Context stringlengths 57 6.04k | file_name stringlengths 21 79 | start int64 14 1.49k | end int64 18 1.5k | theorem stringlengths 25 1.55k | proof stringlengths 5 7.36k | num_lines int64 1 150 | complexity_score float64 2.72 139,370,958,066,637,970,000,000,000,000,000,000,000,000,000,000,000,000,000B | diff_level int64 0 2 | file_diff_level float64 0 2 | theorem_same_file int64 1 32 | rank_file int64 0 2.51k |
|---|---|---|---|---|---|---|---|---|---|---|---|
import Mathlib.Algebra.BigOperators.Group.Finset
import Mathlib.Data.Finset.NatAntidiagonal
import Mathlib.Data.Nat.GCD.Basic
import Mathlib.Init.Data.Nat.Lemmas
import Mathlib.Logic.Function.Iterate
import Mathlib.Tactic.Ring
import Mathlib.Tactic.Zify
#align_import data.nat.fib from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7"
namespace Nat
-- Porting note: Lean cannot find pp_nodot at the time of this port.
-- @[pp_nodot]
def fib (n : β) : β :=
((fun p : β Γ β => (p.snd, p.fst + p.snd))^[n] (0, 1)).fst
#align nat.fib Nat.fib
@[simp]
theorem fib_zero : fib 0 = 0 :=
rfl
#align nat.fib_zero Nat.fib_zero
@[simp]
theorem fib_one : fib 1 = 1 :=
rfl
#align nat.fib_one Nat.fib_one
@[simp]
theorem fib_two : fib 2 = 1 :=
rfl
#align nat.fib_two Nat.fib_two
theorem fib_add_two {n : β} : fib (n + 2) = fib n + fib (n + 1) := by
simp [fib, Function.iterate_succ_apply']
#align nat.fib_add_two Nat.fib_add_two
lemma fib_add_one : β {n}, n β 0 β fib (n + 1) = fib (n - 1) + fib n
| _n + 1, _ => fib_add_two
theorem fib_le_fib_succ {n : β} : fib n β€ fib (n + 1) := by cases n <;> simp [fib_add_two]
#align nat.fib_le_fib_succ Nat.fib_le_fib_succ
@[mono]
theorem fib_mono : Monotone fib :=
monotone_nat_of_le_succ fun _ => fib_le_fib_succ
#align nat.fib_mono Nat.fib_mono
@[simp] lemma fib_eq_zero : β {n}, fib n = 0 β n = 0
| 0 => Iff.rfl
| 1 => Iff.rfl
| n + 2 => by simp [fib_add_two, fib_eq_zero]
@[simp] lemma fib_pos {n : β} : 0 < fib n β 0 < n := by simp [pos_iff_ne_zero]
#align nat.fib_pos Nat.fib_pos
theorem fib_add_two_sub_fib_add_one {n : β} : fib (n + 2) - fib (n + 1) = fib n := by
rw [fib_add_two, add_tsub_cancel_right]
#align nat.fib_add_two_sub_fib_add_one Nat.fib_add_two_sub_fib_add_one
theorem fib_lt_fib_succ {n : β} (hn : 2 β€ n) : fib n < fib (n + 1) := by
rcases exists_add_of_le hn with β¨n, rflβ©
rw [β tsub_pos_iff_lt, add_comm 2, add_right_comm, fib_add_two, add_tsub_cancel_right, fib_pos]
exact succ_pos n
#align nat.fib_lt_fib_succ Nat.fib_lt_fib_succ
theorem fib_add_two_strictMono : StrictMono fun n => fib (n + 2) := by
refine strictMono_nat_of_lt_succ fun n => ?_
rw [add_right_comm]
exact fib_lt_fib_succ (self_le_add_left _ _)
#align nat.fib_add_two_strict_mono Nat.fib_add_two_strictMono
lemma fib_strictMonoOn : StrictMonoOn fib (Set.Ici 2)
| _m + 2, _, _n + 2, _, hmn => fib_add_two_strictMono <| lt_of_add_lt_add_right hmn
lemma fib_lt_fib {m : β} (hm : 2 β€ m) : β {n}, fib m < fib n β m < n
| 0 => by simp [hm]
| 1 => by simp [hm]
| n + 2 => fib_strictMonoOn.lt_iff_lt hm <| by simp
theorem le_fib_self {n : β} (five_le_n : 5 β€ n) : n β€ fib n := by
induction' five_le_n with n five_le_n IH
Β·-- 5 β€ fib 5
rfl
Β· -- n + 1 β€ fib (n + 1) for 5 β€ n
rw [succ_le_iff]
calc
n β€ fib n := IH
_ < fib (n + 1) := fib_lt_fib_succ (le_trans (by decide) five_le_n)
#align nat.le_fib_self Nat.le_fib_self
lemma le_fib_add_one : β n, n β€ fib n + 1
| 0 => zero_le_one
| 1 => one_le_two
| 2 => le_rfl
| 3 => le_rfl
| 4 => le_rfl
| _n + 5 => (le_fib_self le_add_self).trans <| le_succ _
| Mathlib/Data/Nat/Fib/Basic.lean | 156 | 161 | theorem fib_coprime_fib_succ (n : β) : Nat.Coprime (fib n) (fib (n + 1)) := by |
induction' n with n ih
Β· simp
Β· rw [fib_add_two]
simp only [coprime_add_self_right]
simp [Coprime, ih.symm]
| 5 | 148.413159 | 2 | 1.181818 | 11 | 1,246 |
import Mathlib.Algebra.BigOperators.Group.Finset
import Mathlib.Data.Finset.NatAntidiagonal
import Mathlib.Data.Nat.GCD.Basic
import Mathlib.Init.Data.Nat.Lemmas
import Mathlib.Logic.Function.Iterate
import Mathlib.Tactic.Ring
import Mathlib.Tactic.Zify
#align_import data.nat.fib from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7"
namespace Nat
-- Porting note: Lean cannot find pp_nodot at the time of this port.
-- @[pp_nodot]
def fib (n : β) : β :=
((fun p : β Γ β => (p.snd, p.fst + p.snd))^[n] (0, 1)).fst
#align nat.fib Nat.fib
@[simp]
theorem fib_zero : fib 0 = 0 :=
rfl
#align nat.fib_zero Nat.fib_zero
@[simp]
theorem fib_one : fib 1 = 1 :=
rfl
#align nat.fib_one Nat.fib_one
@[simp]
theorem fib_two : fib 2 = 1 :=
rfl
#align nat.fib_two Nat.fib_two
theorem fib_add_two {n : β} : fib (n + 2) = fib n + fib (n + 1) := by
simp [fib, Function.iterate_succ_apply']
#align nat.fib_add_two Nat.fib_add_two
lemma fib_add_one : β {n}, n β 0 β fib (n + 1) = fib (n - 1) + fib n
| _n + 1, _ => fib_add_two
theorem fib_le_fib_succ {n : β} : fib n β€ fib (n + 1) := by cases n <;> simp [fib_add_two]
#align nat.fib_le_fib_succ Nat.fib_le_fib_succ
@[mono]
theorem fib_mono : Monotone fib :=
monotone_nat_of_le_succ fun _ => fib_le_fib_succ
#align nat.fib_mono Nat.fib_mono
@[simp] lemma fib_eq_zero : β {n}, fib n = 0 β n = 0
| 0 => Iff.rfl
| 1 => Iff.rfl
| n + 2 => by simp [fib_add_two, fib_eq_zero]
@[simp] lemma fib_pos {n : β} : 0 < fib n β 0 < n := by simp [pos_iff_ne_zero]
#align nat.fib_pos Nat.fib_pos
theorem fib_add_two_sub_fib_add_one {n : β} : fib (n + 2) - fib (n + 1) = fib n := by
rw [fib_add_two, add_tsub_cancel_right]
#align nat.fib_add_two_sub_fib_add_one Nat.fib_add_two_sub_fib_add_one
theorem fib_lt_fib_succ {n : β} (hn : 2 β€ n) : fib n < fib (n + 1) := by
rcases exists_add_of_le hn with β¨n, rflβ©
rw [β tsub_pos_iff_lt, add_comm 2, add_right_comm, fib_add_two, add_tsub_cancel_right, fib_pos]
exact succ_pos n
#align nat.fib_lt_fib_succ Nat.fib_lt_fib_succ
theorem fib_add_two_strictMono : StrictMono fun n => fib (n + 2) := by
refine strictMono_nat_of_lt_succ fun n => ?_
rw [add_right_comm]
exact fib_lt_fib_succ (self_le_add_left _ _)
#align nat.fib_add_two_strict_mono Nat.fib_add_two_strictMono
lemma fib_strictMonoOn : StrictMonoOn fib (Set.Ici 2)
| _m + 2, _, _n + 2, _, hmn => fib_add_two_strictMono <| lt_of_add_lt_add_right hmn
lemma fib_lt_fib {m : β} (hm : 2 β€ m) : β {n}, fib m < fib n β m < n
| 0 => by simp [hm]
| 1 => by simp [hm]
| n + 2 => fib_strictMonoOn.lt_iff_lt hm <| by simp
theorem le_fib_self {n : β} (five_le_n : 5 β€ n) : n β€ fib n := by
induction' five_le_n with n five_le_n IH
Β·-- 5 β€ fib 5
rfl
Β· -- n + 1 β€ fib (n + 1) for 5 β€ n
rw [succ_le_iff]
calc
n β€ fib n := IH
_ < fib (n + 1) := fib_lt_fib_succ (le_trans (by decide) five_le_n)
#align nat.le_fib_self Nat.le_fib_self
lemma le_fib_add_one : β n, n β€ fib n + 1
| 0 => zero_le_one
| 1 => one_le_two
| 2 => le_rfl
| 3 => le_rfl
| 4 => le_rfl
| _n + 5 => (le_fib_self le_add_self).trans <| le_succ _
theorem fib_coprime_fib_succ (n : β) : Nat.Coprime (fib n) (fib (n + 1)) := by
induction' n with n ih
Β· simp
Β· rw [fib_add_two]
simp only [coprime_add_self_right]
simp [Coprime, ih.symm]
#align nat.fib_coprime_fib_succ Nat.fib_coprime_fib_succ
| Mathlib/Data/Nat/Fib/Basic.lean | 165 | 171 | theorem fib_add (m n : β) : fib (m + n + 1) = fib m * fib n + fib (m + 1) * fib (n + 1) := by |
induction' n with n ih generalizing m
Β· simp
Β· specialize ih (m + 1)
rw [add_assoc m 1 n, add_comm 1 n] at ih
simp only [fib_add_two, succ_eq_add_one, ih]
ring
| 6 | 403.428793 | 2 | 1.181818 | 11 | 1,246 |
import Mathlib.Algebra.BigOperators.Group.Finset
import Mathlib.Data.Finset.NatAntidiagonal
import Mathlib.Data.Nat.GCD.Basic
import Mathlib.Init.Data.Nat.Lemmas
import Mathlib.Logic.Function.Iterate
import Mathlib.Tactic.Ring
import Mathlib.Tactic.Zify
#align_import data.nat.fib from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7"
namespace Nat
-- Porting note: Lean cannot find pp_nodot at the time of this port.
-- @[pp_nodot]
def fib (n : β) : β :=
((fun p : β Γ β => (p.snd, p.fst + p.snd))^[n] (0, 1)).fst
#align nat.fib Nat.fib
@[simp]
theorem fib_zero : fib 0 = 0 :=
rfl
#align nat.fib_zero Nat.fib_zero
@[simp]
theorem fib_one : fib 1 = 1 :=
rfl
#align nat.fib_one Nat.fib_one
@[simp]
theorem fib_two : fib 2 = 1 :=
rfl
#align nat.fib_two Nat.fib_two
theorem fib_add_two {n : β} : fib (n + 2) = fib n + fib (n + 1) := by
simp [fib, Function.iterate_succ_apply']
#align nat.fib_add_two Nat.fib_add_two
lemma fib_add_one : β {n}, n β 0 β fib (n + 1) = fib (n - 1) + fib n
| _n + 1, _ => fib_add_two
theorem fib_le_fib_succ {n : β} : fib n β€ fib (n + 1) := by cases n <;> simp [fib_add_two]
#align nat.fib_le_fib_succ Nat.fib_le_fib_succ
@[mono]
theorem fib_mono : Monotone fib :=
monotone_nat_of_le_succ fun _ => fib_le_fib_succ
#align nat.fib_mono Nat.fib_mono
@[simp] lemma fib_eq_zero : β {n}, fib n = 0 β n = 0
| 0 => Iff.rfl
| 1 => Iff.rfl
| n + 2 => by simp [fib_add_two, fib_eq_zero]
@[simp] lemma fib_pos {n : β} : 0 < fib n β 0 < n := by simp [pos_iff_ne_zero]
#align nat.fib_pos Nat.fib_pos
theorem fib_add_two_sub_fib_add_one {n : β} : fib (n + 2) - fib (n + 1) = fib n := by
rw [fib_add_two, add_tsub_cancel_right]
#align nat.fib_add_two_sub_fib_add_one Nat.fib_add_two_sub_fib_add_one
theorem fib_lt_fib_succ {n : β} (hn : 2 β€ n) : fib n < fib (n + 1) := by
rcases exists_add_of_le hn with β¨n, rflβ©
rw [β tsub_pos_iff_lt, add_comm 2, add_right_comm, fib_add_two, add_tsub_cancel_right, fib_pos]
exact succ_pos n
#align nat.fib_lt_fib_succ Nat.fib_lt_fib_succ
theorem fib_add_two_strictMono : StrictMono fun n => fib (n + 2) := by
refine strictMono_nat_of_lt_succ fun n => ?_
rw [add_right_comm]
exact fib_lt_fib_succ (self_le_add_left _ _)
#align nat.fib_add_two_strict_mono Nat.fib_add_two_strictMono
lemma fib_strictMonoOn : StrictMonoOn fib (Set.Ici 2)
| _m + 2, _, _n + 2, _, hmn => fib_add_two_strictMono <| lt_of_add_lt_add_right hmn
lemma fib_lt_fib {m : β} (hm : 2 β€ m) : β {n}, fib m < fib n β m < n
| 0 => by simp [hm]
| 1 => by simp [hm]
| n + 2 => fib_strictMonoOn.lt_iff_lt hm <| by simp
theorem le_fib_self {n : β} (five_le_n : 5 β€ n) : n β€ fib n := by
induction' five_le_n with n five_le_n IH
Β·-- 5 β€ fib 5
rfl
Β· -- n + 1 β€ fib (n + 1) for 5 β€ n
rw [succ_le_iff]
calc
n β€ fib n := IH
_ < fib (n + 1) := fib_lt_fib_succ (le_trans (by decide) five_le_n)
#align nat.le_fib_self Nat.le_fib_self
lemma le_fib_add_one : β n, n β€ fib n + 1
| 0 => zero_le_one
| 1 => one_le_two
| 2 => le_rfl
| 3 => le_rfl
| 4 => le_rfl
| _n + 5 => (le_fib_self le_add_self).trans <| le_succ _
theorem fib_coprime_fib_succ (n : β) : Nat.Coprime (fib n) (fib (n + 1)) := by
induction' n with n ih
Β· simp
Β· rw [fib_add_two]
simp only [coprime_add_self_right]
simp [Coprime, ih.symm]
#align nat.fib_coprime_fib_succ Nat.fib_coprime_fib_succ
theorem fib_add (m n : β) : fib (m + n + 1) = fib m * fib n + fib (m + 1) * fib (n + 1) := by
induction' n with n ih generalizing m
Β· simp
Β· specialize ih (m + 1)
rw [add_assoc m 1 n, add_comm 1 n] at ih
simp only [fib_add_two, succ_eq_add_one, ih]
ring
#align nat.fib_add Nat.fib_add
| Mathlib/Data/Nat/Fib/Basic.lean | 174 | 179 | theorem fib_two_mul (n : β) : fib (2 * n) = fib n * (2 * fib (n + 1) - fib n) := by |
cases n
Β· simp
Β· rw [two_mul, β add_assoc, fib_add, fib_add_two, two_mul]
simp only [β add_assoc, add_tsub_cancel_right]
ring
| 5 | 148.413159 | 2 | 1.181818 | 11 | 1,246 |
import Mathlib.Algebra.BigOperators.Group.Finset
import Mathlib.Data.Finset.NatAntidiagonal
import Mathlib.Data.Nat.GCD.Basic
import Mathlib.Init.Data.Nat.Lemmas
import Mathlib.Logic.Function.Iterate
import Mathlib.Tactic.Ring
import Mathlib.Tactic.Zify
#align_import data.nat.fib from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7"
namespace Nat
-- Porting note: Lean cannot find pp_nodot at the time of this port.
-- @[pp_nodot]
def fib (n : β) : β :=
((fun p : β Γ β => (p.snd, p.fst + p.snd))^[n] (0, 1)).fst
#align nat.fib Nat.fib
@[simp]
theorem fib_zero : fib 0 = 0 :=
rfl
#align nat.fib_zero Nat.fib_zero
@[simp]
theorem fib_one : fib 1 = 1 :=
rfl
#align nat.fib_one Nat.fib_one
@[simp]
theorem fib_two : fib 2 = 1 :=
rfl
#align nat.fib_two Nat.fib_two
theorem fib_add_two {n : β} : fib (n + 2) = fib n + fib (n + 1) := by
simp [fib, Function.iterate_succ_apply']
#align nat.fib_add_two Nat.fib_add_two
lemma fib_add_one : β {n}, n β 0 β fib (n + 1) = fib (n - 1) + fib n
| _n + 1, _ => fib_add_two
theorem fib_le_fib_succ {n : β} : fib n β€ fib (n + 1) := by cases n <;> simp [fib_add_two]
#align nat.fib_le_fib_succ Nat.fib_le_fib_succ
@[mono]
theorem fib_mono : Monotone fib :=
monotone_nat_of_le_succ fun _ => fib_le_fib_succ
#align nat.fib_mono Nat.fib_mono
@[simp] lemma fib_eq_zero : β {n}, fib n = 0 β n = 0
| 0 => Iff.rfl
| 1 => Iff.rfl
| n + 2 => by simp [fib_add_two, fib_eq_zero]
@[simp] lemma fib_pos {n : β} : 0 < fib n β 0 < n := by simp [pos_iff_ne_zero]
#align nat.fib_pos Nat.fib_pos
theorem fib_add_two_sub_fib_add_one {n : β} : fib (n + 2) - fib (n + 1) = fib n := by
rw [fib_add_two, add_tsub_cancel_right]
#align nat.fib_add_two_sub_fib_add_one Nat.fib_add_two_sub_fib_add_one
theorem fib_lt_fib_succ {n : β} (hn : 2 β€ n) : fib n < fib (n + 1) := by
rcases exists_add_of_le hn with β¨n, rflβ©
rw [β tsub_pos_iff_lt, add_comm 2, add_right_comm, fib_add_two, add_tsub_cancel_right, fib_pos]
exact succ_pos n
#align nat.fib_lt_fib_succ Nat.fib_lt_fib_succ
theorem fib_add_two_strictMono : StrictMono fun n => fib (n + 2) := by
refine strictMono_nat_of_lt_succ fun n => ?_
rw [add_right_comm]
exact fib_lt_fib_succ (self_le_add_left _ _)
#align nat.fib_add_two_strict_mono Nat.fib_add_two_strictMono
lemma fib_strictMonoOn : StrictMonoOn fib (Set.Ici 2)
| _m + 2, _, _n + 2, _, hmn => fib_add_two_strictMono <| lt_of_add_lt_add_right hmn
lemma fib_lt_fib {m : β} (hm : 2 β€ m) : β {n}, fib m < fib n β m < n
| 0 => by simp [hm]
| 1 => by simp [hm]
| n + 2 => fib_strictMonoOn.lt_iff_lt hm <| by simp
theorem le_fib_self {n : β} (five_le_n : 5 β€ n) : n β€ fib n := by
induction' five_le_n with n five_le_n IH
Β·-- 5 β€ fib 5
rfl
Β· -- n + 1 β€ fib (n + 1) for 5 β€ n
rw [succ_le_iff]
calc
n β€ fib n := IH
_ < fib (n + 1) := fib_lt_fib_succ (le_trans (by decide) five_le_n)
#align nat.le_fib_self Nat.le_fib_self
lemma le_fib_add_one : β n, n β€ fib n + 1
| 0 => zero_le_one
| 1 => one_le_two
| 2 => le_rfl
| 3 => le_rfl
| 4 => le_rfl
| _n + 5 => (le_fib_self le_add_self).trans <| le_succ _
theorem fib_coprime_fib_succ (n : β) : Nat.Coprime (fib n) (fib (n + 1)) := by
induction' n with n ih
Β· simp
Β· rw [fib_add_two]
simp only [coprime_add_self_right]
simp [Coprime, ih.symm]
#align nat.fib_coprime_fib_succ Nat.fib_coprime_fib_succ
theorem fib_add (m n : β) : fib (m + n + 1) = fib m * fib n + fib (m + 1) * fib (n + 1) := by
induction' n with n ih generalizing m
Β· simp
Β· specialize ih (m + 1)
rw [add_assoc m 1 n, add_comm 1 n] at ih
simp only [fib_add_two, succ_eq_add_one, ih]
ring
#align nat.fib_add Nat.fib_add
theorem fib_two_mul (n : β) : fib (2 * n) = fib n * (2 * fib (n + 1) - fib n) := by
cases n
Β· simp
Β· rw [two_mul, β add_assoc, fib_add, fib_add_two, two_mul]
simp only [β add_assoc, add_tsub_cancel_right]
ring
#align nat.fib_two_mul Nat.fib_two_mul
| Mathlib/Data/Nat/Fib/Basic.lean | 182 | 184 | theorem fib_two_mul_add_one (n : β) : fib (2 * n + 1) = fib (n + 1) ^ 2 + fib n ^ 2 := by |
rw [two_mul, fib_add]
ring
| 2 | 7.389056 | 1 | 1.181818 | 11 | 1,246 |
import Mathlib.Algebra.BigOperators.Group.Finset
import Mathlib.Data.Finset.NatAntidiagonal
import Mathlib.Data.Nat.GCD.Basic
import Mathlib.Init.Data.Nat.Lemmas
import Mathlib.Logic.Function.Iterate
import Mathlib.Tactic.Ring
import Mathlib.Tactic.Zify
#align_import data.nat.fib from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7"
namespace Nat
-- Porting note: Lean cannot find pp_nodot at the time of this port.
-- @[pp_nodot]
def fib (n : β) : β :=
((fun p : β Γ β => (p.snd, p.fst + p.snd))^[n] (0, 1)).fst
#align nat.fib Nat.fib
@[simp]
theorem fib_zero : fib 0 = 0 :=
rfl
#align nat.fib_zero Nat.fib_zero
@[simp]
theorem fib_one : fib 1 = 1 :=
rfl
#align nat.fib_one Nat.fib_one
@[simp]
theorem fib_two : fib 2 = 1 :=
rfl
#align nat.fib_two Nat.fib_two
theorem fib_add_two {n : β} : fib (n + 2) = fib n + fib (n + 1) := by
simp [fib, Function.iterate_succ_apply']
#align nat.fib_add_two Nat.fib_add_two
lemma fib_add_one : β {n}, n β 0 β fib (n + 1) = fib (n - 1) + fib n
| _n + 1, _ => fib_add_two
theorem fib_le_fib_succ {n : β} : fib n β€ fib (n + 1) := by cases n <;> simp [fib_add_two]
#align nat.fib_le_fib_succ Nat.fib_le_fib_succ
@[mono]
theorem fib_mono : Monotone fib :=
monotone_nat_of_le_succ fun _ => fib_le_fib_succ
#align nat.fib_mono Nat.fib_mono
@[simp] lemma fib_eq_zero : β {n}, fib n = 0 β n = 0
| 0 => Iff.rfl
| 1 => Iff.rfl
| n + 2 => by simp [fib_add_two, fib_eq_zero]
@[simp] lemma fib_pos {n : β} : 0 < fib n β 0 < n := by simp [pos_iff_ne_zero]
#align nat.fib_pos Nat.fib_pos
theorem fib_add_two_sub_fib_add_one {n : β} : fib (n + 2) - fib (n + 1) = fib n := by
rw [fib_add_two, add_tsub_cancel_right]
#align nat.fib_add_two_sub_fib_add_one Nat.fib_add_two_sub_fib_add_one
theorem fib_lt_fib_succ {n : β} (hn : 2 β€ n) : fib n < fib (n + 1) := by
rcases exists_add_of_le hn with β¨n, rflβ©
rw [β tsub_pos_iff_lt, add_comm 2, add_right_comm, fib_add_two, add_tsub_cancel_right, fib_pos]
exact succ_pos n
#align nat.fib_lt_fib_succ Nat.fib_lt_fib_succ
theorem fib_add_two_strictMono : StrictMono fun n => fib (n + 2) := by
refine strictMono_nat_of_lt_succ fun n => ?_
rw [add_right_comm]
exact fib_lt_fib_succ (self_le_add_left _ _)
#align nat.fib_add_two_strict_mono Nat.fib_add_two_strictMono
lemma fib_strictMonoOn : StrictMonoOn fib (Set.Ici 2)
| _m + 2, _, _n + 2, _, hmn => fib_add_two_strictMono <| lt_of_add_lt_add_right hmn
lemma fib_lt_fib {m : β} (hm : 2 β€ m) : β {n}, fib m < fib n β m < n
| 0 => by simp [hm]
| 1 => by simp [hm]
| n + 2 => fib_strictMonoOn.lt_iff_lt hm <| by simp
theorem le_fib_self {n : β} (five_le_n : 5 β€ n) : n β€ fib n := by
induction' five_le_n with n five_le_n IH
Β·-- 5 β€ fib 5
rfl
Β· -- n + 1 β€ fib (n + 1) for 5 β€ n
rw [succ_le_iff]
calc
n β€ fib n := IH
_ < fib (n + 1) := fib_lt_fib_succ (le_trans (by decide) five_le_n)
#align nat.le_fib_self Nat.le_fib_self
lemma le_fib_add_one : β n, n β€ fib n + 1
| 0 => zero_le_one
| 1 => one_le_two
| 2 => le_rfl
| 3 => le_rfl
| 4 => le_rfl
| _n + 5 => (le_fib_self le_add_self).trans <| le_succ _
theorem fib_coprime_fib_succ (n : β) : Nat.Coprime (fib n) (fib (n + 1)) := by
induction' n with n ih
Β· simp
Β· rw [fib_add_two]
simp only [coprime_add_self_right]
simp [Coprime, ih.symm]
#align nat.fib_coprime_fib_succ Nat.fib_coprime_fib_succ
theorem fib_add (m n : β) : fib (m + n + 1) = fib m * fib n + fib (m + 1) * fib (n + 1) := by
induction' n with n ih generalizing m
Β· simp
Β· specialize ih (m + 1)
rw [add_assoc m 1 n, add_comm 1 n] at ih
simp only [fib_add_two, succ_eq_add_one, ih]
ring
#align nat.fib_add Nat.fib_add
theorem fib_two_mul (n : β) : fib (2 * n) = fib n * (2 * fib (n + 1) - fib n) := by
cases n
Β· simp
Β· rw [two_mul, β add_assoc, fib_add, fib_add_two, two_mul]
simp only [β add_assoc, add_tsub_cancel_right]
ring
#align nat.fib_two_mul Nat.fib_two_mul
theorem fib_two_mul_add_one (n : β) : fib (2 * n + 1) = fib (n + 1) ^ 2 + fib n ^ 2 := by
rw [two_mul, fib_add]
ring
#align nat.fib_two_mul_add_one Nat.fib_two_mul_add_one
| Mathlib/Data/Nat/Fib/Basic.lean | 187 | 194 | theorem fib_two_mul_add_two (n : β) :
fib (2 * n + 2) = fib (n + 1) * (2 * fib n + fib (n + 1)) := by |
rw [fib_add_two, fib_two_mul, fib_two_mul_add_one]
-- Porting note: A bunch of issues similar to [this zulip thread](https://github.com/leanprover-community/mathlib4/pull/1576) with `zify`
have : fib n β€ 2 * fib (n + 1) :=
le_trans fib_le_fib_succ (mul_comm 2 _ βΈ Nat.le_mul_of_pos_right _ two_pos)
zify [this]
ring
| 6 | 403.428793 | 2 | 1.181818 | 11 | 1,246 |
import Mathlib.Algebra.CharP.Invertible
import Mathlib.Algebra.MvPolynomial.Variables
import Mathlib.Algebra.MvPolynomial.CommRing
import Mathlib.Algebra.MvPolynomial.Expand
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Data.ZMod.Basic
#align_import ring_theory.witt_vector.witt_polynomial from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395"
open MvPolynomial
open Finset hiding map
open Finsupp (single)
--attribute [-simp] coe_evalβ_hom
variable (p : β)
variable (R : Type*) [CommRing R] [DecidableEq R]
noncomputable def wittPolynomial (n : β) : MvPolynomial β R :=
β i β range (n + 1), monomial (single i (p ^ (n - i))) ((p : R) ^ i)
#align witt_polynomial wittPolynomial
| Mathlib/RingTheory/WittVector/WittPolynomial.lean | 81 | 86 | theorem wittPolynomial_eq_sum_C_mul_X_pow (n : β) :
wittPolynomial p R n = β i β range (n + 1), C ((p : R) ^ i) * X i ^ p ^ (n - i) := by |
apply sum_congr rfl
rintro i -
rw [monomial_eq, Finsupp.prod_single_index]
rw [pow_zero]
| 4 | 54.59815 | 2 | 1.181818 | 11 | 1,247 |
import Mathlib.Algebra.CharP.Invertible
import Mathlib.Algebra.MvPolynomial.Variables
import Mathlib.Algebra.MvPolynomial.CommRing
import Mathlib.Algebra.MvPolynomial.Expand
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Data.ZMod.Basic
#align_import ring_theory.witt_vector.witt_polynomial from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395"
open MvPolynomial
open Finset hiding map
open Finsupp (single)
--attribute [-simp] coe_evalβ_hom
variable (p : β)
variable (R : Type*) [CommRing R] [DecidableEq R]
noncomputable def wittPolynomial (n : β) : MvPolynomial β R :=
β i β range (n + 1), monomial (single i (p ^ (n - i))) ((p : R) ^ i)
#align witt_polynomial wittPolynomial
theorem wittPolynomial_eq_sum_C_mul_X_pow (n : β) :
wittPolynomial p R n = β i β range (n + 1), C ((p : R) ^ i) * X i ^ p ^ (n - i) := by
apply sum_congr rfl
rintro i -
rw [monomial_eq, Finsupp.prod_single_index]
rw [pow_zero]
set_option linter.uppercaseLean3 false in
#align witt_polynomial_eq_sum_C_mul_X_pow wittPolynomial_eq_sum_C_mul_X_pow
-- Notation with ring of coefficients explicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W_" => wittPolynomial p
-- Notation with ring of coefficients implicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W" => wittPolynomial p _
open Witt
open MvPolynomial
section
variable {R} {S : Type*} [CommRing S]
@[simp]
| Mathlib/RingTheory/WittVector/WittPolynomial.lean | 116 | 119 | theorem map_wittPolynomial (f : R β+* S) (n : β) : map f (W n) = W n := by |
rw [wittPolynomial, map_sum, wittPolynomial]
refine sum_congr rfl fun i _ => ?_
rw [map_monomial, RingHom.map_pow, map_natCast]
| 3 | 20.085537 | 1 | 1.181818 | 11 | 1,247 |
import Mathlib.Algebra.CharP.Invertible
import Mathlib.Algebra.MvPolynomial.Variables
import Mathlib.Algebra.MvPolynomial.CommRing
import Mathlib.Algebra.MvPolynomial.Expand
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Data.ZMod.Basic
#align_import ring_theory.witt_vector.witt_polynomial from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395"
open MvPolynomial
open Finset hiding map
open Finsupp (single)
--attribute [-simp] coe_evalβ_hom
variable (p : β)
variable (R : Type*) [CommRing R] [DecidableEq R]
noncomputable def wittPolynomial (n : β) : MvPolynomial β R :=
β i β range (n + 1), monomial (single i (p ^ (n - i))) ((p : R) ^ i)
#align witt_polynomial wittPolynomial
theorem wittPolynomial_eq_sum_C_mul_X_pow (n : β) :
wittPolynomial p R n = β i β range (n + 1), C ((p : R) ^ i) * X i ^ p ^ (n - i) := by
apply sum_congr rfl
rintro i -
rw [monomial_eq, Finsupp.prod_single_index]
rw [pow_zero]
set_option linter.uppercaseLean3 false in
#align witt_polynomial_eq_sum_C_mul_X_pow wittPolynomial_eq_sum_C_mul_X_pow
-- Notation with ring of coefficients explicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W_" => wittPolynomial p
-- Notation with ring of coefficients implicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W" => wittPolynomial p _
open Witt
open MvPolynomial
section
variable {R} {S : Type*} [CommRing S]
@[simp]
theorem map_wittPolynomial (f : R β+* S) (n : β) : map f (W n) = W n := by
rw [wittPolynomial, map_sum, wittPolynomial]
refine sum_congr rfl fun i _ => ?_
rw [map_monomial, RingHom.map_pow, map_natCast]
#align map_witt_polynomial map_wittPolynomial
variable (R)
@[simp]
| Mathlib/RingTheory/WittVector/WittPolynomial.lean | 125 | 132 | theorem constantCoeff_wittPolynomial [hp : Fact p.Prime] (n : β) :
constantCoeff (wittPolynomial p R n) = 0 := by |
simp only [wittPolynomial, map_sum, constantCoeff_monomial]
rw [sum_eq_zero]
rintro i _
rw [if_neg]
rw [Finsupp.single_eq_zero]
exact ne_of_gt (pow_pos hp.1.pos _)
| 6 | 403.428793 | 2 | 1.181818 | 11 | 1,247 |
import Mathlib.Algebra.CharP.Invertible
import Mathlib.Algebra.MvPolynomial.Variables
import Mathlib.Algebra.MvPolynomial.CommRing
import Mathlib.Algebra.MvPolynomial.Expand
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Data.ZMod.Basic
#align_import ring_theory.witt_vector.witt_polynomial from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395"
open MvPolynomial
open Finset hiding map
open Finsupp (single)
--attribute [-simp] coe_evalβ_hom
variable (p : β)
variable (R : Type*) [CommRing R] [DecidableEq R]
noncomputable def wittPolynomial (n : β) : MvPolynomial β R :=
β i β range (n + 1), monomial (single i (p ^ (n - i))) ((p : R) ^ i)
#align witt_polynomial wittPolynomial
theorem wittPolynomial_eq_sum_C_mul_X_pow (n : β) :
wittPolynomial p R n = β i β range (n + 1), C ((p : R) ^ i) * X i ^ p ^ (n - i) := by
apply sum_congr rfl
rintro i -
rw [monomial_eq, Finsupp.prod_single_index]
rw [pow_zero]
set_option linter.uppercaseLean3 false in
#align witt_polynomial_eq_sum_C_mul_X_pow wittPolynomial_eq_sum_C_mul_X_pow
-- Notation with ring of coefficients explicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W_" => wittPolynomial p
-- Notation with ring of coefficients implicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W" => wittPolynomial p _
open Witt
open MvPolynomial
section
variable {R} {S : Type*} [CommRing S]
@[simp]
theorem map_wittPolynomial (f : R β+* S) (n : β) : map f (W n) = W n := by
rw [wittPolynomial, map_sum, wittPolynomial]
refine sum_congr rfl fun i _ => ?_
rw [map_monomial, RingHom.map_pow, map_natCast]
#align map_witt_polynomial map_wittPolynomial
variable (R)
@[simp]
theorem constantCoeff_wittPolynomial [hp : Fact p.Prime] (n : β) :
constantCoeff (wittPolynomial p R n) = 0 := by
simp only [wittPolynomial, map_sum, constantCoeff_monomial]
rw [sum_eq_zero]
rintro i _
rw [if_neg]
rw [Finsupp.single_eq_zero]
exact ne_of_gt (pow_pos hp.1.pos _)
#align constant_coeff_witt_polynomial constantCoeff_wittPolynomial
@[simp]
| Mathlib/RingTheory/WittVector/WittPolynomial.lean | 136 | 137 | theorem wittPolynomial_zero : wittPolynomial p R 0 = X 0 := by |
simp only [wittPolynomial, X, sum_singleton, range_one, pow_zero, zero_add, tsub_self]
| 1 | 2.718282 | 0 | 1.181818 | 11 | 1,247 |
import Mathlib.Algebra.CharP.Invertible
import Mathlib.Algebra.MvPolynomial.Variables
import Mathlib.Algebra.MvPolynomial.CommRing
import Mathlib.Algebra.MvPolynomial.Expand
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Data.ZMod.Basic
#align_import ring_theory.witt_vector.witt_polynomial from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395"
open MvPolynomial
open Finset hiding map
open Finsupp (single)
--attribute [-simp] coe_evalβ_hom
variable (p : β)
variable (R : Type*) [CommRing R] [DecidableEq R]
noncomputable def wittPolynomial (n : β) : MvPolynomial β R :=
β i β range (n + 1), monomial (single i (p ^ (n - i))) ((p : R) ^ i)
#align witt_polynomial wittPolynomial
theorem wittPolynomial_eq_sum_C_mul_X_pow (n : β) :
wittPolynomial p R n = β i β range (n + 1), C ((p : R) ^ i) * X i ^ p ^ (n - i) := by
apply sum_congr rfl
rintro i -
rw [monomial_eq, Finsupp.prod_single_index]
rw [pow_zero]
set_option linter.uppercaseLean3 false in
#align witt_polynomial_eq_sum_C_mul_X_pow wittPolynomial_eq_sum_C_mul_X_pow
-- Notation with ring of coefficients explicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W_" => wittPolynomial p
-- Notation with ring of coefficients implicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W" => wittPolynomial p _
open Witt
open MvPolynomial
section
variable {R} {S : Type*} [CommRing S]
@[simp]
theorem map_wittPolynomial (f : R β+* S) (n : β) : map f (W n) = W n := by
rw [wittPolynomial, map_sum, wittPolynomial]
refine sum_congr rfl fun i _ => ?_
rw [map_monomial, RingHom.map_pow, map_natCast]
#align map_witt_polynomial map_wittPolynomial
variable (R)
@[simp]
theorem constantCoeff_wittPolynomial [hp : Fact p.Prime] (n : β) :
constantCoeff (wittPolynomial p R n) = 0 := by
simp only [wittPolynomial, map_sum, constantCoeff_monomial]
rw [sum_eq_zero]
rintro i _
rw [if_neg]
rw [Finsupp.single_eq_zero]
exact ne_of_gt (pow_pos hp.1.pos _)
#align constant_coeff_witt_polynomial constantCoeff_wittPolynomial
@[simp]
theorem wittPolynomial_zero : wittPolynomial p R 0 = X 0 := by
simp only [wittPolynomial, X, sum_singleton, range_one, pow_zero, zero_add, tsub_self]
#align witt_polynomial_zero wittPolynomial_zero
@[simp]
| Mathlib/RingTheory/WittVector/WittPolynomial.lean | 141 | 143 | theorem wittPolynomial_one : wittPolynomial p R 1 = C (p : R) * X 1 + X 0 ^ p := by |
simp only [wittPolynomial_eq_sum_C_mul_X_pow, sum_range_succ_comm, range_one, sum_singleton,
one_mul, pow_one, C_1, pow_zero, tsub_self, tsub_zero]
| 2 | 7.389056 | 1 | 1.181818 | 11 | 1,247 |
import Mathlib.Algebra.CharP.Invertible
import Mathlib.Algebra.MvPolynomial.Variables
import Mathlib.Algebra.MvPolynomial.CommRing
import Mathlib.Algebra.MvPolynomial.Expand
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Data.ZMod.Basic
#align_import ring_theory.witt_vector.witt_polynomial from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395"
open MvPolynomial
open Finset hiding map
open Finsupp (single)
--attribute [-simp] coe_evalβ_hom
variable (p : β)
variable (R : Type*) [CommRing R] [DecidableEq R]
noncomputable def wittPolynomial (n : β) : MvPolynomial β R :=
β i β range (n + 1), monomial (single i (p ^ (n - i))) ((p : R) ^ i)
#align witt_polynomial wittPolynomial
theorem wittPolynomial_eq_sum_C_mul_X_pow (n : β) :
wittPolynomial p R n = β i β range (n + 1), C ((p : R) ^ i) * X i ^ p ^ (n - i) := by
apply sum_congr rfl
rintro i -
rw [monomial_eq, Finsupp.prod_single_index]
rw [pow_zero]
set_option linter.uppercaseLean3 false in
#align witt_polynomial_eq_sum_C_mul_X_pow wittPolynomial_eq_sum_C_mul_X_pow
-- Notation with ring of coefficients explicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W_" => wittPolynomial p
-- Notation with ring of coefficients implicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W" => wittPolynomial p _
open Witt
open MvPolynomial
section
variable {R} {S : Type*} [CommRing S]
@[simp]
theorem map_wittPolynomial (f : R β+* S) (n : β) : map f (W n) = W n := by
rw [wittPolynomial, map_sum, wittPolynomial]
refine sum_congr rfl fun i _ => ?_
rw [map_monomial, RingHom.map_pow, map_natCast]
#align map_witt_polynomial map_wittPolynomial
variable (R)
@[simp]
theorem constantCoeff_wittPolynomial [hp : Fact p.Prime] (n : β) :
constantCoeff (wittPolynomial p R n) = 0 := by
simp only [wittPolynomial, map_sum, constantCoeff_monomial]
rw [sum_eq_zero]
rintro i _
rw [if_neg]
rw [Finsupp.single_eq_zero]
exact ne_of_gt (pow_pos hp.1.pos _)
#align constant_coeff_witt_polynomial constantCoeff_wittPolynomial
@[simp]
theorem wittPolynomial_zero : wittPolynomial p R 0 = X 0 := by
simp only [wittPolynomial, X, sum_singleton, range_one, pow_zero, zero_add, tsub_self]
#align witt_polynomial_zero wittPolynomial_zero
@[simp]
theorem wittPolynomial_one : wittPolynomial p R 1 = C (p : R) * X 1 + X 0 ^ p := by
simp only [wittPolynomial_eq_sum_C_mul_X_pow, sum_range_succ_comm, range_one, sum_singleton,
one_mul, pow_one, C_1, pow_zero, tsub_self, tsub_zero]
#align witt_polynomial_one wittPolynomial_one
| Mathlib/RingTheory/WittVector/WittPolynomial.lean | 146 | 148 | theorem aeval_wittPolynomial {A : Type*} [CommRing A] [Algebra R A] (f : β β A) (n : β) :
aeval f (W_ R n) = β i β range (n + 1), (p : A) ^ i * f i ^ p ^ (n - i) := by |
simp [wittPolynomial, AlgHom.map_sum, aeval_monomial, Finsupp.prod_single_index]
| 1 | 2.718282 | 0 | 1.181818 | 11 | 1,247 |
import Mathlib.Algebra.CharP.Invertible
import Mathlib.Algebra.MvPolynomial.Variables
import Mathlib.Algebra.MvPolynomial.CommRing
import Mathlib.Algebra.MvPolynomial.Expand
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Data.ZMod.Basic
#align_import ring_theory.witt_vector.witt_polynomial from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395"
open MvPolynomial
open Finset hiding map
open Finsupp (single)
--attribute [-simp] coe_evalβ_hom
variable (p : β)
variable (R : Type*) [CommRing R] [DecidableEq R]
noncomputable def wittPolynomial (n : β) : MvPolynomial β R :=
β i β range (n + 1), monomial (single i (p ^ (n - i))) ((p : R) ^ i)
#align witt_polynomial wittPolynomial
theorem wittPolynomial_eq_sum_C_mul_X_pow (n : β) :
wittPolynomial p R n = β i β range (n + 1), C ((p : R) ^ i) * X i ^ p ^ (n - i) := by
apply sum_congr rfl
rintro i -
rw [monomial_eq, Finsupp.prod_single_index]
rw [pow_zero]
set_option linter.uppercaseLean3 false in
#align witt_polynomial_eq_sum_C_mul_X_pow wittPolynomial_eq_sum_C_mul_X_pow
-- Notation with ring of coefficients explicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W_" => wittPolynomial p
-- Notation with ring of coefficients implicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W" => wittPolynomial p _
open Witt
open MvPolynomial
section
variable {R} {S : Type*} [CommRing S]
@[simp]
theorem map_wittPolynomial (f : R β+* S) (n : β) : map f (W n) = W n := by
rw [wittPolynomial, map_sum, wittPolynomial]
refine sum_congr rfl fun i _ => ?_
rw [map_monomial, RingHom.map_pow, map_natCast]
#align map_witt_polynomial map_wittPolynomial
variable (R)
@[simp]
theorem constantCoeff_wittPolynomial [hp : Fact p.Prime] (n : β) :
constantCoeff (wittPolynomial p R n) = 0 := by
simp only [wittPolynomial, map_sum, constantCoeff_monomial]
rw [sum_eq_zero]
rintro i _
rw [if_neg]
rw [Finsupp.single_eq_zero]
exact ne_of_gt (pow_pos hp.1.pos _)
#align constant_coeff_witt_polynomial constantCoeff_wittPolynomial
@[simp]
theorem wittPolynomial_zero : wittPolynomial p R 0 = X 0 := by
simp only [wittPolynomial, X, sum_singleton, range_one, pow_zero, zero_add, tsub_self]
#align witt_polynomial_zero wittPolynomial_zero
@[simp]
theorem wittPolynomial_one : wittPolynomial p R 1 = C (p : R) * X 1 + X 0 ^ p := by
simp only [wittPolynomial_eq_sum_C_mul_X_pow, sum_range_succ_comm, range_one, sum_singleton,
one_mul, pow_one, C_1, pow_zero, tsub_self, tsub_zero]
#align witt_polynomial_one wittPolynomial_one
theorem aeval_wittPolynomial {A : Type*} [CommRing A] [Algebra R A] (f : β β A) (n : β) :
aeval f (W_ R n) = β i β range (n + 1), (p : A) ^ i * f i ^ p ^ (n - i) := by
simp [wittPolynomial, AlgHom.map_sum, aeval_monomial, Finsupp.prod_single_index]
#align aeval_witt_polynomial aeval_wittPolynomial
@[simp]
| Mathlib/RingTheory/WittVector/WittPolynomial.lean | 154 | 163 | theorem wittPolynomial_zmod_self (n : β) :
W_ (ZMod (p ^ (n + 1))) (n + 1) = expand p (W_ (ZMod (p ^ (n + 1))) n) := by |
simp only [wittPolynomial_eq_sum_C_mul_X_pow]
rw [sum_range_succ, β Nat.cast_pow, CharP.cast_eq_zero (ZMod (p ^ (n + 1))) (p ^ (n + 1)), C_0,
zero_mul, add_zero, AlgHom.map_sum, sum_congr rfl]
intro k hk
rw [AlgHom.map_mul, AlgHom.map_pow, expand_X, algHom_C, β pow_mul, β pow_succ']
congr
rw [mem_range] at hk
rw [add_comm, add_tsub_assoc_of_le (Nat.lt_succ_iff.mp hk), β add_comm]
| 8 | 2,980.957987 | 2 | 1.181818 | 11 | 1,247 |
import Mathlib.Algebra.CharP.Invertible
import Mathlib.Algebra.MvPolynomial.Variables
import Mathlib.Algebra.MvPolynomial.CommRing
import Mathlib.Algebra.MvPolynomial.Expand
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Data.ZMod.Basic
#align_import ring_theory.witt_vector.witt_polynomial from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395"
open MvPolynomial
open Finset hiding map
open Finsupp (single)
--attribute [-simp] coe_evalβ_hom
variable (p : β)
variable (R : Type*) [CommRing R] [DecidableEq R]
noncomputable def wittPolynomial (n : β) : MvPolynomial β R :=
β i β range (n + 1), monomial (single i (p ^ (n - i))) ((p : R) ^ i)
#align witt_polynomial wittPolynomial
theorem wittPolynomial_eq_sum_C_mul_X_pow (n : β) :
wittPolynomial p R n = β i β range (n + 1), C ((p : R) ^ i) * X i ^ p ^ (n - i) := by
apply sum_congr rfl
rintro i -
rw [monomial_eq, Finsupp.prod_single_index]
rw [pow_zero]
set_option linter.uppercaseLean3 false in
#align witt_polynomial_eq_sum_C_mul_X_pow wittPolynomial_eq_sum_C_mul_X_pow
-- Notation with ring of coefficients explicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W_" => wittPolynomial p
-- Notation with ring of coefficients implicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W" => wittPolynomial p _
open Witt
open MvPolynomial
section
variable {R} {S : Type*} [CommRing S]
@[simp]
theorem map_wittPolynomial (f : R β+* S) (n : β) : map f (W n) = W n := by
rw [wittPolynomial, map_sum, wittPolynomial]
refine sum_congr rfl fun i _ => ?_
rw [map_monomial, RingHom.map_pow, map_natCast]
#align map_witt_polynomial map_wittPolynomial
variable (R)
@[simp]
theorem constantCoeff_wittPolynomial [hp : Fact p.Prime] (n : β) :
constantCoeff (wittPolynomial p R n) = 0 := by
simp only [wittPolynomial, map_sum, constantCoeff_monomial]
rw [sum_eq_zero]
rintro i _
rw [if_neg]
rw [Finsupp.single_eq_zero]
exact ne_of_gt (pow_pos hp.1.pos _)
#align constant_coeff_witt_polynomial constantCoeff_wittPolynomial
@[simp]
theorem wittPolynomial_zero : wittPolynomial p R 0 = X 0 := by
simp only [wittPolynomial, X, sum_singleton, range_one, pow_zero, zero_add, tsub_self]
#align witt_polynomial_zero wittPolynomial_zero
@[simp]
theorem wittPolynomial_one : wittPolynomial p R 1 = C (p : R) * X 1 + X 0 ^ p := by
simp only [wittPolynomial_eq_sum_C_mul_X_pow, sum_range_succ_comm, range_one, sum_singleton,
one_mul, pow_one, C_1, pow_zero, tsub_self, tsub_zero]
#align witt_polynomial_one wittPolynomial_one
theorem aeval_wittPolynomial {A : Type*} [CommRing A] [Algebra R A] (f : β β A) (n : β) :
aeval f (W_ R n) = β i β range (n + 1), (p : A) ^ i * f i ^ p ^ (n - i) := by
simp [wittPolynomial, AlgHom.map_sum, aeval_monomial, Finsupp.prod_single_index]
#align aeval_witt_polynomial aeval_wittPolynomial
@[simp]
theorem wittPolynomial_zmod_self (n : β) :
W_ (ZMod (p ^ (n + 1))) (n + 1) = expand p (W_ (ZMod (p ^ (n + 1))) n) := by
simp only [wittPolynomial_eq_sum_C_mul_X_pow]
rw [sum_range_succ, β Nat.cast_pow, CharP.cast_eq_zero (ZMod (p ^ (n + 1))) (p ^ (n + 1)), C_0,
zero_mul, add_zero, AlgHom.map_sum, sum_congr rfl]
intro k hk
rw [AlgHom.map_mul, AlgHom.map_pow, expand_X, algHom_C, β pow_mul, β pow_succ']
congr
rw [mem_range] at hk
rw [add_comm, add_tsub_assoc_of_le (Nat.lt_succ_iff.mp hk), β add_comm]
#align witt_polynomial_zmod_self wittPolynomial_zmod_self
section PPrime
variable [hp : NeZero p]
| Mathlib/RingTheory/WittVector/WittPolynomial.lean | 170 | 181 | theorem wittPolynomial_vars [CharZero R] (n : β) : (wittPolynomial p R n).vars = range (n + 1) := by |
have : β i, (monomial (Finsupp.single i (p ^ (n - i))) ((p : R) ^ i)).vars = {i} := by
intro i
refine vars_monomial_single i (pow_ne_zero _ hp.1) ?_
rw [β Nat.cast_pow, Nat.cast_ne_zero]
exact pow_ne_zero i hp.1
rw [wittPolynomial, vars_sum_of_disjoint]
Β· simp only [this, biUnion_singleton_eq_self]
Β· simp only [this]
intro a b h
apply disjoint_singleton_left.mpr
rwa [mem_singleton]
| 11 | 59,874.141715 | 2 | 1.181818 | 11 | 1,247 |
import Mathlib.Algebra.CharP.Invertible
import Mathlib.Algebra.MvPolynomial.Variables
import Mathlib.Algebra.MvPolynomial.CommRing
import Mathlib.Algebra.MvPolynomial.Expand
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Data.ZMod.Basic
#align_import ring_theory.witt_vector.witt_polynomial from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395"
open MvPolynomial
open Finset hiding map
open Finsupp (single)
--attribute [-simp] coe_evalβ_hom
variable (p : β)
variable (R : Type*) [CommRing R] [DecidableEq R]
noncomputable def wittPolynomial (n : β) : MvPolynomial β R :=
β i β range (n + 1), monomial (single i (p ^ (n - i))) ((p : R) ^ i)
#align witt_polynomial wittPolynomial
theorem wittPolynomial_eq_sum_C_mul_X_pow (n : β) :
wittPolynomial p R n = β i β range (n + 1), C ((p : R) ^ i) * X i ^ p ^ (n - i) := by
apply sum_congr rfl
rintro i -
rw [monomial_eq, Finsupp.prod_single_index]
rw [pow_zero]
set_option linter.uppercaseLean3 false in
#align witt_polynomial_eq_sum_C_mul_X_pow wittPolynomial_eq_sum_C_mul_X_pow
-- Notation with ring of coefficients explicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W_" => wittPolynomial p
-- Notation with ring of coefficients implicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W" => wittPolynomial p _
open Witt
open MvPolynomial
section
variable {R} {S : Type*} [CommRing S]
@[simp]
theorem map_wittPolynomial (f : R β+* S) (n : β) : map f (W n) = W n := by
rw [wittPolynomial, map_sum, wittPolynomial]
refine sum_congr rfl fun i _ => ?_
rw [map_monomial, RingHom.map_pow, map_natCast]
#align map_witt_polynomial map_wittPolynomial
variable (R)
@[simp]
theorem constantCoeff_wittPolynomial [hp : Fact p.Prime] (n : β) :
constantCoeff (wittPolynomial p R n) = 0 := by
simp only [wittPolynomial, map_sum, constantCoeff_monomial]
rw [sum_eq_zero]
rintro i _
rw [if_neg]
rw [Finsupp.single_eq_zero]
exact ne_of_gt (pow_pos hp.1.pos _)
#align constant_coeff_witt_polynomial constantCoeff_wittPolynomial
@[simp]
theorem wittPolynomial_zero : wittPolynomial p R 0 = X 0 := by
simp only [wittPolynomial, X, sum_singleton, range_one, pow_zero, zero_add, tsub_self]
#align witt_polynomial_zero wittPolynomial_zero
@[simp]
theorem wittPolynomial_one : wittPolynomial p R 1 = C (p : R) * X 1 + X 0 ^ p := by
simp only [wittPolynomial_eq_sum_C_mul_X_pow, sum_range_succ_comm, range_one, sum_singleton,
one_mul, pow_one, C_1, pow_zero, tsub_self, tsub_zero]
#align witt_polynomial_one wittPolynomial_one
theorem aeval_wittPolynomial {A : Type*} [CommRing A] [Algebra R A] (f : β β A) (n : β) :
aeval f (W_ R n) = β i β range (n + 1), (p : A) ^ i * f i ^ p ^ (n - i) := by
simp [wittPolynomial, AlgHom.map_sum, aeval_monomial, Finsupp.prod_single_index]
#align aeval_witt_polynomial aeval_wittPolynomial
@[simp]
theorem wittPolynomial_zmod_self (n : β) :
W_ (ZMod (p ^ (n + 1))) (n + 1) = expand p (W_ (ZMod (p ^ (n + 1))) n) := by
simp only [wittPolynomial_eq_sum_C_mul_X_pow]
rw [sum_range_succ, β Nat.cast_pow, CharP.cast_eq_zero (ZMod (p ^ (n + 1))) (p ^ (n + 1)), C_0,
zero_mul, add_zero, AlgHom.map_sum, sum_congr rfl]
intro k hk
rw [AlgHom.map_mul, AlgHom.map_pow, expand_X, algHom_C, β pow_mul, β pow_succ']
congr
rw [mem_range] at hk
rw [add_comm, add_tsub_assoc_of_le (Nat.lt_succ_iff.mp hk), β add_comm]
#align witt_polynomial_zmod_self wittPolynomial_zmod_self
section PPrime
variable [hp : NeZero p]
theorem wittPolynomial_vars [CharZero R] (n : β) : (wittPolynomial p R n).vars = range (n + 1) := by
have : β i, (monomial (Finsupp.single i (p ^ (n - i))) ((p : R) ^ i)).vars = {i} := by
intro i
refine vars_monomial_single i (pow_ne_zero _ hp.1) ?_
rw [β Nat.cast_pow, Nat.cast_ne_zero]
exact pow_ne_zero i hp.1
rw [wittPolynomial, vars_sum_of_disjoint]
Β· simp only [this, biUnion_singleton_eq_self]
Β· simp only [this]
intro a b h
apply disjoint_singleton_left.mpr
rwa [mem_singleton]
#align witt_polynomial_vars wittPolynomial_vars
| Mathlib/RingTheory/WittVector/WittPolynomial.lean | 184 | 186 | theorem wittPolynomial_vars_subset (n : β) : (wittPolynomial p R n).vars β range (n + 1) := by |
rw [β map_wittPolynomial p (Int.castRingHom R), β wittPolynomial_vars p β€]
apply vars_map
| 2 | 7.389056 | 1 | 1.181818 | 11 | 1,247 |
import Mathlib.Algebra.CharP.Invertible
import Mathlib.Algebra.MvPolynomial.Variables
import Mathlib.Algebra.MvPolynomial.CommRing
import Mathlib.Algebra.MvPolynomial.Expand
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Data.ZMod.Basic
#align_import ring_theory.witt_vector.witt_polynomial from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395"
open MvPolynomial
open Finset hiding map
open Finsupp (single)
--attribute [-simp] coe_evalβ_hom
variable (p : β)
variable (R : Type*) [CommRing R] [DecidableEq R]
noncomputable def wittPolynomial (n : β) : MvPolynomial β R :=
β i β range (n + 1), monomial (single i (p ^ (n - i))) ((p : R) ^ i)
#align witt_polynomial wittPolynomial
theorem wittPolynomial_eq_sum_C_mul_X_pow (n : β) :
wittPolynomial p R n = β i β range (n + 1), C ((p : R) ^ i) * X i ^ p ^ (n - i) := by
apply sum_congr rfl
rintro i -
rw [monomial_eq, Finsupp.prod_single_index]
rw [pow_zero]
set_option linter.uppercaseLean3 false in
#align witt_polynomial_eq_sum_C_mul_X_pow wittPolynomial_eq_sum_C_mul_X_pow
-- Notation with ring of coefficients explicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W_" => wittPolynomial p
-- Notation with ring of coefficients implicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W" => wittPolynomial p _
open Witt
open MvPolynomial
section
variable {R} {S : Type*} [CommRing S]
@[simp]
theorem map_wittPolynomial (f : R β+* S) (n : β) : map f (W n) = W n := by
rw [wittPolynomial, map_sum, wittPolynomial]
refine sum_congr rfl fun i _ => ?_
rw [map_monomial, RingHom.map_pow, map_natCast]
#align map_witt_polynomial map_wittPolynomial
variable (R)
@[simp]
theorem constantCoeff_wittPolynomial [hp : Fact p.Prime] (n : β) :
constantCoeff (wittPolynomial p R n) = 0 := by
simp only [wittPolynomial, map_sum, constantCoeff_monomial]
rw [sum_eq_zero]
rintro i _
rw [if_neg]
rw [Finsupp.single_eq_zero]
exact ne_of_gt (pow_pos hp.1.pos _)
#align constant_coeff_witt_polynomial constantCoeff_wittPolynomial
@[simp]
theorem wittPolynomial_zero : wittPolynomial p R 0 = X 0 := by
simp only [wittPolynomial, X, sum_singleton, range_one, pow_zero, zero_add, tsub_self]
#align witt_polynomial_zero wittPolynomial_zero
@[simp]
theorem wittPolynomial_one : wittPolynomial p R 1 = C (p : R) * X 1 + X 0 ^ p := by
simp only [wittPolynomial_eq_sum_C_mul_X_pow, sum_range_succ_comm, range_one, sum_singleton,
one_mul, pow_one, C_1, pow_zero, tsub_self, tsub_zero]
#align witt_polynomial_one wittPolynomial_one
theorem aeval_wittPolynomial {A : Type*} [CommRing A] [Algebra R A] (f : β β A) (n : β) :
aeval f (W_ R n) = β i β range (n + 1), (p : A) ^ i * f i ^ p ^ (n - i) := by
simp [wittPolynomial, AlgHom.map_sum, aeval_monomial, Finsupp.prod_single_index]
#align aeval_witt_polynomial aeval_wittPolynomial
@[simp]
theorem wittPolynomial_zmod_self (n : β) :
W_ (ZMod (p ^ (n + 1))) (n + 1) = expand p (W_ (ZMod (p ^ (n + 1))) n) := by
simp only [wittPolynomial_eq_sum_C_mul_X_pow]
rw [sum_range_succ, β Nat.cast_pow, CharP.cast_eq_zero (ZMod (p ^ (n + 1))) (p ^ (n + 1)), C_0,
zero_mul, add_zero, AlgHom.map_sum, sum_congr rfl]
intro k hk
rw [AlgHom.map_mul, AlgHom.map_pow, expand_X, algHom_C, β pow_mul, β pow_succ']
congr
rw [mem_range] at hk
rw [add_comm, add_tsub_assoc_of_le (Nat.lt_succ_iff.mp hk), β add_comm]
#align witt_polynomial_zmod_self wittPolynomial_zmod_self
end
noncomputable def xInTermsOfW [Invertible (p : R)] : β β MvPolynomial β R
| n => (X n - β i : Fin n,
C ((p : R) ^ (i : β)) * xInTermsOfW i ^ p ^ (n - (i : β))) * C ((β
p : R) ^ n)
set_option linter.uppercaseLean3 false in
#align X_in_terms_of_W xInTermsOfW
| Mathlib/RingTheory/WittVector/WittPolynomial.lean | 211 | 213 | theorem xInTermsOfW_eq [Invertible (p : R)] {n : β} : xInTermsOfW p R n =
(X n - β i β range n, C ((p: R) ^ i) * xInTermsOfW p R i ^ p ^ (n - i)) * C ((β
p : R) ^ n) := by |
rw [xInTermsOfW, β Fin.sum_univ_eq_sum_range]
| 1 | 2.718282 | 0 | 1.181818 | 11 | 1,247 |
import Mathlib.Algebra.CharP.Invertible
import Mathlib.Algebra.MvPolynomial.Variables
import Mathlib.Algebra.MvPolynomial.CommRing
import Mathlib.Algebra.MvPolynomial.Expand
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Data.ZMod.Basic
#align_import ring_theory.witt_vector.witt_polynomial from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395"
open MvPolynomial
open Finset hiding map
open Finsupp (single)
--attribute [-simp] coe_evalβ_hom
variable (p : β)
variable (R : Type*) [CommRing R] [DecidableEq R]
noncomputable def wittPolynomial (n : β) : MvPolynomial β R :=
β i β range (n + 1), monomial (single i (p ^ (n - i))) ((p : R) ^ i)
#align witt_polynomial wittPolynomial
theorem wittPolynomial_eq_sum_C_mul_X_pow (n : β) :
wittPolynomial p R n = β i β range (n + 1), C ((p : R) ^ i) * X i ^ p ^ (n - i) := by
apply sum_congr rfl
rintro i -
rw [monomial_eq, Finsupp.prod_single_index]
rw [pow_zero]
set_option linter.uppercaseLean3 false in
#align witt_polynomial_eq_sum_C_mul_X_pow wittPolynomial_eq_sum_C_mul_X_pow
-- Notation with ring of coefficients explicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W_" => wittPolynomial p
-- Notation with ring of coefficients implicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W" => wittPolynomial p _
open Witt
open MvPolynomial
section
variable {R} {S : Type*} [CommRing S]
@[simp]
theorem map_wittPolynomial (f : R β+* S) (n : β) : map f (W n) = W n := by
rw [wittPolynomial, map_sum, wittPolynomial]
refine sum_congr rfl fun i _ => ?_
rw [map_monomial, RingHom.map_pow, map_natCast]
#align map_witt_polynomial map_wittPolynomial
variable (R)
@[simp]
theorem constantCoeff_wittPolynomial [hp : Fact p.Prime] (n : β) :
constantCoeff (wittPolynomial p R n) = 0 := by
simp only [wittPolynomial, map_sum, constantCoeff_monomial]
rw [sum_eq_zero]
rintro i _
rw [if_neg]
rw [Finsupp.single_eq_zero]
exact ne_of_gt (pow_pos hp.1.pos _)
#align constant_coeff_witt_polynomial constantCoeff_wittPolynomial
@[simp]
theorem wittPolynomial_zero : wittPolynomial p R 0 = X 0 := by
simp only [wittPolynomial, X, sum_singleton, range_one, pow_zero, zero_add, tsub_self]
#align witt_polynomial_zero wittPolynomial_zero
@[simp]
theorem wittPolynomial_one : wittPolynomial p R 1 = C (p : R) * X 1 + X 0 ^ p := by
simp only [wittPolynomial_eq_sum_C_mul_X_pow, sum_range_succ_comm, range_one, sum_singleton,
one_mul, pow_one, C_1, pow_zero, tsub_self, tsub_zero]
#align witt_polynomial_one wittPolynomial_one
theorem aeval_wittPolynomial {A : Type*} [CommRing A] [Algebra R A] (f : β β A) (n : β) :
aeval f (W_ R n) = β i β range (n + 1), (p : A) ^ i * f i ^ p ^ (n - i) := by
simp [wittPolynomial, AlgHom.map_sum, aeval_monomial, Finsupp.prod_single_index]
#align aeval_witt_polynomial aeval_wittPolynomial
@[simp]
theorem wittPolynomial_zmod_self (n : β) :
W_ (ZMod (p ^ (n + 1))) (n + 1) = expand p (W_ (ZMod (p ^ (n + 1))) n) := by
simp only [wittPolynomial_eq_sum_C_mul_X_pow]
rw [sum_range_succ, β Nat.cast_pow, CharP.cast_eq_zero (ZMod (p ^ (n + 1))) (p ^ (n + 1)), C_0,
zero_mul, add_zero, AlgHom.map_sum, sum_congr rfl]
intro k hk
rw [AlgHom.map_mul, AlgHom.map_pow, expand_X, algHom_C, β pow_mul, β pow_succ']
congr
rw [mem_range] at hk
rw [add_comm, add_tsub_assoc_of_le (Nat.lt_succ_iff.mp hk), β add_comm]
#align witt_polynomial_zmod_self wittPolynomial_zmod_self
end
noncomputable def xInTermsOfW [Invertible (p : R)] : β β MvPolynomial β R
| n => (X n - β i : Fin n,
C ((p : R) ^ (i : β)) * xInTermsOfW i ^ p ^ (n - (i : β))) * C ((β
p : R) ^ n)
set_option linter.uppercaseLean3 false in
#align X_in_terms_of_W xInTermsOfW
theorem xInTermsOfW_eq [Invertible (p : R)] {n : β} : xInTermsOfW p R n =
(X n - β i β range n, C ((p: R) ^ i) * xInTermsOfW p R i ^ p ^ (n - i)) * C ((β
p : R) ^ n) := by
rw [xInTermsOfW, β Fin.sum_univ_eq_sum_range]
set_option linter.uppercaseLean3 false in
#align X_in_terms_of_W_eq xInTermsOfW_eq
@[simp]
| Mathlib/RingTheory/WittVector/WittPolynomial.lean | 218 | 234 | theorem constantCoeff_xInTermsOfW [hp : Fact p.Prime] [Invertible (p : R)] (n : β) :
constantCoeff (xInTermsOfW p R n) = 0 := by |
apply Nat.strongInductionOn n; clear n
intro n IH
rw [xInTermsOfW_eq, mul_comm, RingHom.map_mul, RingHom.map_sub, map_sum, constantCoeff_C,
constantCoeff_X, zero_sub, mul_neg, neg_eq_zero]
-- Porting note: here, we should be able to do `rw [sum_eq_zero]`, but the goal that
-- is created is not what we expect, and the sum is not replaced by zero...
-- is it a bug in `rw` tactic?
refine Eq.trans (?_ : _ = ((β
βp : R) ^ n)* 0) (mul_zero _)
congr 1
rw [sum_eq_zero]
intro m H
rw [mem_range] at H
simp only [RingHom.map_mul, RingHom.map_pow, map_natCast, IH m H]
rw [zero_pow, mul_zero]
exact pow_ne_zero _ hp.1.ne_zero
| 15 | 3,269,017.372472 | 2 | 1.181818 | 11 | 1,247 |
import Mathlib.Data.Matrix.Invertible
import Mathlib.LinearAlgebra.Matrix.NonsingularInverse
import Mathlib.LinearAlgebra.Matrix.PosDef
#align_import linear_algebra.matrix.schur_complement from "leanprover-community/mathlib"@"a176cb1219e300e85793d44583dede42377b51af"
variable {l m n Ξ± : Type*}
namespace Matrix
open scoped Matrix
section CommRing
variable [Fintype l] [Fintype m] [Fintype n]
variable [DecidableEq l] [DecidableEq m] [DecidableEq n]
variable [CommRing Ξ±]
| Mathlib/LinearAlgebra/Matrix/SchurComplement.lean | 52 | 59 | theorem fromBlocks_eq_of_invertibleββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix l m Ξ±)
(D : Matrix l n Ξ±) [Invertible A] :
fromBlocks A B C D =
fromBlocks 1 0 (C * β
A) 1 * fromBlocks A 0 0 (D - C * β
A * B) *
fromBlocks 1 (β
A * B) 0 1 := by |
simp only [fromBlocks_multiply, Matrix.mul_zero, Matrix.zero_mul, add_zero, zero_add,
Matrix.one_mul, Matrix.mul_one, invOf_mul_self, Matrix.mul_invOf_self_assoc,
Matrix.mul_invOf_mul_self_cancel, Matrix.mul_assoc, add_sub_cancel]
| 3 | 20.085537 | 1 | 1.1875 | 16 | 1,248 |
import Mathlib.Data.Matrix.Invertible
import Mathlib.LinearAlgebra.Matrix.NonsingularInverse
import Mathlib.LinearAlgebra.Matrix.PosDef
#align_import linear_algebra.matrix.schur_complement from "leanprover-community/mathlib"@"a176cb1219e300e85793d44583dede42377b51af"
variable {l m n Ξ± : Type*}
namespace Matrix
open scoped Matrix
section CommRing
variable [Fintype l] [Fintype m] [Fintype n]
variable [DecidableEq l] [DecidableEq m] [DecidableEq n]
variable [CommRing Ξ±]
theorem fromBlocks_eq_of_invertibleββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix l m Ξ±)
(D : Matrix l n Ξ±) [Invertible A] :
fromBlocks A B C D =
fromBlocks 1 0 (C * β
A) 1 * fromBlocks A 0 0 (D - C * β
A * B) *
fromBlocks 1 (β
A * B) 0 1 := by
simp only [fromBlocks_multiply, Matrix.mul_zero, Matrix.zero_mul, add_zero, zero_add,
Matrix.one_mul, Matrix.mul_one, invOf_mul_self, Matrix.mul_invOf_self_assoc,
Matrix.mul_invOf_mul_self_cancel, Matrix.mul_assoc, add_sub_cancel]
#align matrix.from_blocks_eq_of_invertibleββ Matrix.fromBlocks_eq_of_invertibleββ
theorem fromBlocks_eq_of_invertibleββ (A : Matrix l m Ξ±) (B : Matrix l n Ξ±) (C : Matrix n m Ξ±)
(D : Matrix n n Ξ±) [Invertible D] :
fromBlocks A B C D =
fromBlocks 1 (B * β
D) 0 1 * fromBlocks (A - B * β
D * C) 0 0 D *
fromBlocks 1 0 (β
D * C) 1 :=
(Matrix.reindex (Equiv.sumComm _ _) (Equiv.sumComm _ _)).injective <| by
simpa [reindex_apply, Equiv.sumComm_symm, β submatrix_mul_equiv _ _ _ (Equiv.sumComm n m), β
submatrix_mul_equiv _ _ _ (Equiv.sumComm n l), Equiv.sumComm_apply,
fromBlocks_submatrix_sum_swap_sum_swap] using fromBlocks_eq_of_invertibleββ D C B A
#align matrix.from_blocks_eq_of_invertibleββ Matrix.fromBlocks_eq_of_invertibleββ
section Triangular
def fromBlocksZeroββInvertible (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (D : Matrix n n Ξ±)
[Invertible A] [Invertible D] : Invertible (fromBlocks A B 0 D) :=
invertibleOfLeftInverse _ (fromBlocks (β
A) (-(β
A * B * β
D)) 0 (β
D)) <| by
simp_rw [fromBlocks_multiply, Matrix.mul_zero, Matrix.zero_mul, zero_add, add_zero,
Matrix.neg_mul, invOf_mul_self, Matrix.mul_invOf_mul_self_cancel, add_right_neg,
fromBlocks_one]
#align matrix.from_blocks_zeroββ_invertible Matrix.fromBlocksZeroββInvertible
def fromBlocksZeroββInvertible (A : Matrix m m Ξ±) (C : Matrix n m Ξ±) (D : Matrix n n Ξ±)
[Invertible A] [Invertible D] : Invertible (fromBlocks A 0 C D) :=
invertibleOfLeftInverse _
(fromBlocks (β
A) 0 (-(β
D * C * β
A))
(β
D)) <| by -- a symmetry argument is more work than just copying the proof
simp_rw [fromBlocks_multiply, Matrix.mul_zero, Matrix.zero_mul, zero_add, add_zero,
Matrix.neg_mul, invOf_mul_self, Matrix.mul_invOf_mul_self_cancel, add_left_neg,
fromBlocks_one]
#align matrix.from_blocks_zeroββ_invertible Matrix.fromBlocksZeroββInvertible
| Mathlib/LinearAlgebra/Matrix/SchurComplement.lean | 100 | 104 | theorem invOf_fromBlocks_zeroββ_eq (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (D : Matrix n n Ξ±)
[Invertible A] [Invertible D] [Invertible (fromBlocks A B 0 D)] :
β
(fromBlocks A B 0 D) = fromBlocks (β
A) (-(β
A * B * β
D)) 0 (β
D) := by |
letI := fromBlocksZeroββInvertible A B D
convert (rfl : β
(fromBlocks A B 0 D) = _)
| 2 | 7.389056 | 1 | 1.1875 | 16 | 1,248 |
import Mathlib.Data.Matrix.Invertible
import Mathlib.LinearAlgebra.Matrix.NonsingularInverse
import Mathlib.LinearAlgebra.Matrix.PosDef
#align_import linear_algebra.matrix.schur_complement from "leanprover-community/mathlib"@"a176cb1219e300e85793d44583dede42377b51af"
variable {l m n Ξ± : Type*}
namespace Matrix
open scoped Matrix
section CommRing
variable [Fintype l] [Fintype m] [Fintype n]
variable [DecidableEq l] [DecidableEq m] [DecidableEq n]
variable [CommRing Ξ±]
theorem fromBlocks_eq_of_invertibleββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix l m Ξ±)
(D : Matrix l n Ξ±) [Invertible A] :
fromBlocks A B C D =
fromBlocks 1 0 (C * β
A) 1 * fromBlocks A 0 0 (D - C * β
A * B) *
fromBlocks 1 (β
A * B) 0 1 := by
simp only [fromBlocks_multiply, Matrix.mul_zero, Matrix.zero_mul, add_zero, zero_add,
Matrix.one_mul, Matrix.mul_one, invOf_mul_self, Matrix.mul_invOf_self_assoc,
Matrix.mul_invOf_mul_self_cancel, Matrix.mul_assoc, add_sub_cancel]
#align matrix.from_blocks_eq_of_invertibleββ Matrix.fromBlocks_eq_of_invertibleββ
theorem fromBlocks_eq_of_invertibleββ (A : Matrix l m Ξ±) (B : Matrix l n Ξ±) (C : Matrix n m Ξ±)
(D : Matrix n n Ξ±) [Invertible D] :
fromBlocks A B C D =
fromBlocks 1 (B * β
D) 0 1 * fromBlocks (A - B * β
D * C) 0 0 D *
fromBlocks 1 0 (β
D * C) 1 :=
(Matrix.reindex (Equiv.sumComm _ _) (Equiv.sumComm _ _)).injective <| by
simpa [reindex_apply, Equiv.sumComm_symm, β submatrix_mul_equiv _ _ _ (Equiv.sumComm n m), β
submatrix_mul_equiv _ _ _ (Equiv.sumComm n l), Equiv.sumComm_apply,
fromBlocks_submatrix_sum_swap_sum_swap] using fromBlocks_eq_of_invertibleββ D C B A
#align matrix.from_blocks_eq_of_invertibleββ Matrix.fromBlocks_eq_of_invertibleββ
section Triangular
def fromBlocksZeroββInvertible (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (D : Matrix n n Ξ±)
[Invertible A] [Invertible D] : Invertible (fromBlocks A B 0 D) :=
invertibleOfLeftInverse _ (fromBlocks (β
A) (-(β
A * B * β
D)) 0 (β
D)) <| by
simp_rw [fromBlocks_multiply, Matrix.mul_zero, Matrix.zero_mul, zero_add, add_zero,
Matrix.neg_mul, invOf_mul_self, Matrix.mul_invOf_mul_self_cancel, add_right_neg,
fromBlocks_one]
#align matrix.from_blocks_zeroββ_invertible Matrix.fromBlocksZeroββInvertible
def fromBlocksZeroββInvertible (A : Matrix m m Ξ±) (C : Matrix n m Ξ±) (D : Matrix n n Ξ±)
[Invertible A] [Invertible D] : Invertible (fromBlocks A 0 C D) :=
invertibleOfLeftInverse _
(fromBlocks (β
A) 0 (-(β
D * C * β
A))
(β
D)) <| by -- a symmetry argument is more work than just copying the proof
simp_rw [fromBlocks_multiply, Matrix.mul_zero, Matrix.zero_mul, zero_add, add_zero,
Matrix.neg_mul, invOf_mul_self, Matrix.mul_invOf_mul_self_cancel, add_left_neg,
fromBlocks_one]
#align matrix.from_blocks_zeroββ_invertible Matrix.fromBlocksZeroββInvertible
theorem invOf_fromBlocks_zeroββ_eq (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (D : Matrix n n Ξ±)
[Invertible A] [Invertible D] [Invertible (fromBlocks A B 0 D)] :
β
(fromBlocks A B 0 D) = fromBlocks (β
A) (-(β
A * B * β
D)) 0 (β
D) := by
letI := fromBlocksZeroββInvertible A B D
convert (rfl : β
(fromBlocks A B 0 D) = _)
#align matrix.inv_of_from_blocks_zeroββ_eq Matrix.invOf_fromBlocks_zeroββ_eq
| Mathlib/LinearAlgebra/Matrix/SchurComplement.lean | 107 | 111 | theorem invOf_fromBlocks_zeroββ_eq (A : Matrix m m Ξ±) (C : Matrix n m Ξ±) (D : Matrix n n Ξ±)
[Invertible A] [Invertible D] [Invertible (fromBlocks A 0 C D)] :
β
(fromBlocks A 0 C D) = fromBlocks (β
A) 0 (-(β
D * C * β
A)) (β
D) := by |
letI := fromBlocksZeroββInvertible A C D
convert (rfl : β
(fromBlocks A 0 C D) = _)
| 2 | 7.389056 | 1 | 1.1875 | 16 | 1,248 |
import Mathlib.Data.Matrix.Invertible
import Mathlib.LinearAlgebra.Matrix.NonsingularInverse
import Mathlib.LinearAlgebra.Matrix.PosDef
#align_import linear_algebra.matrix.schur_complement from "leanprover-community/mathlib"@"a176cb1219e300e85793d44583dede42377b51af"
variable {l m n Ξ± : Type*}
namespace Matrix
open scoped Matrix
section CommRing
variable [Fintype l] [Fintype m] [Fintype n]
variable [DecidableEq l] [DecidableEq m] [DecidableEq n]
variable [CommRing Ξ±]
theorem fromBlocks_eq_of_invertibleββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix l m Ξ±)
(D : Matrix l n Ξ±) [Invertible A] :
fromBlocks A B C D =
fromBlocks 1 0 (C * β
A) 1 * fromBlocks A 0 0 (D - C * β
A * B) *
fromBlocks 1 (β
A * B) 0 1 := by
simp only [fromBlocks_multiply, Matrix.mul_zero, Matrix.zero_mul, add_zero, zero_add,
Matrix.one_mul, Matrix.mul_one, invOf_mul_self, Matrix.mul_invOf_self_assoc,
Matrix.mul_invOf_mul_self_cancel, Matrix.mul_assoc, add_sub_cancel]
#align matrix.from_blocks_eq_of_invertibleββ Matrix.fromBlocks_eq_of_invertibleββ
theorem fromBlocks_eq_of_invertibleββ (A : Matrix l m Ξ±) (B : Matrix l n Ξ±) (C : Matrix n m Ξ±)
(D : Matrix n n Ξ±) [Invertible D] :
fromBlocks A B C D =
fromBlocks 1 (B * β
D) 0 1 * fromBlocks (A - B * β
D * C) 0 0 D *
fromBlocks 1 0 (β
D * C) 1 :=
(Matrix.reindex (Equiv.sumComm _ _) (Equiv.sumComm _ _)).injective <| by
simpa [reindex_apply, Equiv.sumComm_symm, β submatrix_mul_equiv _ _ _ (Equiv.sumComm n m), β
submatrix_mul_equiv _ _ _ (Equiv.sumComm n l), Equiv.sumComm_apply,
fromBlocks_submatrix_sum_swap_sum_swap] using fromBlocks_eq_of_invertibleββ D C B A
#align matrix.from_blocks_eq_of_invertibleββ Matrix.fromBlocks_eq_of_invertibleββ
section Det
| Mathlib/LinearAlgebra/Matrix/SchurComplement.lean | 390 | 394 | theorem det_fromBlocksββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix n m Ξ±)
(D : Matrix n n Ξ±) [Invertible A] :
(Matrix.fromBlocks A B C D).det = det A * det (D - C * β
A * B) := by |
rw [fromBlocks_eq_of_invertibleββ (A := A), det_mul, det_mul, det_fromBlocks_zeroββ,
det_fromBlocks_zeroββ, det_fromBlocks_zeroββ, det_one, det_one, one_mul, one_mul, mul_one]
| 2 | 7.389056 | 1 | 1.1875 | 16 | 1,248 |
import Mathlib.Data.Matrix.Invertible
import Mathlib.LinearAlgebra.Matrix.NonsingularInverse
import Mathlib.LinearAlgebra.Matrix.PosDef
#align_import linear_algebra.matrix.schur_complement from "leanprover-community/mathlib"@"a176cb1219e300e85793d44583dede42377b51af"
variable {l m n Ξ± : Type*}
namespace Matrix
open scoped Matrix
section CommRing
variable [Fintype l] [Fintype m] [Fintype n]
variable [DecidableEq l] [DecidableEq m] [DecidableEq n]
variable [CommRing Ξ±]
theorem fromBlocks_eq_of_invertibleββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix l m Ξ±)
(D : Matrix l n Ξ±) [Invertible A] :
fromBlocks A B C D =
fromBlocks 1 0 (C * β
A) 1 * fromBlocks A 0 0 (D - C * β
A * B) *
fromBlocks 1 (β
A * B) 0 1 := by
simp only [fromBlocks_multiply, Matrix.mul_zero, Matrix.zero_mul, add_zero, zero_add,
Matrix.one_mul, Matrix.mul_one, invOf_mul_self, Matrix.mul_invOf_self_assoc,
Matrix.mul_invOf_mul_self_cancel, Matrix.mul_assoc, add_sub_cancel]
#align matrix.from_blocks_eq_of_invertibleββ Matrix.fromBlocks_eq_of_invertibleββ
theorem fromBlocks_eq_of_invertibleββ (A : Matrix l m Ξ±) (B : Matrix l n Ξ±) (C : Matrix n m Ξ±)
(D : Matrix n n Ξ±) [Invertible D] :
fromBlocks A B C D =
fromBlocks 1 (B * β
D) 0 1 * fromBlocks (A - B * β
D * C) 0 0 D *
fromBlocks 1 0 (β
D * C) 1 :=
(Matrix.reindex (Equiv.sumComm _ _) (Equiv.sumComm _ _)).injective <| by
simpa [reindex_apply, Equiv.sumComm_symm, β submatrix_mul_equiv _ _ _ (Equiv.sumComm n m), β
submatrix_mul_equiv _ _ _ (Equiv.sumComm n l), Equiv.sumComm_apply,
fromBlocks_submatrix_sum_swap_sum_swap] using fromBlocks_eq_of_invertibleββ D C B A
#align matrix.from_blocks_eq_of_invertibleββ Matrix.fromBlocks_eq_of_invertibleββ
section Det
theorem det_fromBlocksββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix n m Ξ±)
(D : Matrix n n Ξ±) [Invertible A] :
(Matrix.fromBlocks A B C D).det = det A * det (D - C * β
A * B) := by
rw [fromBlocks_eq_of_invertibleββ (A := A), det_mul, det_mul, det_fromBlocks_zeroββ,
det_fromBlocks_zeroββ, det_fromBlocks_zeroββ, det_one, det_one, one_mul, one_mul, mul_one]
#align matrix.det_from_blocksββ Matrix.det_fromBlocksββ
@[simp]
| Mathlib/LinearAlgebra/Matrix/SchurComplement.lean | 398 | 401 | theorem det_fromBlocks_oneββ (B : Matrix m n Ξ±) (C : Matrix n m Ξ±) (D : Matrix n n Ξ±) :
(Matrix.fromBlocks 1 B C D).det = det (D - C * B) := by |
haveI : Invertible (1 : Matrix m m Ξ±) := invertibleOne
rw [det_fromBlocksββ, invOf_one, Matrix.mul_one, det_one, one_mul]
| 2 | 7.389056 | 1 | 1.1875 | 16 | 1,248 |
import Mathlib.Data.Matrix.Invertible
import Mathlib.LinearAlgebra.Matrix.NonsingularInverse
import Mathlib.LinearAlgebra.Matrix.PosDef
#align_import linear_algebra.matrix.schur_complement from "leanprover-community/mathlib"@"a176cb1219e300e85793d44583dede42377b51af"
variable {l m n Ξ± : Type*}
namespace Matrix
open scoped Matrix
section CommRing
variable [Fintype l] [Fintype m] [Fintype n]
variable [DecidableEq l] [DecidableEq m] [DecidableEq n]
variable [CommRing Ξ±]
theorem fromBlocks_eq_of_invertibleββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix l m Ξ±)
(D : Matrix l n Ξ±) [Invertible A] :
fromBlocks A B C D =
fromBlocks 1 0 (C * β
A) 1 * fromBlocks A 0 0 (D - C * β
A * B) *
fromBlocks 1 (β
A * B) 0 1 := by
simp only [fromBlocks_multiply, Matrix.mul_zero, Matrix.zero_mul, add_zero, zero_add,
Matrix.one_mul, Matrix.mul_one, invOf_mul_self, Matrix.mul_invOf_self_assoc,
Matrix.mul_invOf_mul_self_cancel, Matrix.mul_assoc, add_sub_cancel]
#align matrix.from_blocks_eq_of_invertibleββ Matrix.fromBlocks_eq_of_invertibleββ
theorem fromBlocks_eq_of_invertibleββ (A : Matrix l m Ξ±) (B : Matrix l n Ξ±) (C : Matrix n m Ξ±)
(D : Matrix n n Ξ±) [Invertible D] :
fromBlocks A B C D =
fromBlocks 1 (B * β
D) 0 1 * fromBlocks (A - B * β
D * C) 0 0 D *
fromBlocks 1 0 (β
D * C) 1 :=
(Matrix.reindex (Equiv.sumComm _ _) (Equiv.sumComm _ _)).injective <| by
simpa [reindex_apply, Equiv.sumComm_symm, β submatrix_mul_equiv _ _ _ (Equiv.sumComm n m), β
submatrix_mul_equiv _ _ _ (Equiv.sumComm n l), Equiv.sumComm_apply,
fromBlocks_submatrix_sum_swap_sum_swap] using fromBlocks_eq_of_invertibleββ D C B A
#align matrix.from_blocks_eq_of_invertibleββ Matrix.fromBlocks_eq_of_invertibleββ
section Det
theorem det_fromBlocksββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix n m Ξ±)
(D : Matrix n n Ξ±) [Invertible A] :
(Matrix.fromBlocks A B C D).det = det A * det (D - C * β
A * B) := by
rw [fromBlocks_eq_of_invertibleββ (A := A), det_mul, det_mul, det_fromBlocks_zeroββ,
det_fromBlocks_zeroββ, det_fromBlocks_zeroββ, det_one, det_one, one_mul, one_mul, mul_one]
#align matrix.det_from_blocksββ Matrix.det_fromBlocksββ
@[simp]
theorem det_fromBlocks_oneββ (B : Matrix m n Ξ±) (C : Matrix n m Ξ±) (D : Matrix n n Ξ±) :
(Matrix.fromBlocks 1 B C D).det = det (D - C * B) := by
haveI : Invertible (1 : Matrix m m Ξ±) := invertibleOne
rw [det_fromBlocksββ, invOf_one, Matrix.mul_one, det_one, one_mul]
#align matrix.det_from_blocks_oneββ Matrix.det_fromBlocks_oneββ
| Mathlib/LinearAlgebra/Matrix/SchurComplement.lean | 406 | 413 | theorem det_fromBlocksββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix n m Ξ±)
(D : Matrix n n Ξ±) [Invertible D] :
(Matrix.fromBlocks A B C D).det = det D * det (A - B * β
D * C) := by |
have : fromBlocks A B C D =
(fromBlocks D C B A).submatrix (Equiv.sumComm _ _) (Equiv.sumComm _ _) := by
ext (i j)
cases i <;> cases j <;> rfl
rw [this, det_submatrix_equiv_self, det_fromBlocksββ]
| 5 | 148.413159 | 2 | 1.1875 | 16 | 1,248 |
import Mathlib.Data.Matrix.Invertible
import Mathlib.LinearAlgebra.Matrix.NonsingularInverse
import Mathlib.LinearAlgebra.Matrix.PosDef
#align_import linear_algebra.matrix.schur_complement from "leanprover-community/mathlib"@"a176cb1219e300e85793d44583dede42377b51af"
variable {l m n Ξ± : Type*}
namespace Matrix
open scoped Matrix
section CommRing
variable [Fintype l] [Fintype m] [Fintype n]
variable [DecidableEq l] [DecidableEq m] [DecidableEq n]
variable [CommRing Ξ±]
theorem fromBlocks_eq_of_invertibleββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix l m Ξ±)
(D : Matrix l n Ξ±) [Invertible A] :
fromBlocks A B C D =
fromBlocks 1 0 (C * β
A) 1 * fromBlocks A 0 0 (D - C * β
A * B) *
fromBlocks 1 (β
A * B) 0 1 := by
simp only [fromBlocks_multiply, Matrix.mul_zero, Matrix.zero_mul, add_zero, zero_add,
Matrix.one_mul, Matrix.mul_one, invOf_mul_self, Matrix.mul_invOf_self_assoc,
Matrix.mul_invOf_mul_self_cancel, Matrix.mul_assoc, add_sub_cancel]
#align matrix.from_blocks_eq_of_invertibleββ Matrix.fromBlocks_eq_of_invertibleββ
theorem fromBlocks_eq_of_invertibleββ (A : Matrix l m Ξ±) (B : Matrix l n Ξ±) (C : Matrix n m Ξ±)
(D : Matrix n n Ξ±) [Invertible D] :
fromBlocks A B C D =
fromBlocks 1 (B * β
D) 0 1 * fromBlocks (A - B * β
D * C) 0 0 D *
fromBlocks 1 0 (β
D * C) 1 :=
(Matrix.reindex (Equiv.sumComm _ _) (Equiv.sumComm _ _)).injective <| by
simpa [reindex_apply, Equiv.sumComm_symm, β submatrix_mul_equiv _ _ _ (Equiv.sumComm n m), β
submatrix_mul_equiv _ _ _ (Equiv.sumComm n l), Equiv.sumComm_apply,
fromBlocks_submatrix_sum_swap_sum_swap] using fromBlocks_eq_of_invertibleββ D C B A
#align matrix.from_blocks_eq_of_invertibleββ Matrix.fromBlocks_eq_of_invertibleββ
section Det
theorem det_fromBlocksββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix n m Ξ±)
(D : Matrix n n Ξ±) [Invertible A] :
(Matrix.fromBlocks A B C D).det = det A * det (D - C * β
A * B) := by
rw [fromBlocks_eq_of_invertibleββ (A := A), det_mul, det_mul, det_fromBlocks_zeroββ,
det_fromBlocks_zeroββ, det_fromBlocks_zeroββ, det_one, det_one, one_mul, one_mul, mul_one]
#align matrix.det_from_blocksββ Matrix.det_fromBlocksββ
@[simp]
theorem det_fromBlocks_oneββ (B : Matrix m n Ξ±) (C : Matrix n m Ξ±) (D : Matrix n n Ξ±) :
(Matrix.fromBlocks 1 B C D).det = det (D - C * B) := by
haveI : Invertible (1 : Matrix m m Ξ±) := invertibleOne
rw [det_fromBlocksββ, invOf_one, Matrix.mul_one, det_one, one_mul]
#align matrix.det_from_blocks_oneββ Matrix.det_fromBlocks_oneββ
theorem det_fromBlocksββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix n m Ξ±)
(D : Matrix n n Ξ±) [Invertible D] :
(Matrix.fromBlocks A B C D).det = det D * det (A - B * β
D * C) := by
have : fromBlocks A B C D =
(fromBlocks D C B A).submatrix (Equiv.sumComm _ _) (Equiv.sumComm _ _) := by
ext (i j)
cases i <;> cases j <;> rfl
rw [this, det_submatrix_equiv_self, det_fromBlocksββ]
#align matrix.det_from_blocksββ Matrix.det_fromBlocksββ
@[simp]
| Mathlib/LinearAlgebra/Matrix/SchurComplement.lean | 417 | 420 | theorem det_fromBlocks_oneββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix n m Ξ±) :
(Matrix.fromBlocks A B C 1).det = det (A - B * C) := by |
haveI : Invertible (1 : Matrix n n Ξ±) := invertibleOne
rw [det_fromBlocksββ, invOf_one, Matrix.mul_one, det_one, one_mul]
| 2 | 7.389056 | 1 | 1.1875 | 16 | 1,248 |
import Mathlib.Data.Matrix.Invertible
import Mathlib.LinearAlgebra.Matrix.NonsingularInverse
import Mathlib.LinearAlgebra.Matrix.PosDef
#align_import linear_algebra.matrix.schur_complement from "leanprover-community/mathlib"@"a176cb1219e300e85793d44583dede42377b51af"
variable {l m n Ξ± : Type*}
namespace Matrix
open scoped Matrix
section CommRing
variable [Fintype l] [Fintype m] [Fintype n]
variable [DecidableEq l] [DecidableEq m] [DecidableEq n]
variable [CommRing Ξ±]
theorem fromBlocks_eq_of_invertibleββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix l m Ξ±)
(D : Matrix l n Ξ±) [Invertible A] :
fromBlocks A B C D =
fromBlocks 1 0 (C * β
A) 1 * fromBlocks A 0 0 (D - C * β
A * B) *
fromBlocks 1 (β
A * B) 0 1 := by
simp only [fromBlocks_multiply, Matrix.mul_zero, Matrix.zero_mul, add_zero, zero_add,
Matrix.one_mul, Matrix.mul_one, invOf_mul_self, Matrix.mul_invOf_self_assoc,
Matrix.mul_invOf_mul_self_cancel, Matrix.mul_assoc, add_sub_cancel]
#align matrix.from_blocks_eq_of_invertibleββ Matrix.fromBlocks_eq_of_invertibleββ
theorem fromBlocks_eq_of_invertibleββ (A : Matrix l m Ξ±) (B : Matrix l n Ξ±) (C : Matrix n m Ξ±)
(D : Matrix n n Ξ±) [Invertible D] :
fromBlocks A B C D =
fromBlocks 1 (B * β
D) 0 1 * fromBlocks (A - B * β
D * C) 0 0 D *
fromBlocks 1 0 (β
D * C) 1 :=
(Matrix.reindex (Equiv.sumComm _ _) (Equiv.sumComm _ _)).injective <| by
simpa [reindex_apply, Equiv.sumComm_symm, β submatrix_mul_equiv _ _ _ (Equiv.sumComm n m), β
submatrix_mul_equiv _ _ _ (Equiv.sumComm n l), Equiv.sumComm_apply,
fromBlocks_submatrix_sum_swap_sum_swap] using fromBlocks_eq_of_invertibleββ D C B A
#align matrix.from_blocks_eq_of_invertibleββ Matrix.fromBlocks_eq_of_invertibleββ
section Det
theorem det_fromBlocksββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix n m Ξ±)
(D : Matrix n n Ξ±) [Invertible A] :
(Matrix.fromBlocks A B C D).det = det A * det (D - C * β
A * B) := by
rw [fromBlocks_eq_of_invertibleββ (A := A), det_mul, det_mul, det_fromBlocks_zeroββ,
det_fromBlocks_zeroββ, det_fromBlocks_zeroββ, det_one, det_one, one_mul, one_mul, mul_one]
#align matrix.det_from_blocksββ Matrix.det_fromBlocksββ
@[simp]
theorem det_fromBlocks_oneββ (B : Matrix m n Ξ±) (C : Matrix n m Ξ±) (D : Matrix n n Ξ±) :
(Matrix.fromBlocks 1 B C D).det = det (D - C * B) := by
haveI : Invertible (1 : Matrix m m Ξ±) := invertibleOne
rw [det_fromBlocksββ, invOf_one, Matrix.mul_one, det_one, one_mul]
#align matrix.det_from_blocks_oneββ Matrix.det_fromBlocks_oneββ
theorem det_fromBlocksββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix n m Ξ±)
(D : Matrix n n Ξ±) [Invertible D] :
(Matrix.fromBlocks A B C D).det = det D * det (A - B * β
D * C) := by
have : fromBlocks A B C D =
(fromBlocks D C B A).submatrix (Equiv.sumComm _ _) (Equiv.sumComm _ _) := by
ext (i j)
cases i <;> cases j <;> rfl
rw [this, det_submatrix_equiv_self, det_fromBlocksββ]
#align matrix.det_from_blocksββ Matrix.det_fromBlocksββ
@[simp]
theorem det_fromBlocks_oneββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix n m Ξ±) :
(Matrix.fromBlocks A B C 1).det = det (A - B * C) := by
haveI : Invertible (1 : Matrix n n Ξ±) := invertibleOne
rw [det_fromBlocksββ, invOf_one, Matrix.mul_one, det_one, one_mul]
#align matrix.det_from_blocks_oneββ Matrix.det_fromBlocks_oneββ
| Mathlib/LinearAlgebra/Matrix/SchurComplement.lean | 425 | 430 | theorem det_one_add_mul_comm (A : Matrix m n Ξ±) (B : Matrix n m Ξ±) :
det (1 + A * B) = det (1 + B * A) :=
calc
det (1 + A * B) = det (fromBlocks 1 (-A) B 1) := by |
rw [det_fromBlocks_oneββ, Matrix.neg_mul, sub_neg_eq_add]
_ = det (1 + B * A) := by rw [det_fromBlocks_oneββ, Matrix.mul_neg, sub_neg_eq_add]
| 2 | 7.389056 | 1 | 1.1875 | 16 | 1,248 |
import Mathlib.Data.Matrix.Invertible
import Mathlib.LinearAlgebra.Matrix.NonsingularInverse
import Mathlib.LinearAlgebra.Matrix.PosDef
#align_import linear_algebra.matrix.schur_complement from "leanprover-community/mathlib"@"a176cb1219e300e85793d44583dede42377b51af"
variable {l m n Ξ± : Type*}
namespace Matrix
open scoped Matrix
section CommRing
variable [Fintype l] [Fintype m] [Fintype n]
variable [DecidableEq l] [DecidableEq m] [DecidableEq n]
variable [CommRing Ξ±]
theorem fromBlocks_eq_of_invertibleββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix l m Ξ±)
(D : Matrix l n Ξ±) [Invertible A] :
fromBlocks A B C D =
fromBlocks 1 0 (C * β
A) 1 * fromBlocks A 0 0 (D - C * β
A * B) *
fromBlocks 1 (β
A * B) 0 1 := by
simp only [fromBlocks_multiply, Matrix.mul_zero, Matrix.zero_mul, add_zero, zero_add,
Matrix.one_mul, Matrix.mul_one, invOf_mul_self, Matrix.mul_invOf_self_assoc,
Matrix.mul_invOf_mul_self_cancel, Matrix.mul_assoc, add_sub_cancel]
#align matrix.from_blocks_eq_of_invertibleββ Matrix.fromBlocks_eq_of_invertibleββ
theorem fromBlocks_eq_of_invertibleββ (A : Matrix l m Ξ±) (B : Matrix l n Ξ±) (C : Matrix n m Ξ±)
(D : Matrix n n Ξ±) [Invertible D] :
fromBlocks A B C D =
fromBlocks 1 (B * β
D) 0 1 * fromBlocks (A - B * β
D * C) 0 0 D *
fromBlocks 1 0 (β
D * C) 1 :=
(Matrix.reindex (Equiv.sumComm _ _) (Equiv.sumComm _ _)).injective <| by
simpa [reindex_apply, Equiv.sumComm_symm, β submatrix_mul_equiv _ _ _ (Equiv.sumComm n m), β
submatrix_mul_equiv _ _ _ (Equiv.sumComm n l), Equiv.sumComm_apply,
fromBlocks_submatrix_sum_swap_sum_swap] using fromBlocks_eq_of_invertibleββ D C B A
#align matrix.from_blocks_eq_of_invertibleββ Matrix.fromBlocks_eq_of_invertibleββ
section Det
theorem det_fromBlocksββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix n m Ξ±)
(D : Matrix n n Ξ±) [Invertible A] :
(Matrix.fromBlocks A B C D).det = det A * det (D - C * β
A * B) := by
rw [fromBlocks_eq_of_invertibleββ (A := A), det_mul, det_mul, det_fromBlocks_zeroββ,
det_fromBlocks_zeroββ, det_fromBlocks_zeroββ, det_one, det_one, one_mul, one_mul, mul_one]
#align matrix.det_from_blocksββ Matrix.det_fromBlocksββ
@[simp]
theorem det_fromBlocks_oneββ (B : Matrix m n Ξ±) (C : Matrix n m Ξ±) (D : Matrix n n Ξ±) :
(Matrix.fromBlocks 1 B C D).det = det (D - C * B) := by
haveI : Invertible (1 : Matrix m m Ξ±) := invertibleOne
rw [det_fromBlocksββ, invOf_one, Matrix.mul_one, det_one, one_mul]
#align matrix.det_from_blocks_oneββ Matrix.det_fromBlocks_oneββ
theorem det_fromBlocksββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix n m Ξ±)
(D : Matrix n n Ξ±) [Invertible D] :
(Matrix.fromBlocks A B C D).det = det D * det (A - B * β
D * C) := by
have : fromBlocks A B C D =
(fromBlocks D C B A).submatrix (Equiv.sumComm _ _) (Equiv.sumComm _ _) := by
ext (i j)
cases i <;> cases j <;> rfl
rw [this, det_submatrix_equiv_self, det_fromBlocksββ]
#align matrix.det_from_blocksββ Matrix.det_fromBlocksββ
@[simp]
theorem det_fromBlocks_oneββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix n m Ξ±) :
(Matrix.fromBlocks A B C 1).det = det (A - B * C) := by
haveI : Invertible (1 : Matrix n n Ξ±) := invertibleOne
rw [det_fromBlocksββ, invOf_one, Matrix.mul_one, det_one, one_mul]
#align matrix.det_from_blocks_oneββ Matrix.det_fromBlocks_oneββ
theorem det_one_add_mul_comm (A : Matrix m n Ξ±) (B : Matrix n m Ξ±) :
det (1 + A * B) = det (1 + B * A) :=
calc
det (1 + A * B) = det (fromBlocks 1 (-A) B 1) := by
rw [det_fromBlocks_oneββ, Matrix.neg_mul, sub_neg_eq_add]
_ = det (1 + B * A) := by rw [det_fromBlocks_oneββ, Matrix.mul_neg, sub_neg_eq_add]
#align matrix.det_one_add_mul_comm Matrix.det_one_add_mul_comm
| Mathlib/LinearAlgebra/Matrix/SchurComplement.lean | 434 | 435 | theorem det_mul_add_one_comm (A : Matrix m n Ξ±) (B : Matrix n m Ξ±) :
det (A * B + 1) = det (B * A + 1) := by | rw [add_comm, det_one_add_mul_comm, add_comm]
| 1 | 2.718282 | 0 | 1.1875 | 16 | 1,248 |
import Mathlib.Data.Matrix.Invertible
import Mathlib.LinearAlgebra.Matrix.NonsingularInverse
import Mathlib.LinearAlgebra.Matrix.PosDef
#align_import linear_algebra.matrix.schur_complement from "leanprover-community/mathlib"@"a176cb1219e300e85793d44583dede42377b51af"
variable {l m n Ξ± : Type*}
namespace Matrix
open scoped Matrix
section CommRing
variable [Fintype l] [Fintype m] [Fintype n]
variable [DecidableEq l] [DecidableEq m] [DecidableEq n]
variable [CommRing Ξ±]
theorem fromBlocks_eq_of_invertibleββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix l m Ξ±)
(D : Matrix l n Ξ±) [Invertible A] :
fromBlocks A B C D =
fromBlocks 1 0 (C * β
A) 1 * fromBlocks A 0 0 (D - C * β
A * B) *
fromBlocks 1 (β
A * B) 0 1 := by
simp only [fromBlocks_multiply, Matrix.mul_zero, Matrix.zero_mul, add_zero, zero_add,
Matrix.one_mul, Matrix.mul_one, invOf_mul_self, Matrix.mul_invOf_self_assoc,
Matrix.mul_invOf_mul_self_cancel, Matrix.mul_assoc, add_sub_cancel]
#align matrix.from_blocks_eq_of_invertibleββ Matrix.fromBlocks_eq_of_invertibleββ
theorem fromBlocks_eq_of_invertibleββ (A : Matrix l m Ξ±) (B : Matrix l n Ξ±) (C : Matrix n m Ξ±)
(D : Matrix n n Ξ±) [Invertible D] :
fromBlocks A B C D =
fromBlocks 1 (B * β
D) 0 1 * fromBlocks (A - B * β
D * C) 0 0 D *
fromBlocks 1 0 (β
D * C) 1 :=
(Matrix.reindex (Equiv.sumComm _ _) (Equiv.sumComm _ _)).injective <| by
simpa [reindex_apply, Equiv.sumComm_symm, β submatrix_mul_equiv _ _ _ (Equiv.sumComm n m), β
submatrix_mul_equiv _ _ _ (Equiv.sumComm n l), Equiv.sumComm_apply,
fromBlocks_submatrix_sum_swap_sum_swap] using fromBlocks_eq_of_invertibleββ D C B A
#align matrix.from_blocks_eq_of_invertibleββ Matrix.fromBlocks_eq_of_invertibleββ
section Det
theorem det_fromBlocksββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix n m Ξ±)
(D : Matrix n n Ξ±) [Invertible A] :
(Matrix.fromBlocks A B C D).det = det A * det (D - C * β
A * B) := by
rw [fromBlocks_eq_of_invertibleββ (A := A), det_mul, det_mul, det_fromBlocks_zeroββ,
det_fromBlocks_zeroββ, det_fromBlocks_zeroββ, det_one, det_one, one_mul, one_mul, mul_one]
#align matrix.det_from_blocksββ Matrix.det_fromBlocksββ
@[simp]
theorem det_fromBlocks_oneββ (B : Matrix m n Ξ±) (C : Matrix n m Ξ±) (D : Matrix n n Ξ±) :
(Matrix.fromBlocks 1 B C D).det = det (D - C * B) := by
haveI : Invertible (1 : Matrix m m Ξ±) := invertibleOne
rw [det_fromBlocksββ, invOf_one, Matrix.mul_one, det_one, one_mul]
#align matrix.det_from_blocks_oneββ Matrix.det_fromBlocks_oneββ
theorem det_fromBlocksββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix n m Ξ±)
(D : Matrix n n Ξ±) [Invertible D] :
(Matrix.fromBlocks A B C D).det = det D * det (A - B * β
D * C) := by
have : fromBlocks A B C D =
(fromBlocks D C B A).submatrix (Equiv.sumComm _ _) (Equiv.sumComm _ _) := by
ext (i j)
cases i <;> cases j <;> rfl
rw [this, det_submatrix_equiv_self, det_fromBlocksββ]
#align matrix.det_from_blocksββ Matrix.det_fromBlocksββ
@[simp]
theorem det_fromBlocks_oneββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix n m Ξ±) :
(Matrix.fromBlocks A B C 1).det = det (A - B * C) := by
haveI : Invertible (1 : Matrix n n Ξ±) := invertibleOne
rw [det_fromBlocksββ, invOf_one, Matrix.mul_one, det_one, one_mul]
#align matrix.det_from_blocks_oneββ Matrix.det_fromBlocks_oneββ
theorem det_one_add_mul_comm (A : Matrix m n Ξ±) (B : Matrix n m Ξ±) :
det (1 + A * B) = det (1 + B * A) :=
calc
det (1 + A * B) = det (fromBlocks 1 (-A) B 1) := by
rw [det_fromBlocks_oneββ, Matrix.neg_mul, sub_neg_eq_add]
_ = det (1 + B * A) := by rw [det_fromBlocks_oneββ, Matrix.mul_neg, sub_neg_eq_add]
#align matrix.det_one_add_mul_comm Matrix.det_one_add_mul_comm
theorem det_mul_add_one_comm (A : Matrix m n Ξ±) (B : Matrix n m Ξ±) :
det (A * B + 1) = det (B * A + 1) := by rw [add_comm, det_one_add_mul_comm, add_comm]
#align matrix.det_mul_add_one_comm Matrix.det_mul_add_one_comm
| Mathlib/LinearAlgebra/Matrix/SchurComplement.lean | 438 | 440 | theorem det_one_sub_mul_comm (A : Matrix m n Ξ±) (B : Matrix n m Ξ±) :
det (1 - A * B) = det (1 - B * A) := by |
rw [sub_eq_add_neg, β Matrix.neg_mul, det_one_add_mul_comm, Matrix.mul_neg, β sub_eq_add_neg]
| 1 | 2.718282 | 0 | 1.1875 | 16 | 1,248 |
import Mathlib.Data.Matrix.Invertible
import Mathlib.LinearAlgebra.Matrix.NonsingularInverse
import Mathlib.LinearAlgebra.Matrix.PosDef
#align_import linear_algebra.matrix.schur_complement from "leanprover-community/mathlib"@"a176cb1219e300e85793d44583dede42377b51af"
variable {l m n Ξ± : Type*}
namespace Matrix
open scoped Matrix
section CommRing
variable [Fintype l] [Fintype m] [Fintype n]
variable [DecidableEq l] [DecidableEq m] [DecidableEq n]
variable [CommRing Ξ±]
theorem fromBlocks_eq_of_invertibleββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix l m Ξ±)
(D : Matrix l n Ξ±) [Invertible A] :
fromBlocks A B C D =
fromBlocks 1 0 (C * β
A) 1 * fromBlocks A 0 0 (D - C * β
A * B) *
fromBlocks 1 (β
A * B) 0 1 := by
simp only [fromBlocks_multiply, Matrix.mul_zero, Matrix.zero_mul, add_zero, zero_add,
Matrix.one_mul, Matrix.mul_one, invOf_mul_self, Matrix.mul_invOf_self_assoc,
Matrix.mul_invOf_mul_self_cancel, Matrix.mul_assoc, add_sub_cancel]
#align matrix.from_blocks_eq_of_invertibleββ Matrix.fromBlocks_eq_of_invertibleββ
theorem fromBlocks_eq_of_invertibleββ (A : Matrix l m Ξ±) (B : Matrix l n Ξ±) (C : Matrix n m Ξ±)
(D : Matrix n n Ξ±) [Invertible D] :
fromBlocks A B C D =
fromBlocks 1 (B * β
D) 0 1 * fromBlocks (A - B * β
D * C) 0 0 D *
fromBlocks 1 0 (β
D * C) 1 :=
(Matrix.reindex (Equiv.sumComm _ _) (Equiv.sumComm _ _)).injective <| by
simpa [reindex_apply, Equiv.sumComm_symm, β submatrix_mul_equiv _ _ _ (Equiv.sumComm n m), β
submatrix_mul_equiv _ _ _ (Equiv.sumComm n l), Equiv.sumComm_apply,
fromBlocks_submatrix_sum_swap_sum_swap] using fromBlocks_eq_of_invertibleββ D C B A
#align matrix.from_blocks_eq_of_invertibleββ Matrix.fromBlocks_eq_of_invertibleββ
section Det
theorem det_fromBlocksββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix n m Ξ±)
(D : Matrix n n Ξ±) [Invertible A] :
(Matrix.fromBlocks A B C D).det = det A * det (D - C * β
A * B) := by
rw [fromBlocks_eq_of_invertibleββ (A := A), det_mul, det_mul, det_fromBlocks_zeroββ,
det_fromBlocks_zeroββ, det_fromBlocks_zeroββ, det_one, det_one, one_mul, one_mul, mul_one]
#align matrix.det_from_blocksββ Matrix.det_fromBlocksββ
@[simp]
theorem det_fromBlocks_oneββ (B : Matrix m n Ξ±) (C : Matrix n m Ξ±) (D : Matrix n n Ξ±) :
(Matrix.fromBlocks 1 B C D).det = det (D - C * B) := by
haveI : Invertible (1 : Matrix m m Ξ±) := invertibleOne
rw [det_fromBlocksββ, invOf_one, Matrix.mul_one, det_one, one_mul]
#align matrix.det_from_blocks_oneββ Matrix.det_fromBlocks_oneββ
theorem det_fromBlocksββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix n m Ξ±)
(D : Matrix n n Ξ±) [Invertible D] :
(Matrix.fromBlocks A B C D).det = det D * det (A - B * β
D * C) := by
have : fromBlocks A B C D =
(fromBlocks D C B A).submatrix (Equiv.sumComm _ _) (Equiv.sumComm _ _) := by
ext (i j)
cases i <;> cases j <;> rfl
rw [this, det_submatrix_equiv_self, det_fromBlocksββ]
#align matrix.det_from_blocksββ Matrix.det_fromBlocksββ
@[simp]
theorem det_fromBlocks_oneββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix n m Ξ±) :
(Matrix.fromBlocks A B C 1).det = det (A - B * C) := by
haveI : Invertible (1 : Matrix n n Ξ±) := invertibleOne
rw [det_fromBlocksββ, invOf_one, Matrix.mul_one, det_one, one_mul]
#align matrix.det_from_blocks_oneββ Matrix.det_fromBlocks_oneββ
theorem det_one_add_mul_comm (A : Matrix m n Ξ±) (B : Matrix n m Ξ±) :
det (1 + A * B) = det (1 + B * A) :=
calc
det (1 + A * B) = det (fromBlocks 1 (-A) B 1) := by
rw [det_fromBlocks_oneββ, Matrix.neg_mul, sub_neg_eq_add]
_ = det (1 + B * A) := by rw [det_fromBlocks_oneββ, Matrix.mul_neg, sub_neg_eq_add]
#align matrix.det_one_add_mul_comm Matrix.det_one_add_mul_comm
theorem det_mul_add_one_comm (A : Matrix m n Ξ±) (B : Matrix n m Ξ±) :
det (A * B + 1) = det (B * A + 1) := by rw [add_comm, det_one_add_mul_comm, add_comm]
#align matrix.det_mul_add_one_comm Matrix.det_mul_add_one_comm
theorem det_one_sub_mul_comm (A : Matrix m n Ξ±) (B : Matrix n m Ξ±) :
det (1 - A * B) = det (1 - B * A) := by
rw [sub_eq_add_neg, β Matrix.neg_mul, det_one_add_mul_comm, Matrix.mul_neg, β sub_eq_add_neg]
#align matrix.det_one_sub_mul_comm Matrix.det_one_sub_mul_comm
| Mathlib/LinearAlgebra/Matrix/SchurComplement.lean | 444 | 446 | theorem det_one_add_col_mul_row (u v : m β Ξ±) : det (1 + col u * row v) = 1 + v β¬α΅₯ u := by |
rw [det_one_add_mul_comm, det_unique, Pi.add_apply, Pi.add_apply, Matrix.one_apply_eq,
Matrix.row_mul_col_apply]
| 2 | 7.389056 | 1 | 1.1875 | 16 | 1,248 |
import Mathlib.Data.Matrix.Invertible
import Mathlib.LinearAlgebra.Matrix.NonsingularInverse
import Mathlib.LinearAlgebra.Matrix.PosDef
#align_import linear_algebra.matrix.schur_complement from "leanprover-community/mathlib"@"a176cb1219e300e85793d44583dede42377b51af"
variable {l m n Ξ± : Type*}
namespace Matrix
open scoped Matrix
section CommRing
variable [Fintype l] [Fintype m] [Fintype n]
variable [DecidableEq l] [DecidableEq m] [DecidableEq n]
variable [CommRing Ξ±]
theorem fromBlocks_eq_of_invertibleββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix l m Ξ±)
(D : Matrix l n Ξ±) [Invertible A] :
fromBlocks A B C D =
fromBlocks 1 0 (C * β
A) 1 * fromBlocks A 0 0 (D - C * β
A * B) *
fromBlocks 1 (β
A * B) 0 1 := by
simp only [fromBlocks_multiply, Matrix.mul_zero, Matrix.zero_mul, add_zero, zero_add,
Matrix.one_mul, Matrix.mul_one, invOf_mul_self, Matrix.mul_invOf_self_assoc,
Matrix.mul_invOf_mul_self_cancel, Matrix.mul_assoc, add_sub_cancel]
#align matrix.from_blocks_eq_of_invertibleββ Matrix.fromBlocks_eq_of_invertibleββ
theorem fromBlocks_eq_of_invertibleββ (A : Matrix l m Ξ±) (B : Matrix l n Ξ±) (C : Matrix n m Ξ±)
(D : Matrix n n Ξ±) [Invertible D] :
fromBlocks A B C D =
fromBlocks 1 (B * β
D) 0 1 * fromBlocks (A - B * β
D * C) 0 0 D *
fromBlocks 1 0 (β
D * C) 1 :=
(Matrix.reindex (Equiv.sumComm _ _) (Equiv.sumComm _ _)).injective <| by
simpa [reindex_apply, Equiv.sumComm_symm, β submatrix_mul_equiv _ _ _ (Equiv.sumComm n m), β
submatrix_mul_equiv _ _ _ (Equiv.sumComm n l), Equiv.sumComm_apply,
fromBlocks_submatrix_sum_swap_sum_swap] using fromBlocks_eq_of_invertibleββ D C B A
#align matrix.from_blocks_eq_of_invertibleββ Matrix.fromBlocks_eq_of_invertibleββ
section Det
theorem det_fromBlocksββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix n m Ξ±)
(D : Matrix n n Ξ±) [Invertible A] :
(Matrix.fromBlocks A B C D).det = det A * det (D - C * β
A * B) := by
rw [fromBlocks_eq_of_invertibleββ (A := A), det_mul, det_mul, det_fromBlocks_zeroββ,
det_fromBlocks_zeroββ, det_fromBlocks_zeroββ, det_one, det_one, one_mul, one_mul, mul_one]
#align matrix.det_from_blocksββ Matrix.det_fromBlocksββ
@[simp]
theorem det_fromBlocks_oneββ (B : Matrix m n Ξ±) (C : Matrix n m Ξ±) (D : Matrix n n Ξ±) :
(Matrix.fromBlocks 1 B C D).det = det (D - C * B) := by
haveI : Invertible (1 : Matrix m m Ξ±) := invertibleOne
rw [det_fromBlocksββ, invOf_one, Matrix.mul_one, det_one, one_mul]
#align matrix.det_from_blocks_oneββ Matrix.det_fromBlocks_oneββ
theorem det_fromBlocksββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix n m Ξ±)
(D : Matrix n n Ξ±) [Invertible D] :
(Matrix.fromBlocks A B C D).det = det D * det (A - B * β
D * C) := by
have : fromBlocks A B C D =
(fromBlocks D C B A).submatrix (Equiv.sumComm _ _) (Equiv.sumComm _ _) := by
ext (i j)
cases i <;> cases j <;> rfl
rw [this, det_submatrix_equiv_self, det_fromBlocksββ]
#align matrix.det_from_blocksββ Matrix.det_fromBlocksββ
@[simp]
theorem det_fromBlocks_oneββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix n m Ξ±) :
(Matrix.fromBlocks A B C 1).det = det (A - B * C) := by
haveI : Invertible (1 : Matrix n n Ξ±) := invertibleOne
rw [det_fromBlocksββ, invOf_one, Matrix.mul_one, det_one, one_mul]
#align matrix.det_from_blocks_oneββ Matrix.det_fromBlocks_oneββ
theorem det_one_add_mul_comm (A : Matrix m n Ξ±) (B : Matrix n m Ξ±) :
det (1 + A * B) = det (1 + B * A) :=
calc
det (1 + A * B) = det (fromBlocks 1 (-A) B 1) := by
rw [det_fromBlocks_oneββ, Matrix.neg_mul, sub_neg_eq_add]
_ = det (1 + B * A) := by rw [det_fromBlocks_oneββ, Matrix.mul_neg, sub_neg_eq_add]
#align matrix.det_one_add_mul_comm Matrix.det_one_add_mul_comm
theorem det_mul_add_one_comm (A : Matrix m n Ξ±) (B : Matrix n m Ξ±) :
det (A * B + 1) = det (B * A + 1) := by rw [add_comm, det_one_add_mul_comm, add_comm]
#align matrix.det_mul_add_one_comm Matrix.det_mul_add_one_comm
theorem det_one_sub_mul_comm (A : Matrix m n Ξ±) (B : Matrix n m Ξ±) :
det (1 - A * B) = det (1 - B * A) := by
rw [sub_eq_add_neg, β Matrix.neg_mul, det_one_add_mul_comm, Matrix.mul_neg, β sub_eq_add_neg]
#align matrix.det_one_sub_mul_comm Matrix.det_one_sub_mul_comm
theorem det_one_add_col_mul_row (u v : m β Ξ±) : det (1 + col u * row v) = 1 + v β¬α΅₯ u := by
rw [det_one_add_mul_comm, det_unique, Pi.add_apply, Pi.add_apply, Matrix.one_apply_eq,
Matrix.row_mul_col_apply]
#align matrix.det_one_add_col_mul_row Matrix.det_one_add_col_mul_row
| Mathlib/LinearAlgebra/Matrix/SchurComplement.lean | 454 | 459 | theorem det_add_col_mul_row {A : Matrix m m Ξ±} (hA : IsUnit A.det) (u v : m β Ξ±) :
(A + col u * row v).det = A.det * (1 + row v * Aβ»ΒΉ * col u).det := by |
nth_rewrite 1 [β Matrix.mul_one A]
rwa [β Matrix.mul_nonsing_inv_cancel_left A (col u * row v),
β Matrix.mul_add, det_mul, β Matrix.mul_assoc, det_one_add_mul_comm,
β Matrix.mul_assoc]
| 4 | 54.59815 | 2 | 1.1875 | 16 | 1,248 |
import Mathlib.Data.Matrix.Invertible
import Mathlib.LinearAlgebra.Matrix.NonsingularInverse
import Mathlib.LinearAlgebra.Matrix.PosDef
#align_import linear_algebra.matrix.schur_complement from "leanprover-community/mathlib"@"a176cb1219e300e85793d44583dede42377b51af"
variable {l m n Ξ± : Type*}
namespace Matrix
open scoped Matrix
section CommRing
variable [Fintype l] [Fintype m] [Fintype n]
variable [DecidableEq l] [DecidableEq m] [DecidableEq n]
variable [CommRing Ξ±]
theorem fromBlocks_eq_of_invertibleββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix l m Ξ±)
(D : Matrix l n Ξ±) [Invertible A] :
fromBlocks A B C D =
fromBlocks 1 0 (C * β
A) 1 * fromBlocks A 0 0 (D - C * β
A * B) *
fromBlocks 1 (β
A * B) 0 1 := by
simp only [fromBlocks_multiply, Matrix.mul_zero, Matrix.zero_mul, add_zero, zero_add,
Matrix.one_mul, Matrix.mul_one, invOf_mul_self, Matrix.mul_invOf_self_assoc,
Matrix.mul_invOf_mul_self_cancel, Matrix.mul_assoc, add_sub_cancel]
#align matrix.from_blocks_eq_of_invertibleββ Matrix.fromBlocks_eq_of_invertibleββ
theorem fromBlocks_eq_of_invertibleββ (A : Matrix l m Ξ±) (B : Matrix l n Ξ±) (C : Matrix n m Ξ±)
(D : Matrix n n Ξ±) [Invertible D] :
fromBlocks A B C D =
fromBlocks 1 (B * β
D) 0 1 * fromBlocks (A - B * β
D * C) 0 0 D *
fromBlocks 1 0 (β
D * C) 1 :=
(Matrix.reindex (Equiv.sumComm _ _) (Equiv.sumComm _ _)).injective <| by
simpa [reindex_apply, Equiv.sumComm_symm, β submatrix_mul_equiv _ _ _ (Equiv.sumComm n m), β
submatrix_mul_equiv _ _ _ (Equiv.sumComm n l), Equiv.sumComm_apply,
fromBlocks_submatrix_sum_swap_sum_swap] using fromBlocks_eq_of_invertibleββ D C B A
#align matrix.from_blocks_eq_of_invertibleββ Matrix.fromBlocks_eq_of_invertibleββ
section StarOrderedRing
variable {π : Type*} [CommRing π] [PartialOrder π] [StarRing π] [StarOrderedRing π]
scoped infixl:65 " βα΅₯ " => Sum.elim
| Mathlib/LinearAlgebra/Matrix/SchurComplement.lean | 482 | 491 | theorem schur_complement_eqββ [Fintype m] [DecidableEq m] [Fintype n] {A : Matrix m m π}
(B : Matrix m n π) (D : Matrix n n π) (x : m β π) (y : n β π) [Invertible A]
(hA : A.IsHermitian) :
(star (x βα΅₯ y)) α΅₯* (fromBlocks A B Bα΄΄ D) β¬α΅₯ (x βα΅₯ y) =
(star (x + (Aβ»ΒΉ * B) *α΅₯ y)) α΅₯* A β¬α΅₯ (x + (Aβ»ΒΉ * B) *α΅₯ y) +
(star y) α΅₯* (D - Bα΄΄ * Aβ»ΒΉ * B) β¬α΅₯ y := by |
simp [Function.star_sum_elim, fromBlocks_mulVec, vecMul_fromBlocks, add_vecMul,
dotProduct_mulVec, vecMul_sub, Matrix.mul_assoc, vecMul_mulVec, hA.eq,
conjTranspose_nonsing_inv, star_mulVec]
abel
| 4 | 54.59815 | 2 | 1.1875 | 16 | 1,248 |
import Mathlib.Data.Matrix.Invertible
import Mathlib.LinearAlgebra.Matrix.NonsingularInverse
import Mathlib.LinearAlgebra.Matrix.PosDef
#align_import linear_algebra.matrix.schur_complement from "leanprover-community/mathlib"@"a176cb1219e300e85793d44583dede42377b51af"
variable {l m n Ξ± : Type*}
namespace Matrix
open scoped Matrix
section CommRing
variable [Fintype l] [Fintype m] [Fintype n]
variable [DecidableEq l] [DecidableEq m] [DecidableEq n]
variable [CommRing Ξ±]
theorem fromBlocks_eq_of_invertibleββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix l m Ξ±)
(D : Matrix l n Ξ±) [Invertible A] :
fromBlocks A B C D =
fromBlocks 1 0 (C * β
A) 1 * fromBlocks A 0 0 (D - C * β
A * B) *
fromBlocks 1 (β
A * B) 0 1 := by
simp only [fromBlocks_multiply, Matrix.mul_zero, Matrix.zero_mul, add_zero, zero_add,
Matrix.one_mul, Matrix.mul_one, invOf_mul_self, Matrix.mul_invOf_self_assoc,
Matrix.mul_invOf_mul_self_cancel, Matrix.mul_assoc, add_sub_cancel]
#align matrix.from_blocks_eq_of_invertibleββ Matrix.fromBlocks_eq_of_invertibleββ
theorem fromBlocks_eq_of_invertibleββ (A : Matrix l m Ξ±) (B : Matrix l n Ξ±) (C : Matrix n m Ξ±)
(D : Matrix n n Ξ±) [Invertible D] :
fromBlocks A B C D =
fromBlocks 1 (B * β
D) 0 1 * fromBlocks (A - B * β
D * C) 0 0 D *
fromBlocks 1 0 (β
D * C) 1 :=
(Matrix.reindex (Equiv.sumComm _ _) (Equiv.sumComm _ _)).injective <| by
simpa [reindex_apply, Equiv.sumComm_symm, β submatrix_mul_equiv _ _ _ (Equiv.sumComm n m), β
submatrix_mul_equiv _ _ _ (Equiv.sumComm n l), Equiv.sumComm_apply,
fromBlocks_submatrix_sum_swap_sum_swap] using fromBlocks_eq_of_invertibleββ D C B A
#align matrix.from_blocks_eq_of_invertibleββ Matrix.fromBlocks_eq_of_invertibleββ
section StarOrderedRing
variable {π : Type*} [CommRing π] [PartialOrder π] [StarRing π] [StarOrderedRing π]
scoped infixl:65 " βα΅₯ " => Sum.elim
theorem schur_complement_eqββ [Fintype m] [DecidableEq m] [Fintype n] {A : Matrix m m π}
(B : Matrix m n π) (D : Matrix n n π) (x : m β π) (y : n β π) [Invertible A]
(hA : A.IsHermitian) :
(star (x βα΅₯ y)) α΅₯* (fromBlocks A B Bα΄΄ D) β¬α΅₯ (x βα΅₯ y) =
(star (x + (Aβ»ΒΉ * B) *α΅₯ y)) α΅₯* A β¬α΅₯ (x + (Aβ»ΒΉ * B) *α΅₯ y) +
(star y) α΅₯* (D - Bα΄΄ * Aβ»ΒΉ * B) β¬α΅₯ y := by
simp [Function.star_sum_elim, fromBlocks_mulVec, vecMul_fromBlocks, add_vecMul,
dotProduct_mulVec, vecMul_sub, Matrix.mul_assoc, vecMul_mulVec, hA.eq,
conjTranspose_nonsing_inv, star_mulVec]
abel
#align matrix.schur_complement_eqββ Matrix.schur_complement_eqββ
| Mathlib/LinearAlgebra/Matrix/SchurComplement.lean | 494 | 503 | theorem schur_complement_eqββ [Fintype m] [Fintype n] [DecidableEq n] (A : Matrix m m π)
(B : Matrix m n π) {D : Matrix n n π} (x : m β π) (y : n β π) [Invertible D]
(hD : D.IsHermitian) :
(star (x βα΅₯ y)) α΅₯* (fromBlocks A B Bα΄΄ D) β¬α΅₯ (x βα΅₯ y) =
(star ((Dβ»ΒΉ * Bα΄΄) *α΅₯ x + y)) α΅₯* D β¬α΅₯ ((Dβ»ΒΉ * Bα΄΄) *α΅₯ x + y) +
(star x) α΅₯* (A - B * Dβ»ΒΉ * Bα΄΄) β¬α΅₯ x := by |
simp [Function.star_sum_elim, fromBlocks_mulVec, vecMul_fromBlocks, add_vecMul,
dotProduct_mulVec, vecMul_sub, Matrix.mul_assoc, vecMul_mulVec, hD.eq,
conjTranspose_nonsing_inv, star_mulVec]
abel
| 4 | 54.59815 | 2 | 1.1875 | 16 | 1,248 |
import Mathlib.Data.Matrix.Invertible
import Mathlib.LinearAlgebra.Matrix.NonsingularInverse
import Mathlib.LinearAlgebra.Matrix.PosDef
#align_import linear_algebra.matrix.schur_complement from "leanprover-community/mathlib"@"a176cb1219e300e85793d44583dede42377b51af"
variable {l m n Ξ± : Type*}
namespace Matrix
open scoped Matrix
section CommRing
variable [Fintype l] [Fintype m] [Fintype n]
variable [DecidableEq l] [DecidableEq m] [DecidableEq n]
variable [CommRing Ξ±]
theorem fromBlocks_eq_of_invertibleββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix l m Ξ±)
(D : Matrix l n Ξ±) [Invertible A] :
fromBlocks A B C D =
fromBlocks 1 0 (C * β
A) 1 * fromBlocks A 0 0 (D - C * β
A * B) *
fromBlocks 1 (β
A * B) 0 1 := by
simp only [fromBlocks_multiply, Matrix.mul_zero, Matrix.zero_mul, add_zero, zero_add,
Matrix.one_mul, Matrix.mul_one, invOf_mul_self, Matrix.mul_invOf_self_assoc,
Matrix.mul_invOf_mul_self_cancel, Matrix.mul_assoc, add_sub_cancel]
#align matrix.from_blocks_eq_of_invertibleββ Matrix.fromBlocks_eq_of_invertibleββ
theorem fromBlocks_eq_of_invertibleββ (A : Matrix l m Ξ±) (B : Matrix l n Ξ±) (C : Matrix n m Ξ±)
(D : Matrix n n Ξ±) [Invertible D] :
fromBlocks A B C D =
fromBlocks 1 (B * β
D) 0 1 * fromBlocks (A - B * β
D * C) 0 0 D *
fromBlocks 1 0 (β
D * C) 1 :=
(Matrix.reindex (Equiv.sumComm _ _) (Equiv.sumComm _ _)).injective <| by
simpa [reindex_apply, Equiv.sumComm_symm, β submatrix_mul_equiv _ _ _ (Equiv.sumComm n m), β
submatrix_mul_equiv _ _ _ (Equiv.sumComm n l), Equiv.sumComm_apply,
fromBlocks_submatrix_sum_swap_sum_swap] using fromBlocks_eq_of_invertibleββ D C B A
#align matrix.from_blocks_eq_of_invertibleββ Matrix.fromBlocks_eq_of_invertibleββ
section StarOrderedRing
variable {π : Type*} [CommRing π] [PartialOrder π] [StarRing π] [StarOrderedRing π]
scoped infixl:65 " βα΅₯ " => Sum.elim
theorem schur_complement_eqββ [Fintype m] [DecidableEq m] [Fintype n] {A : Matrix m m π}
(B : Matrix m n π) (D : Matrix n n π) (x : m β π) (y : n β π) [Invertible A]
(hA : A.IsHermitian) :
(star (x βα΅₯ y)) α΅₯* (fromBlocks A B Bα΄΄ D) β¬α΅₯ (x βα΅₯ y) =
(star (x + (Aβ»ΒΉ * B) *α΅₯ y)) α΅₯* A β¬α΅₯ (x + (Aβ»ΒΉ * B) *α΅₯ y) +
(star y) α΅₯* (D - Bα΄΄ * Aβ»ΒΉ * B) β¬α΅₯ y := by
simp [Function.star_sum_elim, fromBlocks_mulVec, vecMul_fromBlocks, add_vecMul,
dotProduct_mulVec, vecMul_sub, Matrix.mul_assoc, vecMul_mulVec, hA.eq,
conjTranspose_nonsing_inv, star_mulVec]
abel
#align matrix.schur_complement_eqββ Matrix.schur_complement_eqββ
theorem schur_complement_eqββ [Fintype m] [Fintype n] [DecidableEq n] (A : Matrix m m π)
(B : Matrix m n π) {D : Matrix n n π} (x : m β π) (y : n β π) [Invertible D]
(hD : D.IsHermitian) :
(star (x βα΅₯ y)) α΅₯* (fromBlocks A B Bα΄΄ D) β¬α΅₯ (x βα΅₯ y) =
(star ((Dβ»ΒΉ * Bα΄΄) *α΅₯ x + y)) α΅₯* D β¬α΅₯ ((Dβ»ΒΉ * Bα΄΄) *α΅₯ x + y) +
(star x) α΅₯* (A - B * Dβ»ΒΉ * Bα΄΄) β¬α΅₯ x := by
simp [Function.star_sum_elim, fromBlocks_mulVec, vecMul_fromBlocks, add_vecMul,
dotProduct_mulVec, vecMul_sub, Matrix.mul_assoc, vecMul_mulVec, hD.eq,
conjTranspose_nonsing_inv, star_mulVec]
abel
#align matrix.schur_complement_eqββ Matrix.schur_complement_eqββ
| Mathlib/LinearAlgebra/Matrix/SchurComplement.lean | 506 | 519 | theorem IsHermitian.fromBlocksββ [Fintype m] [DecidableEq m] {A : Matrix m m π} (B : Matrix m n π)
(D : Matrix n n π) (hA : A.IsHermitian) :
(Matrix.fromBlocks A B Bα΄΄ D).IsHermitian β (D - Bα΄΄ * Aβ»ΒΉ * B).IsHermitian := by |
have hBAB : (Bα΄΄ * Aβ»ΒΉ * B).IsHermitian := by
apply isHermitian_conjTranspose_mul_mul
apply hA.inv
rw [isHermitian_fromBlocks_iff]
constructor
Β· intro h
apply IsHermitian.sub h.2.2.2 hBAB
Β· intro h
refine β¨hA, rfl, conjTranspose_conjTranspose B, ?_β©
rw [β sub_add_cancel D]
apply IsHermitian.add h hBAB
| 11 | 59,874.141715 | 2 | 1.1875 | 16 | 1,248 |
import Mathlib.Data.Matrix.Invertible
import Mathlib.LinearAlgebra.Matrix.NonsingularInverse
import Mathlib.LinearAlgebra.Matrix.PosDef
#align_import linear_algebra.matrix.schur_complement from "leanprover-community/mathlib"@"a176cb1219e300e85793d44583dede42377b51af"
variable {l m n Ξ± : Type*}
namespace Matrix
open scoped Matrix
section CommRing
variable [Fintype l] [Fintype m] [Fintype n]
variable [DecidableEq l] [DecidableEq m] [DecidableEq n]
variable [CommRing Ξ±]
theorem fromBlocks_eq_of_invertibleββ (A : Matrix m m Ξ±) (B : Matrix m n Ξ±) (C : Matrix l m Ξ±)
(D : Matrix l n Ξ±) [Invertible A] :
fromBlocks A B C D =
fromBlocks 1 0 (C * β
A) 1 * fromBlocks A 0 0 (D - C * β
A * B) *
fromBlocks 1 (β
A * B) 0 1 := by
simp only [fromBlocks_multiply, Matrix.mul_zero, Matrix.zero_mul, add_zero, zero_add,
Matrix.one_mul, Matrix.mul_one, invOf_mul_self, Matrix.mul_invOf_self_assoc,
Matrix.mul_invOf_mul_self_cancel, Matrix.mul_assoc, add_sub_cancel]
#align matrix.from_blocks_eq_of_invertibleββ Matrix.fromBlocks_eq_of_invertibleββ
theorem fromBlocks_eq_of_invertibleββ (A : Matrix l m Ξ±) (B : Matrix l n Ξ±) (C : Matrix n m Ξ±)
(D : Matrix n n Ξ±) [Invertible D] :
fromBlocks A B C D =
fromBlocks 1 (B * β
D) 0 1 * fromBlocks (A - B * β
D * C) 0 0 D *
fromBlocks 1 0 (β
D * C) 1 :=
(Matrix.reindex (Equiv.sumComm _ _) (Equiv.sumComm _ _)).injective <| by
simpa [reindex_apply, Equiv.sumComm_symm, β submatrix_mul_equiv _ _ _ (Equiv.sumComm n m), β
submatrix_mul_equiv _ _ _ (Equiv.sumComm n l), Equiv.sumComm_apply,
fromBlocks_submatrix_sum_swap_sum_swap] using fromBlocks_eq_of_invertibleββ D C B A
#align matrix.from_blocks_eq_of_invertibleββ Matrix.fromBlocks_eq_of_invertibleββ
section StarOrderedRing
variable {π : Type*} [CommRing π] [PartialOrder π] [StarRing π] [StarOrderedRing π]
scoped infixl:65 " βα΅₯ " => Sum.elim
theorem schur_complement_eqββ [Fintype m] [DecidableEq m] [Fintype n] {A : Matrix m m π}
(B : Matrix m n π) (D : Matrix n n π) (x : m β π) (y : n β π) [Invertible A]
(hA : A.IsHermitian) :
(star (x βα΅₯ y)) α΅₯* (fromBlocks A B Bα΄΄ D) β¬α΅₯ (x βα΅₯ y) =
(star (x + (Aβ»ΒΉ * B) *α΅₯ y)) α΅₯* A β¬α΅₯ (x + (Aβ»ΒΉ * B) *α΅₯ y) +
(star y) α΅₯* (D - Bα΄΄ * Aβ»ΒΉ * B) β¬α΅₯ y := by
simp [Function.star_sum_elim, fromBlocks_mulVec, vecMul_fromBlocks, add_vecMul,
dotProduct_mulVec, vecMul_sub, Matrix.mul_assoc, vecMul_mulVec, hA.eq,
conjTranspose_nonsing_inv, star_mulVec]
abel
#align matrix.schur_complement_eqββ Matrix.schur_complement_eqββ
theorem schur_complement_eqββ [Fintype m] [Fintype n] [DecidableEq n] (A : Matrix m m π)
(B : Matrix m n π) {D : Matrix n n π} (x : m β π) (y : n β π) [Invertible D]
(hD : D.IsHermitian) :
(star (x βα΅₯ y)) α΅₯* (fromBlocks A B Bα΄΄ D) β¬α΅₯ (x βα΅₯ y) =
(star ((Dβ»ΒΉ * Bα΄΄) *α΅₯ x + y)) α΅₯* D β¬α΅₯ ((Dβ»ΒΉ * Bα΄΄) *α΅₯ x + y) +
(star x) α΅₯* (A - B * Dβ»ΒΉ * Bα΄΄) β¬α΅₯ x := by
simp [Function.star_sum_elim, fromBlocks_mulVec, vecMul_fromBlocks, add_vecMul,
dotProduct_mulVec, vecMul_sub, Matrix.mul_assoc, vecMul_mulVec, hD.eq,
conjTranspose_nonsing_inv, star_mulVec]
abel
#align matrix.schur_complement_eqββ Matrix.schur_complement_eqββ
theorem IsHermitian.fromBlocksββ [Fintype m] [DecidableEq m] {A : Matrix m m π} (B : Matrix m n π)
(D : Matrix n n π) (hA : A.IsHermitian) :
(Matrix.fromBlocks A B Bα΄΄ D).IsHermitian β (D - Bα΄΄ * Aβ»ΒΉ * B).IsHermitian := by
have hBAB : (Bα΄΄ * Aβ»ΒΉ * B).IsHermitian := by
apply isHermitian_conjTranspose_mul_mul
apply hA.inv
rw [isHermitian_fromBlocks_iff]
constructor
Β· intro h
apply IsHermitian.sub h.2.2.2 hBAB
Β· intro h
refine β¨hA, rfl, conjTranspose_conjTranspose B, ?_β©
rw [β sub_add_cancel D]
apply IsHermitian.add h hBAB
#align matrix.is_hermitian.from_blocksββ Matrix.IsHermitian.fromBlocksββ
| Mathlib/LinearAlgebra/Matrix/SchurComplement.lean | 522 | 527 | theorem IsHermitian.fromBlocksββ [Fintype n] [DecidableEq n] (A : Matrix m m π) (B : Matrix m n π)
{D : Matrix n n π} (hD : D.IsHermitian) :
(Matrix.fromBlocks A B Bα΄΄ D).IsHermitian β (A - B * Dβ»ΒΉ * Bα΄΄).IsHermitian := by |
rw [β isHermitian_submatrix_equiv (Equiv.sumComm n m), Equiv.sumComm_apply,
fromBlocks_submatrix_sum_swap_sum_swap]
convert IsHermitian.fromBlocksββ _ _ hD <;> simp
| 3 | 20.085537 | 1 | 1.1875 | 16 | 1,248 |
import Mathlib.Algebra.Module.Zlattice.Basic
import Mathlib.NumberTheory.NumberField.Embeddings
import Mathlib.NumberTheory.NumberField.FractionalIdeal
#align_import number_theory.number_field.canonical_embedding from "leanprover-community/mathlib"@"60da01b41bbe4206f05d34fd70c8dd7498717a30"
variable (K : Type*) [Field K]
namespace NumberField.canonicalEmbedding
open NumberField
def _root_.NumberField.canonicalEmbedding : K β+* ((K β+* β) β β) := Pi.ringHom fun Ο => Ο
theorem _root_.NumberField.canonicalEmbedding_injective [NumberField K] :
Function.Injective (NumberField.canonicalEmbedding K) := RingHom.injective _
variable {K}
@[simp]
theorem apply_at (Ο : K β+* β) (x : K) : (NumberField.canonicalEmbedding K x) Ο = Ο x := rfl
open scoped ComplexConjugate
| Mathlib/NumberTheory/NumberField/CanonicalEmbedding/Basic.lean | 61 | 70 | theorem conj_apply {x : ((K β+* β) β β)} (Ο : K β+* β)
(hx : x β Submodule.span β (Set.range (canonicalEmbedding K))) :
conj (x Ο) = x (ComplexEmbedding.conjugate Ο) := by |
refine Submodule.span_induction hx ?_ ?_ (fun _ _ hx hy => ?_) (fun a _ hx => ?_)
Β· rintro _ β¨x, rflβ©
rw [apply_at, apply_at, ComplexEmbedding.conjugate_coe_eq]
Β· rw [Pi.zero_apply, Pi.zero_apply, map_zero]
Β· rw [Pi.add_apply, Pi.add_apply, map_add, hx, hy]
Β· rw [Pi.smul_apply, Complex.real_smul, map_mul, Complex.conj_ofReal]
exact congrArg ((a : β) * Β·) hx
| 7 | 1,096.633158 | 2 | 1.1875 | 16 | 1,249 |
import Mathlib.Algebra.Module.Zlattice.Basic
import Mathlib.NumberTheory.NumberField.Embeddings
import Mathlib.NumberTheory.NumberField.FractionalIdeal
#align_import number_theory.number_field.canonical_embedding from "leanprover-community/mathlib"@"60da01b41bbe4206f05d34fd70c8dd7498717a30"
variable (K : Type*) [Field K]
namespace NumberField.canonicalEmbedding
open NumberField
def _root_.NumberField.canonicalEmbedding : K β+* ((K β+* β) β β) := Pi.ringHom fun Ο => Ο
theorem _root_.NumberField.canonicalEmbedding_injective [NumberField K] :
Function.Injective (NumberField.canonicalEmbedding K) := RingHom.injective _
variable {K}
@[simp]
theorem apply_at (Ο : K β+* β) (x : K) : (NumberField.canonicalEmbedding K x) Ο = Ο x := rfl
open scoped ComplexConjugate
theorem conj_apply {x : ((K β+* β) β β)} (Ο : K β+* β)
(hx : x β Submodule.span β (Set.range (canonicalEmbedding K))) :
conj (x Ο) = x (ComplexEmbedding.conjugate Ο) := by
refine Submodule.span_induction hx ?_ ?_ (fun _ _ hx hy => ?_) (fun a _ hx => ?_)
Β· rintro _ β¨x, rflβ©
rw [apply_at, apply_at, ComplexEmbedding.conjugate_coe_eq]
Β· rw [Pi.zero_apply, Pi.zero_apply, map_zero]
Β· rw [Pi.add_apply, Pi.add_apply, map_add, hx, hy]
Β· rw [Pi.smul_apply, Complex.real_smul, map_mul, Complex.conj_ofReal]
exact congrArg ((a : β) * Β·) hx
| Mathlib/NumberTheory/NumberField/CanonicalEmbedding/Basic.lean | 72 | 74 | theorem nnnorm_eq [NumberField K] (x : K) :
βcanonicalEmbedding K xββ = Finset.univ.sup (fun Ο : K β+* β => βΟ xββ) := by |
simp_rw [Pi.nnnorm_def, apply_at]
| 1 | 2.718282 | 0 | 1.1875 | 16 | 1,249 |
import Mathlib.Algebra.Module.Zlattice.Basic
import Mathlib.NumberTheory.NumberField.Embeddings
import Mathlib.NumberTheory.NumberField.FractionalIdeal
#align_import number_theory.number_field.canonical_embedding from "leanprover-community/mathlib"@"60da01b41bbe4206f05d34fd70c8dd7498717a30"
variable (K : Type*) [Field K]
namespace NumberField.canonicalEmbedding
open NumberField
def _root_.NumberField.canonicalEmbedding : K β+* ((K β+* β) β β) := Pi.ringHom fun Ο => Ο
theorem _root_.NumberField.canonicalEmbedding_injective [NumberField K] :
Function.Injective (NumberField.canonicalEmbedding K) := RingHom.injective _
variable {K}
@[simp]
theorem apply_at (Ο : K β+* β) (x : K) : (NumberField.canonicalEmbedding K x) Ο = Ο x := rfl
open scoped ComplexConjugate
theorem conj_apply {x : ((K β+* β) β β)} (Ο : K β+* β)
(hx : x β Submodule.span β (Set.range (canonicalEmbedding K))) :
conj (x Ο) = x (ComplexEmbedding.conjugate Ο) := by
refine Submodule.span_induction hx ?_ ?_ (fun _ _ hx hy => ?_) (fun a _ hx => ?_)
Β· rintro _ β¨x, rflβ©
rw [apply_at, apply_at, ComplexEmbedding.conjugate_coe_eq]
Β· rw [Pi.zero_apply, Pi.zero_apply, map_zero]
Β· rw [Pi.add_apply, Pi.add_apply, map_add, hx, hy]
Β· rw [Pi.smul_apply, Complex.real_smul, map_mul, Complex.conj_ofReal]
exact congrArg ((a : β) * Β·) hx
theorem nnnorm_eq [NumberField K] (x : K) :
βcanonicalEmbedding K xββ = Finset.univ.sup (fun Ο : K β+* β => βΟ xββ) := by
simp_rw [Pi.nnnorm_def, apply_at]
| Mathlib/NumberTheory/NumberField/CanonicalEmbedding/Basic.lean | 76 | 85 | theorem norm_le_iff [NumberField K] (x : K) (r : β) :
βcanonicalEmbedding K xβ β€ r β β Ο : K β+* β, βΟ xβ β€ r := by |
obtain hr | hr := lt_or_le r 0
Β· obtain β¨Οβ© := (inferInstance : Nonempty (K β+* β))
refine iff_of_false ?_ ?_
Β· exact (hr.trans_le (norm_nonneg _)).not_le
Β· exact fun h => hr.not_le (le_trans (norm_nonneg _) (h Ο))
Β· lift r to NNReal using hr
simp_rw [β coe_nnnorm, nnnorm_eq, NNReal.coe_le_coe, Finset.sup_le_iff, Finset.mem_univ,
forall_true_left]
| 8 | 2,980.957987 | 2 | 1.1875 | 16 | 1,249 |
import Mathlib.Algebra.Module.Zlattice.Basic
import Mathlib.NumberTheory.NumberField.Embeddings
import Mathlib.NumberTheory.NumberField.FractionalIdeal
#align_import number_theory.number_field.canonical_embedding from "leanprover-community/mathlib"@"60da01b41bbe4206f05d34fd70c8dd7498717a30"
variable (K : Type*) [Field K]
namespace NumberField.canonicalEmbedding
open NumberField
def _root_.NumberField.canonicalEmbedding : K β+* ((K β+* β) β β) := Pi.ringHom fun Ο => Ο
theorem _root_.NumberField.canonicalEmbedding_injective [NumberField K] :
Function.Injective (NumberField.canonicalEmbedding K) := RingHom.injective _
variable {K}
@[simp]
theorem apply_at (Ο : K β+* β) (x : K) : (NumberField.canonicalEmbedding K x) Ο = Ο x := rfl
open scoped ComplexConjugate
theorem conj_apply {x : ((K β+* β) β β)} (Ο : K β+* β)
(hx : x β Submodule.span β (Set.range (canonicalEmbedding K))) :
conj (x Ο) = x (ComplexEmbedding.conjugate Ο) := by
refine Submodule.span_induction hx ?_ ?_ (fun _ _ hx hy => ?_) (fun a _ hx => ?_)
Β· rintro _ β¨x, rflβ©
rw [apply_at, apply_at, ComplexEmbedding.conjugate_coe_eq]
Β· rw [Pi.zero_apply, Pi.zero_apply, map_zero]
Β· rw [Pi.add_apply, Pi.add_apply, map_add, hx, hy]
Β· rw [Pi.smul_apply, Complex.real_smul, map_mul, Complex.conj_ofReal]
exact congrArg ((a : β) * Β·) hx
theorem nnnorm_eq [NumberField K] (x : K) :
βcanonicalEmbedding K xββ = Finset.univ.sup (fun Ο : K β+* β => βΟ xββ) := by
simp_rw [Pi.nnnorm_def, apply_at]
theorem norm_le_iff [NumberField K] (x : K) (r : β) :
βcanonicalEmbedding K xβ β€ r β β Ο : K β+* β, βΟ xβ β€ r := by
obtain hr | hr := lt_or_le r 0
Β· obtain β¨Οβ© := (inferInstance : Nonempty (K β+* β))
refine iff_of_false ?_ ?_
Β· exact (hr.trans_le (norm_nonneg _)).not_le
Β· exact fun h => hr.not_le (le_trans (norm_nonneg _) (h Ο))
Β· lift r to NNReal using hr
simp_rw [β coe_nnnorm, nnnorm_eq, NNReal.coe_le_coe, Finset.sup_le_iff, Finset.mem_univ,
forall_true_left]
variable (K)
def integerLattice : Subring ((K β+* β) β β) :=
(RingHom.range (algebraMap (π K) K)).map (canonicalEmbedding K)
| Mathlib/NumberTheory/NumberField/CanonicalEmbedding/Basic.lean | 93 | 105 | theorem integerLattice.inter_ball_finite [NumberField K] (r : β) :
((integerLattice K : Set ((K β+* β) β β)) β© Metric.closedBall 0 r).Finite := by |
obtain hr | _ := lt_or_le r 0
Β· simp [Metric.closedBall_eq_empty.2 hr]
Β· have heq : β x, canonicalEmbedding K x β Metric.closedBall 0 r β
β Ο : K β+* β, βΟ xβ β€ r := by
intro x; rw [β norm_le_iff, mem_closedBall_zero_iff]
convert (Embeddings.finite_of_norm_le K β r).image (canonicalEmbedding K)
ext; constructor
Β· rintro β¨β¨_, β¨x, rflβ©, rflβ©, hxβ©
exact β¨x, β¨SetLike.coe_mem x, fun Ο => (heq _).mp hx Οβ©, rflβ©
Β· rintro β¨x, β¨hx1, hx2β©, rflβ©
exact β¨β¨x, β¨β¨x, hx1β©, rflβ©, rflβ©, (heq x).mpr hx2β©
| 11 | 59,874.141715 | 2 | 1.1875 | 16 | 1,249 |
import Mathlib.Algebra.Module.Zlattice.Basic
import Mathlib.NumberTheory.NumberField.Embeddings
import Mathlib.NumberTheory.NumberField.FractionalIdeal
#align_import number_theory.number_field.canonical_embedding from "leanprover-community/mathlib"@"60da01b41bbe4206f05d34fd70c8dd7498717a30"
variable (K : Type*) [Field K]
namespace NumberField.canonicalEmbedding
open NumberField
def _root_.NumberField.canonicalEmbedding : K β+* ((K β+* β) β β) := Pi.ringHom fun Ο => Ο
theorem _root_.NumberField.canonicalEmbedding_injective [NumberField K] :
Function.Injective (NumberField.canonicalEmbedding K) := RingHom.injective _
variable {K}
@[simp]
theorem apply_at (Ο : K β+* β) (x : K) : (NumberField.canonicalEmbedding K x) Ο = Ο x := rfl
open scoped ComplexConjugate
theorem conj_apply {x : ((K β+* β) β β)} (Ο : K β+* β)
(hx : x β Submodule.span β (Set.range (canonicalEmbedding K))) :
conj (x Ο) = x (ComplexEmbedding.conjugate Ο) := by
refine Submodule.span_induction hx ?_ ?_ (fun _ _ hx hy => ?_) (fun a _ hx => ?_)
Β· rintro _ β¨x, rflβ©
rw [apply_at, apply_at, ComplexEmbedding.conjugate_coe_eq]
Β· rw [Pi.zero_apply, Pi.zero_apply, map_zero]
Β· rw [Pi.add_apply, Pi.add_apply, map_add, hx, hy]
Β· rw [Pi.smul_apply, Complex.real_smul, map_mul, Complex.conj_ofReal]
exact congrArg ((a : β) * Β·) hx
theorem nnnorm_eq [NumberField K] (x : K) :
βcanonicalEmbedding K xββ = Finset.univ.sup (fun Ο : K β+* β => βΟ xββ) := by
simp_rw [Pi.nnnorm_def, apply_at]
theorem norm_le_iff [NumberField K] (x : K) (r : β) :
βcanonicalEmbedding K xβ β€ r β β Ο : K β+* β, βΟ xβ β€ r := by
obtain hr | hr := lt_or_le r 0
Β· obtain β¨Οβ© := (inferInstance : Nonempty (K β+* β))
refine iff_of_false ?_ ?_
Β· exact (hr.trans_le (norm_nonneg _)).not_le
Β· exact fun h => hr.not_le (le_trans (norm_nonneg _) (h Ο))
Β· lift r to NNReal using hr
simp_rw [β coe_nnnorm, nnnorm_eq, NNReal.coe_le_coe, Finset.sup_le_iff, Finset.mem_univ,
forall_true_left]
variable (K)
def integerLattice : Subring ((K β+* β) β β) :=
(RingHom.range (algebraMap (π K) K)).map (canonicalEmbedding K)
theorem integerLattice.inter_ball_finite [NumberField K] (r : β) :
((integerLattice K : Set ((K β+* β) β β)) β© Metric.closedBall 0 r).Finite := by
obtain hr | _ := lt_or_le r 0
Β· simp [Metric.closedBall_eq_empty.2 hr]
Β· have heq : β x, canonicalEmbedding K x β Metric.closedBall 0 r β
β Ο : K β+* β, βΟ xβ β€ r := by
intro x; rw [β norm_le_iff, mem_closedBall_zero_iff]
convert (Embeddings.finite_of_norm_le K β r).image (canonicalEmbedding K)
ext; constructor
Β· rintro β¨β¨_, β¨x, rflβ©, rflβ©, hxβ©
exact β¨x, β¨SetLike.coe_mem x, fun Ο => (heq _).mp hx Οβ©, rflβ©
Β· rintro β¨x, β¨hx1, hx2β©, rflβ©
exact β¨β¨x, β¨β¨x, hx1β©, rflβ©, rflβ©, (heq x).mpr hx2β©
open Module Fintype FiniteDimensional
noncomputable def latticeBasis [NumberField K] :
Basis (Free.ChooseBasisIndex β€ (π K)) β ((K β+* β) β β) := by
classical
-- Let `B` be the canonical basis of `(K β+* β) β β`. We prove that the determinant of
-- the image by `canonicalEmbedding` of the integral basis of `K` is nonzero. This
-- will imply the result.
let B := Pi.basisFun β (K β+* β)
let e : (K β+* β) β Free.ChooseBasisIndex β€ (π K) :=
equivOfCardEq ((Embeddings.card K β).trans (finrank_eq_card_basis (integralBasis K)))
let M := B.toMatrix (fun i => canonicalEmbedding K (integralBasis K (e i)))
suffices M.det β 0 by
rw [β isUnit_iff_ne_zero, β Basis.det_apply, β is_basis_iff_det] at this
refine basisOfLinearIndependentOfCardEqFinrank
((linearIndependent_equiv e.symm).mpr this.1) ?_
rw [β finrank_eq_card_chooseBasisIndex, RingOfIntegers.rank, finrank_fintype_fun_eq_card,
Embeddings.card]
-- In order to prove that the determinant is nonzero, we show that it is equal to the
-- square of the discriminant of the integral basis and thus it is not zero
let N := Algebra.embeddingsMatrixReindex β β (fun i => integralBasis K (e i))
RingHom.equivRatAlgHom
rw [show M = N.transpose by { ext:2; rfl }]
rw [Matrix.det_transpose, β pow_ne_zero_iff two_ne_zero]
convert (map_ne_zero_iff _ (algebraMap β β).injective).mpr
(Algebra.discr_not_zero_of_basis β (integralBasis K))
rw [β Algebra.discr_reindex β (integralBasis K) e.symm]
exact (Algebra.discr_eq_det_embeddingsMatrixReindex_pow_two β β
(fun i => integralBasis K (e i)) RingHom.equivRatAlgHom).symm
@[simp]
| Mathlib/NumberTheory/NumberField/CanonicalEmbedding/Basic.lean | 139 | 142 | theorem latticeBasis_apply [NumberField K] (i : Free.ChooseBasisIndex β€ (π K)) :
latticeBasis K i = (canonicalEmbedding K) (integralBasis K i) := by |
simp only [latticeBasis, integralBasis_apply, coe_basisOfLinearIndependentOfCardEqFinrank,
Function.comp_apply, Equiv.apply_symm_apply]
| 2 | 7.389056 | 1 | 1.1875 | 16 | 1,249 |
import Mathlib.Algebra.Module.Zlattice.Basic
import Mathlib.NumberTheory.NumberField.Embeddings
import Mathlib.NumberTheory.NumberField.FractionalIdeal
#align_import number_theory.number_field.canonical_embedding from "leanprover-community/mathlib"@"60da01b41bbe4206f05d34fd70c8dd7498717a30"
variable (K : Type*) [Field K]
namespace NumberField.mixedEmbedding
open NumberField NumberField.InfinitePlace FiniteDimensional Finset
local notation "E" K =>
({w : InfinitePlace K // IsReal w} β β) Γ ({w : InfinitePlace K // IsComplex w} β β)
noncomputable def _root_.NumberField.mixedEmbedding : K β+* (E K) :=
RingHom.prod (Pi.ringHom fun w => embedding_of_isReal w.prop)
(Pi.ringHom fun w => w.val.embedding)
instance [NumberField K] : Nontrivial (E K) := by
obtain β¨wβ© := (inferInstance : Nonempty (InfinitePlace K))
obtain hw | hw := w.isReal_or_isComplex
Β· have : Nonempty {w : InfinitePlace K // IsReal w} := β¨β¨w, hwβ©β©
exact nontrivial_prod_left
Β· have : Nonempty {w : InfinitePlace K // IsComplex w} := β¨β¨w, hwβ©β©
exact nontrivial_prod_right
protected theorem finrank [NumberField K] : finrank β (E K) = finrank β K := by
classical
rw [finrank_prod, finrank_pi, finrank_pi_fintype, Complex.finrank_real_complex, sum_const,
card_univ, β NrRealPlaces, β NrComplexPlaces, β card_real_embeddings, Algebra.id.smul_eq_mul,
mul_comm, β card_complex_embeddings, β NumberField.Embeddings.card K β,
Fintype.card_subtype_compl, Nat.add_sub_of_le (Fintype.card_subtype_le _)]
| Mathlib/NumberTheory/NumberField/CanonicalEmbedding/Basic.lean | 185 | 187 | theorem _root_.NumberField.mixedEmbedding_injective [NumberField K] :
Function.Injective (NumberField.mixedEmbedding K) := by |
exact RingHom.injective _
| 1 | 2.718282 | 0 | 1.1875 | 16 | 1,249 |
import Mathlib.Algebra.Module.Zlattice.Basic
import Mathlib.NumberTheory.NumberField.Embeddings
import Mathlib.NumberTheory.NumberField.FractionalIdeal
#align_import number_theory.number_field.canonical_embedding from "leanprover-community/mathlib"@"60da01b41bbe4206f05d34fd70c8dd7498717a30"
variable (K : Type*) [Field K]
namespace NumberField.mixedEmbedding
open NumberField NumberField.InfinitePlace FiniteDimensional Finset
local notation "E" K =>
({w : InfinitePlace K // IsReal w} β β) Γ ({w : InfinitePlace K // IsComplex w} β β)
noncomputable def _root_.NumberField.mixedEmbedding : K β+* (E K) :=
RingHom.prod (Pi.ringHom fun w => embedding_of_isReal w.prop)
(Pi.ringHom fun w => w.val.embedding)
instance [NumberField K] : Nontrivial (E K) := by
obtain β¨wβ© := (inferInstance : Nonempty (InfinitePlace K))
obtain hw | hw := w.isReal_or_isComplex
Β· have : Nonempty {w : InfinitePlace K // IsReal w} := β¨β¨w, hwβ©β©
exact nontrivial_prod_left
Β· have : Nonempty {w : InfinitePlace K // IsComplex w} := β¨β¨w, hwβ©β©
exact nontrivial_prod_right
protected theorem finrank [NumberField K] : finrank β (E K) = finrank β K := by
classical
rw [finrank_prod, finrank_pi, finrank_pi_fintype, Complex.finrank_real_complex, sum_const,
card_univ, β NrRealPlaces, β NrComplexPlaces, β card_real_embeddings, Algebra.id.smul_eq_mul,
mul_comm, β card_complex_embeddings, β NumberField.Embeddings.card K β,
Fintype.card_subtype_compl, Nat.add_sub_of_le (Fintype.card_subtype_le _)]
theorem _root_.NumberField.mixedEmbedding_injective [NumberField K] :
Function.Injective (NumberField.mixedEmbedding K) := by
exact RingHom.injective _
noncomputable section norm
open scoped Classical
variable {K}
def normAtPlace (w : InfinitePlace K) : (E K) β*β β where
toFun x := if hw : IsReal w then βx.1 β¨w, hwβ©β else βx.2 β¨w, not_isReal_iff_isComplex.mp hwβ©β
map_zero' := by simp
map_one' := by simp
map_mul' x y := by split_ifs <;> simp
| Mathlib/NumberTheory/NumberField/CanonicalEmbedding/Basic.lean | 259 | 262 | theorem normAtPlace_nonneg (w : InfinitePlace K) (x : E K) :
0 β€ normAtPlace w x := by |
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs <;> exact norm_nonneg _
| 2 | 7.389056 | 1 | 1.1875 | 16 | 1,249 |
import Mathlib.Algebra.Module.Zlattice.Basic
import Mathlib.NumberTheory.NumberField.Embeddings
import Mathlib.NumberTheory.NumberField.FractionalIdeal
#align_import number_theory.number_field.canonical_embedding from "leanprover-community/mathlib"@"60da01b41bbe4206f05d34fd70c8dd7498717a30"
variable (K : Type*) [Field K]
namespace NumberField.mixedEmbedding
open NumberField NumberField.InfinitePlace FiniteDimensional Finset
local notation "E" K =>
({w : InfinitePlace K // IsReal w} β β) Γ ({w : InfinitePlace K // IsComplex w} β β)
noncomputable def _root_.NumberField.mixedEmbedding : K β+* (E K) :=
RingHom.prod (Pi.ringHom fun w => embedding_of_isReal w.prop)
(Pi.ringHom fun w => w.val.embedding)
instance [NumberField K] : Nontrivial (E K) := by
obtain β¨wβ© := (inferInstance : Nonempty (InfinitePlace K))
obtain hw | hw := w.isReal_or_isComplex
Β· have : Nonempty {w : InfinitePlace K // IsReal w} := β¨β¨w, hwβ©β©
exact nontrivial_prod_left
Β· have : Nonempty {w : InfinitePlace K // IsComplex w} := β¨β¨w, hwβ©β©
exact nontrivial_prod_right
protected theorem finrank [NumberField K] : finrank β (E K) = finrank β K := by
classical
rw [finrank_prod, finrank_pi, finrank_pi_fintype, Complex.finrank_real_complex, sum_const,
card_univ, β NrRealPlaces, β NrComplexPlaces, β card_real_embeddings, Algebra.id.smul_eq_mul,
mul_comm, β card_complex_embeddings, β NumberField.Embeddings.card K β,
Fintype.card_subtype_compl, Nat.add_sub_of_le (Fintype.card_subtype_le _)]
theorem _root_.NumberField.mixedEmbedding_injective [NumberField K] :
Function.Injective (NumberField.mixedEmbedding K) := by
exact RingHom.injective _
noncomputable section norm
open scoped Classical
variable {K}
def normAtPlace (w : InfinitePlace K) : (E K) β*β β where
toFun x := if hw : IsReal w then βx.1 β¨w, hwβ©β else βx.2 β¨w, not_isReal_iff_isComplex.mp hwβ©β
map_zero' := by simp
map_one' := by simp
map_mul' x y := by split_ifs <;> simp
theorem normAtPlace_nonneg (w : InfinitePlace K) (x : E K) :
0 β€ normAtPlace w x := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs <;> exact norm_nonneg _
| Mathlib/NumberTheory/NumberField/CanonicalEmbedding/Basic.lean | 264 | 267 | theorem normAtPlace_neg (w : InfinitePlace K) (x : E K) :
normAtPlace w (- x) = normAtPlace w x := by |
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs <;> simp
| 2 | 7.389056 | 1 | 1.1875 | 16 | 1,249 |
import Mathlib.Algebra.Module.Zlattice.Basic
import Mathlib.NumberTheory.NumberField.Embeddings
import Mathlib.NumberTheory.NumberField.FractionalIdeal
#align_import number_theory.number_field.canonical_embedding from "leanprover-community/mathlib"@"60da01b41bbe4206f05d34fd70c8dd7498717a30"
variable (K : Type*) [Field K]
namespace NumberField.mixedEmbedding
open NumberField NumberField.InfinitePlace FiniteDimensional Finset
local notation "E" K =>
({w : InfinitePlace K // IsReal w} β β) Γ ({w : InfinitePlace K // IsComplex w} β β)
noncomputable def _root_.NumberField.mixedEmbedding : K β+* (E K) :=
RingHom.prod (Pi.ringHom fun w => embedding_of_isReal w.prop)
(Pi.ringHom fun w => w.val.embedding)
instance [NumberField K] : Nontrivial (E K) := by
obtain β¨wβ© := (inferInstance : Nonempty (InfinitePlace K))
obtain hw | hw := w.isReal_or_isComplex
Β· have : Nonempty {w : InfinitePlace K // IsReal w} := β¨β¨w, hwβ©β©
exact nontrivial_prod_left
Β· have : Nonempty {w : InfinitePlace K // IsComplex w} := β¨β¨w, hwβ©β©
exact nontrivial_prod_right
protected theorem finrank [NumberField K] : finrank β (E K) = finrank β K := by
classical
rw [finrank_prod, finrank_pi, finrank_pi_fintype, Complex.finrank_real_complex, sum_const,
card_univ, β NrRealPlaces, β NrComplexPlaces, β card_real_embeddings, Algebra.id.smul_eq_mul,
mul_comm, β card_complex_embeddings, β NumberField.Embeddings.card K β,
Fintype.card_subtype_compl, Nat.add_sub_of_le (Fintype.card_subtype_le _)]
theorem _root_.NumberField.mixedEmbedding_injective [NumberField K] :
Function.Injective (NumberField.mixedEmbedding K) := by
exact RingHom.injective _
noncomputable section norm
open scoped Classical
variable {K}
def normAtPlace (w : InfinitePlace K) : (E K) β*β β where
toFun x := if hw : IsReal w then βx.1 β¨w, hwβ©β else βx.2 β¨w, not_isReal_iff_isComplex.mp hwβ©β
map_zero' := by simp
map_one' := by simp
map_mul' x y := by split_ifs <;> simp
theorem normAtPlace_nonneg (w : InfinitePlace K) (x : E K) :
0 β€ normAtPlace w x := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs <;> exact norm_nonneg _
theorem normAtPlace_neg (w : InfinitePlace K) (x : E K) :
normAtPlace w (- x) = normAtPlace w x := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs <;> simp
| Mathlib/NumberTheory/NumberField/CanonicalEmbedding/Basic.lean | 269 | 272 | theorem normAtPlace_add_le (w : InfinitePlace K) (x y : E K) :
normAtPlace w (x + y) β€ normAtPlace w x + normAtPlace w y := by |
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs <;> exact norm_add_le _ _
| 2 | 7.389056 | 1 | 1.1875 | 16 | 1,249 |
import Mathlib.Algebra.Module.Zlattice.Basic
import Mathlib.NumberTheory.NumberField.Embeddings
import Mathlib.NumberTheory.NumberField.FractionalIdeal
#align_import number_theory.number_field.canonical_embedding from "leanprover-community/mathlib"@"60da01b41bbe4206f05d34fd70c8dd7498717a30"
variable (K : Type*) [Field K]
namespace NumberField.mixedEmbedding
open NumberField NumberField.InfinitePlace FiniteDimensional Finset
local notation "E" K =>
({w : InfinitePlace K // IsReal w} β β) Γ ({w : InfinitePlace K // IsComplex w} β β)
noncomputable def _root_.NumberField.mixedEmbedding : K β+* (E K) :=
RingHom.prod (Pi.ringHom fun w => embedding_of_isReal w.prop)
(Pi.ringHom fun w => w.val.embedding)
instance [NumberField K] : Nontrivial (E K) := by
obtain β¨wβ© := (inferInstance : Nonempty (InfinitePlace K))
obtain hw | hw := w.isReal_or_isComplex
Β· have : Nonempty {w : InfinitePlace K // IsReal w} := β¨β¨w, hwβ©β©
exact nontrivial_prod_left
Β· have : Nonempty {w : InfinitePlace K // IsComplex w} := β¨β¨w, hwβ©β©
exact nontrivial_prod_right
protected theorem finrank [NumberField K] : finrank β (E K) = finrank β K := by
classical
rw [finrank_prod, finrank_pi, finrank_pi_fintype, Complex.finrank_real_complex, sum_const,
card_univ, β NrRealPlaces, β NrComplexPlaces, β card_real_embeddings, Algebra.id.smul_eq_mul,
mul_comm, β card_complex_embeddings, β NumberField.Embeddings.card K β,
Fintype.card_subtype_compl, Nat.add_sub_of_le (Fintype.card_subtype_le _)]
theorem _root_.NumberField.mixedEmbedding_injective [NumberField K] :
Function.Injective (NumberField.mixedEmbedding K) := by
exact RingHom.injective _
noncomputable section norm
open scoped Classical
variable {K}
def normAtPlace (w : InfinitePlace K) : (E K) β*β β where
toFun x := if hw : IsReal w then βx.1 β¨w, hwβ©β else βx.2 β¨w, not_isReal_iff_isComplex.mp hwβ©β
map_zero' := by simp
map_one' := by simp
map_mul' x y := by split_ifs <;> simp
theorem normAtPlace_nonneg (w : InfinitePlace K) (x : E K) :
0 β€ normAtPlace w x := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs <;> exact norm_nonneg _
theorem normAtPlace_neg (w : InfinitePlace K) (x : E K) :
normAtPlace w (- x) = normAtPlace w x := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs <;> simp
theorem normAtPlace_add_le (w : InfinitePlace K) (x y : E K) :
normAtPlace w (x + y) β€ normAtPlace w x + normAtPlace w y := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs <;> exact norm_add_le _ _
| Mathlib/NumberTheory/NumberField/CanonicalEmbedding/Basic.lean | 274 | 279 | theorem normAtPlace_smul (w : InfinitePlace K) (x : E K) (c : β) :
normAtPlace w (c β’ x) = |c| * normAtPlace w x := by |
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs
Β· rw [Prod.smul_fst, Pi.smul_apply, norm_smul, Real.norm_eq_abs]
Β· rw [Prod.smul_snd, Pi.smul_apply, norm_smul, Real.norm_eq_abs, Complex.norm_eq_abs]
| 4 | 54.59815 | 2 | 1.1875 | 16 | 1,249 |
import Mathlib.Algebra.Module.Zlattice.Basic
import Mathlib.NumberTheory.NumberField.Embeddings
import Mathlib.NumberTheory.NumberField.FractionalIdeal
#align_import number_theory.number_field.canonical_embedding from "leanprover-community/mathlib"@"60da01b41bbe4206f05d34fd70c8dd7498717a30"
variable (K : Type*) [Field K]
namespace NumberField.mixedEmbedding
open NumberField NumberField.InfinitePlace FiniteDimensional Finset
local notation "E" K =>
({w : InfinitePlace K // IsReal w} β β) Γ ({w : InfinitePlace K // IsComplex w} β β)
noncomputable def _root_.NumberField.mixedEmbedding : K β+* (E K) :=
RingHom.prod (Pi.ringHom fun w => embedding_of_isReal w.prop)
(Pi.ringHom fun w => w.val.embedding)
instance [NumberField K] : Nontrivial (E K) := by
obtain β¨wβ© := (inferInstance : Nonempty (InfinitePlace K))
obtain hw | hw := w.isReal_or_isComplex
Β· have : Nonempty {w : InfinitePlace K // IsReal w} := β¨β¨w, hwβ©β©
exact nontrivial_prod_left
Β· have : Nonempty {w : InfinitePlace K // IsComplex w} := β¨β¨w, hwβ©β©
exact nontrivial_prod_right
protected theorem finrank [NumberField K] : finrank β (E K) = finrank β K := by
classical
rw [finrank_prod, finrank_pi, finrank_pi_fintype, Complex.finrank_real_complex, sum_const,
card_univ, β NrRealPlaces, β NrComplexPlaces, β card_real_embeddings, Algebra.id.smul_eq_mul,
mul_comm, β card_complex_embeddings, β NumberField.Embeddings.card K β,
Fintype.card_subtype_compl, Nat.add_sub_of_le (Fintype.card_subtype_le _)]
theorem _root_.NumberField.mixedEmbedding_injective [NumberField K] :
Function.Injective (NumberField.mixedEmbedding K) := by
exact RingHom.injective _
noncomputable section norm
open scoped Classical
variable {K}
def normAtPlace (w : InfinitePlace K) : (E K) β*β β where
toFun x := if hw : IsReal w then βx.1 β¨w, hwβ©β else βx.2 β¨w, not_isReal_iff_isComplex.mp hwβ©β
map_zero' := by simp
map_one' := by simp
map_mul' x y := by split_ifs <;> simp
theorem normAtPlace_nonneg (w : InfinitePlace K) (x : E K) :
0 β€ normAtPlace w x := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs <;> exact norm_nonneg _
theorem normAtPlace_neg (w : InfinitePlace K) (x : E K) :
normAtPlace w (- x) = normAtPlace w x := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs <;> simp
theorem normAtPlace_add_le (w : InfinitePlace K) (x y : E K) :
normAtPlace w (x + y) β€ normAtPlace w x + normAtPlace w y := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs <;> exact norm_add_le _ _
theorem normAtPlace_smul (w : InfinitePlace K) (x : E K) (c : β) :
normAtPlace w (c β’ x) = |c| * normAtPlace w x := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs
Β· rw [Prod.smul_fst, Pi.smul_apply, norm_smul, Real.norm_eq_abs]
Β· rw [Prod.smul_snd, Pi.smul_apply, norm_smul, Real.norm_eq_abs, Complex.norm_eq_abs]
| Mathlib/NumberTheory/NumberField/CanonicalEmbedding/Basic.lean | 281 | 284 | theorem normAtPlace_real (w : InfinitePlace K) (c : β) :
normAtPlace w ((fun _ β¦ c, fun _ β¦ c) : (E K)) = |c| := by |
rw [show ((fun _ β¦ c, fun _ β¦ c) : (E K)) = c β’ 1 by ext <;> simp, normAtPlace_smul, map_one,
mul_one]
| 2 | 7.389056 | 1 | 1.1875 | 16 | 1,249 |
import Mathlib.Algebra.Module.Zlattice.Basic
import Mathlib.NumberTheory.NumberField.Embeddings
import Mathlib.NumberTheory.NumberField.FractionalIdeal
#align_import number_theory.number_field.canonical_embedding from "leanprover-community/mathlib"@"60da01b41bbe4206f05d34fd70c8dd7498717a30"
variable (K : Type*) [Field K]
namespace NumberField.mixedEmbedding
open NumberField NumberField.InfinitePlace FiniteDimensional Finset
local notation "E" K =>
({w : InfinitePlace K // IsReal w} β β) Γ ({w : InfinitePlace K // IsComplex w} β β)
noncomputable def _root_.NumberField.mixedEmbedding : K β+* (E K) :=
RingHom.prod (Pi.ringHom fun w => embedding_of_isReal w.prop)
(Pi.ringHom fun w => w.val.embedding)
instance [NumberField K] : Nontrivial (E K) := by
obtain β¨wβ© := (inferInstance : Nonempty (InfinitePlace K))
obtain hw | hw := w.isReal_or_isComplex
Β· have : Nonempty {w : InfinitePlace K // IsReal w} := β¨β¨w, hwβ©β©
exact nontrivial_prod_left
Β· have : Nonempty {w : InfinitePlace K // IsComplex w} := β¨β¨w, hwβ©β©
exact nontrivial_prod_right
protected theorem finrank [NumberField K] : finrank β (E K) = finrank β K := by
classical
rw [finrank_prod, finrank_pi, finrank_pi_fintype, Complex.finrank_real_complex, sum_const,
card_univ, β NrRealPlaces, β NrComplexPlaces, β card_real_embeddings, Algebra.id.smul_eq_mul,
mul_comm, β card_complex_embeddings, β NumberField.Embeddings.card K β,
Fintype.card_subtype_compl, Nat.add_sub_of_le (Fintype.card_subtype_le _)]
theorem _root_.NumberField.mixedEmbedding_injective [NumberField K] :
Function.Injective (NumberField.mixedEmbedding K) := by
exact RingHom.injective _
noncomputable section norm
open scoped Classical
variable {K}
def normAtPlace (w : InfinitePlace K) : (E K) β*β β where
toFun x := if hw : IsReal w then βx.1 β¨w, hwβ©β else βx.2 β¨w, not_isReal_iff_isComplex.mp hwβ©β
map_zero' := by simp
map_one' := by simp
map_mul' x y := by split_ifs <;> simp
theorem normAtPlace_nonneg (w : InfinitePlace K) (x : E K) :
0 β€ normAtPlace w x := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs <;> exact norm_nonneg _
theorem normAtPlace_neg (w : InfinitePlace K) (x : E K) :
normAtPlace w (- x) = normAtPlace w x := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs <;> simp
theorem normAtPlace_add_le (w : InfinitePlace K) (x y : E K) :
normAtPlace w (x + y) β€ normAtPlace w x + normAtPlace w y := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs <;> exact norm_add_le _ _
theorem normAtPlace_smul (w : InfinitePlace K) (x : E K) (c : β) :
normAtPlace w (c β’ x) = |c| * normAtPlace w x := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs
Β· rw [Prod.smul_fst, Pi.smul_apply, norm_smul, Real.norm_eq_abs]
Β· rw [Prod.smul_snd, Pi.smul_apply, norm_smul, Real.norm_eq_abs, Complex.norm_eq_abs]
theorem normAtPlace_real (w : InfinitePlace K) (c : β) :
normAtPlace w ((fun _ β¦ c, fun _ β¦ c) : (E K)) = |c| := by
rw [show ((fun _ β¦ c, fun _ β¦ c) : (E K)) = c β’ 1 by ext <;> simp, normAtPlace_smul, map_one,
mul_one]
| Mathlib/NumberTheory/NumberField/CanonicalEmbedding/Basic.lean | 286 | 288 | theorem normAtPlace_apply_isReal {w : InfinitePlace K} (hw : IsReal w) (x : E K):
normAtPlace w x = βx.1 β¨w, hwβ©β := by |
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk, dif_pos]
| 1 | 2.718282 | 0 | 1.1875 | 16 | 1,249 |
import Mathlib.Algebra.Module.Zlattice.Basic
import Mathlib.NumberTheory.NumberField.Embeddings
import Mathlib.NumberTheory.NumberField.FractionalIdeal
#align_import number_theory.number_field.canonical_embedding from "leanprover-community/mathlib"@"60da01b41bbe4206f05d34fd70c8dd7498717a30"
variable (K : Type*) [Field K]
namespace NumberField.mixedEmbedding
open NumberField NumberField.InfinitePlace FiniteDimensional Finset
local notation "E" K =>
({w : InfinitePlace K // IsReal w} β β) Γ ({w : InfinitePlace K // IsComplex w} β β)
noncomputable def _root_.NumberField.mixedEmbedding : K β+* (E K) :=
RingHom.prod (Pi.ringHom fun w => embedding_of_isReal w.prop)
(Pi.ringHom fun w => w.val.embedding)
instance [NumberField K] : Nontrivial (E K) := by
obtain β¨wβ© := (inferInstance : Nonempty (InfinitePlace K))
obtain hw | hw := w.isReal_or_isComplex
Β· have : Nonempty {w : InfinitePlace K // IsReal w} := β¨β¨w, hwβ©β©
exact nontrivial_prod_left
Β· have : Nonempty {w : InfinitePlace K // IsComplex w} := β¨β¨w, hwβ©β©
exact nontrivial_prod_right
protected theorem finrank [NumberField K] : finrank β (E K) = finrank β K := by
classical
rw [finrank_prod, finrank_pi, finrank_pi_fintype, Complex.finrank_real_complex, sum_const,
card_univ, β NrRealPlaces, β NrComplexPlaces, β card_real_embeddings, Algebra.id.smul_eq_mul,
mul_comm, β card_complex_embeddings, β NumberField.Embeddings.card K β,
Fintype.card_subtype_compl, Nat.add_sub_of_le (Fintype.card_subtype_le _)]
theorem _root_.NumberField.mixedEmbedding_injective [NumberField K] :
Function.Injective (NumberField.mixedEmbedding K) := by
exact RingHom.injective _
noncomputable section norm
open scoped Classical
variable {K}
def normAtPlace (w : InfinitePlace K) : (E K) β*β β where
toFun x := if hw : IsReal w then βx.1 β¨w, hwβ©β else βx.2 β¨w, not_isReal_iff_isComplex.mp hwβ©β
map_zero' := by simp
map_one' := by simp
map_mul' x y := by split_ifs <;> simp
theorem normAtPlace_nonneg (w : InfinitePlace K) (x : E K) :
0 β€ normAtPlace w x := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs <;> exact norm_nonneg _
theorem normAtPlace_neg (w : InfinitePlace K) (x : E K) :
normAtPlace w (- x) = normAtPlace w x := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs <;> simp
theorem normAtPlace_add_le (w : InfinitePlace K) (x y : E K) :
normAtPlace w (x + y) β€ normAtPlace w x + normAtPlace w y := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs <;> exact norm_add_le _ _
theorem normAtPlace_smul (w : InfinitePlace K) (x : E K) (c : β) :
normAtPlace w (c β’ x) = |c| * normAtPlace w x := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs
Β· rw [Prod.smul_fst, Pi.smul_apply, norm_smul, Real.norm_eq_abs]
Β· rw [Prod.smul_snd, Pi.smul_apply, norm_smul, Real.norm_eq_abs, Complex.norm_eq_abs]
theorem normAtPlace_real (w : InfinitePlace K) (c : β) :
normAtPlace w ((fun _ β¦ c, fun _ β¦ c) : (E K)) = |c| := by
rw [show ((fun _ β¦ c, fun _ β¦ c) : (E K)) = c β’ 1 by ext <;> simp, normAtPlace_smul, map_one,
mul_one]
theorem normAtPlace_apply_isReal {w : InfinitePlace K} (hw : IsReal w) (x : E K):
normAtPlace w x = βx.1 β¨w, hwβ©β := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk, dif_pos]
| Mathlib/NumberTheory/NumberField/CanonicalEmbedding/Basic.lean | 290 | 293 | theorem normAtPlace_apply_isComplex {w : InfinitePlace K} (hw : IsComplex w) (x : E K) :
normAtPlace w x = βx.2 β¨w, hwβ©β := by |
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk,
dif_neg (not_isReal_iff_isComplex.mpr hw)]
| 2 | 7.389056 | 1 | 1.1875 | 16 | 1,249 |
import Mathlib.Algebra.Module.Zlattice.Basic
import Mathlib.NumberTheory.NumberField.Embeddings
import Mathlib.NumberTheory.NumberField.FractionalIdeal
#align_import number_theory.number_field.canonical_embedding from "leanprover-community/mathlib"@"60da01b41bbe4206f05d34fd70c8dd7498717a30"
variable (K : Type*) [Field K]
namespace NumberField.mixedEmbedding
open NumberField NumberField.InfinitePlace FiniteDimensional Finset
local notation "E" K =>
({w : InfinitePlace K // IsReal w} β β) Γ ({w : InfinitePlace K // IsComplex w} β β)
noncomputable def _root_.NumberField.mixedEmbedding : K β+* (E K) :=
RingHom.prod (Pi.ringHom fun w => embedding_of_isReal w.prop)
(Pi.ringHom fun w => w.val.embedding)
instance [NumberField K] : Nontrivial (E K) := by
obtain β¨wβ© := (inferInstance : Nonempty (InfinitePlace K))
obtain hw | hw := w.isReal_or_isComplex
Β· have : Nonempty {w : InfinitePlace K // IsReal w} := β¨β¨w, hwβ©β©
exact nontrivial_prod_left
Β· have : Nonempty {w : InfinitePlace K // IsComplex w} := β¨β¨w, hwβ©β©
exact nontrivial_prod_right
protected theorem finrank [NumberField K] : finrank β (E K) = finrank β K := by
classical
rw [finrank_prod, finrank_pi, finrank_pi_fintype, Complex.finrank_real_complex, sum_const,
card_univ, β NrRealPlaces, β NrComplexPlaces, β card_real_embeddings, Algebra.id.smul_eq_mul,
mul_comm, β card_complex_embeddings, β NumberField.Embeddings.card K β,
Fintype.card_subtype_compl, Nat.add_sub_of_le (Fintype.card_subtype_le _)]
theorem _root_.NumberField.mixedEmbedding_injective [NumberField K] :
Function.Injective (NumberField.mixedEmbedding K) := by
exact RingHom.injective _
noncomputable section norm
open scoped Classical
variable {K}
def normAtPlace (w : InfinitePlace K) : (E K) β*β β where
toFun x := if hw : IsReal w then βx.1 β¨w, hwβ©β else βx.2 β¨w, not_isReal_iff_isComplex.mp hwβ©β
map_zero' := by simp
map_one' := by simp
map_mul' x y := by split_ifs <;> simp
theorem normAtPlace_nonneg (w : InfinitePlace K) (x : E K) :
0 β€ normAtPlace w x := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs <;> exact norm_nonneg _
theorem normAtPlace_neg (w : InfinitePlace K) (x : E K) :
normAtPlace w (- x) = normAtPlace w x := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs <;> simp
theorem normAtPlace_add_le (w : InfinitePlace K) (x y : E K) :
normAtPlace w (x + y) β€ normAtPlace w x + normAtPlace w y := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs <;> exact norm_add_le _ _
theorem normAtPlace_smul (w : InfinitePlace K) (x : E K) (c : β) :
normAtPlace w (c β’ x) = |c| * normAtPlace w x := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs
Β· rw [Prod.smul_fst, Pi.smul_apply, norm_smul, Real.norm_eq_abs]
Β· rw [Prod.smul_snd, Pi.smul_apply, norm_smul, Real.norm_eq_abs, Complex.norm_eq_abs]
theorem normAtPlace_real (w : InfinitePlace K) (c : β) :
normAtPlace w ((fun _ β¦ c, fun _ β¦ c) : (E K)) = |c| := by
rw [show ((fun _ β¦ c, fun _ β¦ c) : (E K)) = c β’ 1 by ext <;> simp, normAtPlace_smul, map_one,
mul_one]
theorem normAtPlace_apply_isReal {w : InfinitePlace K} (hw : IsReal w) (x : E K):
normAtPlace w x = βx.1 β¨w, hwβ©β := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk, dif_pos]
theorem normAtPlace_apply_isComplex {w : InfinitePlace K} (hw : IsComplex w) (x : E K) :
normAtPlace w x = βx.2 β¨w, hwβ©β := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk,
dif_neg (not_isReal_iff_isComplex.mpr hw)]
@[simp]
| Mathlib/NumberTheory/NumberField/CanonicalEmbedding/Basic.lean | 296 | 300 | theorem normAtPlace_apply (w : InfinitePlace K) (x : K) :
normAtPlace w (mixedEmbedding K x) = w x := by |
simp_rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk, mixedEmbedding,
RingHom.prod_apply, Pi.ringHom_apply, norm_embedding_of_isReal, norm_embedding_eq, dite_eq_ite,
ite_id]
| 3 | 20.085537 | 1 | 1.1875 | 16 | 1,249 |
import Mathlib.Algebra.Module.Zlattice.Basic
import Mathlib.NumberTheory.NumberField.Embeddings
import Mathlib.NumberTheory.NumberField.FractionalIdeal
#align_import number_theory.number_field.canonical_embedding from "leanprover-community/mathlib"@"60da01b41bbe4206f05d34fd70c8dd7498717a30"
variable (K : Type*) [Field K]
namespace NumberField.mixedEmbedding
open NumberField NumberField.InfinitePlace FiniteDimensional Finset
local notation "E" K =>
({w : InfinitePlace K // IsReal w} β β) Γ ({w : InfinitePlace K // IsComplex w} β β)
noncomputable def _root_.NumberField.mixedEmbedding : K β+* (E K) :=
RingHom.prod (Pi.ringHom fun w => embedding_of_isReal w.prop)
(Pi.ringHom fun w => w.val.embedding)
instance [NumberField K] : Nontrivial (E K) := by
obtain β¨wβ© := (inferInstance : Nonempty (InfinitePlace K))
obtain hw | hw := w.isReal_or_isComplex
Β· have : Nonempty {w : InfinitePlace K // IsReal w} := β¨β¨w, hwβ©β©
exact nontrivial_prod_left
Β· have : Nonempty {w : InfinitePlace K // IsComplex w} := β¨β¨w, hwβ©β©
exact nontrivial_prod_right
protected theorem finrank [NumberField K] : finrank β (E K) = finrank β K := by
classical
rw [finrank_prod, finrank_pi, finrank_pi_fintype, Complex.finrank_real_complex, sum_const,
card_univ, β NrRealPlaces, β NrComplexPlaces, β card_real_embeddings, Algebra.id.smul_eq_mul,
mul_comm, β card_complex_embeddings, β NumberField.Embeddings.card K β,
Fintype.card_subtype_compl, Nat.add_sub_of_le (Fintype.card_subtype_le _)]
theorem _root_.NumberField.mixedEmbedding_injective [NumberField K] :
Function.Injective (NumberField.mixedEmbedding K) := by
exact RingHom.injective _
noncomputable section norm
open scoped Classical
variable {K}
def normAtPlace (w : InfinitePlace K) : (E K) β*β β where
toFun x := if hw : IsReal w then βx.1 β¨w, hwβ©β else βx.2 β¨w, not_isReal_iff_isComplex.mp hwβ©β
map_zero' := by simp
map_one' := by simp
map_mul' x y := by split_ifs <;> simp
theorem normAtPlace_nonneg (w : InfinitePlace K) (x : E K) :
0 β€ normAtPlace w x := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs <;> exact norm_nonneg _
theorem normAtPlace_neg (w : InfinitePlace K) (x : E K) :
normAtPlace w (- x) = normAtPlace w x := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs <;> simp
theorem normAtPlace_add_le (w : InfinitePlace K) (x y : E K) :
normAtPlace w (x + y) β€ normAtPlace w x + normAtPlace w y := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs <;> exact norm_add_le _ _
theorem normAtPlace_smul (w : InfinitePlace K) (x : E K) (c : β) :
normAtPlace w (c β’ x) = |c| * normAtPlace w x := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs
Β· rw [Prod.smul_fst, Pi.smul_apply, norm_smul, Real.norm_eq_abs]
Β· rw [Prod.smul_snd, Pi.smul_apply, norm_smul, Real.norm_eq_abs, Complex.norm_eq_abs]
theorem normAtPlace_real (w : InfinitePlace K) (c : β) :
normAtPlace w ((fun _ β¦ c, fun _ β¦ c) : (E K)) = |c| := by
rw [show ((fun _ β¦ c, fun _ β¦ c) : (E K)) = c β’ 1 by ext <;> simp, normAtPlace_smul, map_one,
mul_one]
theorem normAtPlace_apply_isReal {w : InfinitePlace K} (hw : IsReal w) (x : E K):
normAtPlace w x = βx.1 β¨w, hwβ©β := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk, dif_pos]
theorem normAtPlace_apply_isComplex {w : InfinitePlace K} (hw : IsComplex w) (x : E K) :
normAtPlace w x = βx.2 β¨w, hwβ©β := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk,
dif_neg (not_isReal_iff_isComplex.mpr hw)]
@[simp]
theorem normAtPlace_apply (w : InfinitePlace K) (x : K) :
normAtPlace w (mixedEmbedding K x) = w x := by
simp_rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk, mixedEmbedding,
RingHom.prod_apply, Pi.ringHom_apply, norm_embedding_of_isReal, norm_embedding_eq, dite_eq_ite,
ite_id]
| Mathlib/NumberTheory/NumberField/CanonicalEmbedding/Basic.lean | 302 | 308 | theorem normAtPlace_eq_zero {x : E K} :
(β w, normAtPlace w x = 0) β x = 0 := by |
refine β¨fun h β¦ ?_, fun h β¦ ?_β©
Β· ext w
Β· exact norm_eq_zero'.mp (normAtPlace_apply_isReal w.prop _ βΈ h w.1)
Β· exact norm_eq_zero'.mp (normAtPlace_apply_isComplex w.prop _ βΈ h w.1)
Β· simp_rw [h, map_zero, implies_true]
| 5 | 148.413159 | 2 | 1.1875 | 16 | 1,249 |
import Mathlib.Algebra.Module.Zlattice.Basic
import Mathlib.NumberTheory.NumberField.Embeddings
import Mathlib.NumberTheory.NumberField.FractionalIdeal
#align_import number_theory.number_field.canonical_embedding from "leanprover-community/mathlib"@"60da01b41bbe4206f05d34fd70c8dd7498717a30"
variable (K : Type*) [Field K]
namespace NumberField.mixedEmbedding
open NumberField NumberField.InfinitePlace FiniteDimensional Finset
local notation "E" K =>
({w : InfinitePlace K // IsReal w} β β) Γ ({w : InfinitePlace K // IsComplex w} β β)
noncomputable def _root_.NumberField.mixedEmbedding : K β+* (E K) :=
RingHom.prod (Pi.ringHom fun w => embedding_of_isReal w.prop)
(Pi.ringHom fun w => w.val.embedding)
instance [NumberField K] : Nontrivial (E K) := by
obtain β¨wβ© := (inferInstance : Nonempty (InfinitePlace K))
obtain hw | hw := w.isReal_or_isComplex
Β· have : Nonempty {w : InfinitePlace K // IsReal w} := β¨β¨w, hwβ©β©
exact nontrivial_prod_left
Β· have : Nonempty {w : InfinitePlace K // IsComplex w} := β¨β¨w, hwβ©β©
exact nontrivial_prod_right
protected theorem finrank [NumberField K] : finrank β (E K) = finrank β K := by
classical
rw [finrank_prod, finrank_pi, finrank_pi_fintype, Complex.finrank_real_complex, sum_const,
card_univ, β NrRealPlaces, β NrComplexPlaces, β card_real_embeddings, Algebra.id.smul_eq_mul,
mul_comm, β card_complex_embeddings, β NumberField.Embeddings.card K β,
Fintype.card_subtype_compl, Nat.add_sub_of_le (Fintype.card_subtype_le _)]
theorem _root_.NumberField.mixedEmbedding_injective [NumberField K] :
Function.Injective (NumberField.mixedEmbedding K) := by
exact RingHom.injective _
noncomputable section norm
open scoped Classical
variable {K}
def normAtPlace (w : InfinitePlace K) : (E K) β*β β where
toFun x := if hw : IsReal w then βx.1 β¨w, hwβ©β else βx.2 β¨w, not_isReal_iff_isComplex.mp hwβ©β
map_zero' := by simp
map_one' := by simp
map_mul' x y := by split_ifs <;> simp
theorem normAtPlace_nonneg (w : InfinitePlace K) (x : E K) :
0 β€ normAtPlace w x := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs <;> exact norm_nonneg _
theorem normAtPlace_neg (w : InfinitePlace K) (x : E K) :
normAtPlace w (- x) = normAtPlace w x := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs <;> simp
theorem normAtPlace_add_le (w : InfinitePlace K) (x y : E K) :
normAtPlace w (x + y) β€ normAtPlace w x + normAtPlace w y := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs <;> exact norm_add_le _ _
theorem normAtPlace_smul (w : InfinitePlace K) (x : E K) (c : β) :
normAtPlace w (c β’ x) = |c| * normAtPlace w x := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs
Β· rw [Prod.smul_fst, Pi.smul_apply, norm_smul, Real.norm_eq_abs]
Β· rw [Prod.smul_snd, Pi.smul_apply, norm_smul, Real.norm_eq_abs, Complex.norm_eq_abs]
theorem normAtPlace_real (w : InfinitePlace K) (c : β) :
normAtPlace w ((fun _ β¦ c, fun _ β¦ c) : (E K)) = |c| := by
rw [show ((fun _ β¦ c, fun _ β¦ c) : (E K)) = c β’ 1 by ext <;> simp, normAtPlace_smul, map_one,
mul_one]
theorem normAtPlace_apply_isReal {w : InfinitePlace K} (hw : IsReal w) (x : E K):
normAtPlace w x = βx.1 β¨w, hwβ©β := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk, dif_pos]
theorem normAtPlace_apply_isComplex {w : InfinitePlace K} (hw : IsComplex w) (x : E K) :
normAtPlace w x = βx.2 β¨w, hwβ©β := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk,
dif_neg (not_isReal_iff_isComplex.mpr hw)]
@[simp]
theorem normAtPlace_apply (w : InfinitePlace K) (x : K) :
normAtPlace w (mixedEmbedding K x) = w x := by
simp_rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk, mixedEmbedding,
RingHom.prod_apply, Pi.ringHom_apply, norm_embedding_of_isReal, norm_embedding_eq, dite_eq_ite,
ite_id]
theorem normAtPlace_eq_zero {x : E K} :
(β w, normAtPlace w x = 0) β x = 0 := by
refine β¨fun h β¦ ?_, fun h β¦ ?_β©
Β· ext w
Β· exact norm_eq_zero'.mp (normAtPlace_apply_isReal w.prop _ βΈ h w.1)
Β· exact norm_eq_zero'.mp (normAtPlace_apply_isComplex w.prop _ βΈ h w.1)
Β· simp_rw [h, map_zero, implies_true]
variable [NumberField K]
| Mathlib/NumberTheory/NumberField/CanonicalEmbedding/Basic.lean | 312 | 323 | theorem nnnorm_eq_sup_normAtPlace (x : E K) :
βxββ = univ.sup fun w β¦ β¨normAtPlace w x, normAtPlace_nonneg w xβ© := by |
rw [show (univ : Finset (InfinitePlace K)) = (univ.image
(fun w : {w : InfinitePlace K // IsReal w} β¦ w.1)) βͺ
(univ.image (fun w : {w : InfinitePlace K // IsComplex w} β¦ w.1))
by ext; simp [isReal_or_isComplex], sup_union, univ.sup_image, univ.sup_image, sup_eq_max,
Prod.nnnorm_def', Pi.nnnorm_def, Pi.nnnorm_def]
congr
Β· ext w
simp [normAtPlace_apply_isReal w.prop]
Β· ext w
simp [normAtPlace_apply_isComplex w.prop]
| 10 | 22,026.465795 | 2 | 1.1875 | 16 | 1,249 |
import Mathlib.Analysis.Calculus.FDeriv.Add
import Mathlib.Analysis.Calculus.FDeriv.Equiv
import Mathlib.Analysis.Calculus.FDeriv.Prod
import Mathlib.Analysis.Calculus.Monotone
import Mathlib.Data.Set.Function
import Mathlib.Algebra.Group.Basic
import Mathlib.Tactic.WLOG
#align_import analysis.bounded_variation from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
open scoped NNReal ENNReal Topology UniformConvergence
open Set MeasureTheory Filter
-- Porting note: sectioned variables because a `wlog` was broken due to extra variables in context
variable {Ξ± : Type*} [LinearOrder Ξ±] {E : Type*} [PseudoEMetricSpace E]
noncomputable def eVariationOn (f : Ξ± β E) (s : Set Ξ±) : ββ₯0β :=
β¨ p : β Γ { u : β β Ξ± // Monotone u β§ β i, u i β s },
β i β Finset.range p.1, edist (f (p.2.1 (i + 1))) (f (p.2.1 i))
#align evariation_on eVariationOn
def BoundedVariationOn (f : Ξ± β E) (s : Set Ξ±) :=
eVariationOn f s β β
#align has_bounded_variation_on BoundedVariationOn
def LocallyBoundedVariationOn (f : Ξ± β E) (s : Set Ξ±) :=
β a b, a β s β b β s β BoundedVariationOn f (s β© Icc a b)
#align has_locally_bounded_variation_on LocallyBoundedVariationOn
namespace eVariationOn
| Mathlib/Analysis/BoundedVariation.lean | 83 | 86 | theorem nonempty_monotone_mem {s : Set Ξ±} (hs : s.Nonempty) :
Nonempty { u // Monotone u β§ β i : β, u i β s } := by |
obtain β¨x, hxβ© := hs
exact β¨β¨fun _ => x, fun i j _ => le_rfl, fun _ => hxβ©β©
| 2 | 7.389056 | 1 | 1.2 | 5 | 1,250 |
import Mathlib.Analysis.Calculus.FDeriv.Add
import Mathlib.Analysis.Calculus.FDeriv.Equiv
import Mathlib.Analysis.Calculus.FDeriv.Prod
import Mathlib.Analysis.Calculus.Monotone
import Mathlib.Data.Set.Function
import Mathlib.Algebra.Group.Basic
import Mathlib.Tactic.WLOG
#align_import analysis.bounded_variation from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
open scoped NNReal ENNReal Topology UniformConvergence
open Set MeasureTheory Filter
-- Porting note: sectioned variables because a `wlog` was broken due to extra variables in context
variable {Ξ± : Type*} [LinearOrder Ξ±] {E : Type*} [PseudoEMetricSpace E]
noncomputable def eVariationOn (f : Ξ± β E) (s : Set Ξ±) : ββ₯0β :=
β¨ p : β Γ { u : β β Ξ± // Monotone u β§ β i, u i β s },
β i β Finset.range p.1, edist (f (p.2.1 (i + 1))) (f (p.2.1 i))
#align evariation_on eVariationOn
def BoundedVariationOn (f : Ξ± β E) (s : Set Ξ±) :=
eVariationOn f s β β
#align has_bounded_variation_on BoundedVariationOn
def LocallyBoundedVariationOn (f : Ξ± β E) (s : Set Ξ±) :=
β a b, a β s β b β s β BoundedVariationOn f (s β© Icc a b)
#align has_locally_bounded_variation_on LocallyBoundedVariationOn
namespace eVariationOn
theorem nonempty_monotone_mem {s : Set Ξ±} (hs : s.Nonempty) :
Nonempty { u // Monotone u β§ β i : β, u i β s } := by
obtain β¨x, hxβ© := hs
exact β¨β¨fun _ => x, fun i j _ => le_rfl, fun _ => hxβ©β©
#align evariation_on.nonempty_monotone_mem eVariationOn.nonempty_monotone_mem
| Mathlib/Analysis/BoundedVariation.lean | 89 | 94 | theorem eq_of_edist_zero_on {f f' : Ξ± β E} {s : Set Ξ±} (h : β β¦xβ¦, x β s β edist (f x) (f' x) = 0) :
eVariationOn f s = eVariationOn f' s := by |
dsimp only [eVariationOn]
congr 1 with p : 1
congr 1 with i : 1
rw [edist_congr_right (h <| p.snd.prop.2 (i + 1)), edist_congr_left (h <| p.snd.prop.2 i)]
| 4 | 54.59815 | 2 | 1.2 | 5 | 1,250 |
import Mathlib.Analysis.Calculus.FDeriv.Add
import Mathlib.Analysis.Calculus.FDeriv.Equiv
import Mathlib.Analysis.Calculus.FDeriv.Prod
import Mathlib.Analysis.Calculus.Monotone
import Mathlib.Data.Set.Function
import Mathlib.Algebra.Group.Basic
import Mathlib.Tactic.WLOG
#align_import analysis.bounded_variation from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
open scoped NNReal ENNReal Topology UniformConvergence
open Set MeasureTheory Filter
-- Porting note: sectioned variables because a `wlog` was broken due to extra variables in context
variable {Ξ± : Type*} [LinearOrder Ξ±] {E : Type*} [PseudoEMetricSpace E]
noncomputable def eVariationOn (f : Ξ± β E) (s : Set Ξ±) : ββ₯0β :=
β¨ p : β Γ { u : β β Ξ± // Monotone u β§ β i, u i β s },
β i β Finset.range p.1, edist (f (p.2.1 (i + 1))) (f (p.2.1 i))
#align evariation_on eVariationOn
def BoundedVariationOn (f : Ξ± β E) (s : Set Ξ±) :=
eVariationOn f s β β
#align has_bounded_variation_on BoundedVariationOn
def LocallyBoundedVariationOn (f : Ξ± β E) (s : Set Ξ±) :=
β a b, a β s β b β s β BoundedVariationOn f (s β© Icc a b)
#align has_locally_bounded_variation_on LocallyBoundedVariationOn
namespace eVariationOn
theorem nonempty_monotone_mem {s : Set Ξ±} (hs : s.Nonempty) :
Nonempty { u // Monotone u β§ β i : β, u i β s } := by
obtain β¨x, hxβ© := hs
exact β¨β¨fun _ => x, fun i j _ => le_rfl, fun _ => hxβ©β©
#align evariation_on.nonempty_monotone_mem eVariationOn.nonempty_monotone_mem
theorem eq_of_edist_zero_on {f f' : Ξ± β E} {s : Set Ξ±} (h : β β¦xβ¦, x β s β edist (f x) (f' x) = 0) :
eVariationOn f s = eVariationOn f' s := by
dsimp only [eVariationOn]
congr 1 with p : 1
congr 1 with i : 1
rw [edist_congr_right (h <| p.snd.prop.2 (i + 1)), edist_congr_left (h <| p.snd.prop.2 i)]
#align evariation_on.eq_of_edist_zero_on eVariationOn.eq_of_edist_zero_on
theorem eq_of_eqOn {f f' : Ξ± β E} {s : Set Ξ±} (h : EqOn f f' s) :
eVariationOn f s = eVariationOn f' s :=
eq_of_edist_zero_on fun x xs => by rw [h xs, edist_self]
#align evariation_on.eq_of_eq_on eVariationOn.eq_of_eqOn
theorem sum_le (f : Ξ± β E) {s : Set Ξ±} (n : β) {u : β β Ξ±} (hu : Monotone u) (us : β i, u i β s) :
(β i β Finset.range n, edist (f (u (i + 1))) (f (u i))) β€ eVariationOn f s :=
le_iSup_of_le β¨n, u, hu, usβ© le_rfl
#align evariation_on.sum_le eVariationOn.sum_le
| Mathlib/Analysis/BoundedVariation.lean | 107 | 124 | theorem sum_le_of_monotoneOn_Icc (f : Ξ± β E) {s : Set Ξ±} {m n : β} {u : β β Ξ±}
(hu : MonotoneOn u (Icc m n)) (us : β i β Icc m n, u i β s) :
(β i β Finset.Ico m n, edist (f (u (i + 1))) (f (u i))) β€ eVariationOn f s := by |
rcases le_total n m with hnm | hmn
Β· simp [Finset.Ico_eq_empty_of_le hnm]
let Ο := projIcc m n hmn
let v i := u (Ο i)
calc
β i β Finset.Ico m n, edist (f (u (i + 1))) (f (u i))
= β i β Finset.Ico m n, edist (f (v (i + 1))) (f (v i)) :=
Finset.sum_congr rfl fun i hi β¦ by
rw [Finset.mem_Ico] at hi
simp only [v, Ο, projIcc_of_mem hmn β¨hi.1, hi.2.leβ©,
projIcc_of_mem hmn β¨hi.1.trans i.le_succ, hi.2β©]
_ β€ β i β Finset.range n, edist (f (v (i + 1))) (f (v i)) :=
Finset.sum_mono_set _ (Nat.Iio_eq_range βΈ Finset.Ico_subset_Iio_self)
_ β€ eVariationOn f s :=
sum_le _ _ (fun i j h β¦ hu (Ο i).2 (Ο j).2 (monotone_projIcc hmn h)) fun i β¦ us _ (Ο i).2
| 15 | 3,269,017.372472 | 2 | 1.2 | 5 | 1,250 |
import Mathlib.Analysis.Calculus.FDeriv.Add
import Mathlib.Analysis.Calculus.FDeriv.Equiv
import Mathlib.Analysis.Calculus.FDeriv.Prod
import Mathlib.Analysis.Calculus.Monotone
import Mathlib.Data.Set.Function
import Mathlib.Algebra.Group.Basic
import Mathlib.Tactic.WLOG
#align_import analysis.bounded_variation from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
open scoped NNReal ENNReal Topology UniformConvergence
open Set MeasureTheory Filter
-- Porting note: sectioned variables because a `wlog` was broken due to extra variables in context
variable {Ξ± : Type*} [LinearOrder Ξ±] {E : Type*} [PseudoEMetricSpace E]
noncomputable def eVariationOn (f : Ξ± β E) (s : Set Ξ±) : ββ₯0β :=
β¨ p : β Γ { u : β β Ξ± // Monotone u β§ β i, u i β s },
β i β Finset.range p.1, edist (f (p.2.1 (i + 1))) (f (p.2.1 i))
#align evariation_on eVariationOn
def BoundedVariationOn (f : Ξ± β E) (s : Set Ξ±) :=
eVariationOn f s β β
#align has_bounded_variation_on BoundedVariationOn
def LocallyBoundedVariationOn (f : Ξ± β E) (s : Set Ξ±) :=
β a b, a β s β b β s β BoundedVariationOn f (s β© Icc a b)
#align has_locally_bounded_variation_on LocallyBoundedVariationOn
namespace eVariationOn
theorem nonempty_monotone_mem {s : Set Ξ±} (hs : s.Nonempty) :
Nonempty { u // Monotone u β§ β i : β, u i β s } := by
obtain β¨x, hxβ© := hs
exact β¨β¨fun _ => x, fun i j _ => le_rfl, fun _ => hxβ©β©
#align evariation_on.nonempty_monotone_mem eVariationOn.nonempty_monotone_mem
theorem eq_of_edist_zero_on {f f' : Ξ± β E} {s : Set Ξ±} (h : β β¦xβ¦, x β s β edist (f x) (f' x) = 0) :
eVariationOn f s = eVariationOn f' s := by
dsimp only [eVariationOn]
congr 1 with p : 1
congr 1 with i : 1
rw [edist_congr_right (h <| p.snd.prop.2 (i + 1)), edist_congr_left (h <| p.snd.prop.2 i)]
#align evariation_on.eq_of_edist_zero_on eVariationOn.eq_of_edist_zero_on
theorem eq_of_eqOn {f f' : Ξ± β E} {s : Set Ξ±} (h : EqOn f f' s) :
eVariationOn f s = eVariationOn f' s :=
eq_of_edist_zero_on fun x xs => by rw [h xs, edist_self]
#align evariation_on.eq_of_eq_on eVariationOn.eq_of_eqOn
theorem sum_le (f : Ξ± β E) {s : Set Ξ±} (n : β) {u : β β Ξ±} (hu : Monotone u) (us : β i, u i β s) :
(β i β Finset.range n, edist (f (u (i + 1))) (f (u i))) β€ eVariationOn f s :=
le_iSup_of_le β¨n, u, hu, usβ© le_rfl
#align evariation_on.sum_le eVariationOn.sum_le
theorem sum_le_of_monotoneOn_Icc (f : Ξ± β E) {s : Set Ξ±} {m n : β} {u : β β Ξ±}
(hu : MonotoneOn u (Icc m n)) (us : β i β Icc m n, u i β s) :
(β i β Finset.Ico m n, edist (f (u (i + 1))) (f (u i))) β€ eVariationOn f s := by
rcases le_total n m with hnm | hmn
Β· simp [Finset.Ico_eq_empty_of_le hnm]
let Ο := projIcc m n hmn
let v i := u (Ο i)
calc
β i β Finset.Ico m n, edist (f (u (i + 1))) (f (u i))
= β i β Finset.Ico m n, edist (f (v (i + 1))) (f (v i)) :=
Finset.sum_congr rfl fun i hi β¦ by
rw [Finset.mem_Ico] at hi
simp only [v, Ο, projIcc_of_mem hmn β¨hi.1, hi.2.leβ©,
projIcc_of_mem hmn β¨hi.1.trans i.le_succ, hi.2β©]
_ β€ β i β Finset.range n, edist (f (v (i + 1))) (f (v i)) :=
Finset.sum_mono_set _ (Nat.Iio_eq_range βΈ Finset.Ico_subset_Iio_self)
_ β€ eVariationOn f s :=
sum_le _ _ (fun i j h β¦ hu (Ο i).2 (Ο j).2 (monotone_projIcc hmn h)) fun i β¦ us _ (Ο i).2
#align evariation_on.sum_le_of_monotone_on_Icc eVariationOn.sum_le_of_monotoneOn_Icc
| Mathlib/Analysis/BoundedVariation.lean | 127 | 130 | theorem sum_le_of_monotoneOn_Iic (f : Ξ± β E) {s : Set Ξ±} {n : β} {u : β β Ξ±}
(hu : MonotoneOn u (Iic n)) (us : β i β€ n, u i β s) :
(β i β Finset.range n, edist (f (u (i + 1))) (f (u i))) β€ eVariationOn f s := by |
simpa using sum_le_of_monotoneOn_Icc f (m := 0) (hu.mono Icc_subset_Iic_self) fun i hi β¦ us i hi.2
| 1 | 2.718282 | 0 | 1.2 | 5 | 1,250 |
import Mathlib.Analysis.Calculus.FDeriv.Add
import Mathlib.Analysis.Calculus.FDeriv.Equiv
import Mathlib.Analysis.Calculus.FDeriv.Prod
import Mathlib.Analysis.Calculus.Monotone
import Mathlib.Data.Set.Function
import Mathlib.Algebra.Group.Basic
import Mathlib.Tactic.WLOG
#align_import analysis.bounded_variation from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
open scoped NNReal ENNReal Topology UniformConvergence
open Set MeasureTheory Filter
-- Porting note: sectioned variables because a `wlog` was broken due to extra variables in context
variable {Ξ± : Type*} [LinearOrder Ξ±] {E : Type*} [PseudoEMetricSpace E]
noncomputable def eVariationOn (f : Ξ± β E) (s : Set Ξ±) : ββ₯0β :=
β¨ p : β Γ { u : β β Ξ± // Monotone u β§ β i, u i β s },
β i β Finset.range p.1, edist (f (p.2.1 (i + 1))) (f (p.2.1 i))
#align evariation_on eVariationOn
def BoundedVariationOn (f : Ξ± β E) (s : Set Ξ±) :=
eVariationOn f s β β
#align has_bounded_variation_on BoundedVariationOn
def LocallyBoundedVariationOn (f : Ξ± β E) (s : Set Ξ±) :=
β a b, a β s β b β s β BoundedVariationOn f (s β© Icc a b)
#align has_locally_bounded_variation_on LocallyBoundedVariationOn
namespace eVariationOn
theorem nonempty_monotone_mem {s : Set Ξ±} (hs : s.Nonempty) :
Nonempty { u // Monotone u β§ β i : β, u i β s } := by
obtain β¨x, hxβ© := hs
exact β¨β¨fun _ => x, fun i j _ => le_rfl, fun _ => hxβ©β©
#align evariation_on.nonempty_monotone_mem eVariationOn.nonempty_monotone_mem
theorem eq_of_edist_zero_on {f f' : Ξ± β E} {s : Set Ξ±} (h : β β¦xβ¦, x β s β edist (f x) (f' x) = 0) :
eVariationOn f s = eVariationOn f' s := by
dsimp only [eVariationOn]
congr 1 with p : 1
congr 1 with i : 1
rw [edist_congr_right (h <| p.snd.prop.2 (i + 1)), edist_congr_left (h <| p.snd.prop.2 i)]
#align evariation_on.eq_of_edist_zero_on eVariationOn.eq_of_edist_zero_on
theorem eq_of_eqOn {f f' : Ξ± β E} {s : Set Ξ±} (h : EqOn f f' s) :
eVariationOn f s = eVariationOn f' s :=
eq_of_edist_zero_on fun x xs => by rw [h xs, edist_self]
#align evariation_on.eq_of_eq_on eVariationOn.eq_of_eqOn
theorem sum_le (f : Ξ± β E) {s : Set Ξ±} (n : β) {u : β β Ξ±} (hu : Monotone u) (us : β i, u i β s) :
(β i β Finset.range n, edist (f (u (i + 1))) (f (u i))) β€ eVariationOn f s :=
le_iSup_of_le β¨n, u, hu, usβ© le_rfl
#align evariation_on.sum_le eVariationOn.sum_le
theorem sum_le_of_monotoneOn_Icc (f : Ξ± β E) {s : Set Ξ±} {m n : β} {u : β β Ξ±}
(hu : MonotoneOn u (Icc m n)) (us : β i β Icc m n, u i β s) :
(β i β Finset.Ico m n, edist (f (u (i + 1))) (f (u i))) β€ eVariationOn f s := by
rcases le_total n m with hnm | hmn
Β· simp [Finset.Ico_eq_empty_of_le hnm]
let Ο := projIcc m n hmn
let v i := u (Ο i)
calc
β i β Finset.Ico m n, edist (f (u (i + 1))) (f (u i))
= β i β Finset.Ico m n, edist (f (v (i + 1))) (f (v i)) :=
Finset.sum_congr rfl fun i hi β¦ by
rw [Finset.mem_Ico] at hi
simp only [v, Ο, projIcc_of_mem hmn β¨hi.1, hi.2.leβ©,
projIcc_of_mem hmn β¨hi.1.trans i.le_succ, hi.2β©]
_ β€ β i β Finset.range n, edist (f (v (i + 1))) (f (v i)) :=
Finset.sum_mono_set _ (Nat.Iio_eq_range βΈ Finset.Ico_subset_Iio_self)
_ β€ eVariationOn f s :=
sum_le _ _ (fun i j h β¦ hu (Ο i).2 (Ο j).2 (monotone_projIcc hmn h)) fun i β¦ us _ (Ο i).2
#align evariation_on.sum_le_of_monotone_on_Icc eVariationOn.sum_le_of_monotoneOn_Icc
theorem sum_le_of_monotoneOn_Iic (f : Ξ± β E) {s : Set Ξ±} {n : β} {u : β β Ξ±}
(hu : MonotoneOn u (Iic n)) (us : β i β€ n, u i β s) :
(β i β Finset.range n, edist (f (u (i + 1))) (f (u i))) β€ eVariationOn f s := by
simpa using sum_le_of_monotoneOn_Icc f (m := 0) (hu.mono Icc_subset_Iic_self) fun i hi β¦ us i hi.2
#align evariation_on.sum_le_of_monotone_on_Iic eVariationOn.sum_le_of_monotoneOn_Iic
| Mathlib/Analysis/BoundedVariation.lean | 133 | 136 | theorem mono (f : Ξ± β E) {s t : Set Ξ±} (hst : t β s) : eVariationOn f t β€ eVariationOn f s := by |
apply iSup_le _
rintro β¨n, β¨u, hu, utβ©β©
exact sum_le f n hu fun i => hst (ut i)
| 3 | 20.085537 | 1 | 1.2 | 5 | 1,250 |
import Mathlib.Algebra.Field.Basic
import Mathlib.Algebra.Order.Group.Basic
import Mathlib.Algebra.Order.Ring.Basic
import Mathlib.RingTheory.Int.Basic
import Mathlib.Tactic.Ring
import Mathlib.Tactic.FieldSimp
import Mathlib.Data.Int.NatPrime
import Mathlib.Data.ZMod.Basic
#align_import number_theory.pythagorean_triples from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3"
| Mathlib/NumberTheory/PythagoreanTriples.lean | 32 | 34 | theorem sq_ne_two_fin_zmod_four (z : ZMod 4) : z * z β 2 := by |
change Fin 4 at z
fin_cases z <;> decide
| 2 | 7.389056 | 1 | 1.2 | 10 | 1,251 |
import Mathlib.Algebra.Field.Basic
import Mathlib.Algebra.Order.Group.Basic
import Mathlib.Algebra.Order.Ring.Basic
import Mathlib.RingTheory.Int.Basic
import Mathlib.Tactic.Ring
import Mathlib.Tactic.FieldSimp
import Mathlib.Data.Int.NatPrime
import Mathlib.Data.ZMod.Basic
#align_import number_theory.pythagorean_triples from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3"
theorem sq_ne_two_fin_zmod_four (z : ZMod 4) : z * z β 2 := by
change Fin 4 at z
fin_cases z <;> decide
#align sq_ne_two_fin_zmod_four sq_ne_two_fin_zmod_four
| Mathlib/NumberTheory/PythagoreanTriples.lean | 37 | 40 | theorem Int.sq_ne_two_mod_four (z : β€) : z * z % 4 β 2 := by |
suffices Β¬z * z % (4 : β) = 2 % (4 : β) by exact this
rw [β ZMod.intCast_eq_intCast_iff']
simpa using sq_ne_two_fin_zmod_four _
| 3 | 20.085537 | 1 | 1.2 | 10 | 1,251 |
import Mathlib.Algebra.Field.Basic
import Mathlib.Algebra.Order.Group.Basic
import Mathlib.Algebra.Order.Ring.Basic
import Mathlib.RingTheory.Int.Basic
import Mathlib.Tactic.Ring
import Mathlib.Tactic.FieldSimp
import Mathlib.Data.Int.NatPrime
import Mathlib.Data.ZMod.Basic
#align_import number_theory.pythagorean_triples from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3"
theorem sq_ne_two_fin_zmod_four (z : ZMod 4) : z * z β 2 := by
change Fin 4 at z
fin_cases z <;> decide
#align sq_ne_two_fin_zmod_four sq_ne_two_fin_zmod_four
theorem Int.sq_ne_two_mod_four (z : β€) : z * z % 4 β 2 := by
suffices Β¬z * z % (4 : β) = 2 % (4 : β) by exact this
rw [β ZMod.intCast_eq_intCast_iff']
simpa using sq_ne_two_fin_zmod_four _
#align int.sq_ne_two_mod_four Int.sq_ne_two_mod_four
noncomputable section
open scoped Classical
def PythagoreanTriple (x y z : β€) : Prop :=
x * x + y * y = z * z
#align pythagorean_triple PythagoreanTriple
| Mathlib/NumberTheory/PythagoreanTriples.lean | 54 | 56 | theorem pythagoreanTriple_comm {x y z : β€} : PythagoreanTriple x y z β PythagoreanTriple y x z := by |
delta PythagoreanTriple
rw [add_comm]
| 2 | 7.389056 | 1 | 1.2 | 10 | 1,251 |
import Mathlib.Algebra.Field.Basic
import Mathlib.Algebra.Order.Group.Basic
import Mathlib.Algebra.Order.Ring.Basic
import Mathlib.RingTheory.Int.Basic
import Mathlib.Tactic.Ring
import Mathlib.Tactic.FieldSimp
import Mathlib.Data.Int.NatPrime
import Mathlib.Data.ZMod.Basic
#align_import number_theory.pythagorean_triples from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3"
theorem sq_ne_two_fin_zmod_four (z : ZMod 4) : z * z β 2 := by
change Fin 4 at z
fin_cases z <;> decide
#align sq_ne_two_fin_zmod_four sq_ne_two_fin_zmod_four
theorem Int.sq_ne_two_mod_four (z : β€) : z * z % 4 β 2 := by
suffices Β¬z * z % (4 : β) = 2 % (4 : β) by exact this
rw [β ZMod.intCast_eq_intCast_iff']
simpa using sq_ne_two_fin_zmod_four _
#align int.sq_ne_two_mod_four Int.sq_ne_two_mod_four
noncomputable section
open scoped Classical
def PythagoreanTriple (x y z : β€) : Prop :=
x * x + y * y = z * z
#align pythagorean_triple PythagoreanTriple
theorem pythagoreanTriple_comm {x y z : β€} : PythagoreanTriple x y z β PythagoreanTriple y x z := by
delta PythagoreanTriple
rw [add_comm]
#align pythagorean_triple_comm pythagoreanTriple_comm
| Mathlib/NumberTheory/PythagoreanTriples.lean | 60 | 61 | theorem PythagoreanTriple.zero : PythagoreanTriple 0 0 0 := by |
simp only [PythagoreanTriple, zero_mul, zero_add]
| 1 | 2.718282 | 0 | 1.2 | 10 | 1,251 |
import Mathlib.Algebra.Field.Basic
import Mathlib.Algebra.Order.Group.Basic
import Mathlib.Algebra.Order.Ring.Basic
import Mathlib.RingTheory.Int.Basic
import Mathlib.Tactic.Ring
import Mathlib.Tactic.FieldSimp
import Mathlib.Data.Int.NatPrime
import Mathlib.Data.ZMod.Basic
#align_import number_theory.pythagorean_triples from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3"
theorem sq_ne_two_fin_zmod_four (z : ZMod 4) : z * z β 2 := by
change Fin 4 at z
fin_cases z <;> decide
#align sq_ne_two_fin_zmod_four sq_ne_two_fin_zmod_four
theorem Int.sq_ne_two_mod_four (z : β€) : z * z % 4 β 2 := by
suffices Β¬z * z % (4 : β) = 2 % (4 : β) by exact this
rw [β ZMod.intCast_eq_intCast_iff']
simpa using sq_ne_two_fin_zmod_four _
#align int.sq_ne_two_mod_four Int.sq_ne_two_mod_four
noncomputable section
open scoped Classical
def PythagoreanTriple (x y z : β€) : Prop :=
x * x + y * y = z * z
#align pythagorean_triple PythagoreanTriple
theorem pythagoreanTriple_comm {x y z : β€} : PythagoreanTriple x y z β PythagoreanTriple y x z := by
delta PythagoreanTriple
rw [add_comm]
#align pythagorean_triple_comm pythagoreanTriple_comm
theorem PythagoreanTriple.zero : PythagoreanTriple 0 0 0 := by
simp only [PythagoreanTriple, zero_mul, zero_add]
#align pythagorean_triple.zero PythagoreanTriple.zero
namespace PythagoreanTriple
variable {x y z : β€} (h : PythagoreanTriple x y z)
theorem eq : x * x + y * y = z * z :=
h
#align pythagorean_triple.eq PythagoreanTriple.eq
@[symm]
| Mathlib/NumberTheory/PythagoreanTriples.lean | 73 | 73 | theorem symm : PythagoreanTriple y x z := by | rwa [pythagoreanTriple_comm]
| 1 | 2.718282 | 0 | 1.2 | 10 | 1,251 |
import Mathlib.Algebra.Field.Basic
import Mathlib.Algebra.Order.Group.Basic
import Mathlib.Algebra.Order.Ring.Basic
import Mathlib.RingTheory.Int.Basic
import Mathlib.Tactic.Ring
import Mathlib.Tactic.FieldSimp
import Mathlib.Data.Int.NatPrime
import Mathlib.Data.ZMod.Basic
#align_import number_theory.pythagorean_triples from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3"
theorem sq_ne_two_fin_zmod_four (z : ZMod 4) : z * z β 2 := by
change Fin 4 at z
fin_cases z <;> decide
#align sq_ne_two_fin_zmod_four sq_ne_two_fin_zmod_four
theorem Int.sq_ne_two_mod_four (z : β€) : z * z % 4 β 2 := by
suffices Β¬z * z % (4 : β) = 2 % (4 : β) by exact this
rw [β ZMod.intCast_eq_intCast_iff']
simpa using sq_ne_two_fin_zmod_four _
#align int.sq_ne_two_mod_four Int.sq_ne_two_mod_four
noncomputable section
open scoped Classical
def PythagoreanTriple (x y z : β€) : Prop :=
x * x + y * y = z * z
#align pythagorean_triple PythagoreanTriple
theorem pythagoreanTriple_comm {x y z : β€} : PythagoreanTriple x y z β PythagoreanTriple y x z := by
delta PythagoreanTriple
rw [add_comm]
#align pythagorean_triple_comm pythagoreanTriple_comm
theorem PythagoreanTriple.zero : PythagoreanTriple 0 0 0 := by
simp only [PythagoreanTriple, zero_mul, zero_add]
#align pythagorean_triple.zero PythagoreanTriple.zero
namespace PythagoreanTriple
variable {x y z : β€} (h : PythagoreanTriple x y z)
theorem eq : x * x + y * y = z * z :=
h
#align pythagorean_triple.eq PythagoreanTriple.eq
@[symm]
theorem symm : PythagoreanTriple y x z := by rwa [pythagoreanTriple_comm]
#align pythagorean_triple.symm PythagoreanTriple.symm
| Mathlib/NumberTheory/PythagoreanTriples.lean | 78 | 82 | theorem mul (k : β€) : PythagoreanTriple (k * x) (k * y) (k * z) :=
calc
k * x * (k * x) + k * y * (k * y) = k ^ 2 * (x * x + y * y) := by | ring
_ = k ^ 2 * (z * z) := by rw [h.eq]
_ = k * z * (k * z) := by ring
| 3 | 20.085537 | 1 | 1.2 | 10 | 1,251 |
import Mathlib.Algebra.Field.Basic
import Mathlib.Algebra.Order.Group.Basic
import Mathlib.Algebra.Order.Ring.Basic
import Mathlib.RingTheory.Int.Basic
import Mathlib.Tactic.Ring
import Mathlib.Tactic.FieldSimp
import Mathlib.Data.Int.NatPrime
import Mathlib.Data.ZMod.Basic
#align_import number_theory.pythagorean_triples from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3"
theorem sq_ne_two_fin_zmod_four (z : ZMod 4) : z * z β 2 := by
change Fin 4 at z
fin_cases z <;> decide
#align sq_ne_two_fin_zmod_four sq_ne_two_fin_zmod_four
theorem Int.sq_ne_two_mod_four (z : β€) : z * z % 4 β 2 := by
suffices Β¬z * z % (4 : β) = 2 % (4 : β) by exact this
rw [β ZMod.intCast_eq_intCast_iff']
simpa using sq_ne_two_fin_zmod_four _
#align int.sq_ne_two_mod_four Int.sq_ne_two_mod_four
noncomputable section
open scoped Classical
def PythagoreanTriple (x y z : β€) : Prop :=
x * x + y * y = z * z
#align pythagorean_triple PythagoreanTriple
theorem pythagoreanTriple_comm {x y z : β€} : PythagoreanTriple x y z β PythagoreanTriple y x z := by
delta PythagoreanTriple
rw [add_comm]
#align pythagorean_triple_comm pythagoreanTriple_comm
theorem PythagoreanTriple.zero : PythagoreanTriple 0 0 0 := by
simp only [PythagoreanTriple, zero_mul, zero_add]
#align pythagorean_triple.zero PythagoreanTriple.zero
namespace PythagoreanTriple
variable {x y z : β€} (h : PythagoreanTriple x y z)
theorem eq : x * x + y * y = z * z :=
h
#align pythagorean_triple.eq PythagoreanTriple.eq
@[symm]
theorem symm : PythagoreanTriple y x z := by rwa [pythagoreanTriple_comm]
#align pythagorean_triple.symm PythagoreanTriple.symm
theorem mul (k : β€) : PythagoreanTriple (k * x) (k * y) (k * z) :=
calc
k * x * (k * x) + k * y * (k * y) = k ^ 2 * (x * x + y * y) := by ring
_ = k ^ 2 * (z * z) := by rw [h.eq]
_ = k * z * (k * z) := by ring
#align pythagorean_triple.mul PythagoreanTriple.mul
| Mathlib/NumberTheory/PythagoreanTriples.lean | 87 | 93 | theorem mul_iff (k : β€) (hk : k β 0) :
PythagoreanTriple (k * x) (k * y) (k * z) β PythagoreanTriple x y z := by |
refine β¨?_, fun h => h.mul kβ©
simp only [PythagoreanTriple]
intro h
rw [β mul_left_inj' (mul_ne_zero hk hk)]
convert h using 1 <;> ring
| 5 | 148.413159 | 2 | 1.2 | 10 | 1,251 |
import Mathlib.Algebra.Field.Basic
import Mathlib.Algebra.Order.Group.Basic
import Mathlib.Algebra.Order.Ring.Basic
import Mathlib.RingTheory.Int.Basic
import Mathlib.Tactic.Ring
import Mathlib.Tactic.FieldSimp
import Mathlib.Data.Int.NatPrime
import Mathlib.Data.ZMod.Basic
#align_import number_theory.pythagorean_triples from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3"
theorem sq_ne_two_fin_zmod_four (z : ZMod 4) : z * z β 2 := by
change Fin 4 at z
fin_cases z <;> decide
#align sq_ne_two_fin_zmod_four sq_ne_two_fin_zmod_four
theorem Int.sq_ne_two_mod_four (z : β€) : z * z % 4 β 2 := by
suffices Β¬z * z % (4 : β) = 2 % (4 : β) by exact this
rw [β ZMod.intCast_eq_intCast_iff']
simpa using sq_ne_two_fin_zmod_four _
#align int.sq_ne_two_mod_four Int.sq_ne_two_mod_four
noncomputable section
open scoped Classical
def PythagoreanTriple (x y z : β€) : Prop :=
x * x + y * y = z * z
#align pythagorean_triple PythagoreanTriple
theorem pythagoreanTriple_comm {x y z : β€} : PythagoreanTriple x y z β PythagoreanTriple y x z := by
delta PythagoreanTriple
rw [add_comm]
#align pythagorean_triple_comm pythagoreanTriple_comm
theorem PythagoreanTriple.zero : PythagoreanTriple 0 0 0 := by
simp only [PythagoreanTriple, zero_mul, zero_add]
#align pythagorean_triple.zero PythagoreanTriple.zero
namespace PythagoreanTriple
variable {x y z : β€} (h : PythagoreanTriple x y z)
theorem eq : x * x + y * y = z * z :=
h
#align pythagorean_triple.eq PythagoreanTriple.eq
@[symm]
theorem symm : PythagoreanTriple y x z := by rwa [pythagoreanTriple_comm]
#align pythagorean_triple.symm PythagoreanTriple.symm
theorem mul (k : β€) : PythagoreanTriple (k * x) (k * y) (k * z) :=
calc
k * x * (k * x) + k * y * (k * y) = k ^ 2 * (x * x + y * y) := by ring
_ = k ^ 2 * (z * z) := by rw [h.eq]
_ = k * z * (k * z) := by ring
#align pythagorean_triple.mul PythagoreanTriple.mul
theorem mul_iff (k : β€) (hk : k β 0) :
PythagoreanTriple (k * x) (k * y) (k * z) β PythagoreanTriple x y z := by
refine β¨?_, fun h => h.mul kβ©
simp only [PythagoreanTriple]
intro h
rw [β mul_left_inj' (mul_ne_zero hk hk)]
convert h using 1 <;> ring
#align pythagorean_triple.mul_iff PythagoreanTriple.mul_iff
@[nolint unusedArguments]
def IsClassified (_ : PythagoreanTriple x y z) :=
β k m n : β€,
(x = k * (m ^ 2 - n ^ 2) β§ y = k * (2 * m * n) β¨
x = k * (2 * m * n) β§ y = k * (m ^ 2 - n ^ 2)) β§
Int.gcd m n = 1
#align pythagorean_triple.is_classified PythagoreanTriple.IsClassified
@[nolint unusedArguments]
def IsPrimitiveClassified (_ : PythagoreanTriple x y z) :=
β m n : β€,
(x = m ^ 2 - n ^ 2 β§ y = 2 * m * n β¨ x = 2 * m * n β§ y = m ^ 2 - n ^ 2) β§
Int.gcd m n = 1 β§ (m % 2 = 0 β§ n % 2 = 1 β¨ m % 2 = 1 β§ n % 2 = 0)
#align pythagorean_triple.is_primitive_classified PythagoreanTriple.IsPrimitiveClassified
| Mathlib/NumberTheory/PythagoreanTriples.lean | 120 | 129 | theorem mul_isClassified (k : β€) (hc : h.IsClassified) : (h.mul k).IsClassified := by |
obtain β¨l, m, n, β¨β¨rfl, rflβ© | β¨rfl, rflβ©, coβ©β© := hc
Β· use k * l, m, n
apply And.intro _ co
left
constructor <;> ring
Β· use k * l, m, n
apply And.intro _ co
right
constructor <;> ring
| 9 | 8,103.083928 | 2 | 1.2 | 10 | 1,251 |
import Mathlib.Algebra.Field.Basic
import Mathlib.Algebra.Order.Group.Basic
import Mathlib.Algebra.Order.Ring.Basic
import Mathlib.RingTheory.Int.Basic
import Mathlib.Tactic.Ring
import Mathlib.Tactic.FieldSimp
import Mathlib.Data.Int.NatPrime
import Mathlib.Data.ZMod.Basic
#align_import number_theory.pythagorean_triples from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3"
theorem sq_ne_two_fin_zmod_four (z : ZMod 4) : z * z β 2 := by
change Fin 4 at z
fin_cases z <;> decide
#align sq_ne_two_fin_zmod_four sq_ne_two_fin_zmod_four
theorem Int.sq_ne_two_mod_four (z : β€) : z * z % 4 β 2 := by
suffices Β¬z * z % (4 : β) = 2 % (4 : β) by exact this
rw [β ZMod.intCast_eq_intCast_iff']
simpa using sq_ne_two_fin_zmod_four _
#align int.sq_ne_two_mod_four Int.sq_ne_two_mod_four
noncomputable section
open scoped Classical
def PythagoreanTriple (x y z : β€) : Prop :=
x * x + y * y = z * z
#align pythagorean_triple PythagoreanTriple
theorem pythagoreanTriple_comm {x y z : β€} : PythagoreanTriple x y z β PythagoreanTriple y x z := by
delta PythagoreanTriple
rw [add_comm]
#align pythagorean_triple_comm pythagoreanTriple_comm
theorem PythagoreanTriple.zero : PythagoreanTriple 0 0 0 := by
simp only [PythagoreanTriple, zero_mul, zero_add]
#align pythagorean_triple.zero PythagoreanTriple.zero
namespace PythagoreanTriple
variable {x y z : β€} (h : PythagoreanTriple x y z)
theorem eq : x * x + y * y = z * z :=
h
#align pythagorean_triple.eq PythagoreanTriple.eq
@[symm]
theorem symm : PythagoreanTriple y x z := by rwa [pythagoreanTriple_comm]
#align pythagorean_triple.symm PythagoreanTriple.symm
theorem mul (k : β€) : PythagoreanTriple (k * x) (k * y) (k * z) :=
calc
k * x * (k * x) + k * y * (k * y) = k ^ 2 * (x * x + y * y) := by ring
_ = k ^ 2 * (z * z) := by rw [h.eq]
_ = k * z * (k * z) := by ring
#align pythagorean_triple.mul PythagoreanTriple.mul
theorem mul_iff (k : β€) (hk : k β 0) :
PythagoreanTriple (k * x) (k * y) (k * z) β PythagoreanTriple x y z := by
refine β¨?_, fun h => h.mul kβ©
simp only [PythagoreanTriple]
intro h
rw [β mul_left_inj' (mul_ne_zero hk hk)]
convert h using 1 <;> ring
#align pythagorean_triple.mul_iff PythagoreanTriple.mul_iff
@[nolint unusedArguments]
def IsClassified (_ : PythagoreanTriple x y z) :=
β k m n : β€,
(x = k * (m ^ 2 - n ^ 2) β§ y = k * (2 * m * n) β¨
x = k * (2 * m * n) β§ y = k * (m ^ 2 - n ^ 2)) β§
Int.gcd m n = 1
#align pythagorean_triple.is_classified PythagoreanTriple.IsClassified
@[nolint unusedArguments]
def IsPrimitiveClassified (_ : PythagoreanTriple x y z) :=
β m n : β€,
(x = m ^ 2 - n ^ 2 β§ y = 2 * m * n β¨ x = 2 * m * n β§ y = m ^ 2 - n ^ 2) β§
Int.gcd m n = 1 β§ (m % 2 = 0 β§ n % 2 = 1 β¨ m % 2 = 1 β§ n % 2 = 0)
#align pythagorean_triple.is_primitive_classified PythagoreanTriple.IsPrimitiveClassified
theorem mul_isClassified (k : β€) (hc : h.IsClassified) : (h.mul k).IsClassified := by
obtain β¨l, m, n, β¨β¨rfl, rflβ© | β¨rfl, rflβ©, coβ©β© := hc
Β· use k * l, m, n
apply And.intro _ co
left
constructor <;> ring
Β· use k * l, m, n
apply And.intro _ co
right
constructor <;> ring
#align pythagorean_triple.mul_is_classified PythagoreanTriple.mul_isClassified
| Mathlib/NumberTheory/PythagoreanTriples.lean | 132 | 161 | theorem even_odd_of_coprime (hc : Int.gcd x y = 1) :
x % 2 = 0 β§ y % 2 = 1 β¨ x % 2 = 1 β§ y % 2 = 0 := by |
cases' Int.emod_two_eq_zero_or_one x with hx hx <;>
cases' Int.emod_two_eq_zero_or_one y with hy hy
-- x even, y even
Β· exfalso
apply Nat.not_coprime_of_dvd_of_dvd (by decide : 1 < 2) _ _ hc
Β· apply Int.natCast_dvd.1
apply Int.dvd_of_emod_eq_zero hx
Β· apply Int.natCast_dvd.1
apply Int.dvd_of_emod_eq_zero hy
-- x even, y odd
Β· left
exact β¨hx, hyβ©
-- x odd, y even
Β· right
exact β¨hx, hyβ©
-- x odd, y odd
Β· exfalso
obtain β¨x0, y0, rfl, rflβ© : β x0 y0, x = x0 * 2 + 1 β§ y = y0 * 2 + 1 := by
cases' exists_eq_mul_left_of_dvd (Int.dvd_sub_of_emod_eq hx) with x0 hx2
cases' exists_eq_mul_left_of_dvd (Int.dvd_sub_of_emod_eq hy) with y0 hy2
rw [sub_eq_iff_eq_add] at hx2 hy2
exact β¨x0, y0, hx2, hy2β©
apply Int.sq_ne_two_mod_four z
rw [show z * z = 4 * (x0 * x0 + x0 + y0 * y0 + y0) + 2 by
rw [β h.eq]
ring]
simp only [Int.add_emod, Int.mul_emod_right, zero_add]
decide
| 28 | 1,446,257,064,291.475 | 2 | 1.2 | 10 | 1,251 |
import Mathlib.Algebra.Field.Basic
import Mathlib.Algebra.Order.Group.Basic
import Mathlib.Algebra.Order.Ring.Basic
import Mathlib.RingTheory.Int.Basic
import Mathlib.Tactic.Ring
import Mathlib.Tactic.FieldSimp
import Mathlib.Data.Int.NatPrime
import Mathlib.Data.ZMod.Basic
#align_import number_theory.pythagorean_triples from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3"
theorem sq_ne_two_fin_zmod_four (z : ZMod 4) : z * z β 2 := by
change Fin 4 at z
fin_cases z <;> decide
#align sq_ne_two_fin_zmod_four sq_ne_two_fin_zmod_four
theorem Int.sq_ne_two_mod_four (z : β€) : z * z % 4 β 2 := by
suffices Β¬z * z % (4 : β) = 2 % (4 : β) by exact this
rw [β ZMod.intCast_eq_intCast_iff']
simpa using sq_ne_two_fin_zmod_four _
#align int.sq_ne_two_mod_four Int.sq_ne_two_mod_four
noncomputable section
open scoped Classical
def PythagoreanTriple (x y z : β€) : Prop :=
x * x + y * y = z * z
#align pythagorean_triple PythagoreanTriple
theorem pythagoreanTriple_comm {x y z : β€} : PythagoreanTriple x y z β PythagoreanTriple y x z := by
delta PythagoreanTriple
rw [add_comm]
#align pythagorean_triple_comm pythagoreanTriple_comm
theorem PythagoreanTriple.zero : PythagoreanTriple 0 0 0 := by
simp only [PythagoreanTriple, zero_mul, zero_add]
#align pythagorean_triple.zero PythagoreanTriple.zero
namespace PythagoreanTriple
variable {x y z : β€} (h : PythagoreanTriple x y z)
theorem eq : x * x + y * y = z * z :=
h
#align pythagorean_triple.eq PythagoreanTriple.eq
@[symm]
theorem symm : PythagoreanTriple y x z := by rwa [pythagoreanTriple_comm]
#align pythagorean_triple.symm PythagoreanTriple.symm
theorem mul (k : β€) : PythagoreanTriple (k * x) (k * y) (k * z) :=
calc
k * x * (k * x) + k * y * (k * y) = k ^ 2 * (x * x + y * y) := by ring
_ = k ^ 2 * (z * z) := by rw [h.eq]
_ = k * z * (k * z) := by ring
#align pythagorean_triple.mul PythagoreanTriple.mul
theorem mul_iff (k : β€) (hk : k β 0) :
PythagoreanTriple (k * x) (k * y) (k * z) β PythagoreanTriple x y z := by
refine β¨?_, fun h => h.mul kβ©
simp only [PythagoreanTriple]
intro h
rw [β mul_left_inj' (mul_ne_zero hk hk)]
convert h using 1 <;> ring
#align pythagorean_triple.mul_iff PythagoreanTriple.mul_iff
@[nolint unusedArguments]
def IsClassified (_ : PythagoreanTriple x y z) :=
β k m n : β€,
(x = k * (m ^ 2 - n ^ 2) β§ y = k * (2 * m * n) β¨
x = k * (2 * m * n) β§ y = k * (m ^ 2 - n ^ 2)) β§
Int.gcd m n = 1
#align pythagorean_triple.is_classified PythagoreanTriple.IsClassified
@[nolint unusedArguments]
def IsPrimitiveClassified (_ : PythagoreanTriple x y z) :=
β m n : β€,
(x = m ^ 2 - n ^ 2 β§ y = 2 * m * n β¨ x = 2 * m * n β§ y = m ^ 2 - n ^ 2) β§
Int.gcd m n = 1 β§ (m % 2 = 0 β§ n % 2 = 1 β¨ m % 2 = 1 β§ n % 2 = 0)
#align pythagorean_triple.is_primitive_classified PythagoreanTriple.IsPrimitiveClassified
theorem mul_isClassified (k : β€) (hc : h.IsClassified) : (h.mul k).IsClassified := by
obtain β¨l, m, n, β¨β¨rfl, rflβ© | β¨rfl, rflβ©, coβ©β© := hc
Β· use k * l, m, n
apply And.intro _ co
left
constructor <;> ring
Β· use k * l, m, n
apply And.intro _ co
right
constructor <;> ring
#align pythagorean_triple.mul_is_classified PythagoreanTriple.mul_isClassified
theorem even_odd_of_coprime (hc : Int.gcd x y = 1) :
x % 2 = 0 β§ y % 2 = 1 β¨ x % 2 = 1 β§ y % 2 = 0 := by
cases' Int.emod_two_eq_zero_or_one x with hx hx <;>
cases' Int.emod_two_eq_zero_or_one y with hy hy
-- x even, y even
Β· exfalso
apply Nat.not_coprime_of_dvd_of_dvd (by decide : 1 < 2) _ _ hc
Β· apply Int.natCast_dvd.1
apply Int.dvd_of_emod_eq_zero hx
Β· apply Int.natCast_dvd.1
apply Int.dvd_of_emod_eq_zero hy
-- x even, y odd
Β· left
exact β¨hx, hyβ©
-- x odd, y even
Β· right
exact β¨hx, hyβ©
-- x odd, y odd
Β· exfalso
obtain β¨x0, y0, rfl, rflβ© : β x0 y0, x = x0 * 2 + 1 β§ y = y0 * 2 + 1 := by
cases' exists_eq_mul_left_of_dvd (Int.dvd_sub_of_emod_eq hx) with x0 hx2
cases' exists_eq_mul_left_of_dvd (Int.dvd_sub_of_emod_eq hy) with y0 hy2
rw [sub_eq_iff_eq_add] at hx2 hy2
exact β¨x0, y0, hx2, hy2β©
apply Int.sq_ne_two_mod_four z
rw [show z * z = 4 * (x0 * x0 + x0 + y0 * y0 + y0) + 2 by
rw [β h.eq]
ring]
simp only [Int.add_emod, Int.mul_emod_right, zero_add]
decide
#align pythagorean_triple.even_odd_of_coprime PythagoreanTriple.even_odd_of_coprime
| Mathlib/NumberTheory/PythagoreanTriples.lean | 164 | 182 | theorem gcd_dvd : (Int.gcd x y : β€) β£ z := by |
by_cases h0 : Int.gcd x y = 0
Β· have hx : x = 0 := by
apply Int.natAbs_eq_zero.mp
apply Nat.eq_zero_of_gcd_eq_zero_left h0
have hy : y = 0 := by
apply Int.natAbs_eq_zero.mp
apply Nat.eq_zero_of_gcd_eq_zero_right h0
have hz : z = 0 := by
simpa only [PythagoreanTriple, hx, hy, add_zero, zero_eq_mul, mul_zero,
or_self_iff] using h
simp only [hz, dvd_zero]
obtain β¨k, x0, y0, _, h2, rfl, rflβ© :
β (k : β) (x0 y0 : _), 0 < k β§ Int.gcd x0 y0 = 1 β§ x = x0 * k β§ y = y0 * k :=
Int.exists_gcd_one' (Nat.pos_of_ne_zero h0)
rw [Int.gcd_mul_right, h2, Int.natAbs_ofNat, one_mul]
rw [β Int.pow_dvd_pow_iff two_ne_zero, sq z, β h.eq]
rw [(by ring : x0 * k * (x0 * k) + y0 * k * (y0 * k) = (k : β€) ^ 2 * (x0 * x0 + y0 * y0))]
exact dvd_mul_right _ _
| 18 | 65,659,969.137331 | 2 | 1.2 | 10 | 1,251 |
import Mathlib.Algebra.Order.Monoid.Unbundled.Basic
#align_import algebra.order.monoid.min_max from "leanprover-community/mathlib"@"de87d5053a9fe5cbde723172c0fb7e27e7436473"
open Function
variable {Ξ± Ξ² : Type*}
section CovariantClassMulLe
variable [LinearOrder Ξ±]
section Mul
variable [Mul Ξ±]
@[to_additive]
| Mathlib/Algebra/Order/Monoid/Unbundled/MinMax.lean | 90 | 94 | theorem lt_or_lt_of_mul_lt_mul [CovariantClass Ξ± Ξ± (Β· * Β·) (Β· β€ Β·)]
[CovariantClass Ξ± Ξ± (Function.swap (Β· * Β·)) (Β· β€ Β·)] {aβ aβ bβ bβ : Ξ±} :
aβ * bβ < aβ * bβ β aβ < aβ β¨ bβ < bβ := by |
contrapose!
exact fun h => mul_le_mul' h.1 h.2
| 2 | 7.389056 | 1 | 1.2 | 5 | 1,252 |
import Mathlib.Algebra.Order.Monoid.Unbundled.Basic
#align_import algebra.order.monoid.min_max from "leanprover-community/mathlib"@"de87d5053a9fe5cbde723172c0fb7e27e7436473"
open Function
variable {Ξ± Ξ² : Type*}
section CovariantClassMulLe
variable [LinearOrder Ξ±]
section Mul
variable [Mul Ξ±]
@[to_additive]
theorem lt_or_lt_of_mul_lt_mul [CovariantClass Ξ± Ξ± (Β· * Β·) (Β· β€ Β·)]
[CovariantClass Ξ± Ξ± (Function.swap (Β· * Β·)) (Β· β€ Β·)] {aβ aβ bβ bβ : Ξ±} :
aβ * bβ < aβ * bβ β aβ < aβ β¨ bβ < bβ := by
contrapose!
exact fun h => mul_le_mul' h.1 h.2
#align lt_or_lt_of_mul_lt_mul lt_or_lt_of_mul_lt_mul
#align lt_or_lt_of_add_lt_add lt_or_lt_of_add_lt_add
@[to_additive]
| Mathlib/Algebra/Order/Monoid/Unbundled/MinMax.lean | 99 | 103 | theorem le_or_lt_of_mul_le_mul [CovariantClass Ξ± Ξ± (Β· * Β·) (Β· β€ Β·)]
[CovariantClass Ξ± Ξ± (Function.swap (Β· * Β·)) (Β· < Β·)] {aβ aβ bβ bβ : Ξ±} :
aβ * bβ β€ aβ * bβ β aβ β€ aβ β¨ bβ < bβ := by |
contrapose!
exact fun h => mul_lt_mul_of_lt_of_le h.1 h.2
| 2 | 7.389056 | 1 | 1.2 | 5 | 1,252 |
import Mathlib.Algebra.Order.Monoid.Unbundled.Basic
#align_import algebra.order.monoid.min_max from "leanprover-community/mathlib"@"de87d5053a9fe5cbde723172c0fb7e27e7436473"
open Function
variable {Ξ± Ξ² : Type*}
section CovariantClassMulLe
variable [LinearOrder Ξ±]
section Mul
variable [Mul Ξ±]
@[to_additive]
theorem lt_or_lt_of_mul_lt_mul [CovariantClass Ξ± Ξ± (Β· * Β·) (Β· β€ Β·)]
[CovariantClass Ξ± Ξ± (Function.swap (Β· * Β·)) (Β· β€ Β·)] {aβ aβ bβ bβ : Ξ±} :
aβ * bβ < aβ * bβ β aβ < aβ β¨ bβ < bβ := by
contrapose!
exact fun h => mul_le_mul' h.1 h.2
#align lt_or_lt_of_mul_lt_mul lt_or_lt_of_mul_lt_mul
#align lt_or_lt_of_add_lt_add lt_or_lt_of_add_lt_add
@[to_additive]
theorem le_or_lt_of_mul_le_mul [CovariantClass Ξ± Ξ± (Β· * Β·) (Β· β€ Β·)]
[CovariantClass Ξ± Ξ± (Function.swap (Β· * Β·)) (Β· < Β·)] {aβ aβ bβ bβ : Ξ±} :
aβ * bβ β€ aβ * bβ β aβ β€ aβ β¨ bβ < bβ := by
contrapose!
exact fun h => mul_lt_mul_of_lt_of_le h.1 h.2
#align le_or_lt_of_mul_le_mul le_or_lt_of_mul_le_mul
#align le_or_lt_of_add_le_add le_or_lt_of_add_le_add
@[to_additive]
| Mathlib/Algebra/Order/Monoid/Unbundled/MinMax.lean | 108 | 112 | theorem lt_or_le_of_mul_le_mul [CovariantClass Ξ± Ξ± (Β· * Β·) (Β· < Β·)]
[CovariantClass Ξ± Ξ± (Function.swap (Β· * Β·)) (Β· β€ Β·)] {aβ aβ bβ bβ : Ξ±} :
aβ * bβ β€ aβ * bβ β aβ < aβ β¨ bβ β€ bβ := by |
contrapose!
exact fun h => mul_lt_mul_of_le_of_lt h.1 h.2
| 2 | 7.389056 | 1 | 1.2 | 5 | 1,252 |
import Mathlib.Algebra.Order.Monoid.Unbundled.Basic
#align_import algebra.order.monoid.min_max from "leanprover-community/mathlib"@"de87d5053a9fe5cbde723172c0fb7e27e7436473"
open Function
variable {Ξ± Ξ² : Type*}
section CovariantClassMulLe
variable [LinearOrder Ξ±]
section Mul
variable [Mul Ξ±]
@[to_additive]
theorem lt_or_lt_of_mul_lt_mul [CovariantClass Ξ± Ξ± (Β· * Β·) (Β· β€ Β·)]
[CovariantClass Ξ± Ξ± (Function.swap (Β· * Β·)) (Β· β€ Β·)] {aβ aβ bβ bβ : Ξ±} :
aβ * bβ < aβ * bβ β aβ < aβ β¨ bβ < bβ := by
contrapose!
exact fun h => mul_le_mul' h.1 h.2
#align lt_or_lt_of_mul_lt_mul lt_or_lt_of_mul_lt_mul
#align lt_or_lt_of_add_lt_add lt_or_lt_of_add_lt_add
@[to_additive]
theorem le_or_lt_of_mul_le_mul [CovariantClass Ξ± Ξ± (Β· * Β·) (Β· β€ Β·)]
[CovariantClass Ξ± Ξ± (Function.swap (Β· * Β·)) (Β· < Β·)] {aβ aβ bβ bβ : Ξ±} :
aβ * bβ β€ aβ * bβ β aβ β€ aβ β¨ bβ < bβ := by
contrapose!
exact fun h => mul_lt_mul_of_lt_of_le h.1 h.2
#align le_or_lt_of_mul_le_mul le_or_lt_of_mul_le_mul
#align le_or_lt_of_add_le_add le_or_lt_of_add_le_add
@[to_additive]
theorem lt_or_le_of_mul_le_mul [CovariantClass Ξ± Ξ± (Β· * Β·) (Β· < Β·)]
[CovariantClass Ξ± Ξ± (Function.swap (Β· * Β·)) (Β· β€ Β·)] {aβ aβ bβ bβ : Ξ±} :
aβ * bβ β€ aβ * bβ β aβ < aβ β¨ bβ β€ bβ := by
contrapose!
exact fun h => mul_lt_mul_of_le_of_lt h.1 h.2
#align lt_or_le_of_mul_le_mul lt_or_le_of_mul_le_mul
#align lt_or_le_of_add_le_add lt_or_le_of_add_le_add
@[to_additive]
| Mathlib/Algebra/Order/Monoid/Unbundled/MinMax.lean | 117 | 121 | theorem le_or_le_of_mul_le_mul [CovariantClass Ξ± Ξ± (Β· * Β·) (Β· < Β·)]
[CovariantClass Ξ± Ξ± (Function.swap (Β· * Β·)) (Β· < Β·)] {aβ aβ bβ bβ : Ξ±} :
aβ * bβ β€ aβ * bβ β aβ β€ aβ β¨ bβ β€ bβ := by |
contrapose!
exact fun h => mul_lt_mul_of_lt_of_lt h.1 h.2
| 2 | 7.389056 | 1 | 1.2 | 5 | 1,252 |
import Mathlib.Algebra.Order.Monoid.Unbundled.Basic
#align_import algebra.order.monoid.min_max from "leanprover-community/mathlib"@"de87d5053a9fe5cbde723172c0fb7e27e7436473"
open Function
variable {Ξ± Ξ² : Type*}
section CovariantClassMulLe
variable [LinearOrder Ξ±]
section Mul
variable [Mul Ξ±]
@[to_additive]
theorem lt_or_lt_of_mul_lt_mul [CovariantClass Ξ± Ξ± (Β· * Β·) (Β· β€ Β·)]
[CovariantClass Ξ± Ξ± (Function.swap (Β· * Β·)) (Β· β€ Β·)] {aβ aβ bβ bβ : Ξ±} :
aβ * bβ < aβ * bβ β aβ < aβ β¨ bβ < bβ := by
contrapose!
exact fun h => mul_le_mul' h.1 h.2
#align lt_or_lt_of_mul_lt_mul lt_or_lt_of_mul_lt_mul
#align lt_or_lt_of_add_lt_add lt_or_lt_of_add_lt_add
@[to_additive]
theorem le_or_lt_of_mul_le_mul [CovariantClass Ξ± Ξ± (Β· * Β·) (Β· β€ Β·)]
[CovariantClass Ξ± Ξ± (Function.swap (Β· * Β·)) (Β· < Β·)] {aβ aβ bβ bβ : Ξ±} :
aβ * bβ β€ aβ * bβ β aβ β€ aβ β¨ bβ < bβ := by
contrapose!
exact fun h => mul_lt_mul_of_lt_of_le h.1 h.2
#align le_or_lt_of_mul_le_mul le_or_lt_of_mul_le_mul
#align le_or_lt_of_add_le_add le_or_lt_of_add_le_add
@[to_additive]
theorem lt_or_le_of_mul_le_mul [CovariantClass Ξ± Ξ± (Β· * Β·) (Β· < Β·)]
[CovariantClass Ξ± Ξ± (Function.swap (Β· * Β·)) (Β· β€ Β·)] {aβ aβ bβ bβ : Ξ±} :
aβ * bβ β€ aβ * bβ β aβ < aβ β¨ bβ β€ bβ := by
contrapose!
exact fun h => mul_lt_mul_of_le_of_lt h.1 h.2
#align lt_or_le_of_mul_le_mul lt_or_le_of_mul_le_mul
#align lt_or_le_of_add_le_add lt_or_le_of_add_le_add
@[to_additive]
theorem le_or_le_of_mul_le_mul [CovariantClass Ξ± Ξ± (Β· * Β·) (Β· < Β·)]
[CovariantClass Ξ± Ξ± (Function.swap (Β· * Β·)) (Β· < Β·)] {aβ aβ bβ bβ : Ξ±} :
aβ * bβ β€ aβ * bβ β aβ β€ aβ β¨ bβ β€ bβ := by
contrapose!
exact fun h => mul_lt_mul_of_lt_of_lt h.1 h.2
#align le_or_le_of_mul_le_mul le_or_le_of_mul_le_mul
#align le_or_le_of_add_le_add le_or_le_of_add_le_add
@[to_additive]
| Mathlib/Algebra/Order/Monoid/Unbundled/MinMax.lean | 126 | 133 | theorem mul_lt_mul_iff_of_le_of_le [CovariantClass Ξ± Ξ± (Β· * Β·) (Β· β€ Β·)]
[CovariantClass Ξ± Ξ± (Function.swap (Β· * Β·)) (Β· β€ Β·)] [CovariantClass Ξ± Ξ± (Β· * Β·) (Β· < Β·)]
[CovariantClass Ξ± Ξ± (Function.swap (Β· * Β·)) (Β· < Β·)] {aβ aβ bβ bβ : Ξ±} (ha : aβ β€ aβ)
(hb : bβ β€ bβ) : aβ * bβ < aβ * bβ β aβ < aβ β¨ bβ < bβ := by |
refine β¨lt_or_lt_of_mul_lt_mul, fun h => ?_β©
cases' h with ha' hb'
Β· exact mul_lt_mul_of_lt_of_le ha' hb
Β· exact mul_lt_mul_of_le_of_lt ha hb'
| 4 | 54.59815 | 2 | 1.2 | 5 | 1,252 |
import Mathlib.Analysis.RCLike.Basic
import Mathlib.Analysis.NormedSpace.OperatorNorm.Basic
import Mathlib.Analysis.NormedSpace.Pointwise
#align_import analysis.normed_space.is_R_or_C from "leanprover-community/mathlib"@"3f655f5297b030a87d641ad4e825af8d9679eb0b"
open Metric
variable {π : Type*} [RCLike π] {E : Type*} [NormedAddCommGroup E]
| Mathlib/Analysis/NormedSpace/RCLike.lean | 36 | 36 | theorem RCLike.norm_coe_norm {z : E} : β(βzβ : π)β = βzβ := by | simp
| 1 | 2.718282 | 0 | 1.2 | 5 | 1,253 |
import Mathlib.Analysis.RCLike.Basic
import Mathlib.Analysis.NormedSpace.OperatorNorm.Basic
import Mathlib.Analysis.NormedSpace.Pointwise
#align_import analysis.normed_space.is_R_or_C from "leanprover-community/mathlib"@"3f655f5297b030a87d641ad4e825af8d9679eb0b"
open Metric
variable {π : Type*} [RCLike π] {E : Type*} [NormedAddCommGroup E]
theorem RCLike.norm_coe_norm {z : E} : β(βzβ : π)β = βzβ := by simp
#align is_R_or_C.norm_coe_norm RCLike.norm_coe_norm
variable [NormedSpace π E]
@[simp]
| Mathlib/Analysis/NormedSpace/RCLike.lean | 43 | 45 | theorem norm_smul_inv_norm {x : E} (hx : x β 0) : β(βxββ»ΒΉ : π) β’ xβ = 1 := by |
have : βxβ β 0 := by simp [hx]
field_simp [norm_smul]
| 2 | 7.389056 | 1 | 1.2 | 5 | 1,253 |
import Mathlib.Analysis.RCLike.Basic
import Mathlib.Analysis.NormedSpace.OperatorNorm.Basic
import Mathlib.Analysis.NormedSpace.Pointwise
#align_import analysis.normed_space.is_R_or_C from "leanprover-community/mathlib"@"3f655f5297b030a87d641ad4e825af8d9679eb0b"
open Metric
variable {π : Type*} [RCLike π] {E : Type*} [NormedAddCommGroup E]
theorem RCLike.norm_coe_norm {z : E} : β(βzβ : π)β = βzβ := by simp
#align is_R_or_C.norm_coe_norm RCLike.norm_coe_norm
variable [NormedSpace π E]
@[simp]
theorem norm_smul_inv_norm {x : E} (hx : x β 0) : β(βxββ»ΒΉ : π) β’ xβ = 1 := by
have : βxβ β 0 := by simp [hx]
field_simp [norm_smul]
#align norm_smul_inv_norm norm_smul_inv_norm
| Mathlib/Analysis/NormedSpace/RCLike.lean | 49 | 52 | theorem norm_smul_inv_norm' {r : β} (r_nonneg : 0 β€ r) {x : E} (hx : x β 0) :
β((r : π) * (βxβ : π)β»ΒΉ) β’ xβ = r := by |
have : βxβ β 0 := by simp [hx]
field_simp [norm_smul, r_nonneg, rclike_simps]
| 2 | 7.389056 | 1 | 1.2 | 5 | 1,253 |
import Mathlib.Analysis.RCLike.Basic
import Mathlib.Analysis.NormedSpace.OperatorNorm.Basic
import Mathlib.Analysis.NormedSpace.Pointwise
#align_import analysis.normed_space.is_R_or_C from "leanprover-community/mathlib"@"3f655f5297b030a87d641ad4e825af8d9679eb0b"
open Metric
variable {π : Type*} [RCLike π] {E : Type*} [NormedAddCommGroup E]
theorem RCLike.norm_coe_norm {z : E} : β(βzβ : π)β = βzβ := by simp
#align is_R_or_C.norm_coe_norm RCLike.norm_coe_norm
variable [NormedSpace π E]
@[simp]
theorem norm_smul_inv_norm {x : E} (hx : x β 0) : β(βxββ»ΒΉ : π) β’ xβ = 1 := by
have : βxβ β 0 := by simp [hx]
field_simp [norm_smul]
#align norm_smul_inv_norm norm_smul_inv_norm
theorem norm_smul_inv_norm' {r : β} (r_nonneg : 0 β€ r) {x : E} (hx : x β 0) :
β((r : π) * (βxβ : π)β»ΒΉ) β’ xβ = r := by
have : βxβ β 0 := by simp [hx]
field_simp [norm_smul, r_nonneg, rclike_simps]
#align norm_smul_inv_norm' norm_smul_inv_norm'
| Mathlib/Analysis/NormedSpace/RCLike.lean | 55 | 75 | theorem LinearMap.bound_of_sphere_bound {r : β} (r_pos : 0 < r) (c : β) (f : E ββ[π] π)
(h : β z β sphere (0 : E) r, βf zβ β€ c) (z : E) : βf zβ β€ c / r * βzβ := by |
by_cases z_zero : z = 0
Β· rw [z_zero]
simp only [LinearMap.map_zero, norm_zero, mul_zero]
exact le_rfl
set zβ := ((r : π) * (βzβ : π)β»ΒΉ) β’ z with hzβ
have norm_f_zβ : βf zββ β€ c := by
apply h
rw [mem_sphere_zero_iff_norm]
exact norm_smul_inv_norm' r_pos.le z_zero
have r_ne_zero : (r : π) β 0 := RCLike.ofReal_ne_zero.mpr r_pos.ne'
have eq : f z = βzβ / r * f zβ := by
rw [hzβ, LinearMap.map_smul, smul_eq_mul]
rw [β mul_assoc, β mul_assoc, div_mul_cancelβ _ r_ne_zero, mul_inv_cancel, one_mul]
simp only [z_zero, RCLike.ofReal_eq_zero, norm_eq_zero, Ne, not_false_iff]
rw [eq, norm_mul, norm_div, RCLike.norm_coe_norm, RCLike.norm_of_nonneg r_pos.le,
div_mul_eq_mul_div, div_mul_eq_mul_div, mul_comm]
apply div_le_div _ _ r_pos rfl.ge
Β· exact mul_nonneg ((norm_nonneg _).trans norm_f_zβ) (norm_nonneg z)
apply mul_le_mul norm_f_zβ rfl.le (norm_nonneg z) ((norm_nonneg _).trans norm_f_zβ)
| 19 | 178,482,300.963187 | 2 | 1.2 | 5 | 1,253 |
import Mathlib.Analysis.RCLike.Basic
import Mathlib.Analysis.NormedSpace.OperatorNorm.Basic
import Mathlib.Analysis.NormedSpace.Pointwise
#align_import analysis.normed_space.is_R_or_C from "leanprover-community/mathlib"@"3f655f5297b030a87d641ad4e825af8d9679eb0b"
open Metric
variable {π : Type*} [RCLike π] {E : Type*} [NormedAddCommGroup E]
theorem RCLike.norm_coe_norm {z : E} : β(βzβ : π)β = βzβ := by simp
#align is_R_or_C.norm_coe_norm RCLike.norm_coe_norm
variable [NormedSpace π E]
@[simp]
theorem norm_smul_inv_norm {x : E} (hx : x β 0) : β(βxββ»ΒΉ : π) β’ xβ = 1 := by
have : βxβ β 0 := by simp [hx]
field_simp [norm_smul]
#align norm_smul_inv_norm norm_smul_inv_norm
theorem norm_smul_inv_norm' {r : β} (r_nonneg : 0 β€ r) {x : E} (hx : x β 0) :
β((r : π) * (βxβ : π)β»ΒΉ) β’ xβ = r := by
have : βxβ β 0 := by simp [hx]
field_simp [norm_smul, r_nonneg, rclike_simps]
#align norm_smul_inv_norm' norm_smul_inv_norm'
theorem LinearMap.bound_of_sphere_bound {r : β} (r_pos : 0 < r) (c : β) (f : E ββ[π] π)
(h : β z β sphere (0 : E) r, βf zβ β€ c) (z : E) : βf zβ β€ c / r * βzβ := by
by_cases z_zero : z = 0
Β· rw [z_zero]
simp only [LinearMap.map_zero, norm_zero, mul_zero]
exact le_rfl
set zβ := ((r : π) * (βzβ : π)β»ΒΉ) β’ z with hzβ
have norm_f_zβ : βf zββ β€ c := by
apply h
rw [mem_sphere_zero_iff_norm]
exact norm_smul_inv_norm' r_pos.le z_zero
have r_ne_zero : (r : π) β 0 := RCLike.ofReal_ne_zero.mpr r_pos.ne'
have eq : f z = βzβ / r * f zβ := by
rw [hzβ, LinearMap.map_smul, smul_eq_mul]
rw [β mul_assoc, β mul_assoc, div_mul_cancelβ _ r_ne_zero, mul_inv_cancel, one_mul]
simp only [z_zero, RCLike.ofReal_eq_zero, norm_eq_zero, Ne, not_false_iff]
rw [eq, norm_mul, norm_div, RCLike.norm_coe_norm, RCLike.norm_of_nonneg r_pos.le,
div_mul_eq_mul_div, div_mul_eq_mul_div, mul_comm]
apply div_le_div _ _ r_pos rfl.ge
Β· exact mul_nonneg ((norm_nonneg _).trans norm_f_zβ) (norm_nonneg z)
apply mul_le_mul norm_f_zβ rfl.le (norm_nonneg z) ((norm_nonneg _).trans norm_f_zβ)
#align linear_map.bound_of_sphere_bound LinearMap.bound_of_sphere_bound
theorem LinearMap.bound_of_ball_bound' {r : β} (r_pos : 0 < r) (c : β) (f : E ββ[π] π)
(h : β z β closedBall (0 : E) r, βf zβ β€ c) (z : E) : βf zβ β€ c / r * βzβ :=
f.bound_of_sphere_bound r_pos c (fun z hz => h z hz.le) z
#align linear_map.bound_of_ball_bound' LinearMap.bound_of_ball_bound'
| Mathlib/Analysis/NormedSpace/RCLike.lean | 85 | 93 | theorem ContinuousLinearMap.opNorm_bound_of_ball_bound {r : β} (r_pos : 0 < r) (c : β)
(f : E βL[π] π) (h : β z β closedBall (0 : E) r, βf zβ β€ c) : βfβ β€ c / r := by |
apply ContinuousLinearMap.opNorm_le_bound
Β· apply div_nonneg _ r_pos.le
exact
(norm_nonneg _).trans
(h 0 (by simp only [norm_zero, mem_closedBall, dist_zero_left, r_pos.le]))
apply LinearMap.bound_of_ball_bound' r_pos
exact fun z hz => h z hz
| 7 | 1,096.633158 | 2 | 1.2 | 5 | 1,253 |
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.NormedSpace.Connected
import Mathlib.LinearAlgebra.AffineSpace.ContinuousAffineEquiv
open Set
variable {F : Type*} [AddCommGroup F] [Module β F] [TopologicalSpace F]
def AmpleSet (s : Set F) : Prop :=
β x β s, convexHull β (connectedComponentIn s x) = univ
@[simp]
| Mathlib/Analysis/Convex/AmpleSet.lean | 53 | 56 | theorem ampleSet_univ {F : Type*} [NormedAddCommGroup F] [NormedSpace β F] :
AmpleSet (univ : Set F) := by |
intro x _
rw [connectedComponentIn_univ, PreconnectedSpace.connectedComponent_eq_univ, convexHull_univ]
| 2 | 7.389056 | 1 | 1.2 | 5 | 1,254 |
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.NormedSpace.Connected
import Mathlib.LinearAlgebra.AffineSpace.ContinuousAffineEquiv
open Set
variable {F : Type*} [AddCommGroup F] [Module β F] [TopologicalSpace F]
def AmpleSet (s : Set F) : Prop :=
β x β s, convexHull β (connectedComponentIn s x) = univ
@[simp]
theorem ampleSet_univ {F : Type*} [NormedAddCommGroup F] [NormedSpace β F] :
AmpleSet (univ : Set F) := by
intro x _
rw [connectedComponentIn_univ, PreconnectedSpace.connectedComponent_eq_univ, convexHull_univ]
@[simp]
theorem ampleSet_empty : AmpleSet (β
: Set F) := fun _ β¦ False.elim
namespace AmpleSet
| Mathlib/Analysis/Convex/AmpleSet.lean | 65 | 74 | theorem union {s t : Set F} (hs : AmpleSet s) (ht : AmpleSet t) : AmpleSet (s βͺ t) := by |
intro x hx
rcases hx with (h | h) <;>
-- The connected component of `x β s` in `s βͺ t` contains the connected component of `x` in `s`,
-- hence is also full; similarly for `t`.
[have hx := hs x h; have hx := ht x h] <;>
rw [β Set.univ_subset_iff, β hx] <;>
apply convexHull_mono <;>
apply connectedComponentIn_mono <;>
[apply subset_union_left; apply subset_union_right]
| 9 | 8,103.083928 | 2 | 1.2 | 5 | 1,254 |
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.NormedSpace.Connected
import Mathlib.LinearAlgebra.AffineSpace.ContinuousAffineEquiv
open Set
variable {F : Type*} [AddCommGroup F] [Module β F] [TopologicalSpace F]
def AmpleSet (s : Set F) : Prop :=
β x β s, convexHull β (connectedComponentIn s x) = univ
@[simp]
theorem ampleSet_univ {F : Type*} [NormedAddCommGroup F] [NormedSpace β F] :
AmpleSet (univ : Set F) := by
intro x _
rw [connectedComponentIn_univ, PreconnectedSpace.connectedComponent_eq_univ, convexHull_univ]
@[simp]
theorem ampleSet_empty : AmpleSet (β
: Set F) := fun _ β¦ False.elim
namespace AmpleSet
theorem union {s t : Set F} (hs : AmpleSet s) (ht : AmpleSet t) : AmpleSet (s βͺ t) := by
intro x hx
rcases hx with (h | h) <;>
-- The connected component of `x β s` in `s βͺ t` contains the connected component of `x` in `s`,
-- hence is also full; similarly for `t`.
[have hx := hs x h; have hx := ht x h] <;>
rw [β Set.univ_subset_iff, β hx] <;>
apply convexHull_mono <;>
apply connectedComponentIn_mono <;>
[apply subset_union_left; apply subset_union_right]
variable {E : Type*} [AddCommGroup E] [Module β E] [TopologicalSpace E]
| Mathlib/Analysis/Convex/AmpleSet.lean | 79 | 86 | theorem image {s : Set E} (h : AmpleSet s) (L : E βα΅L[β] F) :
AmpleSet (L '' s) := forall_mem_image.mpr fun x hx β¦
calc (convexHull β) (connectedComponentIn (L '' s) (L x))
_ = (convexHull β) (L '' (connectedComponentIn s x)) :=
.symm <| congrArg _ <| L.toHomeomorph.image_connectedComponentIn hx
_ = L '' (convexHull β (connectedComponentIn s x)) :=
.symm <| L.toAffineMap.image_convexHull _
_ = univ := by | rw [h x hx, image_univ, L.surjective.range_eq]
| 1 | 2.718282 | 0 | 1.2 | 5 | 1,254 |
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.NormedSpace.Connected
import Mathlib.LinearAlgebra.AffineSpace.ContinuousAffineEquiv
open Set
variable {F : Type*} [AddCommGroup F] [Module β F] [TopologicalSpace F]
def AmpleSet (s : Set F) : Prop :=
β x β s, convexHull β (connectedComponentIn s x) = univ
@[simp]
theorem ampleSet_univ {F : Type*} [NormedAddCommGroup F] [NormedSpace β F] :
AmpleSet (univ : Set F) := by
intro x _
rw [connectedComponentIn_univ, PreconnectedSpace.connectedComponent_eq_univ, convexHull_univ]
@[simp]
theorem ampleSet_empty : AmpleSet (β
: Set F) := fun _ β¦ False.elim
namespace AmpleSet
theorem union {s t : Set F} (hs : AmpleSet s) (ht : AmpleSet t) : AmpleSet (s βͺ t) := by
intro x hx
rcases hx with (h | h) <;>
-- The connected component of `x β s` in `s βͺ t` contains the connected component of `x` in `s`,
-- hence is also full; similarly for `t`.
[have hx := hs x h; have hx := ht x h] <;>
rw [β Set.univ_subset_iff, β hx] <;>
apply convexHull_mono <;>
apply connectedComponentIn_mono <;>
[apply subset_union_left; apply subset_union_right]
variable {E : Type*} [AddCommGroup E] [Module β E] [TopologicalSpace E]
theorem image {s : Set E} (h : AmpleSet s) (L : E βα΅L[β] F) :
AmpleSet (L '' s) := forall_mem_image.mpr fun x hx β¦
calc (convexHull β) (connectedComponentIn (L '' s) (L x))
_ = (convexHull β) (L '' (connectedComponentIn s x)) :=
.symm <| congrArg _ <| L.toHomeomorph.image_connectedComponentIn hx
_ = L '' (convexHull β (connectedComponentIn s x)) :=
.symm <| L.toAffineMap.image_convexHull _
_ = univ := by rw [h x hx, image_univ, L.surjective.range_eq]
theorem image_iff {s : Set E} (L : E βα΅L[β] F) :
AmpleSet (L '' s) β AmpleSet s :=
β¨fun h β¦ (L.symm_image_image s) βΈ h.image L.symm, fun h β¦ h.image Lβ©
| Mathlib/Analysis/Convex/AmpleSet.lean | 94 | 96 | theorem preimage {s : Set F} (h : AmpleSet s) (L : E βα΅L[β] F) : AmpleSet (L β»ΒΉ' s) := by |
rw [β L.image_symm_eq_preimage]
exact h.image L.symm
| 2 | 7.389056 | 1 | 1.2 | 5 | 1,254 |
import Mathlib.Analysis.Convex.Normed
import Mathlib.Analysis.NormedSpace.Connected
import Mathlib.LinearAlgebra.AffineSpace.ContinuousAffineEquiv
open Set
variable {F : Type*} [AddCommGroup F] [Module β F] [TopologicalSpace F]
def AmpleSet (s : Set F) : Prop :=
β x β s, convexHull β (connectedComponentIn s x) = univ
@[simp]
theorem ampleSet_univ {F : Type*} [NormedAddCommGroup F] [NormedSpace β F] :
AmpleSet (univ : Set F) := by
intro x _
rw [connectedComponentIn_univ, PreconnectedSpace.connectedComponent_eq_univ, convexHull_univ]
@[simp]
theorem ampleSet_empty : AmpleSet (β
: Set F) := fun _ β¦ False.elim
namespace AmpleSet
theorem union {s t : Set F} (hs : AmpleSet s) (ht : AmpleSet t) : AmpleSet (s βͺ t) := by
intro x hx
rcases hx with (h | h) <;>
-- The connected component of `x β s` in `s βͺ t` contains the connected component of `x` in `s`,
-- hence is also full; similarly for `t`.
[have hx := hs x h; have hx := ht x h] <;>
rw [β Set.univ_subset_iff, β hx] <;>
apply convexHull_mono <;>
apply connectedComponentIn_mono <;>
[apply subset_union_left; apply subset_union_right]
variable {E : Type*} [AddCommGroup E] [Module β E] [TopologicalSpace E]
theorem image {s : Set E} (h : AmpleSet s) (L : E βα΅L[β] F) :
AmpleSet (L '' s) := forall_mem_image.mpr fun x hx β¦
calc (convexHull β) (connectedComponentIn (L '' s) (L x))
_ = (convexHull β) (L '' (connectedComponentIn s x)) :=
.symm <| congrArg _ <| L.toHomeomorph.image_connectedComponentIn hx
_ = L '' (convexHull β (connectedComponentIn s x)) :=
.symm <| L.toAffineMap.image_convexHull _
_ = univ := by rw [h x hx, image_univ, L.surjective.range_eq]
theorem image_iff {s : Set E} (L : E βα΅L[β] F) :
AmpleSet (L '' s) β AmpleSet s :=
β¨fun h β¦ (L.symm_image_image s) βΈ h.image L.symm, fun h β¦ h.image Lβ©
theorem preimage {s : Set F} (h : AmpleSet s) (L : E βα΅L[β] F) : AmpleSet (L β»ΒΉ' s) := by
rw [β L.image_symm_eq_preimage]
exact h.image L.symm
theorem preimage_iff {s : Set F} (L : E βα΅L[β] F) :
AmpleSet (L β»ΒΉ' s) β AmpleSet s :=
β¨fun h β¦ L.image_preimage s βΈ h.image L, fun h β¦ h.preimage Lβ©
open scoped Pointwise
theorem vadd [ContinuousAdd E] {s : Set E} (h : AmpleSet s) {y : E} :
AmpleSet (y +α΅₯ s) :=
h.image (ContinuousAffineEquiv.constVAdd β E y)
theorem vadd_iff [ContinuousAdd E] {s : Set E} {y : E} :
AmpleSet (y +α΅₯ s) β AmpleSet s :=
AmpleSet.image_iff (ContinuousAffineEquiv.constVAdd β E y)
section Codimension
| Mathlib/Analysis/Convex/AmpleSet.lean | 120 | 132 | theorem of_one_lt_codim [TopologicalAddGroup F] [ContinuousSMul β F] {E : Submodule β F}
(hcodim : 1 < Module.rank β (F β§Έ E)) :
AmpleSet (EαΆ : Set F) := fun x hx β¦ by
rw [E.connectedComponentIn_eq_self_of_one_lt_codim hcodim hx, eq_univ_iff_forall]
intro y
by_cases h : y β E
Β· obtain β¨z, hzβ© : β z, z β E := by |
rw [β not_forall, β Submodule.eq_top_iff']
rintro rfl
simp [rank_zero_iff.2 inferInstance] at hcodim
refine segment_subset_convexHull ?_ ?_ (mem_segment_sub_add y z) <;>
simpa [sub_eq_add_neg, Submodule.add_mem_iff_right _ h]
Β· exact subset_convexHull β (EαΆ : Set F) h
| 6 | 403.428793 | 2 | 1.2 | 5 | 1,254 |
import Mathlib.Topology.Algebra.Module.WeakDual
import Mathlib.MeasureTheory.Integral.BoundedContinuousFunction
import Mathlib.MeasureTheory.Measure.HasOuterApproxClosed
#align_import measure_theory.measure.finite_measure from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
noncomputable section
open MeasureTheory
open Set
open Filter
open BoundedContinuousFunction
open scoped Topology ENNReal NNReal BoundedContinuousFunction
namespace MeasureTheory
namespace FiniteMeasure
section FiniteMeasure
variable {Ξ© : Type*} [MeasurableSpace Ξ©]
def _root_.MeasureTheory.FiniteMeasure (Ξ© : Type*) [MeasurableSpace Ξ©] : Type _ :=
{ ΞΌ : Measure Ξ© // IsFiniteMeasure ΞΌ }
#align measure_theory.finite_measure MeasureTheory.FiniteMeasure
-- Porting note: as with other subtype synonyms (e.g., `ββ₯0`, we need a new function for the
-- coercion instead of relying on `Subtype.val`.
@[coe]
def toMeasure : FiniteMeasure Ξ© β Measure Ξ© := Subtype.val
instance instCoe : Coe (FiniteMeasure Ξ©) (MeasureTheory.Measure Ξ©) where
coe := toMeasure
instance isFiniteMeasure (ΞΌ : FiniteMeasure Ξ©) : IsFiniteMeasure (ΞΌ : Measure Ξ©) :=
ΞΌ.prop
#align measure_theory.finite_measure.is_finite_measure MeasureTheory.FiniteMeasure.isFiniteMeasure
@[simp]
theorem val_eq_toMeasure (Ξ½ : FiniteMeasure Ξ©) : Ξ½.val = (Ξ½ : Measure Ξ©) :=
rfl
#align measure_theory.finite_measure.val_eq_to_measure MeasureTheory.FiniteMeasure.val_eq_toMeasure
theorem toMeasure_injective : Function.Injective ((β) : FiniteMeasure Ξ© β Measure Ξ©) :=
Subtype.coe_injective
#align measure_theory.finite_measure.coe_injective MeasureTheory.FiniteMeasure.toMeasure_injective
instance instFunLike : FunLike (FiniteMeasure Ξ©) (Set Ξ©) ββ₯0 where
coe ΞΌ s := ((ΞΌ : Measure Ξ©) s).toNNReal
coe_injective' ΞΌ Ξ½ h := toMeasure_injective $ Measure.ext fun s _ β¦ by
simpa [ENNReal.toNNReal_eq_toNNReal_iff, measure_ne_top] using congr_fun h s
lemma coeFn_def (ΞΌ : FiniteMeasure Ξ©) : ΞΌ = fun s β¦ ((ΞΌ : Measure Ξ©) s).toNNReal := rfl
#align measure_theory.finite_measure.coe_fn_eq_to_nnreal_coe_fn_to_measure MeasureTheory.FiniteMeasure.coeFn_def
lemma coeFn_mk (ΞΌ : Measure Ξ©) (hΞΌ) :
DFunLike.coe (F := FiniteMeasure Ξ©) β¨ΞΌ, hΞΌβ© = fun s β¦ (ΞΌ s).toNNReal := rfl
@[simp, norm_cast]
lemma mk_apply (ΞΌ : Measure Ξ©) (hΞΌ) (s : Set Ξ©) :
DFunLike.coe (F := FiniteMeasure Ξ©) β¨ΞΌ, hΞΌβ© s = (ΞΌ s).toNNReal := rfl
@[simp]
theorem ennreal_coeFn_eq_coeFn_toMeasure (Ξ½ : FiniteMeasure Ξ©) (s : Set Ξ©) :
(Ξ½ s : ββ₯0β) = (Ξ½ : Measure Ξ©) s :=
ENNReal.coe_toNNReal (measure_lt_top (βΞ½) s).ne
#align measure_theory.finite_measure.ennreal_coe_fn_eq_coe_fn_to_measure MeasureTheory.FiniteMeasure.ennreal_coeFn_eq_coeFn_toMeasure
| Mathlib/MeasureTheory/Measure/FiniteMeasure.lean | 168 | 171 | theorem apply_mono (ΞΌ : FiniteMeasure Ξ©) {sβ sβ : Set Ξ©} (h : sβ β sβ) : ΞΌ sβ β€ ΞΌ sβ := by |
change ((ΞΌ : Measure Ξ©) sβ).toNNReal β€ ((ΞΌ : Measure Ξ©) sβ).toNNReal
have key : (ΞΌ : Measure Ξ©) sβ β€ (ΞΌ : Measure Ξ©) sβ := (ΞΌ : Measure Ξ©).mono h
apply (ENNReal.toNNReal_le_toNNReal (measure_ne_top _ sβ) (measure_ne_top _ sβ)).mpr key
| 3 | 20.085537 | 1 | 1.2 | 5 | 1,255 |
import Mathlib.Topology.Algebra.Module.WeakDual
import Mathlib.MeasureTheory.Integral.BoundedContinuousFunction
import Mathlib.MeasureTheory.Measure.HasOuterApproxClosed
#align_import measure_theory.measure.finite_measure from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
noncomputable section
open MeasureTheory
open Set
open Filter
open BoundedContinuousFunction
open scoped Topology ENNReal NNReal BoundedContinuousFunction
namespace MeasureTheory
namespace FiniteMeasure
section FiniteMeasure
variable {Ξ© : Type*} [MeasurableSpace Ξ©]
def _root_.MeasureTheory.FiniteMeasure (Ξ© : Type*) [MeasurableSpace Ξ©] : Type _ :=
{ ΞΌ : Measure Ξ© // IsFiniteMeasure ΞΌ }
#align measure_theory.finite_measure MeasureTheory.FiniteMeasure
-- Porting note: as with other subtype synonyms (e.g., `ββ₯0`, we need a new function for the
-- coercion instead of relying on `Subtype.val`.
@[coe]
def toMeasure : FiniteMeasure Ξ© β Measure Ξ© := Subtype.val
instance instCoe : Coe (FiniteMeasure Ξ©) (MeasureTheory.Measure Ξ©) where
coe := toMeasure
instance isFiniteMeasure (ΞΌ : FiniteMeasure Ξ©) : IsFiniteMeasure (ΞΌ : Measure Ξ©) :=
ΞΌ.prop
#align measure_theory.finite_measure.is_finite_measure MeasureTheory.FiniteMeasure.isFiniteMeasure
@[simp]
theorem val_eq_toMeasure (Ξ½ : FiniteMeasure Ξ©) : Ξ½.val = (Ξ½ : Measure Ξ©) :=
rfl
#align measure_theory.finite_measure.val_eq_to_measure MeasureTheory.FiniteMeasure.val_eq_toMeasure
theorem toMeasure_injective : Function.Injective ((β) : FiniteMeasure Ξ© β Measure Ξ©) :=
Subtype.coe_injective
#align measure_theory.finite_measure.coe_injective MeasureTheory.FiniteMeasure.toMeasure_injective
instance instFunLike : FunLike (FiniteMeasure Ξ©) (Set Ξ©) ββ₯0 where
coe ΞΌ s := ((ΞΌ : Measure Ξ©) s).toNNReal
coe_injective' ΞΌ Ξ½ h := toMeasure_injective $ Measure.ext fun s _ β¦ by
simpa [ENNReal.toNNReal_eq_toNNReal_iff, measure_ne_top] using congr_fun h s
lemma coeFn_def (ΞΌ : FiniteMeasure Ξ©) : ΞΌ = fun s β¦ ((ΞΌ : Measure Ξ©) s).toNNReal := rfl
#align measure_theory.finite_measure.coe_fn_eq_to_nnreal_coe_fn_to_measure MeasureTheory.FiniteMeasure.coeFn_def
lemma coeFn_mk (ΞΌ : Measure Ξ©) (hΞΌ) :
DFunLike.coe (F := FiniteMeasure Ξ©) β¨ΞΌ, hΞΌβ© = fun s β¦ (ΞΌ s).toNNReal := rfl
@[simp, norm_cast]
lemma mk_apply (ΞΌ : Measure Ξ©) (hΞΌ) (s : Set Ξ©) :
DFunLike.coe (F := FiniteMeasure Ξ©) β¨ΞΌ, hΞΌβ© s = (ΞΌ s).toNNReal := rfl
@[simp]
theorem ennreal_coeFn_eq_coeFn_toMeasure (Ξ½ : FiniteMeasure Ξ©) (s : Set Ξ©) :
(Ξ½ s : ββ₯0β) = (Ξ½ : Measure Ξ©) s :=
ENNReal.coe_toNNReal (measure_lt_top (βΞ½) s).ne
#align measure_theory.finite_measure.ennreal_coe_fn_eq_coe_fn_to_measure MeasureTheory.FiniteMeasure.ennreal_coeFn_eq_coeFn_toMeasure
theorem apply_mono (ΞΌ : FiniteMeasure Ξ©) {sβ sβ : Set Ξ©} (h : sβ β sβ) : ΞΌ sβ β€ ΞΌ sβ := by
change ((ΞΌ : Measure Ξ©) sβ).toNNReal β€ ((ΞΌ : Measure Ξ©) sβ).toNNReal
have key : (ΞΌ : Measure Ξ©) sβ β€ (ΞΌ : Measure Ξ©) sβ := (ΞΌ : Measure Ξ©).mono h
apply (ENNReal.toNNReal_le_toNNReal (measure_ne_top _ sβ) (measure_ne_top _ sβ)).mpr key
#align measure_theory.finite_measure.apply_mono MeasureTheory.FiniteMeasure.apply_mono
def mass (ΞΌ : FiniteMeasure Ξ©) : ββ₯0 :=
ΞΌ univ
#align measure_theory.finite_measure.mass MeasureTheory.FiniteMeasure.mass
@[simp] theorem apply_le_mass (ΞΌ : FiniteMeasure Ξ©) (s : Set Ξ©) : ΞΌ s β€ ΞΌ.mass := by
simpa using apply_mono ΞΌ (subset_univ s)
@[simp]
theorem ennreal_mass {ΞΌ : FiniteMeasure Ξ©} : (ΞΌ.mass : ββ₯0β) = (ΞΌ : Measure Ξ©) univ :=
ennreal_coeFn_eq_coeFn_toMeasure ΞΌ Set.univ
#align measure_theory.finite_measure.ennreal_mass MeasureTheory.FiniteMeasure.ennreal_mass
instance instZero : Zero (FiniteMeasure Ξ©) where zero := β¨0, MeasureTheory.isFiniteMeasureZeroβ©
#align measure_theory.finite_measure.has_zero MeasureTheory.FiniteMeasure.instZero
@[simp, norm_cast] lemma coeFn_zero : β(0 : FiniteMeasure Ξ©) = 0 := rfl
#align measure_theory.finite_measure.coe_fn_zero MeasureTheory.FiniteMeasure.coeFn_zero
@[simp]
theorem zero_mass : (0 : FiniteMeasure Ξ©).mass = 0 :=
rfl
#align measure_theory.finite_measure.zero.mass MeasureTheory.FiniteMeasure.zero_mass
@[simp]
| Mathlib/MeasureTheory/Measure/FiniteMeasure.lean | 200 | 204 | theorem mass_zero_iff (ΞΌ : FiniteMeasure Ξ©) : ΞΌ.mass = 0 β ΞΌ = 0 := by |
refine β¨fun ΞΌ_mass => ?_, fun hΞΌ => by simp only [hΞΌ, zero_mass]β©
apply toMeasure_injective
apply Measure.measure_univ_eq_zero.mp
rwa [β ennreal_mass, ENNReal.coe_eq_zero]
| 4 | 54.59815 | 2 | 1.2 | 5 | 1,255 |
import Mathlib.Topology.Algebra.Module.WeakDual
import Mathlib.MeasureTheory.Integral.BoundedContinuousFunction
import Mathlib.MeasureTheory.Measure.HasOuterApproxClosed
#align_import measure_theory.measure.finite_measure from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
noncomputable section
open MeasureTheory
open Set
open Filter
open BoundedContinuousFunction
open scoped Topology ENNReal NNReal BoundedContinuousFunction
namespace MeasureTheory
namespace FiniteMeasure
section FiniteMeasure
variable {Ξ© : Type*} [MeasurableSpace Ξ©]
def _root_.MeasureTheory.FiniteMeasure (Ξ© : Type*) [MeasurableSpace Ξ©] : Type _ :=
{ ΞΌ : Measure Ξ© // IsFiniteMeasure ΞΌ }
#align measure_theory.finite_measure MeasureTheory.FiniteMeasure
-- Porting note: as with other subtype synonyms (e.g., `ββ₯0`, we need a new function for the
-- coercion instead of relying on `Subtype.val`.
@[coe]
def toMeasure : FiniteMeasure Ξ© β Measure Ξ© := Subtype.val
instance instCoe : Coe (FiniteMeasure Ξ©) (MeasureTheory.Measure Ξ©) where
coe := toMeasure
instance isFiniteMeasure (ΞΌ : FiniteMeasure Ξ©) : IsFiniteMeasure (ΞΌ : Measure Ξ©) :=
ΞΌ.prop
#align measure_theory.finite_measure.is_finite_measure MeasureTheory.FiniteMeasure.isFiniteMeasure
@[simp]
theorem val_eq_toMeasure (Ξ½ : FiniteMeasure Ξ©) : Ξ½.val = (Ξ½ : Measure Ξ©) :=
rfl
#align measure_theory.finite_measure.val_eq_to_measure MeasureTheory.FiniteMeasure.val_eq_toMeasure
theorem toMeasure_injective : Function.Injective ((β) : FiniteMeasure Ξ© β Measure Ξ©) :=
Subtype.coe_injective
#align measure_theory.finite_measure.coe_injective MeasureTheory.FiniteMeasure.toMeasure_injective
instance instFunLike : FunLike (FiniteMeasure Ξ©) (Set Ξ©) ββ₯0 where
coe ΞΌ s := ((ΞΌ : Measure Ξ©) s).toNNReal
coe_injective' ΞΌ Ξ½ h := toMeasure_injective $ Measure.ext fun s _ β¦ by
simpa [ENNReal.toNNReal_eq_toNNReal_iff, measure_ne_top] using congr_fun h s
lemma coeFn_def (ΞΌ : FiniteMeasure Ξ©) : ΞΌ = fun s β¦ ((ΞΌ : Measure Ξ©) s).toNNReal := rfl
#align measure_theory.finite_measure.coe_fn_eq_to_nnreal_coe_fn_to_measure MeasureTheory.FiniteMeasure.coeFn_def
lemma coeFn_mk (ΞΌ : Measure Ξ©) (hΞΌ) :
DFunLike.coe (F := FiniteMeasure Ξ©) β¨ΞΌ, hΞΌβ© = fun s β¦ (ΞΌ s).toNNReal := rfl
@[simp, norm_cast]
lemma mk_apply (ΞΌ : Measure Ξ©) (hΞΌ) (s : Set Ξ©) :
DFunLike.coe (F := FiniteMeasure Ξ©) β¨ΞΌ, hΞΌβ© s = (ΞΌ s).toNNReal := rfl
@[simp]
theorem ennreal_coeFn_eq_coeFn_toMeasure (Ξ½ : FiniteMeasure Ξ©) (s : Set Ξ©) :
(Ξ½ s : ββ₯0β) = (Ξ½ : Measure Ξ©) s :=
ENNReal.coe_toNNReal (measure_lt_top (βΞ½) s).ne
#align measure_theory.finite_measure.ennreal_coe_fn_eq_coe_fn_to_measure MeasureTheory.FiniteMeasure.ennreal_coeFn_eq_coeFn_toMeasure
theorem apply_mono (ΞΌ : FiniteMeasure Ξ©) {sβ sβ : Set Ξ©} (h : sβ β sβ) : ΞΌ sβ β€ ΞΌ sβ := by
change ((ΞΌ : Measure Ξ©) sβ).toNNReal β€ ((ΞΌ : Measure Ξ©) sβ).toNNReal
have key : (ΞΌ : Measure Ξ©) sβ β€ (ΞΌ : Measure Ξ©) sβ := (ΞΌ : Measure Ξ©).mono h
apply (ENNReal.toNNReal_le_toNNReal (measure_ne_top _ sβ) (measure_ne_top _ sβ)).mpr key
#align measure_theory.finite_measure.apply_mono MeasureTheory.FiniteMeasure.apply_mono
def mass (ΞΌ : FiniteMeasure Ξ©) : ββ₯0 :=
ΞΌ univ
#align measure_theory.finite_measure.mass MeasureTheory.FiniteMeasure.mass
@[simp] theorem apply_le_mass (ΞΌ : FiniteMeasure Ξ©) (s : Set Ξ©) : ΞΌ s β€ ΞΌ.mass := by
simpa using apply_mono ΞΌ (subset_univ s)
@[simp]
theorem ennreal_mass {ΞΌ : FiniteMeasure Ξ©} : (ΞΌ.mass : ββ₯0β) = (ΞΌ : Measure Ξ©) univ :=
ennreal_coeFn_eq_coeFn_toMeasure ΞΌ Set.univ
#align measure_theory.finite_measure.ennreal_mass MeasureTheory.FiniteMeasure.ennreal_mass
instance instZero : Zero (FiniteMeasure Ξ©) where zero := β¨0, MeasureTheory.isFiniteMeasureZeroβ©
#align measure_theory.finite_measure.has_zero MeasureTheory.FiniteMeasure.instZero
@[simp, norm_cast] lemma coeFn_zero : β(0 : FiniteMeasure Ξ©) = 0 := rfl
#align measure_theory.finite_measure.coe_fn_zero MeasureTheory.FiniteMeasure.coeFn_zero
@[simp]
theorem zero_mass : (0 : FiniteMeasure Ξ©).mass = 0 :=
rfl
#align measure_theory.finite_measure.zero.mass MeasureTheory.FiniteMeasure.zero_mass
@[simp]
theorem mass_zero_iff (ΞΌ : FiniteMeasure Ξ©) : ΞΌ.mass = 0 β ΞΌ = 0 := by
refine β¨fun ΞΌ_mass => ?_, fun hΞΌ => by simp only [hΞΌ, zero_mass]β©
apply toMeasure_injective
apply Measure.measure_univ_eq_zero.mp
rwa [β ennreal_mass, ENNReal.coe_eq_zero]
#align measure_theory.finite_measure.mass_zero_iff MeasureTheory.FiniteMeasure.mass_zero_iff
| Mathlib/MeasureTheory/Measure/FiniteMeasure.lean | 207 | 209 | theorem mass_nonzero_iff (ΞΌ : FiniteMeasure Ξ©) : ΞΌ.mass β 0 β ΞΌ β 0 := by |
rw [not_iff_not]
exact FiniteMeasure.mass_zero_iff ΞΌ
| 2 | 7.389056 | 1 | 1.2 | 5 | 1,255 |
import Mathlib.Topology.Algebra.Module.WeakDual
import Mathlib.MeasureTheory.Integral.BoundedContinuousFunction
import Mathlib.MeasureTheory.Measure.HasOuterApproxClosed
#align_import measure_theory.measure.finite_measure from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
noncomputable section
open MeasureTheory
open Set
open Filter
open BoundedContinuousFunction
open scoped Topology ENNReal NNReal BoundedContinuousFunction
namespace MeasureTheory
namespace FiniteMeasure
section FiniteMeasure
variable {Ξ© : Type*} [MeasurableSpace Ξ©]
def _root_.MeasureTheory.FiniteMeasure (Ξ© : Type*) [MeasurableSpace Ξ©] : Type _ :=
{ ΞΌ : Measure Ξ© // IsFiniteMeasure ΞΌ }
#align measure_theory.finite_measure MeasureTheory.FiniteMeasure
-- Porting note: as with other subtype synonyms (e.g., `ββ₯0`, we need a new function for the
-- coercion instead of relying on `Subtype.val`.
@[coe]
def toMeasure : FiniteMeasure Ξ© β Measure Ξ© := Subtype.val
instance instCoe : Coe (FiniteMeasure Ξ©) (MeasureTheory.Measure Ξ©) where
coe := toMeasure
instance isFiniteMeasure (ΞΌ : FiniteMeasure Ξ©) : IsFiniteMeasure (ΞΌ : Measure Ξ©) :=
ΞΌ.prop
#align measure_theory.finite_measure.is_finite_measure MeasureTheory.FiniteMeasure.isFiniteMeasure
@[simp]
theorem val_eq_toMeasure (Ξ½ : FiniteMeasure Ξ©) : Ξ½.val = (Ξ½ : Measure Ξ©) :=
rfl
#align measure_theory.finite_measure.val_eq_to_measure MeasureTheory.FiniteMeasure.val_eq_toMeasure
theorem toMeasure_injective : Function.Injective ((β) : FiniteMeasure Ξ© β Measure Ξ©) :=
Subtype.coe_injective
#align measure_theory.finite_measure.coe_injective MeasureTheory.FiniteMeasure.toMeasure_injective
instance instFunLike : FunLike (FiniteMeasure Ξ©) (Set Ξ©) ββ₯0 where
coe ΞΌ s := ((ΞΌ : Measure Ξ©) s).toNNReal
coe_injective' ΞΌ Ξ½ h := toMeasure_injective $ Measure.ext fun s _ β¦ by
simpa [ENNReal.toNNReal_eq_toNNReal_iff, measure_ne_top] using congr_fun h s
lemma coeFn_def (ΞΌ : FiniteMeasure Ξ©) : ΞΌ = fun s β¦ ((ΞΌ : Measure Ξ©) s).toNNReal := rfl
#align measure_theory.finite_measure.coe_fn_eq_to_nnreal_coe_fn_to_measure MeasureTheory.FiniteMeasure.coeFn_def
lemma coeFn_mk (ΞΌ : Measure Ξ©) (hΞΌ) :
DFunLike.coe (F := FiniteMeasure Ξ©) β¨ΞΌ, hΞΌβ© = fun s β¦ (ΞΌ s).toNNReal := rfl
@[simp, norm_cast]
lemma mk_apply (ΞΌ : Measure Ξ©) (hΞΌ) (s : Set Ξ©) :
DFunLike.coe (F := FiniteMeasure Ξ©) β¨ΞΌ, hΞΌβ© s = (ΞΌ s).toNNReal := rfl
@[simp]
theorem ennreal_coeFn_eq_coeFn_toMeasure (Ξ½ : FiniteMeasure Ξ©) (s : Set Ξ©) :
(Ξ½ s : ββ₯0β) = (Ξ½ : Measure Ξ©) s :=
ENNReal.coe_toNNReal (measure_lt_top (βΞ½) s).ne
#align measure_theory.finite_measure.ennreal_coe_fn_eq_coe_fn_to_measure MeasureTheory.FiniteMeasure.ennreal_coeFn_eq_coeFn_toMeasure
theorem apply_mono (ΞΌ : FiniteMeasure Ξ©) {sβ sβ : Set Ξ©} (h : sβ β sβ) : ΞΌ sβ β€ ΞΌ sβ := by
change ((ΞΌ : Measure Ξ©) sβ).toNNReal β€ ((ΞΌ : Measure Ξ©) sβ).toNNReal
have key : (ΞΌ : Measure Ξ©) sβ β€ (ΞΌ : Measure Ξ©) sβ := (ΞΌ : Measure Ξ©).mono h
apply (ENNReal.toNNReal_le_toNNReal (measure_ne_top _ sβ) (measure_ne_top _ sβ)).mpr key
#align measure_theory.finite_measure.apply_mono MeasureTheory.FiniteMeasure.apply_mono
def mass (ΞΌ : FiniteMeasure Ξ©) : ββ₯0 :=
ΞΌ univ
#align measure_theory.finite_measure.mass MeasureTheory.FiniteMeasure.mass
@[simp] theorem apply_le_mass (ΞΌ : FiniteMeasure Ξ©) (s : Set Ξ©) : ΞΌ s β€ ΞΌ.mass := by
simpa using apply_mono ΞΌ (subset_univ s)
@[simp]
theorem ennreal_mass {ΞΌ : FiniteMeasure Ξ©} : (ΞΌ.mass : ββ₯0β) = (ΞΌ : Measure Ξ©) univ :=
ennreal_coeFn_eq_coeFn_toMeasure ΞΌ Set.univ
#align measure_theory.finite_measure.ennreal_mass MeasureTheory.FiniteMeasure.ennreal_mass
instance instZero : Zero (FiniteMeasure Ξ©) where zero := β¨0, MeasureTheory.isFiniteMeasureZeroβ©
#align measure_theory.finite_measure.has_zero MeasureTheory.FiniteMeasure.instZero
@[simp, norm_cast] lemma coeFn_zero : β(0 : FiniteMeasure Ξ©) = 0 := rfl
#align measure_theory.finite_measure.coe_fn_zero MeasureTheory.FiniteMeasure.coeFn_zero
@[simp]
theorem zero_mass : (0 : FiniteMeasure Ξ©).mass = 0 :=
rfl
#align measure_theory.finite_measure.zero.mass MeasureTheory.FiniteMeasure.zero_mass
@[simp]
theorem mass_zero_iff (ΞΌ : FiniteMeasure Ξ©) : ΞΌ.mass = 0 β ΞΌ = 0 := by
refine β¨fun ΞΌ_mass => ?_, fun hΞΌ => by simp only [hΞΌ, zero_mass]β©
apply toMeasure_injective
apply Measure.measure_univ_eq_zero.mp
rwa [β ennreal_mass, ENNReal.coe_eq_zero]
#align measure_theory.finite_measure.mass_zero_iff MeasureTheory.FiniteMeasure.mass_zero_iff
theorem mass_nonzero_iff (ΞΌ : FiniteMeasure Ξ©) : ΞΌ.mass β 0 β ΞΌ β 0 := by
rw [not_iff_not]
exact FiniteMeasure.mass_zero_iff ΞΌ
#align measure_theory.finite_measure.mass_nonzero_iff MeasureTheory.FiniteMeasure.mass_nonzero_iff
@[ext]
| Mathlib/MeasureTheory/Measure/FiniteMeasure.lean | 213 | 217 | theorem eq_of_forall_toMeasure_apply_eq (ΞΌ Ξ½ : FiniteMeasure Ξ©)
(h : β s : Set Ξ©, MeasurableSet s β (ΞΌ : Measure Ξ©) s = (Ξ½ : Measure Ξ©) s) : ΞΌ = Ξ½ := by |
apply Subtype.ext
ext1 s s_mble
exact h s s_mble
| 3 | 20.085537 | 1 | 1.2 | 5 | 1,255 |
import Mathlib.Topology.Algebra.Module.WeakDual
import Mathlib.MeasureTheory.Integral.BoundedContinuousFunction
import Mathlib.MeasureTheory.Measure.HasOuterApproxClosed
#align_import measure_theory.measure.finite_measure from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
noncomputable section
open MeasureTheory
open Set
open Filter
open BoundedContinuousFunction
open scoped Topology ENNReal NNReal BoundedContinuousFunction
namespace MeasureTheory
namespace FiniteMeasure
section FiniteMeasure
variable {Ξ© : Type*} [MeasurableSpace Ξ©]
def _root_.MeasureTheory.FiniteMeasure (Ξ© : Type*) [MeasurableSpace Ξ©] : Type _ :=
{ ΞΌ : Measure Ξ© // IsFiniteMeasure ΞΌ }
#align measure_theory.finite_measure MeasureTheory.FiniteMeasure
-- Porting note: as with other subtype synonyms (e.g., `ββ₯0`, we need a new function for the
-- coercion instead of relying on `Subtype.val`.
@[coe]
def toMeasure : FiniteMeasure Ξ© β Measure Ξ© := Subtype.val
instance instCoe : Coe (FiniteMeasure Ξ©) (MeasureTheory.Measure Ξ©) where
coe := toMeasure
instance isFiniteMeasure (ΞΌ : FiniteMeasure Ξ©) : IsFiniteMeasure (ΞΌ : Measure Ξ©) :=
ΞΌ.prop
#align measure_theory.finite_measure.is_finite_measure MeasureTheory.FiniteMeasure.isFiniteMeasure
@[simp]
theorem val_eq_toMeasure (Ξ½ : FiniteMeasure Ξ©) : Ξ½.val = (Ξ½ : Measure Ξ©) :=
rfl
#align measure_theory.finite_measure.val_eq_to_measure MeasureTheory.FiniteMeasure.val_eq_toMeasure
theorem toMeasure_injective : Function.Injective ((β) : FiniteMeasure Ξ© β Measure Ξ©) :=
Subtype.coe_injective
#align measure_theory.finite_measure.coe_injective MeasureTheory.FiniteMeasure.toMeasure_injective
instance instFunLike : FunLike (FiniteMeasure Ξ©) (Set Ξ©) ββ₯0 where
coe ΞΌ s := ((ΞΌ : Measure Ξ©) s).toNNReal
coe_injective' ΞΌ Ξ½ h := toMeasure_injective $ Measure.ext fun s _ β¦ by
simpa [ENNReal.toNNReal_eq_toNNReal_iff, measure_ne_top] using congr_fun h s
lemma coeFn_def (ΞΌ : FiniteMeasure Ξ©) : ΞΌ = fun s β¦ ((ΞΌ : Measure Ξ©) s).toNNReal := rfl
#align measure_theory.finite_measure.coe_fn_eq_to_nnreal_coe_fn_to_measure MeasureTheory.FiniteMeasure.coeFn_def
lemma coeFn_mk (ΞΌ : Measure Ξ©) (hΞΌ) :
DFunLike.coe (F := FiniteMeasure Ξ©) β¨ΞΌ, hΞΌβ© = fun s β¦ (ΞΌ s).toNNReal := rfl
@[simp, norm_cast]
lemma mk_apply (ΞΌ : Measure Ξ©) (hΞΌ) (s : Set Ξ©) :
DFunLike.coe (F := FiniteMeasure Ξ©) β¨ΞΌ, hΞΌβ© s = (ΞΌ s).toNNReal := rfl
@[simp]
theorem ennreal_coeFn_eq_coeFn_toMeasure (Ξ½ : FiniteMeasure Ξ©) (s : Set Ξ©) :
(Ξ½ s : ββ₯0β) = (Ξ½ : Measure Ξ©) s :=
ENNReal.coe_toNNReal (measure_lt_top (βΞ½) s).ne
#align measure_theory.finite_measure.ennreal_coe_fn_eq_coe_fn_to_measure MeasureTheory.FiniteMeasure.ennreal_coeFn_eq_coeFn_toMeasure
theorem apply_mono (ΞΌ : FiniteMeasure Ξ©) {sβ sβ : Set Ξ©} (h : sβ β sβ) : ΞΌ sβ β€ ΞΌ sβ := by
change ((ΞΌ : Measure Ξ©) sβ).toNNReal β€ ((ΞΌ : Measure Ξ©) sβ).toNNReal
have key : (ΞΌ : Measure Ξ©) sβ β€ (ΞΌ : Measure Ξ©) sβ := (ΞΌ : Measure Ξ©).mono h
apply (ENNReal.toNNReal_le_toNNReal (measure_ne_top _ sβ) (measure_ne_top _ sβ)).mpr key
#align measure_theory.finite_measure.apply_mono MeasureTheory.FiniteMeasure.apply_mono
def mass (ΞΌ : FiniteMeasure Ξ©) : ββ₯0 :=
ΞΌ univ
#align measure_theory.finite_measure.mass MeasureTheory.FiniteMeasure.mass
@[simp] theorem apply_le_mass (ΞΌ : FiniteMeasure Ξ©) (s : Set Ξ©) : ΞΌ s β€ ΞΌ.mass := by
simpa using apply_mono ΞΌ (subset_univ s)
@[simp]
theorem ennreal_mass {ΞΌ : FiniteMeasure Ξ©} : (ΞΌ.mass : ββ₯0β) = (ΞΌ : Measure Ξ©) univ :=
ennreal_coeFn_eq_coeFn_toMeasure ΞΌ Set.univ
#align measure_theory.finite_measure.ennreal_mass MeasureTheory.FiniteMeasure.ennreal_mass
instance instZero : Zero (FiniteMeasure Ξ©) where zero := β¨0, MeasureTheory.isFiniteMeasureZeroβ©
#align measure_theory.finite_measure.has_zero MeasureTheory.FiniteMeasure.instZero
@[simp, norm_cast] lemma coeFn_zero : β(0 : FiniteMeasure Ξ©) = 0 := rfl
#align measure_theory.finite_measure.coe_fn_zero MeasureTheory.FiniteMeasure.coeFn_zero
@[simp]
theorem zero_mass : (0 : FiniteMeasure Ξ©).mass = 0 :=
rfl
#align measure_theory.finite_measure.zero.mass MeasureTheory.FiniteMeasure.zero_mass
@[simp]
theorem mass_zero_iff (ΞΌ : FiniteMeasure Ξ©) : ΞΌ.mass = 0 β ΞΌ = 0 := by
refine β¨fun ΞΌ_mass => ?_, fun hΞΌ => by simp only [hΞΌ, zero_mass]β©
apply toMeasure_injective
apply Measure.measure_univ_eq_zero.mp
rwa [β ennreal_mass, ENNReal.coe_eq_zero]
#align measure_theory.finite_measure.mass_zero_iff MeasureTheory.FiniteMeasure.mass_zero_iff
theorem mass_nonzero_iff (ΞΌ : FiniteMeasure Ξ©) : ΞΌ.mass β 0 β ΞΌ β 0 := by
rw [not_iff_not]
exact FiniteMeasure.mass_zero_iff ΞΌ
#align measure_theory.finite_measure.mass_nonzero_iff MeasureTheory.FiniteMeasure.mass_nonzero_iff
@[ext]
theorem eq_of_forall_toMeasure_apply_eq (ΞΌ Ξ½ : FiniteMeasure Ξ©)
(h : β s : Set Ξ©, MeasurableSet s β (ΞΌ : Measure Ξ©) s = (Ξ½ : Measure Ξ©) s) : ΞΌ = Ξ½ := by
apply Subtype.ext
ext1 s s_mble
exact h s s_mble
#align measure_theory.finite_measure.eq_of_forall_measure_apply_eq MeasureTheory.FiniteMeasure.eq_of_forall_toMeasure_apply_eq
| Mathlib/MeasureTheory/Measure/FiniteMeasure.lean | 220 | 223 | theorem eq_of_forall_apply_eq (ΞΌ Ξ½ : FiniteMeasure Ξ©)
(h : β s : Set Ξ©, MeasurableSet s β ΞΌ s = Ξ½ s) : ΞΌ = Ξ½ := by |
ext1 s s_mble
simpa [ennreal_coeFn_eq_coeFn_toMeasure] using congr_arg ((β) : ββ₯0 β ββ₯0β) (h s s_mble)
| 2 | 7.389056 | 1 | 1.2 | 5 | 1,255 |
import Mathlib.LinearAlgebra.Finsupp
import Mathlib.Algebra.MonoidAlgebra.Support
import Mathlib.Algebra.DirectSum.Internal
import Mathlib.RingTheory.GradedAlgebra.Basic
#align_import algebra.monoid_algebra.grading from "leanprover-community/mathlib"@"feb99064803fd3108e37c18b0f77d0a8344677a3"
noncomputable section
namespace AddMonoidAlgebra
variable {M : Type*} {ΞΉ : Type*} {R : Type*}
section
variable (R) [CommSemiring R]
abbrev gradeBy (f : M β ΞΉ) (i : ΞΉ) : Submodule R R[M] where
carrier := { a | β m, m β a.support β f m = i }
zero_mem' m h := by cases h
add_mem' {a b} ha hb m h := by
classical exact (Finset.mem_union.mp (Finsupp.support_add h)).elim (ha m) (hb m)
smul_mem' a m h := Set.Subset.trans Finsupp.support_smul h
#align add_monoid_algebra.grade_by AddMonoidAlgebra.gradeBy
abbrev grade (m : M) : Submodule R R[M] :=
gradeBy R id m
#align add_monoid_algebra.grade AddMonoidAlgebra.grade
theorem gradeBy_id : gradeBy R (id : M β M) = grade R := rfl
#align add_monoid_algebra.grade_by_id AddMonoidAlgebra.gradeBy_id
| Mathlib/Algebra/MonoidAlgebra/Grading.lean | 63 | 64 | theorem mem_gradeBy_iff (f : M β ΞΉ) (i : ΞΉ) (a : R[M]) :
a β gradeBy R f i β (a.support : Set M) β f β»ΒΉ' {i} := by | rfl
| 1 | 2.718282 | 0 | 1.2 | 5 | 1,256 |
import Mathlib.LinearAlgebra.Finsupp
import Mathlib.Algebra.MonoidAlgebra.Support
import Mathlib.Algebra.DirectSum.Internal
import Mathlib.RingTheory.GradedAlgebra.Basic
#align_import algebra.monoid_algebra.grading from "leanprover-community/mathlib"@"feb99064803fd3108e37c18b0f77d0a8344677a3"
noncomputable section
namespace AddMonoidAlgebra
variable {M : Type*} {ΞΉ : Type*} {R : Type*}
section
variable (R) [CommSemiring R]
abbrev gradeBy (f : M β ΞΉ) (i : ΞΉ) : Submodule R R[M] where
carrier := { a | β m, m β a.support β f m = i }
zero_mem' m h := by cases h
add_mem' {a b} ha hb m h := by
classical exact (Finset.mem_union.mp (Finsupp.support_add h)).elim (ha m) (hb m)
smul_mem' a m h := Set.Subset.trans Finsupp.support_smul h
#align add_monoid_algebra.grade_by AddMonoidAlgebra.gradeBy
abbrev grade (m : M) : Submodule R R[M] :=
gradeBy R id m
#align add_monoid_algebra.grade AddMonoidAlgebra.grade
theorem gradeBy_id : gradeBy R (id : M β M) = grade R := rfl
#align add_monoid_algebra.grade_by_id AddMonoidAlgebra.gradeBy_id
theorem mem_gradeBy_iff (f : M β ΞΉ) (i : ΞΉ) (a : R[M]) :
a β gradeBy R f i β (a.support : Set M) β f β»ΒΉ' {i} := by rfl
#align add_monoid_algebra.mem_grade_by_iff AddMonoidAlgebra.mem_gradeBy_iff
| Mathlib/Algebra/MonoidAlgebra/Grading.lean | 67 | 69 | theorem mem_grade_iff (m : M) (a : R[M]) : a β grade R m β a.support β {m} := by |
rw [β Finset.coe_subset, Finset.coe_singleton]
rfl
| 2 | 7.389056 | 1 | 1.2 | 5 | 1,256 |
import Mathlib.LinearAlgebra.Finsupp
import Mathlib.Algebra.MonoidAlgebra.Support
import Mathlib.Algebra.DirectSum.Internal
import Mathlib.RingTheory.GradedAlgebra.Basic
#align_import algebra.monoid_algebra.grading from "leanprover-community/mathlib"@"feb99064803fd3108e37c18b0f77d0a8344677a3"
noncomputable section
namespace AddMonoidAlgebra
variable {M : Type*} {ΞΉ : Type*} {R : Type*}
section
variable (R) [CommSemiring R]
abbrev gradeBy (f : M β ΞΉ) (i : ΞΉ) : Submodule R R[M] where
carrier := { a | β m, m β a.support β f m = i }
zero_mem' m h := by cases h
add_mem' {a b} ha hb m h := by
classical exact (Finset.mem_union.mp (Finsupp.support_add h)).elim (ha m) (hb m)
smul_mem' a m h := Set.Subset.trans Finsupp.support_smul h
#align add_monoid_algebra.grade_by AddMonoidAlgebra.gradeBy
abbrev grade (m : M) : Submodule R R[M] :=
gradeBy R id m
#align add_monoid_algebra.grade AddMonoidAlgebra.grade
theorem gradeBy_id : gradeBy R (id : M β M) = grade R := rfl
#align add_monoid_algebra.grade_by_id AddMonoidAlgebra.gradeBy_id
theorem mem_gradeBy_iff (f : M β ΞΉ) (i : ΞΉ) (a : R[M]) :
a β gradeBy R f i β (a.support : Set M) β f β»ΒΉ' {i} := by rfl
#align add_monoid_algebra.mem_grade_by_iff AddMonoidAlgebra.mem_gradeBy_iff
theorem mem_grade_iff (m : M) (a : R[M]) : a β grade R m β a.support β {m} := by
rw [β Finset.coe_subset, Finset.coe_singleton]
rfl
#align add_monoid_algebra.mem_grade_iff AddMonoidAlgebra.mem_grade_iff
| Mathlib/Algebra/MonoidAlgebra/Grading.lean | 72 | 78 | theorem mem_grade_iff' (m : M) (a : R[M]) :
a β grade R m β a β (LinearMap.range (Finsupp.lsingle m : R ββ[R] M ββ R) :
Submodule R R[M]) := by |
rw [mem_grade_iff, Finsupp.support_subset_singleton']
apply exists_congr
intro r
constructor <;> exact Eq.symm
| 4 | 54.59815 | 2 | 1.2 | 5 | 1,256 |
import Mathlib.LinearAlgebra.Finsupp
import Mathlib.Algebra.MonoidAlgebra.Support
import Mathlib.Algebra.DirectSum.Internal
import Mathlib.RingTheory.GradedAlgebra.Basic
#align_import algebra.monoid_algebra.grading from "leanprover-community/mathlib"@"feb99064803fd3108e37c18b0f77d0a8344677a3"
noncomputable section
namespace AddMonoidAlgebra
variable {M : Type*} {ΞΉ : Type*} {R : Type*}
section
variable (R) [CommSemiring R]
abbrev gradeBy (f : M β ΞΉ) (i : ΞΉ) : Submodule R R[M] where
carrier := { a | β m, m β a.support β f m = i }
zero_mem' m h := by cases h
add_mem' {a b} ha hb m h := by
classical exact (Finset.mem_union.mp (Finsupp.support_add h)).elim (ha m) (hb m)
smul_mem' a m h := Set.Subset.trans Finsupp.support_smul h
#align add_monoid_algebra.grade_by AddMonoidAlgebra.gradeBy
abbrev grade (m : M) : Submodule R R[M] :=
gradeBy R id m
#align add_monoid_algebra.grade AddMonoidAlgebra.grade
theorem gradeBy_id : gradeBy R (id : M β M) = grade R := rfl
#align add_monoid_algebra.grade_by_id AddMonoidAlgebra.gradeBy_id
theorem mem_gradeBy_iff (f : M β ΞΉ) (i : ΞΉ) (a : R[M]) :
a β gradeBy R f i β (a.support : Set M) β f β»ΒΉ' {i} := by rfl
#align add_monoid_algebra.mem_grade_by_iff AddMonoidAlgebra.mem_gradeBy_iff
theorem mem_grade_iff (m : M) (a : R[M]) : a β grade R m β a.support β {m} := by
rw [β Finset.coe_subset, Finset.coe_singleton]
rfl
#align add_monoid_algebra.mem_grade_iff AddMonoidAlgebra.mem_grade_iff
theorem mem_grade_iff' (m : M) (a : R[M]) :
a β grade R m β a β (LinearMap.range (Finsupp.lsingle m : R ββ[R] M ββ R) :
Submodule R R[M]) := by
rw [mem_grade_iff, Finsupp.support_subset_singleton']
apply exists_congr
intro r
constructor <;> exact Eq.symm
#align add_monoid_algebra.mem_grade_iff' AddMonoidAlgebra.mem_grade_iff'
theorem grade_eq_lsingle_range (m : M) :
grade R m = LinearMap.range (Finsupp.lsingle m : R ββ[R] M ββ R) :=
Submodule.ext (mem_grade_iff' R m)
#align add_monoid_algebra.grade_eq_lsingle_range AddMonoidAlgebra.grade_eq_lsingle_range
| Mathlib/Algebra/MonoidAlgebra/Grading.lean | 86 | 89 | theorem single_mem_gradeBy {R} [CommSemiring R] (f : M β ΞΉ) (m : M) (r : R) :
Finsupp.single m r β gradeBy R f (f m) := by |
intro x hx
rw [Finset.mem_singleton.mp (Finsupp.support_single_subset hx)]
| 2 | 7.389056 | 1 | 1.2 | 5 | 1,256 |
import Mathlib.LinearAlgebra.Finsupp
import Mathlib.Algebra.MonoidAlgebra.Support
import Mathlib.Algebra.DirectSum.Internal
import Mathlib.RingTheory.GradedAlgebra.Basic
#align_import algebra.monoid_algebra.grading from "leanprover-community/mathlib"@"feb99064803fd3108e37c18b0f77d0a8344677a3"
noncomputable section
namespace AddMonoidAlgebra
variable {M : Type*} {ΞΉ : Type*} {R : Type*}
section
variable (R) [CommSemiring R]
abbrev gradeBy (f : M β ΞΉ) (i : ΞΉ) : Submodule R R[M] where
carrier := { a | β m, m β a.support β f m = i }
zero_mem' m h := by cases h
add_mem' {a b} ha hb m h := by
classical exact (Finset.mem_union.mp (Finsupp.support_add h)).elim (ha m) (hb m)
smul_mem' a m h := Set.Subset.trans Finsupp.support_smul h
#align add_monoid_algebra.grade_by AddMonoidAlgebra.gradeBy
abbrev grade (m : M) : Submodule R R[M] :=
gradeBy R id m
#align add_monoid_algebra.grade AddMonoidAlgebra.grade
theorem gradeBy_id : gradeBy R (id : M β M) = grade R := rfl
#align add_monoid_algebra.grade_by_id AddMonoidAlgebra.gradeBy_id
theorem mem_gradeBy_iff (f : M β ΞΉ) (i : ΞΉ) (a : R[M]) :
a β gradeBy R f i β (a.support : Set M) β f β»ΒΉ' {i} := by rfl
#align add_monoid_algebra.mem_grade_by_iff AddMonoidAlgebra.mem_gradeBy_iff
theorem mem_grade_iff (m : M) (a : R[M]) : a β grade R m β a.support β {m} := by
rw [β Finset.coe_subset, Finset.coe_singleton]
rfl
#align add_monoid_algebra.mem_grade_iff AddMonoidAlgebra.mem_grade_iff
theorem mem_grade_iff' (m : M) (a : R[M]) :
a β grade R m β a β (LinearMap.range (Finsupp.lsingle m : R ββ[R] M ββ R) :
Submodule R R[M]) := by
rw [mem_grade_iff, Finsupp.support_subset_singleton']
apply exists_congr
intro r
constructor <;> exact Eq.symm
#align add_monoid_algebra.mem_grade_iff' AddMonoidAlgebra.mem_grade_iff'
theorem grade_eq_lsingle_range (m : M) :
grade R m = LinearMap.range (Finsupp.lsingle m : R ββ[R] M ββ R) :=
Submodule.ext (mem_grade_iff' R m)
#align add_monoid_algebra.grade_eq_lsingle_range AddMonoidAlgebra.grade_eq_lsingle_range
theorem single_mem_gradeBy {R} [CommSemiring R] (f : M β ΞΉ) (m : M) (r : R) :
Finsupp.single m r β gradeBy R f (f m) := by
intro x hx
rw [Finset.mem_singleton.mp (Finsupp.support_single_subset hx)]
#align add_monoid_algebra.single_mem_grade_by AddMonoidAlgebra.single_mem_gradeBy
theorem single_mem_grade {R} [CommSemiring R] (i : M) (r : R) : Finsupp.single i r β grade R i :=
single_mem_gradeBy _ _ _
#align add_monoid_algebra.single_mem_grade AddMonoidAlgebra.single_mem_grade
end
open DirectSum
instance gradeBy.gradedMonoid [AddMonoid M] [AddMonoid ΞΉ] [CommSemiring R] (f : M β+ ΞΉ) :
SetLike.GradedMonoid (gradeBy R f : ΞΉ β Submodule R R[M]) where
one_mem m h := by
rw [one_def] at h
obtain rfl : m = 0 := Finset.mem_singleton.1 <| Finsupp.support_single_subset h
apply map_zero
mul_mem i j a b ha hb c hc := by
classical
obtain β¨ma, hma, mb, hmb, rflβ© : β y β a.support, β z β b.support, y + z = c :=
Finset.mem_add.1 <| support_mul a b hc
rw [map_add, ha ma hma, hb mb hmb]
#align add_monoid_algebra.grade_by.graded_monoid AddMonoidAlgebra.gradeBy.gradedMonoid
instance grade.gradedMonoid [AddMonoid M] [CommSemiring R] :
SetLike.GradedMonoid (grade R : M β Submodule R R[M]) := by
apply gradeBy.gradedMonoid (AddMonoidHom.id _)
#align add_monoid_algebra.grade.graded_monoid AddMonoidAlgebra.grade.gradedMonoid
variable [AddMonoid M] [DecidableEq ΞΉ] [AddMonoid ΞΉ] [CommSemiring R] (f : M β+ ΞΉ)
def decomposeAux : R[M] ββ[R] β¨ i : ΞΉ, gradeBy R f i :=
AddMonoidAlgebra.lift R M _
{ toFun := fun m =>
DirectSum.of (fun i : ΞΉ => gradeBy R f i) (f (Multiplicative.toAdd m))
β¨Finsupp.single (Multiplicative.toAdd m) 1, single_mem_gradeBy _ _ _β©
map_one' :=
DirectSum.of_eq_of_gradedMonoid_eq
(by congr 2 <;> simp)
map_mul' := fun i j => by
symm
dsimp only [toAdd_one, Eq.ndrec, Set.mem_setOf_eq, ne_eq, OneHom.toFun_eq_coe,
OneHom.coe_mk, toAdd_mul]
convert DirectSum.of_mul_of (A := (fun i : ΞΉ => gradeBy R f i)) _ _
repeat { rw [ AddMonoidHom.map_add] }
simp only [SetLike.coe_gMul]
exact Eq.trans (by rw [one_mul]) single_mul_single.symm }
#align add_monoid_algebra.decompose_aux AddMonoidAlgebra.decomposeAux
| Mathlib/Algebra/MonoidAlgebra/Grading.lean | 140 | 150 | theorem decomposeAux_single (m : M) (r : R) :
decomposeAux f (Finsupp.single m r) =
DirectSum.of (fun i : ΞΉ => gradeBy R f i) (f m)
β¨Finsupp.single m r, single_mem_gradeBy _ _ _β© := by |
refine (lift_single _ _ _).trans ?_
refine (DirectSum.of_smul R _ _ _).symm.trans ?_
apply DirectSum.of_eq_of_gradedMonoid_eq
refine Sigma.subtype_ext rfl ?_
refine (Finsupp.smul_single' _ _ _).trans ?_
rw [mul_one]
rfl
| 7 | 1,096.633158 | 2 | 1.2 | 5 | 1,256 |
import Mathlib.Analysis.Calculus.Deriv.Basic
import Mathlib.LinearAlgebra.AffineSpace.Slope
#align_import analysis.calculus.deriv.slope from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
universe u v w
noncomputable section
open Topology Filter TopologicalSpace
open Filter Set
section NormedField
variable {π : Type u} [NontriviallyNormedField π]
variable {F : Type v} [NormedAddCommGroup F] [NormedSpace π F]
variable {E : Type w} [NormedAddCommGroup E] [NormedSpace π E]
variable {f fβ fβ g : π β F}
variable {f' fβ' fβ' g' : F}
variable {x : π}
variable {s t : Set π}
variable {L Lβ Lβ : Filter π}
| Mathlib/Analysis/Calculus/Deriv/Slope.lean | 51 | 63 | theorem hasDerivAtFilter_iff_tendsto_slope {x : π} {L : Filter π} :
HasDerivAtFilter f f' x L β Tendsto (slope f x) (L β π {x}αΆ) (π f') :=
calc HasDerivAtFilter f f' x L
β Tendsto (fun y β¦ slope f x y - (y - x)β»ΒΉ β’ (y - x) β’ f') L (π 0) := by |
simp only [hasDerivAtFilter_iff_tendsto, β norm_inv, β norm_smul,
β tendsto_zero_iff_norm_tendsto_zero, slope_def_module, smul_sub]
_ β Tendsto (fun y β¦ slope f x y - (y - x)β»ΒΉ β’ (y - x) β’ f') (L β π {x}αΆ) (π 0) :=
.symm <| tendsto_inf_principal_nhds_iff_of_forall_eq <| by simp
_ β Tendsto (fun y β¦ slope f x y - f') (L β π {x}αΆ) (π 0) := tendsto_congr' <| by
refine (EqOn.eventuallyEq fun y hy β¦ ?_).filter_mono inf_le_right
rw [inv_smul_smulβ (sub_ne_zero.2 hy) f']
_ β Tendsto (slope f x) (L β π {x}αΆ) (π f') := by
rw [β nhds_translation_sub f', tendsto_comap_iff]; rfl
| 9 | 8,103.083928 | 2 | 1.2 | 5 | 1,257 |
import Mathlib.Analysis.Calculus.Deriv.Basic
import Mathlib.LinearAlgebra.AffineSpace.Slope
#align_import analysis.calculus.deriv.slope from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
universe u v w
noncomputable section
open Topology Filter TopologicalSpace
open Filter Set
section NormedField
variable {π : Type u} [NontriviallyNormedField π]
variable {F : Type v} [NormedAddCommGroup F] [NormedSpace π F]
variable {E : Type w} [NormedAddCommGroup E] [NormedSpace π E]
variable {f fβ fβ g : π β F}
variable {f' fβ' fβ' g' : F}
variable {x : π}
variable {s t : Set π}
variable {L Lβ Lβ : Filter π}
theorem hasDerivAtFilter_iff_tendsto_slope {x : π} {L : Filter π} :
HasDerivAtFilter f f' x L β Tendsto (slope f x) (L β π {x}αΆ) (π f') :=
calc HasDerivAtFilter f f' x L
β Tendsto (fun y β¦ slope f x y - (y - x)β»ΒΉ β’ (y - x) β’ f') L (π 0) := by
simp only [hasDerivAtFilter_iff_tendsto, β norm_inv, β norm_smul,
β tendsto_zero_iff_norm_tendsto_zero, slope_def_module, smul_sub]
_ β Tendsto (fun y β¦ slope f x y - (y - x)β»ΒΉ β’ (y - x) β’ f') (L β π {x}αΆ) (π 0) :=
.symm <| tendsto_inf_principal_nhds_iff_of_forall_eq <| by simp
_ β Tendsto (fun y β¦ slope f x y - f') (L β π {x}αΆ) (π 0) := tendsto_congr' <| by
refine (EqOn.eventuallyEq fun y hy β¦ ?_).filter_mono inf_le_right
rw [inv_smul_smulβ (sub_ne_zero.2 hy) f']
_ β Tendsto (slope f x) (L β π {x}αΆ) (π f') := by
rw [β nhds_translation_sub f', tendsto_comap_iff]; rfl
#align has_deriv_at_filter_iff_tendsto_slope hasDerivAtFilter_iff_tendsto_slope
| Mathlib/Analysis/Calculus/Deriv/Slope.lean | 66 | 69 | theorem hasDerivWithinAt_iff_tendsto_slope :
HasDerivWithinAt f f' s x β Tendsto (slope f x) (π[s \ {x}] x) (π f') := by |
simp only [HasDerivWithinAt, nhdsWithin, diff_eq, β inf_assoc, inf_principal.symm]
exact hasDerivAtFilter_iff_tendsto_slope
| 2 | 7.389056 | 1 | 1.2 | 5 | 1,257 |
import Mathlib.Analysis.Calculus.Deriv.Basic
import Mathlib.LinearAlgebra.AffineSpace.Slope
#align_import analysis.calculus.deriv.slope from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
universe u v w
noncomputable section
open Topology Filter TopologicalSpace
open Filter Set
section NormedField
variable {π : Type u} [NontriviallyNormedField π]
variable {F : Type v} [NormedAddCommGroup F] [NormedSpace π F]
variable {E : Type w} [NormedAddCommGroup E] [NormedSpace π E]
variable {f fβ fβ g : π β F}
variable {f' fβ' fβ' g' : F}
variable {x : π}
variable {s t : Set π}
variable {L Lβ Lβ : Filter π}
theorem hasDerivAtFilter_iff_tendsto_slope {x : π} {L : Filter π} :
HasDerivAtFilter f f' x L β Tendsto (slope f x) (L β π {x}αΆ) (π f') :=
calc HasDerivAtFilter f f' x L
β Tendsto (fun y β¦ slope f x y - (y - x)β»ΒΉ β’ (y - x) β’ f') L (π 0) := by
simp only [hasDerivAtFilter_iff_tendsto, β norm_inv, β norm_smul,
β tendsto_zero_iff_norm_tendsto_zero, slope_def_module, smul_sub]
_ β Tendsto (fun y β¦ slope f x y - (y - x)β»ΒΉ β’ (y - x) β’ f') (L β π {x}αΆ) (π 0) :=
.symm <| tendsto_inf_principal_nhds_iff_of_forall_eq <| by simp
_ β Tendsto (fun y β¦ slope f x y - f') (L β π {x}αΆ) (π 0) := tendsto_congr' <| by
refine (EqOn.eventuallyEq fun y hy β¦ ?_).filter_mono inf_le_right
rw [inv_smul_smulβ (sub_ne_zero.2 hy) f']
_ β Tendsto (slope f x) (L β π {x}αΆ) (π f') := by
rw [β nhds_translation_sub f', tendsto_comap_iff]; rfl
#align has_deriv_at_filter_iff_tendsto_slope hasDerivAtFilter_iff_tendsto_slope
theorem hasDerivWithinAt_iff_tendsto_slope :
HasDerivWithinAt f f' s x β Tendsto (slope f x) (π[s \ {x}] x) (π f') := by
simp only [HasDerivWithinAt, nhdsWithin, diff_eq, β inf_assoc, inf_principal.symm]
exact hasDerivAtFilter_iff_tendsto_slope
#align has_deriv_within_at_iff_tendsto_slope hasDerivWithinAt_iff_tendsto_slope
| Mathlib/Analysis/Calculus/Deriv/Slope.lean | 72 | 74 | theorem hasDerivWithinAt_iff_tendsto_slope' (hs : x β s) :
HasDerivWithinAt f f' s x β Tendsto (slope f x) (π[s] x) (π f') := by |
rw [hasDerivWithinAt_iff_tendsto_slope, diff_singleton_eq_self hs]
| 1 | 2.718282 | 0 | 1.2 | 5 | 1,257 |
import Mathlib.Analysis.Calculus.Deriv.Basic
import Mathlib.LinearAlgebra.AffineSpace.Slope
#align_import analysis.calculus.deriv.slope from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
universe u v w
noncomputable section
open Topology Filter TopologicalSpace
open Filter Set
section NormedField
variable {π : Type u} [NontriviallyNormedField π]
variable {F : Type v} [NormedAddCommGroup F] [NormedSpace π F]
variable {E : Type w} [NormedAddCommGroup E] [NormedSpace π E]
variable {f fβ fβ g : π β F}
variable {f' fβ' fβ' g' : F}
variable {x : π}
variable {s t : Set π}
variable {L Lβ Lβ : Filter π}
theorem hasDerivAtFilter_iff_tendsto_slope {x : π} {L : Filter π} :
HasDerivAtFilter f f' x L β Tendsto (slope f x) (L β π {x}αΆ) (π f') :=
calc HasDerivAtFilter f f' x L
β Tendsto (fun y β¦ slope f x y - (y - x)β»ΒΉ β’ (y - x) β’ f') L (π 0) := by
simp only [hasDerivAtFilter_iff_tendsto, β norm_inv, β norm_smul,
β tendsto_zero_iff_norm_tendsto_zero, slope_def_module, smul_sub]
_ β Tendsto (fun y β¦ slope f x y - (y - x)β»ΒΉ β’ (y - x) β’ f') (L β π {x}αΆ) (π 0) :=
.symm <| tendsto_inf_principal_nhds_iff_of_forall_eq <| by simp
_ β Tendsto (fun y β¦ slope f x y - f') (L β π {x}αΆ) (π 0) := tendsto_congr' <| by
refine (EqOn.eventuallyEq fun y hy β¦ ?_).filter_mono inf_le_right
rw [inv_smul_smulβ (sub_ne_zero.2 hy) f']
_ β Tendsto (slope f x) (L β π {x}αΆ) (π f') := by
rw [β nhds_translation_sub f', tendsto_comap_iff]; rfl
#align has_deriv_at_filter_iff_tendsto_slope hasDerivAtFilter_iff_tendsto_slope
theorem hasDerivWithinAt_iff_tendsto_slope :
HasDerivWithinAt f f' s x β Tendsto (slope f x) (π[s \ {x}] x) (π f') := by
simp only [HasDerivWithinAt, nhdsWithin, diff_eq, β inf_assoc, inf_principal.symm]
exact hasDerivAtFilter_iff_tendsto_slope
#align has_deriv_within_at_iff_tendsto_slope hasDerivWithinAt_iff_tendsto_slope
theorem hasDerivWithinAt_iff_tendsto_slope' (hs : x β s) :
HasDerivWithinAt f f' s x β Tendsto (slope f x) (π[s] x) (π f') := by
rw [hasDerivWithinAt_iff_tendsto_slope, diff_singleton_eq_self hs]
#align has_deriv_within_at_iff_tendsto_slope' hasDerivWithinAt_iff_tendsto_slope'
theorem hasDerivAt_iff_tendsto_slope : HasDerivAt f f' x β Tendsto (slope f x) (π[β ] x) (π f') :=
hasDerivAtFilter_iff_tendsto_slope
#align has_deriv_at_iff_tendsto_slope hasDerivAt_iff_tendsto_slope
| Mathlib/Analysis/Calculus/Deriv/Slope.lean | 81 | 85 | theorem hasDerivAt_iff_tendsto_slope_zero :
HasDerivAt f f' x β Tendsto (fun t β¦ tβ»ΒΉ β’ (f (x + t) - f x)) (π[β ] 0) (π f') := by |
have : π[β ] x = Filter.map (fun t β¦ x + t) (π[β ] 0) := by
simp [nhdsWithin, map_add_left_nhds_zero x, Filter.map_inf, add_right_injective x]
simp [hasDerivAt_iff_tendsto_slope, this, slope, Function.comp]
| 3 | 20.085537 | 1 | 1.2 | 5 | 1,257 |
import Mathlib.Analysis.Calculus.Deriv.Basic
import Mathlib.LinearAlgebra.AffineSpace.Slope
#align_import analysis.calculus.deriv.slope from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
universe u v w
noncomputable section
open Topology Filter TopologicalSpace
open Filter Set
section NormedField
variable {π : Type u} [NontriviallyNormedField π]
variable {F : Type v} [NormedAddCommGroup F] [NormedSpace π F]
variable {E : Type w} [NormedAddCommGroup E] [NormedSpace π E]
variable {f fβ fβ g : π β F}
variable {f' fβ' fβ' g' : F}
variable {x : π}
variable {s t : Set π}
variable {L Lβ Lβ : Filter π}
theorem hasDerivAtFilter_iff_tendsto_slope {x : π} {L : Filter π} :
HasDerivAtFilter f f' x L β Tendsto (slope f x) (L β π {x}αΆ) (π f') :=
calc HasDerivAtFilter f f' x L
β Tendsto (fun y β¦ slope f x y - (y - x)β»ΒΉ β’ (y - x) β’ f') L (π 0) := by
simp only [hasDerivAtFilter_iff_tendsto, β norm_inv, β norm_smul,
β tendsto_zero_iff_norm_tendsto_zero, slope_def_module, smul_sub]
_ β Tendsto (fun y β¦ slope f x y - (y - x)β»ΒΉ β’ (y - x) β’ f') (L β π {x}αΆ) (π 0) :=
.symm <| tendsto_inf_principal_nhds_iff_of_forall_eq <| by simp
_ β Tendsto (fun y β¦ slope f x y - f') (L β π {x}αΆ) (π 0) := tendsto_congr' <| by
refine (EqOn.eventuallyEq fun y hy β¦ ?_).filter_mono inf_le_right
rw [inv_smul_smulβ (sub_ne_zero.2 hy) f']
_ β Tendsto (slope f x) (L β π {x}αΆ) (π f') := by
rw [β nhds_translation_sub f', tendsto_comap_iff]; rfl
#align has_deriv_at_filter_iff_tendsto_slope hasDerivAtFilter_iff_tendsto_slope
theorem hasDerivWithinAt_iff_tendsto_slope :
HasDerivWithinAt f f' s x β Tendsto (slope f x) (π[s \ {x}] x) (π f') := by
simp only [HasDerivWithinAt, nhdsWithin, diff_eq, β inf_assoc, inf_principal.symm]
exact hasDerivAtFilter_iff_tendsto_slope
#align has_deriv_within_at_iff_tendsto_slope hasDerivWithinAt_iff_tendsto_slope
theorem hasDerivWithinAt_iff_tendsto_slope' (hs : x β s) :
HasDerivWithinAt f f' s x β Tendsto (slope f x) (π[s] x) (π f') := by
rw [hasDerivWithinAt_iff_tendsto_slope, diff_singleton_eq_self hs]
#align has_deriv_within_at_iff_tendsto_slope' hasDerivWithinAt_iff_tendsto_slope'
theorem hasDerivAt_iff_tendsto_slope : HasDerivAt f f' x β Tendsto (slope f x) (π[β ] x) (π f') :=
hasDerivAtFilter_iff_tendsto_slope
#align has_deriv_at_iff_tendsto_slope hasDerivAt_iff_tendsto_slope
theorem hasDerivAt_iff_tendsto_slope_zero :
HasDerivAt f f' x β Tendsto (fun t β¦ tβ»ΒΉ β’ (f (x + t) - f x)) (π[β ] 0) (π f') := by
have : π[β ] x = Filter.map (fun t β¦ x + t) (π[β ] 0) := by
simp [nhdsWithin, map_add_left_nhds_zero x, Filter.map_inf, add_right_injective x]
simp [hasDerivAt_iff_tendsto_slope, this, slope, Function.comp]
alias β¨HasDerivAt.tendsto_slope_zero, _β© := hasDerivAt_iff_tendsto_slope_zero
theorem HasDerivAt.tendsto_slope_zero_right [PartialOrder π] (h : HasDerivAt f f' x) :
Tendsto (fun t β¦ tβ»ΒΉ β’ (f (x + t) - f x)) (π[>] 0) (π f') :=
h.tendsto_slope_zero.mono_left (nhds_right'_le_nhds_ne 0)
theorem HasDerivAt.tendsto_slope_zero_left [PartialOrder π] (h : HasDerivAt f f' x) :
Tendsto (fun t β¦ tβ»ΒΉ β’ (f (x + t) - f x)) (π[<] 0) (π f') :=
h.tendsto_slope_zero.mono_left (nhds_left'_le_nhds_ne 0)
| Mathlib/Analysis/Calculus/Deriv/Slope.lean | 99 | 134 | theorem range_derivWithin_subset_closure_span_image
(f : π β F) {s t : Set π} (h : s β closure (s β© t)) :
range (derivWithin f s) β closure (Submodule.span π (f '' t)) := by |
rintro - β¨x, rflβ©
rcases eq_or_neBot (π[s \ {x}] x) with H|H
Β· simp [derivWithin, fderivWithin, H]
exact subset_closure (zero_mem _)
by_cases H' : DifferentiableWithinAt π f s x; swap
Β· rw [derivWithin_zero_of_not_differentiableWithinAt H']
exact subset_closure (zero_mem _)
have I : (π[(s β© t) \ {x}] x).NeBot := by
rw [β mem_closure_iff_nhdsWithin_neBot] at H β’
have A : closure (s \ {x}) β closure (closure (s β© t) \ {x}) :=
closure_mono (diff_subset_diff_left h)
have B : closure (s β© t) \ {x} β closure ((s β© t) \ {x}) := by
convert closure_diff; exact closure_singleton.symm
simpa using A.trans (closure_mono B) H
have : Tendsto (slope f x) (π[(s β© t) \ {x}] x) (π (derivWithin f s x)) := by
apply Tendsto.mono_left (hasDerivWithinAt_iff_tendsto_slope.1 H'.hasDerivWithinAt)
rw [inter_comm, inter_diff_assoc]
exact nhdsWithin_mono _ inter_subset_right
rw [β closure_closure, β Submodule.topologicalClosure_coe]
apply mem_closure_of_tendsto this
filter_upwards [self_mem_nhdsWithin] with y hy
simp only [slope, vsub_eq_sub, SetLike.mem_coe]
refine Submodule.smul_mem _ _ (Submodule.sub_mem _ ?_ ?_)
Β· apply Submodule.le_topologicalClosure
apply Submodule.subset_span
exact mem_image_of_mem _ hy.1.2
Β· apply Submodule.closure_subset_topologicalClosure_span
suffices A : f x β closure (f '' (s β© t)) from
closure_mono (image_subset _ inter_subset_right) A
apply ContinuousWithinAt.mem_closure_image
Β· apply H'.continuousWithinAt.mono inter_subset_left
rw [mem_closure_iff_nhdsWithin_neBot]
exact I.mono (nhdsWithin_mono _ diff_subset)
| 33 | 214,643,579,785,916.06 | 2 | 1.2 | 5 | 1,257 |
import Mathlib.Data.List.Sublists
import Mathlib.Data.Multiset.Bind
#align_import data.multiset.powerset from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
namespace Multiset
open List
variable {Ξ± : Type*}
-- Porting note (#11215): TODO: Write a more efficient version
def powersetAux (l : List Ξ±) : List (Multiset Ξ±) :=
(sublists l).map (β)
#align multiset.powerset_aux Multiset.powersetAux
theorem powersetAux_eq_map_coe {l : List Ξ±} : powersetAux l = (sublists l).map (β) :=
rfl
#align multiset.powerset_aux_eq_map_coe Multiset.powersetAux_eq_map_coe
@[simp]
theorem mem_powersetAux {l : List Ξ±} {s} : s β powersetAux l β s β€ βl :=
Quotient.inductionOn s <| by simp [powersetAux_eq_map_coe, Subperm, and_comm]
#align multiset.mem_powerset_aux Multiset.mem_powersetAux
def powersetAux' (l : List Ξ±) : List (Multiset Ξ±) :=
(sublists' l).map (β)
#align multiset.powerset_aux' Multiset.powersetAux'
| Mathlib/Data/Multiset/Powerset.lean | 45 | 46 | theorem powersetAux_perm_powersetAux' {l : List Ξ±} : powersetAux l ~ powersetAux' l := by |
rw [powersetAux_eq_map_coe]; exact (sublists_perm_sublists' _).map _
| 1 | 2.718282 | 0 | 1.2 | 5 | 1,258 |
import Mathlib.Data.List.Sublists
import Mathlib.Data.Multiset.Bind
#align_import data.multiset.powerset from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
namespace Multiset
open List
variable {Ξ± : Type*}
-- Porting note (#11215): TODO: Write a more efficient version
def powersetAux (l : List Ξ±) : List (Multiset Ξ±) :=
(sublists l).map (β)
#align multiset.powerset_aux Multiset.powersetAux
theorem powersetAux_eq_map_coe {l : List Ξ±} : powersetAux l = (sublists l).map (β) :=
rfl
#align multiset.powerset_aux_eq_map_coe Multiset.powersetAux_eq_map_coe
@[simp]
theorem mem_powersetAux {l : List Ξ±} {s} : s β powersetAux l β s β€ βl :=
Quotient.inductionOn s <| by simp [powersetAux_eq_map_coe, Subperm, and_comm]
#align multiset.mem_powerset_aux Multiset.mem_powersetAux
def powersetAux' (l : List Ξ±) : List (Multiset Ξ±) :=
(sublists' l).map (β)
#align multiset.powerset_aux' Multiset.powersetAux'
theorem powersetAux_perm_powersetAux' {l : List Ξ±} : powersetAux l ~ powersetAux' l := by
rw [powersetAux_eq_map_coe]; exact (sublists_perm_sublists' _).map _
#align multiset.powerset_aux_perm_powerset_aux' Multiset.powersetAux_perm_powersetAux'
@[simp]
theorem powersetAux'_nil : powersetAux' (@nil Ξ±) = [0] :=
rfl
#align multiset.powerset_aux'_nil Multiset.powersetAux'_nil
@[simp]
| Mathlib/Data/Multiset/Powerset.lean | 55 | 57 | theorem powersetAux'_cons (a : Ξ±) (l : List Ξ±) :
powersetAux' (a :: l) = powersetAux' l ++ List.map (cons a) (powersetAux' l) := by |
simp only [powersetAux', sublists'_cons, map_append, List.map_map, append_cancel_left_eq]; rfl
| 1 | 2.718282 | 0 | 1.2 | 5 | 1,258 |
import Mathlib.Data.List.Sublists
import Mathlib.Data.Multiset.Bind
#align_import data.multiset.powerset from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
namespace Multiset
open List
variable {Ξ± : Type*}
-- Porting note (#11215): TODO: Write a more efficient version
def powersetAux (l : List Ξ±) : List (Multiset Ξ±) :=
(sublists l).map (β)
#align multiset.powerset_aux Multiset.powersetAux
theorem powersetAux_eq_map_coe {l : List Ξ±} : powersetAux l = (sublists l).map (β) :=
rfl
#align multiset.powerset_aux_eq_map_coe Multiset.powersetAux_eq_map_coe
@[simp]
theorem mem_powersetAux {l : List Ξ±} {s} : s β powersetAux l β s β€ βl :=
Quotient.inductionOn s <| by simp [powersetAux_eq_map_coe, Subperm, and_comm]
#align multiset.mem_powerset_aux Multiset.mem_powersetAux
def powersetAux' (l : List Ξ±) : List (Multiset Ξ±) :=
(sublists' l).map (β)
#align multiset.powerset_aux' Multiset.powersetAux'
theorem powersetAux_perm_powersetAux' {l : List Ξ±} : powersetAux l ~ powersetAux' l := by
rw [powersetAux_eq_map_coe]; exact (sublists_perm_sublists' _).map _
#align multiset.powerset_aux_perm_powerset_aux' Multiset.powersetAux_perm_powersetAux'
@[simp]
theorem powersetAux'_nil : powersetAux' (@nil Ξ±) = [0] :=
rfl
#align multiset.powerset_aux'_nil Multiset.powersetAux'_nil
@[simp]
theorem powersetAux'_cons (a : Ξ±) (l : List Ξ±) :
powersetAux' (a :: l) = powersetAux' l ++ List.map (cons a) (powersetAux' l) := by
simp only [powersetAux', sublists'_cons, map_append, List.map_map, append_cancel_left_eq]; rfl
#align multiset.powerset_aux'_cons Multiset.powersetAux'_cons
| Mathlib/Data/Multiset/Powerset.lean | 60 | 70 | theorem powerset_aux'_perm {lβ lβ : List Ξ±} (p : lβ ~ lβ) : powersetAux' lβ ~ powersetAux' lβ := by |
induction' p with a lβ lβ p IH a b l lβ lβ lβ _ _ IHβ IHβ
Β· simp
Β· simp only [powersetAux'_cons]
exact IH.append (IH.map _)
Β· simp only [powersetAux'_cons, map_append, List.map_map, append_assoc]
apply Perm.append_left
rw [β append_assoc, β append_assoc,
(by funext s; simp [cons_swap] : cons b β cons a = cons a β cons b)]
exact perm_append_comm.append_right _
Β· exact IHβ.trans IHβ
| 10 | 22,026.465795 | 2 | 1.2 | 5 | 1,258 |
import Mathlib.Data.List.Sublists
import Mathlib.Data.Multiset.Bind
#align_import data.multiset.powerset from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
namespace Multiset
open List
variable {Ξ± : Type*}
-- Porting note (#11215): TODO: Write a more efficient version
def powersetAux (l : List Ξ±) : List (Multiset Ξ±) :=
(sublists l).map (β)
#align multiset.powerset_aux Multiset.powersetAux
theorem powersetAux_eq_map_coe {l : List Ξ±} : powersetAux l = (sublists l).map (β) :=
rfl
#align multiset.powerset_aux_eq_map_coe Multiset.powersetAux_eq_map_coe
@[simp]
theorem mem_powersetAux {l : List Ξ±} {s} : s β powersetAux l β s β€ βl :=
Quotient.inductionOn s <| by simp [powersetAux_eq_map_coe, Subperm, and_comm]
#align multiset.mem_powerset_aux Multiset.mem_powersetAux
def powersetAux' (l : List Ξ±) : List (Multiset Ξ±) :=
(sublists' l).map (β)
#align multiset.powerset_aux' Multiset.powersetAux'
theorem powersetAux_perm_powersetAux' {l : List Ξ±} : powersetAux l ~ powersetAux' l := by
rw [powersetAux_eq_map_coe]; exact (sublists_perm_sublists' _).map _
#align multiset.powerset_aux_perm_powerset_aux' Multiset.powersetAux_perm_powersetAux'
@[simp]
theorem powersetAux'_nil : powersetAux' (@nil Ξ±) = [0] :=
rfl
#align multiset.powerset_aux'_nil Multiset.powersetAux'_nil
@[simp]
theorem powersetAux'_cons (a : Ξ±) (l : List Ξ±) :
powersetAux' (a :: l) = powersetAux' l ++ List.map (cons a) (powersetAux' l) := by
simp only [powersetAux', sublists'_cons, map_append, List.map_map, append_cancel_left_eq]; rfl
#align multiset.powerset_aux'_cons Multiset.powersetAux'_cons
theorem powerset_aux'_perm {lβ lβ : List Ξ±} (p : lβ ~ lβ) : powersetAux' lβ ~ powersetAux' lβ := by
induction' p with a lβ lβ p IH a b l lβ lβ lβ _ _ IHβ IHβ
Β· simp
Β· simp only [powersetAux'_cons]
exact IH.append (IH.map _)
Β· simp only [powersetAux'_cons, map_append, List.map_map, append_assoc]
apply Perm.append_left
rw [β append_assoc, β append_assoc,
(by funext s; simp [cons_swap] : cons b β cons a = cons a β cons b)]
exact perm_append_comm.append_right _
Β· exact IHβ.trans IHβ
#align multiset.powerset_aux'_perm Multiset.powerset_aux'_perm
theorem powersetAux_perm {lβ lβ : List Ξ±} (p : lβ ~ lβ) : powersetAux lβ ~ powersetAux lβ :=
powersetAux_perm_powersetAux'.trans <|
(powerset_aux'_perm p).trans powersetAux_perm_powersetAux'.symm
#align multiset.powerset_aux_perm Multiset.powersetAux_perm
--Porting note (#11083): slightly slower implementation due to `map ofList`
def powerset (s : Multiset Ξ±) : Multiset (Multiset Ξ±) :=
Quot.liftOn s
(fun l => (powersetAux l : Multiset (Multiset Ξ±)))
(fun _ _ h => Quot.sound (powersetAux_perm h))
#align multiset.powerset Multiset.powerset
theorem powerset_coe (l : List Ξ±) : @powerset Ξ± l = ((sublists l).map (β) : List (Multiset Ξ±)) :=
congr_arg ((β) : List (Multiset Ξ±) β Multiset (Multiset Ξ±)) powersetAux_eq_map_coe
#align multiset.powerset_coe Multiset.powerset_coe
@[simp]
theorem powerset_coe' (l : List Ξ±) : @powerset Ξ± l = ((sublists' l).map (β) : List (Multiset Ξ±)) :=
Quot.sound powersetAux_perm_powersetAux'
#align multiset.powerset_coe' Multiset.powerset_coe'
@[simp]
theorem powerset_zero : @powerset Ξ± 0 = {0} :=
rfl
#align multiset.powerset_zero Multiset.powerset_zero
@[simp]
theorem powerset_cons (a : Ξ±) (s) : powerset (a ::β s) = powerset s + map (cons a) (powerset s) :=
Quotient.inductionOn s fun l => by
simp only [quot_mk_to_coe, cons_coe, powerset_coe', sublists'_cons, map_append, List.map_map,
map_coe, coe_add, coe_eq_coe]; rfl
#align multiset.powerset_cons Multiset.powerset_cons
@[simp]
theorem mem_powerset {s t : Multiset Ξ±} : s β powerset t β s β€ t :=
Quotient.inductionOnβ s t <| by simp [Subperm, and_comm]
#align multiset.mem_powerset Multiset.mem_powerset
theorem map_single_le_powerset (s : Multiset Ξ±) : s.map singleton β€ powerset s :=
Quotient.inductionOn s fun l => by
simp only [powerset_coe, quot_mk_to_coe, coe_le, map_coe]
show l.map (((β) : List Ξ± β Multiset Ξ±) β pure) <+~ (sublists l).map (β)
rw [β List.map_map]
exact ((map_pure_sublist_sublists _).map _).subperm
#align multiset.map_single_le_powerset Multiset.map_single_le_powerset
@[simp]
theorem card_powerset (s : Multiset Ξ±) : card (powerset s) = 2 ^ card s :=
Quotient.inductionOn s <| by simp
#align multiset.card_powerset Multiset.card_powerset
| Mathlib/Data/Multiset/Powerset.lean | 125 | 129 | theorem revzip_powersetAux {l : List Ξ±} β¦xβ¦ (h : x β revzip (powersetAux l)) : x.1 + x.2 = βl := by |
rw [revzip, powersetAux_eq_map_coe, β map_reverse, zip_map, β revzip, List.mem_map] at h
simp only [Prod.map_apply, Prod.exists] at h
rcases h with β¨lβ, lβ, h, rfl, rflβ©
exact Quot.sound (revzip_sublists _ _ _ h)
| 4 | 54.59815 | 2 | 1.2 | 5 | 1,258 |
import Mathlib.Data.List.Sublists
import Mathlib.Data.Multiset.Bind
#align_import data.multiset.powerset from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
namespace Multiset
open List
variable {Ξ± : Type*}
-- Porting note (#11215): TODO: Write a more efficient version
def powersetAux (l : List Ξ±) : List (Multiset Ξ±) :=
(sublists l).map (β)
#align multiset.powerset_aux Multiset.powersetAux
theorem powersetAux_eq_map_coe {l : List Ξ±} : powersetAux l = (sublists l).map (β) :=
rfl
#align multiset.powerset_aux_eq_map_coe Multiset.powersetAux_eq_map_coe
@[simp]
theorem mem_powersetAux {l : List Ξ±} {s} : s β powersetAux l β s β€ βl :=
Quotient.inductionOn s <| by simp [powersetAux_eq_map_coe, Subperm, and_comm]
#align multiset.mem_powerset_aux Multiset.mem_powersetAux
def powersetAux' (l : List Ξ±) : List (Multiset Ξ±) :=
(sublists' l).map (β)
#align multiset.powerset_aux' Multiset.powersetAux'
theorem powersetAux_perm_powersetAux' {l : List Ξ±} : powersetAux l ~ powersetAux' l := by
rw [powersetAux_eq_map_coe]; exact (sublists_perm_sublists' _).map _
#align multiset.powerset_aux_perm_powerset_aux' Multiset.powersetAux_perm_powersetAux'
@[simp]
theorem powersetAux'_nil : powersetAux' (@nil Ξ±) = [0] :=
rfl
#align multiset.powerset_aux'_nil Multiset.powersetAux'_nil
@[simp]
theorem powersetAux'_cons (a : Ξ±) (l : List Ξ±) :
powersetAux' (a :: l) = powersetAux' l ++ List.map (cons a) (powersetAux' l) := by
simp only [powersetAux', sublists'_cons, map_append, List.map_map, append_cancel_left_eq]; rfl
#align multiset.powerset_aux'_cons Multiset.powersetAux'_cons
theorem powerset_aux'_perm {lβ lβ : List Ξ±} (p : lβ ~ lβ) : powersetAux' lβ ~ powersetAux' lβ := by
induction' p with a lβ lβ p IH a b l lβ lβ lβ _ _ IHβ IHβ
Β· simp
Β· simp only [powersetAux'_cons]
exact IH.append (IH.map _)
Β· simp only [powersetAux'_cons, map_append, List.map_map, append_assoc]
apply Perm.append_left
rw [β append_assoc, β append_assoc,
(by funext s; simp [cons_swap] : cons b β cons a = cons a β cons b)]
exact perm_append_comm.append_right _
Β· exact IHβ.trans IHβ
#align multiset.powerset_aux'_perm Multiset.powerset_aux'_perm
theorem powersetAux_perm {lβ lβ : List Ξ±} (p : lβ ~ lβ) : powersetAux lβ ~ powersetAux lβ :=
powersetAux_perm_powersetAux'.trans <|
(powerset_aux'_perm p).trans powersetAux_perm_powersetAux'.symm
#align multiset.powerset_aux_perm Multiset.powersetAux_perm
--Porting note (#11083): slightly slower implementation due to `map ofList`
def powerset (s : Multiset Ξ±) : Multiset (Multiset Ξ±) :=
Quot.liftOn s
(fun l => (powersetAux l : Multiset (Multiset Ξ±)))
(fun _ _ h => Quot.sound (powersetAux_perm h))
#align multiset.powerset Multiset.powerset
theorem powerset_coe (l : List Ξ±) : @powerset Ξ± l = ((sublists l).map (β) : List (Multiset Ξ±)) :=
congr_arg ((β) : List (Multiset Ξ±) β Multiset (Multiset Ξ±)) powersetAux_eq_map_coe
#align multiset.powerset_coe Multiset.powerset_coe
@[simp]
theorem powerset_coe' (l : List Ξ±) : @powerset Ξ± l = ((sublists' l).map (β) : List (Multiset Ξ±)) :=
Quot.sound powersetAux_perm_powersetAux'
#align multiset.powerset_coe' Multiset.powerset_coe'
@[simp]
theorem powerset_zero : @powerset Ξ± 0 = {0} :=
rfl
#align multiset.powerset_zero Multiset.powerset_zero
@[simp]
theorem powerset_cons (a : Ξ±) (s) : powerset (a ::β s) = powerset s + map (cons a) (powerset s) :=
Quotient.inductionOn s fun l => by
simp only [quot_mk_to_coe, cons_coe, powerset_coe', sublists'_cons, map_append, List.map_map,
map_coe, coe_add, coe_eq_coe]; rfl
#align multiset.powerset_cons Multiset.powerset_cons
@[simp]
theorem mem_powerset {s t : Multiset Ξ±} : s β powerset t β s β€ t :=
Quotient.inductionOnβ s t <| by simp [Subperm, and_comm]
#align multiset.mem_powerset Multiset.mem_powerset
theorem map_single_le_powerset (s : Multiset Ξ±) : s.map singleton β€ powerset s :=
Quotient.inductionOn s fun l => by
simp only [powerset_coe, quot_mk_to_coe, coe_le, map_coe]
show l.map (((β) : List Ξ± β Multiset Ξ±) β pure) <+~ (sublists l).map (β)
rw [β List.map_map]
exact ((map_pure_sublist_sublists _).map _).subperm
#align multiset.map_single_le_powerset Multiset.map_single_le_powerset
@[simp]
theorem card_powerset (s : Multiset Ξ±) : card (powerset s) = 2 ^ card s :=
Quotient.inductionOn s <| by simp
#align multiset.card_powerset Multiset.card_powerset
theorem revzip_powersetAux {l : List Ξ±} β¦xβ¦ (h : x β revzip (powersetAux l)) : x.1 + x.2 = βl := by
rw [revzip, powersetAux_eq_map_coe, β map_reverse, zip_map, β revzip, List.mem_map] at h
simp only [Prod.map_apply, Prod.exists] at h
rcases h with β¨lβ, lβ, h, rfl, rflβ©
exact Quot.sound (revzip_sublists _ _ _ h)
#align multiset.revzip_powerset_aux Multiset.revzip_powersetAux
| Mathlib/Data/Multiset/Powerset.lean | 132 | 137 | theorem revzip_powersetAux' {l : List Ξ±} β¦xβ¦ (h : x β revzip (powersetAux' l)) :
x.1 + x.2 = βl := by |
rw [revzip, powersetAux', β map_reverse, zip_map, β revzip, List.mem_map] at h
simp only [Prod.map_apply, Prod.exists] at h
rcases h with β¨lβ, lβ, h, rfl, rflβ©
exact Quot.sound (revzip_sublists' _ _ _ h)
| 4 | 54.59815 | 2 | 1.2 | 5 | 1,258 |
import Mathlib.SetTheory.Ordinal.Arithmetic
import Mathlib.Tactic.TFAE
import Mathlib.Topology.Order.Monotone
#align_import set_theory.ordinal.topology from "leanprover-community/mathlib"@"740acc0e6f9adf4423f92a485d0456fc271482da"
noncomputable section
universe u v
open Cardinal Order Topology
namespace Ordinal
variable {s : Set Ordinal.{u}} {a : Ordinal.{u}}
instance : TopologicalSpace Ordinal.{u} := Preorder.topology Ordinal.{u}
instance : OrderTopology Ordinal.{u} := β¨rflβ©
| Mathlib/SetTheory/Ordinal/Topology.lean | 41 | 53 | theorem isOpen_singleton_iff : IsOpen ({a} : Set Ordinal) β Β¬IsLimit a := by |
refine β¨fun h β¨hβ, hsuccβ© => ?_, fun ha => ?_β©
Β· obtain β¨b, c, hbc, hbc'β© :=
(mem_nhds_iff_exists_Ioo_subset' β¨0, Ordinal.pos_iff_ne_zero.2 hββ© β¨_, lt_succ aβ©).1
(h.mem_nhds rfl)
have hba := hsucc b hbc.1
exact hba.ne (hbc' β¨lt_succ b, hba.trans hbc.2β©)
Β· rcases zero_or_succ_or_limit a with (rfl | β¨b, rflβ© | ha')
Β· rw [β bot_eq_zero, β Set.Iic_bot, β Iio_succ]
exact isOpen_Iio
Β· rw [β Set.Icc_self, Icc_succ_left, β Ioo_succ_right]
exact isOpen_Ioo
Β· exact (ha ha').elim
| 12 | 162,754.791419 | 2 | 1.2 | 5 | 1,259 |
import Mathlib.SetTheory.Ordinal.Arithmetic
import Mathlib.Tactic.TFAE
import Mathlib.Topology.Order.Monotone
#align_import set_theory.ordinal.topology from "leanprover-community/mathlib"@"740acc0e6f9adf4423f92a485d0456fc271482da"
noncomputable section
universe u v
open Cardinal Order Topology
namespace Ordinal
variable {s : Set Ordinal.{u}} {a : Ordinal.{u}}
instance : TopologicalSpace Ordinal.{u} := Preorder.topology Ordinal.{u}
instance : OrderTopology Ordinal.{u} := β¨rflβ©
theorem isOpen_singleton_iff : IsOpen ({a} : Set Ordinal) β Β¬IsLimit a := by
refine β¨fun h β¨hβ, hsuccβ© => ?_, fun ha => ?_β©
Β· obtain β¨b, c, hbc, hbc'β© :=
(mem_nhds_iff_exists_Ioo_subset' β¨0, Ordinal.pos_iff_ne_zero.2 hββ© β¨_, lt_succ aβ©).1
(h.mem_nhds rfl)
have hba := hsucc b hbc.1
exact hba.ne (hbc' β¨lt_succ b, hba.trans hbc.2β©)
Β· rcases zero_or_succ_or_limit a with (rfl | β¨b, rflβ© | ha')
Β· rw [β bot_eq_zero, β Set.Iic_bot, β Iio_succ]
exact isOpen_Iio
Β· rw [β Set.Icc_self, Icc_succ_left, β Ioo_succ_right]
exact isOpen_Ioo
Β· exact (ha ha').elim
#align ordinal.is_open_singleton_iff Ordinal.isOpen_singleton_iff
-- Porting note (#11215): TODO: generalize to a `SuccOrder`
theorem nhds_right' (a : Ordinal) : π[>] a = β₯ := (covBy_succ a).nhdsWithin_Ioi
-- todo: generalize to a `SuccOrder`
| Mathlib/SetTheory/Ordinal/Topology.lean | 60 | 61 | theorem nhds_left'_eq_nhds_ne (a : Ordinal) : π[<] a = π[β ] a := by |
rw [β nhds_left'_sup_nhds_right', nhds_right', sup_bot_eq]
| 1 | 2.718282 | 0 | 1.2 | 5 | 1,259 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.