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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.