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.Associated import Mathlib.Algebra.Order.Ring.Abs import Mathlib.Data.Nat.Choose.Sum import Mathlib.Data.Nat.Choose.Dvd import Mathlib.Data.Nat.Prime #align_import number_theory.primorial from "leanprover-community/mathlib"@"0a0ec35061ed9960bf0e7ffb0335f44447b58977" open Finset open Nat open Nat def primorial (n : β„•) : β„• := ∏ p ∈ filter Nat.Prime (range (n + 1)), p #align primorial primorial local notation x "#" => primorial x theorem primorial_pos (n : β„•) : 0 < n# := prod_pos fun _p hp ↦ (mem_filter.1 hp).2.pos #align primorial_pos primorial_pos
Mathlib/NumberTheory/Primorial.lean
45
48
theorem primorial_succ {n : β„•} (hn1 : n β‰  1) (hn : Odd n) : (n + 1)# = n# := by
refine prod_congr ?_ fun _ _ ↦ rfl rw [range_succ, filter_insert, if_neg fun h ↦ odd_iff_not_even.mp hn _] exact fun h ↦ h.even_sub_one <| mt succ.inj hn1
3
20.085537
1
1.333333
3
1,394
import Mathlib.Algebra.BigOperators.Associated import Mathlib.Algebra.Order.Ring.Abs import Mathlib.Data.Nat.Choose.Sum import Mathlib.Data.Nat.Choose.Dvd import Mathlib.Data.Nat.Prime #align_import number_theory.primorial from "leanprover-community/mathlib"@"0a0ec35061ed9960bf0e7ffb0335f44447b58977" open Finset open Nat open Nat def primorial (n : β„•) : β„• := ∏ p ∈ filter Nat.Prime (range (n + 1)), p #align primorial primorial local notation x "#" => primorial x theorem primorial_pos (n : β„•) : 0 < n# := prod_pos fun _p hp ↦ (mem_filter.1 hp).2.pos #align primorial_pos primorial_pos theorem primorial_succ {n : β„•} (hn1 : n β‰  1) (hn : Odd n) : (n + 1)# = n# := by refine prod_congr ?_ fun _ _ ↦ rfl rw [range_succ, filter_insert, if_neg fun h ↦ odd_iff_not_even.mp hn _] exact fun h ↦ h.even_sub_one <| mt succ.inj hn1 #align primorial_succ primorial_succ
Mathlib/NumberTheory/Primorial.lean
51
55
theorem primorial_add (m n : β„•) : (m + n)# = m# * ∏ p ∈ filter Nat.Prime (Ico (m + 1) (m + n + 1)), p := by
rw [primorial, primorial, ← Ico_zero_eq_range, ← prod_union, ← filter_union, Ico_union_Ico_eq_Ico] exacts [Nat.zero_le _, add_le_add_right (Nat.le_add_right _ _) _, disjoint_filter_filter <| Ico_disjoint_Ico_consecutive _ _ _]
3
20.085537
1
1.333333
3
1,394
import Mathlib.Algebra.BigOperators.Associated import Mathlib.Algebra.Order.Ring.Abs import Mathlib.Data.Nat.Choose.Sum import Mathlib.Data.Nat.Choose.Dvd import Mathlib.Data.Nat.Prime #align_import number_theory.primorial from "leanprover-community/mathlib"@"0a0ec35061ed9960bf0e7ffb0335f44447b58977" open Finset open Nat open Nat def primorial (n : β„•) : β„• := ∏ p ∈ filter Nat.Prime (range (n + 1)), p #align primorial primorial local notation x "#" => primorial x theorem primorial_pos (n : β„•) : 0 < n# := prod_pos fun _p hp ↦ (mem_filter.1 hp).2.pos #align primorial_pos primorial_pos theorem primorial_succ {n : β„•} (hn1 : n β‰  1) (hn : Odd n) : (n + 1)# = n# := by refine prod_congr ?_ fun _ _ ↦ rfl rw [range_succ, filter_insert, if_neg fun h ↦ odd_iff_not_even.mp hn _] exact fun h ↦ h.even_sub_one <| mt succ.inj hn1 #align primorial_succ primorial_succ theorem primorial_add (m n : β„•) : (m + n)# = m# * ∏ p ∈ filter Nat.Prime (Ico (m + 1) (m + n + 1)), p := by rw [primorial, primorial, ← Ico_zero_eq_range, ← prod_union, ← filter_union, Ico_union_Ico_eq_Ico] exacts [Nat.zero_le _, add_le_add_right (Nat.le_add_right _ _) _, disjoint_filter_filter <| Ico_disjoint_Ico_consecutive _ _ _] #align primorial_add primorial_add theorem primorial_add_dvd {m n : β„•} (h : n ≀ m) : (m + n)# ∣ m# * choose (m + n) m := calc (m + n)# = m# * ∏ p ∈ filter Nat.Prime (Ico (m + 1) (m + n + 1)), p := primorial_add _ _ _ ∣ m# * choose (m + n) m := mul_dvd_mul_left _ <| prod_primes_dvd _ (fun k hk ↦ (mem_filter.1 hk).2.prime) fun p hp ↦ by rw [mem_filter, mem_Ico] at hp exact hp.2.dvd_choose_add hp.1.1 (h.trans_lt (m.lt_succ_self.trans_le hp.1.1)) (Nat.lt_succ_iff.1 hp.1.2) #align primorial_add_dvd primorial_add_dvd theorem primorial_add_le {m n : β„•} (h : n ≀ m) : (m + n)# ≀ m# * choose (m + n) m := le_of_dvd (mul_pos (primorial_pos _) (choose_pos <| Nat.le_add_right _ _)) (primorial_add_dvd h) #align primorial_add_le primorial_add_le
Mathlib/NumberTheory/Primorial.lean
73
91
theorem primorial_le_4_pow (n : β„•) : n# ≀ 4 ^ n := by
induction' n using Nat.strong_induction_on with n ihn cases' n with n; Β· rfl rcases n.even_or_odd with (⟨m, rfl⟩ | ho) Β· rcases m.eq_zero_or_pos with (rfl | hm) Β· decide calc (m + m + 1)# = (m + 1 + m)# := by rw [add_right_comm] _ ≀ (m + 1)# * choose (m + 1 + m) (m + 1) := primorial_add_le m.le_succ _ = (m + 1)# * choose (2 * m + 1) m := by rw [choose_symm_add, two_mul, add_right_comm] _ ≀ 4 ^ (m + 1) * 4 ^ m := mul_le_mul' (ihn _ <| succ_lt_succ <| (lt_add_iff_pos_left _).2 hm) (choose_middle_le_pow _) _ ≀ 4 ^ (m + m + 1) := by rw [← pow_add, add_right_comm] Β· rcases Decidable.eq_or_ne n 1 with (rfl | hn) Β· decide Β· calc (n + 1)# = n# := primorial_succ hn ho _ ≀ 4 ^ n := ihn n n.lt_succ_self _ ≀ 4 ^ (n + 1) := pow_le_pow_of_le_right four_pos n.le_succ
18
65,659,969.137331
2
1.333333
3
1,394
import Mathlib.Analysis.Analytic.Composition import Mathlib.Analysis.Analytic.Constructions import Mathlib.Analysis.Complex.CauchyIntegral import Mathlib.Analysis.SpecialFunctions.Complex.LogDeriv open Complex Set open scoped Topology variable {E : Type} [NormedAddCommGroup E] [NormedSpace β„‚ E] variable {f g : E β†’ β„‚} {z : β„‚} {x : E} {s : Set E}
Mathlib/Analysis/SpecialFunctions/Complex/Analytic.lean
24
25
theorem analyticOn_cexp : AnalyticOn β„‚ exp univ := by
rw [analyticOn_univ_iff_differentiable]; exact differentiable_exp
1
2.718282
0
1.333333
3
1,395
import Mathlib.Analysis.Analytic.Composition import Mathlib.Analysis.Analytic.Constructions import Mathlib.Analysis.Complex.CauchyIntegral import Mathlib.Analysis.SpecialFunctions.Complex.LogDeriv open Complex Set open scoped Topology variable {E : Type} [NormedAddCommGroup E] [NormedSpace β„‚ E] variable {f g : E β†’ β„‚} {z : β„‚} {x : E} {s : Set E} theorem analyticOn_cexp : AnalyticOn β„‚ exp univ := by rw [analyticOn_univ_iff_differentiable]; exact differentiable_exp theorem analyticAt_cexp : AnalyticAt β„‚ exp z := analyticOn_cexp z (mem_univ _) theorem AnalyticAt.cexp (fa : AnalyticAt β„‚ f x) : AnalyticAt β„‚ (fun z ↦ exp (f z)) x := analyticAt_cexp.comp fa theorem AnalyticOn.cexp (fs : AnalyticOn β„‚ f s) : AnalyticOn β„‚ (fun z ↦ exp (f z)) s := fun z n ↦ analyticAt_cexp.comp (fs z n)
Mathlib/Analysis/SpecialFunctions/Complex/Analytic.lean
40
44
theorem analyticAt_clog (m : z ∈ slitPlane) : AnalyticAt β„‚ log z := by
rw [analyticAt_iff_eventually_differentiableAt] filter_upwards [isOpen_slitPlane.eventually_mem m] intro z m exact differentiableAt_id.clog m
4
54.59815
2
1.333333
3
1,395
import Mathlib.Analysis.Analytic.Composition import Mathlib.Analysis.Analytic.Constructions import Mathlib.Analysis.Complex.CauchyIntegral import Mathlib.Analysis.SpecialFunctions.Complex.LogDeriv open Complex Set open scoped Topology variable {E : Type} [NormedAddCommGroup E] [NormedSpace β„‚ E] variable {f g : E β†’ β„‚} {z : β„‚} {x : E} {s : Set E} theorem analyticOn_cexp : AnalyticOn β„‚ exp univ := by rw [analyticOn_univ_iff_differentiable]; exact differentiable_exp theorem analyticAt_cexp : AnalyticAt β„‚ exp z := analyticOn_cexp z (mem_univ _) theorem AnalyticAt.cexp (fa : AnalyticAt β„‚ f x) : AnalyticAt β„‚ (fun z ↦ exp (f z)) x := analyticAt_cexp.comp fa theorem AnalyticOn.cexp (fs : AnalyticOn β„‚ f s) : AnalyticOn β„‚ (fun z ↦ exp (f z)) s := fun z n ↦ analyticAt_cexp.comp (fs z n) theorem analyticAt_clog (m : z ∈ slitPlane) : AnalyticAt β„‚ log z := by rw [analyticAt_iff_eventually_differentiableAt] filter_upwards [isOpen_slitPlane.eventually_mem m] intro z m exact differentiableAt_id.clog m theorem AnalyticAt.clog (fa : AnalyticAt β„‚ f x) (m : f x ∈ slitPlane) : AnalyticAt β„‚ (fun z ↦ log (f z)) x := (analyticAt_clog m).comp fa theorem AnalyticOn.clog (fs : AnalyticOn β„‚ f s) (m : βˆ€ z ∈ s, f z ∈ slitPlane) : AnalyticOn β„‚ (fun z ↦ log (f z)) s := fun z n ↦ (analyticAt_clog (m z n)).comp (fs z n)
Mathlib/Analysis/SpecialFunctions/Complex/Analytic.lean
57
64
theorem AnalyticAt.cpow (fa : AnalyticAt β„‚ f x) (ga : AnalyticAt β„‚ g x) (m : f x ∈ slitPlane) : AnalyticAt β„‚ (fun z ↦ f z ^ g z) x := by
have e : (fun z ↦ f z ^ g z) =αΆ [𝓝 x] fun z ↦ exp (log (f z) * g z) := by filter_upwards [(fa.continuousAt.eventually_ne (slitPlane_ne_zero m))] intro z fz simp only [fz, cpow_def, if_false] rw [analyticAt_congr e] exact ((fa.clog m).mul ga).cexp
6
403.428793
2
1.333333
3
1,395
import Mathlib.Analysis.SpecialFunctions.Pow.NNReal import Mathlib.Analysis.SpecialFunctions.Pow.Continuity import Mathlib.Analysis.SumOverResidueClass #align_import analysis.p_series from "leanprover-community/mathlib"@"0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8" def SuccDiffBounded (C : β„•) (u : β„• β†’ β„•) : Prop := βˆ€ n : β„•, u (n + 2) - u (n + 1) ≀ C β€’ (u (n + 1) - u n) namespace Finset variable {M : Type*} [OrderedAddCommMonoid M] {f : β„• β†’ M} {u : β„• β†’ β„•}
Mathlib/Analysis/PSeries.lean
50
62
theorem le_sum_schlomilch' (hf : βˆ€ ⦃m n⦄, 0 < m β†’ m ≀ n β†’ f n ≀ f m) (h_pos : βˆ€ n, 0 < u n) (hu : Monotone u) (n : β„•) : (βˆ‘ k ∈ Ico (u 0) (u n), f k) ≀ βˆ‘ k ∈ range n, (u (k + 1) - u k) β€’ f (u k) := by
induction' n with n ihn Β· simp suffices (βˆ‘ k ∈ Ico (u n) (u (n + 1)), f k) ≀ (u (n + 1) - u n) β€’ f (u n) by rw [sum_range_succ, ← sum_Ico_consecutive] Β· exact add_le_add ihn this exacts [hu n.zero_le, hu n.le_succ] have : βˆ€ k ∈ Ico (u n) (u (n + 1)), f k ≀ f (u n) := fun k hk => hf (Nat.succ_le_of_lt (h_pos n)) (mem_Ico.mp hk).1 convert sum_le_sum this simp [pow_succ, mul_two]
10
22,026.465795
2
1.333333
6
1,396
import Mathlib.Analysis.SpecialFunctions.Pow.NNReal import Mathlib.Analysis.SpecialFunctions.Pow.Continuity import Mathlib.Analysis.SumOverResidueClass #align_import analysis.p_series from "leanprover-community/mathlib"@"0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8" def SuccDiffBounded (C : β„•) (u : β„• β†’ β„•) : Prop := βˆ€ n : β„•, u (n + 2) - u (n + 1) ≀ C β€’ (u (n + 1) - u n) namespace Finset variable {M : Type*} [OrderedAddCommMonoid M] {f : β„• β†’ M} {u : β„• β†’ β„•} theorem le_sum_schlomilch' (hf : βˆ€ ⦃m n⦄, 0 < m β†’ m ≀ n β†’ f n ≀ f m) (h_pos : βˆ€ n, 0 < u n) (hu : Monotone u) (n : β„•) : (βˆ‘ k ∈ Ico (u 0) (u n), f k) ≀ βˆ‘ k ∈ range n, (u (k + 1) - u k) β€’ f (u k) := by induction' n with n ihn Β· simp suffices (βˆ‘ k ∈ Ico (u n) (u (n + 1)), f k) ≀ (u (n + 1) - u n) β€’ f (u n) by rw [sum_range_succ, ← sum_Ico_consecutive] Β· exact add_le_add ihn this exacts [hu n.zero_le, hu n.le_succ] have : βˆ€ k ∈ Ico (u n) (u (n + 1)), f k ≀ f (u n) := fun k hk => hf (Nat.succ_le_of_lt (h_pos n)) (mem_Ico.mp hk).1 convert sum_le_sum this simp [pow_succ, mul_two]
Mathlib/Analysis/PSeries.lean
64
68
theorem le_sum_condensed' (hf : βˆ€ ⦃m n⦄, 0 < m β†’ m ≀ n β†’ f n ≀ f m) (n : β„•) : (βˆ‘ k ∈ Ico 1 (2 ^ n), f k) ≀ βˆ‘ k ∈ range n, 2 ^ k β€’ f (2 ^ k) := by
convert le_sum_schlomilch' hf (fun n => pow_pos zero_lt_two n) (fun m n hm => pow_le_pow_right one_le_two hm) n using 2 simp [pow_succ, mul_two, two_mul]
3
20.085537
1
1.333333
6
1,396
import Mathlib.Analysis.SpecialFunctions.Pow.NNReal import Mathlib.Analysis.SpecialFunctions.Pow.Continuity import Mathlib.Analysis.SumOverResidueClass #align_import analysis.p_series from "leanprover-community/mathlib"@"0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8" def SuccDiffBounded (C : β„•) (u : β„• β†’ β„•) : Prop := βˆ€ n : β„•, u (n + 2) - u (n + 1) ≀ C β€’ (u (n + 1) - u n) namespace Finset variable {M : Type*} [OrderedAddCommMonoid M] {f : β„• β†’ M} {u : β„• β†’ β„•} theorem le_sum_schlomilch' (hf : βˆ€ ⦃m n⦄, 0 < m β†’ m ≀ n β†’ f n ≀ f m) (h_pos : βˆ€ n, 0 < u n) (hu : Monotone u) (n : β„•) : (βˆ‘ k ∈ Ico (u 0) (u n), f k) ≀ βˆ‘ k ∈ range n, (u (k + 1) - u k) β€’ f (u k) := by induction' n with n ihn Β· simp suffices (βˆ‘ k ∈ Ico (u n) (u (n + 1)), f k) ≀ (u (n + 1) - u n) β€’ f (u n) by rw [sum_range_succ, ← sum_Ico_consecutive] Β· exact add_le_add ihn this exacts [hu n.zero_le, hu n.le_succ] have : βˆ€ k ∈ Ico (u n) (u (n + 1)), f k ≀ f (u n) := fun k hk => hf (Nat.succ_le_of_lt (h_pos n)) (mem_Ico.mp hk).1 convert sum_le_sum this simp [pow_succ, mul_two] theorem le_sum_condensed' (hf : βˆ€ ⦃m n⦄, 0 < m β†’ m ≀ n β†’ f n ≀ f m) (n : β„•) : (βˆ‘ k ∈ Ico 1 (2 ^ n), f k) ≀ βˆ‘ k ∈ range n, 2 ^ k β€’ f (2 ^ k) := by convert le_sum_schlomilch' hf (fun n => pow_pos zero_lt_two n) (fun m n hm => pow_le_pow_right one_le_two hm) n using 2 simp [pow_succ, mul_two, two_mul] #align finset.le_sum_condensed' Finset.le_sum_condensed'
Mathlib/Analysis/PSeries.lean
71
76
theorem le_sum_schlomilch (hf : βˆ€ ⦃m n⦄, 0 < m β†’ m ≀ n β†’ f n ≀ f m) (h_pos : βˆ€ n, 0 < u n) (hu : Monotone u) (n : β„•) : (βˆ‘ k ∈ range (u n), f k) ≀ βˆ‘ k ∈ range (u 0), f k + βˆ‘ k ∈ range n, (u (k + 1) - u k) β€’ f (u k) := by
convert add_le_add_left (le_sum_schlomilch' hf h_pos hu n) (βˆ‘ k ∈ range (u 0), f k) rw [← sum_range_add_sum_Ico _ (hu n.zero_le)]
2
7.389056
1
1.333333
6
1,396
import Mathlib.Analysis.SpecialFunctions.Pow.NNReal import Mathlib.Analysis.SpecialFunctions.Pow.Continuity import Mathlib.Analysis.SumOverResidueClass #align_import analysis.p_series from "leanprover-community/mathlib"@"0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8" def SuccDiffBounded (C : β„•) (u : β„• β†’ β„•) : Prop := βˆ€ n : β„•, u (n + 2) - u (n + 1) ≀ C β€’ (u (n + 1) - u n) namespace Finset variable {M : Type*} [OrderedAddCommMonoid M] {f : β„• β†’ M} {u : β„• β†’ β„•} theorem le_sum_schlomilch' (hf : βˆ€ ⦃m n⦄, 0 < m β†’ m ≀ n β†’ f n ≀ f m) (h_pos : βˆ€ n, 0 < u n) (hu : Monotone u) (n : β„•) : (βˆ‘ k ∈ Ico (u 0) (u n), f k) ≀ βˆ‘ k ∈ range n, (u (k + 1) - u k) β€’ f (u k) := by induction' n with n ihn Β· simp suffices (βˆ‘ k ∈ Ico (u n) (u (n + 1)), f k) ≀ (u (n + 1) - u n) β€’ f (u n) by rw [sum_range_succ, ← sum_Ico_consecutive] Β· exact add_le_add ihn this exacts [hu n.zero_le, hu n.le_succ] have : βˆ€ k ∈ Ico (u n) (u (n + 1)), f k ≀ f (u n) := fun k hk => hf (Nat.succ_le_of_lt (h_pos n)) (mem_Ico.mp hk).1 convert sum_le_sum this simp [pow_succ, mul_two] theorem le_sum_condensed' (hf : βˆ€ ⦃m n⦄, 0 < m β†’ m ≀ n β†’ f n ≀ f m) (n : β„•) : (βˆ‘ k ∈ Ico 1 (2 ^ n), f k) ≀ βˆ‘ k ∈ range n, 2 ^ k β€’ f (2 ^ k) := by convert le_sum_schlomilch' hf (fun n => pow_pos zero_lt_two n) (fun m n hm => pow_le_pow_right one_le_two hm) n using 2 simp [pow_succ, mul_two, two_mul] #align finset.le_sum_condensed' Finset.le_sum_condensed' theorem le_sum_schlomilch (hf : βˆ€ ⦃m n⦄, 0 < m β†’ m ≀ n β†’ f n ≀ f m) (h_pos : βˆ€ n, 0 < u n) (hu : Monotone u) (n : β„•) : (βˆ‘ k ∈ range (u n), f k) ≀ βˆ‘ k ∈ range (u 0), f k + βˆ‘ k ∈ range n, (u (k + 1) - u k) β€’ f (u k) := by convert add_le_add_left (le_sum_schlomilch' hf h_pos hu n) (βˆ‘ k ∈ range (u 0), f k) rw [← sum_range_add_sum_Ico _ (hu n.zero_le)]
Mathlib/Analysis/PSeries.lean
78
81
theorem le_sum_condensed (hf : βˆ€ ⦃m n⦄, 0 < m β†’ m ≀ n β†’ f n ≀ f m) (n : β„•) : (βˆ‘ k ∈ range (2 ^ n), f k) ≀ f 0 + βˆ‘ k ∈ range n, 2 ^ k β€’ f (2 ^ k) := by
convert add_le_add_left (le_sum_condensed' hf n) (f 0) rw [← sum_range_add_sum_Ico _ n.one_le_two_pow, sum_range_succ, sum_range_zero, zero_add]
2
7.389056
1
1.333333
6
1,396
import Mathlib.Analysis.SpecialFunctions.Pow.NNReal import Mathlib.Analysis.SpecialFunctions.Pow.Continuity import Mathlib.Analysis.SumOverResidueClass #align_import analysis.p_series from "leanprover-community/mathlib"@"0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8" def SuccDiffBounded (C : β„•) (u : β„• β†’ β„•) : Prop := βˆ€ n : β„•, u (n + 2) - u (n + 1) ≀ C β€’ (u (n + 1) - u n) namespace Finset variable {M : Type*} [OrderedAddCommMonoid M] {f : β„• β†’ M} {u : β„• β†’ β„•} theorem le_sum_schlomilch' (hf : βˆ€ ⦃m n⦄, 0 < m β†’ m ≀ n β†’ f n ≀ f m) (h_pos : βˆ€ n, 0 < u n) (hu : Monotone u) (n : β„•) : (βˆ‘ k ∈ Ico (u 0) (u n), f k) ≀ βˆ‘ k ∈ range n, (u (k + 1) - u k) β€’ f (u k) := by induction' n with n ihn Β· simp suffices (βˆ‘ k ∈ Ico (u n) (u (n + 1)), f k) ≀ (u (n + 1) - u n) β€’ f (u n) by rw [sum_range_succ, ← sum_Ico_consecutive] Β· exact add_le_add ihn this exacts [hu n.zero_le, hu n.le_succ] have : βˆ€ k ∈ Ico (u n) (u (n + 1)), f k ≀ f (u n) := fun k hk => hf (Nat.succ_le_of_lt (h_pos n)) (mem_Ico.mp hk).1 convert sum_le_sum this simp [pow_succ, mul_two] theorem le_sum_condensed' (hf : βˆ€ ⦃m n⦄, 0 < m β†’ m ≀ n β†’ f n ≀ f m) (n : β„•) : (βˆ‘ k ∈ Ico 1 (2 ^ n), f k) ≀ βˆ‘ k ∈ range n, 2 ^ k β€’ f (2 ^ k) := by convert le_sum_schlomilch' hf (fun n => pow_pos zero_lt_two n) (fun m n hm => pow_le_pow_right one_le_two hm) n using 2 simp [pow_succ, mul_two, two_mul] #align finset.le_sum_condensed' Finset.le_sum_condensed' theorem le_sum_schlomilch (hf : βˆ€ ⦃m n⦄, 0 < m β†’ m ≀ n β†’ f n ≀ f m) (h_pos : βˆ€ n, 0 < u n) (hu : Monotone u) (n : β„•) : (βˆ‘ k ∈ range (u n), f k) ≀ βˆ‘ k ∈ range (u 0), f k + βˆ‘ k ∈ range n, (u (k + 1) - u k) β€’ f (u k) := by convert add_le_add_left (le_sum_schlomilch' hf h_pos hu n) (βˆ‘ k ∈ range (u 0), f k) rw [← sum_range_add_sum_Ico _ (hu n.zero_le)] theorem le_sum_condensed (hf : βˆ€ ⦃m n⦄, 0 < m β†’ m ≀ n β†’ f n ≀ f m) (n : β„•) : (βˆ‘ k ∈ range (2 ^ n), f k) ≀ f 0 + βˆ‘ k ∈ range n, 2 ^ k β€’ f (2 ^ k) := by convert add_le_add_left (le_sum_condensed' hf n) (f 0) rw [← sum_range_add_sum_Ico _ n.one_le_two_pow, sum_range_succ, sum_range_zero, zero_add] #align finset.le_sum_condensed Finset.le_sum_condensed
Mathlib/Analysis/PSeries.lean
84
98
theorem sum_schlomilch_le' (hf : βˆ€ ⦃m n⦄, 1 < m β†’ m ≀ n β†’ f n ≀ f m) (h_pos : βˆ€ n, 0 < u n) (hu : Monotone u) (n : β„•) : (βˆ‘ k ∈ range n, (u (k + 1) - u k) β€’ f (u (k + 1))) ≀ βˆ‘ k ∈ Ico (u 0 + 1) (u n + 1), f k := by
induction' n with n ihn Β· simp suffices (u (n + 1) - u n) β€’ f (u (n + 1)) ≀ βˆ‘ k ∈ Ico (u n + 1) (u (n + 1) + 1), f k by rw [sum_range_succ, ← sum_Ico_consecutive] exacts [add_le_add ihn this, (add_le_add_right (hu n.zero_le) _ : u 0 + 1 ≀ u n + 1), add_le_add_right (hu n.le_succ) _] have : βˆ€ k ∈ Ico (u n + 1) (u (n + 1) + 1), f (u (n + 1)) ≀ f k := fun k hk => hf (Nat.lt_of_le_of_lt (Nat.succ_le_of_lt (h_pos n)) <| (Nat.lt_succ_of_le le_rfl).trans_le (mem_Ico.mp hk).1) (Nat.le_of_lt_succ <| (mem_Ico.mp hk).2) convert sum_le_sum this simp [pow_succ, mul_two]
12
162,754.791419
2
1.333333
6
1,396
import Mathlib.Analysis.SpecialFunctions.Pow.NNReal import Mathlib.Analysis.SpecialFunctions.Pow.Continuity import Mathlib.Analysis.SumOverResidueClass #align_import analysis.p_series from "leanprover-community/mathlib"@"0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8" def SuccDiffBounded (C : β„•) (u : β„• β†’ β„•) : Prop := βˆ€ n : β„•, u (n + 2) - u (n + 1) ≀ C β€’ (u (n + 1) - u n) namespace Finset variable {M : Type*} [OrderedAddCommMonoid M] {f : β„• β†’ M} {u : β„• β†’ β„•} theorem le_sum_schlomilch' (hf : βˆ€ ⦃m n⦄, 0 < m β†’ m ≀ n β†’ f n ≀ f m) (h_pos : βˆ€ n, 0 < u n) (hu : Monotone u) (n : β„•) : (βˆ‘ k ∈ Ico (u 0) (u n), f k) ≀ βˆ‘ k ∈ range n, (u (k + 1) - u k) β€’ f (u k) := by induction' n with n ihn Β· simp suffices (βˆ‘ k ∈ Ico (u n) (u (n + 1)), f k) ≀ (u (n + 1) - u n) β€’ f (u n) by rw [sum_range_succ, ← sum_Ico_consecutive] Β· exact add_le_add ihn this exacts [hu n.zero_le, hu n.le_succ] have : βˆ€ k ∈ Ico (u n) (u (n + 1)), f k ≀ f (u n) := fun k hk => hf (Nat.succ_le_of_lt (h_pos n)) (mem_Ico.mp hk).1 convert sum_le_sum this simp [pow_succ, mul_two] theorem le_sum_condensed' (hf : βˆ€ ⦃m n⦄, 0 < m β†’ m ≀ n β†’ f n ≀ f m) (n : β„•) : (βˆ‘ k ∈ Ico 1 (2 ^ n), f k) ≀ βˆ‘ k ∈ range n, 2 ^ k β€’ f (2 ^ k) := by convert le_sum_schlomilch' hf (fun n => pow_pos zero_lt_two n) (fun m n hm => pow_le_pow_right one_le_two hm) n using 2 simp [pow_succ, mul_two, two_mul] #align finset.le_sum_condensed' Finset.le_sum_condensed' theorem le_sum_schlomilch (hf : βˆ€ ⦃m n⦄, 0 < m β†’ m ≀ n β†’ f n ≀ f m) (h_pos : βˆ€ n, 0 < u n) (hu : Monotone u) (n : β„•) : (βˆ‘ k ∈ range (u n), f k) ≀ βˆ‘ k ∈ range (u 0), f k + βˆ‘ k ∈ range n, (u (k + 1) - u k) β€’ f (u k) := by convert add_le_add_left (le_sum_schlomilch' hf h_pos hu n) (βˆ‘ k ∈ range (u 0), f k) rw [← sum_range_add_sum_Ico _ (hu n.zero_le)] theorem le_sum_condensed (hf : βˆ€ ⦃m n⦄, 0 < m β†’ m ≀ n β†’ f n ≀ f m) (n : β„•) : (βˆ‘ k ∈ range (2 ^ n), f k) ≀ f 0 + βˆ‘ k ∈ range n, 2 ^ k β€’ f (2 ^ k) := by convert add_le_add_left (le_sum_condensed' hf n) (f 0) rw [← sum_range_add_sum_Ico _ n.one_le_two_pow, sum_range_succ, sum_range_zero, zero_add] #align finset.le_sum_condensed Finset.le_sum_condensed theorem sum_schlomilch_le' (hf : βˆ€ ⦃m n⦄, 1 < m β†’ m ≀ n β†’ f n ≀ f m) (h_pos : βˆ€ n, 0 < u n) (hu : Monotone u) (n : β„•) : (βˆ‘ k ∈ range n, (u (k + 1) - u k) β€’ f (u (k + 1))) ≀ βˆ‘ k ∈ Ico (u 0 + 1) (u n + 1), f k := by induction' n with n ihn Β· simp suffices (u (n + 1) - u n) β€’ f (u (n + 1)) ≀ βˆ‘ k ∈ Ico (u n + 1) (u (n + 1) + 1), f k by rw [sum_range_succ, ← sum_Ico_consecutive] exacts [add_le_add ihn this, (add_le_add_right (hu n.zero_le) _ : u 0 + 1 ≀ u n + 1), add_le_add_right (hu n.le_succ) _] have : βˆ€ k ∈ Ico (u n + 1) (u (n + 1) + 1), f (u (n + 1)) ≀ f k := fun k hk => hf (Nat.lt_of_le_of_lt (Nat.succ_le_of_lt (h_pos n)) <| (Nat.lt_succ_of_le le_rfl).trans_le (mem_Ico.mp hk).1) (Nat.le_of_lt_succ <| (mem_Ico.mp hk).2) convert sum_le_sum this simp [pow_succ, mul_two]
Mathlib/Analysis/PSeries.lean
100
104
theorem sum_condensed_le' (hf : βˆ€ ⦃m n⦄, 1 < m β†’ m ≀ n β†’ f n ≀ f m) (n : β„•) : (βˆ‘ k ∈ range n, 2 ^ k β€’ f (2 ^ (k + 1))) ≀ βˆ‘ k ∈ Ico 2 (2 ^ n + 1), f k := by
convert sum_schlomilch_le' hf (fun n => pow_pos zero_lt_two n) (fun m n hm => pow_le_pow_right one_le_two hm) n using 2 simp [pow_succ, mul_two, two_mul]
3
20.085537
1
1.333333
6
1,396
import Mathlib.LinearAlgebra.CliffordAlgebra.Fold import Mathlib.LinearAlgebra.ExteriorAlgebra.Basic #align_import linear_algebra.exterior_algebra.of_alternating from "leanprover-community/mathlib"@"ce11c3c2a285bbe6937e26d9792fda4e51f3fe1a" variable {R M N N' : Type*} variable [CommRing R] [AddCommGroup M] [AddCommGroup N] [AddCommGroup N'] variable [Module R M] [Module R N] [Module R N'] -- This instance can't be found where it's needed if we don't remind lean that it exists. instance AlternatingMap.instModuleAddCommGroup {ΞΉ : Type*} : Module R (M [β‹€^ΞΉ]β†’β‚—[R] N) := by infer_instance #align alternating_map.module_add_comm_group AlternatingMap.instModuleAddCommGroup namespace ExteriorAlgebra open CliffordAlgebra hiding ΞΉ def liftAlternating : (βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) β†’β‚—[R] ExteriorAlgebra R M β†’β‚—[R] N := by suffices (βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) β†’β‚—[R] ExteriorAlgebra R M β†’β‚—[R] βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N by refine LinearMap.comprβ‚‚ this ?_ refine (LinearEquiv.toLinearMap ?_).comp (LinearMap.proj 0) exact AlternatingMap.constLinearEquivOfIsEmpty.symm refine CliffordAlgebra.foldl _ ?_ ?_ Β· refine LinearMap.mkβ‚‚ R (fun m f i => (f i.succ).curryLeft m) (fun m₁ mβ‚‚ f => ?_) (fun c m f => ?_) (fun m f₁ fβ‚‚ => ?_) fun c m f => ?_ all_goals ext i : 1 simp only [map_smul, map_add, Pi.add_apply, Pi.smul_apply, AlternatingMap.curryLeft_add, AlternatingMap.curryLeft_smul, map_add, map_smul, LinearMap.add_apply, LinearMap.smul_apply] Β· -- when applied twice with the same `m`, this recursive step produces 0 intro m x dsimp only [LinearMap.mkβ‚‚_apply, QuadraticForm.coeFn_zero, Pi.zero_apply] simp_rw [zero_smul] ext i : 1 exact AlternatingMap.curryLeft_same _ _ #align exterior_algebra.lift_alternating ExteriorAlgebra.liftAlternating @[simp]
Mathlib/LinearAlgebra/ExteriorAlgebra/OfAlternating.lean
68
76
theorem liftAlternating_ΞΉ (f : βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) (m : M) : liftAlternating (R := R) (M := M) (N := N) f (ΞΉ R m) = f 1 ![m] := by
dsimp [liftAlternating] rw [foldl_ΞΉ, LinearMap.mkβ‚‚_apply, AlternatingMap.curryLeft_apply_apply] congr -- Porting note: In Lean 3, `congr` could use the `[Subsingleton (Fin 0 β†’ M)]` instance to finish -- the proof. Here, the instance can be synthesized but `congr` does not use it so the following -- line is provided. rw [Matrix.zero_empty]
7
1,096.633158
2
1.333333
6
1,397
import Mathlib.LinearAlgebra.CliffordAlgebra.Fold import Mathlib.LinearAlgebra.ExteriorAlgebra.Basic #align_import linear_algebra.exterior_algebra.of_alternating from "leanprover-community/mathlib"@"ce11c3c2a285bbe6937e26d9792fda4e51f3fe1a" variable {R M N N' : Type*} variable [CommRing R] [AddCommGroup M] [AddCommGroup N] [AddCommGroup N'] variable [Module R M] [Module R N] [Module R N'] -- This instance can't be found where it's needed if we don't remind lean that it exists. instance AlternatingMap.instModuleAddCommGroup {ΞΉ : Type*} : Module R (M [β‹€^ΞΉ]β†’β‚—[R] N) := by infer_instance #align alternating_map.module_add_comm_group AlternatingMap.instModuleAddCommGroup namespace ExteriorAlgebra open CliffordAlgebra hiding ΞΉ def liftAlternating : (βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) β†’β‚—[R] ExteriorAlgebra R M β†’β‚—[R] N := by suffices (βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) β†’β‚—[R] ExteriorAlgebra R M β†’β‚—[R] βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N by refine LinearMap.comprβ‚‚ this ?_ refine (LinearEquiv.toLinearMap ?_).comp (LinearMap.proj 0) exact AlternatingMap.constLinearEquivOfIsEmpty.symm refine CliffordAlgebra.foldl _ ?_ ?_ Β· refine LinearMap.mkβ‚‚ R (fun m f i => (f i.succ).curryLeft m) (fun m₁ mβ‚‚ f => ?_) (fun c m f => ?_) (fun m f₁ fβ‚‚ => ?_) fun c m f => ?_ all_goals ext i : 1 simp only [map_smul, map_add, Pi.add_apply, Pi.smul_apply, AlternatingMap.curryLeft_add, AlternatingMap.curryLeft_smul, map_add, map_smul, LinearMap.add_apply, LinearMap.smul_apply] Β· -- when applied twice with the same `m`, this recursive step produces 0 intro m x dsimp only [LinearMap.mkβ‚‚_apply, QuadraticForm.coeFn_zero, Pi.zero_apply] simp_rw [zero_smul] ext i : 1 exact AlternatingMap.curryLeft_same _ _ #align exterior_algebra.lift_alternating ExteriorAlgebra.liftAlternating @[simp] theorem liftAlternating_ΞΉ (f : βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) (m : M) : liftAlternating (R := R) (M := M) (N := N) f (ΞΉ R m) = f 1 ![m] := by dsimp [liftAlternating] rw [foldl_ΞΉ, LinearMap.mkβ‚‚_apply, AlternatingMap.curryLeft_apply_apply] congr -- Porting note: In Lean 3, `congr` could use the `[Subsingleton (Fin 0 β†’ M)]` instance to finish -- the proof. Here, the instance can be synthesized but `congr` does not use it so the following -- line is provided. rw [Matrix.zero_empty] #align exterior_algebra.lift_alternating_ΞΉ ExteriorAlgebra.liftAlternating_ΞΉ
Mathlib/LinearAlgebra/ExteriorAlgebra/OfAlternating.lean
79
85
theorem liftAlternating_ΞΉ_mul (f : βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) (m : M) (x : ExteriorAlgebra R M) : liftAlternating (R := R) (M := M) (N := N) f (ΞΉ R m * x) = liftAlternating (R := R) (M := M) (N := N) (fun i => (f i.succ).curryLeft m) x := by
dsimp [liftAlternating] rw [foldl_mul, foldl_ΞΉ] rfl
3
20.085537
1
1.333333
6
1,397
import Mathlib.LinearAlgebra.CliffordAlgebra.Fold import Mathlib.LinearAlgebra.ExteriorAlgebra.Basic #align_import linear_algebra.exterior_algebra.of_alternating from "leanprover-community/mathlib"@"ce11c3c2a285bbe6937e26d9792fda4e51f3fe1a" variable {R M N N' : Type*} variable [CommRing R] [AddCommGroup M] [AddCommGroup N] [AddCommGroup N'] variable [Module R M] [Module R N] [Module R N'] -- This instance can't be found where it's needed if we don't remind lean that it exists. instance AlternatingMap.instModuleAddCommGroup {ΞΉ : Type*} : Module R (M [β‹€^ΞΉ]β†’β‚—[R] N) := by infer_instance #align alternating_map.module_add_comm_group AlternatingMap.instModuleAddCommGroup namespace ExteriorAlgebra open CliffordAlgebra hiding ΞΉ def liftAlternating : (βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) β†’β‚—[R] ExteriorAlgebra R M β†’β‚—[R] N := by suffices (βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) β†’β‚—[R] ExteriorAlgebra R M β†’β‚—[R] βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N by refine LinearMap.comprβ‚‚ this ?_ refine (LinearEquiv.toLinearMap ?_).comp (LinearMap.proj 0) exact AlternatingMap.constLinearEquivOfIsEmpty.symm refine CliffordAlgebra.foldl _ ?_ ?_ Β· refine LinearMap.mkβ‚‚ R (fun m f i => (f i.succ).curryLeft m) (fun m₁ mβ‚‚ f => ?_) (fun c m f => ?_) (fun m f₁ fβ‚‚ => ?_) fun c m f => ?_ all_goals ext i : 1 simp only [map_smul, map_add, Pi.add_apply, Pi.smul_apply, AlternatingMap.curryLeft_add, AlternatingMap.curryLeft_smul, map_add, map_smul, LinearMap.add_apply, LinearMap.smul_apply] Β· -- when applied twice with the same `m`, this recursive step produces 0 intro m x dsimp only [LinearMap.mkβ‚‚_apply, QuadraticForm.coeFn_zero, Pi.zero_apply] simp_rw [zero_smul] ext i : 1 exact AlternatingMap.curryLeft_same _ _ #align exterior_algebra.lift_alternating ExteriorAlgebra.liftAlternating @[simp] theorem liftAlternating_ΞΉ (f : βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) (m : M) : liftAlternating (R := R) (M := M) (N := N) f (ΞΉ R m) = f 1 ![m] := by dsimp [liftAlternating] rw [foldl_ΞΉ, LinearMap.mkβ‚‚_apply, AlternatingMap.curryLeft_apply_apply] congr -- Porting note: In Lean 3, `congr` could use the `[Subsingleton (Fin 0 β†’ M)]` instance to finish -- the proof. Here, the instance can be synthesized but `congr` does not use it so the following -- line is provided. rw [Matrix.zero_empty] #align exterior_algebra.lift_alternating_ΞΉ ExteriorAlgebra.liftAlternating_ΞΉ theorem liftAlternating_ΞΉ_mul (f : βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) (m : M) (x : ExteriorAlgebra R M) : liftAlternating (R := R) (M := M) (N := N) f (ΞΉ R m * x) = liftAlternating (R := R) (M := M) (N := N) (fun i => (f i.succ).curryLeft m) x := by dsimp [liftAlternating] rw [foldl_mul, foldl_ΞΉ] rfl #align exterior_algebra.lift_alternating_ΞΉ_mul ExteriorAlgebra.liftAlternating_ΞΉ_mul @[simp]
Mathlib/LinearAlgebra/ExteriorAlgebra/OfAlternating.lean
89
92
theorem liftAlternating_one (f : βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) : liftAlternating (R := R) (M := M) (N := N) f (1 : ExteriorAlgebra R M) = f 0 0 := by
dsimp [liftAlternating] rw [foldl_one]
2
7.389056
1
1.333333
6
1,397
import Mathlib.LinearAlgebra.CliffordAlgebra.Fold import Mathlib.LinearAlgebra.ExteriorAlgebra.Basic #align_import linear_algebra.exterior_algebra.of_alternating from "leanprover-community/mathlib"@"ce11c3c2a285bbe6937e26d9792fda4e51f3fe1a" variable {R M N N' : Type*} variable [CommRing R] [AddCommGroup M] [AddCommGroup N] [AddCommGroup N'] variable [Module R M] [Module R N] [Module R N'] -- This instance can't be found where it's needed if we don't remind lean that it exists. instance AlternatingMap.instModuleAddCommGroup {ΞΉ : Type*} : Module R (M [β‹€^ΞΉ]β†’β‚—[R] N) := by infer_instance #align alternating_map.module_add_comm_group AlternatingMap.instModuleAddCommGroup namespace ExteriorAlgebra open CliffordAlgebra hiding ΞΉ def liftAlternating : (βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) β†’β‚—[R] ExteriorAlgebra R M β†’β‚—[R] N := by suffices (βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) β†’β‚—[R] ExteriorAlgebra R M β†’β‚—[R] βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N by refine LinearMap.comprβ‚‚ this ?_ refine (LinearEquiv.toLinearMap ?_).comp (LinearMap.proj 0) exact AlternatingMap.constLinearEquivOfIsEmpty.symm refine CliffordAlgebra.foldl _ ?_ ?_ Β· refine LinearMap.mkβ‚‚ R (fun m f i => (f i.succ).curryLeft m) (fun m₁ mβ‚‚ f => ?_) (fun c m f => ?_) (fun m f₁ fβ‚‚ => ?_) fun c m f => ?_ all_goals ext i : 1 simp only [map_smul, map_add, Pi.add_apply, Pi.smul_apply, AlternatingMap.curryLeft_add, AlternatingMap.curryLeft_smul, map_add, map_smul, LinearMap.add_apply, LinearMap.smul_apply] Β· -- when applied twice with the same `m`, this recursive step produces 0 intro m x dsimp only [LinearMap.mkβ‚‚_apply, QuadraticForm.coeFn_zero, Pi.zero_apply] simp_rw [zero_smul] ext i : 1 exact AlternatingMap.curryLeft_same _ _ #align exterior_algebra.lift_alternating ExteriorAlgebra.liftAlternating @[simp] theorem liftAlternating_ΞΉ (f : βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) (m : M) : liftAlternating (R := R) (M := M) (N := N) f (ΞΉ R m) = f 1 ![m] := by dsimp [liftAlternating] rw [foldl_ΞΉ, LinearMap.mkβ‚‚_apply, AlternatingMap.curryLeft_apply_apply] congr -- Porting note: In Lean 3, `congr` could use the `[Subsingleton (Fin 0 β†’ M)]` instance to finish -- the proof. Here, the instance can be synthesized but `congr` does not use it so the following -- line is provided. rw [Matrix.zero_empty] #align exterior_algebra.lift_alternating_ΞΉ ExteriorAlgebra.liftAlternating_ΞΉ theorem liftAlternating_ΞΉ_mul (f : βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) (m : M) (x : ExteriorAlgebra R M) : liftAlternating (R := R) (M := M) (N := N) f (ΞΉ R m * x) = liftAlternating (R := R) (M := M) (N := N) (fun i => (f i.succ).curryLeft m) x := by dsimp [liftAlternating] rw [foldl_mul, foldl_ΞΉ] rfl #align exterior_algebra.lift_alternating_ΞΉ_mul ExteriorAlgebra.liftAlternating_ΞΉ_mul @[simp] theorem liftAlternating_one (f : βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) : liftAlternating (R := R) (M := M) (N := N) f (1 : ExteriorAlgebra R M) = f 0 0 := by dsimp [liftAlternating] rw [foldl_one] #align exterior_algebra.lift_alternating_one ExteriorAlgebra.liftAlternating_one @[simp]
Mathlib/LinearAlgebra/ExteriorAlgebra/OfAlternating.lean
96
99
theorem liftAlternating_algebraMap (f : βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) (r : R) : liftAlternating (R := R) (M := M) (N := N) f (algebraMap _ (ExteriorAlgebra R M) r) = r β€’ f 0 0 := by
rw [Algebra.algebraMap_eq_smul_one, map_smul, liftAlternating_one]
1
2.718282
0
1.333333
6
1,397
import Mathlib.LinearAlgebra.CliffordAlgebra.Fold import Mathlib.LinearAlgebra.ExteriorAlgebra.Basic #align_import linear_algebra.exterior_algebra.of_alternating from "leanprover-community/mathlib"@"ce11c3c2a285bbe6937e26d9792fda4e51f3fe1a" variable {R M N N' : Type*} variable [CommRing R] [AddCommGroup M] [AddCommGroup N] [AddCommGroup N'] variable [Module R M] [Module R N] [Module R N'] -- This instance can't be found where it's needed if we don't remind lean that it exists. instance AlternatingMap.instModuleAddCommGroup {ΞΉ : Type*} : Module R (M [β‹€^ΞΉ]β†’β‚—[R] N) := by infer_instance #align alternating_map.module_add_comm_group AlternatingMap.instModuleAddCommGroup namespace ExteriorAlgebra open CliffordAlgebra hiding ΞΉ def liftAlternating : (βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) β†’β‚—[R] ExteriorAlgebra R M β†’β‚—[R] N := by suffices (βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) β†’β‚—[R] ExteriorAlgebra R M β†’β‚—[R] βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N by refine LinearMap.comprβ‚‚ this ?_ refine (LinearEquiv.toLinearMap ?_).comp (LinearMap.proj 0) exact AlternatingMap.constLinearEquivOfIsEmpty.symm refine CliffordAlgebra.foldl _ ?_ ?_ Β· refine LinearMap.mkβ‚‚ R (fun m f i => (f i.succ).curryLeft m) (fun m₁ mβ‚‚ f => ?_) (fun c m f => ?_) (fun m f₁ fβ‚‚ => ?_) fun c m f => ?_ all_goals ext i : 1 simp only [map_smul, map_add, Pi.add_apply, Pi.smul_apply, AlternatingMap.curryLeft_add, AlternatingMap.curryLeft_smul, map_add, map_smul, LinearMap.add_apply, LinearMap.smul_apply] Β· -- when applied twice with the same `m`, this recursive step produces 0 intro m x dsimp only [LinearMap.mkβ‚‚_apply, QuadraticForm.coeFn_zero, Pi.zero_apply] simp_rw [zero_smul] ext i : 1 exact AlternatingMap.curryLeft_same _ _ #align exterior_algebra.lift_alternating ExteriorAlgebra.liftAlternating @[simp] theorem liftAlternating_ΞΉ (f : βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) (m : M) : liftAlternating (R := R) (M := M) (N := N) f (ΞΉ R m) = f 1 ![m] := by dsimp [liftAlternating] rw [foldl_ΞΉ, LinearMap.mkβ‚‚_apply, AlternatingMap.curryLeft_apply_apply] congr -- Porting note: In Lean 3, `congr` could use the `[Subsingleton (Fin 0 β†’ M)]` instance to finish -- the proof. Here, the instance can be synthesized but `congr` does not use it so the following -- line is provided. rw [Matrix.zero_empty] #align exterior_algebra.lift_alternating_ΞΉ ExteriorAlgebra.liftAlternating_ΞΉ theorem liftAlternating_ΞΉ_mul (f : βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) (m : M) (x : ExteriorAlgebra R M) : liftAlternating (R := R) (M := M) (N := N) f (ΞΉ R m * x) = liftAlternating (R := R) (M := M) (N := N) (fun i => (f i.succ).curryLeft m) x := by dsimp [liftAlternating] rw [foldl_mul, foldl_ΞΉ] rfl #align exterior_algebra.lift_alternating_ΞΉ_mul ExteriorAlgebra.liftAlternating_ΞΉ_mul @[simp] theorem liftAlternating_one (f : βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) : liftAlternating (R := R) (M := M) (N := N) f (1 : ExteriorAlgebra R M) = f 0 0 := by dsimp [liftAlternating] rw [foldl_one] #align exterior_algebra.lift_alternating_one ExteriorAlgebra.liftAlternating_one @[simp] theorem liftAlternating_algebraMap (f : βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) (r : R) : liftAlternating (R := R) (M := M) (N := N) f (algebraMap _ (ExteriorAlgebra R M) r) = r β€’ f 0 0 := by rw [Algebra.algebraMap_eq_smul_one, map_smul, liftAlternating_one] #align exterior_algebra.lift_alternating_algebra_map ExteriorAlgebra.liftAlternating_algebraMap @[simp]
Mathlib/LinearAlgebra/ExteriorAlgebra/OfAlternating.lean
103
115
theorem liftAlternating_apply_ΞΉMulti {n : β„•} (f : βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) (v : Fin n β†’ M) : liftAlternating (R := R) (M := M) (N := N) f (ΞΉMulti R n v) = f n v := by
rw [ΞΉMulti_apply] -- Porting note: `v` is generalized automatically so it was removed from the next line induction' n with n ih generalizing f Β· -- Porting note: Lean does not automatically synthesize the instance -- `[Subsingleton (Fin 0 β†’ M)]` which is needed for `Subsingleton.elim 0 v` on line 114. letI : Subsingleton (Fin 0 β†’ M) := by infer_instance rw [List.ofFn_zero, List.prod_nil, liftAlternating_one, Subsingleton.elim 0 v] Β· rw [List.ofFn_succ, List.prod_cons, liftAlternating_ΞΉ_mul, ih, AlternatingMap.curryLeft_apply_apply] congr exact Matrix.cons_head_tail _
11
59,874.141715
2
1.333333
6
1,397
import Mathlib.LinearAlgebra.CliffordAlgebra.Fold import Mathlib.LinearAlgebra.ExteriorAlgebra.Basic #align_import linear_algebra.exterior_algebra.of_alternating from "leanprover-community/mathlib"@"ce11c3c2a285bbe6937e26d9792fda4e51f3fe1a" variable {R M N N' : Type*} variable [CommRing R] [AddCommGroup M] [AddCommGroup N] [AddCommGroup N'] variable [Module R M] [Module R N] [Module R N'] -- This instance can't be found where it's needed if we don't remind lean that it exists. instance AlternatingMap.instModuleAddCommGroup {ΞΉ : Type*} : Module R (M [β‹€^ΞΉ]β†’β‚—[R] N) := by infer_instance #align alternating_map.module_add_comm_group AlternatingMap.instModuleAddCommGroup namespace ExteriorAlgebra open CliffordAlgebra hiding ΞΉ def liftAlternating : (βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) β†’β‚—[R] ExteriorAlgebra R M β†’β‚—[R] N := by suffices (βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) β†’β‚—[R] ExteriorAlgebra R M β†’β‚—[R] βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N by refine LinearMap.comprβ‚‚ this ?_ refine (LinearEquiv.toLinearMap ?_).comp (LinearMap.proj 0) exact AlternatingMap.constLinearEquivOfIsEmpty.symm refine CliffordAlgebra.foldl _ ?_ ?_ Β· refine LinearMap.mkβ‚‚ R (fun m f i => (f i.succ).curryLeft m) (fun m₁ mβ‚‚ f => ?_) (fun c m f => ?_) (fun m f₁ fβ‚‚ => ?_) fun c m f => ?_ all_goals ext i : 1 simp only [map_smul, map_add, Pi.add_apply, Pi.smul_apply, AlternatingMap.curryLeft_add, AlternatingMap.curryLeft_smul, map_add, map_smul, LinearMap.add_apply, LinearMap.smul_apply] Β· -- when applied twice with the same `m`, this recursive step produces 0 intro m x dsimp only [LinearMap.mkβ‚‚_apply, QuadraticForm.coeFn_zero, Pi.zero_apply] simp_rw [zero_smul] ext i : 1 exact AlternatingMap.curryLeft_same _ _ #align exterior_algebra.lift_alternating ExteriorAlgebra.liftAlternating @[simp] theorem liftAlternating_ΞΉ (f : βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) (m : M) : liftAlternating (R := R) (M := M) (N := N) f (ΞΉ R m) = f 1 ![m] := by dsimp [liftAlternating] rw [foldl_ΞΉ, LinearMap.mkβ‚‚_apply, AlternatingMap.curryLeft_apply_apply] congr -- Porting note: In Lean 3, `congr` could use the `[Subsingleton (Fin 0 β†’ M)]` instance to finish -- the proof. Here, the instance can be synthesized but `congr` does not use it so the following -- line is provided. rw [Matrix.zero_empty] #align exterior_algebra.lift_alternating_ΞΉ ExteriorAlgebra.liftAlternating_ΞΉ theorem liftAlternating_ΞΉ_mul (f : βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) (m : M) (x : ExteriorAlgebra R M) : liftAlternating (R := R) (M := M) (N := N) f (ΞΉ R m * x) = liftAlternating (R := R) (M := M) (N := N) (fun i => (f i.succ).curryLeft m) x := by dsimp [liftAlternating] rw [foldl_mul, foldl_ΞΉ] rfl #align exterior_algebra.lift_alternating_ΞΉ_mul ExteriorAlgebra.liftAlternating_ΞΉ_mul @[simp] theorem liftAlternating_one (f : βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) : liftAlternating (R := R) (M := M) (N := N) f (1 : ExteriorAlgebra R M) = f 0 0 := by dsimp [liftAlternating] rw [foldl_one] #align exterior_algebra.lift_alternating_one ExteriorAlgebra.liftAlternating_one @[simp] theorem liftAlternating_algebraMap (f : βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) (r : R) : liftAlternating (R := R) (M := M) (N := N) f (algebraMap _ (ExteriorAlgebra R M) r) = r β€’ f 0 0 := by rw [Algebra.algebraMap_eq_smul_one, map_smul, liftAlternating_one] #align exterior_algebra.lift_alternating_algebra_map ExteriorAlgebra.liftAlternating_algebraMap @[simp] theorem liftAlternating_apply_ΞΉMulti {n : β„•} (f : βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) (v : Fin n β†’ M) : liftAlternating (R := R) (M := M) (N := N) f (ΞΉMulti R n v) = f n v := by rw [ΞΉMulti_apply] -- Porting note: `v` is generalized automatically so it was removed from the next line induction' n with n ih generalizing f Β· -- Porting note: Lean does not automatically synthesize the instance -- `[Subsingleton (Fin 0 β†’ M)]` which is needed for `Subsingleton.elim 0 v` on line 114. letI : Subsingleton (Fin 0 β†’ M) := by infer_instance rw [List.ofFn_zero, List.prod_nil, liftAlternating_one, Subsingleton.elim 0 v] Β· rw [List.ofFn_succ, List.prod_cons, liftAlternating_ΞΉ_mul, ih, AlternatingMap.curryLeft_apply_apply] congr exact Matrix.cons_head_tail _ #align exterior_algebra.lift_alternating_apply_ΞΉ_multi ExteriorAlgebra.liftAlternating_apply_ΞΉMulti @[simp] theorem liftAlternating_comp_ΞΉMulti {n : β„•} (f : βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) : (liftAlternating (R := R) (M := M) (N := N) f).compAlternatingMap (ΞΉMulti R n) = f n := AlternatingMap.ext <| liftAlternating_apply_ΞΉMulti f #align exterior_algebra.lift_alternating_comp_ΞΉ_multi ExteriorAlgebra.liftAlternating_comp_ΞΉMulti @[simp]
Mathlib/LinearAlgebra/ExteriorAlgebra/OfAlternating.lean
125
135
theorem liftAlternating_comp (g : N β†’β‚—[R] N') (f : βˆ€ i, M [β‹€^Fin i]β†’β‚—[R] N) : (liftAlternating (R := R) (M := M) (N := N') fun i => g.compAlternatingMap (f i)) = g βˆ˜β‚— liftAlternating (R := R) (M := M) (N := N) f := by
ext v rw [LinearMap.comp_apply] induction' v using CliffordAlgebra.left_induction with r x y hx hy x m hx generalizing f Β· rw [liftAlternating_algebraMap, liftAlternating_algebraMap, map_smul, LinearMap.compAlternatingMap_apply] Β· rw [map_add, map_add, map_add, hx, hy] Β· rw [liftAlternating_ΞΉ_mul, liftAlternating_ΞΉ_mul, ← hx] simp_rw [AlternatingMap.curryLeft_compAlternatingMap]
8
2,980.957987
2
1.333333
6
1,397
import Mathlib.Analysis.InnerProductSpace.Projection import Mathlib.Analysis.NormedSpace.lpSpace import Mathlib.Analysis.InnerProductSpace.PiL2 #align_import analysis.inner_product_space.l2_space from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5" open RCLike Submodule Filter open scoped NNReal ENNReal Classical ComplexConjugate Topology noncomputable section variable {ΞΉ π•œ : Type*} [RCLike π•œ] {E : Type*} variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] [cplt : CompleteSpace E] variable {G : ΞΉ β†’ Type*} [βˆ€ i, NormedAddCommGroup (G i)] [βˆ€ i, InnerProductSpace π•œ (G i)] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y notation "β„“Β²(" ΞΉ ", " π•œ ")" => lp (fun i : ΞΉ => π•œ) 2 namespace lp
Mathlib/Analysis/InnerProductSpace/l2Space.lean
106
112
theorem summable_inner (f g : lp G 2) : Summable fun i => βŸͺf i, g i⟫ := by
-- Apply the Direct Comparison Test, comparing with βˆ‘' i, β€–f iβ€– * β€–g iβ€– (summable by HΓΆlder) refine .of_norm_bounded (fun i => β€–f iβ€– * β€–g iβ€–) (lp.summable_mul ?_ f g) ?_ Β· rw [Real.isConjExponent_iff]; norm_num intro i -- Then apply Cauchy-Schwarz pointwise exact norm_inner_le_norm (π•œ := π•œ) _ _
6
403.428793
2
1.333333
3
1,398
import Mathlib.Analysis.InnerProductSpace.Projection import Mathlib.Analysis.NormedSpace.lpSpace import Mathlib.Analysis.InnerProductSpace.PiL2 #align_import analysis.inner_product_space.l2_space from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5" open RCLike Submodule Filter open scoped NNReal ENNReal Classical ComplexConjugate Topology noncomputable section variable {ΞΉ π•œ : Type*} [RCLike π•œ] {E : Type*} variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] [cplt : CompleteSpace E] variable {G : ΞΉ β†’ Type*} [βˆ€ i, NormedAddCommGroup (G i)] [βˆ€ i, InnerProductSpace π•œ (G i)] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y notation "β„“Β²(" ΞΉ ", " π•œ ")" => lp (fun i : ΞΉ => π•œ) 2 namespace lp theorem summable_inner (f g : lp G 2) : Summable fun i => βŸͺf i, g i⟫ := by -- Apply the Direct Comparison Test, comparing with βˆ‘' i, β€–f iβ€– * β€–g iβ€– (summable by HΓΆlder) refine .of_norm_bounded (fun i => β€–f iβ€– * β€–g iβ€–) (lp.summable_mul ?_ f g) ?_ Β· rw [Real.isConjExponent_iff]; norm_num intro i -- Then apply Cauchy-Schwarz pointwise exact norm_inner_le_norm (π•œ := π•œ) _ _ #align lp.summable_inner lp.summable_inner instance instInnerProductSpace : InnerProductSpace π•œ (lp G 2) := { lp.normedAddCommGroup (E := G) (p := 2) with inner := fun f g => βˆ‘' i, βŸͺf i, g i⟫ norm_sq_eq_inner := fun f => by calc β€–fβ€– ^ 2 = β€–fβ€– ^ (2 : ℝβ‰₯0∞).toReal := by norm_cast _ = βˆ‘' i, β€–f iβ€– ^ (2 : ℝβ‰₯0∞).toReal := lp.norm_rpow_eq_tsum ?_ f _ = βˆ‘' i, β€–f iβ€– ^ (2 : β„•) := by norm_cast _ = βˆ‘' i, re βŸͺf i, f i⟫ := by congr funext i rw [norm_sq_eq_inner (π•œ := π•œ)] -- Porting note: `simp` couldn't do this anymore _ = re (βˆ‘' i, βŸͺf i, f i⟫) := (RCLike.reCLM.map_tsum ?_).symm Β· norm_num Β· exact summable_inner f f conj_symm := fun f g => by calc conj _ = conj (βˆ‘' i, βŸͺg i, f i⟫) := by congr _ = βˆ‘' i, conj βŸͺg i, f i⟫ := RCLike.conjCLE.map_tsum _ = βˆ‘' i, βŸͺf i, g i⟫ := by simp only [inner_conj_symm] _ = _ := by congr add_left := fun f₁ fβ‚‚ g => by calc _ = βˆ‘' i, βŸͺ(f₁ + fβ‚‚) i, g i⟫ := ?_ _ = βˆ‘' i, (βŸͺf₁ i, g i⟫ + βŸͺfβ‚‚ i, g i⟫) := by simp only [inner_add_left, Pi.add_apply, coeFn_add] _ = (βˆ‘' i, βŸͺf₁ i, g i⟫) + βˆ‘' i, βŸͺfβ‚‚ i, g i⟫ := tsum_add ?_ ?_ _ = _ := by congr Β· congr Β· exact summable_inner f₁ g Β· exact summable_inner fβ‚‚ g smul_left := fun f g c => by calc _ = βˆ‘' i, βŸͺc β€’ f i, g i⟫ := ?_ _ = βˆ‘' i, conj c * βŸͺf i, g i⟫ := by simp only [inner_smul_left] _ = conj c * βˆ‘' i, βŸͺf i, g i⟫ := tsum_mul_left _ = _ := ?_ Β· simp only [coeFn_smul, Pi.smul_apply] Β· congr } theorem inner_eq_tsum (f g : lp G 2) : βŸͺf, g⟫ = βˆ‘' i, βŸͺf i, g i⟫ := rfl #align lp.inner_eq_tsum lp.inner_eq_tsum theorem hasSum_inner (f g : lp G 2) : HasSum (fun i => βŸͺf i, g i⟫) βŸͺf, g⟫ := (summable_inner f g).hasSum #align lp.has_sum_inner lp.hasSum_inner
Mathlib/Analysis/InnerProductSpace/l2Space.lean
164
171
theorem inner_single_left (i : ΞΉ) (a : G i) (f : lp G 2) : βŸͺlp.single 2 i a, f⟫ = βŸͺa, f i⟫ := by
refine (hasSum_inner (lp.single 2 i a) f).unique ?_ convert hasSum_ite_eq i βŸͺa, f i⟫ using 1 ext j rw [lp.single_apply] split_ifs with h Β· subst h; rfl Β· simp
7
1,096.633158
2
1.333333
3
1,398
import Mathlib.Analysis.InnerProductSpace.Projection import Mathlib.Analysis.NormedSpace.lpSpace import Mathlib.Analysis.InnerProductSpace.PiL2 #align_import analysis.inner_product_space.l2_space from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5" open RCLike Submodule Filter open scoped NNReal ENNReal Classical ComplexConjugate Topology noncomputable section variable {ΞΉ π•œ : Type*} [RCLike π•œ] {E : Type*} variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] [cplt : CompleteSpace E] variable {G : ΞΉ β†’ Type*} [βˆ€ i, NormedAddCommGroup (G i)] [βˆ€ i, InnerProductSpace π•œ (G i)] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y notation "β„“Β²(" ΞΉ ", " π•œ ")" => lp (fun i : ΞΉ => π•œ) 2 namespace lp theorem summable_inner (f g : lp G 2) : Summable fun i => βŸͺf i, g i⟫ := by -- Apply the Direct Comparison Test, comparing with βˆ‘' i, β€–f iβ€– * β€–g iβ€– (summable by HΓΆlder) refine .of_norm_bounded (fun i => β€–f iβ€– * β€–g iβ€–) (lp.summable_mul ?_ f g) ?_ Β· rw [Real.isConjExponent_iff]; norm_num intro i -- Then apply Cauchy-Schwarz pointwise exact norm_inner_le_norm (π•œ := π•œ) _ _ #align lp.summable_inner lp.summable_inner instance instInnerProductSpace : InnerProductSpace π•œ (lp G 2) := { lp.normedAddCommGroup (E := G) (p := 2) with inner := fun f g => βˆ‘' i, βŸͺf i, g i⟫ norm_sq_eq_inner := fun f => by calc β€–fβ€– ^ 2 = β€–fβ€– ^ (2 : ℝβ‰₯0∞).toReal := by norm_cast _ = βˆ‘' i, β€–f iβ€– ^ (2 : ℝβ‰₯0∞).toReal := lp.norm_rpow_eq_tsum ?_ f _ = βˆ‘' i, β€–f iβ€– ^ (2 : β„•) := by norm_cast _ = βˆ‘' i, re βŸͺf i, f i⟫ := by congr funext i rw [norm_sq_eq_inner (π•œ := π•œ)] -- Porting note: `simp` couldn't do this anymore _ = re (βˆ‘' i, βŸͺf i, f i⟫) := (RCLike.reCLM.map_tsum ?_).symm Β· norm_num Β· exact summable_inner f f conj_symm := fun f g => by calc conj _ = conj (βˆ‘' i, βŸͺg i, f i⟫) := by congr _ = βˆ‘' i, conj βŸͺg i, f i⟫ := RCLike.conjCLE.map_tsum _ = βˆ‘' i, βŸͺf i, g i⟫ := by simp only [inner_conj_symm] _ = _ := by congr add_left := fun f₁ fβ‚‚ g => by calc _ = βˆ‘' i, βŸͺ(f₁ + fβ‚‚) i, g i⟫ := ?_ _ = βˆ‘' i, (βŸͺf₁ i, g i⟫ + βŸͺfβ‚‚ i, g i⟫) := by simp only [inner_add_left, Pi.add_apply, coeFn_add] _ = (βˆ‘' i, βŸͺf₁ i, g i⟫) + βˆ‘' i, βŸͺfβ‚‚ i, g i⟫ := tsum_add ?_ ?_ _ = _ := by congr Β· congr Β· exact summable_inner f₁ g Β· exact summable_inner fβ‚‚ g smul_left := fun f g c => by calc _ = βˆ‘' i, βŸͺc β€’ f i, g i⟫ := ?_ _ = βˆ‘' i, conj c * βŸͺf i, g i⟫ := by simp only [inner_smul_left] _ = conj c * βˆ‘' i, βŸͺf i, g i⟫ := tsum_mul_left _ = _ := ?_ Β· simp only [coeFn_smul, Pi.smul_apply] Β· congr } theorem inner_eq_tsum (f g : lp G 2) : βŸͺf, g⟫ = βˆ‘' i, βŸͺf i, g i⟫ := rfl #align lp.inner_eq_tsum lp.inner_eq_tsum theorem hasSum_inner (f g : lp G 2) : HasSum (fun i => βŸͺf i, g i⟫) βŸͺf, g⟫ := (summable_inner f g).hasSum #align lp.has_sum_inner lp.hasSum_inner theorem inner_single_left (i : ΞΉ) (a : G i) (f : lp G 2) : βŸͺlp.single 2 i a, f⟫ = βŸͺa, f i⟫ := by refine (hasSum_inner (lp.single 2 i a) f).unique ?_ convert hasSum_ite_eq i βŸͺa, f i⟫ using 1 ext j rw [lp.single_apply] split_ifs with h Β· subst h; rfl Β· simp #align lp.inner_single_left lp.inner_single_left
Mathlib/Analysis/InnerProductSpace/l2Space.lean
174
175
theorem inner_single_right (i : ΞΉ) (a : G i) (f : lp G 2) : βŸͺf, lp.single 2 i a⟫ = βŸͺf i, a⟫ := by
simpa [inner_conj_symm] using congr_arg conj (@inner_single_left _ π•œ _ _ _ _ i a f)
1
2.718282
0
1.333333
3
1,398
import Mathlib.Data.Int.AbsoluteValue import Mathlib.LinearAlgebra.Matrix.Determinant.Basic #align_import linear_algebra.matrix.absolute_value from "leanprover-community/mathlib"@"ab0a2959c83b06280ef576bc830d4aa5fe8c8e61" open Matrix namespace Matrix open Equiv Finset variable {R S : Type*} [CommRing R] [Nontrivial R] [LinearOrderedCommRing S] variable {n : Type*} [Fintype n] [DecidableEq n]
Mathlib/LinearAlgebra/Matrix/AbsoluteValue.lean
37
49
theorem det_le {A : Matrix n n R} {abv : AbsoluteValue R S} {x : S} (hx : βˆ€ i j, abv (A i j) ≀ x) : abv A.det ≀ Nat.factorial (Fintype.card n) β€’ x ^ Fintype.card n := calc abv A.det = abv (βˆ‘ Οƒ : Perm n, Perm.sign Οƒ β€’ ∏ i, A (Οƒ i) i) := congr_arg abv (det_apply _) _ ≀ βˆ‘ Οƒ : Perm n, abv (Perm.sign Οƒ β€’ ∏ i, A (Οƒ i) i) := abv.sum_le _ _ _ = βˆ‘ Οƒ : Perm n, ∏ i, abv (A (Οƒ i) i) := (sum_congr rfl fun Οƒ _ => by rw [abv.map_units_int_smul, abv.map_prod]) _ ≀ βˆ‘ _Οƒ : Perm n, ∏ _i : n, x := (sum_le_sum fun _ _ => prod_le_prod (fun _ _ => abv.nonneg _) fun _ _ => hx _ _) _ = βˆ‘ _Οƒ : Perm n, x ^ Fintype.card n := (sum_congr rfl fun _ _ => by rw [prod_const, Finset.card_univ]) _ = Nat.factorial (Fintype.card n) β€’ x ^ Fintype.card n := by
rw [sum_const, Finset.card_univ, Fintype.card_perm]
1
2.718282
0
1.333333
3
1,399
import Mathlib.Data.Int.AbsoluteValue import Mathlib.LinearAlgebra.Matrix.Determinant.Basic #align_import linear_algebra.matrix.absolute_value from "leanprover-community/mathlib"@"ab0a2959c83b06280ef576bc830d4aa5fe8c8e61" open Matrix namespace Matrix open Equiv Finset variable {R S : Type*} [CommRing R] [Nontrivial R] [LinearOrderedCommRing S] variable {n : Type*} [Fintype n] [DecidableEq n] theorem det_le {A : Matrix n n R} {abv : AbsoluteValue R S} {x : S} (hx : βˆ€ i j, abv (A i j) ≀ x) : abv A.det ≀ Nat.factorial (Fintype.card n) β€’ x ^ Fintype.card n := calc abv A.det = abv (βˆ‘ Οƒ : Perm n, Perm.sign Οƒ β€’ ∏ i, A (Οƒ i) i) := congr_arg abv (det_apply _) _ ≀ βˆ‘ Οƒ : Perm n, abv (Perm.sign Οƒ β€’ ∏ i, A (Οƒ i) i) := abv.sum_le _ _ _ = βˆ‘ Οƒ : Perm n, ∏ i, abv (A (Οƒ i) i) := (sum_congr rfl fun Οƒ _ => by rw [abv.map_units_int_smul, abv.map_prod]) _ ≀ βˆ‘ _Οƒ : Perm n, ∏ _i : n, x := (sum_le_sum fun _ _ => prod_le_prod (fun _ _ => abv.nonneg _) fun _ _ => hx _ _) _ = βˆ‘ _Οƒ : Perm n, x ^ Fintype.card n := (sum_congr rfl fun _ _ => by rw [prod_const, Finset.card_univ]) _ = Nat.factorial (Fintype.card n) β€’ x ^ Fintype.card n := by rw [sum_const, Finset.card_univ, Fintype.card_perm] #align matrix.det_le Matrix.det_le
Mathlib/LinearAlgebra/Matrix/AbsoluteValue.lean
52
61
theorem det_sum_le {ΞΉ : Type*} (s : Finset ΞΉ) {A : ΞΉ β†’ Matrix n n R} {abv : AbsoluteValue R S} {x : S} (hx : βˆ€ k i j, abv (A k i j) ≀ x) : abv (det (βˆ‘ k ∈ s, A k)) ≀ Nat.factorial (Fintype.card n) β€’ (Finset.card s β€’ x) ^ Fintype.card n := det_le fun i j => calc abv ((βˆ‘ k ∈ s, A k) i j) = abv (βˆ‘ k ∈ s, A k i j) := by
simp only [sum_apply] _ ≀ βˆ‘ k ∈ s, abv (A k i j) := abv.sum_le _ _ _ ≀ βˆ‘ _k ∈ s, x := sum_le_sum fun k _ => hx k i j _ = s.card β€’ x := sum_const _
4
54.59815
2
1.333333
3
1,399
import Mathlib.Data.Int.AbsoluteValue import Mathlib.LinearAlgebra.Matrix.Determinant.Basic #align_import linear_algebra.matrix.absolute_value from "leanprover-community/mathlib"@"ab0a2959c83b06280ef576bc830d4aa5fe8c8e61" open Matrix namespace Matrix open Equiv Finset variable {R S : Type*} [CommRing R] [Nontrivial R] [LinearOrderedCommRing S] variable {n : Type*} [Fintype n] [DecidableEq n] theorem det_le {A : Matrix n n R} {abv : AbsoluteValue R S} {x : S} (hx : βˆ€ i j, abv (A i j) ≀ x) : abv A.det ≀ Nat.factorial (Fintype.card n) β€’ x ^ Fintype.card n := calc abv A.det = abv (βˆ‘ Οƒ : Perm n, Perm.sign Οƒ β€’ ∏ i, A (Οƒ i) i) := congr_arg abv (det_apply _) _ ≀ βˆ‘ Οƒ : Perm n, abv (Perm.sign Οƒ β€’ ∏ i, A (Οƒ i) i) := abv.sum_le _ _ _ = βˆ‘ Οƒ : Perm n, ∏ i, abv (A (Οƒ i) i) := (sum_congr rfl fun Οƒ _ => by rw [abv.map_units_int_smul, abv.map_prod]) _ ≀ βˆ‘ _Οƒ : Perm n, ∏ _i : n, x := (sum_le_sum fun _ _ => prod_le_prod (fun _ _ => abv.nonneg _) fun _ _ => hx _ _) _ = βˆ‘ _Οƒ : Perm n, x ^ Fintype.card n := (sum_congr rfl fun _ _ => by rw [prod_const, Finset.card_univ]) _ = Nat.factorial (Fintype.card n) β€’ x ^ Fintype.card n := by rw [sum_const, Finset.card_univ, Fintype.card_perm] #align matrix.det_le Matrix.det_le theorem det_sum_le {ΞΉ : Type*} (s : Finset ΞΉ) {A : ΞΉ β†’ Matrix n n R} {abv : AbsoluteValue R S} {x : S} (hx : βˆ€ k i j, abv (A k i j) ≀ x) : abv (det (βˆ‘ k ∈ s, A k)) ≀ Nat.factorial (Fintype.card n) β€’ (Finset.card s β€’ x) ^ Fintype.card n := det_le fun i j => calc abv ((βˆ‘ k ∈ s, A k) i j) = abv (βˆ‘ k ∈ s, A k i j) := by simp only [sum_apply] _ ≀ βˆ‘ k ∈ s, abv (A k i j) := abv.sum_le _ _ _ ≀ βˆ‘ _k ∈ s, x := sum_le_sum fun k _ => hx k i j _ = s.card β€’ x := sum_const _ #align matrix.det_sum_le Matrix.det_sum_le
Mathlib/LinearAlgebra/Matrix/AbsoluteValue.lean
64
73
theorem det_sum_smul_le {ΞΉ : Type*} (s : Finset ΞΉ) {c : ΞΉ β†’ R} {A : ΞΉ β†’ Matrix n n R} {abv : AbsoluteValue R S} {x : S} (hx : βˆ€ k i j, abv (A k i j) ≀ x) {y : S} (hy : βˆ€ k, abv (c k) ≀ y) : abv (det (βˆ‘ k ∈ s, c k β€’ A k)) ≀ Nat.factorial (Fintype.card n) β€’ (Finset.card s β€’ y * x) ^ Fintype.card n := by
simpa only [smul_mul_assoc] using det_sum_le s fun k i j => calc abv (c k * A k i j) = abv (c k) * abv (A k i j) := abv.map_mul _ _ _ ≀ y * x := mul_le_mul (hy k) (hx k i j) (abv.nonneg _) ((abv.nonneg _).trans (hy k))
5
148.413159
2
1.333333
3
1,399
import Mathlib.RingTheory.Ideal.Operations import Mathlib.Algebra.Module.Torsion import Mathlib.Algebra.Ring.Idempotents import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.RingTheory.Ideal.LocalRing import Mathlib.RingTheory.Filtration import Mathlib.RingTheory.Nakayama #align_import ring_theory.ideal.cotangent from "leanprover-community/mathlib"@"4b92a463033b5587bb011657e25e4710bfca7364" namespace Ideal -- Porting note: universes need to be explicit to avoid bad universe levels in `quotCotangent` universe u v w variable {R : Type u} {S : Type v} {S' : Type w} [CommRing R] [CommSemiring S] [Algebra S R] variable [CommSemiring S'] [Algebra S' R] [Algebra S S'] [IsScalarTower S S' R] (I : Ideal R) -- Porting note: instances that were derived automatically need to be proved by hand (see below) def Cotangent : Type _ := I β§Έ (I β€’ ⊀ : Submodule R I) #align ideal.cotangent Ideal.Cotangent instance : AddCommGroup I.Cotangent := by delta Cotangent; infer_instance instance cotangentModule : Module (R β§Έ I) I.Cotangent := by delta Cotangent; infer_instance instance : Inhabited I.Cotangent := ⟨0⟩ instance Cotangent.moduleOfTower : Module S I.Cotangent := Submodule.Quotient.module' _ #align ideal.cotangent.module_of_tower Ideal.Cotangent.moduleOfTower instance Cotangent.isScalarTower : IsScalarTower S S' I.Cotangent := Submodule.Quotient.isScalarTower _ _ #align ideal.cotangent.is_scalar_tower Ideal.Cotangent.isScalarTower instance [IsNoetherian R I] : IsNoetherian R I.Cotangent := inferInstanceAs (IsNoetherian R (I β§Έ (I β€’ ⊀ : Submodule R I))) @[simps! (config := .lemmasOnly) apply] def toCotangent : I β†’β‚—[R] I.Cotangent := Submodule.mkQ _ #align ideal.to_cotangent Ideal.toCotangent
Mathlib/RingTheory/Ideal/Cotangent.lean
63
65
theorem map_toCotangent_ker : I.toCotangent.ker.map I.subtype = I ^ 2 := by
rw [Ideal.toCotangent, Submodule.ker_mkQ, pow_two, Submodule.map_smul'' I ⊀ (Submodule.subtype I), Algebra.id.smul_eq_mul, Submodule.map_subtype_top]
2
7.389056
1
1.333333
6
1,400
import Mathlib.RingTheory.Ideal.Operations import Mathlib.Algebra.Module.Torsion import Mathlib.Algebra.Ring.Idempotents import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.RingTheory.Ideal.LocalRing import Mathlib.RingTheory.Filtration import Mathlib.RingTheory.Nakayama #align_import ring_theory.ideal.cotangent from "leanprover-community/mathlib"@"4b92a463033b5587bb011657e25e4710bfca7364" namespace Ideal -- Porting note: universes need to be explicit to avoid bad universe levels in `quotCotangent` universe u v w variable {R : Type u} {S : Type v} {S' : Type w} [CommRing R] [CommSemiring S] [Algebra S R] variable [CommSemiring S'] [Algebra S' R] [Algebra S S'] [IsScalarTower S S' R] (I : Ideal R) -- Porting note: instances that were derived automatically need to be proved by hand (see below) def Cotangent : Type _ := I β§Έ (I β€’ ⊀ : Submodule R I) #align ideal.cotangent Ideal.Cotangent instance : AddCommGroup I.Cotangent := by delta Cotangent; infer_instance instance cotangentModule : Module (R β§Έ I) I.Cotangent := by delta Cotangent; infer_instance instance : Inhabited I.Cotangent := ⟨0⟩ instance Cotangent.moduleOfTower : Module S I.Cotangent := Submodule.Quotient.module' _ #align ideal.cotangent.module_of_tower Ideal.Cotangent.moduleOfTower instance Cotangent.isScalarTower : IsScalarTower S S' I.Cotangent := Submodule.Quotient.isScalarTower _ _ #align ideal.cotangent.is_scalar_tower Ideal.Cotangent.isScalarTower instance [IsNoetherian R I] : IsNoetherian R I.Cotangent := inferInstanceAs (IsNoetherian R (I β§Έ (I β€’ ⊀ : Submodule R I))) @[simps! (config := .lemmasOnly) apply] def toCotangent : I β†’β‚—[R] I.Cotangent := Submodule.mkQ _ #align ideal.to_cotangent Ideal.toCotangent theorem map_toCotangent_ker : I.toCotangent.ker.map I.subtype = I ^ 2 := by rw [Ideal.toCotangent, Submodule.ker_mkQ, pow_two, Submodule.map_smul'' I ⊀ (Submodule.subtype I), Algebra.id.smul_eq_mul, Submodule.map_subtype_top] #align ideal.map_to_cotangent_ker Ideal.map_toCotangent_ker
Mathlib/RingTheory/Ideal/Cotangent.lean
69
71
theorem mem_toCotangent_ker {x : I} : x ∈ LinearMap.ker I.toCotangent ↔ (x : R) ∈ I ^ 2 := by
rw [← I.map_toCotangent_ker] simp
2
7.389056
1
1.333333
6
1,400
import Mathlib.RingTheory.Ideal.Operations import Mathlib.Algebra.Module.Torsion import Mathlib.Algebra.Ring.Idempotents import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.RingTheory.Ideal.LocalRing import Mathlib.RingTheory.Filtration import Mathlib.RingTheory.Nakayama #align_import ring_theory.ideal.cotangent from "leanprover-community/mathlib"@"4b92a463033b5587bb011657e25e4710bfca7364" namespace Ideal -- Porting note: universes need to be explicit to avoid bad universe levels in `quotCotangent` universe u v w variable {R : Type u} {S : Type v} {S' : Type w} [CommRing R] [CommSemiring S] [Algebra S R] variable [CommSemiring S'] [Algebra S' R] [Algebra S S'] [IsScalarTower S S' R] (I : Ideal R) -- Porting note: instances that were derived automatically need to be proved by hand (see below) def Cotangent : Type _ := I β§Έ (I β€’ ⊀ : Submodule R I) #align ideal.cotangent Ideal.Cotangent instance : AddCommGroup I.Cotangent := by delta Cotangent; infer_instance instance cotangentModule : Module (R β§Έ I) I.Cotangent := by delta Cotangent; infer_instance instance : Inhabited I.Cotangent := ⟨0⟩ instance Cotangent.moduleOfTower : Module S I.Cotangent := Submodule.Quotient.module' _ #align ideal.cotangent.module_of_tower Ideal.Cotangent.moduleOfTower instance Cotangent.isScalarTower : IsScalarTower S S' I.Cotangent := Submodule.Quotient.isScalarTower _ _ #align ideal.cotangent.is_scalar_tower Ideal.Cotangent.isScalarTower instance [IsNoetherian R I] : IsNoetherian R I.Cotangent := inferInstanceAs (IsNoetherian R (I β§Έ (I β€’ ⊀ : Submodule R I))) @[simps! (config := .lemmasOnly) apply] def toCotangent : I β†’β‚—[R] I.Cotangent := Submodule.mkQ _ #align ideal.to_cotangent Ideal.toCotangent theorem map_toCotangent_ker : I.toCotangent.ker.map I.subtype = I ^ 2 := by rw [Ideal.toCotangent, Submodule.ker_mkQ, pow_two, Submodule.map_smul'' I ⊀ (Submodule.subtype I), Algebra.id.smul_eq_mul, Submodule.map_subtype_top] #align ideal.map_to_cotangent_ker Ideal.map_toCotangent_ker theorem mem_toCotangent_ker {x : I} : x ∈ LinearMap.ker I.toCotangent ↔ (x : R) ∈ I ^ 2 := by rw [← I.map_toCotangent_ker] simp #align ideal.mem_to_cotangent_ker Ideal.mem_toCotangent_ker
Mathlib/RingTheory/Ideal/Cotangent.lean
74
76
theorem toCotangent_eq {x y : I} : I.toCotangent x = I.toCotangent y ↔ (x - y : R) ∈ I ^ 2 := by
rw [← sub_eq_zero] exact I.mem_toCotangent_ker
2
7.389056
1
1.333333
6
1,400
import Mathlib.RingTheory.Ideal.Operations import Mathlib.Algebra.Module.Torsion import Mathlib.Algebra.Ring.Idempotents import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.RingTheory.Ideal.LocalRing import Mathlib.RingTheory.Filtration import Mathlib.RingTheory.Nakayama #align_import ring_theory.ideal.cotangent from "leanprover-community/mathlib"@"4b92a463033b5587bb011657e25e4710bfca7364" namespace Ideal -- Porting note: universes need to be explicit to avoid bad universe levels in `quotCotangent` universe u v w variable {R : Type u} {S : Type v} {S' : Type w} [CommRing R] [CommSemiring S] [Algebra S R] variable [CommSemiring S'] [Algebra S' R] [Algebra S S'] [IsScalarTower S S' R] (I : Ideal R) -- Porting note: instances that were derived automatically need to be proved by hand (see below) def Cotangent : Type _ := I β§Έ (I β€’ ⊀ : Submodule R I) #align ideal.cotangent Ideal.Cotangent instance : AddCommGroup I.Cotangent := by delta Cotangent; infer_instance instance cotangentModule : Module (R β§Έ I) I.Cotangent := by delta Cotangent; infer_instance instance : Inhabited I.Cotangent := ⟨0⟩ instance Cotangent.moduleOfTower : Module S I.Cotangent := Submodule.Quotient.module' _ #align ideal.cotangent.module_of_tower Ideal.Cotangent.moduleOfTower instance Cotangent.isScalarTower : IsScalarTower S S' I.Cotangent := Submodule.Quotient.isScalarTower _ _ #align ideal.cotangent.is_scalar_tower Ideal.Cotangent.isScalarTower instance [IsNoetherian R I] : IsNoetherian R I.Cotangent := inferInstanceAs (IsNoetherian R (I β§Έ (I β€’ ⊀ : Submodule R I))) @[simps! (config := .lemmasOnly) apply] def toCotangent : I β†’β‚—[R] I.Cotangent := Submodule.mkQ _ #align ideal.to_cotangent Ideal.toCotangent theorem map_toCotangent_ker : I.toCotangent.ker.map I.subtype = I ^ 2 := by rw [Ideal.toCotangent, Submodule.ker_mkQ, pow_two, Submodule.map_smul'' I ⊀ (Submodule.subtype I), Algebra.id.smul_eq_mul, Submodule.map_subtype_top] #align ideal.map_to_cotangent_ker Ideal.map_toCotangent_ker theorem mem_toCotangent_ker {x : I} : x ∈ LinearMap.ker I.toCotangent ↔ (x : R) ∈ I ^ 2 := by rw [← I.map_toCotangent_ker] simp #align ideal.mem_to_cotangent_ker Ideal.mem_toCotangent_ker theorem toCotangent_eq {x y : I} : I.toCotangent x = I.toCotangent y ↔ (x - y : R) ∈ I ^ 2 := by rw [← sub_eq_zero] exact I.mem_toCotangent_ker #align ideal.to_cotangent_eq Ideal.toCotangent_eq theorem toCotangent_eq_zero (x : I) : I.toCotangent x = 0 ↔ (x : R) ∈ I ^ 2 := I.mem_toCotangent_ker #align ideal.to_cotangent_eq_zero Ideal.toCotangent_eq_zero theorem toCotangent_surjective : Function.Surjective I.toCotangent := Submodule.mkQ_surjective _ #align ideal.to_cotangent_surjective Ideal.toCotangent_surjective theorem toCotangent_range : LinearMap.range I.toCotangent = ⊀ := Submodule.range_mkQ _ #align ideal.to_cotangent_range Ideal.toCotangent_range
Mathlib/RingTheory/Ideal/Cotangent.lean
88
96
theorem cotangent_subsingleton_iff : Subsingleton I.Cotangent ↔ IsIdempotentElem I := by
constructor Β· intro H refine (pow_two I).symm.trans (le_antisymm (Ideal.pow_le_self two_ne_zero) ?_) exact fun x hx => (I.toCotangent_eq_zero ⟨x, hx⟩).mp (Subsingleton.elim _ _) Β· exact fun e => ⟨fun x y => Quotient.inductionOnβ‚‚' x y fun x y => I.toCotangent_eq.mpr <| ((pow_two I).trans e).symm β–Έ I.sub_mem x.prop y.prop⟩
8
2,980.957987
2
1.333333
6
1,400
import Mathlib.RingTheory.Ideal.Operations import Mathlib.Algebra.Module.Torsion import Mathlib.Algebra.Ring.Idempotents import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.RingTheory.Ideal.LocalRing import Mathlib.RingTheory.Filtration import Mathlib.RingTheory.Nakayama #align_import ring_theory.ideal.cotangent from "leanprover-community/mathlib"@"4b92a463033b5587bb011657e25e4710bfca7364" namespace Ideal -- Porting note: universes need to be explicit to avoid bad universe levels in `quotCotangent` universe u v w variable {R : Type u} {S : Type v} {S' : Type w} [CommRing R] [CommSemiring S] [Algebra S R] variable [CommSemiring S'] [Algebra S' R] [Algebra S S'] [IsScalarTower S S' R] (I : Ideal R) -- Porting note: instances that were derived automatically need to be proved by hand (see below) def Cotangent : Type _ := I β§Έ (I β€’ ⊀ : Submodule R I) #align ideal.cotangent Ideal.Cotangent instance : AddCommGroup I.Cotangent := by delta Cotangent; infer_instance instance cotangentModule : Module (R β§Έ I) I.Cotangent := by delta Cotangent; infer_instance instance : Inhabited I.Cotangent := ⟨0⟩ instance Cotangent.moduleOfTower : Module S I.Cotangent := Submodule.Quotient.module' _ #align ideal.cotangent.module_of_tower Ideal.Cotangent.moduleOfTower instance Cotangent.isScalarTower : IsScalarTower S S' I.Cotangent := Submodule.Quotient.isScalarTower _ _ #align ideal.cotangent.is_scalar_tower Ideal.Cotangent.isScalarTower instance [IsNoetherian R I] : IsNoetherian R I.Cotangent := inferInstanceAs (IsNoetherian R (I β§Έ (I β€’ ⊀ : Submodule R I))) @[simps! (config := .lemmasOnly) apply] def toCotangent : I β†’β‚—[R] I.Cotangent := Submodule.mkQ _ #align ideal.to_cotangent Ideal.toCotangent theorem map_toCotangent_ker : I.toCotangent.ker.map I.subtype = I ^ 2 := by rw [Ideal.toCotangent, Submodule.ker_mkQ, pow_two, Submodule.map_smul'' I ⊀ (Submodule.subtype I), Algebra.id.smul_eq_mul, Submodule.map_subtype_top] #align ideal.map_to_cotangent_ker Ideal.map_toCotangent_ker theorem mem_toCotangent_ker {x : I} : x ∈ LinearMap.ker I.toCotangent ↔ (x : R) ∈ I ^ 2 := by rw [← I.map_toCotangent_ker] simp #align ideal.mem_to_cotangent_ker Ideal.mem_toCotangent_ker theorem toCotangent_eq {x y : I} : I.toCotangent x = I.toCotangent y ↔ (x - y : R) ∈ I ^ 2 := by rw [← sub_eq_zero] exact I.mem_toCotangent_ker #align ideal.to_cotangent_eq Ideal.toCotangent_eq theorem toCotangent_eq_zero (x : I) : I.toCotangent x = 0 ↔ (x : R) ∈ I ^ 2 := I.mem_toCotangent_ker #align ideal.to_cotangent_eq_zero Ideal.toCotangent_eq_zero theorem toCotangent_surjective : Function.Surjective I.toCotangent := Submodule.mkQ_surjective _ #align ideal.to_cotangent_surjective Ideal.toCotangent_surjective theorem toCotangent_range : LinearMap.range I.toCotangent = ⊀ := Submodule.range_mkQ _ #align ideal.to_cotangent_range Ideal.toCotangent_range theorem cotangent_subsingleton_iff : Subsingleton I.Cotangent ↔ IsIdempotentElem I := by constructor Β· intro H refine (pow_two I).symm.trans (le_antisymm (Ideal.pow_le_self two_ne_zero) ?_) exact fun x hx => (I.toCotangent_eq_zero ⟨x, hx⟩).mp (Subsingleton.elim _ _) Β· exact fun e => ⟨fun x y => Quotient.inductionOnβ‚‚' x y fun x y => I.toCotangent_eq.mpr <| ((pow_two I).trans e).symm β–Έ I.sub_mem x.prop y.prop⟩ #align ideal.cotangent_subsingleton_iff Ideal.cotangent_subsingleton_iff def cotangentToQuotientSquare : I.Cotangent β†’β‚—[R] R β§Έ I ^ 2 := Submodule.mapQ (I β€’ ⊀) (I ^ 2) I.subtype (by rw [← Submodule.map_le_iff_le_comap, Submodule.map_smul'', Submodule.map_top, Submodule.range_subtype, smul_eq_mul, pow_two] ) #align ideal.cotangent_to_quotient_square Ideal.cotangentToQuotientSquare theorem to_quotient_square_comp_toCotangent : I.cotangentToQuotientSquare.comp I.toCotangent = (I ^ 2).mkQ.comp (Submodule.subtype I) := LinearMap.ext fun _ => rfl #align ideal.to_quotient_square_comp_to_cotangent Ideal.to_quotient_square_comp_toCotangent @[simp] theorem toCotangent_to_quotient_square (x : I) : I.cotangentToQuotientSquare (I.toCotangent x) = (I ^ 2).mkQ x := rfl #align ideal.to_cotangent_to_quotient_square Ideal.toCotangent_to_quotient_square def cotangentIdeal (I : Ideal R) : Ideal (R β§Έ I ^ 2) := Submodule.map (Quotient.mk (I ^ 2)|>.toSemilinearMap) I #align ideal.cotangent_ideal Ideal.cotangentIdeal
Mathlib/RingTheory/Ideal/Cotangent.lean
122
128
theorem cotangentIdeal_square (I : Ideal R) : I.cotangentIdeal ^ 2 = βŠ₯ := by
rw [eq_bot_iff, pow_two I.cotangentIdeal, ← smul_eq_mul] intro x hx refine Submodule.smul_induction_on hx ?_ ?_ Β· rintro _ ⟨x, hx, rfl⟩ _ ⟨y, hy, rfl⟩; apply (Submodule.Quotient.eq _).mpr _ rw [sub_zero, pow_two]; exact Ideal.mul_mem_mul hx hy Β· intro x y hx hy; exact add_mem hx hy
6
403.428793
2
1.333333
6
1,400
import Mathlib.RingTheory.Ideal.Operations import Mathlib.Algebra.Module.Torsion import Mathlib.Algebra.Ring.Idempotents import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.RingTheory.Ideal.LocalRing import Mathlib.RingTheory.Filtration import Mathlib.RingTheory.Nakayama #align_import ring_theory.ideal.cotangent from "leanprover-community/mathlib"@"4b92a463033b5587bb011657e25e4710bfca7364" namespace Ideal -- Porting note: universes need to be explicit to avoid bad universe levels in `quotCotangent` universe u v w variable {R : Type u} {S : Type v} {S' : Type w} [CommRing R] [CommSemiring S] [Algebra S R] variable [CommSemiring S'] [Algebra S' R] [Algebra S S'] [IsScalarTower S S' R] (I : Ideal R) -- Porting note: instances that were derived automatically need to be proved by hand (see below) def Cotangent : Type _ := I β§Έ (I β€’ ⊀ : Submodule R I) #align ideal.cotangent Ideal.Cotangent instance : AddCommGroup I.Cotangent := by delta Cotangent; infer_instance instance cotangentModule : Module (R β§Έ I) I.Cotangent := by delta Cotangent; infer_instance instance : Inhabited I.Cotangent := ⟨0⟩ instance Cotangent.moduleOfTower : Module S I.Cotangent := Submodule.Quotient.module' _ #align ideal.cotangent.module_of_tower Ideal.Cotangent.moduleOfTower instance Cotangent.isScalarTower : IsScalarTower S S' I.Cotangent := Submodule.Quotient.isScalarTower _ _ #align ideal.cotangent.is_scalar_tower Ideal.Cotangent.isScalarTower instance [IsNoetherian R I] : IsNoetherian R I.Cotangent := inferInstanceAs (IsNoetherian R (I β§Έ (I β€’ ⊀ : Submodule R I))) @[simps! (config := .lemmasOnly) apply] def toCotangent : I β†’β‚—[R] I.Cotangent := Submodule.mkQ _ #align ideal.to_cotangent Ideal.toCotangent theorem map_toCotangent_ker : I.toCotangent.ker.map I.subtype = I ^ 2 := by rw [Ideal.toCotangent, Submodule.ker_mkQ, pow_two, Submodule.map_smul'' I ⊀ (Submodule.subtype I), Algebra.id.smul_eq_mul, Submodule.map_subtype_top] #align ideal.map_to_cotangent_ker Ideal.map_toCotangent_ker theorem mem_toCotangent_ker {x : I} : x ∈ LinearMap.ker I.toCotangent ↔ (x : R) ∈ I ^ 2 := by rw [← I.map_toCotangent_ker] simp #align ideal.mem_to_cotangent_ker Ideal.mem_toCotangent_ker theorem toCotangent_eq {x y : I} : I.toCotangent x = I.toCotangent y ↔ (x - y : R) ∈ I ^ 2 := by rw [← sub_eq_zero] exact I.mem_toCotangent_ker #align ideal.to_cotangent_eq Ideal.toCotangent_eq theorem toCotangent_eq_zero (x : I) : I.toCotangent x = 0 ↔ (x : R) ∈ I ^ 2 := I.mem_toCotangent_ker #align ideal.to_cotangent_eq_zero Ideal.toCotangent_eq_zero theorem toCotangent_surjective : Function.Surjective I.toCotangent := Submodule.mkQ_surjective _ #align ideal.to_cotangent_surjective Ideal.toCotangent_surjective theorem toCotangent_range : LinearMap.range I.toCotangent = ⊀ := Submodule.range_mkQ _ #align ideal.to_cotangent_range Ideal.toCotangent_range theorem cotangent_subsingleton_iff : Subsingleton I.Cotangent ↔ IsIdempotentElem I := by constructor Β· intro H refine (pow_two I).symm.trans (le_antisymm (Ideal.pow_le_self two_ne_zero) ?_) exact fun x hx => (I.toCotangent_eq_zero ⟨x, hx⟩).mp (Subsingleton.elim _ _) Β· exact fun e => ⟨fun x y => Quotient.inductionOnβ‚‚' x y fun x y => I.toCotangent_eq.mpr <| ((pow_two I).trans e).symm β–Έ I.sub_mem x.prop y.prop⟩ #align ideal.cotangent_subsingleton_iff Ideal.cotangent_subsingleton_iff def cotangentToQuotientSquare : I.Cotangent β†’β‚—[R] R β§Έ I ^ 2 := Submodule.mapQ (I β€’ ⊀) (I ^ 2) I.subtype (by rw [← Submodule.map_le_iff_le_comap, Submodule.map_smul'', Submodule.map_top, Submodule.range_subtype, smul_eq_mul, pow_two] ) #align ideal.cotangent_to_quotient_square Ideal.cotangentToQuotientSquare theorem to_quotient_square_comp_toCotangent : I.cotangentToQuotientSquare.comp I.toCotangent = (I ^ 2).mkQ.comp (Submodule.subtype I) := LinearMap.ext fun _ => rfl #align ideal.to_quotient_square_comp_to_cotangent Ideal.to_quotient_square_comp_toCotangent @[simp] theorem toCotangent_to_quotient_square (x : I) : I.cotangentToQuotientSquare (I.toCotangent x) = (I ^ 2).mkQ x := rfl #align ideal.to_cotangent_to_quotient_square Ideal.toCotangent_to_quotient_square def cotangentIdeal (I : Ideal R) : Ideal (R β§Έ I ^ 2) := Submodule.map (Quotient.mk (I ^ 2)|>.toSemilinearMap) I #align ideal.cotangent_ideal Ideal.cotangentIdeal theorem cotangentIdeal_square (I : Ideal R) : I.cotangentIdeal ^ 2 = βŠ₯ := by rw [eq_bot_iff, pow_two I.cotangentIdeal, ← smul_eq_mul] intro x hx refine Submodule.smul_induction_on hx ?_ ?_ Β· rintro _ ⟨x, hx, rfl⟩ _ ⟨y, hy, rfl⟩; apply (Submodule.Quotient.eq _).mpr _ rw [sub_zero, pow_two]; exact Ideal.mul_mem_mul hx hy Β· intro x y hx hy; exact add_mem hx hy #align ideal.cotangent_ideal_square Ideal.cotangentIdeal_square set_option backward.synthInstance.canonInstances false in -- See https://github.com/leanprover-community/mathlib4/issues/12532
Mathlib/RingTheory/Ideal/Cotangent.lean
132
136
theorem to_quotient_square_range : LinearMap.range I.cotangentToQuotientSquare = I.cotangentIdeal.restrictScalars R := by
trans LinearMap.range (I.cotangentToQuotientSquare.comp I.toCotangent) Β· rw [LinearMap.range_comp, I.toCotangent_range, Submodule.map_top] Β· rw [to_quotient_square_comp_toCotangent, LinearMap.range_comp, I.range_subtype]; ext; rfl
3
20.085537
1
1.333333
6
1,400
import Mathlib.Data.Stream.Init import Mathlib.Tactic.Common #align_import data.seq.computation from "leanprover-community/mathlib"@"1f0096e6caa61e9c849ec2adbd227e960e9dff58" open Function universe u v w def Computation (Ξ± : Type u) : Type u := { f : Stream' (Option Ξ±) // βˆ€ ⦃n a⦄, f n = some a β†’ f (n + 1) = some a } #align computation Computation namespace Computation variable {Ξ± : Type u} {Ξ² : Type v} {Ξ³ : Type w} -- constructors -- Porting note: `return` is reserved, so changed to `pure` def pure (a : Ξ±) : Computation Ξ± := ⟨Stream'.const (some a), fun _ _ => id⟩ #align computation.return Computation.pure instance : CoeTC Ξ± (Computation Ξ±) := ⟨pure⟩ -- note [use has_coe_t] def think (c : Computation Ξ±) : Computation Ξ± := ⟨Stream'.cons none c.1, fun n a h => by cases' n with n Β· contradiction Β· exact c.2 h⟩ #align computation.think Computation.think def thinkN (c : Computation Ξ±) : β„• β†’ Computation Ξ± | 0 => c | n + 1 => think (thinkN c n) set_option linter.uppercaseLean3 false in #align computation.thinkN Computation.thinkN -- check for immediate result def head (c : Computation Ξ±) : Option Ξ± := c.1.head #align computation.head Computation.head -- one step of computation def tail (c : Computation Ξ±) : Computation Ξ± := ⟨c.1.tail, fun _ _ h => c.2 h⟩ #align computation.tail Computation.tail def empty (Ξ±) : Computation Ξ± := ⟨Stream'.const none, fun _ _ => id⟩ #align computation.empty Computation.empty instance : Inhabited (Computation Ξ±) := ⟨empty _⟩ def runFor : Computation Ξ± β†’ β„• β†’ Option Ξ± := Subtype.val #align computation.run_for Computation.runFor def destruct (c : Computation Ξ±) : Sum Ξ± (Computation Ξ±) := match c.1 0 with | none => Sum.inr (tail c) | some a => Sum.inl a #align computation.destruct Computation.destruct unsafe def run : Computation Ξ± β†’ Ξ± | c => match destruct c with | Sum.inl a => a | Sum.inr ca => run ca #align computation.run Computation.run
Mathlib/Data/Seq/Computation.lean
114
123
theorem destruct_eq_pure {s : Computation Ξ±} {a : Ξ±} : destruct s = Sum.inl a β†’ s = pure a := by
dsimp [destruct] induction' f0 : s.1 0 with _ <;> intro h Β· contradiction Β· apply Subtype.eq funext n induction' n with n IH Β· injection h with h' rwa [h'] at f0 Β· exact s.2 IH
9
8,103.083928
2
1.333333
3
1,401
import Mathlib.Data.Stream.Init import Mathlib.Tactic.Common #align_import data.seq.computation from "leanprover-community/mathlib"@"1f0096e6caa61e9c849ec2adbd227e960e9dff58" open Function universe u v w def Computation (Ξ± : Type u) : Type u := { f : Stream' (Option Ξ±) // βˆ€ ⦃n a⦄, f n = some a β†’ f (n + 1) = some a } #align computation Computation namespace Computation variable {Ξ± : Type u} {Ξ² : Type v} {Ξ³ : Type w} -- constructors -- Porting note: `return` is reserved, so changed to `pure` def pure (a : Ξ±) : Computation Ξ± := ⟨Stream'.const (some a), fun _ _ => id⟩ #align computation.return Computation.pure instance : CoeTC Ξ± (Computation Ξ±) := ⟨pure⟩ -- note [use has_coe_t] def think (c : Computation Ξ±) : Computation Ξ± := ⟨Stream'.cons none c.1, fun n a h => by cases' n with n Β· contradiction Β· exact c.2 h⟩ #align computation.think Computation.think def thinkN (c : Computation Ξ±) : β„• β†’ Computation Ξ± | 0 => c | n + 1 => think (thinkN c n) set_option linter.uppercaseLean3 false in #align computation.thinkN Computation.thinkN -- check for immediate result def head (c : Computation Ξ±) : Option Ξ± := c.1.head #align computation.head Computation.head -- one step of computation def tail (c : Computation Ξ±) : Computation Ξ± := ⟨c.1.tail, fun _ _ h => c.2 h⟩ #align computation.tail Computation.tail def empty (Ξ±) : Computation Ξ± := ⟨Stream'.const none, fun _ _ => id⟩ #align computation.empty Computation.empty instance : Inhabited (Computation Ξ±) := ⟨empty _⟩ def runFor : Computation Ξ± β†’ β„• β†’ Option Ξ± := Subtype.val #align computation.run_for Computation.runFor def destruct (c : Computation Ξ±) : Sum Ξ± (Computation Ξ±) := match c.1 0 with | none => Sum.inr (tail c) | some a => Sum.inl a #align computation.destruct Computation.destruct unsafe def run : Computation Ξ± β†’ Ξ± | c => match destruct c with | Sum.inl a => a | Sum.inr ca => run ca #align computation.run Computation.run theorem destruct_eq_pure {s : Computation Ξ±} {a : Ξ±} : destruct s = Sum.inl a β†’ s = pure a := by dsimp [destruct] induction' f0 : s.1 0 with _ <;> intro h Β· contradiction Β· apply Subtype.eq funext n induction' n with n IH Β· injection h with h' rwa [h'] at f0 Β· exact s.2 IH #align computation.destruct_eq_ret Computation.destruct_eq_pure
Mathlib/Data/Seq/Computation.lean
126
136
theorem destruct_eq_think {s : Computation Ξ±} {s'} : destruct s = Sum.inr s' β†’ s = think s' := by
dsimp [destruct] induction' f0 : s.1 0 with a' <;> intro h Β· injection h with h' rw [← h'] cases' s with f al apply Subtype.eq dsimp [think, tail] rw [← f0] exact (Stream'.eta f).symm Β· contradiction
10
22,026.465795
2
1.333333
3
1,401
import Mathlib.Data.Stream.Init import Mathlib.Tactic.Common #align_import data.seq.computation from "leanprover-community/mathlib"@"1f0096e6caa61e9c849ec2adbd227e960e9dff58" open Function universe u v w def Computation (Ξ± : Type u) : Type u := { f : Stream' (Option Ξ±) // βˆ€ ⦃n a⦄, f n = some a β†’ f (n + 1) = some a } #align computation Computation namespace Computation variable {Ξ± : Type u} {Ξ² : Type v} {Ξ³ : Type w} -- constructors -- Porting note: `return` is reserved, so changed to `pure` def pure (a : Ξ±) : Computation Ξ± := ⟨Stream'.const (some a), fun _ _ => id⟩ #align computation.return Computation.pure instance : CoeTC Ξ± (Computation Ξ±) := ⟨pure⟩ -- note [use has_coe_t] def think (c : Computation Ξ±) : Computation Ξ± := ⟨Stream'.cons none c.1, fun n a h => by cases' n with n Β· contradiction Β· exact c.2 h⟩ #align computation.think Computation.think def thinkN (c : Computation Ξ±) : β„• β†’ Computation Ξ± | 0 => c | n + 1 => think (thinkN c n) set_option linter.uppercaseLean3 false in #align computation.thinkN Computation.thinkN -- check for immediate result def head (c : Computation Ξ±) : Option Ξ± := c.1.head #align computation.head Computation.head -- one step of computation def tail (c : Computation Ξ±) : Computation Ξ± := ⟨c.1.tail, fun _ _ h => c.2 h⟩ #align computation.tail Computation.tail def empty (Ξ±) : Computation Ξ± := ⟨Stream'.const none, fun _ _ => id⟩ #align computation.empty Computation.empty instance : Inhabited (Computation Ξ±) := ⟨empty _⟩ def runFor : Computation Ξ± β†’ β„• β†’ Option Ξ± := Subtype.val #align computation.run_for Computation.runFor def destruct (c : Computation Ξ±) : Sum Ξ± (Computation Ξ±) := match c.1 0 with | none => Sum.inr (tail c) | some a => Sum.inl a #align computation.destruct Computation.destruct unsafe def run : Computation Ξ± β†’ Ξ± | c => match destruct c with | Sum.inl a => a | Sum.inr ca => run ca #align computation.run Computation.run theorem destruct_eq_pure {s : Computation Ξ±} {a : Ξ±} : destruct s = Sum.inl a β†’ s = pure a := by dsimp [destruct] induction' f0 : s.1 0 with _ <;> intro h Β· contradiction Β· apply Subtype.eq funext n induction' n with n IH Β· injection h with h' rwa [h'] at f0 Β· exact s.2 IH #align computation.destruct_eq_ret Computation.destruct_eq_pure theorem destruct_eq_think {s : Computation Ξ±} {s'} : destruct s = Sum.inr s' β†’ s = think s' := by dsimp [destruct] induction' f0 : s.1 0 with a' <;> intro h Β· injection h with h' rw [← h'] cases' s with f al apply Subtype.eq dsimp [think, tail] rw [← f0] exact (Stream'.eta f).symm Β· contradiction #align computation.destruct_eq_think Computation.destruct_eq_think @[simp] theorem destruct_pure (a : Ξ±) : destruct (pure a) = Sum.inl a := rfl #align computation.destruct_ret Computation.destruct_pure @[simp] theorem destruct_think : βˆ€ s : Computation Ξ±, destruct (think s) = Sum.inr s | ⟨_, _⟩ => rfl #align computation.destruct_think Computation.destruct_think @[simp] theorem destruct_empty : destruct (empty Ξ±) = Sum.inr (empty Ξ±) := rfl #align computation.destruct_empty Computation.destruct_empty @[simp] theorem head_pure (a : Ξ±) : head (pure a) = some a := rfl #align computation.head_ret Computation.head_pure @[simp] theorem head_think (s : Computation Ξ±) : head (think s) = none := rfl #align computation.head_think Computation.head_think @[simp] theorem head_empty : head (empty Ξ±) = none := rfl #align computation.head_empty Computation.head_empty @[simp] theorem tail_pure (a : Ξ±) : tail (pure a) = pure a := rfl #align computation.tail_ret Computation.tail_pure @[simp]
Mathlib/Data/Seq/Computation.lean
175
176
theorem tail_think (s : Computation Ξ±) : tail (think s) = s := by
cases' s with f al; apply Subtype.eq; dsimp [tail, think]
1
2.718282
0
1.333333
3
1,401
import Mathlib.Combinatorics.SimpleGraph.Coloring #align_import combinatorics.simple_graph.partition from "leanprover-community/mathlib"@"2303b3e299f1c75b07bceaaac130ce23044d1386" universe u v namespace SimpleGraph variable {V : Type u} (G : SimpleGraph V) structure Partition where parts : Set (Set V) isPartition : Setoid.IsPartition parts independent : βˆ€ s ∈ parts, IsAntichain G.Adj s #align simple_graph.partition SimpleGraph.Partition def Partition.PartsCardLe {G : SimpleGraph V} (P : G.Partition) (n : β„•) : Prop := βˆƒ h : P.parts.Finite, h.toFinset.card ≀ n #align simple_graph.partition.parts_card_le SimpleGraph.Partition.PartsCardLe def Partitionable (n : β„•) : Prop := βˆƒ P : G.Partition, P.PartsCardLe n #align simple_graph.partitionable SimpleGraph.Partitionable namespace Partition variable {G} (P : G.Partition) def partOfVertex (v : V) : Set V := Classical.choose (P.isPartition.2 v) #align simple_graph.partition.part_of_vertex SimpleGraph.Partition.partOfVertex
Mathlib/Combinatorics/SimpleGraph/Partition.lean
88
90
theorem partOfVertex_mem (v : V) : P.partOfVertex v ∈ P.parts := by
obtain ⟨h, -⟩ := (P.isPartition.2 v).choose_spec.1 exact h
2
7.389056
1
1.333333
3
1,402
import Mathlib.Combinatorics.SimpleGraph.Coloring #align_import combinatorics.simple_graph.partition from "leanprover-community/mathlib"@"2303b3e299f1c75b07bceaaac130ce23044d1386" universe u v namespace SimpleGraph variable {V : Type u} (G : SimpleGraph V) structure Partition where parts : Set (Set V) isPartition : Setoid.IsPartition parts independent : βˆ€ s ∈ parts, IsAntichain G.Adj s #align simple_graph.partition SimpleGraph.Partition def Partition.PartsCardLe {G : SimpleGraph V} (P : G.Partition) (n : β„•) : Prop := βˆƒ h : P.parts.Finite, h.toFinset.card ≀ n #align simple_graph.partition.parts_card_le SimpleGraph.Partition.PartsCardLe def Partitionable (n : β„•) : Prop := βˆƒ P : G.Partition, P.PartsCardLe n #align simple_graph.partitionable SimpleGraph.Partitionable namespace Partition variable {G} (P : G.Partition) def partOfVertex (v : V) : Set V := Classical.choose (P.isPartition.2 v) #align simple_graph.partition.part_of_vertex SimpleGraph.Partition.partOfVertex theorem partOfVertex_mem (v : V) : P.partOfVertex v ∈ P.parts := by obtain ⟨h, -⟩ := (P.isPartition.2 v).choose_spec.1 exact h #align simple_graph.partition.part_of_vertex_mem SimpleGraph.Partition.partOfVertex_mem
Mathlib/Combinatorics/SimpleGraph/Partition.lean
93
95
theorem mem_partOfVertex (v : V) : v ∈ P.partOfVertex v := by
obtain ⟨⟨_, h⟩, _⟩ := (P.isPartition.2 v).choose_spec exact h
2
7.389056
1
1.333333
3
1,402
import Mathlib.Combinatorics.SimpleGraph.Coloring #align_import combinatorics.simple_graph.partition from "leanprover-community/mathlib"@"2303b3e299f1c75b07bceaaac130ce23044d1386" universe u v namespace SimpleGraph variable {V : Type u} (G : SimpleGraph V) structure Partition where parts : Set (Set V) isPartition : Setoid.IsPartition parts independent : βˆ€ s ∈ parts, IsAntichain G.Adj s #align simple_graph.partition SimpleGraph.Partition def Partition.PartsCardLe {G : SimpleGraph V} (P : G.Partition) (n : β„•) : Prop := βˆƒ h : P.parts.Finite, h.toFinset.card ≀ n #align simple_graph.partition.parts_card_le SimpleGraph.Partition.PartsCardLe def Partitionable (n : β„•) : Prop := βˆƒ P : G.Partition, P.PartsCardLe n #align simple_graph.partitionable SimpleGraph.Partitionable namespace Partition variable {G} (P : G.Partition) def partOfVertex (v : V) : Set V := Classical.choose (P.isPartition.2 v) #align simple_graph.partition.part_of_vertex SimpleGraph.Partition.partOfVertex theorem partOfVertex_mem (v : V) : P.partOfVertex v ∈ P.parts := by obtain ⟨h, -⟩ := (P.isPartition.2 v).choose_spec.1 exact h #align simple_graph.partition.part_of_vertex_mem SimpleGraph.Partition.partOfVertex_mem theorem mem_partOfVertex (v : V) : v ∈ P.partOfVertex v := by obtain ⟨⟨_, h⟩, _⟩ := (P.isPartition.2 v).choose_spec exact h #align simple_graph.partition.mem_part_of_vertex SimpleGraph.Partition.mem_partOfVertex
Mathlib/Combinatorics/SimpleGraph/Partition.lean
98
102
theorem partOfVertex_ne_of_adj {v w : V} (h : G.Adj v w) : P.partOfVertex v β‰  P.partOfVertex w := by
intro hn have hw := P.mem_partOfVertex w rw [← hn] at hw exact P.independent _ (P.partOfVertex_mem v) (P.mem_partOfVertex v) hw (G.ne_of_adj h) h
4
54.59815
2
1.333333
3
1,402
import Mathlib.Topology.UniformSpace.UniformEmbedding import Mathlib.Topology.UniformSpace.Equiv #align_import topology.uniform_space.abstract_completion from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988" noncomputable section attribute [local instance] Classical.propDecidable open Filter Set Function universe u structure AbstractCompletion (Ξ± : Type u) [UniformSpace Ξ±] where space : Type u coe : Ξ± β†’ space uniformStruct : UniformSpace space complete : CompleteSpace space separation : T0Space space uniformInducing : UniformInducing coe dense : DenseRange coe #align abstract_completion AbstractCompletion attribute [local instance] AbstractCompletion.uniformStruct AbstractCompletion.complete AbstractCompletion.separation namespace AbstractCompletion variable {Ξ± : Type*} [UniformSpace Ξ±] (pkg : AbstractCompletion Ξ±) local notation "hatΞ±" => pkg.space local notation "ΞΉ" => pkg.coe def ofComplete [T0Space Ξ±] [CompleteSpace Ξ±] : AbstractCompletion Ξ± := mk Ξ± id inferInstance inferInstance inferInstance uniformInducing_id denseRange_id #align abstract_completion.of_complete AbstractCompletion.ofComplete theorem closure_range : closure (range ΞΉ) = univ := pkg.dense.closure_range #align abstract_completion.closure_range AbstractCompletion.closure_range theorem denseInducing : DenseInducing ΞΉ := ⟨pkg.uniformInducing.inducing, pkg.dense⟩ #align abstract_completion.dense_inducing AbstractCompletion.denseInducing theorem uniformContinuous_coe : UniformContinuous ΞΉ := UniformInducing.uniformContinuous pkg.uniformInducing #align abstract_completion.uniform_continuous_coe AbstractCompletion.uniformContinuous_coe theorem continuous_coe : Continuous ΞΉ := pkg.uniformContinuous_coe.continuous #align abstract_completion.continuous_coe AbstractCompletion.continuous_coe @[elab_as_elim] theorem induction_on {p : hatΞ± β†’ Prop} (a : hatΞ±) (hp : IsClosed { a | p a }) (ih : βˆ€ a, p (ΞΉ a)) : p a := isClosed_property pkg.dense hp ih a #align abstract_completion.induction_on AbstractCompletion.induction_on variable {Ξ² : Type*} protected theorem funext [TopologicalSpace Ξ²] [T2Space Ξ²] {f g : hatΞ± β†’ Ξ²} (hf : Continuous f) (hg : Continuous g) (h : βˆ€ a, f (ΞΉ a) = g (ΞΉ a)) : f = g := funext fun a => pkg.induction_on a (isClosed_eq hf hg) h #align abstract_completion.funext AbstractCompletion.funext variable [UniformSpace Ξ²] section Extend protected def extend (f : Ξ± β†’ Ξ²) : hatΞ± β†’ Ξ² := if UniformContinuous f then pkg.denseInducing.extend f else fun x => f (pkg.dense.some x) #align abstract_completion.extend AbstractCompletion.extend variable {f : Ξ± β†’ Ξ²} theorem extend_def (hf : UniformContinuous f) : pkg.extend f = pkg.denseInducing.extend f := if_pos hf #align abstract_completion.extend_def AbstractCompletion.extend_def
Mathlib/Topology/UniformSpace/AbstractCompletion.lean
136
138
theorem extend_coe [T2Space Ξ²] (hf : UniformContinuous f) (a : Ξ±) : (pkg.extend f) (ΞΉ a) = f a := by
rw [pkg.extend_def hf] exact pkg.denseInducing.extend_eq hf.continuous a
2
7.389056
1
1.333333
3
1,403
import Mathlib.Topology.UniformSpace.UniformEmbedding import Mathlib.Topology.UniformSpace.Equiv #align_import topology.uniform_space.abstract_completion from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988" noncomputable section attribute [local instance] Classical.propDecidable open Filter Set Function universe u structure AbstractCompletion (Ξ± : Type u) [UniformSpace Ξ±] where space : Type u coe : Ξ± β†’ space uniformStruct : UniformSpace space complete : CompleteSpace space separation : T0Space space uniformInducing : UniformInducing coe dense : DenseRange coe #align abstract_completion AbstractCompletion attribute [local instance] AbstractCompletion.uniformStruct AbstractCompletion.complete AbstractCompletion.separation namespace AbstractCompletion variable {Ξ± : Type*} [UniformSpace Ξ±] (pkg : AbstractCompletion Ξ±) local notation "hatΞ±" => pkg.space local notation "ΞΉ" => pkg.coe def ofComplete [T0Space Ξ±] [CompleteSpace Ξ±] : AbstractCompletion Ξ± := mk Ξ± id inferInstance inferInstance inferInstance uniformInducing_id denseRange_id #align abstract_completion.of_complete AbstractCompletion.ofComplete theorem closure_range : closure (range ΞΉ) = univ := pkg.dense.closure_range #align abstract_completion.closure_range AbstractCompletion.closure_range theorem denseInducing : DenseInducing ΞΉ := ⟨pkg.uniformInducing.inducing, pkg.dense⟩ #align abstract_completion.dense_inducing AbstractCompletion.denseInducing theorem uniformContinuous_coe : UniformContinuous ΞΉ := UniformInducing.uniformContinuous pkg.uniformInducing #align abstract_completion.uniform_continuous_coe AbstractCompletion.uniformContinuous_coe theorem continuous_coe : Continuous ΞΉ := pkg.uniformContinuous_coe.continuous #align abstract_completion.continuous_coe AbstractCompletion.continuous_coe @[elab_as_elim] theorem induction_on {p : hatΞ± β†’ Prop} (a : hatΞ±) (hp : IsClosed { a | p a }) (ih : βˆ€ a, p (ΞΉ a)) : p a := isClosed_property pkg.dense hp ih a #align abstract_completion.induction_on AbstractCompletion.induction_on variable {Ξ² : Type*} protected theorem funext [TopologicalSpace Ξ²] [T2Space Ξ²] {f g : hatΞ± β†’ Ξ²} (hf : Continuous f) (hg : Continuous g) (h : βˆ€ a, f (ΞΉ a) = g (ΞΉ a)) : f = g := funext fun a => pkg.induction_on a (isClosed_eq hf hg) h #align abstract_completion.funext AbstractCompletion.funext variable [UniformSpace Ξ²] section Extend protected def extend (f : Ξ± β†’ Ξ²) : hatΞ± β†’ Ξ² := if UniformContinuous f then pkg.denseInducing.extend f else fun x => f (pkg.dense.some x) #align abstract_completion.extend AbstractCompletion.extend variable {f : Ξ± β†’ Ξ²} theorem extend_def (hf : UniformContinuous f) : pkg.extend f = pkg.denseInducing.extend f := if_pos hf #align abstract_completion.extend_def AbstractCompletion.extend_def theorem extend_coe [T2Space Ξ²] (hf : UniformContinuous f) (a : Ξ±) : (pkg.extend f) (ΞΉ a) = f a := by rw [pkg.extend_def hf] exact pkg.denseInducing.extend_eq hf.continuous a #align abstract_completion.extend_coe AbstractCompletion.extend_coe variable [CompleteSpace Ξ²]
Mathlib/Topology/UniformSpace/AbstractCompletion.lean
143
149
theorem uniformContinuous_extend : UniformContinuous (pkg.extend f) := by
by_cases hf : UniformContinuous f Β· rw [pkg.extend_def hf] exact uniformContinuous_uniformly_extend pkg.uniformInducing pkg.dense hf Β· change UniformContinuous (ite _ _ _) rw [if_neg hf] exact uniformContinuous_of_const fun a b => by congr 1
6
403.428793
2
1.333333
3
1,403
import Mathlib.Topology.UniformSpace.UniformEmbedding import Mathlib.Topology.UniformSpace.Equiv #align_import topology.uniform_space.abstract_completion from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988" noncomputable section attribute [local instance] Classical.propDecidable open Filter Set Function universe u structure AbstractCompletion (Ξ± : Type u) [UniformSpace Ξ±] where space : Type u coe : Ξ± β†’ space uniformStruct : UniformSpace space complete : CompleteSpace space separation : T0Space space uniformInducing : UniformInducing coe dense : DenseRange coe #align abstract_completion AbstractCompletion attribute [local instance] AbstractCompletion.uniformStruct AbstractCompletion.complete AbstractCompletion.separation namespace AbstractCompletion variable {Ξ± : Type*} [UniformSpace Ξ±] (pkg : AbstractCompletion Ξ±) local notation "hatΞ±" => pkg.space local notation "ΞΉ" => pkg.coe def ofComplete [T0Space Ξ±] [CompleteSpace Ξ±] : AbstractCompletion Ξ± := mk Ξ± id inferInstance inferInstance inferInstance uniformInducing_id denseRange_id #align abstract_completion.of_complete AbstractCompletion.ofComplete theorem closure_range : closure (range ΞΉ) = univ := pkg.dense.closure_range #align abstract_completion.closure_range AbstractCompletion.closure_range theorem denseInducing : DenseInducing ΞΉ := ⟨pkg.uniformInducing.inducing, pkg.dense⟩ #align abstract_completion.dense_inducing AbstractCompletion.denseInducing theorem uniformContinuous_coe : UniformContinuous ΞΉ := UniformInducing.uniformContinuous pkg.uniformInducing #align abstract_completion.uniform_continuous_coe AbstractCompletion.uniformContinuous_coe theorem continuous_coe : Continuous ΞΉ := pkg.uniformContinuous_coe.continuous #align abstract_completion.continuous_coe AbstractCompletion.continuous_coe @[elab_as_elim] theorem induction_on {p : hatΞ± β†’ Prop} (a : hatΞ±) (hp : IsClosed { a | p a }) (ih : βˆ€ a, p (ΞΉ a)) : p a := isClosed_property pkg.dense hp ih a #align abstract_completion.induction_on AbstractCompletion.induction_on variable {Ξ² : Type*} protected theorem funext [TopologicalSpace Ξ²] [T2Space Ξ²] {f g : hatΞ± β†’ Ξ²} (hf : Continuous f) (hg : Continuous g) (h : βˆ€ a, f (ΞΉ a) = g (ΞΉ a)) : f = g := funext fun a => pkg.induction_on a (isClosed_eq hf hg) h #align abstract_completion.funext AbstractCompletion.funext variable [UniformSpace Ξ²] section Extend protected def extend (f : Ξ± β†’ Ξ²) : hatΞ± β†’ Ξ² := if UniformContinuous f then pkg.denseInducing.extend f else fun x => f (pkg.dense.some x) #align abstract_completion.extend AbstractCompletion.extend variable {f : Ξ± β†’ Ξ²} theorem extend_def (hf : UniformContinuous f) : pkg.extend f = pkg.denseInducing.extend f := if_pos hf #align abstract_completion.extend_def AbstractCompletion.extend_def theorem extend_coe [T2Space Ξ²] (hf : UniformContinuous f) (a : Ξ±) : (pkg.extend f) (ΞΉ a) = f a := by rw [pkg.extend_def hf] exact pkg.denseInducing.extend_eq hf.continuous a #align abstract_completion.extend_coe AbstractCompletion.extend_coe variable [CompleteSpace Ξ²] theorem uniformContinuous_extend : UniformContinuous (pkg.extend f) := by by_cases hf : UniformContinuous f Β· rw [pkg.extend_def hf] exact uniformContinuous_uniformly_extend pkg.uniformInducing pkg.dense hf Β· change UniformContinuous (ite _ _ _) rw [if_neg hf] exact uniformContinuous_of_const fun a b => by congr 1 #align abstract_completion.uniform_continuous_extend AbstractCompletion.uniformContinuous_extend theorem continuous_extend : Continuous (pkg.extend f) := pkg.uniformContinuous_extend.continuous #align abstract_completion.continuous_extend AbstractCompletion.continuous_extend variable [T0Space Ξ²]
Mathlib/Topology/UniformSpace/AbstractCompletion.lean
158
161
theorem extend_unique (hf : UniformContinuous f) {g : hatΞ± β†’ Ξ²} (hg : UniformContinuous g) (h : βˆ€ a : Ξ±, f a = g (ΞΉ a)) : pkg.extend f = g := by
apply pkg.funext pkg.continuous_extend hg.continuous simpa only [pkg.extend_coe hf] using h
2
7.389056
1
1.333333
3
1,403
import Mathlib.MeasureTheory.MeasurableSpace.Basic import Mathlib.MeasureTheory.Measure.MeasureSpaceDef #align_import measure_theory.function.ae_measurable_sequence from "leanprover-community/mathlib"@"d003c55042c3cd08aefd1ae9a42ef89441cdaaf3" open MeasureTheory open scoped Classical variable {ΞΉ : Sort*} {Ξ± Ξ² Ξ³ : Type*} [MeasurableSpace Ξ±] [MeasurableSpace Ξ²] {f : ΞΉ β†’ Ξ± β†’ Ξ²} {ΞΌ : Measure Ξ±} {p : Ξ± β†’ (ΞΉ β†’ Ξ²) β†’ Prop} def aeSeqSet (hf : βˆ€ i, AEMeasurable (f i) ΞΌ) (p : Ξ± β†’ (ΞΉ β†’ Ξ²) β†’ Prop) : Set Ξ± := (toMeasurable ΞΌ { x | (βˆ€ i, f i x = (hf i).mk (f i) x) ∧ p x fun n => f n x }ᢜ)ᢜ #align ae_seq_set aeSeqSet noncomputable def aeSeq (hf : βˆ€ i, AEMeasurable (f i) ΞΌ) (p : Ξ± β†’ (ΞΉ β†’ Ξ²) β†’ Prop) : ΞΉ β†’ Ξ± β†’ Ξ² := fun i x => ite (x ∈ aeSeqSet hf p) ((hf i).mk (f i) x) (⟨f i x⟩ : Nonempty Ξ²).some #align ae_seq aeSeq namespace aeSeq section MemAESeqSet
Mathlib/MeasureTheory/Function/AEMeasurableSequence.lean
50
56
theorem mk_eq_fun_of_mem_aeSeqSet (hf : βˆ€ i, AEMeasurable (f i) ΞΌ) {x : Ξ±} (hx : x ∈ aeSeqSet hf p) (i : ΞΉ) : (hf i).mk (f i) x = f i x := haveI h_ss : aeSeqSet hf p βŠ† { x | βˆ€ i, f i x = (hf i).mk (f i) x } := by
rw [aeSeqSet, ← compl_compl { x | βˆ€ i, f i x = (hf i).mk (f i) x }, Set.compl_subset_compl] refine Set.Subset.trans (Set.compl_subset_compl.mpr fun x h => ?_) (subset_toMeasurable _ _) exact h.1 (h_ss hx i).symm
4
54.59815
2
1.333333
6
1,404
import Mathlib.MeasureTheory.MeasurableSpace.Basic import Mathlib.MeasureTheory.Measure.MeasureSpaceDef #align_import measure_theory.function.ae_measurable_sequence from "leanprover-community/mathlib"@"d003c55042c3cd08aefd1ae9a42ef89441cdaaf3" open MeasureTheory open scoped Classical variable {ΞΉ : Sort*} {Ξ± Ξ² Ξ³ : Type*} [MeasurableSpace Ξ±] [MeasurableSpace Ξ²] {f : ΞΉ β†’ Ξ± β†’ Ξ²} {ΞΌ : Measure Ξ±} {p : Ξ± β†’ (ΞΉ β†’ Ξ²) β†’ Prop} def aeSeqSet (hf : βˆ€ i, AEMeasurable (f i) ΞΌ) (p : Ξ± β†’ (ΞΉ β†’ Ξ²) β†’ Prop) : Set Ξ± := (toMeasurable ΞΌ { x | (βˆ€ i, f i x = (hf i).mk (f i) x) ∧ p x fun n => f n x }ᢜ)ᢜ #align ae_seq_set aeSeqSet noncomputable def aeSeq (hf : βˆ€ i, AEMeasurable (f i) ΞΌ) (p : Ξ± β†’ (ΞΉ β†’ Ξ²) β†’ Prop) : ΞΉ β†’ Ξ± β†’ Ξ² := fun i x => ite (x ∈ aeSeqSet hf p) ((hf i).mk (f i) x) (⟨f i x⟩ : Nonempty Ξ²).some #align ae_seq aeSeq namespace aeSeq section MemAESeqSet theorem mk_eq_fun_of_mem_aeSeqSet (hf : βˆ€ i, AEMeasurable (f i) ΞΌ) {x : Ξ±} (hx : x ∈ aeSeqSet hf p) (i : ΞΉ) : (hf i).mk (f i) x = f i x := haveI h_ss : aeSeqSet hf p βŠ† { x | βˆ€ i, f i x = (hf i).mk (f i) x } := by rw [aeSeqSet, ← compl_compl { x | βˆ€ i, f i x = (hf i).mk (f i) x }, Set.compl_subset_compl] refine Set.Subset.trans (Set.compl_subset_compl.mpr fun x h => ?_) (subset_toMeasurable _ _) exact h.1 (h_ss hx i).symm #align ae_seq.mk_eq_fun_of_mem_ae_seq_set aeSeq.mk_eq_fun_of_mem_aeSeqSet
Mathlib/MeasureTheory/Function/AEMeasurableSequence.lean
59
61
theorem aeSeq_eq_mk_of_mem_aeSeqSet (hf : βˆ€ i, AEMeasurable (f i) ΞΌ) {x : Ξ±} (hx : x ∈ aeSeqSet hf p) (i : ΞΉ) : aeSeq hf p i x = (hf i).mk (f i) x := by
simp only [aeSeq, hx, if_true]
1
2.718282
0
1.333333
6
1,404
import Mathlib.MeasureTheory.MeasurableSpace.Basic import Mathlib.MeasureTheory.Measure.MeasureSpaceDef #align_import measure_theory.function.ae_measurable_sequence from "leanprover-community/mathlib"@"d003c55042c3cd08aefd1ae9a42ef89441cdaaf3" open MeasureTheory open scoped Classical variable {ΞΉ : Sort*} {Ξ± Ξ² Ξ³ : Type*} [MeasurableSpace Ξ±] [MeasurableSpace Ξ²] {f : ΞΉ β†’ Ξ± β†’ Ξ²} {ΞΌ : Measure Ξ±} {p : Ξ± β†’ (ΞΉ β†’ Ξ²) β†’ Prop} def aeSeqSet (hf : βˆ€ i, AEMeasurable (f i) ΞΌ) (p : Ξ± β†’ (ΞΉ β†’ Ξ²) β†’ Prop) : Set Ξ± := (toMeasurable ΞΌ { x | (βˆ€ i, f i x = (hf i).mk (f i) x) ∧ p x fun n => f n x }ᢜ)ᢜ #align ae_seq_set aeSeqSet noncomputable def aeSeq (hf : βˆ€ i, AEMeasurable (f i) ΞΌ) (p : Ξ± β†’ (ΞΉ β†’ Ξ²) β†’ Prop) : ΞΉ β†’ Ξ± β†’ Ξ² := fun i x => ite (x ∈ aeSeqSet hf p) ((hf i).mk (f i) x) (⟨f i x⟩ : Nonempty Ξ²).some #align ae_seq aeSeq namespace aeSeq section MemAESeqSet theorem mk_eq_fun_of_mem_aeSeqSet (hf : βˆ€ i, AEMeasurable (f i) ΞΌ) {x : Ξ±} (hx : x ∈ aeSeqSet hf p) (i : ΞΉ) : (hf i).mk (f i) x = f i x := haveI h_ss : aeSeqSet hf p βŠ† { x | βˆ€ i, f i x = (hf i).mk (f i) x } := by rw [aeSeqSet, ← compl_compl { x | βˆ€ i, f i x = (hf i).mk (f i) x }, Set.compl_subset_compl] refine Set.Subset.trans (Set.compl_subset_compl.mpr fun x h => ?_) (subset_toMeasurable _ _) exact h.1 (h_ss hx i).symm #align ae_seq.mk_eq_fun_of_mem_ae_seq_set aeSeq.mk_eq_fun_of_mem_aeSeqSet theorem aeSeq_eq_mk_of_mem_aeSeqSet (hf : βˆ€ i, AEMeasurable (f i) ΞΌ) {x : Ξ±} (hx : x ∈ aeSeqSet hf p) (i : ΞΉ) : aeSeq hf p i x = (hf i).mk (f i) x := by simp only [aeSeq, hx, if_true] #align ae_seq.ae_seq_eq_mk_of_mem_ae_seq_set aeSeq.aeSeq_eq_mk_of_mem_aeSeqSet
Mathlib/MeasureTheory/Function/AEMeasurableSequence.lean
64
66
theorem aeSeq_eq_fun_of_mem_aeSeqSet (hf : βˆ€ i, AEMeasurable (f i) ΞΌ) {x : Ξ±} (hx : x ∈ aeSeqSet hf p) (i : ΞΉ) : aeSeq hf p i x = f i x := by
simp only [aeSeq_eq_mk_of_mem_aeSeqSet hf hx i, mk_eq_fun_of_mem_aeSeqSet hf hx i]
1
2.718282
0
1.333333
6
1,404
import Mathlib.MeasureTheory.MeasurableSpace.Basic import Mathlib.MeasureTheory.Measure.MeasureSpaceDef #align_import measure_theory.function.ae_measurable_sequence from "leanprover-community/mathlib"@"d003c55042c3cd08aefd1ae9a42ef89441cdaaf3" open MeasureTheory open scoped Classical variable {ΞΉ : Sort*} {Ξ± Ξ² Ξ³ : Type*} [MeasurableSpace Ξ±] [MeasurableSpace Ξ²] {f : ΞΉ β†’ Ξ± β†’ Ξ²} {ΞΌ : Measure Ξ±} {p : Ξ± β†’ (ΞΉ β†’ Ξ²) β†’ Prop} def aeSeqSet (hf : βˆ€ i, AEMeasurable (f i) ΞΌ) (p : Ξ± β†’ (ΞΉ β†’ Ξ²) β†’ Prop) : Set Ξ± := (toMeasurable ΞΌ { x | (βˆ€ i, f i x = (hf i).mk (f i) x) ∧ p x fun n => f n x }ᢜ)ᢜ #align ae_seq_set aeSeqSet noncomputable def aeSeq (hf : βˆ€ i, AEMeasurable (f i) ΞΌ) (p : Ξ± β†’ (ΞΉ β†’ Ξ²) β†’ Prop) : ΞΉ β†’ Ξ± β†’ Ξ² := fun i x => ite (x ∈ aeSeqSet hf p) ((hf i).mk (f i) x) (⟨f i x⟩ : Nonempty Ξ²).some #align ae_seq aeSeq namespace aeSeq section MemAESeqSet theorem mk_eq_fun_of_mem_aeSeqSet (hf : βˆ€ i, AEMeasurable (f i) ΞΌ) {x : Ξ±} (hx : x ∈ aeSeqSet hf p) (i : ΞΉ) : (hf i).mk (f i) x = f i x := haveI h_ss : aeSeqSet hf p βŠ† { x | βˆ€ i, f i x = (hf i).mk (f i) x } := by rw [aeSeqSet, ← compl_compl { x | βˆ€ i, f i x = (hf i).mk (f i) x }, Set.compl_subset_compl] refine Set.Subset.trans (Set.compl_subset_compl.mpr fun x h => ?_) (subset_toMeasurable _ _) exact h.1 (h_ss hx i).symm #align ae_seq.mk_eq_fun_of_mem_ae_seq_set aeSeq.mk_eq_fun_of_mem_aeSeqSet theorem aeSeq_eq_mk_of_mem_aeSeqSet (hf : βˆ€ i, AEMeasurable (f i) ΞΌ) {x : Ξ±} (hx : x ∈ aeSeqSet hf p) (i : ΞΉ) : aeSeq hf p i x = (hf i).mk (f i) x := by simp only [aeSeq, hx, if_true] #align ae_seq.ae_seq_eq_mk_of_mem_ae_seq_set aeSeq.aeSeq_eq_mk_of_mem_aeSeqSet theorem aeSeq_eq_fun_of_mem_aeSeqSet (hf : βˆ€ i, AEMeasurable (f i) ΞΌ) {x : Ξ±} (hx : x ∈ aeSeqSet hf p) (i : ΞΉ) : aeSeq hf p i x = f i x := by simp only [aeSeq_eq_mk_of_mem_aeSeqSet hf hx i, mk_eq_fun_of_mem_aeSeqSet hf hx i] #align ae_seq.ae_seq_eq_fun_of_mem_ae_seq_set aeSeq.aeSeq_eq_fun_of_mem_aeSeqSet
Mathlib/MeasureTheory/Function/AEMeasurableSequence.lean
69
78
theorem prop_of_mem_aeSeqSet (hf : βˆ€ i, AEMeasurable (f i) ΞΌ) {x : Ξ±} (hx : x ∈ aeSeqSet hf p) : p x fun n => aeSeq hf p n x := by
simp only [aeSeq, hx, if_true] rw [funext fun n => mk_eq_fun_of_mem_aeSeqSet hf hx n] have h_ss : aeSeqSet hf p βŠ† { x | p x fun n => f n x } := by rw [← compl_compl { x | p x fun n => f n x }, aeSeqSet, Set.compl_subset_compl] refine Set.Subset.trans (Set.compl_subset_compl.mpr ?_) (subset_toMeasurable _ _) exact fun x hx => hx.2 have hx' := Set.mem_of_subset_of_mem h_ss hx exact hx'
8
2,980.957987
2
1.333333
6
1,404
import Mathlib.MeasureTheory.MeasurableSpace.Basic import Mathlib.MeasureTheory.Measure.MeasureSpaceDef #align_import measure_theory.function.ae_measurable_sequence from "leanprover-community/mathlib"@"d003c55042c3cd08aefd1ae9a42ef89441cdaaf3" open MeasureTheory open scoped Classical variable {ΞΉ : Sort*} {Ξ± Ξ² Ξ³ : Type*} [MeasurableSpace Ξ±] [MeasurableSpace Ξ²] {f : ΞΉ β†’ Ξ± β†’ Ξ²} {ΞΌ : Measure Ξ±} {p : Ξ± β†’ (ΞΉ β†’ Ξ²) β†’ Prop} def aeSeqSet (hf : βˆ€ i, AEMeasurable (f i) ΞΌ) (p : Ξ± β†’ (ΞΉ β†’ Ξ²) β†’ Prop) : Set Ξ± := (toMeasurable ΞΌ { x | (βˆ€ i, f i x = (hf i).mk (f i) x) ∧ p x fun n => f n x }ᢜ)ᢜ #align ae_seq_set aeSeqSet noncomputable def aeSeq (hf : βˆ€ i, AEMeasurable (f i) ΞΌ) (p : Ξ± β†’ (ΞΉ β†’ Ξ²) β†’ Prop) : ΞΉ β†’ Ξ± β†’ Ξ² := fun i x => ite (x ∈ aeSeqSet hf p) ((hf i).mk (f i) x) (⟨f i x⟩ : Nonempty Ξ²).some #align ae_seq aeSeq namespace aeSeq section MemAESeqSet theorem mk_eq_fun_of_mem_aeSeqSet (hf : βˆ€ i, AEMeasurable (f i) ΞΌ) {x : Ξ±} (hx : x ∈ aeSeqSet hf p) (i : ΞΉ) : (hf i).mk (f i) x = f i x := haveI h_ss : aeSeqSet hf p βŠ† { x | βˆ€ i, f i x = (hf i).mk (f i) x } := by rw [aeSeqSet, ← compl_compl { x | βˆ€ i, f i x = (hf i).mk (f i) x }, Set.compl_subset_compl] refine Set.Subset.trans (Set.compl_subset_compl.mpr fun x h => ?_) (subset_toMeasurable _ _) exact h.1 (h_ss hx i).symm #align ae_seq.mk_eq_fun_of_mem_ae_seq_set aeSeq.mk_eq_fun_of_mem_aeSeqSet theorem aeSeq_eq_mk_of_mem_aeSeqSet (hf : βˆ€ i, AEMeasurable (f i) ΞΌ) {x : Ξ±} (hx : x ∈ aeSeqSet hf p) (i : ΞΉ) : aeSeq hf p i x = (hf i).mk (f i) x := by simp only [aeSeq, hx, if_true] #align ae_seq.ae_seq_eq_mk_of_mem_ae_seq_set aeSeq.aeSeq_eq_mk_of_mem_aeSeqSet theorem aeSeq_eq_fun_of_mem_aeSeqSet (hf : βˆ€ i, AEMeasurable (f i) ΞΌ) {x : Ξ±} (hx : x ∈ aeSeqSet hf p) (i : ΞΉ) : aeSeq hf p i x = f i x := by simp only [aeSeq_eq_mk_of_mem_aeSeqSet hf hx i, mk_eq_fun_of_mem_aeSeqSet hf hx i] #align ae_seq.ae_seq_eq_fun_of_mem_ae_seq_set aeSeq.aeSeq_eq_fun_of_mem_aeSeqSet theorem prop_of_mem_aeSeqSet (hf : βˆ€ i, AEMeasurable (f i) ΞΌ) {x : Ξ±} (hx : x ∈ aeSeqSet hf p) : p x fun n => aeSeq hf p n x := by simp only [aeSeq, hx, if_true] rw [funext fun n => mk_eq_fun_of_mem_aeSeqSet hf hx n] have h_ss : aeSeqSet hf p βŠ† { x | p x fun n => f n x } := by rw [← compl_compl { x | p x fun n => f n x }, aeSeqSet, Set.compl_subset_compl] refine Set.Subset.trans (Set.compl_subset_compl.mpr ?_) (subset_toMeasurable _ _) exact fun x hx => hx.2 have hx' := Set.mem_of_subset_of_mem h_ss hx exact hx' #align ae_seq.prop_of_mem_ae_seq_set aeSeq.prop_of_mem_aeSeqSet
Mathlib/MeasureTheory/Function/AEMeasurableSequence.lean
81
86
theorem fun_prop_of_mem_aeSeqSet (hf : βˆ€ i, AEMeasurable (f i) ΞΌ) {x : Ξ±} (hx : x ∈ aeSeqSet hf p) : p x fun n => f n x := by
have h_eq : (fun n => f n x) = fun n => aeSeq hf p n x := funext fun n => (aeSeq_eq_fun_of_mem_aeSeqSet hf hx n).symm rw [h_eq] exact prop_of_mem_aeSeqSet hf hx
4
54.59815
2
1.333333
6
1,404
import Mathlib.MeasureTheory.MeasurableSpace.Basic import Mathlib.MeasureTheory.Measure.MeasureSpaceDef #align_import measure_theory.function.ae_measurable_sequence from "leanprover-community/mathlib"@"d003c55042c3cd08aefd1ae9a42ef89441cdaaf3" open MeasureTheory open scoped Classical variable {ΞΉ : Sort*} {Ξ± Ξ² Ξ³ : Type*} [MeasurableSpace Ξ±] [MeasurableSpace Ξ²] {f : ΞΉ β†’ Ξ± β†’ Ξ²} {ΞΌ : Measure Ξ±} {p : Ξ± β†’ (ΞΉ β†’ Ξ²) β†’ Prop} def aeSeqSet (hf : βˆ€ i, AEMeasurable (f i) ΞΌ) (p : Ξ± β†’ (ΞΉ β†’ Ξ²) β†’ Prop) : Set Ξ± := (toMeasurable ΞΌ { x | (βˆ€ i, f i x = (hf i).mk (f i) x) ∧ p x fun n => f n x }ᢜ)ᢜ #align ae_seq_set aeSeqSet noncomputable def aeSeq (hf : βˆ€ i, AEMeasurable (f i) ΞΌ) (p : Ξ± β†’ (ΞΉ β†’ Ξ²) β†’ Prop) : ΞΉ β†’ Ξ± β†’ Ξ² := fun i x => ite (x ∈ aeSeqSet hf p) ((hf i).mk (f i) x) (⟨f i x⟩ : Nonempty Ξ²).some #align ae_seq aeSeq namespace aeSeq theorem aeSeqSet_measurableSet {hf : βˆ€ i, AEMeasurable (f i) ΞΌ} : MeasurableSet (aeSeqSet hf p) := (measurableSet_toMeasurable _ _).compl #align ae_seq.ae_seq_set_measurable_set aeSeq.aeSeqSet_measurableSet theorem measurable (hf : βˆ€ i, AEMeasurable (f i) ΞΌ) (p : Ξ± β†’ (ΞΉ β†’ Ξ²) β†’ Prop) (i : ΞΉ) : Measurable (aeSeq hf p i) := Measurable.ite aeSeqSet_measurableSet (hf i).measurable_mk <| measurable_const' fun _ _ => rfl #align ae_seq.measurable aeSeq.measurable
Mathlib/MeasureTheory/Function/AEMeasurableSequence.lean
100
105
theorem measure_compl_aeSeqSet_eq_zero [Countable ΞΉ] (hf : βˆ€ i, AEMeasurable (f i) ΞΌ) (hp : βˆ€α΅ x βˆ‚ΞΌ, p x fun n => f n x) : ΞΌ (aeSeqSet hf p)ᢜ = 0 := by
rw [aeSeqSet, compl_compl, measure_toMeasurable] have hf_eq := fun i => (hf i).ae_eq_mk simp_rw [Filter.EventuallyEq, ← ae_all_iff] at hf_eq exact Filter.Eventually.and hf_eq hp
4
54.59815
2
1.333333
6
1,404
import Mathlib.CategoryTheory.Elementwise import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.CategoryTheory.Adhesive import Mathlib.CategoryTheory.Sites.ConcreteSheafification #align_import category_theory.sites.subsheaf from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" universe w v u open Opposite CategoryTheory namespace CategoryTheory.GrothendieckTopology variable {C : Type u} [Category.{v} C] (J : GrothendieckTopology C) @[ext] structure Subpresheaf (F : Cα΅’α΅– β₯€ Type w) where obj : βˆ€ U, Set (F.obj U) map : βˆ€ {U V : Cα΅’α΅–} (i : U ⟢ V), obj U βŠ† F.map i ⁻¹' obj V #align category_theory.grothendieck_topology.subpresheaf CategoryTheory.GrothendieckTopology.Subpresheaf variable {F F' F'' : Cα΅’α΅– β₯€ Type w} (G G' : Subpresheaf F) instance : PartialOrder (Subpresheaf F) := PartialOrder.lift Subpresheaf.obj Subpresheaf.ext instance : Top (Subpresheaf F) := ⟨⟨fun U => ⊀, @fun U V _ x _ => by aesop_cat⟩⟩ instance : Nonempty (Subpresheaf F) := inferInstance @[simps!] def Subpresheaf.toPresheaf : Cα΅’α΅– β₯€ Type w where obj U := G.obj U map := @fun U V i x => ⟨F.map i x, G.map i x.prop⟩ map_id X := by ext ⟨x, _⟩ dsimp simp only [FunctorToTypes.map_id_apply] map_comp := @fun X Y Z i j => by ext ⟨x, _⟩ dsimp simp only [FunctorToTypes.map_comp_apply] #align category_theory.grothendieck_topology.subpresheaf.to_presheaf CategoryTheory.GrothendieckTopology.Subpresheaf.toPresheaf instance {U} : CoeHead (G.toPresheaf.obj U) (F.obj U) where coe := Subtype.val @[simps] def Subpresheaf.ΞΉ : G.toPresheaf ⟢ F where app U x := x #align category_theory.grothendieck_topology.subpresheaf.ΞΉ CategoryTheory.GrothendieckTopology.Subpresheaf.ΞΉ instance : Mono G.ΞΉ := ⟨@fun _ f₁ fβ‚‚ e => NatTrans.ext f₁ fβ‚‚ <| funext fun U => funext fun x => Subtype.ext <| congr_fun (congr_app e U) x⟩ @[simps] def Subpresheaf.homOfLe {G G' : Subpresheaf F} (h : G ≀ G') : G.toPresheaf ⟢ G'.toPresheaf where app U x := ⟨x, h U x.prop⟩ #align category_theory.grothendieck_topology.subpresheaf.hom_of_le CategoryTheory.GrothendieckTopology.Subpresheaf.homOfLe instance {G G' : Subpresheaf F} (h : G ≀ G') : Mono (Subpresheaf.homOfLe h) := ⟨fun f₁ fβ‚‚ e => NatTrans.ext f₁ fβ‚‚ <| funext fun U => funext fun x => Subtype.ext <| (congr_arg Subtype.val <| (congr_fun (congr_app e U) x : _) : _)⟩ @[reassoc (attr := simp)]
Mathlib/CategoryTheory/Sites/Subsheaf.lean
110
113
theorem Subpresheaf.homOfLe_ΞΉ {G G' : Subpresheaf F} (h : G ≀ G') : Subpresheaf.homOfLe h ≫ G'.ΞΉ = G.ΞΉ := by
ext rfl
2
7.389056
1
1.333333
3
1,405
import Mathlib.CategoryTheory.Elementwise import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.CategoryTheory.Adhesive import Mathlib.CategoryTheory.Sites.ConcreteSheafification #align_import category_theory.sites.subsheaf from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" universe w v u open Opposite CategoryTheory namespace CategoryTheory.GrothendieckTopology variable {C : Type u} [Category.{v} C] (J : GrothendieckTopology C) @[ext] structure Subpresheaf (F : Cα΅’α΅– β₯€ Type w) where obj : βˆ€ U, Set (F.obj U) map : βˆ€ {U V : Cα΅’α΅–} (i : U ⟢ V), obj U βŠ† F.map i ⁻¹' obj V #align category_theory.grothendieck_topology.subpresheaf CategoryTheory.GrothendieckTopology.Subpresheaf variable {F F' F'' : Cα΅’α΅– β₯€ Type w} (G G' : Subpresheaf F) instance : PartialOrder (Subpresheaf F) := PartialOrder.lift Subpresheaf.obj Subpresheaf.ext instance : Top (Subpresheaf F) := ⟨⟨fun U => ⊀, @fun U V _ x _ => by aesop_cat⟩⟩ instance : Nonempty (Subpresheaf F) := inferInstance @[simps!] def Subpresheaf.toPresheaf : Cα΅’α΅– β₯€ Type w where obj U := G.obj U map := @fun U V i x => ⟨F.map i x, G.map i x.prop⟩ map_id X := by ext ⟨x, _⟩ dsimp simp only [FunctorToTypes.map_id_apply] map_comp := @fun X Y Z i j => by ext ⟨x, _⟩ dsimp simp only [FunctorToTypes.map_comp_apply] #align category_theory.grothendieck_topology.subpresheaf.to_presheaf CategoryTheory.GrothendieckTopology.Subpresheaf.toPresheaf instance {U} : CoeHead (G.toPresheaf.obj U) (F.obj U) where coe := Subtype.val @[simps] def Subpresheaf.ΞΉ : G.toPresheaf ⟢ F where app U x := x #align category_theory.grothendieck_topology.subpresheaf.ΞΉ CategoryTheory.GrothendieckTopology.Subpresheaf.ΞΉ instance : Mono G.ΞΉ := ⟨@fun _ f₁ fβ‚‚ e => NatTrans.ext f₁ fβ‚‚ <| funext fun U => funext fun x => Subtype.ext <| congr_fun (congr_app e U) x⟩ @[simps] def Subpresheaf.homOfLe {G G' : Subpresheaf F} (h : G ≀ G') : G.toPresheaf ⟢ G'.toPresheaf where app U x := ⟨x, h U x.prop⟩ #align category_theory.grothendieck_topology.subpresheaf.hom_of_le CategoryTheory.GrothendieckTopology.Subpresheaf.homOfLe instance {G G' : Subpresheaf F} (h : G ≀ G') : Mono (Subpresheaf.homOfLe h) := ⟨fun f₁ fβ‚‚ e => NatTrans.ext f₁ fβ‚‚ <| funext fun U => funext fun x => Subtype.ext <| (congr_arg Subtype.val <| (congr_fun (congr_app e U) x : _) : _)⟩ @[reassoc (attr := simp)] theorem Subpresheaf.homOfLe_ΞΉ {G G' : Subpresheaf F} (h : G ≀ G') : Subpresheaf.homOfLe h ≫ G'.ΞΉ = G.ΞΉ := by ext rfl #align category_theory.grothendieck_topology.subpresheaf.hom_of_le_ΞΉ CategoryTheory.GrothendieckTopology.Subpresheaf.homOfLe_ΞΉ instance : IsIso (Subpresheaf.ΞΉ (⊀ : Subpresheaf F)) := by refine @NatIso.isIso_of_isIso_app _ _ _ _ _ _ _ ?_ intro X rw [isIso_iff_bijective] exact ⟨Subtype.coe_injective, fun x => ⟨⟨x, _root_.trivial⟩, rfl⟩⟩
Mathlib/CategoryTheory/Sites/Subsheaf.lean
122
130
theorem Subpresheaf.eq_top_iff_isIso : G = ⊀ ↔ IsIso G.ΞΉ := by
constructor Β· rintro rfl infer_instance Β· intro H ext U x apply iff_true_iff.mpr rw [← IsIso.inv_hom_id_apply (G.ΞΉ.app U) x] exact ((inv (G.ΞΉ.app U)) x).2
8
2,980.957987
2
1.333333
3
1,405
import Mathlib.CategoryTheory.Elementwise import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.CategoryTheory.Adhesive import Mathlib.CategoryTheory.Sites.ConcreteSheafification #align_import category_theory.sites.subsheaf from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" universe w v u open Opposite CategoryTheory namespace CategoryTheory.GrothendieckTopology variable {C : Type u} [Category.{v} C] (J : GrothendieckTopology C) @[ext] structure Subpresheaf (F : Cα΅’α΅– β₯€ Type w) where obj : βˆ€ U, Set (F.obj U) map : βˆ€ {U V : Cα΅’α΅–} (i : U ⟢ V), obj U βŠ† F.map i ⁻¹' obj V #align category_theory.grothendieck_topology.subpresheaf CategoryTheory.GrothendieckTopology.Subpresheaf variable {F F' F'' : Cα΅’α΅– β₯€ Type w} (G G' : Subpresheaf F) instance : PartialOrder (Subpresheaf F) := PartialOrder.lift Subpresheaf.obj Subpresheaf.ext instance : Top (Subpresheaf F) := ⟨⟨fun U => ⊀, @fun U V _ x _ => by aesop_cat⟩⟩ instance : Nonempty (Subpresheaf F) := inferInstance @[simps!] def Subpresheaf.toPresheaf : Cα΅’α΅– β₯€ Type w where obj U := G.obj U map := @fun U V i x => ⟨F.map i x, G.map i x.prop⟩ map_id X := by ext ⟨x, _⟩ dsimp simp only [FunctorToTypes.map_id_apply] map_comp := @fun X Y Z i j => by ext ⟨x, _⟩ dsimp simp only [FunctorToTypes.map_comp_apply] #align category_theory.grothendieck_topology.subpresheaf.to_presheaf CategoryTheory.GrothendieckTopology.Subpresheaf.toPresheaf instance {U} : CoeHead (G.toPresheaf.obj U) (F.obj U) where coe := Subtype.val @[simps] def Subpresheaf.ΞΉ : G.toPresheaf ⟢ F where app U x := x #align category_theory.grothendieck_topology.subpresheaf.ΞΉ CategoryTheory.GrothendieckTopology.Subpresheaf.ΞΉ instance : Mono G.ΞΉ := ⟨@fun _ f₁ fβ‚‚ e => NatTrans.ext f₁ fβ‚‚ <| funext fun U => funext fun x => Subtype.ext <| congr_fun (congr_app e U) x⟩ @[simps] def Subpresheaf.homOfLe {G G' : Subpresheaf F} (h : G ≀ G') : G.toPresheaf ⟢ G'.toPresheaf where app U x := ⟨x, h U x.prop⟩ #align category_theory.grothendieck_topology.subpresheaf.hom_of_le CategoryTheory.GrothendieckTopology.Subpresheaf.homOfLe instance {G G' : Subpresheaf F} (h : G ≀ G') : Mono (Subpresheaf.homOfLe h) := ⟨fun f₁ fβ‚‚ e => NatTrans.ext f₁ fβ‚‚ <| funext fun U => funext fun x => Subtype.ext <| (congr_arg Subtype.val <| (congr_fun (congr_app e U) x : _) : _)⟩ @[reassoc (attr := simp)] theorem Subpresheaf.homOfLe_ΞΉ {G G' : Subpresheaf F} (h : G ≀ G') : Subpresheaf.homOfLe h ≫ G'.ΞΉ = G.ΞΉ := by ext rfl #align category_theory.grothendieck_topology.subpresheaf.hom_of_le_ΞΉ CategoryTheory.GrothendieckTopology.Subpresheaf.homOfLe_ΞΉ instance : IsIso (Subpresheaf.ΞΉ (⊀ : Subpresheaf F)) := by refine @NatIso.isIso_of_isIso_app _ _ _ _ _ _ _ ?_ intro X rw [isIso_iff_bijective] exact ⟨Subtype.coe_injective, fun x => ⟨⟨x, _root_.trivial⟩, rfl⟩⟩ theorem Subpresheaf.eq_top_iff_isIso : G = ⊀ ↔ IsIso G.ΞΉ := by constructor Β· rintro rfl infer_instance Β· intro H ext U x apply iff_true_iff.mpr rw [← IsIso.inv_hom_id_apply (G.ΞΉ.app U) x] exact ((inv (G.ΞΉ.app U)) x).2 #align category_theory.grothendieck_topology.subpresheaf.eq_top_iff_is_iso CategoryTheory.GrothendieckTopology.Subpresheaf.eq_top_iff_isIso @[simps!] def Subpresheaf.lift (f : F' ⟢ F) (hf : βˆ€ U x, f.app U x ∈ G.obj U) : F' ⟢ G.toPresheaf where app U x := ⟨f.app U x, hf U x⟩ naturality := by have := elementwise_of% f.naturality intros refine funext fun x => Subtype.ext ?_ simp only [toPresheaf_obj, types_comp_apply] exact this _ _ #align category_theory.grothendieck_topology.subpresheaf.lift CategoryTheory.GrothendieckTopology.Subpresheaf.lift @[reassoc (attr := simp)]
Mathlib/CategoryTheory/Sites/Subsheaf.lean
146
149
theorem Subpresheaf.lift_ΞΉ (f : F' ⟢ F) (hf : βˆ€ U x, f.app U x ∈ G.obj U) : G.lift f hf ≫ G.ΞΉ = f := by
ext rfl
2
7.389056
1
1.333333
3
1,405
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Complex #align_import analysis.special_functions.trigonometric.complex_deriv from "leanprover-community/mathlib"@"2c1d8ca2812b64f88992a5294ea3dba144755cd1" noncomputable section namespace Complex open Set Filter open scoped Real
Mathlib/Analysis/SpecialFunctions/Trigonometric/ComplexDeriv.lean
25
28
theorem hasStrictDerivAt_tan {x : β„‚} (h : cos x β‰  0) : HasStrictDerivAt tan (1 / cos x ^ 2) x := by
convert (hasStrictDerivAt_sin x).div (hasStrictDerivAt_cos x) h using 1 rw_mod_cast [← sin_sq_add_cos_sq x] ring
3
20.085537
1
1.333333
3
1,406
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Complex #align_import analysis.special_functions.trigonometric.complex_deriv from "leanprover-community/mathlib"@"2c1d8ca2812b64f88992a5294ea3dba144755cd1" noncomputable section namespace Complex open Set Filter open scoped Real theorem hasStrictDerivAt_tan {x : β„‚} (h : cos x β‰  0) : HasStrictDerivAt tan (1 / cos x ^ 2) x := by convert (hasStrictDerivAt_sin x).div (hasStrictDerivAt_cos x) h using 1 rw_mod_cast [← sin_sq_add_cos_sq x] ring #align complex.has_strict_deriv_at_tan Complex.hasStrictDerivAt_tan theorem hasDerivAt_tan {x : β„‚} (h : cos x β‰  0) : HasDerivAt tan (1 / cos x ^ 2) x := (hasStrictDerivAt_tan h).hasDerivAt #align complex.has_deriv_at_tan Complex.hasDerivAt_tan open scoped Topology
Mathlib/Analysis/SpecialFunctions/Trigonometric/ComplexDeriv.lean
37
44
theorem tendsto_abs_tan_of_cos_eq_zero {x : β„‚} (hx : cos x = 0) : Tendsto (fun x => abs (tan x)) (𝓝[β‰ ] x) atTop := by
simp only [tan_eq_sin_div_cos, ← norm_eq_abs, norm_div] have A : sin x β‰  0 := fun h => by simpa [*, sq] using sin_sq_add_cos_sq x have B : Tendsto cos (𝓝[β‰ ] x) (𝓝[β‰ ] 0) := hx β–Έ (hasDerivAt_cos x).tendsto_punctured_nhds (neg_ne_zero.2 A) exact continuous_sin.continuousWithinAt.norm.mul_atTop (norm_pos_iff.2 A) (tendsto_norm_nhdsWithin_zero.comp B).inv_tendsto_zero
6
403.428793
2
1.333333
3
1,406
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Complex #align_import analysis.special_functions.trigonometric.complex_deriv from "leanprover-community/mathlib"@"2c1d8ca2812b64f88992a5294ea3dba144755cd1" noncomputable section namespace Complex open Set Filter open scoped Real theorem hasStrictDerivAt_tan {x : β„‚} (h : cos x β‰  0) : HasStrictDerivAt tan (1 / cos x ^ 2) x := by convert (hasStrictDerivAt_sin x).div (hasStrictDerivAt_cos x) h using 1 rw_mod_cast [← sin_sq_add_cos_sq x] ring #align complex.has_strict_deriv_at_tan Complex.hasStrictDerivAt_tan theorem hasDerivAt_tan {x : β„‚} (h : cos x β‰  0) : HasDerivAt tan (1 / cos x ^ 2) x := (hasStrictDerivAt_tan h).hasDerivAt #align complex.has_deriv_at_tan Complex.hasDerivAt_tan open scoped Topology theorem tendsto_abs_tan_of_cos_eq_zero {x : β„‚} (hx : cos x = 0) : Tendsto (fun x => abs (tan x)) (𝓝[β‰ ] x) atTop := by simp only [tan_eq_sin_div_cos, ← norm_eq_abs, norm_div] have A : sin x β‰  0 := fun h => by simpa [*, sq] using sin_sq_add_cos_sq x have B : Tendsto cos (𝓝[β‰ ] x) (𝓝[β‰ ] 0) := hx β–Έ (hasDerivAt_cos x).tendsto_punctured_nhds (neg_ne_zero.2 A) exact continuous_sin.continuousWithinAt.norm.mul_atTop (norm_pos_iff.2 A) (tendsto_norm_nhdsWithin_zero.comp B).inv_tendsto_zero #align complex.tendsto_abs_tan_of_cos_eq_zero Complex.tendsto_abs_tan_of_cos_eq_zero theorem tendsto_abs_tan_atTop (k : β„€) : Tendsto (fun x => abs (tan x)) (𝓝[β‰ ] ((2 * k + 1) * Ο€ / 2 : β„‚)) atTop := tendsto_abs_tan_of_cos_eq_zero <| cos_eq_zero_iff.2 ⟨k, rfl⟩ #align complex.tendsto_abs_tan_at_top Complex.tendsto_abs_tan_atTop @[simp]
Mathlib/Analysis/SpecialFunctions/Trigonometric/ComplexDeriv.lean
53
56
theorem continuousAt_tan {x : β„‚} : ContinuousAt tan x ↔ cos x β‰  0 := by
refine ⟨fun hc hβ‚€ => ?_, fun h => (hasDerivAt_tan h).continuousAt⟩ exact not_tendsto_nhds_of_tendsto_atTop (tendsto_abs_tan_of_cos_eq_zero hβ‚€) _ (hc.norm.tendsto.mono_left inf_le_left)
3
20.085537
1
1.333333
3
1,406
import Mathlib.NumberTheory.Padics.PadicNumbers import Mathlib.RingTheory.DiscreteValuationRing.Basic #align_import number_theory.padics.padic_integers from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9" open Padic Metric LocalRing noncomputable section open scoped Classical def PadicInt (p : β„•) [Fact p.Prime] := { x : β„š_[p] // β€–xβ€– ≀ 1 } #align padic_int PadicInt notation "β„€_[" p "]" => PadicInt p namespace PadicInt variable {p : β„•} [Fact p.Prime] instance : Coe β„€_[p] β„š_[p] := ⟨Subtype.val⟩ theorem ext {x y : β„€_[p]} : (x : β„š_[p]) = y β†’ x = y := Subtype.ext #align padic_int.ext PadicInt.ext variable (p) def subring : Subring β„š_[p] where carrier := { x : β„š_[p] | β€–xβ€– ≀ 1 } zero_mem' := by set_option tactic.skipAssignedInstances false in norm_num one_mem' := by set_option tactic.skipAssignedInstances false in norm_num add_mem' hx hy := (padicNormE.nonarchimedean _ _).trans <| max_le_iff.2 ⟨hx, hy⟩ mul_mem' hx hy := (padicNormE.mul _ _).trans_le <| mul_le_one hx (norm_nonneg _) hy neg_mem' hx := (norm_neg _).trans_le hx #align padic_int.subring PadicInt.subring @[simp] theorem mem_subring_iff {x : β„š_[p]} : x ∈ subring p ↔ β€–xβ€– ≀ 1 := Iff.rfl #align padic_int.mem_subring_iff PadicInt.mem_subring_iff variable {p} instance : Add β„€_[p] := (by infer_instance : Add (subring p)) instance : Mul β„€_[p] := (by infer_instance : Mul (subring p)) instance : Neg β„€_[p] := (by infer_instance : Neg (subring p)) instance : Sub β„€_[p] := (by infer_instance : Sub (subring p)) instance : Zero β„€_[p] := (by infer_instance : Zero (subring p)) instance : Inhabited β„€_[p] := ⟨0⟩ instance : One β„€_[p] := ⟨⟨1, by norm_num⟩⟩ @[simp] theorem mk_zero {h} : (⟨0, h⟩ : β„€_[p]) = (0 : β„€_[p]) := rfl #align padic_int.mk_zero PadicInt.mk_zero @[simp, norm_cast] theorem coe_add (z1 z2 : β„€_[p]) : ((z1 + z2 : β„€_[p]) : β„š_[p]) = z1 + z2 := rfl #align padic_int.coe_add PadicInt.coe_add @[simp, norm_cast] theorem coe_mul (z1 z2 : β„€_[p]) : ((z1 * z2 : β„€_[p]) : β„š_[p]) = z1 * z2 := rfl #align padic_int.coe_mul PadicInt.coe_mul @[simp, norm_cast] theorem coe_neg (z1 : β„€_[p]) : ((-z1 : β„€_[p]) : β„š_[p]) = -z1 := rfl #align padic_int.coe_neg PadicInt.coe_neg @[simp, norm_cast] theorem coe_sub (z1 z2 : β„€_[p]) : ((z1 - z2 : β„€_[p]) : β„š_[p]) = z1 - z2 := rfl #align padic_int.coe_sub PadicInt.coe_sub @[simp, norm_cast] theorem coe_one : ((1 : β„€_[p]) : β„š_[p]) = 1 := rfl #align padic_int.coe_one PadicInt.coe_one @[simp, norm_cast] theorem coe_zero : ((0 : β„€_[p]) : β„š_[p]) = 0 := rfl #align padic_int.coe_zero PadicInt.coe_zero
Mathlib/NumberTheory/Padics/PadicIntegers.lean
145
145
theorem coe_eq_zero (z : β„€_[p]) : (z : β„š_[p]) = 0 ↔ z = 0 := by
rw [← coe_zero, Subtype.coe_inj]
1
2.718282
0
1.333333
3
1,407
import Mathlib.NumberTheory.Padics.PadicNumbers import Mathlib.RingTheory.DiscreteValuationRing.Basic #align_import number_theory.padics.padic_integers from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9" open Padic Metric LocalRing noncomputable section open scoped Classical def PadicInt (p : β„•) [Fact p.Prime] := { x : β„š_[p] // β€–xβ€– ≀ 1 } #align padic_int PadicInt notation "β„€_[" p "]" => PadicInt p namespace PadicInt variable (p : β„•) [hp : Fact p.Prime]
Mathlib/NumberTheory/Padics/PadicIntegers.lean
343
353
theorem exists_pow_neg_lt {Ξ΅ : ℝ} (hΞ΅ : 0 < Ξ΅) : βˆƒ k : β„•, (p : ℝ) ^ (-(k : β„€)) < Ξ΅ := by
obtain ⟨k, hk⟩ := exists_nat_gt Ρ⁻¹ use k rw [← inv_lt_inv hΞ΅ (_root_.zpow_pos_of_pos _ _)] Β· rw [zpow_neg, inv_inv, zpow_natCast] apply lt_of_lt_of_le hk norm_cast apply le_of_lt convert Nat.lt_pow_self _ _ using 1 exact hp.1.one_lt Β· exact mod_cast hp.1.pos
10
22,026.465795
2
1.333333
3
1,407
import Mathlib.NumberTheory.Padics.PadicNumbers import Mathlib.RingTheory.DiscreteValuationRing.Basic #align_import number_theory.padics.padic_integers from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9" open Padic Metric LocalRing noncomputable section open scoped Classical def PadicInt (p : β„•) [Fact p.Prime] := { x : β„š_[p] // β€–xβ€– ≀ 1 } #align padic_int PadicInt notation "β„€_[" p "]" => PadicInt p namespace PadicInt variable (p : β„•) [hp : Fact p.Prime] theorem exists_pow_neg_lt {Ξ΅ : ℝ} (hΞ΅ : 0 < Ξ΅) : βˆƒ k : β„•, (p : ℝ) ^ (-(k : β„€)) < Ξ΅ := by obtain ⟨k, hk⟩ := exists_nat_gt Ρ⁻¹ use k rw [← inv_lt_inv hΞ΅ (_root_.zpow_pos_of_pos _ _)] Β· rw [zpow_neg, inv_inv, zpow_natCast] apply lt_of_lt_of_le hk norm_cast apply le_of_lt convert Nat.lt_pow_self _ _ using 1 exact hp.1.one_lt Β· exact mod_cast hp.1.pos #align padic_int.exists_pow_neg_lt PadicInt.exists_pow_neg_lt
Mathlib/NumberTheory/Padics/PadicIntegers.lean
356
360
theorem exists_pow_neg_lt_rat {Ξ΅ : β„š} (hΞ΅ : 0 < Ξ΅) : βˆƒ k : β„•, (p : β„š) ^ (-(k : β„€)) < Ξ΅ := by
obtain ⟨k, hk⟩ := @exists_pow_neg_lt p _ Ξ΅ (mod_cast hΞ΅) use k rw [show (p : ℝ) = (p : β„š) by simp] at hk exact mod_cast hk
4
54.59815
2
1.333333
3
1,407
import Mathlib.Algebra.MonoidAlgebra.Ideal import Mathlib.Algebra.MvPolynomial.Division #align_import ring_theory.mv_polynomial.ideal from "leanprover-community/mathlib"@"72c366d0475675f1309d3027d3d7d47ee4423951" variable {Οƒ R : Type*} namespace MvPolynomial variable [CommSemiring R]
Mathlib/RingTheory/MvPolynomial/Ideal.lean
32
36
theorem mem_ideal_span_monomial_image {x : MvPolynomial Οƒ R} {s : Set (Οƒ β†’β‚€ β„•)} : x ∈ Ideal.span ((fun s => monomial s (1 : R)) '' s) ↔ βˆ€ xi ∈ x.support, βˆƒ si ∈ s, si ≀ xi := by
refine AddMonoidAlgebra.mem_ideal_span_of'_image.trans ?_ simp_rw [le_iff_exists_add, add_comm] rfl
3
20.085537
1
1.333333
3
1,408
import Mathlib.Algebra.MonoidAlgebra.Ideal import Mathlib.Algebra.MvPolynomial.Division #align_import ring_theory.mv_polynomial.ideal from "leanprover-community/mathlib"@"72c366d0475675f1309d3027d3d7d47ee4423951" variable {Οƒ R : Type*} namespace MvPolynomial variable [CommSemiring R] theorem mem_ideal_span_monomial_image {x : MvPolynomial Οƒ R} {s : Set (Οƒ β†’β‚€ β„•)} : x ∈ Ideal.span ((fun s => monomial s (1 : R)) '' s) ↔ βˆ€ xi ∈ x.support, βˆƒ si ∈ s, si ≀ xi := by refine AddMonoidAlgebra.mem_ideal_span_of'_image.trans ?_ simp_rw [le_iff_exists_add, add_comm] rfl #align mv_polynomial.mem_ideal_span_monomial_image MvPolynomial.mem_ideal_span_monomial_image
Mathlib/RingTheory/MvPolynomial/Ideal.lean
39
43
theorem mem_ideal_span_monomial_image_iff_dvd {x : MvPolynomial Οƒ R} {s : Set (Οƒ β†’β‚€ β„•)} : x ∈ Ideal.span ((fun s => monomial s (1 : R)) '' s) ↔ βˆ€ xi ∈ x.support, βˆƒ si ∈ s, monomial si 1 ∣ monomial xi (x.coeff xi) := by
refine mem_ideal_span_monomial_image.trans (forallβ‚‚_congr fun xi hxi => ?_) simp_rw [monomial_dvd_monomial, one_dvd, and_true_iff, mem_support_iff.mp hxi, false_or_iff]
2
7.389056
1
1.333333
3
1,408
import Mathlib.Algebra.MonoidAlgebra.Ideal import Mathlib.Algebra.MvPolynomial.Division #align_import ring_theory.mv_polynomial.ideal from "leanprover-community/mathlib"@"72c366d0475675f1309d3027d3d7d47ee4423951" variable {Οƒ R : Type*} namespace MvPolynomial variable [CommSemiring R] theorem mem_ideal_span_monomial_image {x : MvPolynomial Οƒ R} {s : Set (Οƒ β†’β‚€ β„•)} : x ∈ Ideal.span ((fun s => monomial s (1 : R)) '' s) ↔ βˆ€ xi ∈ x.support, βˆƒ si ∈ s, si ≀ xi := by refine AddMonoidAlgebra.mem_ideal_span_of'_image.trans ?_ simp_rw [le_iff_exists_add, add_comm] rfl #align mv_polynomial.mem_ideal_span_monomial_image MvPolynomial.mem_ideal_span_monomial_image theorem mem_ideal_span_monomial_image_iff_dvd {x : MvPolynomial Οƒ R} {s : Set (Οƒ β†’β‚€ β„•)} : x ∈ Ideal.span ((fun s => monomial s (1 : R)) '' s) ↔ βˆ€ xi ∈ x.support, βˆƒ si ∈ s, monomial si 1 ∣ monomial xi (x.coeff xi) := by refine mem_ideal_span_monomial_image.trans (forallβ‚‚_congr fun xi hxi => ?_) simp_rw [monomial_dvd_monomial, one_dvd, and_true_iff, mem_support_iff.mp hxi, false_or_iff] #align mv_polynomial.mem_ideal_span_monomial_image_iff_dvd MvPolynomial.mem_ideal_span_monomial_image_iff_dvd
Mathlib/RingTheory/MvPolynomial/Ideal.lean
48
54
theorem mem_ideal_span_X_image {x : MvPolynomial Οƒ R} {s : Set Οƒ} : x ∈ Ideal.span (MvPolynomial.X '' s : Set (MvPolynomial Οƒ R)) ↔ βˆ€ m ∈ x.support, βˆƒ i ∈ s, (m : Οƒ β†’β‚€ β„•) i β‰  0 := by
have := @mem_ideal_span_monomial_image Οƒ R _ x ((fun i => Finsupp.single i 1) '' s) rw [Set.image_image] at this refine this.trans ?_ simp [Nat.one_le_iff_ne_zero]
4
54.59815
2
1.333333
3
1,408
import Mathlib.Algebra.Field.Subfield import Mathlib.Algebra.GroupWithZero.Divisibility import Mathlib.Topology.Algebra.GroupWithZero import Mathlib.Topology.Algebra.Ring.Basic import Mathlib.Topology.Order.LocalExtr #align_import topology.algebra.field from "leanprover-community/mathlib"@"c10e724be91096453ee3db13862b9fb9a992fef2" variable {K : Type*} [DivisionRing K] [TopologicalSpace K] theorem Filter.tendsto_cocompact_mul_leftβ‚€ [ContinuousMul K] {a : K} (ha : a β‰  0) : Filter.Tendsto (fun x : K => a * x) (Filter.cocompact K) (Filter.cocompact K) := Filter.tendsto_cocompact_mul_left (inv_mul_cancel ha) #align filter.tendsto_cocompact_mul_leftβ‚€ Filter.tendsto_cocompact_mul_leftβ‚€ theorem Filter.tendsto_cocompact_mul_rightβ‚€ [ContinuousMul K] {a : K} (ha : a β‰  0) : Filter.Tendsto (fun x : K => x * a) (Filter.cocompact K) (Filter.cocompact K) := Filter.tendsto_cocompact_mul_right (mul_inv_cancel ha) #align filter.tendsto_cocompact_mul_rightβ‚€ Filter.tendsto_cocompact_mul_rightβ‚€ variable (K) class TopologicalDivisionRing extends TopologicalRing K, HasContinuousInvβ‚€ K : Prop #align topological_division_ring TopologicalDivisionRing section LocalExtr variable {Ξ± Ξ² : Type*} [TopologicalSpace Ξ±] [LinearOrderedSemifield Ξ²] {a : Ξ±} open Topology
Mathlib/Topology/Algebra/Field.lean
112
114
theorem IsLocalMin.inv {f : Ξ± β†’ Ξ²} {a : Ξ±} (h1 : IsLocalMin f a) (h2 : βˆ€αΆ  z in 𝓝 a, 0 < f z) : IsLocalMax f⁻¹ a := by
filter_upwards [h1, h2] with z h3 h4 using(inv_le_inv h4 h2.self_of_nhds).mpr h3
1
2.718282
0
1.333333
3
1,409
import Mathlib.Algebra.Field.Subfield import Mathlib.Algebra.GroupWithZero.Divisibility import Mathlib.Topology.Algebra.GroupWithZero import Mathlib.Topology.Algebra.Ring.Basic import Mathlib.Topology.Order.LocalExtr #align_import topology.algebra.field from "leanprover-community/mathlib"@"c10e724be91096453ee3db13862b9fb9a992fef2" variable {K : Type*} [DivisionRing K] [TopologicalSpace K] theorem Filter.tendsto_cocompact_mul_leftβ‚€ [ContinuousMul K] {a : K} (ha : a β‰  0) : Filter.Tendsto (fun x : K => a * x) (Filter.cocompact K) (Filter.cocompact K) := Filter.tendsto_cocompact_mul_left (inv_mul_cancel ha) #align filter.tendsto_cocompact_mul_leftβ‚€ Filter.tendsto_cocompact_mul_leftβ‚€ theorem Filter.tendsto_cocompact_mul_rightβ‚€ [ContinuousMul K] {a : K} (ha : a β‰  0) : Filter.Tendsto (fun x : K => x * a) (Filter.cocompact K) (Filter.cocompact K) := Filter.tendsto_cocompact_mul_right (mul_inv_cancel ha) #align filter.tendsto_cocompact_mul_rightβ‚€ Filter.tendsto_cocompact_mul_rightβ‚€ variable (K) class TopologicalDivisionRing extends TopologicalRing K, HasContinuousInvβ‚€ K : Prop #align topological_division_ring TopologicalDivisionRing section Preconnected open Set variable {Ξ± π•œ : Type*} {f g : Ξ± β†’ π•œ} {S : Set Ξ±} [TopologicalSpace Ξ±] [TopologicalSpace π•œ] [T1Space π•œ]
Mathlib/Topology/Algebra/Field.lean
130
136
theorem IsPreconnected.eq_one_or_eq_neg_one_of_sq_eq [Ring π•œ] [NoZeroDivisors π•œ] (hS : IsPreconnected S) (hf : ContinuousOn f S) (hsq : EqOn (f ^ 2) 1 S) : EqOn f 1 S ∨ EqOn f (-1) S := by
have : DiscreteTopology ({1, -1} : Set π•œ) := discrete_of_t1_of_finite have hmaps : MapsTo f S {1, -1} := by simpa only [EqOn, Pi.one_apply, Pi.pow_apply, sq_eq_one_iff] using hsq simpa using hS.eqOn_const_of_mapsTo hf hmaps
4
54.59815
2
1.333333
3
1,409
import Mathlib.Algebra.Field.Subfield import Mathlib.Algebra.GroupWithZero.Divisibility import Mathlib.Topology.Algebra.GroupWithZero import Mathlib.Topology.Algebra.Ring.Basic import Mathlib.Topology.Order.LocalExtr #align_import topology.algebra.field from "leanprover-community/mathlib"@"c10e724be91096453ee3db13862b9fb9a992fef2" variable {K : Type*} [DivisionRing K] [TopologicalSpace K] theorem Filter.tendsto_cocompact_mul_leftβ‚€ [ContinuousMul K] {a : K} (ha : a β‰  0) : Filter.Tendsto (fun x : K => a * x) (Filter.cocompact K) (Filter.cocompact K) := Filter.tendsto_cocompact_mul_left (inv_mul_cancel ha) #align filter.tendsto_cocompact_mul_leftβ‚€ Filter.tendsto_cocompact_mul_leftβ‚€ theorem Filter.tendsto_cocompact_mul_rightβ‚€ [ContinuousMul K] {a : K} (ha : a β‰  0) : Filter.Tendsto (fun x : K => x * a) (Filter.cocompact K) (Filter.cocompact K) := Filter.tendsto_cocompact_mul_right (mul_inv_cancel ha) #align filter.tendsto_cocompact_mul_rightβ‚€ Filter.tendsto_cocompact_mul_rightβ‚€ variable (K) class TopologicalDivisionRing extends TopologicalRing K, HasContinuousInvβ‚€ K : Prop #align topological_division_ring TopologicalDivisionRing section Preconnected open Set variable {Ξ± π•œ : Type*} {f g : Ξ± β†’ π•œ} {S : Set Ξ±} [TopologicalSpace Ξ±] [TopologicalSpace π•œ] [T1Space π•œ] theorem IsPreconnected.eq_one_or_eq_neg_one_of_sq_eq [Ring π•œ] [NoZeroDivisors π•œ] (hS : IsPreconnected S) (hf : ContinuousOn f S) (hsq : EqOn (f ^ 2) 1 S) : EqOn f 1 S ∨ EqOn f (-1) S := by have : DiscreteTopology ({1, -1} : Set π•œ) := discrete_of_t1_of_finite have hmaps : MapsTo f S {1, -1} := by simpa only [EqOn, Pi.one_apply, Pi.pow_apply, sq_eq_one_iff] using hsq simpa using hS.eqOn_const_of_mapsTo hf hmaps #align is_preconnected.eq_one_or_eq_neg_one_of_sq_eq IsPreconnected.eq_one_or_eq_neg_one_of_sq_eq
Mathlib/Topology/Algebra/Field.lean
142
149
theorem IsPreconnected.eq_or_eq_neg_of_sq_eq [Field π•œ] [HasContinuousInvβ‚€ π•œ] [ContinuousMul π•œ] (hS : IsPreconnected S) (hf : ContinuousOn f S) (hg : ContinuousOn g S) (hsq : EqOn (f ^ 2) (g ^ 2) S) (hg_ne : βˆ€ {x : Ξ±}, x ∈ S β†’ g x β‰  0) : EqOn f g S ∨ EqOn f (-g) S := by
have hsq : EqOn ((f / g) ^ 2) 1 S := fun x hx => by simpa [div_eq_one_iff_eq (pow_ne_zero _ (hg_ne hx))] using hsq hx simpa (config := { contextual := true }) [EqOn, div_eq_iff (hg_ne _)] using hS.eq_one_or_eq_neg_one_of_sq_eq (hf.div hg fun z => hg_ne) hsq
4
54.59815
2
1.333333
3
1,409
import Mathlib.Data.ZMod.Basic import Mathlib.Algebra.Group.Nat import Mathlib.Tactic.IntervalCases import Mathlib.GroupTheory.SpecificGroups.Dihedral import Mathlib.GroupTheory.SpecificGroups.Cyclic #align_import group_theory.specific_groups.quaternion from "leanprover-community/mathlib"@"879155bff5af618b9062cbb2915347dafd749ad6" inductive QuaternionGroup (n : β„•) : Type | a : ZMod (2 * n) β†’ QuaternionGroup n | xa : ZMod (2 * n) β†’ QuaternionGroup n deriving DecidableEq #align quaternion_group QuaternionGroup namespace QuaternionGroup variable {n : β„•} private def mul : QuaternionGroup n β†’ QuaternionGroup n β†’ QuaternionGroup n | a i, a j => a (i + j) | a i, xa j => xa (j - i) | xa i, a j => xa (i + j) | xa i, xa j => a (n + j - i) private def one : QuaternionGroup n := a 0 instance : Inhabited (QuaternionGroup n) := ⟨one⟩ private def inv : QuaternionGroup n β†’ QuaternionGroup n | a i => a (-i) | xa i => xa (n + i) instance : Group (QuaternionGroup n) where mul := mul mul_assoc := by rintro (i | i) (j | j) (k | k) <;> simp only [(Β· * Β·), mul] <;> ring_nf congr calc -(n : ZMod (2 * n)) = 0 - n := by rw [zero_sub] _ = 2 * n - n := by norm_cast; simp _ = n := by ring one := one one_mul := by rintro (i | i) Β· exact congr_arg a (zero_add i) Β· exact congr_arg xa (sub_zero i) mul_one := by rintro (i | i) Β· exact congr_arg a (add_zero i) Β· exact congr_arg xa (add_zero i) inv := inv mul_left_inv := by rintro (i | i) Β· exact congr_arg a (neg_add_self i) Β· exact congr_arg a (sub_self (n + i)) @[simp] theorem a_mul_a (i j : ZMod (2 * n)) : a i * a j = a (i + j) := rfl #align quaternion_group.a_mul_a QuaternionGroup.a_mul_a @[simp] theorem a_mul_xa (i j : ZMod (2 * n)) : a i * xa j = xa (j - i) := rfl #align quaternion_group.a_mul_xa QuaternionGroup.a_mul_xa @[simp] theorem xa_mul_a (i j : ZMod (2 * n)) : xa i * a j = xa (i + j) := rfl #align quaternion_group.xa_mul_a QuaternionGroup.xa_mul_a @[simp] theorem xa_mul_xa (i j : ZMod (2 * n)) : xa i * xa j = a ((n : ZMod (2 * n)) + j - i) := rfl #align quaternion_group.xa_mul_xa QuaternionGroup.xa_mul_xa theorem one_def : (1 : QuaternionGroup n) = a 0 := rfl #align quaternion_group.one_def QuaternionGroup.one_def private def fintypeHelper : Sum (ZMod (2 * n)) (ZMod (2 * n)) ≃ QuaternionGroup n where invFun i := match i with | a j => Sum.inl j | xa j => Sum.inr j toFun i := match i with | Sum.inl j => a j | Sum.inr j => xa j left_inv := by rintro (x | x) <;> rfl right_inv := by rintro (x | x) <;> rfl def quaternionGroupZeroEquivDihedralGroupZero : QuaternionGroup 0 ≃* DihedralGroup 0 where toFun i := -- Porting note: Originally `QuaternionGroup.recOn i DihedralGroup.r DihedralGroup.sr` match i with | a j => DihedralGroup.r j | xa j => DihedralGroup.sr j invFun i := match i with | DihedralGroup.r j => a j | DihedralGroup.sr j => xa j left_inv := by rintro (k | k) <;> rfl right_inv := by rintro (k | k) <;> rfl map_mul' := by rintro (k | k) (l | l) <;> simp #align quaternion_group.quaternion_group_zero_equiv_dihedral_group_zero QuaternionGroup.quaternionGroupZeroEquivDihedralGroupZero instance [NeZero n] : Fintype (QuaternionGroup n) := Fintype.ofEquiv _ fintypeHelper instance : Nontrivial (QuaternionGroup n) := ⟨⟨a 0, xa 0, by revert n; simp⟩⟩ -- Porting note: `revert n; simp` was `decide`
Mathlib/GroupTheory/SpecificGroups/Quaternion.lean
174
176
theorem card [NeZero n] : Fintype.card (QuaternionGroup n) = 4 * n := by
rw [← Fintype.card_eq.mpr ⟨fintypeHelper⟩, Fintype.card_sum, ZMod.card, two_mul] ring
2
7.389056
1
1.333333
6
1,410
import Mathlib.Data.ZMod.Basic import Mathlib.Algebra.Group.Nat import Mathlib.Tactic.IntervalCases import Mathlib.GroupTheory.SpecificGroups.Dihedral import Mathlib.GroupTheory.SpecificGroups.Cyclic #align_import group_theory.specific_groups.quaternion from "leanprover-community/mathlib"@"879155bff5af618b9062cbb2915347dafd749ad6" inductive QuaternionGroup (n : β„•) : Type | a : ZMod (2 * n) β†’ QuaternionGroup n | xa : ZMod (2 * n) β†’ QuaternionGroup n deriving DecidableEq #align quaternion_group QuaternionGroup namespace QuaternionGroup variable {n : β„•} private def mul : QuaternionGroup n β†’ QuaternionGroup n β†’ QuaternionGroup n | a i, a j => a (i + j) | a i, xa j => xa (j - i) | xa i, a j => xa (i + j) | xa i, xa j => a (n + j - i) private def one : QuaternionGroup n := a 0 instance : Inhabited (QuaternionGroup n) := ⟨one⟩ private def inv : QuaternionGroup n β†’ QuaternionGroup n | a i => a (-i) | xa i => xa (n + i) instance : Group (QuaternionGroup n) where mul := mul mul_assoc := by rintro (i | i) (j | j) (k | k) <;> simp only [(Β· * Β·), mul] <;> ring_nf congr calc -(n : ZMod (2 * n)) = 0 - n := by rw [zero_sub] _ = 2 * n - n := by norm_cast; simp _ = n := by ring one := one one_mul := by rintro (i | i) Β· exact congr_arg a (zero_add i) Β· exact congr_arg xa (sub_zero i) mul_one := by rintro (i | i) Β· exact congr_arg a (add_zero i) Β· exact congr_arg xa (add_zero i) inv := inv mul_left_inv := by rintro (i | i) Β· exact congr_arg a (neg_add_self i) Β· exact congr_arg a (sub_self (n + i)) @[simp] theorem a_mul_a (i j : ZMod (2 * n)) : a i * a j = a (i + j) := rfl #align quaternion_group.a_mul_a QuaternionGroup.a_mul_a @[simp] theorem a_mul_xa (i j : ZMod (2 * n)) : a i * xa j = xa (j - i) := rfl #align quaternion_group.a_mul_xa QuaternionGroup.a_mul_xa @[simp] theorem xa_mul_a (i j : ZMod (2 * n)) : xa i * a j = xa (i + j) := rfl #align quaternion_group.xa_mul_a QuaternionGroup.xa_mul_a @[simp] theorem xa_mul_xa (i j : ZMod (2 * n)) : xa i * xa j = a ((n : ZMod (2 * n)) + j - i) := rfl #align quaternion_group.xa_mul_xa QuaternionGroup.xa_mul_xa theorem one_def : (1 : QuaternionGroup n) = a 0 := rfl #align quaternion_group.one_def QuaternionGroup.one_def private def fintypeHelper : Sum (ZMod (2 * n)) (ZMod (2 * n)) ≃ QuaternionGroup n where invFun i := match i with | a j => Sum.inl j | xa j => Sum.inr j toFun i := match i with | Sum.inl j => a j | Sum.inr j => xa j left_inv := by rintro (x | x) <;> rfl right_inv := by rintro (x | x) <;> rfl def quaternionGroupZeroEquivDihedralGroupZero : QuaternionGroup 0 ≃* DihedralGroup 0 where toFun i := -- Porting note: Originally `QuaternionGroup.recOn i DihedralGroup.r DihedralGroup.sr` match i with | a j => DihedralGroup.r j | xa j => DihedralGroup.sr j invFun i := match i with | DihedralGroup.r j => a j | DihedralGroup.sr j => xa j left_inv := by rintro (k | k) <;> rfl right_inv := by rintro (k | k) <;> rfl map_mul' := by rintro (k | k) (l | l) <;> simp #align quaternion_group.quaternion_group_zero_equiv_dihedral_group_zero QuaternionGroup.quaternionGroupZeroEquivDihedralGroupZero instance [NeZero n] : Fintype (QuaternionGroup n) := Fintype.ofEquiv _ fintypeHelper instance : Nontrivial (QuaternionGroup n) := ⟨⟨a 0, xa 0, by revert n; simp⟩⟩ -- Porting note: `revert n; simp` was `decide` theorem card [NeZero n] : Fintype.card (QuaternionGroup n) = 4 * n := by rw [← Fintype.card_eq.mpr ⟨fintypeHelper⟩, Fintype.card_sum, ZMod.card, two_mul] ring #align quaternion_group.card QuaternionGroup.card @[simp]
Mathlib/GroupTheory/SpecificGroups/Quaternion.lean
180
185
theorem a_one_pow (k : β„•) : (a 1 : QuaternionGroup n) ^ k = a k := by
induction' k with k IH Β· rw [Nat.cast_zero]; rfl Β· rw [pow_succ, IH, a_mul_a] congr 1 norm_cast
5
148.413159
2
1.333333
6
1,410
import Mathlib.Data.ZMod.Basic import Mathlib.Algebra.Group.Nat import Mathlib.Tactic.IntervalCases import Mathlib.GroupTheory.SpecificGroups.Dihedral import Mathlib.GroupTheory.SpecificGroups.Cyclic #align_import group_theory.specific_groups.quaternion from "leanprover-community/mathlib"@"879155bff5af618b9062cbb2915347dafd749ad6" inductive QuaternionGroup (n : β„•) : Type | a : ZMod (2 * n) β†’ QuaternionGroup n | xa : ZMod (2 * n) β†’ QuaternionGroup n deriving DecidableEq #align quaternion_group QuaternionGroup namespace QuaternionGroup variable {n : β„•} private def mul : QuaternionGroup n β†’ QuaternionGroup n β†’ QuaternionGroup n | a i, a j => a (i + j) | a i, xa j => xa (j - i) | xa i, a j => xa (i + j) | xa i, xa j => a (n + j - i) private def one : QuaternionGroup n := a 0 instance : Inhabited (QuaternionGroup n) := ⟨one⟩ private def inv : QuaternionGroup n β†’ QuaternionGroup n | a i => a (-i) | xa i => xa (n + i) instance : Group (QuaternionGroup n) where mul := mul mul_assoc := by rintro (i | i) (j | j) (k | k) <;> simp only [(Β· * Β·), mul] <;> ring_nf congr calc -(n : ZMod (2 * n)) = 0 - n := by rw [zero_sub] _ = 2 * n - n := by norm_cast; simp _ = n := by ring one := one one_mul := by rintro (i | i) Β· exact congr_arg a (zero_add i) Β· exact congr_arg xa (sub_zero i) mul_one := by rintro (i | i) Β· exact congr_arg a (add_zero i) Β· exact congr_arg xa (add_zero i) inv := inv mul_left_inv := by rintro (i | i) Β· exact congr_arg a (neg_add_self i) Β· exact congr_arg a (sub_self (n + i)) @[simp] theorem a_mul_a (i j : ZMod (2 * n)) : a i * a j = a (i + j) := rfl #align quaternion_group.a_mul_a QuaternionGroup.a_mul_a @[simp] theorem a_mul_xa (i j : ZMod (2 * n)) : a i * xa j = xa (j - i) := rfl #align quaternion_group.a_mul_xa QuaternionGroup.a_mul_xa @[simp] theorem xa_mul_a (i j : ZMod (2 * n)) : xa i * a j = xa (i + j) := rfl #align quaternion_group.xa_mul_a QuaternionGroup.xa_mul_a @[simp] theorem xa_mul_xa (i j : ZMod (2 * n)) : xa i * xa j = a ((n : ZMod (2 * n)) + j - i) := rfl #align quaternion_group.xa_mul_xa QuaternionGroup.xa_mul_xa theorem one_def : (1 : QuaternionGroup n) = a 0 := rfl #align quaternion_group.one_def QuaternionGroup.one_def private def fintypeHelper : Sum (ZMod (2 * n)) (ZMod (2 * n)) ≃ QuaternionGroup n where invFun i := match i with | a j => Sum.inl j | xa j => Sum.inr j toFun i := match i with | Sum.inl j => a j | Sum.inr j => xa j left_inv := by rintro (x | x) <;> rfl right_inv := by rintro (x | x) <;> rfl def quaternionGroupZeroEquivDihedralGroupZero : QuaternionGroup 0 ≃* DihedralGroup 0 where toFun i := -- Porting note: Originally `QuaternionGroup.recOn i DihedralGroup.r DihedralGroup.sr` match i with | a j => DihedralGroup.r j | xa j => DihedralGroup.sr j invFun i := match i with | DihedralGroup.r j => a j | DihedralGroup.sr j => xa j left_inv := by rintro (k | k) <;> rfl right_inv := by rintro (k | k) <;> rfl map_mul' := by rintro (k | k) (l | l) <;> simp #align quaternion_group.quaternion_group_zero_equiv_dihedral_group_zero QuaternionGroup.quaternionGroupZeroEquivDihedralGroupZero instance [NeZero n] : Fintype (QuaternionGroup n) := Fintype.ofEquiv _ fintypeHelper instance : Nontrivial (QuaternionGroup n) := ⟨⟨a 0, xa 0, by revert n; simp⟩⟩ -- Porting note: `revert n; simp` was `decide` theorem card [NeZero n] : Fintype.card (QuaternionGroup n) = 4 * n := by rw [← Fintype.card_eq.mpr ⟨fintypeHelper⟩, Fintype.card_sum, ZMod.card, two_mul] ring #align quaternion_group.card QuaternionGroup.card @[simp] theorem a_one_pow (k : β„•) : (a 1 : QuaternionGroup n) ^ k = a k := by induction' k with k IH Β· rw [Nat.cast_zero]; rfl Β· rw [pow_succ, IH, a_mul_a] congr 1 norm_cast #align quaternion_group.a_one_pow QuaternionGroup.a_one_pow -- @[simp] -- Porting note: simp changes this to `a 0 = 1`, so this is no longer a good simp lemma.
Mathlib/GroupTheory/SpecificGroups/Quaternion.lean
189
192
theorem a_one_pow_n : (a 1 : QuaternionGroup n) ^ (2 * n) = 1 := by
rw [a_one_pow, one_def] congr 1 exact ZMod.natCast_self _
3
20.085537
1
1.333333
6
1,410
import Mathlib.Data.ZMod.Basic import Mathlib.Algebra.Group.Nat import Mathlib.Tactic.IntervalCases import Mathlib.GroupTheory.SpecificGroups.Dihedral import Mathlib.GroupTheory.SpecificGroups.Cyclic #align_import group_theory.specific_groups.quaternion from "leanprover-community/mathlib"@"879155bff5af618b9062cbb2915347dafd749ad6" inductive QuaternionGroup (n : β„•) : Type | a : ZMod (2 * n) β†’ QuaternionGroup n | xa : ZMod (2 * n) β†’ QuaternionGroup n deriving DecidableEq #align quaternion_group QuaternionGroup namespace QuaternionGroup variable {n : β„•} private def mul : QuaternionGroup n β†’ QuaternionGroup n β†’ QuaternionGroup n | a i, a j => a (i + j) | a i, xa j => xa (j - i) | xa i, a j => xa (i + j) | xa i, xa j => a (n + j - i) private def one : QuaternionGroup n := a 0 instance : Inhabited (QuaternionGroup n) := ⟨one⟩ private def inv : QuaternionGroup n β†’ QuaternionGroup n | a i => a (-i) | xa i => xa (n + i) instance : Group (QuaternionGroup n) where mul := mul mul_assoc := by rintro (i | i) (j | j) (k | k) <;> simp only [(Β· * Β·), mul] <;> ring_nf congr calc -(n : ZMod (2 * n)) = 0 - n := by rw [zero_sub] _ = 2 * n - n := by norm_cast; simp _ = n := by ring one := one one_mul := by rintro (i | i) Β· exact congr_arg a (zero_add i) Β· exact congr_arg xa (sub_zero i) mul_one := by rintro (i | i) Β· exact congr_arg a (add_zero i) Β· exact congr_arg xa (add_zero i) inv := inv mul_left_inv := by rintro (i | i) Β· exact congr_arg a (neg_add_self i) Β· exact congr_arg a (sub_self (n + i)) @[simp] theorem a_mul_a (i j : ZMod (2 * n)) : a i * a j = a (i + j) := rfl #align quaternion_group.a_mul_a QuaternionGroup.a_mul_a @[simp] theorem a_mul_xa (i j : ZMod (2 * n)) : a i * xa j = xa (j - i) := rfl #align quaternion_group.a_mul_xa QuaternionGroup.a_mul_xa @[simp] theorem xa_mul_a (i j : ZMod (2 * n)) : xa i * a j = xa (i + j) := rfl #align quaternion_group.xa_mul_a QuaternionGroup.xa_mul_a @[simp] theorem xa_mul_xa (i j : ZMod (2 * n)) : xa i * xa j = a ((n : ZMod (2 * n)) + j - i) := rfl #align quaternion_group.xa_mul_xa QuaternionGroup.xa_mul_xa theorem one_def : (1 : QuaternionGroup n) = a 0 := rfl #align quaternion_group.one_def QuaternionGroup.one_def private def fintypeHelper : Sum (ZMod (2 * n)) (ZMod (2 * n)) ≃ QuaternionGroup n where invFun i := match i with | a j => Sum.inl j | xa j => Sum.inr j toFun i := match i with | Sum.inl j => a j | Sum.inr j => xa j left_inv := by rintro (x | x) <;> rfl right_inv := by rintro (x | x) <;> rfl def quaternionGroupZeroEquivDihedralGroupZero : QuaternionGroup 0 ≃* DihedralGroup 0 where toFun i := -- Porting note: Originally `QuaternionGroup.recOn i DihedralGroup.r DihedralGroup.sr` match i with | a j => DihedralGroup.r j | xa j => DihedralGroup.sr j invFun i := match i with | DihedralGroup.r j => a j | DihedralGroup.sr j => xa j left_inv := by rintro (k | k) <;> rfl right_inv := by rintro (k | k) <;> rfl map_mul' := by rintro (k | k) (l | l) <;> simp #align quaternion_group.quaternion_group_zero_equiv_dihedral_group_zero QuaternionGroup.quaternionGroupZeroEquivDihedralGroupZero instance [NeZero n] : Fintype (QuaternionGroup n) := Fintype.ofEquiv _ fintypeHelper instance : Nontrivial (QuaternionGroup n) := ⟨⟨a 0, xa 0, by revert n; simp⟩⟩ -- Porting note: `revert n; simp` was `decide` theorem card [NeZero n] : Fintype.card (QuaternionGroup n) = 4 * n := by rw [← Fintype.card_eq.mpr ⟨fintypeHelper⟩, Fintype.card_sum, ZMod.card, two_mul] ring #align quaternion_group.card QuaternionGroup.card @[simp] theorem a_one_pow (k : β„•) : (a 1 : QuaternionGroup n) ^ k = a k := by induction' k with k IH Β· rw [Nat.cast_zero]; rfl Β· rw [pow_succ, IH, a_mul_a] congr 1 norm_cast #align quaternion_group.a_one_pow QuaternionGroup.a_one_pow -- @[simp] -- Porting note: simp changes this to `a 0 = 1`, so this is no longer a good simp lemma. theorem a_one_pow_n : (a 1 : QuaternionGroup n) ^ (2 * n) = 1 := by rw [a_one_pow, one_def] congr 1 exact ZMod.natCast_self _ #align quaternion_group.a_one_pow_n QuaternionGroup.a_one_pow_n @[simp]
Mathlib/GroupTheory/SpecificGroups/Quaternion.lean
196
196
theorem xa_sq (i : ZMod (2 * n)) : xa i ^ 2 = a n := by
simp [sq]
1
2.718282
0
1.333333
6
1,410
import Mathlib.Data.ZMod.Basic import Mathlib.Algebra.Group.Nat import Mathlib.Tactic.IntervalCases import Mathlib.GroupTheory.SpecificGroups.Dihedral import Mathlib.GroupTheory.SpecificGroups.Cyclic #align_import group_theory.specific_groups.quaternion from "leanprover-community/mathlib"@"879155bff5af618b9062cbb2915347dafd749ad6" inductive QuaternionGroup (n : β„•) : Type | a : ZMod (2 * n) β†’ QuaternionGroup n | xa : ZMod (2 * n) β†’ QuaternionGroup n deriving DecidableEq #align quaternion_group QuaternionGroup namespace QuaternionGroup variable {n : β„•} private def mul : QuaternionGroup n β†’ QuaternionGroup n β†’ QuaternionGroup n | a i, a j => a (i + j) | a i, xa j => xa (j - i) | xa i, a j => xa (i + j) | xa i, xa j => a (n + j - i) private def one : QuaternionGroup n := a 0 instance : Inhabited (QuaternionGroup n) := ⟨one⟩ private def inv : QuaternionGroup n β†’ QuaternionGroup n | a i => a (-i) | xa i => xa (n + i) instance : Group (QuaternionGroup n) where mul := mul mul_assoc := by rintro (i | i) (j | j) (k | k) <;> simp only [(Β· * Β·), mul] <;> ring_nf congr calc -(n : ZMod (2 * n)) = 0 - n := by rw [zero_sub] _ = 2 * n - n := by norm_cast; simp _ = n := by ring one := one one_mul := by rintro (i | i) Β· exact congr_arg a (zero_add i) Β· exact congr_arg xa (sub_zero i) mul_one := by rintro (i | i) Β· exact congr_arg a (add_zero i) Β· exact congr_arg xa (add_zero i) inv := inv mul_left_inv := by rintro (i | i) Β· exact congr_arg a (neg_add_self i) Β· exact congr_arg a (sub_self (n + i)) @[simp] theorem a_mul_a (i j : ZMod (2 * n)) : a i * a j = a (i + j) := rfl #align quaternion_group.a_mul_a QuaternionGroup.a_mul_a @[simp] theorem a_mul_xa (i j : ZMod (2 * n)) : a i * xa j = xa (j - i) := rfl #align quaternion_group.a_mul_xa QuaternionGroup.a_mul_xa @[simp] theorem xa_mul_a (i j : ZMod (2 * n)) : xa i * a j = xa (i + j) := rfl #align quaternion_group.xa_mul_a QuaternionGroup.xa_mul_a @[simp] theorem xa_mul_xa (i j : ZMod (2 * n)) : xa i * xa j = a ((n : ZMod (2 * n)) + j - i) := rfl #align quaternion_group.xa_mul_xa QuaternionGroup.xa_mul_xa theorem one_def : (1 : QuaternionGroup n) = a 0 := rfl #align quaternion_group.one_def QuaternionGroup.one_def private def fintypeHelper : Sum (ZMod (2 * n)) (ZMod (2 * n)) ≃ QuaternionGroup n where invFun i := match i with | a j => Sum.inl j | xa j => Sum.inr j toFun i := match i with | Sum.inl j => a j | Sum.inr j => xa j left_inv := by rintro (x | x) <;> rfl right_inv := by rintro (x | x) <;> rfl def quaternionGroupZeroEquivDihedralGroupZero : QuaternionGroup 0 ≃* DihedralGroup 0 where toFun i := -- Porting note: Originally `QuaternionGroup.recOn i DihedralGroup.r DihedralGroup.sr` match i with | a j => DihedralGroup.r j | xa j => DihedralGroup.sr j invFun i := match i with | DihedralGroup.r j => a j | DihedralGroup.sr j => xa j left_inv := by rintro (k | k) <;> rfl right_inv := by rintro (k | k) <;> rfl map_mul' := by rintro (k | k) (l | l) <;> simp #align quaternion_group.quaternion_group_zero_equiv_dihedral_group_zero QuaternionGroup.quaternionGroupZeroEquivDihedralGroupZero instance [NeZero n] : Fintype (QuaternionGroup n) := Fintype.ofEquiv _ fintypeHelper instance : Nontrivial (QuaternionGroup n) := ⟨⟨a 0, xa 0, by revert n; simp⟩⟩ -- Porting note: `revert n; simp` was `decide` theorem card [NeZero n] : Fintype.card (QuaternionGroup n) = 4 * n := by rw [← Fintype.card_eq.mpr ⟨fintypeHelper⟩, Fintype.card_sum, ZMod.card, two_mul] ring #align quaternion_group.card QuaternionGroup.card @[simp] theorem a_one_pow (k : β„•) : (a 1 : QuaternionGroup n) ^ k = a k := by induction' k with k IH Β· rw [Nat.cast_zero]; rfl Β· rw [pow_succ, IH, a_mul_a] congr 1 norm_cast #align quaternion_group.a_one_pow QuaternionGroup.a_one_pow -- @[simp] -- Porting note: simp changes this to `a 0 = 1`, so this is no longer a good simp lemma. theorem a_one_pow_n : (a 1 : QuaternionGroup n) ^ (2 * n) = 1 := by rw [a_one_pow, one_def] congr 1 exact ZMod.natCast_self _ #align quaternion_group.a_one_pow_n QuaternionGroup.a_one_pow_n @[simp] theorem xa_sq (i : ZMod (2 * n)) : xa i ^ 2 = a n := by simp [sq] #align quaternion_group.xa_sq QuaternionGroup.xa_sq @[simp]
Mathlib/GroupTheory/SpecificGroups/Quaternion.lean
200
205
theorem xa_pow_four (i : ZMod (2 * n)) : xa i ^ 4 = 1 := by
rw [pow_succ, pow_succ, sq, xa_mul_xa, a_mul_xa, xa_mul_xa, add_sub_cancel_right, add_sub_assoc, sub_sub_cancel] norm_cast rw [← two_mul] simp [one_def]
5
148.413159
2
1.333333
6
1,410
import Mathlib.Data.ZMod.Basic import Mathlib.Algebra.Group.Nat import Mathlib.Tactic.IntervalCases import Mathlib.GroupTheory.SpecificGroups.Dihedral import Mathlib.GroupTheory.SpecificGroups.Cyclic #align_import group_theory.specific_groups.quaternion from "leanprover-community/mathlib"@"879155bff5af618b9062cbb2915347dafd749ad6" inductive QuaternionGroup (n : β„•) : Type | a : ZMod (2 * n) β†’ QuaternionGroup n | xa : ZMod (2 * n) β†’ QuaternionGroup n deriving DecidableEq #align quaternion_group QuaternionGroup namespace QuaternionGroup variable {n : β„•} private def mul : QuaternionGroup n β†’ QuaternionGroup n β†’ QuaternionGroup n | a i, a j => a (i + j) | a i, xa j => xa (j - i) | xa i, a j => xa (i + j) | xa i, xa j => a (n + j - i) private def one : QuaternionGroup n := a 0 instance : Inhabited (QuaternionGroup n) := ⟨one⟩ private def inv : QuaternionGroup n β†’ QuaternionGroup n | a i => a (-i) | xa i => xa (n + i) instance : Group (QuaternionGroup n) where mul := mul mul_assoc := by rintro (i | i) (j | j) (k | k) <;> simp only [(Β· * Β·), mul] <;> ring_nf congr calc -(n : ZMod (2 * n)) = 0 - n := by rw [zero_sub] _ = 2 * n - n := by norm_cast; simp _ = n := by ring one := one one_mul := by rintro (i | i) Β· exact congr_arg a (zero_add i) Β· exact congr_arg xa (sub_zero i) mul_one := by rintro (i | i) Β· exact congr_arg a (add_zero i) Β· exact congr_arg xa (add_zero i) inv := inv mul_left_inv := by rintro (i | i) Β· exact congr_arg a (neg_add_self i) Β· exact congr_arg a (sub_self (n + i)) @[simp] theorem a_mul_a (i j : ZMod (2 * n)) : a i * a j = a (i + j) := rfl #align quaternion_group.a_mul_a QuaternionGroup.a_mul_a @[simp] theorem a_mul_xa (i j : ZMod (2 * n)) : a i * xa j = xa (j - i) := rfl #align quaternion_group.a_mul_xa QuaternionGroup.a_mul_xa @[simp] theorem xa_mul_a (i j : ZMod (2 * n)) : xa i * a j = xa (i + j) := rfl #align quaternion_group.xa_mul_a QuaternionGroup.xa_mul_a @[simp] theorem xa_mul_xa (i j : ZMod (2 * n)) : xa i * xa j = a ((n : ZMod (2 * n)) + j - i) := rfl #align quaternion_group.xa_mul_xa QuaternionGroup.xa_mul_xa theorem one_def : (1 : QuaternionGroup n) = a 0 := rfl #align quaternion_group.one_def QuaternionGroup.one_def private def fintypeHelper : Sum (ZMod (2 * n)) (ZMod (2 * n)) ≃ QuaternionGroup n where invFun i := match i with | a j => Sum.inl j | xa j => Sum.inr j toFun i := match i with | Sum.inl j => a j | Sum.inr j => xa j left_inv := by rintro (x | x) <;> rfl right_inv := by rintro (x | x) <;> rfl def quaternionGroupZeroEquivDihedralGroupZero : QuaternionGroup 0 ≃* DihedralGroup 0 where toFun i := -- Porting note: Originally `QuaternionGroup.recOn i DihedralGroup.r DihedralGroup.sr` match i with | a j => DihedralGroup.r j | xa j => DihedralGroup.sr j invFun i := match i with | DihedralGroup.r j => a j | DihedralGroup.sr j => xa j left_inv := by rintro (k | k) <;> rfl right_inv := by rintro (k | k) <;> rfl map_mul' := by rintro (k | k) (l | l) <;> simp #align quaternion_group.quaternion_group_zero_equiv_dihedral_group_zero QuaternionGroup.quaternionGroupZeroEquivDihedralGroupZero instance [NeZero n] : Fintype (QuaternionGroup n) := Fintype.ofEquiv _ fintypeHelper instance : Nontrivial (QuaternionGroup n) := ⟨⟨a 0, xa 0, by revert n; simp⟩⟩ -- Porting note: `revert n; simp` was `decide` theorem card [NeZero n] : Fintype.card (QuaternionGroup n) = 4 * n := by rw [← Fintype.card_eq.mpr ⟨fintypeHelper⟩, Fintype.card_sum, ZMod.card, two_mul] ring #align quaternion_group.card QuaternionGroup.card @[simp] theorem a_one_pow (k : β„•) : (a 1 : QuaternionGroup n) ^ k = a k := by induction' k with k IH Β· rw [Nat.cast_zero]; rfl Β· rw [pow_succ, IH, a_mul_a] congr 1 norm_cast #align quaternion_group.a_one_pow QuaternionGroup.a_one_pow -- @[simp] -- Porting note: simp changes this to `a 0 = 1`, so this is no longer a good simp lemma. theorem a_one_pow_n : (a 1 : QuaternionGroup n) ^ (2 * n) = 1 := by rw [a_one_pow, one_def] congr 1 exact ZMod.natCast_self _ #align quaternion_group.a_one_pow_n QuaternionGroup.a_one_pow_n @[simp] theorem xa_sq (i : ZMod (2 * n)) : xa i ^ 2 = a n := by simp [sq] #align quaternion_group.xa_sq QuaternionGroup.xa_sq @[simp] theorem xa_pow_four (i : ZMod (2 * n)) : xa i ^ 4 = 1 := by rw [pow_succ, pow_succ, sq, xa_mul_xa, a_mul_xa, xa_mul_xa, add_sub_cancel_right, add_sub_assoc, sub_sub_cancel] norm_cast rw [← two_mul] simp [one_def] #align quaternion_group.xa_pow_four QuaternionGroup.xa_pow_four @[simp]
Mathlib/GroupTheory/SpecificGroups/Quaternion.lean
211
222
theorem orderOf_xa [NeZero n] (i : ZMod (2 * n)) : orderOf (xa i) = 4 := by
change _ = 2 ^ 2 haveI : Fact (Nat.Prime 2) := Fact.mk Nat.prime_two apply orderOf_eq_prime_pow Β· intro h simp only [pow_one, xa_sq] at h injection h with h' apply_fun ZMod.val at h' apply_fun (Β· / n) at h' simp only [ZMod.val_natCast, ZMod.val_zero, Nat.zero_div, Nat.mod_mul_left_div_self, Nat.div_self (NeZero.pos n)] at h' Β· norm_num
11
59,874.141715
2
1.333333
6
1,410
import Mathlib.Algebra.Group.Defs import Mathlib.Logic.Relation #align_import algebra.homology.complex_shape from "leanprover-community/mathlib"@"c4658a649d216f57e99621708b09dcb3dcccbd23" noncomputable section open scoped Classical @[ext] structure ComplexShape (ΞΉ : Type*) where Rel : ΞΉ β†’ ΞΉ β†’ Prop next_eq : βˆ€ {i j j'}, Rel i j β†’ Rel i j' β†’ j = j' prev_eq : βˆ€ {i i' j}, Rel i j β†’ Rel i' j β†’ i = i' #align complex_shape ComplexShape #align complex_shape.ext ComplexShape.ext #align complex_shape.ext_iff ComplexShape.ext_iff namespace ComplexShape variable {ΞΉ : Type*} @[simps] def refl (ΞΉ : Type*) : ComplexShape ΞΉ where Rel i j := i = j next_eq w w' := w.symm.trans w' prev_eq w w' := w.trans w'.symm #align complex_shape.refl ComplexShape.refl #align complex_shape.refl_rel ComplexShape.refl_Rel @[simps] def symm (c : ComplexShape ΞΉ) : ComplexShape ΞΉ where Rel i j := c.Rel j i next_eq w w' := c.prev_eq w w' prev_eq w w' := c.next_eq w w' #align complex_shape.symm ComplexShape.symm #align complex_shape.symm_rel ComplexShape.symm_Rel @[simp]
Mathlib/Algebra/Homology/ComplexShape.lean
100
102
theorem symm_symm (c : ComplexShape ΞΉ) : c.symm.symm = c := by
ext simp
2
7.389056
1
1.333333
3
1,411
import Mathlib.Algebra.Group.Defs import Mathlib.Logic.Relation #align_import algebra.homology.complex_shape from "leanprover-community/mathlib"@"c4658a649d216f57e99621708b09dcb3dcccbd23" noncomputable section open scoped Classical @[ext] structure ComplexShape (ΞΉ : Type*) where Rel : ΞΉ β†’ ΞΉ β†’ Prop next_eq : βˆ€ {i j j'}, Rel i j β†’ Rel i j' β†’ j = j' prev_eq : βˆ€ {i i' j}, Rel i j β†’ Rel i' j β†’ i = i' #align complex_shape ComplexShape #align complex_shape.ext ComplexShape.ext #align complex_shape.ext_iff ComplexShape.ext_iff namespace ComplexShape variable {ΞΉ : Type*} @[simps] def refl (ΞΉ : Type*) : ComplexShape ΞΉ where Rel i j := i = j next_eq w w' := w.symm.trans w' prev_eq w w' := w.trans w'.symm #align complex_shape.refl ComplexShape.refl #align complex_shape.refl_rel ComplexShape.refl_Rel @[simps] def symm (c : ComplexShape ΞΉ) : ComplexShape ΞΉ where Rel i j := c.Rel j i next_eq w w' := c.prev_eq w w' prev_eq w w' := c.next_eq w w' #align complex_shape.symm ComplexShape.symm #align complex_shape.symm_rel ComplexShape.symm_Rel @[simp] theorem symm_symm (c : ComplexShape ΞΉ) : c.symm.symm = c := by ext simp #align complex_shape.symm_symm ComplexShape.symm_symm theorem symm_bijective : Function.Bijective (ComplexShape.symm : ComplexShape ΞΉ β†’ ComplexShape ΞΉ) := Function.bijective_iff_has_inverse.mpr ⟨_, symm_symm, symm_symm⟩ @[simp] def trans (c₁ cβ‚‚ : ComplexShape ΞΉ) : ComplexShape ΞΉ where Rel := Relation.Comp c₁.Rel cβ‚‚.Rel next_eq w w' := by obtain ⟨k, w₁, wβ‚‚βŸ© := w obtain ⟨k', w₁', wβ‚‚'⟩ := w' rw [c₁.next_eq w₁ w₁'] at wβ‚‚ exact cβ‚‚.next_eq wβ‚‚ wβ‚‚' prev_eq w w' := by obtain ⟨k, w₁, wβ‚‚βŸ© := w obtain ⟨k', w₁', wβ‚‚'⟩ := w' rw [cβ‚‚.prev_eq wβ‚‚ wβ‚‚'] at w₁ exact c₁.prev_eq w₁ w₁' #align complex_shape.trans ComplexShape.trans instance subsingleton_next (c : ComplexShape ΞΉ) (i : ΞΉ) : Subsingleton { j // c.Rel i j } := by constructor rintro ⟨j, rij⟩ ⟨k, rik⟩ congr exact c.next_eq rij rik instance subsingleton_prev (c : ComplexShape ΞΉ) (j : ΞΉ) : Subsingleton { i // c.Rel i j } := by constructor rintro ⟨i, rik⟩ ⟨j, rjk⟩ congr exact c.prev_eq rik rjk def next (c : ComplexShape ΞΉ) (i : ΞΉ) : ΞΉ := if h : βˆƒ j, c.Rel i j then h.choose else i #align complex_shape.next ComplexShape.next def prev (c : ComplexShape ΞΉ) (j : ΞΉ) : ΞΉ := if h : βˆƒ i, c.Rel i j then h.choose else j #align complex_shape.prev ComplexShape.prev
Mathlib/Algebra/Homology/ComplexShape.lean
154
158
theorem next_eq' (c : ComplexShape ΞΉ) {i j : ΞΉ} (h : c.Rel i j) : c.next i = j := by
apply c.next_eq _ h rw [next] rw [dif_pos] exact Exists.choose_spec ⟨j, h⟩
4
54.59815
2
1.333333
3
1,411
import Mathlib.Algebra.Group.Defs import Mathlib.Logic.Relation #align_import algebra.homology.complex_shape from "leanprover-community/mathlib"@"c4658a649d216f57e99621708b09dcb3dcccbd23" noncomputable section open scoped Classical @[ext] structure ComplexShape (ΞΉ : Type*) where Rel : ΞΉ β†’ ΞΉ β†’ Prop next_eq : βˆ€ {i j j'}, Rel i j β†’ Rel i j' β†’ j = j' prev_eq : βˆ€ {i i' j}, Rel i j β†’ Rel i' j β†’ i = i' #align complex_shape ComplexShape #align complex_shape.ext ComplexShape.ext #align complex_shape.ext_iff ComplexShape.ext_iff namespace ComplexShape variable {ΞΉ : Type*} @[simps] def refl (ΞΉ : Type*) : ComplexShape ΞΉ where Rel i j := i = j next_eq w w' := w.symm.trans w' prev_eq w w' := w.trans w'.symm #align complex_shape.refl ComplexShape.refl #align complex_shape.refl_rel ComplexShape.refl_Rel @[simps] def symm (c : ComplexShape ΞΉ) : ComplexShape ΞΉ where Rel i j := c.Rel j i next_eq w w' := c.prev_eq w w' prev_eq w w' := c.next_eq w w' #align complex_shape.symm ComplexShape.symm #align complex_shape.symm_rel ComplexShape.symm_Rel @[simp] theorem symm_symm (c : ComplexShape ΞΉ) : c.symm.symm = c := by ext simp #align complex_shape.symm_symm ComplexShape.symm_symm theorem symm_bijective : Function.Bijective (ComplexShape.symm : ComplexShape ΞΉ β†’ ComplexShape ΞΉ) := Function.bijective_iff_has_inverse.mpr ⟨_, symm_symm, symm_symm⟩ @[simp] def trans (c₁ cβ‚‚ : ComplexShape ΞΉ) : ComplexShape ΞΉ where Rel := Relation.Comp c₁.Rel cβ‚‚.Rel next_eq w w' := by obtain ⟨k, w₁, wβ‚‚βŸ© := w obtain ⟨k', w₁', wβ‚‚'⟩ := w' rw [c₁.next_eq w₁ w₁'] at wβ‚‚ exact cβ‚‚.next_eq wβ‚‚ wβ‚‚' prev_eq w w' := by obtain ⟨k, w₁, wβ‚‚βŸ© := w obtain ⟨k', w₁', wβ‚‚'⟩ := w' rw [cβ‚‚.prev_eq wβ‚‚ wβ‚‚'] at w₁ exact c₁.prev_eq w₁ w₁' #align complex_shape.trans ComplexShape.trans instance subsingleton_next (c : ComplexShape ΞΉ) (i : ΞΉ) : Subsingleton { j // c.Rel i j } := by constructor rintro ⟨j, rij⟩ ⟨k, rik⟩ congr exact c.next_eq rij rik instance subsingleton_prev (c : ComplexShape ΞΉ) (j : ΞΉ) : Subsingleton { i // c.Rel i j } := by constructor rintro ⟨i, rik⟩ ⟨j, rjk⟩ congr exact c.prev_eq rik rjk def next (c : ComplexShape ΞΉ) (i : ΞΉ) : ΞΉ := if h : βˆƒ j, c.Rel i j then h.choose else i #align complex_shape.next ComplexShape.next def prev (c : ComplexShape ΞΉ) (j : ΞΉ) : ΞΉ := if h : βˆƒ i, c.Rel i j then h.choose else j #align complex_shape.prev ComplexShape.prev theorem next_eq' (c : ComplexShape ΞΉ) {i j : ΞΉ} (h : c.Rel i j) : c.next i = j := by apply c.next_eq _ h rw [next] rw [dif_pos] exact Exists.choose_spec ⟨j, h⟩ #align complex_shape.next_eq' ComplexShape.next_eq'
Mathlib/Algebra/Homology/ComplexShape.lean
161
164
theorem prev_eq' (c : ComplexShape ΞΉ) {i j : ΞΉ} (h : c.Rel i j) : c.prev j = i := by
apply c.prev_eq _ h rw [prev, dif_pos] exact Exists.choose_spec (⟨i, h⟩ : βˆƒ k, c.Rel k j)
3
20.085537
1
1.333333
3
1,411
import Mathlib.MeasureTheory.Decomposition.RadonNikodym import Mathlib.Probability.Kernel.Disintegration.CdfToKernel #align_import probability.kernel.cond_cdf from "leanprover-community/mathlib"@"3b88f4005dc2e28d42f974cc1ce838f0dafb39b8" open MeasureTheory Set Filter TopologicalSpace open scoped NNReal ENNReal MeasureTheory Topology namespace MeasureTheory.Measure variable {Ξ± Ξ² : Type*} {mΞ± : MeasurableSpace Ξ±} (ρ : Measure (Ξ± Γ— ℝ)) noncomputable def IicSnd (r : ℝ) : Measure Ξ± := (ρ.restrict (univ Γ—Λ’ Iic r)).fst #align measure_theory.measure.Iic_snd MeasureTheory.Measure.IicSnd
Mathlib/Probability/Kernel/Disintegration/CondCdf.lean
54
58
theorem IicSnd_apply (r : ℝ) {s : Set Ξ±} (hs : MeasurableSet s) : ρ.IicSnd r s = ρ (s Γ—Λ’ Iic r) := by
rw [IicSnd, fst_apply hs, restrict_apply' (MeasurableSet.univ.prod (measurableSet_Iic : MeasurableSet (Iic r))), ← prod_univ, prod_inter_prod, inter_univ, univ_inter]
3
20.085537
1
1.333333
6
1,412
import Mathlib.MeasureTheory.Decomposition.RadonNikodym import Mathlib.Probability.Kernel.Disintegration.CdfToKernel #align_import probability.kernel.cond_cdf from "leanprover-community/mathlib"@"3b88f4005dc2e28d42f974cc1ce838f0dafb39b8" open MeasureTheory Set Filter TopologicalSpace open scoped NNReal ENNReal MeasureTheory Topology namespace MeasureTheory.Measure variable {Ξ± Ξ² : Type*} {mΞ± : MeasurableSpace Ξ±} (ρ : Measure (Ξ± Γ— ℝ)) noncomputable def IicSnd (r : ℝ) : Measure Ξ± := (ρ.restrict (univ Γ—Λ’ Iic r)).fst #align measure_theory.measure.Iic_snd MeasureTheory.Measure.IicSnd theorem IicSnd_apply (r : ℝ) {s : Set Ξ±} (hs : MeasurableSet s) : ρ.IicSnd r s = ρ (s Γ—Λ’ Iic r) := by rw [IicSnd, fst_apply hs, restrict_apply' (MeasurableSet.univ.prod (measurableSet_Iic : MeasurableSet (Iic r))), ← prod_univ, prod_inter_prod, inter_univ, univ_inter] #align measure_theory.measure.Iic_snd_apply MeasureTheory.Measure.IicSnd_apply theorem IicSnd_univ (r : ℝ) : ρ.IicSnd r univ = ρ (univ Γ—Λ’ Iic r) := IicSnd_apply ρ r MeasurableSet.univ #align measure_theory.measure.Iic_snd_univ MeasureTheory.Measure.IicSnd_univ
Mathlib/Probability/Kernel/Disintegration/CondCdf.lean
65
69
theorem IicSnd_mono {r r' : ℝ} (h_le : r ≀ r') : ρ.IicSnd r ≀ ρ.IicSnd r' := by
refine Measure.le_iff.2 fun s hs ↦ ?_ simp_rw [IicSnd_apply ρ _ hs] refine measure_mono (prod_subset_prod_iff.mpr (Or.inl ⟨subset_rfl, Iic_subset_Iic.mpr ?_⟩)) exact mod_cast h_le
4
54.59815
2
1.333333
6
1,412
import Mathlib.MeasureTheory.Decomposition.RadonNikodym import Mathlib.Probability.Kernel.Disintegration.CdfToKernel #align_import probability.kernel.cond_cdf from "leanprover-community/mathlib"@"3b88f4005dc2e28d42f974cc1ce838f0dafb39b8" open MeasureTheory Set Filter TopologicalSpace open scoped NNReal ENNReal MeasureTheory Topology namespace MeasureTheory.Measure variable {Ξ± Ξ² : Type*} {mΞ± : MeasurableSpace Ξ±} (ρ : Measure (Ξ± Γ— ℝ)) noncomputable def IicSnd (r : ℝ) : Measure Ξ± := (ρ.restrict (univ Γ—Λ’ Iic r)).fst #align measure_theory.measure.Iic_snd MeasureTheory.Measure.IicSnd theorem IicSnd_apply (r : ℝ) {s : Set Ξ±} (hs : MeasurableSet s) : ρ.IicSnd r s = ρ (s Γ—Λ’ Iic r) := by rw [IicSnd, fst_apply hs, restrict_apply' (MeasurableSet.univ.prod (measurableSet_Iic : MeasurableSet (Iic r))), ← prod_univ, prod_inter_prod, inter_univ, univ_inter] #align measure_theory.measure.Iic_snd_apply MeasureTheory.Measure.IicSnd_apply theorem IicSnd_univ (r : ℝ) : ρ.IicSnd r univ = ρ (univ Γ—Λ’ Iic r) := IicSnd_apply ρ r MeasurableSet.univ #align measure_theory.measure.Iic_snd_univ MeasureTheory.Measure.IicSnd_univ theorem IicSnd_mono {r r' : ℝ} (h_le : r ≀ r') : ρ.IicSnd r ≀ ρ.IicSnd r' := by refine Measure.le_iff.2 fun s hs ↦ ?_ simp_rw [IicSnd_apply ρ _ hs] refine measure_mono (prod_subset_prod_iff.mpr (Or.inl ⟨subset_rfl, Iic_subset_Iic.mpr ?_⟩)) exact mod_cast h_le #align measure_theory.measure.Iic_snd_mono MeasureTheory.Measure.IicSnd_mono
Mathlib/Probability/Kernel/Disintegration/CondCdf.lean
72
75
theorem IicSnd_le_fst (r : ℝ) : ρ.IicSnd r ≀ ρ.fst := by
refine Measure.le_iff.2 fun s hs ↦ ?_ simp_rw [fst_apply hs, IicSnd_apply ρ r hs] exact measure_mono (prod_subset_preimage_fst _ _)
3
20.085537
1
1.333333
6
1,412
import Mathlib.MeasureTheory.Decomposition.RadonNikodym import Mathlib.Probability.Kernel.Disintegration.CdfToKernel #align_import probability.kernel.cond_cdf from "leanprover-community/mathlib"@"3b88f4005dc2e28d42f974cc1ce838f0dafb39b8" open MeasureTheory Set Filter TopologicalSpace open scoped NNReal ENNReal MeasureTheory Topology namespace MeasureTheory.Measure variable {Ξ± Ξ² : Type*} {mΞ± : MeasurableSpace Ξ±} (ρ : Measure (Ξ± Γ— ℝ)) noncomputable def IicSnd (r : ℝ) : Measure Ξ± := (ρ.restrict (univ Γ—Λ’ Iic r)).fst #align measure_theory.measure.Iic_snd MeasureTheory.Measure.IicSnd theorem IicSnd_apply (r : ℝ) {s : Set Ξ±} (hs : MeasurableSet s) : ρ.IicSnd r s = ρ (s Γ—Λ’ Iic r) := by rw [IicSnd, fst_apply hs, restrict_apply' (MeasurableSet.univ.prod (measurableSet_Iic : MeasurableSet (Iic r))), ← prod_univ, prod_inter_prod, inter_univ, univ_inter] #align measure_theory.measure.Iic_snd_apply MeasureTheory.Measure.IicSnd_apply theorem IicSnd_univ (r : ℝ) : ρ.IicSnd r univ = ρ (univ Γ—Λ’ Iic r) := IicSnd_apply ρ r MeasurableSet.univ #align measure_theory.measure.Iic_snd_univ MeasureTheory.Measure.IicSnd_univ theorem IicSnd_mono {r r' : ℝ} (h_le : r ≀ r') : ρ.IicSnd r ≀ ρ.IicSnd r' := by refine Measure.le_iff.2 fun s hs ↦ ?_ simp_rw [IicSnd_apply ρ _ hs] refine measure_mono (prod_subset_prod_iff.mpr (Or.inl ⟨subset_rfl, Iic_subset_Iic.mpr ?_⟩)) exact mod_cast h_le #align measure_theory.measure.Iic_snd_mono MeasureTheory.Measure.IicSnd_mono theorem IicSnd_le_fst (r : ℝ) : ρ.IicSnd r ≀ ρ.fst := by refine Measure.le_iff.2 fun s hs ↦ ?_ simp_rw [fst_apply hs, IicSnd_apply ρ r hs] exact measure_mono (prod_subset_preimage_fst _ _) #align measure_theory.measure.Iic_snd_le_fst MeasureTheory.Measure.IicSnd_le_fst theorem IicSnd_ac_fst (r : ℝ) : ρ.IicSnd r β‰ͺ ρ.fst := Measure.absolutelyContinuous_of_le (IicSnd_le_fst ρ r) #align measure_theory.measure.Iic_snd_ac_fst MeasureTheory.Measure.IicSnd_ac_fst theorem IsFiniteMeasure.IicSnd {ρ : Measure (Ξ± Γ— ℝ)} [IsFiniteMeasure ρ] (r : ℝ) : IsFiniteMeasure (ρ.IicSnd r) := isFiniteMeasure_of_le _ (IicSnd_le_fst ρ _) #align measure_theory.measure.is_finite_measure.Iic_snd MeasureTheory.Measure.IsFiniteMeasure.IicSnd
Mathlib/Probability/Kernel/Disintegration/CondCdf.lean
87
89
theorem iInf_IicSnd_gt (t : β„š) {s : Set Ξ±} (hs : MeasurableSet s) [IsFiniteMeasure ρ] : β¨… r : { r' : β„š // t < r' }, ρ.IicSnd r s = ρ.IicSnd t s := by
simp_rw [ρ.IicSnd_apply _ hs, Measure.iInf_rat_gt_prod_Iic hs]
1
2.718282
0
1.333333
6
1,412
import Mathlib.MeasureTheory.Decomposition.RadonNikodym import Mathlib.Probability.Kernel.Disintegration.CdfToKernel #align_import probability.kernel.cond_cdf from "leanprover-community/mathlib"@"3b88f4005dc2e28d42f974cc1ce838f0dafb39b8" open MeasureTheory Set Filter TopologicalSpace open scoped NNReal ENNReal MeasureTheory Topology namespace MeasureTheory.Measure variable {Ξ± Ξ² : Type*} {mΞ± : MeasurableSpace Ξ±} (ρ : Measure (Ξ± Γ— ℝ)) noncomputable def IicSnd (r : ℝ) : Measure Ξ± := (ρ.restrict (univ Γ—Λ’ Iic r)).fst #align measure_theory.measure.Iic_snd MeasureTheory.Measure.IicSnd theorem IicSnd_apply (r : ℝ) {s : Set Ξ±} (hs : MeasurableSet s) : ρ.IicSnd r s = ρ (s Γ—Λ’ Iic r) := by rw [IicSnd, fst_apply hs, restrict_apply' (MeasurableSet.univ.prod (measurableSet_Iic : MeasurableSet (Iic r))), ← prod_univ, prod_inter_prod, inter_univ, univ_inter] #align measure_theory.measure.Iic_snd_apply MeasureTheory.Measure.IicSnd_apply theorem IicSnd_univ (r : ℝ) : ρ.IicSnd r univ = ρ (univ Γ—Λ’ Iic r) := IicSnd_apply ρ r MeasurableSet.univ #align measure_theory.measure.Iic_snd_univ MeasureTheory.Measure.IicSnd_univ theorem IicSnd_mono {r r' : ℝ} (h_le : r ≀ r') : ρ.IicSnd r ≀ ρ.IicSnd r' := by refine Measure.le_iff.2 fun s hs ↦ ?_ simp_rw [IicSnd_apply ρ _ hs] refine measure_mono (prod_subset_prod_iff.mpr (Or.inl ⟨subset_rfl, Iic_subset_Iic.mpr ?_⟩)) exact mod_cast h_le #align measure_theory.measure.Iic_snd_mono MeasureTheory.Measure.IicSnd_mono theorem IicSnd_le_fst (r : ℝ) : ρ.IicSnd r ≀ ρ.fst := by refine Measure.le_iff.2 fun s hs ↦ ?_ simp_rw [fst_apply hs, IicSnd_apply ρ r hs] exact measure_mono (prod_subset_preimage_fst _ _) #align measure_theory.measure.Iic_snd_le_fst MeasureTheory.Measure.IicSnd_le_fst theorem IicSnd_ac_fst (r : ℝ) : ρ.IicSnd r β‰ͺ ρ.fst := Measure.absolutelyContinuous_of_le (IicSnd_le_fst ρ r) #align measure_theory.measure.Iic_snd_ac_fst MeasureTheory.Measure.IicSnd_ac_fst theorem IsFiniteMeasure.IicSnd {ρ : Measure (Ξ± Γ— ℝ)} [IsFiniteMeasure ρ] (r : ℝ) : IsFiniteMeasure (ρ.IicSnd r) := isFiniteMeasure_of_le _ (IicSnd_le_fst ρ _) #align measure_theory.measure.is_finite_measure.Iic_snd MeasureTheory.Measure.IsFiniteMeasure.IicSnd theorem iInf_IicSnd_gt (t : β„š) {s : Set Ξ±} (hs : MeasurableSet s) [IsFiniteMeasure ρ] : β¨… r : { r' : β„š // t < r' }, ρ.IicSnd r s = ρ.IicSnd t s := by simp_rw [ρ.IicSnd_apply _ hs, Measure.iInf_rat_gt_prod_Iic hs] #align measure_theory.measure.infi_Iic_snd_gt MeasureTheory.Measure.iInf_IicSnd_gt
Mathlib/Probability/Kernel/Disintegration/CondCdf.lean
92
99
theorem tendsto_IicSnd_atTop {s : Set Ξ±} (hs : MeasurableSet s) : Tendsto (fun r : β„š ↦ ρ.IicSnd r s) atTop (𝓝 (ρ.fst s)) := by
simp_rw [ρ.IicSnd_apply _ hs, fst_apply hs, ← prod_univ] rw [← Real.iUnion_Iic_rat, prod_iUnion] refine tendsto_measure_iUnion fun r q hr_le_q x ↦ ?_ simp only [mem_prod, mem_Iic, and_imp] refine fun hxs hxr ↦ ⟨hxs, hxr.trans ?_⟩ exact mod_cast hr_le_q
6
403.428793
2
1.333333
6
1,412
import Mathlib.MeasureTheory.Decomposition.RadonNikodym import Mathlib.Probability.Kernel.Disintegration.CdfToKernel #align_import probability.kernel.cond_cdf from "leanprover-community/mathlib"@"3b88f4005dc2e28d42f974cc1ce838f0dafb39b8" open MeasureTheory Set Filter TopologicalSpace open scoped NNReal ENNReal MeasureTheory Topology namespace MeasureTheory.Measure variable {Ξ± Ξ² : Type*} {mΞ± : MeasurableSpace Ξ±} (ρ : Measure (Ξ± Γ— ℝ)) noncomputable def IicSnd (r : ℝ) : Measure Ξ± := (ρ.restrict (univ Γ—Λ’ Iic r)).fst #align measure_theory.measure.Iic_snd MeasureTheory.Measure.IicSnd theorem IicSnd_apply (r : ℝ) {s : Set Ξ±} (hs : MeasurableSet s) : ρ.IicSnd r s = ρ (s Γ—Λ’ Iic r) := by rw [IicSnd, fst_apply hs, restrict_apply' (MeasurableSet.univ.prod (measurableSet_Iic : MeasurableSet (Iic r))), ← prod_univ, prod_inter_prod, inter_univ, univ_inter] #align measure_theory.measure.Iic_snd_apply MeasureTheory.Measure.IicSnd_apply theorem IicSnd_univ (r : ℝ) : ρ.IicSnd r univ = ρ (univ Γ—Λ’ Iic r) := IicSnd_apply ρ r MeasurableSet.univ #align measure_theory.measure.Iic_snd_univ MeasureTheory.Measure.IicSnd_univ theorem IicSnd_mono {r r' : ℝ} (h_le : r ≀ r') : ρ.IicSnd r ≀ ρ.IicSnd r' := by refine Measure.le_iff.2 fun s hs ↦ ?_ simp_rw [IicSnd_apply ρ _ hs] refine measure_mono (prod_subset_prod_iff.mpr (Or.inl ⟨subset_rfl, Iic_subset_Iic.mpr ?_⟩)) exact mod_cast h_le #align measure_theory.measure.Iic_snd_mono MeasureTheory.Measure.IicSnd_mono theorem IicSnd_le_fst (r : ℝ) : ρ.IicSnd r ≀ ρ.fst := by refine Measure.le_iff.2 fun s hs ↦ ?_ simp_rw [fst_apply hs, IicSnd_apply ρ r hs] exact measure_mono (prod_subset_preimage_fst _ _) #align measure_theory.measure.Iic_snd_le_fst MeasureTheory.Measure.IicSnd_le_fst theorem IicSnd_ac_fst (r : ℝ) : ρ.IicSnd r β‰ͺ ρ.fst := Measure.absolutelyContinuous_of_le (IicSnd_le_fst ρ r) #align measure_theory.measure.Iic_snd_ac_fst MeasureTheory.Measure.IicSnd_ac_fst theorem IsFiniteMeasure.IicSnd {ρ : Measure (Ξ± Γ— ℝ)} [IsFiniteMeasure ρ] (r : ℝ) : IsFiniteMeasure (ρ.IicSnd r) := isFiniteMeasure_of_le _ (IicSnd_le_fst ρ _) #align measure_theory.measure.is_finite_measure.Iic_snd MeasureTheory.Measure.IsFiniteMeasure.IicSnd theorem iInf_IicSnd_gt (t : β„š) {s : Set Ξ±} (hs : MeasurableSet s) [IsFiniteMeasure ρ] : β¨… r : { r' : β„š // t < r' }, ρ.IicSnd r s = ρ.IicSnd t s := by simp_rw [ρ.IicSnd_apply _ hs, Measure.iInf_rat_gt_prod_Iic hs] #align measure_theory.measure.infi_Iic_snd_gt MeasureTheory.Measure.iInf_IicSnd_gt theorem tendsto_IicSnd_atTop {s : Set Ξ±} (hs : MeasurableSet s) : Tendsto (fun r : β„š ↦ ρ.IicSnd r s) atTop (𝓝 (ρ.fst s)) := by simp_rw [ρ.IicSnd_apply _ hs, fst_apply hs, ← prod_univ] rw [← Real.iUnion_Iic_rat, prod_iUnion] refine tendsto_measure_iUnion fun r q hr_le_q x ↦ ?_ simp only [mem_prod, mem_Iic, and_imp] refine fun hxs hxr ↦ ⟨hxs, hxr.trans ?_⟩ exact mod_cast hr_le_q #align measure_theory.measure.tendsto_Iic_snd_at_top MeasureTheory.Measure.tendsto_IicSnd_atTop
Mathlib/Probability/Kernel/Disintegration/CondCdf.lean
102
124
theorem tendsto_IicSnd_atBot [IsFiniteMeasure ρ] {s : Set Ξ±} (hs : MeasurableSet s) : Tendsto (fun r : β„š ↦ ρ.IicSnd r s) atBot (𝓝 0) := by
simp_rw [ρ.IicSnd_apply _ hs] have h_empty : ρ (s Γ—Λ’ βˆ…) = 0 := by simp only [prod_empty, measure_empty] rw [← h_empty, ← Real.iInter_Iic_rat, prod_iInter] suffices h_neg : Tendsto (fun r : β„š ↦ ρ (s Γ—Λ’ Iic ↑(-r))) atTop (𝓝 (ρ (β‹‚ r : β„š, s Γ—Λ’ Iic ↑(-r)))) by have h_inter_eq : β‹‚ r : β„š, s Γ—Λ’ Iic ↑(-r) = β‹‚ r : β„š, s Γ—Λ’ Iic (r : ℝ) := by ext1 x simp only [Rat.cast_eq_id, id, mem_iInter, mem_prod, mem_Iic] refine ⟨fun h i ↦ ⟨(h i).1, ?_⟩, fun h i ↦ ⟨(h i).1, ?_⟩⟩ <;> have h' := h (-i) Β· rw [neg_neg] at h'; exact h'.2 Β· exact h'.2 rw [h_inter_eq] at h_neg have h_fun_eq : (fun r : β„š ↦ ρ (s Γ—Λ’ Iic (r : ℝ))) = fun r : β„š ↦ ρ (s Γ—Λ’ Iic ↑(- -r)) := by simp_rw [neg_neg] rw [h_fun_eq] exact h_neg.comp tendsto_neg_atBot_atTop refine tendsto_measure_iInter (fun q ↦ hs.prod measurableSet_Iic) ?_ ⟨0, measure_ne_top ρ _⟩ refine fun q r hqr ↦ prod_subset_prod_iff.mpr (Or.inl ⟨subset_rfl, fun x hx ↦ ?_⟩) simp only [Rat.cast_neg, mem_Iic] at hx ⊒ refine hx.trans (neg_le_neg ?_) exact mod_cast hqr
21
1,318,815,734.483215
2
1.333333
6
1,412
import Mathlib.Data.Finsupp.Defs #align_import data.list.to_finsupp from "leanprover-community/mathlib"@"06a655b5fcfbda03502f9158bbf6c0f1400886f9" namespace List variable {M : Type*} [Zero M] (l : List M) [DecidablePred (getD l Β· 0 β‰  0)] (n : β„•) def toFinsupp : β„• β†’β‚€ M where toFun i := getD l i 0 support := (Finset.range l.length).filter fun i => getD l i 0 β‰  0 mem_support_toFun n := by simp only [Ne, Finset.mem_filter, Finset.mem_range, and_iff_right_iff_imp] contrapose! exact getD_eq_default _ _ #align list.to_finsupp List.toFinsupp @[norm_cast] theorem coe_toFinsupp : (l.toFinsupp : β„• β†’ M) = (l.getD Β· 0) := rfl #align list.coe_to_finsupp List.coe_toFinsupp @[simp, norm_cast] theorem toFinsupp_apply (i : β„•) : (l.toFinsupp : β„• β†’ M) i = l.getD i 0 := rfl #align list.to_finsupp_apply List.toFinsupp_apply theorem toFinsupp_support : l.toFinsupp.support = (Finset.range l.length).filter (getD l Β· 0 β‰  0) := rfl #align list.to_finsupp_support List.toFinsupp_support theorem toFinsupp_apply_lt (hn : n < l.length) : l.toFinsupp n = l.get ⟨n, hn⟩ := getD_eq_get _ _ _ theorem toFinsupp_apply_fin (n : Fin l.length) : l.toFinsupp n = l.get n := getD_eq_get _ _ _ set_option linter.deprecated false in @[deprecated (since := "2023-04-10")] theorem toFinsupp_apply_lt' (hn : n < l.length) : l.toFinsupp n = l.nthLe n hn := getD_eq_get _ _ _ #align list.to_finsupp_apply_lt List.toFinsupp_apply_lt' theorem toFinsupp_apply_le (hn : l.length ≀ n) : l.toFinsupp n = 0 := getD_eq_default _ _ hn #align list.to_finsupp_apply_le List.toFinsupp_apply_le @[simp]
Mathlib/Data/List/ToFinsupp.lean
86
89
theorem toFinsupp_nil [DecidablePred fun i => getD ([] : List M) i 0 β‰  0] : toFinsupp ([] : List M) = 0 := by
ext simp
2
7.389056
1
1.333333
6
1,413
import Mathlib.Data.Finsupp.Defs #align_import data.list.to_finsupp from "leanprover-community/mathlib"@"06a655b5fcfbda03502f9158bbf6c0f1400886f9" namespace List variable {M : Type*} [Zero M] (l : List M) [DecidablePred (getD l Β· 0 β‰  0)] (n : β„•) def toFinsupp : β„• β†’β‚€ M where toFun i := getD l i 0 support := (Finset.range l.length).filter fun i => getD l i 0 β‰  0 mem_support_toFun n := by simp only [Ne, Finset.mem_filter, Finset.mem_range, and_iff_right_iff_imp] contrapose! exact getD_eq_default _ _ #align list.to_finsupp List.toFinsupp @[norm_cast] theorem coe_toFinsupp : (l.toFinsupp : β„• β†’ M) = (l.getD Β· 0) := rfl #align list.coe_to_finsupp List.coe_toFinsupp @[simp, norm_cast] theorem toFinsupp_apply (i : β„•) : (l.toFinsupp : β„• β†’ M) i = l.getD i 0 := rfl #align list.to_finsupp_apply List.toFinsupp_apply theorem toFinsupp_support : l.toFinsupp.support = (Finset.range l.length).filter (getD l Β· 0 β‰  0) := rfl #align list.to_finsupp_support List.toFinsupp_support theorem toFinsupp_apply_lt (hn : n < l.length) : l.toFinsupp n = l.get ⟨n, hn⟩ := getD_eq_get _ _ _ theorem toFinsupp_apply_fin (n : Fin l.length) : l.toFinsupp n = l.get n := getD_eq_get _ _ _ set_option linter.deprecated false in @[deprecated (since := "2023-04-10")] theorem toFinsupp_apply_lt' (hn : n < l.length) : l.toFinsupp n = l.nthLe n hn := getD_eq_get _ _ _ #align list.to_finsupp_apply_lt List.toFinsupp_apply_lt' theorem toFinsupp_apply_le (hn : l.length ≀ n) : l.toFinsupp n = 0 := getD_eq_default _ _ hn #align list.to_finsupp_apply_le List.toFinsupp_apply_le @[simp] theorem toFinsupp_nil [DecidablePred fun i => getD ([] : List M) i 0 β‰  0] : toFinsupp ([] : List M) = 0 := by ext simp #align list.to_finsupp_nil List.toFinsupp_nil
Mathlib/Data/List/ToFinsupp.lean
92
94
theorem toFinsupp_singleton (x : M) [DecidablePred (getD [x] Β· 0 β‰  0)] : toFinsupp [x] = Finsupp.single 0 x := by
ext ⟨_ | i⟩ <;> simp [Finsupp.single_apply, (Nat.zero_lt_succ _).ne]
1
2.718282
0
1.333333
6
1,413
import Mathlib.Data.Finsupp.Defs #align_import data.list.to_finsupp from "leanprover-community/mathlib"@"06a655b5fcfbda03502f9158bbf6c0f1400886f9" namespace List variable {M : Type*} [Zero M] (l : List M) [DecidablePred (getD l Β· 0 β‰  0)] (n : β„•) def toFinsupp : β„• β†’β‚€ M where toFun i := getD l i 0 support := (Finset.range l.length).filter fun i => getD l i 0 β‰  0 mem_support_toFun n := by simp only [Ne, Finset.mem_filter, Finset.mem_range, and_iff_right_iff_imp] contrapose! exact getD_eq_default _ _ #align list.to_finsupp List.toFinsupp @[norm_cast] theorem coe_toFinsupp : (l.toFinsupp : β„• β†’ M) = (l.getD Β· 0) := rfl #align list.coe_to_finsupp List.coe_toFinsupp @[simp, norm_cast] theorem toFinsupp_apply (i : β„•) : (l.toFinsupp : β„• β†’ M) i = l.getD i 0 := rfl #align list.to_finsupp_apply List.toFinsupp_apply theorem toFinsupp_support : l.toFinsupp.support = (Finset.range l.length).filter (getD l Β· 0 β‰  0) := rfl #align list.to_finsupp_support List.toFinsupp_support theorem toFinsupp_apply_lt (hn : n < l.length) : l.toFinsupp n = l.get ⟨n, hn⟩ := getD_eq_get _ _ _ theorem toFinsupp_apply_fin (n : Fin l.length) : l.toFinsupp n = l.get n := getD_eq_get _ _ _ set_option linter.deprecated false in @[deprecated (since := "2023-04-10")] theorem toFinsupp_apply_lt' (hn : n < l.length) : l.toFinsupp n = l.nthLe n hn := getD_eq_get _ _ _ #align list.to_finsupp_apply_lt List.toFinsupp_apply_lt' theorem toFinsupp_apply_le (hn : l.length ≀ n) : l.toFinsupp n = 0 := getD_eq_default _ _ hn #align list.to_finsupp_apply_le List.toFinsupp_apply_le @[simp] theorem toFinsupp_nil [DecidablePred fun i => getD ([] : List M) i 0 β‰  0] : toFinsupp ([] : List M) = 0 := by ext simp #align list.to_finsupp_nil List.toFinsupp_nil theorem toFinsupp_singleton (x : M) [DecidablePred (getD [x] Β· 0 β‰  0)] : toFinsupp [x] = Finsupp.single 0 x := by ext ⟨_ | i⟩ <;> simp [Finsupp.single_apply, (Nat.zero_lt_succ _).ne] #align list.to_finsupp_singleton List.toFinsupp_singleton @[simp] theorem toFinsupp_cons_apply_zero (x : M) (xs : List M) [DecidablePred (getD (x::xs) Β· 0 β‰  0)] : (x::xs).toFinsupp 0 = x := rfl #align list.to_finsupp_cons_apply_zero List.toFinsupp_cons_apply_zero @[simp] theorem toFinsupp_cons_apply_succ (x : M) (xs : List M) (n : β„•) [DecidablePred (getD (x::xs) Β· 0 β‰  0)] [DecidablePred (getD xs Β· 0 β‰  0)] : (x::xs).toFinsupp n.succ = xs.toFinsupp n := rfl #align list.to_finsupp_cons_apply_succ List.toFinsupp_cons_apply_succ -- Porting note (#10756): new theorem
Mathlib/Data/List/ToFinsupp.lean
111
126
theorem toFinsupp_append {R : Type*} [AddZeroClass R] (l₁ lβ‚‚ : List R) [DecidablePred (getD (l₁ ++ lβ‚‚) Β· 0 β‰  0)] [DecidablePred (getD l₁ Β· 0 β‰  0)] [DecidablePred (getD lβ‚‚ Β· 0 β‰  0)] : toFinsupp (l₁ ++ lβ‚‚) = toFinsupp l₁ + (toFinsupp lβ‚‚).embDomain (addLeftEmbedding l₁.length) := by
ext n simp only [toFinsupp_apply, Finsupp.add_apply] cases lt_or_le n l₁.length with | inl h => rw [getD_append _ _ _ _ h, Finsupp.embDomain_notin_range, add_zero] rintro ⟨k, rfl : length l₁ + k = n⟩ omega | inr h => rcases Nat.exists_eq_add_of_le h with ⟨k, rfl⟩ rw [getD_append_right _ _ _ _ h, Nat.add_sub_cancel_left, getD_eq_default _ _ h, zero_add] exact Eq.symm (Finsupp.embDomain_apply _ _ _)
11
59,874.141715
2
1.333333
6
1,413
import Mathlib.Data.Finsupp.Defs #align_import data.list.to_finsupp from "leanprover-community/mathlib"@"06a655b5fcfbda03502f9158bbf6c0f1400886f9" namespace List variable {M : Type*} [Zero M] (l : List M) [DecidablePred (getD l Β· 0 β‰  0)] (n : β„•) def toFinsupp : β„• β†’β‚€ M where toFun i := getD l i 0 support := (Finset.range l.length).filter fun i => getD l i 0 β‰  0 mem_support_toFun n := by simp only [Ne, Finset.mem_filter, Finset.mem_range, and_iff_right_iff_imp] contrapose! exact getD_eq_default _ _ #align list.to_finsupp List.toFinsupp @[norm_cast] theorem coe_toFinsupp : (l.toFinsupp : β„• β†’ M) = (l.getD Β· 0) := rfl #align list.coe_to_finsupp List.coe_toFinsupp @[simp, norm_cast] theorem toFinsupp_apply (i : β„•) : (l.toFinsupp : β„• β†’ M) i = l.getD i 0 := rfl #align list.to_finsupp_apply List.toFinsupp_apply theorem toFinsupp_support : l.toFinsupp.support = (Finset.range l.length).filter (getD l Β· 0 β‰  0) := rfl #align list.to_finsupp_support List.toFinsupp_support theorem toFinsupp_apply_lt (hn : n < l.length) : l.toFinsupp n = l.get ⟨n, hn⟩ := getD_eq_get _ _ _ theorem toFinsupp_apply_fin (n : Fin l.length) : l.toFinsupp n = l.get n := getD_eq_get _ _ _ set_option linter.deprecated false in @[deprecated (since := "2023-04-10")] theorem toFinsupp_apply_lt' (hn : n < l.length) : l.toFinsupp n = l.nthLe n hn := getD_eq_get _ _ _ #align list.to_finsupp_apply_lt List.toFinsupp_apply_lt' theorem toFinsupp_apply_le (hn : l.length ≀ n) : l.toFinsupp n = 0 := getD_eq_default _ _ hn #align list.to_finsupp_apply_le List.toFinsupp_apply_le @[simp] theorem toFinsupp_nil [DecidablePred fun i => getD ([] : List M) i 0 β‰  0] : toFinsupp ([] : List M) = 0 := by ext simp #align list.to_finsupp_nil List.toFinsupp_nil theorem toFinsupp_singleton (x : M) [DecidablePred (getD [x] Β· 0 β‰  0)] : toFinsupp [x] = Finsupp.single 0 x := by ext ⟨_ | i⟩ <;> simp [Finsupp.single_apply, (Nat.zero_lt_succ _).ne] #align list.to_finsupp_singleton List.toFinsupp_singleton @[simp] theorem toFinsupp_cons_apply_zero (x : M) (xs : List M) [DecidablePred (getD (x::xs) Β· 0 β‰  0)] : (x::xs).toFinsupp 0 = x := rfl #align list.to_finsupp_cons_apply_zero List.toFinsupp_cons_apply_zero @[simp] theorem toFinsupp_cons_apply_succ (x : M) (xs : List M) (n : β„•) [DecidablePred (getD (x::xs) Β· 0 β‰  0)] [DecidablePred (getD xs Β· 0 β‰  0)] : (x::xs).toFinsupp n.succ = xs.toFinsupp n := rfl #align list.to_finsupp_cons_apply_succ List.toFinsupp_cons_apply_succ -- Porting note (#10756): new theorem theorem toFinsupp_append {R : Type*} [AddZeroClass R] (l₁ lβ‚‚ : List R) [DecidablePred (getD (l₁ ++ lβ‚‚) Β· 0 β‰  0)] [DecidablePred (getD l₁ Β· 0 β‰  0)] [DecidablePred (getD lβ‚‚ Β· 0 β‰  0)] : toFinsupp (l₁ ++ lβ‚‚) = toFinsupp l₁ + (toFinsupp lβ‚‚).embDomain (addLeftEmbedding l₁.length) := by ext n simp only [toFinsupp_apply, Finsupp.add_apply] cases lt_or_le n l₁.length with | inl h => rw [getD_append _ _ _ _ h, Finsupp.embDomain_notin_range, add_zero] rintro ⟨k, rfl : length l₁ + k = n⟩ omega | inr h => rcases Nat.exists_eq_add_of_le h with ⟨k, rfl⟩ rw [getD_append_right _ _ _ _ h, Nat.add_sub_cancel_left, getD_eq_default _ _ h, zero_add] exact Eq.symm (Finsupp.embDomain_apply _ _ _)
Mathlib/Data/List/ToFinsupp.lean
128
136
theorem toFinsupp_cons_eq_single_add_embDomain {R : Type*} [AddZeroClass R] (x : R) (xs : List R) [DecidablePred (getD (x::xs) Β· 0 β‰  0)] [DecidablePred (getD xs Β· 0 β‰  0)] : toFinsupp (x::xs) = Finsupp.single 0 x + (toFinsupp xs).embDomain ⟨Nat.succ, Nat.succ_injective⟩ := by
classical convert toFinsupp_append [x] xs using 3 Β· exact (toFinsupp_singleton x).symm Β· ext n exact add_comm n 1
5
148.413159
2
1.333333
6
1,413
import Mathlib.Data.Finsupp.Defs #align_import data.list.to_finsupp from "leanprover-community/mathlib"@"06a655b5fcfbda03502f9158bbf6c0f1400886f9" namespace List variable {M : Type*} [Zero M] (l : List M) [DecidablePred (getD l Β· 0 β‰  0)] (n : β„•) def toFinsupp : β„• β†’β‚€ M where toFun i := getD l i 0 support := (Finset.range l.length).filter fun i => getD l i 0 β‰  0 mem_support_toFun n := by simp only [Ne, Finset.mem_filter, Finset.mem_range, and_iff_right_iff_imp] contrapose! exact getD_eq_default _ _ #align list.to_finsupp List.toFinsupp @[norm_cast] theorem coe_toFinsupp : (l.toFinsupp : β„• β†’ M) = (l.getD Β· 0) := rfl #align list.coe_to_finsupp List.coe_toFinsupp @[simp, norm_cast] theorem toFinsupp_apply (i : β„•) : (l.toFinsupp : β„• β†’ M) i = l.getD i 0 := rfl #align list.to_finsupp_apply List.toFinsupp_apply theorem toFinsupp_support : l.toFinsupp.support = (Finset.range l.length).filter (getD l Β· 0 β‰  0) := rfl #align list.to_finsupp_support List.toFinsupp_support theorem toFinsupp_apply_lt (hn : n < l.length) : l.toFinsupp n = l.get ⟨n, hn⟩ := getD_eq_get _ _ _ theorem toFinsupp_apply_fin (n : Fin l.length) : l.toFinsupp n = l.get n := getD_eq_get _ _ _ set_option linter.deprecated false in @[deprecated (since := "2023-04-10")] theorem toFinsupp_apply_lt' (hn : n < l.length) : l.toFinsupp n = l.nthLe n hn := getD_eq_get _ _ _ #align list.to_finsupp_apply_lt List.toFinsupp_apply_lt' theorem toFinsupp_apply_le (hn : l.length ≀ n) : l.toFinsupp n = 0 := getD_eq_default _ _ hn #align list.to_finsupp_apply_le List.toFinsupp_apply_le @[simp] theorem toFinsupp_nil [DecidablePred fun i => getD ([] : List M) i 0 β‰  0] : toFinsupp ([] : List M) = 0 := by ext simp #align list.to_finsupp_nil List.toFinsupp_nil theorem toFinsupp_singleton (x : M) [DecidablePred (getD [x] Β· 0 β‰  0)] : toFinsupp [x] = Finsupp.single 0 x := by ext ⟨_ | i⟩ <;> simp [Finsupp.single_apply, (Nat.zero_lt_succ _).ne] #align list.to_finsupp_singleton List.toFinsupp_singleton @[simp] theorem toFinsupp_cons_apply_zero (x : M) (xs : List M) [DecidablePred (getD (x::xs) Β· 0 β‰  0)] : (x::xs).toFinsupp 0 = x := rfl #align list.to_finsupp_cons_apply_zero List.toFinsupp_cons_apply_zero @[simp] theorem toFinsupp_cons_apply_succ (x : M) (xs : List M) (n : β„•) [DecidablePred (getD (x::xs) Β· 0 β‰  0)] [DecidablePred (getD xs Β· 0 β‰  0)] : (x::xs).toFinsupp n.succ = xs.toFinsupp n := rfl #align list.to_finsupp_cons_apply_succ List.toFinsupp_cons_apply_succ -- Porting note (#10756): new theorem theorem toFinsupp_append {R : Type*} [AddZeroClass R] (l₁ lβ‚‚ : List R) [DecidablePred (getD (l₁ ++ lβ‚‚) Β· 0 β‰  0)] [DecidablePred (getD l₁ Β· 0 β‰  0)] [DecidablePred (getD lβ‚‚ Β· 0 β‰  0)] : toFinsupp (l₁ ++ lβ‚‚) = toFinsupp l₁ + (toFinsupp lβ‚‚).embDomain (addLeftEmbedding l₁.length) := by ext n simp only [toFinsupp_apply, Finsupp.add_apply] cases lt_or_le n l₁.length with | inl h => rw [getD_append _ _ _ _ h, Finsupp.embDomain_notin_range, add_zero] rintro ⟨k, rfl : length l₁ + k = n⟩ omega | inr h => rcases Nat.exists_eq_add_of_le h with ⟨k, rfl⟩ rw [getD_append_right _ _ _ _ h, Nat.add_sub_cancel_left, getD_eq_default _ _ h, zero_add] exact Eq.symm (Finsupp.embDomain_apply _ _ _) theorem toFinsupp_cons_eq_single_add_embDomain {R : Type*} [AddZeroClass R] (x : R) (xs : List R) [DecidablePred (getD (x::xs) Β· 0 β‰  0)] [DecidablePred (getD xs Β· 0 β‰  0)] : toFinsupp (x::xs) = Finsupp.single 0 x + (toFinsupp xs).embDomain ⟨Nat.succ, Nat.succ_injective⟩ := by classical convert toFinsupp_append [x] xs using 3 Β· exact (toFinsupp_singleton x).symm Β· ext n exact add_comm n 1 #align list.to_finsupp_cons_eq_single_add_emb_domain List.toFinsupp_cons_eq_single_add_embDomain
Mathlib/Data/List/ToFinsupp.lean
139
143
theorem toFinsupp_concat_eq_toFinsupp_add_single {R : Type*} [AddZeroClass R] (x : R) (xs : List R) [DecidablePred fun i => getD (xs ++ [x]) i 0 β‰  0] [DecidablePred fun i => getD xs i 0 β‰  0] : toFinsupp (xs ++ [x]) = toFinsupp xs + Finsupp.single xs.length x := by
classical rw [toFinsupp_append, toFinsupp_singleton, Finsupp.embDomain_single, addLeftEmbedding_apply, add_zero]
2
7.389056
1
1.333333
6
1,413
import Mathlib.Data.Finsupp.Defs #align_import data.list.to_finsupp from "leanprover-community/mathlib"@"06a655b5fcfbda03502f9158bbf6c0f1400886f9" namespace List variable {M : Type*} [Zero M] (l : List M) [DecidablePred (getD l Β· 0 β‰  0)] (n : β„•) def toFinsupp : β„• β†’β‚€ M where toFun i := getD l i 0 support := (Finset.range l.length).filter fun i => getD l i 0 β‰  0 mem_support_toFun n := by simp only [Ne, Finset.mem_filter, Finset.mem_range, and_iff_right_iff_imp] contrapose! exact getD_eq_default _ _ #align list.to_finsupp List.toFinsupp @[norm_cast] theorem coe_toFinsupp : (l.toFinsupp : β„• β†’ M) = (l.getD Β· 0) := rfl #align list.coe_to_finsupp List.coe_toFinsupp @[simp, norm_cast] theorem toFinsupp_apply (i : β„•) : (l.toFinsupp : β„• β†’ M) i = l.getD i 0 := rfl #align list.to_finsupp_apply List.toFinsupp_apply theorem toFinsupp_support : l.toFinsupp.support = (Finset.range l.length).filter (getD l Β· 0 β‰  0) := rfl #align list.to_finsupp_support List.toFinsupp_support theorem toFinsupp_apply_lt (hn : n < l.length) : l.toFinsupp n = l.get ⟨n, hn⟩ := getD_eq_get _ _ _ theorem toFinsupp_apply_fin (n : Fin l.length) : l.toFinsupp n = l.get n := getD_eq_get _ _ _ set_option linter.deprecated false in @[deprecated (since := "2023-04-10")] theorem toFinsupp_apply_lt' (hn : n < l.length) : l.toFinsupp n = l.nthLe n hn := getD_eq_get _ _ _ #align list.to_finsupp_apply_lt List.toFinsupp_apply_lt' theorem toFinsupp_apply_le (hn : l.length ≀ n) : l.toFinsupp n = 0 := getD_eq_default _ _ hn #align list.to_finsupp_apply_le List.toFinsupp_apply_le @[simp] theorem toFinsupp_nil [DecidablePred fun i => getD ([] : List M) i 0 β‰  0] : toFinsupp ([] : List M) = 0 := by ext simp #align list.to_finsupp_nil List.toFinsupp_nil theorem toFinsupp_singleton (x : M) [DecidablePred (getD [x] Β· 0 β‰  0)] : toFinsupp [x] = Finsupp.single 0 x := by ext ⟨_ | i⟩ <;> simp [Finsupp.single_apply, (Nat.zero_lt_succ _).ne] #align list.to_finsupp_singleton List.toFinsupp_singleton @[simp] theorem toFinsupp_cons_apply_zero (x : M) (xs : List M) [DecidablePred (getD (x::xs) Β· 0 β‰  0)] : (x::xs).toFinsupp 0 = x := rfl #align list.to_finsupp_cons_apply_zero List.toFinsupp_cons_apply_zero @[simp] theorem toFinsupp_cons_apply_succ (x : M) (xs : List M) (n : β„•) [DecidablePred (getD (x::xs) Β· 0 β‰  0)] [DecidablePred (getD xs Β· 0 β‰  0)] : (x::xs).toFinsupp n.succ = xs.toFinsupp n := rfl #align list.to_finsupp_cons_apply_succ List.toFinsupp_cons_apply_succ -- Porting note (#10756): new theorem theorem toFinsupp_append {R : Type*} [AddZeroClass R] (l₁ lβ‚‚ : List R) [DecidablePred (getD (l₁ ++ lβ‚‚) Β· 0 β‰  0)] [DecidablePred (getD l₁ Β· 0 β‰  0)] [DecidablePred (getD lβ‚‚ Β· 0 β‰  0)] : toFinsupp (l₁ ++ lβ‚‚) = toFinsupp l₁ + (toFinsupp lβ‚‚).embDomain (addLeftEmbedding l₁.length) := by ext n simp only [toFinsupp_apply, Finsupp.add_apply] cases lt_or_le n l₁.length with | inl h => rw [getD_append _ _ _ _ h, Finsupp.embDomain_notin_range, add_zero] rintro ⟨k, rfl : length l₁ + k = n⟩ omega | inr h => rcases Nat.exists_eq_add_of_le h with ⟨k, rfl⟩ rw [getD_append_right _ _ _ _ h, Nat.add_sub_cancel_left, getD_eq_default _ _ h, zero_add] exact Eq.symm (Finsupp.embDomain_apply _ _ _) theorem toFinsupp_cons_eq_single_add_embDomain {R : Type*} [AddZeroClass R] (x : R) (xs : List R) [DecidablePred (getD (x::xs) Β· 0 β‰  0)] [DecidablePred (getD xs Β· 0 β‰  0)] : toFinsupp (x::xs) = Finsupp.single 0 x + (toFinsupp xs).embDomain ⟨Nat.succ, Nat.succ_injective⟩ := by classical convert toFinsupp_append [x] xs using 3 Β· exact (toFinsupp_singleton x).symm Β· ext n exact add_comm n 1 #align list.to_finsupp_cons_eq_single_add_emb_domain List.toFinsupp_cons_eq_single_add_embDomain theorem toFinsupp_concat_eq_toFinsupp_add_single {R : Type*} [AddZeroClass R] (x : R) (xs : List R) [DecidablePred fun i => getD (xs ++ [x]) i 0 β‰  0] [DecidablePred fun i => getD xs i 0 β‰  0] : toFinsupp (xs ++ [x]) = toFinsupp xs + Finsupp.single xs.length x := by classical rw [toFinsupp_append, toFinsupp_singleton, Finsupp.embDomain_single, addLeftEmbedding_apply, add_zero] #align list.to_finsupp_concat_eq_to_finsupp_add_single List.toFinsupp_concat_eq_toFinsupp_add_single
Mathlib/Data/List/ToFinsupp.lean
147
156
theorem toFinsupp_eq_sum_map_enum_single {R : Type*} [AddMonoid R] (l : List R) [DecidablePred (getD l Β· 0 β‰  0)] : toFinsupp l = (l.enum.map fun nr : β„• Γ— R => Finsupp.single nr.1 nr.2).sum := by
/- Porting note (#11215): TODO: `induction` fails to substitute `l = []` in `[DecidablePred (getD l Β· 0 β‰  0)]`, so we manually do some `revert`/`intro` as a workaround -/ revert l; intro l induction l using List.reverseRecOn with | nil => exact toFinsupp_nil | append_singleton x xs ih => classical simp [toFinsupp_concat_eq_toFinsupp_add_single, enum_append, ih]
7
1,096.633158
2
1.333333
6
1,413
import Mathlib.LinearAlgebra.Contraction import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff #align_import linear_algebra.trace from "leanprover-community/mathlib"@"4cf7ca0e69e048b006674cf4499e5c7d296a89e0" noncomputable section universe u v w namespace LinearMap open Matrix open FiniteDimensional open TensorProduct section variable (R : Type u) [CommSemiring R] {M : Type v} [AddCommMonoid M] [Module R M] variable {ΞΉ : Type w} [DecidableEq ΞΉ] [Fintype ΞΉ] variable {ΞΊ : Type*} [DecidableEq ΞΊ] [Fintype ΞΊ] variable (b : Basis ΞΉ R M) (c : Basis ΞΊ R M) def traceAux : (M β†’β‚—[R] M) β†’β‚—[R] R := Matrix.traceLinearMap ΞΉ R R βˆ˜β‚— ↑(LinearMap.toMatrix b b) #align linear_map.trace_aux LinearMap.traceAux -- Can't be `simp` because it would cause a loop. theorem traceAux_def (b : Basis ΞΉ R M) (f : M β†’β‚—[R] M) : traceAux R b f = Matrix.trace (LinearMap.toMatrix b b f) := rfl #align linear_map.trace_aux_def LinearMap.traceAux_def
Mathlib/LinearAlgebra/Trace.lean
55
69
theorem traceAux_eq : traceAux R b = traceAux R c := LinearMap.ext fun f => calc Matrix.trace (LinearMap.toMatrix b b f) = Matrix.trace (LinearMap.toMatrix b b ((LinearMap.id.comp f).comp LinearMap.id)) := by
rw [LinearMap.id_comp, LinearMap.comp_id] _ = Matrix.trace (LinearMap.toMatrix c b LinearMap.id * LinearMap.toMatrix c c f * LinearMap.toMatrix b c LinearMap.id) := by rw [LinearMap.toMatrix_comp _ c, LinearMap.toMatrix_comp _ c] _ = Matrix.trace (LinearMap.toMatrix c c f * LinearMap.toMatrix b c LinearMap.id * LinearMap.toMatrix c b LinearMap.id) := by rw [Matrix.mul_assoc, Matrix.trace_mul_comm] _ = Matrix.trace (LinearMap.toMatrix c c ((f.comp LinearMap.id).comp LinearMap.id)) := by rw [LinearMap.toMatrix_comp _ b, LinearMap.toMatrix_comp _ c] _ = Matrix.trace (LinearMap.toMatrix c c f) := by rw [LinearMap.comp_id, LinearMap.comp_id]
10
22,026.465795
2
1.333333
6
1,414
import Mathlib.LinearAlgebra.Contraction import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff #align_import linear_algebra.trace from "leanprover-community/mathlib"@"4cf7ca0e69e048b006674cf4499e5c7d296a89e0" noncomputable section universe u v w namespace LinearMap open Matrix open FiniteDimensional open TensorProduct section variable (R : Type u) [CommSemiring R] {M : Type v} [AddCommMonoid M] [Module R M] variable {ΞΉ : Type w} [DecidableEq ΞΉ] [Fintype ΞΉ] variable {ΞΊ : Type*} [DecidableEq ΞΊ] [Fintype ΞΊ] variable (b : Basis ΞΉ R M) (c : Basis ΞΊ R M) def traceAux : (M β†’β‚—[R] M) β†’β‚—[R] R := Matrix.traceLinearMap ΞΉ R R βˆ˜β‚— ↑(LinearMap.toMatrix b b) #align linear_map.trace_aux LinearMap.traceAux -- Can't be `simp` because it would cause a loop. theorem traceAux_def (b : Basis ΞΉ R M) (f : M β†’β‚—[R] M) : traceAux R b f = Matrix.trace (LinearMap.toMatrix b b f) := rfl #align linear_map.trace_aux_def LinearMap.traceAux_def theorem traceAux_eq : traceAux R b = traceAux R c := LinearMap.ext fun f => calc Matrix.trace (LinearMap.toMatrix b b f) = Matrix.trace (LinearMap.toMatrix b b ((LinearMap.id.comp f).comp LinearMap.id)) := by rw [LinearMap.id_comp, LinearMap.comp_id] _ = Matrix.trace (LinearMap.toMatrix c b LinearMap.id * LinearMap.toMatrix c c f * LinearMap.toMatrix b c LinearMap.id) := by rw [LinearMap.toMatrix_comp _ c, LinearMap.toMatrix_comp _ c] _ = Matrix.trace (LinearMap.toMatrix c c f * LinearMap.toMatrix b c LinearMap.id * LinearMap.toMatrix c b LinearMap.id) := by rw [Matrix.mul_assoc, Matrix.trace_mul_comm] _ = Matrix.trace (LinearMap.toMatrix c c ((f.comp LinearMap.id).comp LinearMap.id)) := by rw [LinearMap.toMatrix_comp _ b, LinearMap.toMatrix_comp _ c] _ = Matrix.trace (LinearMap.toMatrix c c f) := by rw [LinearMap.comp_id, LinearMap.comp_id] #align linear_map.trace_aux_eq LinearMap.traceAux_eq open scoped Classical variable (M) def trace : (M β†’β‚—[R] M) β†’β‚—[R] R := if H : βˆƒ s : Finset M, Nonempty (Basis s R M) then traceAux R H.choose_spec.some else 0 #align linear_map.trace LinearMap.trace variable {M}
Mathlib/LinearAlgebra/Trace.lean
84
89
theorem trace_eq_matrix_trace_of_finset {s : Finset M} (b : Basis s R M) (f : M β†’β‚—[R] M) : trace R M f = Matrix.trace (LinearMap.toMatrix b b f) := by
have : βˆƒ s : Finset M, Nonempty (Basis s R M) := ⟨s, ⟨b⟩⟩ rw [trace, dif_pos this, ← traceAux_def] congr 1 apply traceAux_eq
4
54.59815
2
1.333333
6
1,414
import Mathlib.LinearAlgebra.Contraction import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff #align_import linear_algebra.trace from "leanprover-community/mathlib"@"4cf7ca0e69e048b006674cf4499e5c7d296a89e0" noncomputable section universe u v w namespace LinearMap open Matrix open FiniteDimensional open TensorProduct section variable (R : Type u) [CommSemiring R] {M : Type v} [AddCommMonoid M] [Module R M] variable {ΞΉ : Type w} [DecidableEq ΞΉ] [Fintype ΞΉ] variable {ΞΊ : Type*} [DecidableEq ΞΊ] [Fintype ΞΊ] variable (b : Basis ΞΉ R M) (c : Basis ΞΊ R M) def traceAux : (M β†’β‚—[R] M) β†’β‚—[R] R := Matrix.traceLinearMap ΞΉ R R βˆ˜β‚— ↑(LinearMap.toMatrix b b) #align linear_map.trace_aux LinearMap.traceAux -- Can't be `simp` because it would cause a loop. theorem traceAux_def (b : Basis ΞΉ R M) (f : M β†’β‚—[R] M) : traceAux R b f = Matrix.trace (LinearMap.toMatrix b b f) := rfl #align linear_map.trace_aux_def LinearMap.traceAux_def theorem traceAux_eq : traceAux R b = traceAux R c := LinearMap.ext fun f => calc Matrix.trace (LinearMap.toMatrix b b f) = Matrix.trace (LinearMap.toMatrix b b ((LinearMap.id.comp f).comp LinearMap.id)) := by rw [LinearMap.id_comp, LinearMap.comp_id] _ = Matrix.trace (LinearMap.toMatrix c b LinearMap.id * LinearMap.toMatrix c c f * LinearMap.toMatrix b c LinearMap.id) := by rw [LinearMap.toMatrix_comp _ c, LinearMap.toMatrix_comp _ c] _ = Matrix.trace (LinearMap.toMatrix c c f * LinearMap.toMatrix b c LinearMap.id * LinearMap.toMatrix c b LinearMap.id) := by rw [Matrix.mul_assoc, Matrix.trace_mul_comm] _ = Matrix.trace (LinearMap.toMatrix c c ((f.comp LinearMap.id).comp LinearMap.id)) := by rw [LinearMap.toMatrix_comp _ b, LinearMap.toMatrix_comp _ c] _ = Matrix.trace (LinearMap.toMatrix c c f) := by rw [LinearMap.comp_id, LinearMap.comp_id] #align linear_map.trace_aux_eq LinearMap.traceAux_eq open scoped Classical variable (M) def trace : (M β†’β‚—[R] M) β†’β‚—[R] R := if H : βˆƒ s : Finset M, Nonempty (Basis s R M) then traceAux R H.choose_spec.some else 0 #align linear_map.trace LinearMap.trace variable {M} theorem trace_eq_matrix_trace_of_finset {s : Finset M} (b : Basis s R M) (f : M β†’β‚—[R] M) : trace R M f = Matrix.trace (LinearMap.toMatrix b b f) := by have : βˆƒ s : Finset M, Nonempty (Basis s R M) := ⟨s, ⟨b⟩⟩ rw [trace, dif_pos this, ← traceAux_def] congr 1 apply traceAux_eq #align linear_map.trace_eq_matrix_trace_of_finset LinearMap.trace_eq_matrix_trace_of_finset
Mathlib/LinearAlgebra/Trace.lean
92
95
theorem trace_eq_matrix_trace (f : M β†’β‚—[R] M) : trace R M f = Matrix.trace (LinearMap.toMatrix b b f) := by
rw [trace_eq_matrix_trace_of_finset R b.reindexFinsetRange, ← traceAux_def, ← traceAux_def, traceAux_eq R b b.reindexFinsetRange]
2
7.389056
1
1.333333
6
1,414
import Mathlib.LinearAlgebra.Contraction import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff #align_import linear_algebra.trace from "leanprover-community/mathlib"@"4cf7ca0e69e048b006674cf4499e5c7d296a89e0" noncomputable section universe u v w namespace LinearMap open Matrix open FiniteDimensional open TensorProduct section variable (R : Type u) [CommSemiring R] {M : Type v} [AddCommMonoid M] [Module R M] variable {ΞΉ : Type w} [DecidableEq ΞΉ] [Fintype ΞΉ] variable {ΞΊ : Type*} [DecidableEq ΞΊ] [Fintype ΞΊ] variable (b : Basis ΞΉ R M) (c : Basis ΞΊ R M) def traceAux : (M β†’β‚—[R] M) β†’β‚—[R] R := Matrix.traceLinearMap ΞΉ R R βˆ˜β‚— ↑(LinearMap.toMatrix b b) #align linear_map.trace_aux LinearMap.traceAux -- Can't be `simp` because it would cause a loop. theorem traceAux_def (b : Basis ΞΉ R M) (f : M β†’β‚—[R] M) : traceAux R b f = Matrix.trace (LinearMap.toMatrix b b f) := rfl #align linear_map.trace_aux_def LinearMap.traceAux_def theorem traceAux_eq : traceAux R b = traceAux R c := LinearMap.ext fun f => calc Matrix.trace (LinearMap.toMatrix b b f) = Matrix.trace (LinearMap.toMatrix b b ((LinearMap.id.comp f).comp LinearMap.id)) := by rw [LinearMap.id_comp, LinearMap.comp_id] _ = Matrix.trace (LinearMap.toMatrix c b LinearMap.id * LinearMap.toMatrix c c f * LinearMap.toMatrix b c LinearMap.id) := by rw [LinearMap.toMatrix_comp _ c, LinearMap.toMatrix_comp _ c] _ = Matrix.trace (LinearMap.toMatrix c c f * LinearMap.toMatrix b c LinearMap.id * LinearMap.toMatrix c b LinearMap.id) := by rw [Matrix.mul_assoc, Matrix.trace_mul_comm] _ = Matrix.trace (LinearMap.toMatrix c c ((f.comp LinearMap.id).comp LinearMap.id)) := by rw [LinearMap.toMatrix_comp _ b, LinearMap.toMatrix_comp _ c] _ = Matrix.trace (LinearMap.toMatrix c c f) := by rw [LinearMap.comp_id, LinearMap.comp_id] #align linear_map.trace_aux_eq LinearMap.traceAux_eq open scoped Classical variable (M) def trace : (M β†’β‚—[R] M) β†’β‚—[R] R := if H : βˆƒ s : Finset M, Nonempty (Basis s R M) then traceAux R H.choose_spec.some else 0 #align linear_map.trace LinearMap.trace variable {M} theorem trace_eq_matrix_trace_of_finset {s : Finset M} (b : Basis s R M) (f : M β†’β‚—[R] M) : trace R M f = Matrix.trace (LinearMap.toMatrix b b f) := by have : βˆƒ s : Finset M, Nonempty (Basis s R M) := ⟨s, ⟨b⟩⟩ rw [trace, dif_pos this, ← traceAux_def] congr 1 apply traceAux_eq #align linear_map.trace_eq_matrix_trace_of_finset LinearMap.trace_eq_matrix_trace_of_finset theorem trace_eq_matrix_trace (f : M β†’β‚—[R] M) : trace R M f = Matrix.trace (LinearMap.toMatrix b b f) := by rw [trace_eq_matrix_trace_of_finset R b.reindexFinsetRange, ← traceAux_def, ← traceAux_def, traceAux_eq R b b.reindexFinsetRange] #align linear_map.trace_eq_matrix_trace LinearMap.trace_eq_matrix_trace theorem trace_mul_comm (f g : M β†’β‚—[R] M) : trace R M (f * g) = trace R M (g * f) := if H : βˆƒ s : Finset M, Nonempty (Basis s R M) then by let ⟨s, ⟨b⟩⟩ := H simp_rw [trace_eq_matrix_trace R b, LinearMap.toMatrix_mul] apply Matrix.trace_mul_comm else by rw [trace, dif_neg H, LinearMap.zero_apply, LinearMap.zero_apply] #align linear_map.trace_mul_comm LinearMap.trace_mul_comm lemma trace_mul_cycle (f g h : M β†’β‚—[R] M) : trace R M (f * g * h) = trace R M (h * f * g) := by rw [LinearMap.trace_mul_comm, ← mul_assoc] lemma trace_mul_cycle' (f g h : M β†’β‚—[R] M) : trace R M (f * (g * h)) = trace R M (h * (f * g)) := by rw [← mul_assoc, LinearMap.trace_mul_comm] @[simp]
Mathlib/LinearAlgebra/Trace.lean
116
119
theorem trace_conj (g : M β†’β‚—[R] M) (f : (M β†’β‚—[R] M)Λ£) : trace R M (↑f * g * ↑f⁻¹) = trace R M g := by
rw [trace_mul_comm] simp
2
7.389056
1
1.333333
6
1,414
import Mathlib.LinearAlgebra.Contraction import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff #align_import linear_algebra.trace from "leanprover-community/mathlib"@"4cf7ca0e69e048b006674cf4499e5c7d296a89e0" noncomputable section universe u v w namespace LinearMap open Matrix open FiniteDimensional open TensorProduct section variable (R : Type u) [CommSemiring R] {M : Type v} [AddCommMonoid M] [Module R M] variable {ΞΉ : Type w} [DecidableEq ΞΉ] [Fintype ΞΉ] variable {ΞΊ : Type*} [DecidableEq ΞΊ] [Fintype ΞΊ] variable (b : Basis ΞΉ R M) (c : Basis ΞΊ R M) def traceAux : (M β†’β‚—[R] M) β†’β‚—[R] R := Matrix.traceLinearMap ΞΉ R R βˆ˜β‚— ↑(LinearMap.toMatrix b b) #align linear_map.trace_aux LinearMap.traceAux -- Can't be `simp` because it would cause a loop. theorem traceAux_def (b : Basis ΞΉ R M) (f : M β†’β‚—[R] M) : traceAux R b f = Matrix.trace (LinearMap.toMatrix b b f) := rfl #align linear_map.trace_aux_def LinearMap.traceAux_def theorem traceAux_eq : traceAux R b = traceAux R c := LinearMap.ext fun f => calc Matrix.trace (LinearMap.toMatrix b b f) = Matrix.trace (LinearMap.toMatrix b b ((LinearMap.id.comp f).comp LinearMap.id)) := by rw [LinearMap.id_comp, LinearMap.comp_id] _ = Matrix.trace (LinearMap.toMatrix c b LinearMap.id * LinearMap.toMatrix c c f * LinearMap.toMatrix b c LinearMap.id) := by rw [LinearMap.toMatrix_comp _ c, LinearMap.toMatrix_comp _ c] _ = Matrix.trace (LinearMap.toMatrix c c f * LinearMap.toMatrix b c LinearMap.id * LinearMap.toMatrix c b LinearMap.id) := by rw [Matrix.mul_assoc, Matrix.trace_mul_comm] _ = Matrix.trace (LinearMap.toMatrix c c ((f.comp LinearMap.id).comp LinearMap.id)) := by rw [LinearMap.toMatrix_comp _ b, LinearMap.toMatrix_comp _ c] _ = Matrix.trace (LinearMap.toMatrix c c f) := by rw [LinearMap.comp_id, LinearMap.comp_id] #align linear_map.trace_aux_eq LinearMap.traceAux_eq open scoped Classical variable (M) def trace : (M β†’β‚—[R] M) β†’β‚—[R] R := if H : βˆƒ s : Finset M, Nonempty (Basis s R M) then traceAux R H.choose_spec.some else 0 #align linear_map.trace LinearMap.trace variable {M} theorem trace_eq_matrix_trace_of_finset {s : Finset M} (b : Basis s R M) (f : M β†’β‚—[R] M) : trace R M f = Matrix.trace (LinearMap.toMatrix b b f) := by have : βˆƒ s : Finset M, Nonempty (Basis s R M) := ⟨s, ⟨b⟩⟩ rw [trace, dif_pos this, ← traceAux_def] congr 1 apply traceAux_eq #align linear_map.trace_eq_matrix_trace_of_finset LinearMap.trace_eq_matrix_trace_of_finset theorem trace_eq_matrix_trace (f : M β†’β‚—[R] M) : trace R M f = Matrix.trace (LinearMap.toMatrix b b f) := by rw [trace_eq_matrix_trace_of_finset R b.reindexFinsetRange, ← traceAux_def, ← traceAux_def, traceAux_eq R b b.reindexFinsetRange] #align linear_map.trace_eq_matrix_trace LinearMap.trace_eq_matrix_trace theorem trace_mul_comm (f g : M β†’β‚—[R] M) : trace R M (f * g) = trace R M (g * f) := if H : βˆƒ s : Finset M, Nonempty (Basis s R M) then by let ⟨s, ⟨b⟩⟩ := H simp_rw [trace_eq_matrix_trace R b, LinearMap.toMatrix_mul] apply Matrix.trace_mul_comm else by rw [trace, dif_neg H, LinearMap.zero_apply, LinearMap.zero_apply] #align linear_map.trace_mul_comm LinearMap.trace_mul_comm lemma trace_mul_cycle (f g h : M β†’β‚—[R] M) : trace R M (f * g * h) = trace R M (h * f * g) := by rw [LinearMap.trace_mul_comm, ← mul_assoc] lemma trace_mul_cycle' (f g h : M β†’β‚—[R] M) : trace R M (f * (g * h)) = trace R M (h * (f * g)) := by rw [← mul_assoc, LinearMap.trace_mul_comm] @[simp] theorem trace_conj (g : M β†’β‚—[R] M) (f : (M β†’β‚—[R] M)Λ£) : trace R M (↑f * g * ↑f⁻¹) = trace R M g := by rw [trace_mul_comm] simp #align linear_map.trace_conj LinearMap.trace_conj @[simp] lemma trace_lie {R M : Type*} [CommRing R] [AddCommGroup M] [Module R M] (f g : Module.End R M) : trace R M ⁅f, g⁆ = 0 := by rw [Ring.lie_def, map_sub, trace_mul_comm] exact sub_self _ end section variable {R : Type*} [CommRing R] {M : Type*} [AddCommGroup M] [Module R M] variable (N P : Type*) [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] variable {ΞΉ : Type*}
Mathlib/LinearAlgebra/Trace.lean
138
150
theorem trace_eq_contract_of_basis [Finite ΞΉ] (b : Basis ΞΉ R M) : LinearMap.trace R M βˆ˜β‚— dualTensorHom R M M = contractLeft R M := by
classical cases nonempty_fintype ι apply Basis.ext (Basis.tensorProduct (Basis.dualBasis b) b) rintro ⟨i, j⟩ simp only [Function.comp_apply, Basis.tensorProduct_apply, Basis.coe_dualBasis, coe_comp] rw [trace_eq_matrix_trace R b, toMatrix_dualTensorHom] by_cases hij : i = j · rw [hij] simp rw [Matrix.StdBasisMatrix.trace_zero j i (1 : R) hij] simp [Finsupp.single_eq_pi_single, hij]
11
59,874.141715
2
1.333333
6
1,414
import Mathlib.LinearAlgebra.Contraction import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff #align_import linear_algebra.trace from "leanprover-community/mathlib"@"4cf7ca0e69e048b006674cf4499e5c7d296a89e0" noncomputable section universe u v w namespace LinearMap open Matrix open FiniteDimensional open TensorProduct section variable (R : Type u) [CommSemiring R] {M : Type v} [AddCommMonoid M] [Module R M] variable {ΞΉ : Type w} [DecidableEq ΞΉ] [Fintype ΞΉ] variable {ΞΊ : Type*} [DecidableEq ΞΊ] [Fintype ΞΊ] variable (b : Basis ΞΉ R M) (c : Basis ΞΊ R M) def traceAux : (M β†’β‚—[R] M) β†’β‚—[R] R := Matrix.traceLinearMap ΞΉ R R βˆ˜β‚— ↑(LinearMap.toMatrix b b) #align linear_map.trace_aux LinearMap.traceAux -- Can't be `simp` because it would cause a loop. theorem traceAux_def (b : Basis ΞΉ R M) (f : M β†’β‚—[R] M) : traceAux R b f = Matrix.trace (LinearMap.toMatrix b b f) := rfl #align linear_map.trace_aux_def LinearMap.traceAux_def theorem traceAux_eq : traceAux R b = traceAux R c := LinearMap.ext fun f => calc Matrix.trace (LinearMap.toMatrix b b f) = Matrix.trace (LinearMap.toMatrix b b ((LinearMap.id.comp f).comp LinearMap.id)) := by rw [LinearMap.id_comp, LinearMap.comp_id] _ = Matrix.trace (LinearMap.toMatrix c b LinearMap.id * LinearMap.toMatrix c c f * LinearMap.toMatrix b c LinearMap.id) := by rw [LinearMap.toMatrix_comp _ c, LinearMap.toMatrix_comp _ c] _ = Matrix.trace (LinearMap.toMatrix c c f * LinearMap.toMatrix b c LinearMap.id * LinearMap.toMatrix c b LinearMap.id) := by rw [Matrix.mul_assoc, Matrix.trace_mul_comm] _ = Matrix.trace (LinearMap.toMatrix c c ((f.comp LinearMap.id).comp LinearMap.id)) := by rw [LinearMap.toMatrix_comp _ b, LinearMap.toMatrix_comp _ c] _ = Matrix.trace (LinearMap.toMatrix c c f) := by rw [LinearMap.comp_id, LinearMap.comp_id] #align linear_map.trace_aux_eq LinearMap.traceAux_eq open scoped Classical variable (M) def trace : (M β†’β‚—[R] M) β†’β‚—[R] R := if H : βˆƒ s : Finset M, Nonempty (Basis s R M) then traceAux R H.choose_spec.some else 0 #align linear_map.trace LinearMap.trace variable {M} theorem trace_eq_matrix_trace_of_finset {s : Finset M} (b : Basis s R M) (f : M β†’β‚—[R] M) : trace R M f = Matrix.trace (LinearMap.toMatrix b b f) := by have : βˆƒ s : Finset M, Nonempty (Basis s R M) := ⟨s, ⟨b⟩⟩ rw [trace, dif_pos this, ← traceAux_def] congr 1 apply traceAux_eq #align linear_map.trace_eq_matrix_trace_of_finset LinearMap.trace_eq_matrix_trace_of_finset theorem trace_eq_matrix_trace (f : M β†’β‚—[R] M) : trace R M f = Matrix.trace (LinearMap.toMatrix b b f) := by rw [trace_eq_matrix_trace_of_finset R b.reindexFinsetRange, ← traceAux_def, ← traceAux_def, traceAux_eq R b b.reindexFinsetRange] #align linear_map.trace_eq_matrix_trace LinearMap.trace_eq_matrix_trace theorem trace_mul_comm (f g : M β†’β‚—[R] M) : trace R M (f * g) = trace R M (g * f) := if H : βˆƒ s : Finset M, Nonempty (Basis s R M) then by let ⟨s, ⟨b⟩⟩ := H simp_rw [trace_eq_matrix_trace R b, LinearMap.toMatrix_mul] apply Matrix.trace_mul_comm else by rw [trace, dif_neg H, LinearMap.zero_apply, LinearMap.zero_apply] #align linear_map.trace_mul_comm LinearMap.trace_mul_comm lemma trace_mul_cycle (f g h : M β†’β‚—[R] M) : trace R M (f * g * h) = trace R M (h * f * g) := by rw [LinearMap.trace_mul_comm, ← mul_assoc] lemma trace_mul_cycle' (f g h : M β†’β‚—[R] M) : trace R M (f * (g * h)) = trace R M (h * (f * g)) := by rw [← mul_assoc, LinearMap.trace_mul_comm] @[simp] theorem trace_conj (g : M β†’β‚—[R] M) (f : (M β†’β‚—[R] M)Λ£) : trace R M (↑f * g * ↑f⁻¹) = trace R M g := by rw [trace_mul_comm] simp #align linear_map.trace_conj LinearMap.trace_conj @[simp] lemma trace_lie {R M : Type*} [CommRing R] [AddCommGroup M] [Module R M] (f g : Module.End R M) : trace R M ⁅f, g⁆ = 0 := by rw [Ring.lie_def, map_sub, trace_mul_comm] exact sub_self _ end section variable {R : Type*} [CommRing R] {M : Type*} [AddCommGroup M] [Module R M] variable (N P : Type*) [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] variable {ΞΉ : Type*} theorem trace_eq_contract_of_basis [Finite ΞΉ] (b : Basis ΞΉ R M) : LinearMap.trace R M βˆ˜β‚— dualTensorHom R M M = contractLeft R M := by classical cases nonempty_fintype ΞΉ apply Basis.ext (Basis.tensorProduct (Basis.dualBasis b) b) rintro ⟨i, j⟩ simp only [Function.comp_apply, Basis.tensorProduct_apply, Basis.coe_dualBasis, coe_comp] rw [trace_eq_matrix_trace R b, toMatrix_dualTensorHom] by_cases hij : i = j Β· rw [hij] simp rw [Matrix.StdBasisMatrix.trace_zero j i (1 : R) hij] simp [Finsupp.single_eq_pi_single, hij] #align linear_map.trace_eq_contract_of_basis LinearMap.trace_eq_contract_of_basis
Mathlib/LinearAlgebra/Trace.lean
155
157
theorem trace_eq_contract_of_basis' [Fintype ΞΉ] [DecidableEq ΞΉ] (b : Basis ΞΉ R M) : LinearMap.trace R M = contractLeft R M βˆ˜β‚— (dualTensorHomEquivOfBasis b).symm.toLinearMap := by
simp [LinearEquiv.eq_comp_toLinearMap_symm, trace_eq_contract_of_basis b]
1
2.718282
0
1.333333
6
1,414
import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals import Mathlib.Analysis.Calculus.ParametricIntegral import Mathlib.MeasureTheory.Measure.Haar.NormedSpace #align_import analysis.mellin_transform from "leanprover-community/mathlib"@"917c3c072e487b3cccdbfeff17e75b40e45f66cb" open MeasureTheory Set Filter Asymptotics TopologicalSpace open Real open Complex hiding exp log abs_of_nonneg open scoped Topology noncomputable section section Defs variable {E : Type*} [NormedAddCommGroup E] [NormedSpace β„‚ E] def MellinConvergent (f : ℝ β†’ E) (s : β„‚) : Prop := IntegrableOn (fun t : ℝ => (t : β„‚) ^ (s - 1) β€’ f t) (Ioi 0) #align mellin_convergent MellinConvergent
Mathlib/Analysis/MellinTransform.lean
47
50
theorem MellinConvergent.const_smul {f : ℝ β†’ E} {s : β„‚} (hf : MellinConvergent f s) {π•œ : Type*} [NontriviallyNormedField π•œ] [NormedSpace π•œ E] [SMulCommClass β„‚ π•œ E] (c : π•œ) : MellinConvergent (fun t => c β€’ f t) s := by
simpa only [MellinConvergent, smul_comm] using hf.smul c
1
2.718282
0
1.333333
12
1,415
import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals import Mathlib.Analysis.Calculus.ParametricIntegral import Mathlib.MeasureTheory.Measure.Haar.NormedSpace #align_import analysis.mellin_transform from "leanprover-community/mathlib"@"917c3c072e487b3cccdbfeff17e75b40e45f66cb" open MeasureTheory Set Filter Asymptotics TopologicalSpace open Real open Complex hiding exp log abs_of_nonneg open scoped Topology noncomputable section section Defs variable {E : Type*} [NormedAddCommGroup E] [NormedSpace β„‚ E] def MellinConvergent (f : ℝ β†’ E) (s : β„‚) : Prop := IntegrableOn (fun t : ℝ => (t : β„‚) ^ (s - 1) β€’ f t) (Ioi 0) #align mellin_convergent MellinConvergent theorem MellinConvergent.const_smul {f : ℝ β†’ E} {s : β„‚} (hf : MellinConvergent f s) {π•œ : Type*} [NontriviallyNormedField π•œ] [NormedSpace π•œ E] [SMulCommClass β„‚ π•œ E] (c : π•œ) : MellinConvergent (fun t => c β€’ f t) s := by simpa only [MellinConvergent, smul_comm] using hf.smul c #align mellin_convergent.const_smul MellinConvergent.const_smul
Mathlib/Analysis/MellinTransform.lean
53
56
theorem MellinConvergent.cpow_smul {f : ℝ β†’ E} {s a : β„‚} : MellinConvergent (fun t => (t : β„‚) ^ a β€’ f t) s ↔ MellinConvergent f (s + a) := by
refine integrableOn_congr_fun (fun t ht => ?_) measurableSet_Ioi simp_rw [← sub_add_eq_add_sub, cpow_add _ _ (ofReal_ne_zero.2 <| ne_of_gt ht), mul_smul]
2
7.389056
1
1.333333
12
1,415
import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals import Mathlib.Analysis.Calculus.ParametricIntegral import Mathlib.MeasureTheory.Measure.Haar.NormedSpace #align_import analysis.mellin_transform from "leanprover-community/mathlib"@"917c3c072e487b3cccdbfeff17e75b40e45f66cb" open MeasureTheory Set Filter Asymptotics TopologicalSpace open Real open Complex hiding exp log abs_of_nonneg open scoped Topology noncomputable section section Defs variable {E : Type*} [NormedAddCommGroup E] [NormedSpace β„‚ E] def MellinConvergent (f : ℝ β†’ E) (s : β„‚) : Prop := IntegrableOn (fun t : ℝ => (t : β„‚) ^ (s - 1) β€’ f t) (Ioi 0) #align mellin_convergent MellinConvergent theorem MellinConvergent.const_smul {f : ℝ β†’ E} {s : β„‚} (hf : MellinConvergent f s) {π•œ : Type*} [NontriviallyNormedField π•œ] [NormedSpace π•œ E] [SMulCommClass β„‚ π•œ E] (c : π•œ) : MellinConvergent (fun t => c β€’ f t) s := by simpa only [MellinConvergent, smul_comm] using hf.smul c #align mellin_convergent.const_smul MellinConvergent.const_smul theorem MellinConvergent.cpow_smul {f : ℝ β†’ E} {s a : β„‚} : MellinConvergent (fun t => (t : β„‚) ^ a β€’ f t) s ↔ MellinConvergent f (s + a) := by refine integrableOn_congr_fun (fun t ht => ?_) measurableSet_Ioi simp_rw [← sub_add_eq_add_sub, cpow_add _ _ (ofReal_ne_zero.2 <| ne_of_gt ht), mul_smul] #align mellin_convergent.cpow_smul MellinConvergent.cpow_smul nonrec theorem MellinConvergent.div_const {f : ℝ β†’ β„‚} {s : β„‚} (hf : MellinConvergent f s) (a : β„‚) : MellinConvergent (fun t => f t / a) s := by simpa only [MellinConvergent, smul_eq_mul, ← mul_div_assoc] using hf.div_const a #align mellin_convergent.div_const MellinConvergent.div_const
Mathlib/Analysis/MellinTransform.lean
64
75
theorem MellinConvergent.comp_mul_left {f : ℝ β†’ E} {s : β„‚} {a : ℝ} (ha : 0 < a) : MellinConvergent (fun t => f (a * t)) s ↔ MellinConvergent f s := by
have := integrableOn_Ioi_comp_mul_left_iff (fun t : ℝ => (t : β„‚) ^ (s - 1) β€’ f t) 0 ha rw [mul_zero] at this have h1 : EqOn (fun t : ℝ => (↑(a * t) : β„‚) ^ (s - 1) β€’ f (a * t)) ((a : β„‚) ^ (s - 1) β€’ fun t : ℝ => (t : β„‚) ^ (s - 1) β€’ f (a * t)) (Ioi 0) := fun t ht ↦ by simp only [ofReal_mul, mul_cpow_ofReal_nonneg ha.le (le_of_lt ht), mul_smul, Pi.smul_apply] have h2 : (a : β„‚) ^ (s - 1) β‰  0 := by rw [Ne, cpow_eq_zero_iff, not_and_or, ofReal_eq_zero] exact Or.inl ha.ne' rw [MellinConvergent, MellinConvergent, ← this, integrableOn_congr_fun h1 measurableSet_Ioi, IntegrableOn, IntegrableOn, integrable_smul_iff h2]
10
22,026.465795
2
1.333333
12
1,415
import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals import Mathlib.Analysis.Calculus.ParametricIntegral import Mathlib.MeasureTheory.Measure.Haar.NormedSpace #align_import analysis.mellin_transform from "leanprover-community/mathlib"@"917c3c072e487b3cccdbfeff17e75b40e45f66cb" open MeasureTheory Set Filter Asymptotics TopologicalSpace open Real open Complex hiding exp log abs_of_nonneg open scoped Topology noncomputable section section Defs variable {E : Type*} [NormedAddCommGroup E] [NormedSpace β„‚ E] def MellinConvergent (f : ℝ β†’ E) (s : β„‚) : Prop := IntegrableOn (fun t : ℝ => (t : β„‚) ^ (s - 1) β€’ f t) (Ioi 0) #align mellin_convergent MellinConvergent theorem MellinConvergent.const_smul {f : ℝ β†’ E} {s : β„‚} (hf : MellinConvergent f s) {π•œ : Type*} [NontriviallyNormedField π•œ] [NormedSpace π•œ E] [SMulCommClass β„‚ π•œ E] (c : π•œ) : MellinConvergent (fun t => c β€’ f t) s := by simpa only [MellinConvergent, smul_comm] using hf.smul c #align mellin_convergent.const_smul MellinConvergent.const_smul theorem MellinConvergent.cpow_smul {f : ℝ β†’ E} {s a : β„‚} : MellinConvergent (fun t => (t : β„‚) ^ a β€’ f t) s ↔ MellinConvergent f (s + a) := by refine integrableOn_congr_fun (fun t ht => ?_) measurableSet_Ioi simp_rw [← sub_add_eq_add_sub, cpow_add _ _ (ofReal_ne_zero.2 <| ne_of_gt ht), mul_smul] #align mellin_convergent.cpow_smul MellinConvergent.cpow_smul nonrec theorem MellinConvergent.div_const {f : ℝ β†’ β„‚} {s : β„‚} (hf : MellinConvergent f s) (a : β„‚) : MellinConvergent (fun t => f t / a) s := by simpa only [MellinConvergent, smul_eq_mul, ← mul_div_assoc] using hf.div_const a #align mellin_convergent.div_const MellinConvergent.div_const theorem MellinConvergent.comp_mul_left {f : ℝ β†’ E} {s : β„‚} {a : ℝ} (ha : 0 < a) : MellinConvergent (fun t => f (a * t)) s ↔ MellinConvergent f s := by have := integrableOn_Ioi_comp_mul_left_iff (fun t : ℝ => (t : β„‚) ^ (s - 1) β€’ f t) 0 ha rw [mul_zero] at this have h1 : EqOn (fun t : ℝ => (↑(a * t) : β„‚) ^ (s - 1) β€’ f (a * t)) ((a : β„‚) ^ (s - 1) β€’ fun t : ℝ => (t : β„‚) ^ (s - 1) β€’ f (a * t)) (Ioi 0) := fun t ht ↦ by simp only [ofReal_mul, mul_cpow_ofReal_nonneg ha.le (le_of_lt ht), mul_smul, Pi.smul_apply] have h2 : (a : β„‚) ^ (s - 1) β‰  0 := by rw [Ne, cpow_eq_zero_iff, not_and_or, ofReal_eq_zero] exact Or.inl ha.ne' rw [MellinConvergent, MellinConvergent, ← this, integrableOn_congr_fun h1 measurableSet_Ioi, IntegrableOn, IntegrableOn, integrable_smul_iff h2] #align mellin_convergent.comp_mul_left MellinConvergent.comp_mul_left
Mathlib/Analysis/MellinTransform.lean
78
87
theorem MellinConvergent.comp_rpow {f : ℝ β†’ E} {s : β„‚} {a : ℝ} (ha : a β‰  0) : MellinConvergent (fun t => f (t ^ a)) s ↔ MellinConvergent f (s / a) := by
refine Iff.trans ?_ (integrableOn_Ioi_comp_rpow_iff' _ ha) rw [MellinConvergent] refine integrableOn_congr_fun (fun t ht => ?_) measurableSet_Ioi dsimp only [Pi.smul_apply] rw [← Complex.coe_smul (t ^ (a - 1)), ← mul_smul, ← cpow_mul_ofReal_nonneg (le_of_lt ht), ofReal_cpow (le_of_lt ht), ← cpow_add _ _ (ofReal_ne_zero.mpr (ne_of_gt ht)), ofReal_sub, ofReal_one, mul_sub, mul_div_cancelβ‚€ _ (ofReal_ne_zero.mpr ha), mul_one, add_comm, ← add_sub_assoc, sub_add_cancel]
8
2,980.957987
2
1.333333
12
1,415
import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals import Mathlib.Analysis.Calculus.ParametricIntegral import Mathlib.MeasureTheory.Measure.Haar.NormedSpace #align_import analysis.mellin_transform from "leanprover-community/mathlib"@"917c3c072e487b3cccdbfeff17e75b40e45f66cb" open MeasureTheory Set Filter Asymptotics TopologicalSpace open Real open Complex hiding exp log abs_of_nonneg open scoped Topology noncomputable section section Defs variable {E : Type*} [NormedAddCommGroup E] [NormedSpace β„‚ E] def MellinConvergent (f : ℝ β†’ E) (s : β„‚) : Prop := IntegrableOn (fun t : ℝ => (t : β„‚) ^ (s - 1) β€’ f t) (Ioi 0) #align mellin_convergent MellinConvergent theorem MellinConvergent.const_smul {f : ℝ β†’ E} {s : β„‚} (hf : MellinConvergent f s) {π•œ : Type*} [NontriviallyNormedField π•œ] [NormedSpace π•œ E] [SMulCommClass β„‚ π•œ E] (c : π•œ) : MellinConvergent (fun t => c β€’ f t) s := by simpa only [MellinConvergent, smul_comm] using hf.smul c #align mellin_convergent.const_smul MellinConvergent.const_smul theorem MellinConvergent.cpow_smul {f : ℝ β†’ E} {s a : β„‚} : MellinConvergent (fun t => (t : β„‚) ^ a β€’ f t) s ↔ MellinConvergent f (s + a) := by refine integrableOn_congr_fun (fun t ht => ?_) measurableSet_Ioi simp_rw [← sub_add_eq_add_sub, cpow_add _ _ (ofReal_ne_zero.2 <| ne_of_gt ht), mul_smul] #align mellin_convergent.cpow_smul MellinConvergent.cpow_smul nonrec theorem MellinConvergent.div_const {f : ℝ β†’ β„‚} {s : β„‚} (hf : MellinConvergent f s) (a : β„‚) : MellinConvergent (fun t => f t / a) s := by simpa only [MellinConvergent, smul_eq_mul, ← mul_div_assoc] using hf.div_const a #align mellin_convergent.div_const MellinConvergent.div_const theorem MellinConvergent.comp_mul_left {f : ℝ β†’ E} {s : β„‚} {a : ℝ} (ha : 0 < a) : MellinConvergent (fun t => f (a * t)) s ↔ MellinConvergent f s := by have := integrableOn_Ioi_comp_mul_left_iff (fun t : ℝ => (t : β„‚) ^ (s - 1) β€’ f t) 0 ha rw [mul_zero] at this have h1 : EqOn (fun t : ℝ => (↑(a * t) : β„‚) ^ (s - 1) β€’ f (a * t)) ((a : β„‚) ^ (s - 1) β€’ fun t : ℝ => (t : β„‚) ^ (s - 1) β€’ f (a * t)) (Ioi 0) := fun t ht ↦ by simp only [ofReal_mul, mul_cpow_ofReal_nonneg ha.le (le_of_lt ht), mul_smul, Pi.smul_apply] have h2 : (a : β„‚) ^ (s - 1) β‰  0 := by rw [Ne, cpow_eq_zero_iff, not_and_or, ofReal_eq_zero] exact Or.inl ha.ne' rw [MellinConvergent, MellinConvergent, ← this, integrableOn_congr_fun h1 measurableSet_Ioi, IntegrableOn, IntegrableOn, integrable_smul_iff h2] #align mellin_convergent.comp_mul_left MellinConvergent.comp_mul_left theorem MellinConvergent.comp_rpow {f : ℝ β†’ E} {s : β„‚} {a : ℝ} (ha : a β‰  0) : MellinConvergent (fun t => f (t ^ a)) s ↔ MellinConvergent f (s / a) := by refine Iff.trans ?_ (integrableOn_Ioi_comp_rpow_iff' _ ha) rw [MellinConvergent] refine integrableOn_congr_fun (fun t ht => ?_) measurableSet_Ioi dsimp only [Pi.smul_apply] rw [← Complex.coe_smul (t ^ (a - 1)), ← mul_smul, ← cpow_mul_ofReal_nonneg (le_of_lt ht), ofReal_cpow (le_of_lt ht), ← cpow_add _ _ (ofReal_ne_zero.mpr (ne_of_gt ht)), ofReal_sub, ofReal_one, mul_sub, mul_div_cancelβ‚€ _ (ofReal_ne_zero.mpr ha), mul_one, add_comm, ← add_sub_assoc, sub_add_cancel] #align mellin_convergent.comp_rpow MellinConvergent.comp_rpow def Complex.VerticalIntegrable (f : β„‚ β†’ E) (Οƒ : ℝ) (ΞΌ : Measure ℝ := by volume_tac) : Prop := Integrable (fun (y : ℝ) ↦ f (Οƒ + y * I)) ΞΌ def mellin (f : ℝ β†’ E) (s : β„‚) : E := ∫ t : ℝ in Ioi 0, (t : β„‚) ^ (s - 1) β€’ f t #align mellin mellin def mellinInv (Οƒ : ℝ) (f : β„‚ β†’ E) (x : ℝ) : E := (1 / (2 * Ο€)) β€’ ∫ y : ℝ, (x : β„‚) ^ (-(Οƒ + y * I)) β€’ f (Οƒ + y * I) -- next few lemmas don't require convergence of the Mellin transform (they are just 0 = 0 otherwise)
Mathlib/Analysis/MellinTransform.lean
106
109
theorem mellin_cpow_smul (f : ℝ β†’ E) (s a : β„‚) : mellin (fun t => (t : β„‚) ^ a β€’ f t) s = mellin f (s + a) := by
refine setIntegral_congr measurableSet_Ioi fun t ht => ?_ simp_rw [← sub_add_eq_add_sub, cpow_add _ _ (ofReal_ne_zero.2 <| ne_of_gt ht), mul_smul]
2
7.389056
1
1.333333
12
1,415
import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals import Mathlib.Analysis.Calculus.ParametricIntegral import Mathlib.MeasureTheory.Measure.Haar.NormedSpace #align_import analysis.mellin_transform from "leanprover-community/mathlib"@"917c3c072e487b3cccdbfeff17e75b40e45f66cb" open MeasureTheory Set Filter Asymptotics TopologicalSpace open Real open Complex hiding exp log abs_of_nonneg open scoped Topology noncomputable section section Defs variable {E : Type*} [NormedAddCommGroup E] [NormedSpace β„‚ E] def MellinConvergent (f : ℝ β†’ E) (s : β„‚) : Prop := IntegrableOn (fun t : ℝ => (t : β„‚) ^ (s - 1) β€’ f t) (Ioi 0) #align mellin_convergent MellinConvergent theorem MellinConvergent.const_smul {f : ℝ β†’ E} {s : β„‚} (hf : MellinConvergent f s) {π•œ : Type*} [NontriviallyNormedField π•œ] [NormedSpace π•œ E] [SMulCommClass β„‚ π•œ E] (c : π•œ) : MellinConvergent (fun t => c β€’ f t) s := by simpa only [MellinConvergent, smul_comm] using hf.smul c #align mellin_convergent.const_smul MellinConvergent.const_smul theorem MellinConvergent.cpow_smul {f : ℝ β†’ E} {s a : β„‚} : MellinConvergent (fun t => (t : β„‚) ^ a β€’ f t) s ↔ MellinConvergent f (s + a) := by refine integrableOn_congr_fun (fun t ht => ?_) measurableSet_Ioi simp_rw [← sub_add_eq_add_sub, cpow_add _ _ (ofReal_ne_zero.2 <| ne_of_gt ht), mul_smul] #align mellin_convergent.cpow_smul MellinConvergent.cpow_smul nonrec theorem MellinConvergent.div_const {f : ℝ β†’ β„‚} {s : β„‚} (hf : MellinConvergent f s) (a : β„‚) : MellinConvergent (fun t => f t / a) s := by simpa only [MellinConvergent, smul_eq_mul, ← mul_div_assoc] using hf.div_const a #align mellin_convergent.div_const MellinConvergent.div_const theorem MellinConvergent.comp_mul_left {f : ℝ β†’ E} {s : β„‚} {a : ℝ} (ha : 0 < a) : MellinConvergent (fun t => f (a * t)) s ↔ MellinConvergent f s := by have := integrableOn_Ioi_comp_mul_left_iff (fun t : ℝ => (t : β„‚) ^ (s - 1) β€’ f t) 0 ha rw [mul_zero] at this have h1 : EqOn (fun t : ℝ => (↑(a * t) : β„‚) ^ (s - 1) β€’ f (a * t)) ((a : β„‚) ^ (s - 1) β€’ fun t : ℝ => (t : β„‚) ^ (s - 1) β€’ f (a * t)) (Ioi 0) := fun t ht ↦ by simp only [ofReal_mul, mul_cpow_ofReal_nonneg ha.le (le_of_lt ht), mul_smul, Pi.smul_apply] have h2 : (a : β„‚) ^ (s - 1) β‰  0 := by rw [Ne, cpow_eq_zero_iff, not_and_or, ofReal_eq_zero] exact Or.inl ha.ne' rw [MellinConvergent, MellinConvergent, ← this, integrableOn_congr_fun h1 measurableSet_Ioi, IntegrableOn, IntegrableOn, integrable_smul_iff h2] #align mellin_convergent.comp_mul_left MellinConvergent.comp_mul_left theorem MellinConvergent.comp_rpow {f : ℝ β†’ E} {s : β„‚} {a : ℝ} (ha : a β‰  0) : MellinConvergent (fun t => f (t ^ a)) s ↔ MellinConvergent f (s / a) := by refine Iff.trans ?_ (integrableOn_Ioi_comp_rpow_iff' _ ha) rw [MellinConvergent] refine integrableOn_congr_fun (fun t ht => ?_) measurableSet_Ioi dsimp only [Pi.smul_apply] rw [← Complex.coe_smul (t ^ (a - 1)), ← mul_smul, ← cpow_mul_ofReal_nonneg (le_of_lt ht), ofReal_cpow (le_of_lt ht), ← cpow_add _ _ (ofReal_ne_zero.mpr (ne_of_gt ht)), ofReal_sub, ofReal_one, mul_sub, mul_div_cancelβ‚€ _ (ofReal_ne_zero.mpr ha), mul_one, add_comm, ← add_sub_assoc, sub_add_cancel] #align mellin_convergent.comp_rpow MellinConvergent.comp_rpow def Complex.VerticalIntegrable (f : β„‚ β†’ E) (Οƒ : ℝ) (ΞΌ : Measure ℝ := by volume_tac) : Prop := Integrable (fun (y : ℝ) ↦ f (Οƒ + y * I)) ΞΌ def mellin (f : ℝ β†’ E) (s : β„‚) : E := ∫ t : ℝ in Ioi 0, (t : β„‚) ^ (s - 1) β€’ f t #align mellin mellin def mellinInv (Οƒ : ℝ) (f : β„‚ β†’ E) (x : ℝ) : E := (1 / (2 * Ο€)) β€’ ∫ y : ℝ, (x : β„‚) ^ (-(Οƒ + y * I)) β€’ f (Οƒ + y * I) -- next few lemmas don't require convergence of the Mellin transform (they are just 0 = 0 otherwise) theorem mellin_cpow_smul (f : ℝ β†’ E) (s a : β„‚) : mellin (fun t => (t : β„‚) ^ a β€’ f t) s = mellin f (s + a) := by refine setIntegral_congr measurableSet_Ioi fun t ht => ?_ simp_rw [← sub_add_eq_add_sub, cpow_add _ _ (ofReal_ne_zero.2 <| ne_of_gt ht), mul_smul] #align mellin_cpow_smul mellin_cpow_smul
Mathlib/Analysis/MellinTransform.lean
112
114
theorem mellin_const_smul (f : ℝ β†’ E) (s : β„‚) {π•œ : Type*} [NontriviallyNormedField π•œ] [NormedSpace π•œ E] [SMulCommClass β„‚ π•œ E] (c : π•œ) : mellin (fun t => c β€’ f t) s = c β€’ mellin f s := by
simp only [mellin, smul_comm, integral_smul]
1
2.718282
0
1.333333
12
1,415
import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals import Mathlib.Analysis.Calculus.ParametricIntegral import Mathlib.MeasureTheory.Measure.Haar.NormedSpace #align_import analysis.mellin_transform from "leanprover-community/mathlib"@"917c3c072e487b3cccdbfeff17e75b40e45f66cb" open MeasureTheory Set Filter Asymptotics TopologicalSpace open Real open Complex hiding exp log abs_of_nonneg open scoped Topology noncomputable section section Defs variable {E : Type*} [NormedAddCommGroup E] [NormedSpace β„‚ E] def MellinConvergent (f : ℝ β†’ E) (s : β„‚) : Prop := IntegrableOn (fun t : ℝ => (t : β„‚) ^ (s - 1) β€’ f t) (Ioi 0) #align mellin_convergent MellinConvergent theorem MellinConvergent.const_smul {f : ℝ β†’ E} {s : β„‚} (hf : MellinConvergent f s) {π•œ : Type*} [NontriviallyNormedField π•œ] [NormedSpace π•œ E] [SMulCommClass β„‚ π•œ E] (c : π•œ) : MellinConvergent (fun t => c β€’ f t) s := by simpa only [MellinConvergent, smul_comm] using hf.smul c #align mellin_convergent.const_smul MellinConvergent.const_smul theorem MellinConvergent.cpow_smul {f : ℝ β†’ E} {s a : β„‚} : MellinConvergent (fun t => (t : β„‚) ^ a β€’ f t) s ↔ MellinConvergent f (s + a) := by refine integrableOn_congr_fun (fun t ht => ?_) measurableSet_Ioi simp_rw [← sub_add_eq_add_sub, cpow_add _ _ (ofReal_ne_zero.2 <| ne_of_gt ht), mul_smul] #align mellin_convergent.cpow_smul MellinConvergent.cpow_smul nonrec theorem MellinConvergent.div_const {f : ℝ β†’ β„‚} {s : β„‚} (hf : MellinConvergent f s) (a : β„‚) : MellinConvergent (fun t => f t / a) s := by simpa only [MellinConvergent, smul_eq_mul, ← mul_div_assoc] using hf.div_const a #align mellin_convergent.div_const MellinConvergent.div_const theorem MellinConvergent.comp_mul_left {f : ℝ β†’ E} {s : β„‚} {a : ℝ} (ha : 0 < a) : MellinConvergent (fun t => f (a * t)) s ↔ MellinConvergent f s := by have := integrableOn_Ioi_comp_mul_left_iff (fun t : ℝ => (t : β„‚) ^ (s - 1) β€’ f t) 0 ha rw [mul_zero] at this have h1 : EqOn (fun t : ℝ => (↑(a * t) : β„‚) ^ (s - 1) β€’ f (a * t)) ((a : β„‚) ^ (s - 1) β€’ fun t : ℝ => (t : β„‚) ^ (s - 1) β€’ f (a * t)) (Ioi 0) := fun t ht ↦ by simp only [ofReal_mul, mul_cpow_ofReal_nonneg ha.le (le_of_lt ht), mul_smul, Pi.smul_apply] have h2 : (a : β„‚) ^ (s - 1) β‰  0 := by rw [Ne, cpow_eq_zero_iff, not_and_or, ofReal_eq_zero] exact Or.inl ha.ne' rw [MellinConvergent, MellinConvergent, ← this, integrableOn_congr_fun h1 measurableSet_Ioi, IntegrableOn, IntegrableOn, integrable_smul_iff h2] #align mellin_convergent.comp_mul_left MellinConvergent.comp_mul_left theorem MellinConvergent.comp_rpow {f : ℝ β†’ E} {s : β„‚} {a : ℝ} (ha : a β‰  0) : MellinConvergent (fun t => f (t ^ a)) s ↔ MellinConvergent f (s / a) := by refine Iff.trans ?_ (integrableOn_Ioi_comp_rpow_iff' _ ha) rw [MellinConvergent] refine integrableOn_congr_fun (fun t ht => ?_) measurableSet_Ioi dsimp only [Pi.smul_apply] rw [← Complex.coe_smul (t ^ (a - 1)), ← mul_smul, ← cpow_mul_ofReal_nonneg (le_of_lt ht), ofReal_cpow (le_of_lt ht), ← cpow_add _ _ (ofReal_ne_zero.mpr (ne_of_gt ht)), ofReal_sub, ofReal_one, mul_sub, mul_div_cancelβ‚€ _ (ofReal_ne_zero.mpr ha), mul_one, add_comm, ← add_sub_assoc, sub_add_cancel] #align mellin_convergent.comp_rpow MellinConvergent.comp_rpow def Complex.VerticalIntegrable (f : β„‚ β†’ E) (Οƒ : ℝ) (ΞΌ : Measure ℝ := by volume_tac) : Prop := Integrable (fun (y : ℝ) ↦ f (Οƒ + y * I)) ΞΌ def mellin (f : ℝ β†’ E) (s : β„‚) : E := ∫ t : ℝ in Ioi 0, (t : β„‚) ^ (s - 1) β€’ f t #align mellin mellin def mellinInv (Οƒ : ℝ) (f : β„‚ β†’ E) (x : ℝ) : E := (1 / (2 * Ο€)) β€’ ∫ y : ℝ, (x : β„‚) ^ (-(Οƒ + y * I)) β€’ f (Οƒ + y * I) -- next few lemmas don't require convergence of the Mellin transform (they are just 0 = 0 otherwise) theorem mellin_cpow_smul (f : ℝ β†’ E) (s a : β„‚) : mellin (fun t => (t : β„‚) ^ a β€’ f t) s = mellin f (s + a) := by refine setIntegral_congr measurableSet_Ioi fun t ht => ?_ simp_rw [← sub_add_eq_add_sub, cpow_add _ _ (ofReal_ne_zero.2 <| ne_of_gt ht), mul_smul] #align mellin_cpow_smul mellin_cpow_smul theorem mellin_const_smul (f : ℝ β†’ E) (s : β„‚) {π•œ : Type*} [NontriviallyNormedField π•œ] [NormedSpace π•œ E] [SMulCommClass β„‚ π•œ E] (c : π•œ) : mellin (fun t => c β€’ f t) s = c β€’ mellin f s := by simp only [mellin, smul_comm, integral_smul] #align mellin_const_smul mellin_const_smul
Mathlib/Analysis/MellinTransform.lean
117
118
theorem mellin_div_const (f : ℝ β†’ β„‚) (s a : β„‚) : mellin (fun t => f t / a) s = mellin f s / a := by
simp_rw [mellin, smul_eq_mul, ← mul_div_assoc, integral_div]
1
2.718282
0
1.333333
12
1,415
import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals import Mathlib.Analysis.Calculus.ParametricIntegral import Mathlib.MeasureTheory.Measure.Haar.NormedSpace #align_import analysis.mellin_transform from "leanprover-community/mathlib"@"917c3c072e487b3cccdbfeff17e75b40e45f66cb" open MeasureTheory Set Filter Asymptotics TopologicalSpace open Real open Complex hiding exp log abs_of_nonneg open scoped Topology noncomputable section variable {E : Type*} [NormedAddCommGroup E] section MellinConvergent
Mathlib/Analysis/MellinTransform.lean
196
205
theorem mellin_convergent_iff_norm [NormedSpace β„‚ E] {f : ℝ β†’ E} {T : Set ℝ} (hT : T βŠ† Ioi 0) (hT' : MeasurableSet T) (hfc : AEStronglyMeasurable f <| volume.restrict <| Ioi 0) {s : β„‚} : IntegrableOn (fun t : ℝ => (t : β„‚) ^ (s - 1) β€’ f t) T ↔ IntegrableOn (fun t : ℝ => t ^ (s.re - 1) * β€–f tβ€–) T := by
have : AEStronglyMeasurable (fun t : ℝ => (t : β„‚) ^ (s - 1) β€’ f t) (volume.restrict T) := by refine ((ContinuousAt.continuousOn ?_).aestronglyMeasurable hT').smul (hfc.mono_set hT) exact fun t ht => continuousAt_ofReal_cpow_const _ _ (Or.inr <| ne_of_gt (hT ht)) rw [IntegrableOn, ← integrable_norm_iff this, ← IntegrableOn] refine integrableOn_congr_fun (fun t ht => ?_) hT' simp_rw [norm_smul, Complex.norm_eq_abs, abs_cpow_eq_rpow_re_of_pos (hT ht), sub_re, one_re]
6
403.428793
2
1.333333
12
1,415
import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals import Mathlib.Analysis.Calculus.ParametricIntegral import Mathlib.MeasureTheory.Measure.Haar.NormedSpace #align_import analysis.mellin_transform from "leanprover-community/mathlib"@"917c3c072e487b3cccdbfeff17e75b40e45f66cb" open MeasureTheory Set Filter Asymptotics TopologicalSpace open Real open Complex hiding exp log abs_of_nonneg open scoped Topology noncomputable section variable {E : Type*} [NormedAddCommGroup E] section MellinConvergent theorem mellin_convergent_iff_norm [NormedSpace β„‚ E] {f : ℝ β†’ E} {T : Set ℝ} (hT : T βŠ† Ioi 0) (hT' : MeasurableSet T) (hfc : AEStronglyMeasurable f <| volume.restrict <| Ioi 0) {s : β„‚} : IntegrableOn (fun t : ℝ => (t : β„‚) ^ (s - 1) β€’ f t) T ↔ IntegrableOn (fun t : ℝ => t ^ (s.re - 1) * β€–f tβ€–) T := by have : AEStronglyMeasurable (fun t : ℝ => (t : β„‚) ^ (s - 1) β€’ f t) (volume.restrict T) := by refine ((ContinuousAt.continuousOn ?_).aestronglyMeasurable hT').smul (hfc.mono_set hT) exact fun t ht => continuousAt_ofReal_cpow_const _ _ (Or.inr <| ne_of_gt (hT ht)) rw [IntegrableOn, ← integrable_norm_iff this, ← IntegrableOn] refine integrableOn_congr_fun (fun t ht => ?_) hT' simp_rw [norm_smul, Complex.norm_eq_abs, abs_cpow_eq_rpow_re_of_pos (hT ht), sub_re, one_re] #align mellin_convergent_iff_norm mellin_convergent_iff_norm
Mathlib/Analysis/MellinTransform.lean
210
231
theorem mellin_convergent_top_of_isBigO {f : ℝ β†’ ℝ} (hfc : AEStronglyMeasurable f <| volume.restrict (Ioi 0)) {a s : ℝ} (hf : f =O[atTop] (Β· ^ (-a))) (hs : s < a) : βˆƒ c : ℝ, 0 < c ∧ IntegrableOn (fun t : ℝ => t ^ (s - 1) * f t) (Ioi c) := by
obtain ⟨d, hd'⟩ := hf.isBigOWith simp_rw [IsBigOWith, eventually_atTop] at hd' obtain ⟨e, he⟩ := hd' have he' : 0 < max e 1 := zero_lt_one.trans_le (le_max_right _ _) refine ⟨max e 1, he', ?_, ?_⟩ Β· refine AEStronglyMeasurable.mul ?_ (hfc.mono_set (Ioi_subset_Ioi he'.le)) refine (ContinuousAt.continuousOn fun t ht => ?_).aestronglyMeasurable measurableSet_Ioi exact continuousAt_rpow_const _ _ (Or.inl <| (he'.trans ht).ne') Β· have : βˆ€α΅ t : ℝ βˆ‚volume.restrict (Ioi <| max e 1), β€–t ^ (s - 1) * f tβ€– ≀ t ^ (s - 1 + -a) * d := by refine (ae_restrict_mem measurableSet_Ioi).mono fun t ht => ?_ have ht' : 0 < t := he'.trans ht rw [norm_mul, rpow_add ht', ← norm_of_nonneg (rpow_nonneg ht'.le (-a)), mul_assoc, mul_comm _ d, norm_of_nonneg (rpow_nonneg ht'.le _)] gcongr exact he t ((le_max_left e 1).trans_lt ht).le refine (HasFiniteIntegral.mul_const ?_ _).mono' this exact (integrableOn_Ioi_rpow_of_lt (by linarith) he').hasFiniteIntegral
18
65,659,969.137331
2
1.333333
12
1,415
import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals import Mathlib.Analysis.Calculus.ParametricIntegral import Mathlib.MeasureTheory.Measure.Haar.NormedSpace #align_import analysis.mellin_transform from "leanprover-community/mathlib"@"917c3c072e487b3cccdbfeff17e75b40e45f66cb" open MeasureTheory Set Filter Asymptotics TopologicalSpace open Real open Complex hiding exp log abs_of_nonneg open scoped Topology noncomputable section variable {E : Type*} [NormedAddCommGroup E] section MellinConvergent theorem mellin_convergent_iff_norm [NormedSpace β„‚ E] {f : ℝ β†’ E} {T : Set ℝ} (hT : T βŠ† Ioi 0) (hT' : MeasurableSet T) (hfc : AEStronglyMeasurable f <| volume.restrict <| Ioi 0) {s : β„‚} : IntegrableOn (fun t : ℝ => (t : β„‚) ^ (s - 1) β€’ f t) T ↔ IntegrableOn (fun t : ℝ => t ^ (s.re - 1) * β€–f tβ€–) T := by have : AEStronglyMeasurable (fun t : ℝ => (t : β„‚) ^ (s - 1) β€’ f t) (volume.restrict T) := by refine ((ContinuousAt.continuousOn ?_).aestronglyMeasurable hT').smul (hfc.mono_set hT) exact fun t ht => continuousAt_ofReal_cpow_const _ _ (Or.inr <| ne_of_gt (hT ht)) rw [IntegrableOn, ← integrable_norm_iff this, ← IntegrableOn] refine integrableOn_congr_fun (fun t ht => ?_) hT' simp_rw [norm_smul, Complex.norm_eq_abs, abs_cpow_eq_rpow_re_of_pos (hT ht), sub_re, one_re] #align mellin_convergent_iff_norm mellin_convergent_iff_norm theorem mellin_convergent_top_of_isBigO {f : ℝ β†’ ℝ} (hfc : AEStronglyMeasurable f <| volume.restrict (Ioi 0)) {a s : ℝ} (hf : f =O[atTop] (Β· ^ (-a))) (hs : s < a) : βˆƒ c : ℝ, 0 < c ∧ IntegrableOn (fun t : ℝ => t ^ (s - 1) * f t) (Ioi c) := by obtain ⟨d, hd'⟩ := hf.isBigOWith simp_rw [IsBigOWith, eventually_atTop] at hd' obtain ⟨e, he⟩ := hd' have he' : 0 < max e 1 := zero_lt_one.trans_le (le_max_right _ _) refine ⟨max e 1, he', ?_, ?_⟩ Β· refine AEStronglyMeasurable.mul ?_ (hfc.mono_set (Ioi_subset_Ioi he'.le)) refine (ContinuousAt.continuousOn fun t ht => ?_).aestronglyMeasurable measurableSet_Ioi exact continuousAt_rpow_const _ _ (Or.inl <| (he'.trans ht).ne') Β· have : βˆ€α΅ t : ℝ βˆ‚volume.restrict (Ioi <| max e 1), β€–t ^ (s - 1) * f tβ€– ≀ t ^ (s - 1 + -a) * d := by refine (ae_restrict_mem measurableSet_Ioi).mono fun t ht => ?_ have ht' : 0 < t := he'.trans ht rw [norm_mul, rpow_add ht', ← norm_of_nonneg (rpow_nonneg ht'.le (-a)), mul_assoc, mul_comm _ d, norm_of_nonneg (rpow_nonneg ht'.le _)] gcongr exact he t ((le_max_left e 1).trans_lt ht).le refine (HasFiniteIntegral.mul_const ?_ _).mono' this exact (integrableOn_Ioi_rpow_of_lt (by linarith) he').hasFiniteIntegral set_option linter.uppercaseLean3 false in #align mellin_convergent_top_of_is_O mellin_convergent_top_of_isBigO
Mathlib/Analysis/MellinTransform.lean
237
264
theorem mellin_convergent_zero_of_isBigO {b : ℝ} {f : ℝ β†’ ℝ} (hfc : AEStronglyMeasurable f <| volume.restrict (Ioi 0)) (hf : f =O[𝓝[>] 0] (Β· ^ (-b))) {s : ℝ} (hs : b < s) : βˆƒ c : ℝ, 0 < c ∧ IntegrableOn (fun t : ℝ => t ^ (s - 1) * f t) (Ioc 0 c) := by
obtain ⟨d, _, hd'⟩ := hf.exists_pos simp_rw [IsBigOWith, eventually_nhdsWithin_iff, Metric.eventually_nhds_iff, gt_iff_lt] at hd' obtain ⟨Ρ, hΞ΅, hΞ΅'⟩ := hd' refine ⟨Ρ, hΞ΅, integrableOn_Ioc_iff_integrableOn_Ioo.mpr ⟨?_, ?_⟩⟩ Β· refine AEStronglyMeasurable.mul ?_ (hfc.mono_set Ioo_subset_Ioi_self) refine (ContinuousAt.continuousOn fun t ht => ?_).aestronglyMeasurable measurableSet_Ioo exact continuousAt_rpow_const _ _ (Or.inl ht.1.ne') Β· apply HasFiniteIntegral.mono' Β· show HasFiniteIntegral (fun t => d * t ^ (s - b - 1)) _ refine (Integrable.hasFiniteIntegral ?_).const_mul _ rw [← IntegrableOn, ← integrableOn_Ioc_iff_integrableOn_Ioo, ← intervalIntegrable_iff_integrableOn_Ioc_of_le hΞ΅.le] exact intervalIntegral.intervalIntegrable_rpow' (by linarith) Β· refine (ae_restrict_iff' measurableSet_Ioo).mpr (eventually_of_forall fun t ht => ?_) rw [mul_comm, norm_mul] specialize hΞ΅' _ ht.1 Β· rw [dist_eq_norm, sub_zero, norm_of_nonneg (le_of_lt ht.1)] exact ht.2 Β· calc _ ≀ d * β€–t ^ (-b)β€– * β€–t ^ (s - 1)β€– := by gcongr _ = d * t ^ (s - b - 1) := ?_ simp_rw [norm_of_nonneg (rpow_nonneg (le_of_lt ht.1) _), mul_assoc] rw [← rpow_add ht.1] congr 2 abel
24
26,489,122,129.84347
2
1.333333
12
1,415
import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals import Mathlib.Analysis.Calculus.ParametricIntegral import Mathlib.MeasureTheory.Measure.Haar.NormedSpace #align_import analysis.mellin_transform from "leanprover-community/mathlib"@"917c3c072e487b3cccdbfeff17e75b40e45f66cb" open MeasureTheory Set Filter Asymptotics TopologicalSpace open Real open Complex hiding exp log abs_of_nonneg open scoped Topology noncomputable section variable {E : Type*} [NormedAddCommGroup E] section MellinDiff
Mathlib/Analysis/MellinTransform.lean
304
312
theorem isBigO_rpow_top_log_smul [NormedSpace ℝ E] {a b : ℝ} {f : ℝ β†’ E} (hab : b < a) (hf : f =O[atTop] (Β· ^ (-a))) : (fun t : ℝ => log t β€’ f t) =O[atTop] (Β· ^ (-b)) := by
refine ((isLittleO_log_rpow_atTop (sub_pos.mpr hab)).isBigO.smul hf).congr' (eventually_of_forall fun t => by rfl) ((eventually_gt_atTop 0).mp (eventually_of_forall fun t ht => ?_)) simp only rw [smul_eq_mul, ← rpow_add ht, ← sub_eq_add_neg, sub_eq_add_neg a, add_sub_cancel_left]
6
403.428793
2
1.333333
12
1,415
import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals import Mathlib.Analysis.Calculus.ParametricIntegral import Mathlib.MeasureTheory.Measure.Haar.NormedSpace #align_import analysis.mellin_transform from "leanprover-community/mathlib"@"917c3c072e487b3cccdbfeff17e75b40e45f66cb" open MeasureTheory Set Filter Asymptotics TopologicalSpace open Real open Complex hiding exp log abs_of_nonneg open scoped Topology noncomputable section variable {E : Type*} [NormedAddCommGroup E] section MellinDiff theorem isBigO_rpow_top_log_smul [NormedSpace ℝ E] {a b : ℝ} {f : ℝ β†’ E} (hab : b < a) (hf : f =O[atTop] (Β· ^ (-a))) : (fun t : ℝ => log t β€’ f t) =O[atTop] (Β· ^ (-b)) := by refine ((isLittleO_log_rpow_atTop (sub_pos.mpr hab)).isBigO.smul hf).congr' (eventually_of_forall fun t => by rfl) ((eventually_gt_atTop 0).mp (eventually_of_forall fun t ht => ?_)) simp only rw [smul_eq_mul, ← rpow_add ht, ← sub_eq_add_neg, sub_eq_add_neg a, add_sub_cancel_left] set_option linter.uppercaseLean3 false in #align is_O_rpow_top_log_smul isBigO_rpow_top_log_smul
Mathlib/Analysis/MellinTransform.lean
317
332
theorem isBigO_rpow_zero_log_smul [NormedSpace ℝ E] {a b : ℝ} {f : ℝ β†’ E} (hab : a < b) (hf : f =O[𝓝[>] 0] (Β· ^ (-a))) : (fun t : ℝ => log t β€’ f t) =O[𝓝[>] 0] (Β· ^ (-b)) := by
have : log =o[𝓝[>] 0] fun t : ℝ => t ^ (a - b) := by refine ((isLittleO_log_rpow_atTop (sub_pos.mpr hab)).neg_left.comp_tendsto tendsto_inv_zero_atTop).congr' (eventually_nhdsWithin_iff.mpr <| eventually_of_forall fun t ht => ?_) (eventually_nhdsWithin_iff.mpr <| eventually_of_forall fun t ht => ?_) Β· simp_rw [Function.comp_apply, ← one_div, log_div one_ne_zero (ne_of_gt ht), Real.log_one, zero_sub, neg_neg] Β· simp_rw [Function.comp_apply, inv_rpow (le_of_lt ht), ← rpow_neg (le_of_lt ht), neg_sub] refine (this.isBigO.smul hf).congr' (eventually_of_forall fun t => by rfl) (eventually_nhdsWithin_iff.mpr (eventually_of_forall fun t ht => ?_)) simp_rw [smul_eq_mul, ← rpow_add ht] congr 1 abel
13
442,413.392009
2
1.333333
12
1,415
import Mathlib.NumberTheory.Liouville.Basic #align_import number_theory.liouville.liouville_number from "leanprover-community/mathlib"@"04e80bb7e8510958cd9aacd32fe2dc147af0b9f1" noncomputable section open scoped Nat open Real Finset def liouvilleNumber (m : ℝ) : ℝ := βˆ‘' i : β„•, 1 / m ^ i ! #align liouville_number liouvilleNumber namespace LiouvilleNumber def partialSum (m : ℝ) (k : β„•) : ℝ := βˆ‘ i ∈ range (k + 1), 1 / m ^ i ! #align liouville_number.partial_sum LiouvilleNumber.partialSum def remainder (m : ℝ) (k : β„•) : ℝ := βˆ‘' i, 1 / m ^ (i + (k + 1))! #align liouville_number.remainder LiouvilleNumber.remainder protected theorem summable {m : ℝ} (hm : 1 < m) : Summable fun i : β„• => 1 / m ^ i ! := summable_one_div_pow_of_le hm Nat.self_le_factorial #align liouville_number.summable LiouvilleNumber.summable
Mathlib/NumberTheory/Liouville/LiouvilleNumber.lean
84
86
theorem remainder_summable {m : ℝ} (hm : 1 < m) (k : β„•) : Summable fun i : β„• => 1 / m ^ (i + (k + 1))! := by
convert (summable_nat_add_iff (k + 1)).2 (LiouvilleNumber.summable hm)
1
2.718282
0
1.333333
3
1,416