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.Analysis.Convex.Hull
#align_import analysis.convex.extreme from "leanprover-community/mathlib"@"c5773405394e073885e2a144c9ca14637e8eb963"
open Function Set
open scoped Classical
open Affine
variable {π E F ΞΉ : Type*} {Ο : ΞΉ β Type*}
section SMul
variable (π) [OrderedSemiring π] [AddCommMonoid E] [SMul π E]
def IsExtreme (A B : Set E) : Prop :=
B β A β§ β β¦xββ¦, xβ β A β β β¦xββ¦, xβ β A β β β¦xβ¦, x β B β x β openSegment π xβ xβ β xβ β B β§ xβ β B
#align is_extreme IsExtreme
def Set.extremePoints (A : Set E) : Set E :=
{ x β A | β β¦xββ¦, xβ β A β β β¦xββ¦, xβ β A β x β openSegment π xβ xβ β xβ = x β§ xβ = x }
#align set.extreme_points Set.extremePoints
@[refl]
protected theorem IsExtreme.refl (A : Set E) : IsExtreme π A A :=
β¨Subset.rfl, fun _ hxβA _ hxβA _ _ _ β¦ β¨hxβA, hxβAβ©β©
#align is_extreme.refl IsExtreme.refl
variable {π} {A B C : Set E} {x : E}
protected theorem IsExtreme.rfl : IsExtreme π A A :=
IsExtreme.refl π A
#align is_extreme.rfl IsExtreme.rfl
@[trans]
protected theorem IsExtreme.trans (hAB : IsExtreme π A B) (hBC : IsExtreme π B C) :
IsExtreme π A C := by
refine β¨Subset.trans hBC.1 hAB.1, fun xβ hxβA xβ hxβA x hxC hx β¦ ?_β©
obtain β¨hxβB, hxβBβ© := hAB.2 hxβA hxβA (hBC.1 hxC) hx
exact hBC.2 hxβB hxβB hxC hx
#align is_extreme.trans IsExtreme.trans
protected theorem IsExtreme.antisymm : AntiSymmetric (IsExtreme π : Set E β Set E β Prop) :=
fun _ _ hAB hBA β¦ Subset.antisymm hBA.1 hAB.1
#align is_extreme.antisymm IsExtreme.antisymm
instance : IsPartialOrder (Set E) (IsExtreme π) where
refl := IsExtreme.refl π
trans _ _ _ := IsExtreme.trans
antisymm := IsExtreme.antisymm
theorem IsExtreme.inter (hAB : IsExtreme π A B) (hAC : IsExtreme π A C) :
IsExtreme π A (B β© C) := by
use Subset.trans inter_subset_left hAB.1
rintro xβ hxβA xβ hxβA x β¨hxB, hxCβ© hx
obtain β¨hxβB, hxβBβ© := hAB.2 hxβA hxβA hxB hx
obtain β¨hxβC, hxβCβ© := hAC.2 hxβA hxβA hxC hx
exact β¨β¨hxβB, hxβCβ©, hxβB, hxβCβ©
#align is_extreme.inter IsExtreme.inter
protected theorem IsExtreme.mono (hAC : IsExtreme π A C) (hBA : B β A) (hCB : C β B) :
IsExtreme π B C :=
β¨hCB, fun _ hxβB _ hxβB _ hxC hx β¦ hAC.2 (hBA hxβB) (hBA hxβB) hxC hxβ©
#align is_extreme.mono IsExtreme.mono
| Mathlib/Analysis/Convex/Extreme.lean | 111 | 117 | theorem isExtreme_iInter {ΞΉ : Sort*} [Nonempty ΞΉ] {F : ΞΉ β Set E}
(hAF : β i : ΞΉ, IsExtreme π A (F i)) : IsExtreme π A (β i : ΞΉ, F i) := by |
obtain i := Classical.arbitrary ΞΉ
refine β¨iInter_subset_of_subset i (hAF i).1, fun xβ hxβA xβ hxβA x hxF hx β¦ ?_β©
simp_rw [mem_iInter] at hxF β’
have h := fun i β¦ (hAF i).2 hxβA hxβA (hxF i) hx
exact β¨fun i β¦ (h i).1, fun i β¦ (h i).2β©
| 5 | 148.413159 | 2 | 1.25 | 4 | 1,326 |
import Mathlib.Analysis.Convex.Hull
#align_import analysis.convex.extreme from "leanprover-community/mathlib"@"c5773405394e073885e2a144c9ca14637e8eb963"
open Function Set
open scoped Classical
open Affine
variable {π E F ΞΉ : Type*} {Ο : ΞΉ β Type*}
section SMul
variable (π) [OrderedSemiring π] [AddCommMonoid E] [SMul π E]
def IsExtreme (A B : Set E) : Prop :=
B β A β§ β β¦xββ¦, xβ β A β β β¦xββ¦, xβ β A β β β¦xβ¦, x β B β x β openSegment π xβ xβ β xβ β B β§ xβ β B
#align is_extreme IsExtreme
def Set.extremePoints (A : Set E) : Set E :=
{ x β A | β β¦xββ¦, xβ β A β β β¦xββ¦, xβ β A β x β openSegment π xβ xβ β xβ = x β§ xβ = x }
#align set.extreme_points Set.extremePoints
@[refl]
protected theorem IsExtreme.refl (A : Set E) : IsExtreme π A A :=
β¨Subset.rfl, fun _ hxβA _ hxβA _ _ _ β¦ β¨hxβA, hxβAβ©β©
#align is_extreme.refl IsExtreme.refl
variable {π} {A B C : Set E} {x : E}
protected theorem IsExtreme.rfl : IsExtreme π A A :=
IsExtreme.refl π A
#align is_extreme.rfl IsExtreme.rfl
@[trans]
protected theorem IsExtreme.trans (hAB : IsExtreme π A B) (hBC : IsExtreme π B C) :
IsExtreme π A C := by
refine β¨Subset.trans hBC.1 hAB.1, fun xβ hxβA xβ hxβA x hxC hx β¦ ?_β©
obtain β¨hxβB, hxβBβ© := hAB.2 hxβA hxβA (hBC.1 hxC) hx
exact hBC.2 hxβB hxβB hxC hx
#align is_extreme.trans IsExtreme.trans
protected theorem IsExtreme.antisymm : AntiSymmetric (IsExtreme π : Set E β Set E β Prop) :=
fun _ _ hAB hBA β¦ Subset.antisymm hBA.1 hAB.1
#align is_extreme.antisymm IsExtreme.antisymm
instance : IsPartialOrder (Set E) (IsExtreme π) where
refl := IsExtreme.refl π
trans _ _ _ := IsExtreme.trans
antisymm := IsExtreme.antisymm
theorem IsExtreme.inter (hAB : IsExtreme π A B) (hAC : IsExtreme π A C) :
IsExtreme π A (B β© C) := by
use Subset.trans inter_subset_left hAB.1
rintro xβ hxβA xβ hxβA x β¨hxB, hxCβ© hx
obtain β¨hxβB, hxβBβ© := hAB.2 hxβA hxβA hxB hx
obtain β¨hxβC, hxβCβ© := hAC.2 hxβA hxβA hxC hx
exact β¨β¨hxβB, hxβCβ©, hxβB, hxβCβ©
#align is_extreme.inter IsExtreme.inter
protected theorem IsExtreme.mono (hAC : IsExtreme π A C) (hBA : B β A) (hCB : C β B) :
IsExtreme π B C :=
β¨hCB, fun _ hxβB _ hxβB _ hxC hx β¦ hAC.2 (hBA hxβB) (hBA hxβB) hxC hxβ©
#align is_extreme.mono IsExtreme.mono
theorem isExtreme_iInter {ΞΉ : Sort*} [Nonempty ΞΉ] {F : ΞΉ β Set E}
(hAF : β i : ΞΉ, IsExtreme π A (F i)) : IsExtreme π A (β i : ΞΉ, F i) := by
obtain i := Classical.arbitrary ΞΉ
refine β¨iInter_subset_of_subset i (hAF i).1, fun xβ hxβA xβ hxβA x hxF hx β¦ ?_β©
simp_rw [mem_iInter] at hxF β’
have h := fun i β¦ (hAF i).2 hxβA hxβA (hxF i) hx
exact β¨fun i β¦ (h i).1, fun i β¦ (h i).2β©
#align is_extreme_Inter isExtreme_iInter
| Mathlib/Analysis/Convex/Extreme.lean | 120 | 123 | theorem isExtreme_biInter {F : Set (Set E)} (hF : F.Nonempty) (hA : β B β F, IsExtreme π A B) :
IsExtreme π A (β B β F, B) := by |
haveI := hF.to_subtype
simpa only [iInter_subtype] using isExtreme_iInter fun i : F β¦ hA _ i.2
| 2 | 7.389056 | 1 | 1.25 | 4 | 1,326 |
import Mathlib.Analysis.Convex.Hull
#align_import analysis.convex.extreme from "leanprover-community/mathlib"@"c5773405394e073885e2a144c9ca14637e8eb963"
open Function Set
open scoped Classical
open Affine
variable {π E F ΞΉ : Type*} {Ο : ΞΉ β Type*}
section SMul
variable (π) [OrderedSemiring π] [AddCommMonoid E] [SMul π E]
def IsExtreme (A B : Set E) : Prop :=
B β A β§ β β¦xββ¦, xβ β A β β β¦xββ¦, xβ β A β β β¦xβ¦, x β B β x β openSegment π xβ xβ β xβ β B β§ xβ β B
#align is_extreme IsExtreme
def Set.extremePoints (A : Set E) : Set E :=
{ x β A | β β¦xββ¦, xβ β A β β β¦xββ¦, xβ β A β x β openSegment π xβ xβ β xβ = x β§ xβ = x }
#align set.extreme_points Set.extremePoints
@[refl]
protected theorem IsExtreme.refl (A : Set E) : IsExtreme π A A :=
β¨Subset.rfl, fun _ hxβA _ hxβA _ _ _ β¦ β¨hxβA, hxβAβ©β©
#align is_extreme.refl IsExtreme.refl
variable {π} {A B C : Set E} {x : E}
protected theorem IsExtreme.rfl : IsExtreme π A A :=
IsExtreme.refl π A
#align is_extreme.rfl IsExtreme.rfl
@[trans]
protected theorem IsExtreme.trans (hAB : IsExtreme π A B) (hBC : IsExtreme π B C) :
IsExtreme π A C := by
refine β¨Subset.trans hBC.1 hAB.1, fun xβ hxβA xβ hxβA x hxC hx β¦ ?_β©
obtain β¨hxβB, hxβBβ© := hAB.2 hxβA hxβA (hBC.1 hxC) hx
exact hBC.2 hxβB hxβB hxC hx
#align is_extreme.trans IsExtreme.trans
protected theorem IsExtreme.antisymm : AntiSymmetric (IsExtreme π : Set E β Set E β Prop) :=
fun _ _ hAB hBA β¦ Subset.antisymm hBA.1 hAB.1
#align is_extreme.antisymm IsExtreme.antisymm
instance : IsPartialOrder (Set E) (IsExtreme π) where
refl := IsExtreme.refl π
trans _ _ _ := IsExtreme.trans
antisymm := IsExtreme.antisymm
theorem IsExtreme.inter (hAB : IsExtreme π A B) (hAC : IsExtreme π A C) :
IsExtreme π A (B β© C) := by
use Subset.trans inter_subset_left hAB.1
rintro xβ hxβA xβ hxβA x β¨hxB, hxCβ© hx
obtain β¨hxβB, hxβBβ© := hAB.2 hxβA hxβA hxB hx
obtain β¨hxβC, hxβCβ© := hAC.2 hxβA hxβA hxC hx
exact β¨β¨hxβB, hxβCβ©, hxβB, hxβCβ©
#align is_extreme.inter IsExtreme.inter
protected theorem IsExtreme.mono (hAC : IsExtreme π A C) (hBA : B β A) (hCB : C β B) :
IsExtreme π B C :=
β¨hCB, fun _ hxβB _ hxβB _ hxC hx β¦ hAC.2 (hBA hxβB) (hBA hxβB) hxC hxβ©
#align is_extreme.mono IsExtreme.mono
theorem isExtreme_iInter {ΞΉ : Sort*} [Nonempty ΞΉ] {F : ΞΉ β Set E}
(hAF : β i : ΞΉ, IsExtreme π A (F i)) : IsExtreme π A (β i : ΞΉ, F i) := by
obtain i := Classical.arbitrary ΞΉ
refine β¨iInter_subset_of_subset i (hAF i).1, fun xβ hxβA xβ hxβA x hxF hx β¦ ?_β©
simp_rw [mem_iInter] at hxF β’
have h := fun i β¦ (hAF i).2 hxβA hxβA (hxF i) hx
exact β¨fun i β¦ (h i).1, fun i β¦ (h i).2β©
#align is_extreme_Inter isExtreme_iInter
theorem isExtreme_biInter {F : Set (Set E)} (hF : F.Nonempty) (hA : β B β F, IsExtreme π A B) :
IsExtreme π A (β B β F, B) := by
haveI := hF.to_subtype
simpa only [iInter_subtype] using isExtreme_iInter fun i : F β¦ hA _ i.2
#align is_extreme_bInter isExtreme_biInter
| Mathlib/Analysis/Convex/Extreme.lean | 126 | 127 | theorem isExtreme_sInter {F : Set (Set E)} (hF : F.Nonempty) (hAF : β B β F, IsExtreme π A B) :
IsExtreme π A (ββ F) := by | simpa [sInter_eq_biInter] using isExtreme_biInter hF hAF
| 1 | 2.718282 | 0 | 1.25 | 4 | 1,326 |
import Mathlib.Algebra.Group.Basic
import Mathlib.Algebra.Group.Nat
import Mathlib.Init.Data.Nat.Lemmas
#align_import data.nat.psub from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
namespace Nat
def ppred : β β Option β
| 0 => none
| n + 1 => some n
#align nat.ppred Nat.ppred
@[simp]
theorem ppred_zero : ppred 0 = none := rfl
@[simp]
theorem ppred_succ {n : β} : ppred (succ n) = some n := rfl
def psub (m : β) : β β Option β
| 0 => some m
| n + 1 => psub m n >>= ppred
#align nat.psub Nat.psub
@[simp]
theorem psub_zero {m : β} : psub m 0 = some m := rfl
@[simp]
theorem psub_succ {m n : β} : psub m (succ n) = psub m n >>= ppred := rfl
| Mathlib/Data/Nat/PSub.lean | 54 | 54 | theorem pred_eq_ppred (n : β) : pred n = (ppred n).getD 0 := by | cases n <;> rfl
| 1 | 2.718282 | 0 | 1.25 | 4 | 1,327 |
import Mathlib.Algebra.Group.Basic
import Mathlib.Algebra.Group.Nat
import Mathlib.Init.Data.Nat.Lemmas
#align_import data.nat.psub from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
namespace Nat
def ppred : β β Option β
| 0 => none
| n + 1 => some n
#align nat.ppred Nat.ppred
@[simp]
theorem ppred_zero : ppred 0 = none := rfl
@[simp]
theorem ppred_succ {n : β} : ppred (succ n) = some n := rfl
def psub (m : β) : β β Option β
| 0 => some m
| n + 1 => psub m n >>= ppred
#align nat.psub Nat.psub
@[simp]
theorem psub_zero {m : β} : psub m 0 = some m := rfl
@[simp]
theorem psub_succ {m n : β} : psub m (succ n) = psub m n >>= ppred := rfl
theorem pred_eq_ppred (n : β) : pred n = (ppred n).getD 0 := by cases n <;> rfl
#align nat.pred_eq_ppred Nat.pred_eq_ppred
theorem sub_eq_psub (m : β) : β n, m - n = (psub m n).getD 0
| 0 => rfl
| n + 1 => (pred_eq_ppred (m - n)).trans <| by rw [sub_eq_psub m n, psub]; cases psub m n <;> rfl
#align nat.sub_eq_psub Nat.sub_eq_psub
@[simp]
theorem ppred_eq_some {m : β} : β {n}, ppred n = some m β succ m = n
| 0 => by constructor <;> intro h <;> contradiction
| n + 1 => by constructor <;> intro h <;> injection h <;> subst m <;> rfl
#align nat.ppred_eq_some Nat.ppred_eq_some
-- Porting note: `contradiction` required an `intro` for the goals
-- `ppred (n + 1) = none β n + 1 = 0` and `n + 1 = 0 β ppred (n + 1) = none`
@[simp]
theorem ppred_eq_none : β {n : β}, ppred n = none β n = 0
| 0 => by simp
| n + 1 => by constructor <;> intro <;> contradiction
#align nat.ppred_eq_none Nat.ppred_eq_none
theorem psub_eq_some {m : β} : β {n k}, psub m n = some k β k + n = m
| 0, k => by simp [eq_comm]
| n + 1, k => by
apply Option.bind_eq_some.trans
simp only [psub_eq_some, ppred_eq_some]
simp [add_comm, add_left_comm, Nat.succ_eq_add_one]
#align nat.psub_eq_some Nat.psub_eq_some
| Mathlib/Data/Nat/PSub.lean | 85 | 93 | theorem psub_eq_none {m n : β} : psub m n = none β m < n := by |
cases s : psub m n <;> simp [eq_comm]
Β· show m < n
refine lt_of_not_ge fun h => ?_
cases' le.dest h with k e
injection s.symm.trans (psub_eq_some.2 <| (add_comm _ _).trans e)
Β· show n β€ m
rw [β psub_eq_some.1 s]
apply Nat.le_add_left
| 8 | 2,980.957987 | 2 | 1.25 | 4 | 1,327 |
import Mathlib.Algebra.Group.Basic
import Mathlib.Algebra.Group.Nat
import Mathlib.Init.Data.Nat.Lemmas
#align_import data.nat.psub from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
namespace Nat
def ppred : β β Option β
| 0 => none
| n + 1 => some n
#align nat.ppred Nat.ppred
@[simp]
theorem ppred_zero : ppred 0 = none := rfl
@[simp]
theorem ppred_succ {n : β} : ppred (succ n) = some n := rfl
def psub (m : β) : β β Option β
| 0 => some m
| n + 1 => psub m n >>= ppred
#align nat.psub Nat.psub
@[simp]
theorem psub_zero {m : β} : psub m 0 = some m := rfl
@[simp]
theorem psub_succ {m n : β} : psub m (succ n) = psub m n >>= ppred := rfl
theorem pred_eq_ppred (n : β) : pred n = (ppred n).getD 0 := by cases n <;> rfl
#align nat.pred_eq_ppred Nat.pred_eq_ppred
theorem sub_eq_psub (m : β) : β n, m - n = (psub m n).getD 0
| 0 => rfl
| n + 1 => (pred_eq_ppred (m - n)).trans <| by rw [sub_eq_psub m n, psub]; cases psub m n <;> rfl
#align nat.sub_eq_psub Nat.sub_eq_psub
@[simp]
theorem ppred_eq_some {m : β} : β {n}, ppred n = some m β succ m = n
| 0 => by constructor <;> intro h <;> contradiction
| n + 1 => by constructor <;> intro h <;> injection h <;> subst m <;> rfl
#align nat.ppred_eq_some Nat.ppred_eq_some
-- Porting note: `contradiction` required an `intro` for the goals
-- `ppred (n + 1) = none β n + 1 = 0` and `n + 1 = 0 β ppred (n + 1) = none`
@[simp]
theorem ppred_eq_none : β {n : β}, ppred n = none β n = 0
| 0 => by simp
| n + 1 => by constructor <;> intro <;> contradiction
#align nat.ppred_eq_none Nat.ppred_eq_none
theorem psub_eq_some {m : β} : β {n k}, psub m n = some k β k + n = m
| 0, k => by simp [eq_comm]
| n + 1, k => by
apply Option.bind_eq_some.trans
simp only [psub_eq_some, ppred_eq_some]
simp [add_comm, add_left_comm, Nat.succ_eq_add_one]
#align nat.psub_eq_some Nat.psub_eq_some
theorem psub_eq_none {m n : β} : psub m n = none β m < n := by
cases s : psub m n <;> simp [eq_comm]
Β· show m < n
refine lt_of_not_ge fun h => ?_
cases' le.dest h with k e
injection s.symm.trans (psub_eq_some.2 <| (add_comm _ _).trans e)
Β· show n β€ m
rw [β psub_eq_some.1 s]
apply Nat.le_add_left
#align nat.psub_eq_none Nat.psub_eq_none
theorem ppred_eq_pred {n} (h : 0 < n) : ppred n = some (pred n) :=
ppred_eq_some.2 <| succ_pred_eq_of_pos h
#align nat.ppred_eq_pred Nat.ppred_eq_pred
theorem psub_eq_sub {m n} (h : n β€ m) : psub m n = some (m - n) :=
psub_eq_some.2 <| Nat.sub_add_cancel h
#align nat.psub_eq_sub Nat.psub_eq_sub
-- Porting note: we only have the simp lemma `Option.bind_some` which uses `Option.bind` not `>>=`
| Mathlib/Data/Nat/PSub.lean | 105 | 109 | theorem psub_add (m n k) :
psub m (n + k) = (do psub (β psub m n) k) := by |
induction k with
| zero => simp only [zero_eq, add_zero, psub_zero, Option.bind_eq_bind, Option.bind_some]
| succ n ih => simp only [ih, add_succ, psub_succ, bind_assoc]
| 3 | 20.085537 | 1 | 1.25 | 4 | 1,327 |
import Mathlib.Algebra.Group.Basic
import Mathlib.Algebra.Group.Nat
import Mathlib.Init.Data.Nat.Lemmas
#align_import data.nat.psub from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
namespace Nat
def ppred : β β Option β
| 0 => none
| n + 1 => some n
#align nat.ppred Nat.ppred
@[simp]
theorem ppred_zero : ppred 0 = none := rfl
@[simp]
theorem ppred_succ {n : β} : ppred (succ n) = some n := rfl
def psub (m : β) : β β Option β
| 0 => some m
| n + 1 => psub m n >>= ppred
#align nat.psub Nat.psub
@[simp]
theorem psub_zero {m : β} : psub m 0 = some m := rfl
@[simp]
theorem psub_succ {m n : β} : psub m (succ n) = psub m n >>= ppred := rfl
theorem pred_eq_ppred (n : β) : pred n = (ppred n).getD 0 := by cases n <;> rfl
#align nat.pred_eq_ppred Nat.pred_eq_ppred
theorem sub_eq_psub (m : β) : β n, m - n = (psub m n).getD 0
| 0 => rfl
| n + 1 => (pred_eq_ppred (m - n)).trans <| by rw [sub_eq_psub m n, psub]; cases psub m n <;> rfl
#align nat.sub_eq_psub Nat.sub_eq_psub
@[simp]
theorem ppred_eq_some {m : β} : β {n}, ppred n = some m β succ m = n
| 0 => by constructor <;> intro h <;> contradiction
| n + 1 => by constructor <;> intro h <;> injection h <;> subst m <;> rfl
#align nat.ppred_eq_some Nat.ppred_eq_some
-- Porting note: `contradiction` required an `intro` for the goals
-- `ppred (n + 1) = none β n + 1 = 0` and `n + 1 = 0 β ppred (n + 1) = none`
@[simp]
theorem ppred_eq_none : β {n : β}, ppred n = none β n = 0
| 0 => by simp
| n + 1 => by constructor <;> intro <;> contradiction
#align nat.ppred_eq_none Nat.ppred_eq_none
theorem psub_eq_some {m : β} : β {n k}, psub m n = some k β k + n = m
| 0, k => by simp [eq_comm]
| n + 1, k => by
apply Option.bind_eq_some.trans
simp only [psub_eq_some, ppred_eq_some]
simp [add_comm, add_left_comm, Nat.succ_eq_add_one]
#align nat.psub_eq_some Nat.psub_eq_some
theorem psub_eq_none {m n : β} : psub m n = none β m < n := by
cases s : psub m n <;> simp [eq_comm]
Β· show m < n
refine lt_of_not_ge fun h => ?_
cases' le.dest h with k e
injection s.symm.trans (psub_eq_some.2 <| (add_comm _ _).trans e)
Β· show n β€ m
rw [β psub_eq_some.1 s]
apply Nat.le_add_left
#align nat.psub_eq_none Nat.psub_eq_none
theorem ppred_eq_pred {n} (h : 0 < n) : ppred n = some (pred n) :=
ppred_eq_some.2 <| succ_pred_eq_of_pos h
#align nat.ppred_eq_pred Nat.ppred_eq_pred
theorem psub_eq_sub {m n} (h : n β€ m) : psub m n = some (m - n) :=
psub_eq_some.2 <| Nat.sub_add_cancel h
#align nat.psub_eq_sub Nat.psub_eq_sub
-- Porting note: we only have the simp lemma `Option.bind_some` which uses `Option.bind` not `>>=`
theorem psub_add (m n k) :
psub m (n + k) = (do psub (β psub m n) k) := by
induction k with
| zero => simp only [zero_eq, add_zero, psub_zero, Option.bind_eq_bind, Option.bind_some]
| succ n ih => simp only [ih, add_succ, psub_succ, bind_assoc]
#align nat.psub_add Nat.psub_add
@[inline]
def psub' (m n : β) : Option β :=
if n β€ m then some (m - n) else none
#align nat.psub' Nat.psub'
| Mathlib/Data/Nat/PSub.lean | 118 | 122 | theorem psub'_eq_psub (m n) : psub' m n = psub m n := by |
rw [psub']
split_ifs with h
Β· exact (psub_eq_sub h).symm
Β· exact (psub_eq_none.2 (not_le.1 h)).symm
| 4 | 54.59815 | 2 | 1.25 | 4 | 1,327 |
import Mathlib.Analysis.Convex.Hull
import Mathlib.LinearAlgebra.AffineSpace.Independent
#align_import analysis.convex.simplicial_complex.basic from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
open Finset Set
variable (π E : Type*) {ΞΉ : Type*} [OrderedRing π] [AddCommGroup E] [Module π E]
namespace Geometry
-- TODO: update to new binder order? not sure what binder order is correct for `down_closed`.
@[ext]
structure SimplicialComplex where
faces : Set (Finset E)
not_empty_mem : β
β faces
indep : β {s}, s β faces β AffineIndependent π ((β) : s β E)
down_closed : β {s t}, s β faces β t β s β t β β
β t β faces
inter_subset_convexHull : β {s t}, s β faces β t β faces β
convexHull π βs β© convexHull π βt β convexHull π (s β© t : Set E)
#align geometry.simplicial_complex Geometry.SimplicialComplex
namespace SimplicialComplex
variable {π E}
variable {K : SimplicialComplex π E} {s t : Finset E} {x : E}
instance : Membership (Finset E) (SimplicialComplex π E) :=
β¨fun s K => s β K.facesβ©
def space (K : SimplicialComplex π E) : Set E :=
β s β K.faces, convexHull π (s : Set E)
#align geometry.simplicial_complex.space Geometry.SimplicialComplex.space
-- Porting note: Expanded `β s β K.faces` to get the type to match more closely with Lean 3
| Mathlib/Analysis/Convex/SimplicialComplex/Basic.lean | 86 | 87 | theorem mem_space_iff : x β K.space β β s β K.faces, x β convexHull π (s : Set E) := by |
simp [space]
| 1 | 2.718282 | 0 | 1.25 | 4 | 1,328 |
import Mathlib.Analysis.Convex.Hull
import Mathlib.LinearAlgebra.AffineSpace.Independent
#align_import analysis.convex.simplicial_complex.basic from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
open Finset Set
variable (π E : Type*) {ΞΉ : Type*} [OrderedRing π] [AddCommGroup E] [Module π E]
namespace Geometry
-- TODO: update to new binder order? not sure what binder order is correct for `down_closed`.
@[ext]
structure SimplicialComplex where
faces : Set (Finset E)
not_empty_mem : β
β faces
indep : β {s}, s β faces β AffineIndependent π ((β) : s β E)
down_closed : β {s t}, s β faces β t β s β t β β
β t β faces
inter_subset_convexHull : β {s t}, s β faces β t β faces β
convexHull π βs β© convexHull π βt β convexHull π (s β© t : Set E)
#align geometry.simplicial_complex Geometry.SimplicialComplex
namespace SimplicialComplex
variable {π E}
variable {K : SimplicialComplex π E} {s t : Finset E} {x : E}
instance : Membership (Finset E) (SimplicialComplex π E) :=
β¨fun s K => s β K.facesβ©
def space (K : SimplicialComplex π E) : Set E :=
β s β K.faces, convexHull π (s : Set E)
#align geometry.simplicial_complex.space Geometry.SimplicialComplex.space
-- Porting note: Expanded `β s β K.faces` to get the type to match more closely with Lean 3
theorem mem_space_iff : x β K.space β β s β K.faces, x β convexHull π (s : Set E) := by
simp [space]
#align geometry.simplicial_complex.mem_space_iff Geometry.SimplicialComplex.mem_space_iff
-- Porting note: Original proof was `:= subset_biUnion_of_mem hs`
| Mathlib/Analysis/Convex/SimplicialComplex/Basic.lean | 91 | 93 | theorem convexHull_subset_space (hs : s β K.faces) : convexHull π βs β K.space := by |
convert subset_biUnion_of_mem hs
rfl
| 2 | 7.389056 | 1 | 1.25 | 4 | 1,328 |
import Mathlib.Analysis.Convex.Hull
import Mathlib.LinearAlgebra.AffineSpace.Independent
#align_import analysis.convex.simplicial_complex.basic from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
open Finset Set
variable (π E : Type*) {ΞΉ : Type*} [OrderedRing π] [AddCommGroup E] [Module π E]
namespace Geometry
-- TODO: update to new binder order? not sure what binder order is correct for `down_closed`.
@[ext]
structure SimplicialComplex where
faces : Set (Finset E)
not_empty_mem : β
β faces
indep : β {s}, s β faces β AffineIndependent π ((β) : s β E)
down_closed : β {s t}, s β faces β t β s β t β β
β t β faces
inter_subset_convexHull : β {s t}, s β faces β t β faces β
convexHull π βs β© convexHull π βt β convexHull π (s β© t : Set E)
#align geometry.simplicial_complex Geometry.SimplicialComplex
namespace SimplicialComplex
variable {π E}
variable {K : SimplicialComplex π E} {s t : Finset E} {x : E}
instance : Membership (Finset E) (SimplicialComplex π E) :=
β¨fun s K => s β K.facesβ©
def space (K : SimplicialComplex π E) : Set E :=
β s β K.faces, convexHull π (s : Set E)
#align geometry.simplicial_complex.space Geometry.SimplicialComplex.space
-- Porting note: Expanded `β s β K.faces` to get the type to match more closely with Lean 3
theorem mem_space_iff : x β K.space β β s β K.faces, x β convexHull π (s : Set E) := by
simp [space]
#align geometry.simplicial_complex.mem_space_iff Geometry.SimplicialComplex.mem_space_iff
-- Porting note: Original proof was `:= subset_biUnion_of_mem hs`
theorem convexHull_subset_space (hs : s β K.faces) : convexHull π βs β K.space := by
convert subset_biUnion_of_mem hs
rfl
#align geometry.simplicial_complex.convex_hull_subset_space Geometry.SimplicialComplex.convexHull_subset_space
protected theorem subset_space (hs : s β K.faces) : (s : Set E) β K.space :=
(subset_convexHull π _).trans <| convexHull_subset_space hs
#align geometry.simplicial_complex.subset_space Geometry.SimplicialComplex.subset_space
theorem convexHull_inter_convexHull (hs : s β K.faces) (ht : t β K.faces) :
convexHull π βs β© convexHull π βt = convexHull π (s β© t : Set E) :=
(K.inter_subset_convexHull hs ht).antisymm <|
subset_inter (convexHull_mono Set.inter_subset_left) <|
convexHull_mono Set.inter_subset_right
#align geometry.simplicial_complex.convex_hull_inter_convex_hull Geometry.SimplicialComplex.convexHull_inter_convexHull
| Mathlib/Analysis/Convex/SimplicialComplex/Basic.lean | 110 | 119 | theorem disjoint_or_exists_inter_eq_convexHull (hs : s β K.faces) (ht : t β K.faces) :
Disjoint (convexHull π (s : Set E)) (convexHull π βt) β¨
β u β K.faces, convexHull π (s : Set E) β© convexHull π βt = convexHull π βu := by |
classical
by_contra! h
refine h.2 (s β© t) (K.down_closed hs inter_subset_left fun hst => h.1 <|
disjoint_iff_inf_le.mpr <| (K.inter_subset_convexHull hs ht).trans ?_) ?_
Β· rw [β coe_inter, hst, coe_empty, convexHull_empty]
rfl
Β· rw [coe_inter, convexHull_inter_convexHull hs ht]
| 7 | 1,096.633158 | 2 | 1.25 | 4 | 1,328 |
import Mathlib.Analysis.Convex.Hull
import Mathlib.LinearAlgebra.AffineSpace.Independent
#align_import analysis.convex.simplicial_complex.basic from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
open Finset Set
variable (π E : Type*) {ΞΉ : Type*} [OrderedRing π] [AddCommGroup E] [Module π E]
namespace Geometry
-- TODO: update to new binder order? not sure what binder order is correct for `down_closed`.
@[ext]
structure SimplicialComplex where
faces : Set (Finset E)
not_empty_mem : β
β faces
indep : β {s}, s β faces β AffineIndependent π ((β) : s β E)
down_closed : β {s t}, s β faces β t β s β t β β
β t β faces
inter_subset_convexHull : β {s t}, s β faces β t β faces β
convexHull π βs β© convexHull π βt β convexHull π (s β© t : Set E)
#align geometry.simplicial_complex Geometry.SimplicialComplex
namespace SimplicialComplex
variable {π E}
variable {K : SimplicialComplex π E} {s t : Finset E} {x : E}
instance : Membership (Finset E) (SimplicialComplex π E) :=
β¨fun s K => s β K.facesβ©
def space (K : SimplicialComplex π E) : Set E :=
β s β K.faces, convexHull π (s : Set E)
#align geometry.simplicial_complex.space Geometry.SimplicialComplex.space
-- Porting note: Expanded `β s β K.faces` to get the type to match more closely with Lean 3
theorem mem_space_iff : x β K.space β β s β K.faces, x β convexHull π (s : Set E) := by
simp [space]
#align geometry.simplicial_complex.mem_space_iff Geometry.SimplicialComplex.mem_space_iff
-- Porting note: Original proof was `:= subset_biUnion_of_mem hs`
theorem convexHull_subset_space (hs : s β K.faces) : convexHull π βs β K.space := by
convert subset_biUnion_of_mem hs
rfl
#align geometry.simplicial_complex.convex_hull_subset_space Geometry.SimplicialComplex.convexHull_subset_space
protected theorem subset_space (hs : s β K.faces) : (s : Set E) β K.space :=
(subset_convexHull π _).trans <| convexHull_subset_space hs
#align geometry.simplicial_complex.subset_space Geometry.SimplicialComplex.subset_space
theorem convexHull_inter_convexHull (hs : s β K.faces) (ht : t β K.faces) :
convexHull π βs β© convexHull π βt = convexHull π (s β© t : Set E) :=
(K.inter_subset_convexHull hs ht).antisymm <|
subset_inter (convexHull_mono Set.inter_subset_left) <|
convexHull_mono Set.inter_subset_right
#align geometry.simplicial_complex.convex_hull_inter_convex_hull Geometry.SimplicialComplex.convexHull_inter_convexHull
theorem disjoint_or_exists_inter_eq_convexHull (hs : s β K.faces) (ht : t β K.faces) :
Disjoint (convexHull π (s : Set E)) (convexHull π βt) β¨
β u β K.faces, convexHull π (s : Set E) β© convexHull π βt = convexHull π βu := by
classical
by_contra! h
refine h.2 (s β© t) (K.down_closed hs inter_subset_left fun hst => h.1 <|
disjoint_iff_inf_le.mpr <| (K.inter_subset_convexHull hs ht).trans ?_) ?_
Β· rw [β coe_inter, hst, coe_empty, convexHull_empty]
rfl
Β· rw [coe_inter, convexHull_inter_convexHull hs ht]
#align geometry.simplicial_complex.disjoint_or_exists_inter_eq_convex_hull Geometry.SimplicialComplex.disjoint_or_exists_inter_eq_convexHull
@[simps]
def ofErase (faces : Set (Finset E)) (indep : β s β faces, AffineIndependent π ((β) : s β E))
(down_closed : β s β faces, β t β s, t β faces)
(inter_subset_convexHull : βα΅ (s β faces) (t β faces),
convexHull π βs β© convexHull π βt β convexHull π (s β© t : Set E)) :
SimplicialComplex π E where
faces := faces \ {β
}
not_empty_mem h := h.2 (mem_singleton _)
indep hs := indep _ hs.1
down_closed hs hts ht := β¨down_closed _ hs.1 _ hts, htβ©
inter_subset_convexHull hs ht := inter_subset_convexHull _ hs.1 _ ht.1
#align geometry.simplicial_complex.of_erase Geometry.SimplicialComplex.ofErase
@[simps]
def ofSubcomplex (K : SimplicialComplex π E) (faces : Set (Finset E)) (subset : faces β K.faces)
(down_closed : β {s t}, s β faces β t β s β t β faces) : SimplicialComplex π E :=
{ faces
not_empty_mem := fun h => K.not_empty_mem (subset h)
indep := fun hs => K.indep (subset hs)
down_closed := fun hs hts _ => down_closed hs hts
inter_subset_convexHull := fun hs ht => K.inter_subset_convexHull (subset hs) (subset ht) }
#align geometry.simplicial_complex.of_subcomplex Geometry.SimplicialComplex.ofSubcomplex
def vertices (K : SimplicialComplex π E) : Set E :=
{ x | {x} β K.faces }
#align geometry.simplicial_complex.vertices Geometry.SimplicialComplex.vertices
theorem mem_vertices : x β K.vertices β {x} β K.faces := Iff.rfl
#align geometry.simplicial_complex.mem_vertices Geometry.SimplicialComplex.mem_vertices
| Mathlib/Analysis/Convex/SimplicialComplex/Basic.lean | 158 | 162 | theorem vertices_eq : K.vertices = β k β K.faces, (k : Set E) := by |
ext x
refine β¨fun h => mem_biUnion h <| mem_coe.2 <| mem_singleton_self x, fun h => ?_β©
obtain β¨s, hs, hxβ© := mem_iUnionβ.1 h
exact K.down_closed hs (Finset.singleton_subset_iff.2 <| mem_coe.1 hx) (singleton_ne_empty _)
| 4 | 54.59815 | 2 | 1.25 | 4 | 1,328 |
import Mathlib.Algebra.Group.Subgroup.Pointwise
import Mathlib.Data.ZMod.Basic
import Mathlib.GroupTheory.GroupAction.ConjAct
import Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup
#align_import number_theory.modular_forms.congruence_subgroups from "leanprover-community/mathlib"@"ae690b0c236e488a0043f6faa8ce3546e7f2f9c5"
local notation "SL(" n ", " R ")" => Matrix.SpecialLinearGroup (Fin n) R
attribute [-instance] Matrix.SpecialLinearGroup.instCoeFun
local notation:1024 "ββ" A:1024 => ((A : SL(2, β€)) : Matrix (Fin 2) (Fin 2) β€)
open Matrix.SpecialLinearGroup Matrix
variable (N : β)
local notation "SLMOD(" N ")" =>
@Matrix.SpecialLinearGroup.map (Fin 2) _ _ _ _ _ _ (Int.castRingHom (ZMod N))
set_option linter.uppercaseLean3 false
@[simp]
theorem SL_reduction_mod_hom_val (N : β) (Ξ³ : SL(2, β€)) :
β i j : Fin 2, (SLMOD(N) Ξ³ : Matrix (Fin 2) (Fin 2) (ZMod N)) i j = ((ββΞ³ i j : β€) : ZMod N) :=
fun _ _ => rfl
#align SL_reduction_mod_hom_val SL_reduction_mod_hom_val
def Gamma (N : β) : Subgroup SL(2, β€) :=
SLMOD(N).ker
#align Gamma Gamma
theorem Gamma_mem' (N : β) (Ξ³ : SL(2, β€)) : Ξ³ β Gamma N β SLMOD(N) Ξ³ = 1 :=
Iff.rfl
#align Gamma_mem' Gamma_mem'
@[simp]
| Mathlib/NumberTheory/ModularForms/CongruenceSubgroups.lean | 56 | 66 | theorem Gamma_mem (N : β) (Ξ³ : SL(2, β€)) : Ξ³ β Gamma N β ((ββΞ³ 0 0 : β€) : ZMod N) = 1 β§
((ββΞ³ 0 1 : β€) : ZMod N) = 0 β§ ((ββΞ³ 1 0 : β€) : ZMod N) = 0 β§ ((ββΞ³ 1 1 : β€) : ZMod N) = 1 := by |
rw [Gamma_mem']
constructor
Β· intro h
simp [β SL_reduction_mod_hom_val N Ξ³, h]
Β· intro h
ext i j
rw [SL_reduction_mod_hom_val N Ξ³]
fin_cases i <;> fin_cases j <;> simp only [h]
exacts [h.1, h.2.1, h.2.2.1, h.2.2.2]
| 9 | 8,103.083928 | 2 | 1.25 | 4 | 1,329 |
import Mathlib.Algebra.Group.Subgroup.Pointwise
import Mathlib.Data.ZMod.Basic
import Mathlib.GroupTheory.GroupAction.ConjAct
import Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup
#align_import number_theory.modular_forms.congruence_subgroups from "leanprover-community/mathlib"@"ae690b0c236e488a0043f6faa8ce3546e7f2f9c5"
local notation "SL(" n ", " R ")" => Matrix.SpecialLinearGroup (Fin n) R
attribute [-instance] Matrix.SpecialLinearGroup.instCoeFun
local notation:1024 "ββ" A:1024 => ((A : SL(2, β€)) : Matrix (Fin 2) (Fin 2) β€)
open Matrix.SpecialLinearGroup Matrix
variable (N : β)
local notation "SLMOD(" N ")" =>
@Matrix.SpecialLinearGroup.map (Fin 2) _ _ _ _ _ _ (Int.castRingHom (ZMod N))
set_option linter.uppercaseLean3 false
@[simp]
theorem SL_reduction_mod_hom_val (N : β) (Ξ³ : SL(2, β€)) :
β i j : Fin 2, (SLMOD(N) Ξ³ : Matrix (Fin 2) (Fin 2) (ZMod N)) i j = ((ββΞ³ i j : β€) : ZMod N) :=
fun _ _ => rfl
#align SL_reduction_mod_hom_val SL_reduction_mod_hom_val
def Gamma (N : β) : Subgroup SL(2, β€) :=
SLMOD(N).ker
#align Gamma Gamma
theorem Gamma_mem' (N : β) (Ξ³ : SL(2, β€)) : Ξ³ β Gamma N β SLMOD(N) Ξ³ = 1 :=
Iff.rfl
#align Gamma_mem' Gamma_mem'
@[simp]
theorem Gamma_mem (N : β) (Ξ³ : SL(2, β€)) : Ξ³ β Gamma N β ((ββΞ³ 0 0 : β€) : ZMod N) = 1 β§
((ββΞ³ 0 1 : β€) : ZMod N) = 0 β§ ((ββΞ³ 1 0 : β€) : ZMod N) = 0 β§ ((ββΞ³ 1 1 : β€) : ZMod N) = 1 := by
rw [Gamma_mem']
constructor
Β· intro h
simp [β SL_reduction_mod_hom_val N Ξ³, h]
Β· intro h
ext i j
rw [SL_reduction_mod_hom_val N Ξ³]
fin_cases i <;> fin_cases j <;> simp only [h]
exacts [h.1, h.2.1, h.2.2.1, h.2.2.2]
#align Gamma_mem Gamma_mem
theorem Gamma_normal (N : β) : Subgroup.Normal (Gamma N) :=
SLMOD(N).normal_ker
#align Gamma_normal Gamma_normal
| Mathlib/NumberTheory/ModularForms/CongruenceSubgroups.lean | 73 | 75 | theorem Gamma_one_top : Gamma 1 = β€ := by |
ext
simp [eq_iff_true_of_subsingleton]
| 2 | 7.389056 | 1 | 1.25 | 4 | 1,329 |
import Mathlib.Algebra.Group.Subgroup.Pointwise
import Mathlib.Data.ZMod.Basic
import Mathlib.GroupTheory.GroupAction.ConjAct
import Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup
#align_import number_theory.modular_forms.congruence_subgroups from "leanprover-community/mathlib"@"ae690b0c236e488a0043f6faa8ce3546e7f2f9c5"
local notation "SL(" n ", " R ")" => Matrix.SpecialLinearGroup (Fin n) R
attribute [-instance] Matrix.SpecialLinearGroup.instCoeFun
local notation:1024 "ββ" A:1024 => ((A : SL(2, β€)) : Matrix (Fin 2) (Fin 2) β€)
open Matrix.SpecialLinearGroup Matrix
variable (N : β)
local notation "SLMOD(" N ")" =>
@Matrix.SpecialLinearGroup.map (Fin 2) _ _ _ _ _ _ (Int.castRingHom (ZMod N))
set_option linter.uppercaseLean3 false
@[simp]
theorem SL_reduction_mod_hom_val (N : β) (Ξ³ : SL(2, β€)) :
β i j : Fin 2, (SLMOD(N) Ξ³ : Matrix (Fin 2) (Fin 2) (ZMod N)) i j = ((ββΞ³ i j : β€) : ZMod N) :=
fun _ _ => rfl
#align SL_reduction_mod_hom_val SL_reduction_mod_hom_val
def Gamma (N : β) : Subgroup SL(2, β€) :=
SLMOD(N).ker
#align Gamma Gamma
theorem Gamma_mem' (N : β) (Ξ³ : SL(2, β€)) : Ξ³ β Gamma N β SLMOD(N) Ξ³ = 1 :=
Iff.rfl
#align Gamma_mem' Gamma_mem'
@[simp]
theorem Gamma_mem (N : β) (Ξ³ : SL(2, β€)) : Ξ³ β Gamma N β ((ββΞ³ 0 0 : β€) : ZMod N) = 1 β§
((ββΞ³ 0 1 : β€) : ZMod N) = 0 β§ ((ββΞ³ 1 0 : β€) : ZMod N) = 0 β§ ((ββΞ³ 1 1 : β€) : ZMod N) = 1 := by
rw [Gamma_mem']
constructor
Β· intro h
simp [β SL_reduction_mod_hom_val N Ξ³, h]
Β· intro h
ext i j
rw [SL_reduction_mod_hom_val N Ξ³]
fin_cases i <;> fin_cases j <;> simp only [h]
exacts [h.1, h.2.1, h.2.2.1, h.2.2.2]
#align Gamma_mem Gamma_mem
theorem Gamma_normal (N : β) : Subgroup.Normal (Gamma N) :=
SLMOD(N).normal_ker
#align Gamma_normal Gamma_normal
theorem Gamma_one_top : Gamma 1 = β€ := by
ext
simp [eq_iff_true_of_subsingleton]
#align Gamma_one_top Gamma_one_top
| Mathlib/NumberTheory/ModularForms/CongruenceSubgroups.lean | 78 | 88 | theorem Gamma_zero_bot : Gamma 0 = β₯ := by |
ext
simp only [Gamma_mem, coe_matrix_coe, Int.coe_castRingHom, map_apply, Int.cast_id,
Subgroup.mem_bot]
constructor
Β· intro h
ext i j
fin_cases i <;> fin_cases j <;> simp only [h]
exacts [h.1, h.2.1, h.2.2.1, h.2.2.2]
Β· intro h
simp [h]
| 10 | 22,026.465795 | 2 | 1.25 | 4 | 1,329 |
import Mathlib.Algebra.Group.Subgroup.Pointwise
import Mathlib.Data.ZMod.Basic
import Mathlib.GroupTheory.GroupAction.ConjAct
import Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup
#align_import number_theory.modular_forms.congruence_subgroups from "leanprover-community/mathlib"@"ae690b0c236e488a0043f6faa8ce3546e7f2f9c5"
local notation "SL(" n ", " R ")" => Matrix.SpecialLinearGroup (Fin n) R
attribute [-instance] Matrix.SpecialLinearGroup.instCoeFun
local notation:1024 "ββ" A:1024 => ((A : SL(2, β€)) : Matrix (Fin 2) (Fin 2) β€)
open Matrix.SpecialLinearGroup Matrix
variable (N : β)
local notation "SLMOD(" N ")" =>
@Matrix.SpecialLinearGroup.map (Fin 2) _ _ _ _ _ _ (Int.castRingHom (ZMod N))
set_option linter.uppercaseLean3 false
@[simp]
theorem SL_reduction_mod_hom_val (N : β) (Ξ³ : SL(2, β€)) :
β i j : Fin 2, (SLMOD(N) Ξ³ : Matrix (Fin 2) (Fin 2) (ZMod N)) i j = ((ββΞ³ i j : β€) : ZMod N) :=
fun _ _ => rfl
#align SL_reduction_mod_hom_val SL_reduction_mod_hom_val
def Gamma (N : β) : Subgroup SL(2, β€) :=
SLMOD(N).ker
#align Gamma Gamma
theorem Gamma_mem' (N : β) (Ξ³ : SL(2, β€)) : Ξ³ β Gamma N β SLMOD(N) Ξ³ = 1 :=
Iff.rfl
#align Gamma_mem' Gamma_mem'
@[simp]
theorem Gamma_mem (N : β) (Ξ³ : SL(2, β€)) : Ξ³ β Gamma N β ((ββΞ³ 0 0 : β€) : ZMod N) = 1 β§
((ββΞ³ 0 1 : β€) : ZMod N) = 0 β§ ((ββΞ³ 1 0 : β€) : ZMod N) = 0 β§ ((ββΞ³ 1 1 : β€) : ZMod N) = 1 := by
rw [Gamma_mem']
constructor
Β· intro h
simp [β SL_reduction_mod_hom_val N Ξ³, h]
Β· intro h
ext i j
rw [SL_reduction_mod_hom_val N Ξ³]
fin_cases i <;> fin_cases j <;> simp only [h]
exacts [h.1, h.2.1, h.2.2.1, h.2.2.2]
#align Gamma_mem Gamma_mem
theorem Gamma_normal (N : β) : Subgroup.Normal (Gamma N) :=
SLMOD(N).normal_ker
#align Gamma_normal Gamma_normal
theorem Gamma_one_top : Gamma 1 = β€ := by
ext
simp [eq_iff_true_of_subsingleton]
#align Gamma_one_top Gamma_one_top
theorem Gamma_zero_bot : Gamma 0 = β₯ := by
ext
simp only [Gamma_mem, coe_matrix_coe, Int.coe_castRingHom, map_apply, Int.cast_id,
Subgroup.mem_bot]
constructor
Β· intro h
ext i j
fin_cases i <;> fin_cases j <;> simp only [h]
exacts [h.1, h.2.1, h.2.2.1, h.2.2.2]
Β· intro h
simp [h]
#align Gamma_zero_bot Gamma_zero_bot
lemma ModularGroup_T_pow_mem_Gamma (N M : β€) (hNM : N β£ M) :
(ModularGroup.T ^ M) β _root_.Gamma (Int.natAbs N) := by
simp only [Gamma_mem, Fin.isValue, ModularGroup.coe_T_zpow, of_apply, cons_val', cons_val_zero,
empty_val', cons_val_fin_one, Int.cast_one, cons_val_one, head_cons, head_fin_const,
Int.cast_zero, and_self, and_true, true_and]
refine Iff.mpr (ZMod.intCast_zmod_eq_zero_iff_dvd M (Int.natAbs N)) ?_
simp only [Int.natCast_natAbs, abs_dvd, hNM]
def Gamma0 (N : β) : Subgroup SL(2, β€) where
carrier := { g : SL(2, β€) | ((ββg 1 0 : β€) : ZMod N) = 0 }
one_mem' := by simp
mul_mem' := by
intro a b ha hb
simp only [Set.mem_setOf_eq]
have h := (Matrix.two_mul_expl a.1 b.1).2.2.1
simp only [coe_matrix_coe, coe_mul, Int.coe_castRingHom, map_apply, Set.mem_setOf_eq] at *
rw [h]
simp [ha, hb]
inv_mem' := by
intro a ha
simp only [Set.mem_setOf_eq]
rw [SL2_inv_expl a]
simp only [cons_val_zero, cons_val_one, head_cons, coe_matrix_coe,
coe_mk, Int.coe_castRingHom, map_apply, Int.cast_neg, neg_eq_zero, Set.mem_setOf_eq] at *
exact ha
#align Gamma0 Gamma0
@[simp]
theorem Gamma0_mem (N : β) (A : SL(2, β€)) : A β Gamma0 N β ((ββA 1 0 : β€) : ZMod N) = 0 :=
Iff.rfl
#align Gamma0_mem Gamma0_mem
| Mathlib/NumberTheory/ModularForms/CongruenceSubgroups.lean | 125 | 125 | theorem Gamma0_det (N : β) (A : Gamma0 N) : (A.1.1.det : ZMod N) = 1 := by | simp [A.1.property]
| 1 | 2.718282 | 0 | 1.25 | 4 | 1,329 |
import Mathlib.Data.Int.Bitwise
import Mathlib.LinearAlgebra.Matrix.NonsingularInverse
import Mathlib.LinearAlgebra.Matrix.Symmetric
#align_import linear_algebra.matrix.zpow from "leanprover-community/mathlib"@"03fda9112aa6708947da13944a19310684bfdfcb"
open Matrix
namespace Matrix
variable {n' : Type*} [DecidableEq n'] [Fintype n'] {R : Type*} [CommRing R]
local notation "M" => Matrix n' n' R
noncomputable instance : DivInvMonoid M :=
{ show Monoid M by infer_instance, show Inv M by infer_instance with }
section NatPow
@[simp]
| Mathlib/LinearAlgebra/Matrix/ZPow.lean | 44 | 47 | theorem inv_pow' (A : M) (n : β) : Aβ»ΒΉ ^ n = (A ^ n)β»ΒΉ := by |
induction' n with n ih
Β· simp
Β· rw [pow_succ A, mul_inv_rev, β ih, β pow_succ']
| 3 | 20.085537 | 1 | 1.25 | 4 | 1,330 |
import Mathlib.Data.Int.Bitwise
import Mathlib.LinearAlgebra.Matrix.NonsingularInverse
import Mathlib.LinearAlgebra.Matrix.Symmetric
#align_import linear_algebra.matrix.zpow from "leanprover-community/mathlib"@"03fda9112aa6708947da13944a19310684bfdfcb"
open Matrix
namespace Matrix
variable {n' : Type*} [DecidableEq n'] [Fintype n'] {R : Type*} [CommRing R]
local notation "M" => Matrix n' n' R
noncomputable instance : DivInvMonoid M :=
{ show Monoid M by infer_instance, show Inv M by infer_instance with }
section NatPow
@[simp]
theorem inv_pow' (A : M) (n : β) : Aβ»ΒΉ ^ n = (A ^ n)β»ΒΉ := by
induction' n with n ih
Β· simp
Β· rw [pow_succ A, mul_inv_rev, β ih, β pow_succ']
#align matrix.inv_pow' Matrix.inv_pow'
| Mathlib/LinearAlgebra/Matrix/ZPow.lean | 50 | 54 | theorem pow_sub' (A : M) {m n : β} (ha : IsUnit A.det) (h : n β€ m) :
A ^ (m - n) = A ^ m * (A ^ n)β»ΒΉ := by |
rw [β tsub_add_cancel_of_le h, pow_add, Matrix.mul_assoc, mul_nonsing_inv,
tsub_add_cancel_of_le h, Matrix.mul_one]
simpa using ha.pow n
| 3 | 20.085537 | 1 | 1.25 | 4 | 1,330 |
import Mathlib.Data.Int.Bitwise
import Mathlib.LinearAlgebra.Matrix.NonsingularInverse
import Mathlib.LinearAlgebra.Matrix.Symmetric
#align_import linear_algebra.matrix.zpow from "leanprover-community/mathlib"@"03fda9112aa6708947da13944a19310684bfdfcb"
open Matrix
namespace Matrix
variable {n' : Type*} [DecidableEq n'] [Fintype n'] {R : Type*} [CommRing R]
local notation "M" => Matrix n' n' R
noncomputable instance : DivInvMonoid M :=
{ show Monoid M by infer_instance, show Inv M by infer_instance with }
section NatPow
@[simp]
theorem inv_pow' (A : M) (n : β) : Aβ»ΒΉ ^ n = (A ^ n)β»ΒΉ := by
induction' n with n ih
Β· simp
Β· rw [pow_succ A, mul_inv_rev, β ih, β pow_succ']
#align matrix.inv_pow' Matrix.inv_pow'
theorem pow_sub' (A : M) {m n : β} (ha : IsUnit A.det) (h : n β€ m) :
A ^ (m - n) = A ^ m * (A ^ n)β»ΒΉ := by
rw [β tsub_add_cancel_of_le h, pow_add, Matrix.mul_assoc, mul_nonsing_inv,
tsub_add_cancel_of_le h, Matrix.mul_one]
simpa using ha.pow n
#align matrix.pow_sub' Matrix.pow_sub'
| Mathlib/LinearAlgebra/Matrix/ZPow.lean | 57 | 70 | theorem pow_inv_comm' (A : M) (m n : β) : Aβ»ΒΉ ^ m * A ^ n = A ^ n * Aβ»ΒΉ ^ m := by |
induction' n with n IH generalizing m
Β· simp
cases' m with m m
Β· simp
rcases nonsing_inv_cancel_or_zero A with (β¨h, h'β© | h)
Β· calc
Aβ»ΒΉ ^ (m + 1) * A ^ (n + 1) = Aβ»ΒΉ ^ m * (Aβ»ΒΉ * A) * A ^ n := by
simp only [pow_succ Aβ»ΒΉ, pow_succ' A, Matrix.mul_assoc]
_ = A ^ n * Aβ»ΒΉ ^ m := by simp only [h, Matrix.mul_one, Matrix.one_mul, IH m]
_ = A ^ n * (A * Aβ»ΒΉ) * Aβ»ΒΉ ^ m := by simp only [h', Matrix.mul_one, Matrix.one_mul]
_ = A ^ (n + 1) * Aβ»ΒΉ ^ (m + 1) := by
simp only [pow_succ A, pow_succ' Aβ»ΒΉ, Matrix.mul_assoc]
Β· simp [h]
| 13 | 442,413.392009 | 2 | 1.25 | 4 | 1,330 |
import Mathlib.Data.Int.Bitwise
import Mathlib.LinearAlgebra.Matrix.NonsingularInverse
import Mathlib.LinearAlgebra.Matrix.Symmetric
#align_import linear_algebra.matrix.zpow from "leanprover-community/mathlib"@"03fda9112aa6708947da13944a19310684bfdfcb"
open Matrix
namespace Matrix
variable {n' : Type*} [DecidableEq n'] [Fintype n'] {R : Type*} [CommRing R]
local notation "M" => Matrix n' n' R
noncomputable instance : DivInvMonoid M :=
{ show Monoid M by infer_instance, show Inv M by infer_instance with }
section ZPow
open Int
@[simp]
theorem one_zpow : β n : β€, (1 : M) ^ n = 1
| (n : β) => by rw [zpow_natCast, one_pow]
| -[n+1] => by rw [zpow_negSucc, one_pow, inv_one]
#align matrix.one_zpow Matrix.one_zpow
theorem zero_zpow : β z : β€, z β 0 β (0 : M) ^ z = 0
| (n : β), h => by
rw [zpow_natCast, zero_pow]
exact mod_cast h
| -[n+1], _ => by simp [zero_pow n.succ_ne_zero]
#align matrix.zero_zpow Matrix.zero_zpow
| Mathlib/LinearAlgebra/Matrix/ZPow.lean | 92 | 95 | theorem zero_zpow_eq (n : β€) : (0 : M) ^ n = if n = 0 then 1 else 0 := by |
split_ifs with h
Β· rw [h, zpow_zero]
Β· rw [zero_zpow _ h]
| 3 | 20.085537 | 1 | 1.25 | 4 | 1,330 |
import Mathlib.Algebra.Group.ConjFinite
import Mathlib.GroupTheory.Perm.Fin
import Mathlib.GroupTheory.Subgroup.Simple
import Mathlib.Tactic.IntervalCases
#align_import group_theory.specific_groups.alternating from "leanprover-community/mathlib"@"0f6670b8af2dff699de1c0b4b49039b31bc13c46"
-- An example on how to determine the order of an element of a finite group.
example : orderOf (-1 : β€Λ£) = 2 :=
orderOf_eq_prime (Int.units_sq _) (by decide)
open Equiv Equiv.Perm Subgroup Fintype
variable (Ξ± : Type*) [Fintype Ξ±] [DecidableEq Ξ±]
def alternatingGroup : Subgroup (Perm Ξ±) :=
sign.ker
#align alternating_group alternatingGroup
-- Porting note (#10754): manually added instance
instance fta : Fintype (alternatingGroup Ξ±) :=
@Subtype.fintype _ _ sign.decidableMemKer _
instance [Subsingleton Ξ±] : Unique (alternatingGroup Ξ±) :=
β¨β¨1β©, fun β¨p, _β© => Subtype.eq (Subsingleton.elim p _)β©
variable {Ξ±}
theorem alternatingGroup_eq_sign_ker : alternatingGroup Ξ± = sign.ker :=
rfl
#align alternating_group_eq_sign_ker alternatingGroup_eq_sign_ker
namespace Equiv.Perm
@[simp]
theorem mem_alternatingGroup {f : Perm Ξ±} : f β alternatingGroup Ξ± β sign f = 1 :=
sign.mem_ker
#align equiv.perm.mem_alternating_group Equiv.Perm.mem_alternatingGroup
| Mathlib/GroupTheory/SpecificGroups/Alternating.lean | 77 | 80 | theorem prod_list_swap_mem_alternatingGroup_iff_even_length {l : List (Perm Ξ±)}
(hl : β g β l, IsSwap g) : l.prod β alternatingGroup Ξ± β Even l.length := by |
rw [mem_alternatingGroup, sign_prod_list_swap hl, neg_one_pow_eq_one_iff_even]
decide
| 2 | 7.389056 | 1 | 1.25 | 4 | 1,331 |
import Mathlib.Algebra.Group.ConjFinite
import Mathlib.GroupTheory.Perm.Fin
import Mathlib.GroupTheory.Subgroup.Simple
import Mathlib.Tactic.IntervalCases
#align_import group_theory.specific_groups.alternating from "leanprover-community/mathlib"@"0f6670b8af2dff699de1c0b4b49039b31bc13c46"
-- An example on how to determine the order of an element of a finite group.
example : orderOf (-1 : β€Λ£) = 2 :=
orderOf_eq_prime (Int.units_sq _) (by decide)
open Equiv Equiv.Perm Subgroup Fintype
variable (Ξ± : Type*) [Fintype Ξ±] [DecidableEq Ξ±]
def alternatingGroup : Subgroup (Perm Ξ±) :=
sign.ker
#align alternating_group alternatingGroup
-- Porting note (#10754): manually added instance
instance fta : Fintype (alternatingGroup Ξ±) :=
@Subtype.fintype _ _ sign.decidableMemKer _
instance [Subsingleton Ξ±] : Unique (alternatingGroup Ξ±) :=
β¨β¨1β©, fun β¨p, _β© => Subtype.eq (Subsingleton.elim p _)β©
variable {Ξ±}
theorem alternatingGroup_eq_sign_ker : alternatingGroup Ξ± = sign.ker :=
rfl
#align alternating_group_eq_sign_ker alternatingGroup_eq_sign_ker
namespace Equiv.Perm
@[simp]
theorem mem_alternatingGroup {f : Perm Ξ±} : f β alternatingGroup Ξ± β sign f = 1 :=
sign.mem_ker
#align equiv.perm.mem_alternating_group Equiv.Perm.mem_alternatingGroup
theorem prod_list_swap_mem_alternatingGroup_iff_even_length {l : List (Perm Ξ±)}
(hl : β g β l, IsSwap g) : l.prod β alternatingGroup Ξ± β Even l.length := by
rw [mem_alternatingGroup, sign_prod_list_swap hl, neg_one_pow_eq_one_iff_even]
decide
#align equiv.perm.prod_list_swap_mem_alternating_group_iff_even_length Equiv.Perm.prod_list_swap_mem_alternatingGroup_iff_even_length
theorem IsThreeCycle.mem_alternatingGroup {f : Perm Ξ±} (h : IsThreeCycle f) :
f β alternatingGroup Ξ± :=
mem_alternatingGroup.mpr h.sign
#align equiv.perm.is_three_cycle.mem_alternating_group Equiv.Perm.IsThreeCycle.mem_alternatingGroup
set_option linter.deprecated false in
| Mathlib/GroupTheory/SpecificGroups/Alternating.lean | 89 | 91 | theorem finRotate_bit1_mem_alternatingGroup {n : β} :
finRotate (bit1 n) β alternatingGroup (Fin (bit1 n)) := by |
rw [mem_alternatingGroup, bit1, sign_finRotate, pow_bit0', Int.units_mul_self, one_pow]
| 1 | 2.718282 | 0 | 1.25 | 4 | 1,331 |
import Mathlib.Algebra.Group.ConjFinite
import Mathlib.GroupTheory.Perm.Fin
import Mathlib.GroupTheory.Subgroup.Simple
import Mathlib.Tactic.IntervalCases
#align_import group_theory.specific_groups.alternating from "leanprover-community/mathlib"@"0f6670b8af2dff699de1c0b4b49039b31bc13c46"
-- An example on how to determine the order of an element of a finite group.
example : orderOf (-1 : β€Λ£) = 2 :=
orderOf_eq_prime (Int.units_sq _) (by decide)
open Equiv Equiv.Perm Subgroup Fintype
variable (Ξ± : Type*) [Fintype Ξ±] [DecidableEq Ξ±]
def alternatingGroup : Subgroup (Perm Ξ±) :=
sign.ker
#align alternating_group alternatingGroup
-- Porting note (#10754): manually added instance
instance fta : Fintype (alternatingGroup Ξ±) :=
@Subtype.fintype _ _ sign.decidableMemKer _
instance [Subsingleton Ξ±] : Unique (alternatingGroup Ξ±) :=
β¨β¨1β©, fun β¨p, _β© => Subtype.eq (Subsingleton.elim p _)β©
variable {Ξ±}
theorem alternatingGroup_eq_sign_ker : alternatingGroup Ξ± = sign.ker :=
rfl
#align alternating_group_eq_sign_ker alternatingGroup_eq_sign_ker
| Mathlib/GroupTheory/SpecificGroups/Alternating.lean | 96 | 101 | theorem two_mul_card_alternatingGroup [Nontrivial Ξ±] :
2 * card (alternatingGroup Ξ±) = card (Perm Ξ±) := by |
let this := (QuotientGroup.quotientKerEquivOfSurjective _ (sign_surjective Ξ±)).toEquiv
rw [β Fintype.card_units_int, β Fintype.card_congr this]
simp only [β Nat.card_eq_fintype_card]
apply (Subgroup.card_eq_card_quotient_mul_card_subgroup _).symm
| 4 | 54.59815 | 2 | 1.25 | 4 | 1,331 |
import Mathlib.Algebra.Group.ConjFinite
import Mathlib.GroupTheory.Perm.Fin
import Mathlib.GroupTheory.Subgroup.Simple
import Mathlib.Tactic.IntervalCases
#align_import group_theory.specific_groups.alternating from "leanprover-community/mathlib"@"0f6670b8af2dff699de1c0b4b49039b31bc13c46"
-- An example on how to determine the order of an element of a finite group.
example : orderOf (-1 : β€Λ£) = 2 :=
orderOf_eq_prime (Int.units_sq _) (by decide)
open Equiv Equiv.Perm Subgroup Fintype
variable (Ξ± : Type*) [Fintype Ξ±] [DecidableEq Ξ±]
def alternatingGroup : Subgroup (Perm Ξ±) :=
sign.ker
#align alternating_group alternatingGroup
-- Porting note (#10754): manually added instance
instance fta : Fintype (alternatingGroup Ξ±) :=
@Subtype.fintype _ _ sign.decidableMemKer _
instance [Subsingleton Ξ±] : Unique (alternatingGroup Ξ±) :=
β¨β¨1β©, fun β¨p, _β© => Subtype.eq (Subsingleton.elim p _)β©
variable {Ξ±}
theorem alternatingGroup_eq_sign_ker : alternatingGroup Ξ± = sign.ker :=
rfl
#align alternating_group_eq_sign_ker alternatingGroup_eq_sign_ker
theorem two_mul_card_alternatingGroup [Nontrivial Ξ±] :
2 * card (alternatingGroup Ξ±) = card (Perm Ξ±) := by
let this := (QuotientGroup.quotientKerEquivOfSurjective _ (sign_surjective Ξ±)).toEquiv
rw [β Fintype.card_units_int, β Fintype.card_congr this]
simp only [β Nat.card_eq_fintype_card]
apply (Subgroup.card_eq_card_quotient_mul_card_subgroup _).symm
#align two_mul_card_alternating_group two_mul_card_alternatingGroup
namespace alternatingGroup
open Equiv.Perm
| Mathlib/GroupTheory/SpecificGroups/Alternating.lean | 219 | 224 | theorem nontrivial_of_three_le_card (h3 : 3 β€ card Ξ±) : Nontrivial (alternatingGroup Ξ±) := by |
haveI := Fintype.one_lt_card_iff_nontrivial.1 (lt_trans (by decide) h3)
rw [β Fintype.one_lt_card_iff_nontrivial]
refine lt_of_mul_lt_mul_left ?_ (le_of_lt Nat.prime_two.pos)
rw [two_mul_card_alternatingGroup, card_perm, β Nat.succ_le_iff]
exact le_trans h3 (card Ξ±).self_le_factorial
| 5 | 148.413159 | 2 | 1.25 | 4 | 1,331 |
import Mathlib.Data.Int.Range
import Mathlib.Data.ZMod.Basic
import Mathlib.NumberTheory.MulChar.Basic
#align_import number_theory.legendre_symbol.zmod_char from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
namespace ZMod
section QuadCharModP
@[simps]
def Οβ : MulChar (ZMod 4) β€ where
toFun := (![0, 1, 0, -1] : ZMod 4 β β€)
map_one' := rfl
map_mul' := by decide
map_nonunit' := by decide
#align zmod.Οβ ZMod.Οβ
| Mathlib/NumberTheory/LegendreSymbol/ZModChar.lean | 48 | 52 | theorem isQuadratic_Οβ : Οβ.IsQuadratic := by |
intro a
-- Porting note (#11043): was `decide!`
fin_cases a
all_goals decide
| 4 | 54.59815 | 2 | 1.25 | 12 | 1,332 |
import Mathlib.Data.Int.Range
import Mathlib.Data.ZMod.Basic
import Mathlib.NumberTheory.MulChar.Basic
#align_import number_theory.legendre_symbol.zmod_char from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
namespace ZMod
section QuadCharModP
@[simps]
def Οβ : MulChar (ZMod 4) β€ where
toFun := (![0, 1, 0, -1] : ZMod 4 β β€)
map_one' := rfl
map_mul' := by decide
map_nonunit' := by decide
#align zmod.Οβ ZMod.Οβ
theorem isQuadratic_Οβ : Οβ.IsQuadratic := by
intro a
-- Porting note (#11043): was `decide!`
fin_cases a
all_goals decide
#align zmod.is_quadratic_Οβ ZMod.isQuadratic_Οβ
| Mathlib/NumberTheory/LegendreSymbol/ZModChar.lean | 56 | 56 | theorem Οβ_nat_mod_four (n : β) : Οβ n = Οβ (n % 4 : β) := by | rw [β ZMod.natCast_mod n 4]
| 1 | 2.718282 | 0 | 1.25 | 12 | 1,332 |
import Mathlib.Data.Int.Range
import Mathlib.Data.ZMod.Basic
import Mathlib.NumberTheory.MulChar.Basic
#align_import number_theory.legendre_symbol.zmod_char from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
namespace ZMod
section QuadCharModP
@[simps]
def Οβ : MulChar (ZMod 4) β€ where
toFun := (![0, 1, 0, -1] : ZMod 4 β β€)
map_one' := rfl
map_mul' := by decide
map_nonunit' := by decide
#align zmod.Οβ ZMod.Οβ
theorem isQuadratic_Οβ : Οβ.IsQuadratic := by
intro a
-- Porting note (#11043): was `decide!`
fin_cases a
all_goals decide
#align zmod.is_quadratic_Οβ ZMod.isQuadratic_Οβ
theorem Οβ_nat_mod_four (n : β) : Οβ n = Οβ (n % 4 : β) := by rw [β ZMod.natCast_mod n 4]
#align zmod.Οβ_nat_mod_four ZMod.Οβ_nat_mod_four
| Mathlib/NumberTheory/LegendreSymbol/ZModChar.lean | 60 | 62 | theorem Οβ_int_mod_four (n : β€) : Οβ n = Οβ (n % 4 : β€) := by |
rw [β ZMod.intCast_mod n 4]
norm_cast
| 2 | 7.389056 | 1 | 1.25 | 12 | 1,332 |
import Mathlib.Data.Int.Range
import Mathlib.Data.ZMod.Basic
import Mathlib.NumberTheory.MulChar.Basic
#align_import number_theory.legendre_symbol.zmod_char from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
namespace ZMod
section QuadCharModP
@[simps]
def Οβ : MulChar (ZMod 4) β€ where
toFun := (![0, 1, 0, -1] : ZMod 4 β β€)
map_one' := rfl
map_mul' := by decide
map_nonunit' := by decide
#align zmod.Οβ ZMod.Οβ
theorem isQuadratic_Οβ : Οβ.IsQuadratic := by
intro a
-- Porting note (#11043): was `decide!`
fin_cases a
all_goals decide
#align zmod.is_quadratic_Οβ ZMod.isQuadratic_Οβ
theorem Οβ_nat_mod_four (n : β) : Οβ n = Οβ (n % 4 : β) := by rw [β ZMod.natCast_mod n 4]
#align zmod.Οβ_nat_mod_four ZMod.Οβ_nat_mod_four
theorem Οβ_int_mod_four (n : β€) : Οβ n = Οβ (n % 4 : β€) := by
rw [β ZMod.intCast_mod n 4]
norm_cast
#align zmod.Οβ_int_mod_four ZMod.Οβ_int_mod_four
| Mathlib/NumberTheory/LegendreSymbol/ZModChar.lean | 66 | 71 | theorem Οβ_int_eq_if_mod_four (n : β€) :
Οβ n = if n % 2 = 0 then 0 else if n % 4 = 1 then 1 else -1 := by |
have help : β m : β€, 0 β€ m β m < 4 β Οβ m = if m % 2 = 0 then 0 else if m = 1 then 1 else -1 := by
decide
rw [β Int.emod_emod_of_dvd n (by decide : (2 : β€) β£ 4), β ZMod.intCast_mod n 4]
exact help (n % 4) (Int.emod_nonneg n (by norm_num)) (Int.emod_lt n (by norm_num))
| 4 | 54.59815 | 2 | 1.25 | 12 | 1,332 |
import Mathlib.Data.Int.Range
import Mathlib.Data.ZMod.Basic
import Mathlib.NumberTheory.MulChar.Basic
#align_import number_theory.legendre_symbol.zmod_char from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
namespace ZMod
section QuadCharModP
@[simps]
def Οβ : MulChar (ZMod 4) β€ where
toFun := (![0, 1, 0, -1] : ZMod 4 β β€)
map_one' := rfl
map_mul' := by decide
map_nonunit' := by decide
#align zmod.Οβ ZMod.Οβ
theorem isQuadratic_Οβ : Οβ.IsQuadratic := by
intro a
-- Porting note (#11043): was `decide!`
fin_cases a
all_goals decide
#align zmod.is_quadratic_Οβ ZMod.isQuadratic_Οβ
theorem Οβ_nat_mod_four (n : β) : Οβ n = Οβ (n % 4 : β) := by rw [β ZMod.natCast_mod n 4]
#align zmod.Οβ_nat_mod_four ZMod.Οβ_nat_mod_four
theorem Οβ_int_mod_four (n : β€) : Οβ n = Οβ (n % 4 : β€) := by
rw [β ZMod.intCast_mod n 4]
norm_cast
#align zmod.Οβ_int_mod_four ZMod.Οβ_int_mod_four
theorem Οβ_int_eq_if_mod_four (n : β€) :
Οβ n = if n % 2 = 0 then 0 else if n % 4 = 1 then 1 else -1 := by
have help : β m : β€, 0 β€ m β m < 4 β Οβ m = if m % 2 = 0 then 0 else if m = 1 then 1 else -1 := by
decide
rw [β Int.emod_emod_of_dvd n (by decide : (2 : β€) β£ 4), β ZMod.intCast_mod n 4]
exact help (n % 4) (Int.emod_nonneg n (by norm_num)) (Int.emod_lt n (by norm_num))
#align zmod.Οβ_int_eq_if_mod_four ZMod.Οβ_int_eq_if_mod_four
theorem Οβ_nat_eq_if_mod_four (n : β) :
Οβ n = if n % 2 = 0 then 0 else if n % 4 = 1 then 1 else -1 :=
mod_cast Οβ_int_eq_if_mod_four n
#align zmod.Οβ_nat_eq_if_mod_four ZMod.Οβ_nat_eq_if_mod_four
| Mathlib/NumberTheory/LegendreSymbol/ZModChar.lean | 80 | 91 | theorem Οβ_eq_neg_one_pow {n : β} (hn : n % 2 = 1) : Οβ n = (-1) ^ (n / 2) := by |
rw [Οβ_nat_eq_if_mod_four]
simp only [hn, Nat.one_ne_zero, if_false]
conv_rhs => -- Porting note: was `nth_rw`
arg 2; rw [β Nat.div_add_mod n 4]
enter [1, 1, 1]; rw [(by norm_num : 4 = 2 * 2)]
rw [mul_assoc, add_comm, Nat.add_mul_div_left _ _ (by norm_num : 0 < 2), pow_add, pow_mul,
neg_one_sq, one_pow, mul_one]
have help : β m : β, m < 4 β m % 2 = 1 β ite (m = 1) (1 : β€) (-1) = (-1) ^ (m / 2) := by decide
exact
help (n % 4) (Nat.mod_lt n (by norm_num))
((Nat.mod_mod_of_dvd n (by decide : 2 β£ 4)).trans hn)
| 11 | 59,874.141715 | 2 | 1.25 | 12 | 1,332 |
import Mathlib.Data.Int.Range
import Mathlib.Data.ZMod.Basic
import Mathlib.NumberTheory.MulChar.Basic
#align_import number_theory.legendre_symbol.zmod_char from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
namespace ZMod
section QuadCharModP
@[simps]
def Οβ : MulChar (ZMod 4) β€ where
toFun := (![0, 1, 0, -1] : ZMod 4 β β€)
map_one' := rfl
map_mul' := by decide
map_nonunit' := by decide
#align zmod.Οβ ZMod.Οβ
theorem isQuadratic_Οβ : Οβ.IsQuadratic := by
intro a
-- Porting note (#11043): was `decide!`
fin_cases a
all_goals decide
#align zmod.is_quadratic_Οβ ZMod.isQuadratic_Οβ
theorem Οβ_nat_mod_four (n : β) : Οβ n = Οβ (n % 4 : β) := by rw [β ZMod.natCast_mod n 4]
#align zmod.Οβ_nat_mod_four ZMod.Οβ_nat_mod_four
theorem Οβ_int_mod_four (n : β€) : Οβ n = Οβ (n % 4 : β€) := by
rw [β ZMod.intCast_mod n 4]
norm_cast
#align zmod.Οβ_int_mod_four ZMod.Οβ_int_mod_four
theorem Οβ_int_eq_if_mod_four (n : β€) :
Οβ n = if n % 2 = 0 then 0 else if n % 4 = 1 then 1 else -1 := by
have help : β m : β€, 0 β€ m β m < 4 β Οβ m = if m % 2 = 0 then 0 else if m = 1 then 1 else -1 := by
decide
rw [β Int.emod_emod_of_dvd n (by decide : (2 : β€) β£ 4), β ZMod.intCast_mod n 4]
exact help (n % 4) (Int.emod_nonneg n (by norm_num)) (Int.emod_lt n (by norm_num))
#align zmod.Οβ_int_eq_if_mod_four ZMod.Οβ_int_eq_if_mod_four
theorem Οβ_nat_eq_if_mod_four (n : β) :
Οβ n = if n % 2 = 0 then 0 else if n % 4 = 1 then 1 else -1 :=
mod_cast Οβ_int_eq_if_mod_four n
#align zmod.Οβ_nat_eq_if_mod_four ZMod.Οβ_nat_eq_if_mod_four
theorem Οβ_eq_neg_one_pow {n : β} (hn : n % 2 = 1) : Οβ n = (-1) ^ (n / 2) := by
rw [Οβ_nat_eq_if_mod_four]
simp only [hn, Nat.one_ne_zero, if_false]
conv_rhs => -- Porting note: was `nth_rw`
arg 2; rw [β Nat.div_add_mod n 4]
enter [1, 1, 1]; rw [(by norm_num : 4 = 2 * 2)]
rw [mul_assoc, add_comm, Nat.add_mul_div_left _ _ (by norm_num : 0 < 2), pow_add, pow_mul,
neg_one_sq, one_pow, mul_one]
have help : β m : β, m < 4 β m % 2 = 1 β ite (m = 1) (1 : β€) (-1) = (-1) ^ (m / 2) := by decide
exact
help (n % 4) (Nat.mod_lt n (by norm_num))
((Nat.mod_mod_of_dvd n (by decide : 2 β£ 4)).trans hn)
#align zmod.Οβ_eq_neg_one_pow ZMod.Οβ_eq_neg_one_pow
| Mathlib/NumberTheory/LegendreSymbol/ZModChar.lean | 95 | 97 | theorem Οβ_nat_one_mod_four {n : β} (hn : n % 4 = 1) : Οβ n = 1 := by |
rw [Οβ_nat_mod_four, hn]
rfl
| 2 | 7.389056 | 1 | 1.25 | 12 | 1,332 |
import Mathlib.Data.Int.Range
import Mathlib.Data.ZMod.Basic
import Mathlib.NumberTheory.MulChar.Basic
#align_import number_theory.legendre_symbol.zmod_char from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
namespace ZMod
section QuadCharModP
@[simps]
def Οβ : MulChar (ZMod 4) β€ where
toFun := (![0, 1, 0, -1] : ZMod 4 β β€)
map_one' := rfl
map_mul' := by decide
map_nonunit' := by decide
#align zmod.Οβ ZMod.Οβ
theorem isQuadratic_Οβ : Οβ.IsQuadratic := by
intro a
-- Porting note (#11043): was `decide!`
fin_cases a
all_goals decide
#align zmod.is_quadratic_Οβ ZMod.isQuadratic_Οβ
theorem Οβ_nat_mod_four (n : β) : Οβ n = Οβ (n % 4 : β) := by rw [β ZMod.natCast_mod n 4]
#align zmod.Οβ_nat_mod_four ZMod.Οβ_nat_mod_four
theorem Οβ_int_mod_four (n : β€) : Οβ n = Οβ (n % 4 : β€) := by
rw [β ZMod.intCast_mod n 4]
norm_cast
#align zmod.Οβ_int_mod_four ZMod.Οβ_int_mod_four
theorem Οβ_int_eq_if_mod_four (n : β€) :
Οβ n = if n % 2 = 0 then 0 else if n % 4 = 1 then 1 else -1 := by
have help : β m : β€, 0 β€ m β m < 4 β Οβ m = if m % 2 = 0 then 0 else if m = 1 then 1 else -1 := by
decide
rw [β Int.emod_emod_of_dvd n (by decide : (2 : β€) β£ 4), β ZMod.intCast_mod n 4]
exact help (n % 4) (Int.emod_nonneg n (by norm_num)) (Int.emod_lt n (by norm_num))
#align zmod.Οβ_int_eq_if_mod_four ZMod.Οβ_int_eq_if_mod_four
theorem Οβ_nat_eq_if_mod_four (n : β) :
Οβ n = if n % 2 = 0 then 0 else if n % 4 = 1 then 1 else -1 :=
mod_cast Οβ_int_eq_if_mod_four n
#align zmod.Οβ_nat_eq_if_mod_four ZMod.Οβ_nat_eq_if_mod_four
theorem Οβ_eq_neg_one_pow {n : β} (hn : n % 2 = 1) : Οβ n = (-1) ^ (n / 2) := by
rw [Οβ_nat_eq_if_mod_four]
simp only [hn, Nat.one_ne_zero, if_false]
conv_rhs => -- Porting note: was `nth_rw`
arg 2; rw [β Nat.div_add_mod n 4]
enter [1, 1, 1]; rw [(by norm_num : 4 = 2 * 2)]
rw [mul_assoc, add_comm, Nat.add_mul_div_left _ _ (by norm_num : 0 < 2), pow_add, pow_mul,
neg_one_sq, one_pow, mul_one]
have help : β m : β, m < 4 β m % 2 = 1 β ite (m = 1) (1 : β€) (-1) = (-1) ^ (m / 2) := by decide
exact
help (n % 4) (Nat.mod_lt n (by norm_num))
((Nat.mod_mod_of_dvd n (by decide : 2 β£ 4)).trans hn)
#align zmod.Οβ_eq_neg_one_pow ZMod.Οβ_eq_neg_one_pow
theorem Οβ_nat_one_mod_four {n : β} (hn : n % 4 = 1) : Οβ n = 1 := by
rw [Οβ_nat_mod_four, hn]
rfl
#align zmod.Οβ_nat_one_mod_four ZMod.Οβ_nat_one_mod_four
| Mathlib/NumberTheory/LegendreSymbol/ZModChar.lean | 101 | 103 | theorem Οβ_nat_three_mod_four {n : β} (hn : n % 4 = 3) : Οβ n = -1 := by |
rw [Οβ_nat_mod_four, hn]
rfl
| 2 | 7.389056 | 1 | 1.25 | 12 | 1,332 |
import Mathlib.Data.Int.Range
import Mathlib.Data.ZMod.Basic
import Mathlib.NumberTheory.MulChar.Basic
#align_import number_theory.legendre_symbol.zmod_char from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
namespace ZMod
section QuadCharModP
@[simps]
def Οβ : MulChar (ZMod 4) β€ where
toFun := (![0, 1, 0, -1] : ZMod 4 β β€)
map_one' := rfl
map_mul' := by decide
map_nonunit' := by decide
#align zmod.Οβ ZMod.Οβ
theorem isQuadratic_Οβ : Οβ.IsQuadratic := by
intro a
-- Porting note (#11043): was `decide!`
fin_cases a
all_goals decide
#align zmod.is_quadratic_Οβ ZMod.isQuadratic_Οβ
theorem Οβ_nat_mod_four (n : β) : Οβ n = Οβ (n % 4 : β) := by rw [β ZMod.natCast_mod n 4]
#align zmod.Οβ_nat_mod_four ZMod.Οβ_nat_mod_four
theorem Οβ_int_mod_four (n : β€) : Οβ n = Οβ (n % 4 : β€) := by
rw [β ZMod.intCast_mod n 4]
norm_cast
#align zmod.Οβ_int_mod_four ZMod.Οβ_int_mod_four
theorem Οβ_int_eq_if_mod_four (n : β€) :
Οβ n = if n % 2 = 0 then 0 else if n % 4 = 1 then 1 else -1 := by
have help : β m : β€, 0 β€ m β m < 4 β Οβ m = if m % 2 = 0 then 0 else if m = 1 then 1 else -1 := by
decide
rw [β Int.emod_emod_of_dvd n (by decide : (2 : β€) β£ 4), β ZMod.intCast_mod n 4]
exact help (n % 4) (Int.emod_nonneg n (by norm_num)) (Int.emod_lt n (by norm_num))
#align zmod.Οβ_int_eq_if_mod_four ZMod.Οβ_int_eq_if_mod_four
theorem Οβ_nat_eq_if_mod_four (n : β) :
Οβ n = if n % 2 = 0 then 0 else if n % 4 = 1 then 1 else -1 :=
mod_cast Οβ_int_eq_if_mod_four n
#align zmod.Οβ_nat_eq_if_mod_four ZMod.Οβ_nat_eq_if_mod_four
theorem Οβ_eq_neg_one_pow {n : β} (hn : n % 2 = 1) : Οβ n = (-1) ^ (n / 2) := by
rw [Οβ_nat_eq_if_mod_four]
simp only [hn, Nat.one_ne_zero, if_false]
conv_rhs => -- Porting note: was `nth_rw`
arg 2; rw [β Nat.div_add_mod n 4]
enter [1, 1, 1]; rw [(by norm_num : 4 = 2 * 2)]
rw [mul_assoc, add_comm, Nat.add_mul_div_left _ _ (by norm_num : 0 < 2), pow_add, pow_mul,
neg_one_sq, one_pow, mul_one]
have help : β m : β, m < 4 β m % 2 = 1 β ite (m = 1) (1 : β€) (-1) = (-1) ^ (m / 2) := by decide
exact
help (n % 4) (Nat.mod_lt n (by norm_num))
((Nat.mod_mod_of_dvd n (by decide : 2 β£ 4)).trans hn)
#align zmod.Οβ_eq_neg_one_pow ZMod.Οβ_eq_neg_one_pow
theorem Οβ_nat_one_mod_four {n : β} (hn : n % 4 = 1) : Οβ n = 1 := by
rw [Οβ_nat_mod_four, hn]
rfl
#align zmod.Οβ_nat_one_mod_four ZMod.Οβ_nat_one_mod_four
theorem Οβ_nat_three_mod_four {n : β} (hn : n % 4 = 3) : Οβ n = -1 := by
rw [Οβ_nat_mod_four, hn]
rfl
#align zmod.Οβ_nat_three_mod_four ZMod.Οβ_nat_three_mod_four
| Mathlib/NumberTheory/LegendreSymbol/ZModChar.lean | 107 | 109 | theorem Οβ_int_one_mod_four {n : β€} (hn : n % 4 = 1) : Οβ n = 1 := by |
rw [Οβ_int_mod_four, hn]
rfl
| 2 | 7.389056 | 1 | 1.25 | 12 | 1,332 |
import Mathlib.Data.Int.Range
import Mathlib.Data.ZMod.Basic
import Mathlib.NumberTheory.MulChar.Basic
#align_import number_theory.legendre_symbol.zmod_char from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
namespace ZMod
section QuadCharModP
@[simps]
def Οβ : MulChar (ZMod 4) β€ where
toFun := (![0, 1, 0, -1] : ZMod 4 β β€)
map_one' := rfl
map_mul' := by decide
map_nonunit' := by decide
#align zmod.Οβ ZMod.Οβ
theorem isQuadratic_Οβ : Οβ.IsQuadratic := by
intro a
-- Porting note (#11043): was `decide!`
fin_cases a
all_goals decide
#align zmod.is_quadratic_Οβ ZMod.isQuadratic_Οβ
theorem Οβ_nat_mod_four (n : β) : Οβ n = Οβ (n % 4 : β) := by rw [β ZMod.natCast_mod n 4]
#align zmod.Οβ_nat_mod_four ZMod.Οβ_nat_mod_four
theorem Οβ_int_mod_four (n : β€) : Οβ n = Οβ (n % 4 : β€) := by
rw [β ZMod.intCast_mod n 4]
norm_cast
#align zmod.Οβ_int_mod_four ZMod.Οβ_int_mod_four
theorem Οβ_int_eq_if_mod_four (n : β€) :
Οβ n = if n % 2 = 0 then 0 else if n % 4 = 1 then 1 else -1 := by
have help : β m : β€, 0 β€ m β m < 4 β Οβ m = if m % 2 = 0 then 0 else if m = 1 then 1 else -1 := by
decide
rw [β Int.emod_emod_of_dvd n (by decide : (2 : β€) β£ 4), β ZMod.intCast_mod n 4]
exact help (n % 4) (Int.emod_nonneg n (by norm_num)) (Int.emod_lt n (by norm_num))
#align zmod.Οβ_int_eq_if_mod_four ZMod.Οβ_int_eq_if_mod_four
theorem Οβ_nat_eq_if_mod_four (n : β) :
Οβ n = if n % 2 = 0 then 0 else if n % 4 = 1 then 1 else -1 :=
mod_cast Οβ_int_eq_if_mod_four n
#align zmod.Οβ_nat_eq_if_mod_four ZMod.Οβ_nat_eq_if_mod_four
theorem Οβ_eq_neg_one_pow {n : β} (hn : n % 2 = 1) : Οβ n = (-1) ^ (n / 2) := by
rw [Οβ_nat_eq_if_mod_four]
simp only [hn, Nat.one_ne_zero, if_false]
conv_rhs => -- Porting note: was `nth_rw`
arg 2; rw [β Nat.div_add_mod n 4]
enter [1, 1, 1]; rw [(by norm_num : 4 = 2 * 2)]
rw [mul_assoc, add_comm, Nat.add_mul_div_left _ _ (by norm_num : 0 < 2), pow_add, pow_mul,
neg_one_sq, one_pow, mul_one]
have help : β m : β, m < 4 β m % 2 = 1 β ite (m = 1) (1 : β€) (-1) = (-1) ^ (m / 2) := by decide
exact
help (n % 4) (Nat.mod_lt n (by norm_num))
((Nat.mod_mod_of_dvd n (by decide : 2 β£ 4)).trans hn)
#align zmod.Οβ_eq_neg_one_pow ZMod.Οβ_eq_neg_one_pow
theorem Οβ_nat_one_mod_four {n : β} (hn : n % 4 = 1) : Οβ n = 1 := by
rw [Οβ_nat_mod_four, hn]
rfl
#align zmod.Οβ_nat_one_mod_four ZMod.Οβ_nat_one_mod_four
theorem Οβ_nat_three_mod_four {n : β} (hn : n % 4 = 3) : Οβ n = -1 := by
rw [Οβ_nat_mod_four, hn]
rfl
#align zmod.Οβ_nat_three_mod_four ZMod.Οβ_nat_three_mod_four
theorem Οβ_int_one_mod_four {n : β€} (hn : n % 4 = 1) : Οβ n = 1 := by
rw [Οβ_int_mod_four, hn]
rfl
#align zmod.Οβ_int_one_mod_four ZMod.Οβ_int_one_mod_four
| Mathlib/NumberTheory/LegendreSymbol/ZModChar.lean | 113 | 115 | theorem Οβ_int_three_mod_four {n : β€} (hn : n % 4 = 3) : Οβ n = -1 := by |
rw [Οβ_int_mod_four, hn]
rfl
| 2 | 7.389056 | 1 | 1.25 | 12 | 1,332 |
import Mathlib.Data.Int.Range
import Mathlib.Data.ZMod.Basic
import Mathlib.NumberTheory.MulChar.Basic
#align_import number_theory.legendre_symbol.zmod_char from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
namespace ZMod
section QuadCharModP
@[simps]
def Οβ : MulChar (ZMod 4) β€ where
toFun := (![0, 1, 0, -1] : ZMod 4 β β€)
map_one' := rfl
map_mul' := by decide
map_nonunit' := by decide
#align zmod.Οβ ZMod.Οβ
theorem isQuadratic_Οβ : Οβ.IsQuadratic := by
intro a
-- Porting note (#11043): was `decide!`
fin_cases a
all_goals decide
#align zmod.is_quadratic_Οβ ZMod.isQuadratic_Οβ
theorem Οβ_nat_mod_four (n : β) : Οβ n = Οβ (n % 4 : β) := by rw [β ZMod.natCast_mod n 4]
#align zmod.Οβ_nat_mod_four ZMod.Οβ_nat_mod_four
theorem Οβ_int_mod_four (n : β€) : Οβ n = Οβ (n % 4 : β€) := by
rw [β ZMod.intCast_mod n 4]
norm_cast
#align zmod.Οβ_int_mod_four ZMod.Οβ_int_mod_four
theorem Οβ_int_eq_if_mod_four (n : β€) :
Οβ n = if n % 2 = 0 then 0 else if n % 4 = 1 then 1 else -1 := by
have help : β m : β€, 0 β€ m β m < 4 β Οβ m = if m % 2 = 0 then 0 else if m = 1 then 1 else -1 := by
decide
rw [β Int.emod_emod_of_dvd n (by decide : (2 : β€) β£ 4), β ZMod.intCast_mod n 4]
exact help (n % 4) (Int.emod_nonneg n (by norm_num)) (Int.emod_lt n (by norm_num))
#align zmod.Οβ_int_eq_if_mod_four ZMod.Οβ_int_eq_if_mod_four
theorem Οβ_nat_eq_if_mod_four (n : β) :
Οβ n = if n % 2 = 0 then 0 else if n % 4 = 1 then 1 else -1 :=
mod_cast Οβ_int_eq_if_mod_four n
#align zmod.Οβ_nat_eq_if_mod_four ZMod.Οβ_nat_eq_if_mod_four
theorem Οβ_eq_neg_one_pow {n : β} (hn : n % 2 = 1) : Οβ n = (-1) ^ (n / 2) := by
rw [Οβ_nat_eq_if_mod_four]
simp only [hn, Nat.one_ne_zero, if_false]
conv_rhs => -- Porting note: was `nth_rw`
arg 2; rw [β Nat.div_add_mod n 4]
enter [1, 1, 1]; rw [(by norm_num : 4 = 2 * 2)]
rw [mul_assoc, add_comm, Nat.add_mul_div_left _ _ (by norm_num : 0 < 2), pow_add, pow_mul,
neg_one_sq, one_pow, mul_one]
have help : β m : β, m < 4 β m % 2 = 1 β ite (m = 1) (1 : β€) (-1) = (-1) ^ (m / 2) := by decide
exact
help (n % 4) (Nat.mod_lt n (by norm_num))
((Nat.mod_mod_of_dvd n (by decide : 2 β£ 4)).trans hn)
#align zmod.Οβ_eq_neg_one_pow ZMod.Οβ_eq_neg_one_pow
theorem Οβ_nat_one_mod_four {n : β} (hn : n % 4 = 1) : Οβ n = 1 := by
rw [Οβ_nat_mod_four, hn]
rfl
#align zmod.Οβ_nat_one_mod_four ZMod.Οβ_nat_one_mod_four
theorem Οβ_nat_three_mod_four {n : β} (hn : n % 4 = 3) : Οβ n = -1 := by
rw [Οβ_nat_mod_four, hn]
rfl
#align zmod.Οβ_nat_three_mod_four ZMod.Οβ_nat_three_mod_four
theorem Οβ_int_one_mod_four {n : β€} (hn : n % 4 = 1) : Οβ n = 1 := by
rw [Οβ_int_mod_four, hn]
rfl
#align zmod.Οβ_int_one_mod_four ZMod.Οβ_int_one_mod_four
theorem Οβ_int_three_mod_four {n : β€} (hn : n % 4 = 3) : Οβ n = -1 := by
rw [Οβ_int_mod_four, hn]
rfl
#align zmod.Οβ_int_three_mod_four ZMod.Οβ_int_three_mod_four
| Mathlib/NumberTheory/LegendreSymbol/ZModChar.lean | 119 | 121 | theorem neg_one_pow_div_two_of_one_mod_four {n : β} (hn : n % 4 = 1) : (-1 : β€) ^ (n / 2) = 1 := by |
rw [β Οβ_eq_neg_one_pow (Nat.odd_of_mod_four_eq_one hn), β natCast_mod, hn]
rfl
| 2 | 7.389056 | 1 | 1.25 | 12 | 1,332 |
import Mathlib.Data.Int.Range
import Mathlib.Data.ZMod.Basic
import Mathlib.NumberTheory.MulChar.Basic
#align_import number_theory.legendre_symbol.zmod_char from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
namespace ZMod
section QuadCharModP
@[simps]
def Οβ : MulChar (ZMod 4) β€ where
toFun := (![0, 1, 0, -1] : ZMod 4 β β€)
map_one' := rfl
map_mul' := by decide
map_nonunit' := by decide
#align zmod.Οβ ZMod.Οβ
theorem isQuadratic_Οβ : Οβ.IsQuadratic := by
intro a
-- Porting note (#11043): was `decide!`
fin_cases a
all_goals decide
#align zmod.is_quadratic_Οβ ZMod.isQuadratic_Οβ
theorem Οβ_nat_mod_four (n : β) : Οβ n = Οβ (n % 4 : β) := by rw [β ZMod.natCast_mod n 4]
#align zmod.Οβ_nat_mod_four ZMod.Οβ_nat_mod_four
theorem Οβ_int_mod_four (n : β€) : Οβ n = Οβ (n % 4 : β€) := by
rw [β ZMod.intCast_mod n 4]
norm_cast
#align zmod.Οβ_int_mod_four ZMod.Οβ_int_mod_four
theorem Οβ_int_eq_if_mod_four (n : β€) :
Οβ n = if n % 2 = 0 then 0 else if n % 4 = 1 then 1 else -1 := by
have help : β m : β€, 0 β€ m β m < 4 β Οβ m = if m % 2 = 0 then 0 else if m = 1 then 1 else -1 := by
decide
rw [β Int.emod_emod_of_dvd n (by decide : (2 : β€) β£ 4), β ZMod.intCast_mod n 4]
exact help (n % 4) (Int.emod_nonneg n (by norm_num)) (Int.emod_lt n (by norm_num))
#align zmod.Οβ_int_eq_if_mod_four ZMod.Οβ_int_eq_if_mod_four
theorem Οβ_nat_eq_if_mod_four (n : β) :
Οβ n = if n % 2 = 0 then 0 else if n % 4 = 1 then 1 else -1 :=
mod_cast Οβ_int_eq_if_mod_four n
#align zmod.Οβ_nat_eq_if_mod_four ZMod.Οβ_nat_eq_if_mod_four
theorem Οβ_eq_neg_one_pow {n : β} (hn : n % 2 = 1) : Οβ n = (-1) ^ (n / 2) := by
rw [Οβ_nat_eq_if_mod_four]
simp only [hn, Nat.one_ne_zero, if_false]
conv_rhs => -- Porting note: was `nth_rw`
arg 2; rw [β Nat.div_add_mod n 4]
enter [1, 1, 1]; rw [(by norm_num : 4 = 2 * 2)]
rw [mul_assoc, add_comm, Nat.add_mul_div_left _ _ (by norm_num : 0 < 2), pow_add, pow_mul,
neg_one_sq, one_pow, mul_one]
have help : β m : β, m < 4 β m % 2 = 1 β ite (m = 1) (1 : β€) (-1) = (-1) ^ (m / 2) := by decide
exact
help (n % 4) (Nat.mod_lt n (by norm_num))
((Nat.mod_mod_of_dvd n (by decide : 2 β£ 4)).trans hn)
#align zmod.Οβ_eq_neg_one_pow ZMod.Οβ_eq_neg_one_pow
theorem Οβ_nat_one_mod_four {n : β} (hn : n % 4 = 1) : Οβ n = 1 := by
rw [Οβ_nat_mod_four, hn]
rfl
#align zmod.Οβ_nat_one_mod_four ZMod.Οβ_nat_one_mod_four
theorem Οβ_nat_three_mod_four {n : β} (hn : n % 4 = 3) : Οβ n = -1 := by
rw [Οβ_nat_mod_four, hn]
rfl
#align zmod.Οβ_nat_three_mod_four ZMod.Οβ_nat_three_mod_four
theorem Οβ_int_one_mod_four {n : β€} (hn : n % 4 = 1) : Οβ n = 1 := by
rw [Οβ_int_mod_four, hn]
rfl
#align zmod.Οβ_int_one_mod_four ZMod.Οβ_int_one_mod_four
theorem Οβ_int_three_mod_four {n : β€} (hn : n % 4 = 3) : Οβ n = -1 := by
rw [Οβ_int_mod_four, hn]
rfl
#align zmod.Οβ_int_three_mod_four ZMod.Οβ_int_three_mod_four
theorem neg_one_pow_div_two_of_one_mod_four {n : β} (hn : n % 4 = 1) : (-1 : β€) ^ (n / 2) = 1 := by
rw [β Οβ_eq_neg_one_pow (Nat.odd_of_mod_four_eq_one hn), β natCast_mod, hn]
rfl
#align zmod.neg_one_pow_div_two_of_one_mod_four ZMod.neg_one_pow_div_two_of_one_mod_four
| Mathlib/NumberTheory/LegendreSymbol/ZModChar.lean | 125 | 128 | theorem neg_one_pow_div_two_of_three_mod_four {n : β} (hn : n % 4 = 3) :
(-1 : β€) ^ (n / 2) = -1 := by |
rw [β Οβ_eq_neg_one_pow (Nat.odd_of_mod_four_eq_three hn), β natCast_mod, hn]
rfl
| 2 | 7.389056 | 1 | 1.25 | 12 | 1,332 |
import Mathlib.Data.Int.Range
import Mathlib.Data.ZMod.Basic
import Mathlib.NumberTheory.MulChar.Basic
#align_import number_theory.legendre_symbol.zmod_char from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
namespace ZMod
section QuadCharModP
@[simps]
def Οβ : MulChar (ZMod 4) β€ where
toFun := (![0, 1, 0, -1] : ZMod 4 β β€)
map_one' := rfl
map_mul' := by decide
map_nonunit' := by decide
#align zmod.Οβ ZMod.Οβ
theorem isQuadratic_Οβ : Οβ.IsQuadratic := by
intro a
-- Porting note (#11043): was `decide!`
fin_cases a
all_goals decide
#align zmod.is_quadratic_Οβ ZMod.isQuadratic_Οβ
theorem Οβ_nat_mod_four (n : β) : Οβ n = Οβ (n % 4 : β) := by rw [β ZMod.natCast_mod n 4]
#align zmod.Οβ_nat_mod_four ZMod.Οβ_nat_mod_four
theorem Οβ_int_mod_four (n : β€) : Οβ n = Οβ (n % 4 : β€) := by
rw [β ZMod.intCast_mod n 4]
norm_cast
#align zmod.Οβ_int_mod_four ZMod.Οβ_int_mod_four
theorem Οβ_int_eq_if_mod_four (n : β€) :
Οβ n = if n % 2 = 0 then 0 else if n % 4 = 1 then 1 else -1 := by
have help : β m : β€, 0 β€ m β m < 4 β Οβ m = if m % 2 = 0 then 0 else if m = 1 then 1 else -1 := by
decide
rw [β Int.emod_emod_of_dvd n (by decide : (2 : β€) β£ 4), β ZMod.intCast_mod n 4]
exact help (n % 4) (Int.emod_nonneg n (by norm_num)) (Int.emod_lt n (by norm_num))
#align zmod.Οβ_int_eq_if_mod_four ZMod.Οβ_int_eq_if_mod_four
theorem Οβ_nat_eq_if_mod_four (n : β) :
Οβ n = if n % 2 = 0 then 0 else if n % 4 = 1 then 1 else -1 :=
mod_cast Οβ_int_eq_if_mod_four n
#align zmod.Οβ_nat_eq_if_mod_four ZMod.Οβ_nat_eq_if_mod_four
theorem Οβ_eq_neg_one_pow {n : β} (hn : n % 2 = 1) : Οβ n = (-1) ^ (n / 2) := by
rw [Οβ_nat_eq_if_mod_four]
simp only [hn, Nat.one_ne_zero, if_false]
conv_rhs => -- Porting note: was `nth_rw`
arg 2; rw [β Nat.div_add_mod n 4]
enter [1, 1, 1]; rw [(by norm_num : 4 = 2 * 2)]
rw [mul_assoc, add_comm, Nat.add_mul_div_left _ _ (by norm_num : 0 < 2), pow_add, pow_mul,
neg_one_sq, one_pow, mul_one]
have help : β m : β, m < 4 β m % 2 = 1 β ite (m = 1) (1 : β€) (-1) = (-1) ^ (m / 2) := by decide
exact
help (n % 4) (Nat.mod_lt n (by norm_num))
((Nat.mod_mod_of_dvd n (by decide : 2 β£ 4)).trans hn)
#align zmod.Οβ_eq_neg_one_pow ZMod.Οβ_eq_neg_one_pow
theorem Οβ_nat_one_mod_four {n : β} (hn : n % 4 = 1) : Οβ n = 1 := by
rw [Οβ_nat_mod_four, hn]
rfl
#align zmod.Οβ_nat_one_mod_four ZMod.Οβ_nat_one_mod_four
theorem Οβ_nat_three_mod_four {n : β} (hn : n % 4 = 3) : Οβ n = -1 := by
rw [Οβ_nat_mod_four, hn]
rfl
#align zmod.Οβ_nat_three_mod_four ZMod.Οβ_nat_three_mod_four
theorem Οβ_int_one_mod_four {n : β€} (hn : n % 4 = 1) : Οβ n = 1 := by
rw [Οβ_int_mod_four, hn]
rfl
#align zmod.Οβ_int_one_mod_four ZMod.Οβ_int_one_mod_four
theorem Οβ_int_three_mod_four {n : β€} (hn : n % 4 = 3) : Οβ n = -1 := by
rw [Οβ_int_mod_four, hn]
rfl
#align zmod.Οβ_int_three_mod_four ZMod.Οβ_int_three_mod_four
theorem neg_one_pow_div_two_of_one_mod_four {n : β} (hn : n % 4 = 1) : (-1 : β€) ^ (n / 2) = 1 := by
rw [β Οβ_eq_neg_one_pow (Nat.odd_of_mod_four_eq_one hn), β natCast_mod, hn]
rfl
#align zmod.neg_one_pow_div_two_of_one_mod_four ZMod.neg_one_pow_div_two_of_one_mod_four
theorem neg_one_pow_div_two_of_three_mod_four {n : β} (hn : n % 4 = 3) :
(-1 : β€) ^ (n / 2) = -1 := by
rw [β Οβ_eq_neg_one_pow (Nat.odd_of_mod_four_eq_three hn), β natCast_mod, hn]
rfl
#align zmod.neg_one_pow_div_two_of_three_mod_four ZMod.neg_one_pow_div_two_of_three_mod_four
@[simps]
def Οβ : MulChar (ZMod 8) β€ where
toFun := (![0, 1, 0, -1, 0, -1, 0, 1] : ZMod 8 β β€)
map_one' := rfl
map_mul' := by decide
map_nonunit' := by decide
#align zmod.Οβ ZMod.Οβ
| Mathlib/NumberTheory/LegendreSymbol/ZModChar.lean | 142 | 146 | theorem isQuadratic_Οβ : Οβ.IsQuadratic := by |
intro a
-- Porting note: was `decide!`
fin_cases a
all_goals decide
| 4 | 54.59815 | 2 | 1.25 | 12 | 1,332 |
import Mathlib.Algebra.MvPolynomial.Basic
import Mathlib.Data.Finset.PiAntidiagonal
import Mathlib.LinearAlgebra.StdBasis
import Mathlib.Tactic.Linarith
#align_import ring_theory.power_series.basic from "leanprover-community/mathlib"@"2d5739b61641ee4e7e53eca5688a08f66f2e6a60"
noncomputable section
open Finset (antidiagonal mem_antidiagonal)
def MvPowerSeries (Ο : Type*) (R : Type*) :=
(Ο ββ β) β R
#align mv_power_series MvPowerSeries
namespace MvPowerSeries
open Finsupp
variable {Ο R : Type*}
instance [Inhabited R] : Inhabited (MvPowerSeries Ο R) :=
β¨fun _ => defaultβ©
instance [Zero R] : Zero (MvPowerSeries Ο R) :=
Pi.instZero
instance [AddMonoid R] : AddMonoid (MvPowerSeries Ο R) :=
Pi.addMonoid
instance [AddGroup R] : AddGroup (MvPowerSeries Ο R) :=
Pi.addGroup
instance [AddCommMonoid R] : AddCommMonoid (MvPowerSeries Ο R) :=
Pi.addCommMonoid
instance [AddCommGroup R] : AddCommGroup (MvPowerSeries Ο R) :=
Pi.addCommGroup
instance [Nontrivial R] : Nontrivial (MvPowerSeries Ο R) :=
Function.nontrivial
instance {A} [Semiring R] [AddCommMonoid A] [Module R A] : Module R (MvPowerSeries Ο A) :=
Pi.module _ _ _
instance {A S} [Semiring R] [Semiring S] [AddCommMonoid A] [Module R A] [Module S A] [SMul R S]
[IsScalarTower R S A] : IsScalarTower R S (MvPowerSeries Ο A) :=
Pi.isScalarTower
section Semiring
variable (R) [Semiring R]
def monomial (n : Ο ββ β) : R ββ[R] MvPowerSeries Ο R :=
letI := Classical.decEq Ο
LinearMap.stdBasis R (fun _ β¦ R) n
#align mv_power_series.monomial MvPowerSeries.monomial
def coeff (n : Ο ββ β) : MvPowerSeries Ο R ββ[R] R :=
LinearMap.proj n
#align mv_power_series.coeff MvPowerSeries.coeff
variable {R}
@[ext]
theorem ext {Ο Ο} (h : β n : Ο ββ β, coeff R n Ο = coeff R n Ο) : Ο = Ο :=
funext h
#align mv_power_series.ext MvPowerSeries.ext
theorem ext_iff {Ο Ο : MvPowerSeries Ο R} : Ο = Ο β β n : Ο ββ β, coeff R n Ο = coeff R n Ο :=
Function.funext_iff
#align mv_power_series.ext_iff MvPowerSeries.ext_iff
| Mathlib/RingTheory/MvPowerSeries/Basic.lean | 127 | 131 | theorem monomial_def [DecidableEq Ο] (n : Ο ββ β) :
(monomial R n) = LinearMap.stdBasis R (fun _ β¦ R) n := by |
rw [monomial]
-- unify the `Decidable` arguments
convert rfl
| 3 | 20.085537 | 1 | 1.25 | 4 | 1,333 |
import Mathlib.Algebra.MvPolynomial.Basic
import Mathlib.Data.Finset.PiAntidiagonal
import Mathlib.LinearAlgebra.StdBasis
import Mathlib.Tactic.Linarith
#align_import ring_theory.power_series.basic from "leanprover-community/mathlib"@"2d5739b61641ee4e7e53eca5688a08f66f2e6a60"
noncomputable section
open Finset (antidiagonal mem_antidiagonal)
def MvPowerSeries (Ο : Type*) (R : Type*) :=
(Ο ββ β) β R
#align mv_power_series MvPowerSeries
namespace MvPowerSeries
open Finsupp
variable {Ο R : Type*}
instance [Inhabited R] : Inhabited (MvPowerSeries Ο R) :=
β¨fun _ => defaultβ©
instance [Zero R] : Zero (MvPowerSeries Ο R) :=
Pi.instZero
instance [AddMonoid R] : AddMonoid (MvPowerSeries Ο R) :=
Pi.addMonoid
instance [AddGroup R] : AddGroup (MvPowerSeries Ο R) :=
Pi.addGroup
instance [AddCommMonoid R] : AddCommMonoid (MvPowerSeries Ο R) :=
Pi.addCommMonoid
instance [AddCommGroup R] : AddCommGroup (MvPowerSeries Ο R) :=
Pi.addCommGroup
instance [Nontrivial R] : Nontrivial (MvPowerSeries Ο R) :=
Function.nontrivial
instance {A} [Semiring R] [AddCommMonoid A] [Module R A] : Module R (MvPowerSeries Ο A) :=
Pi.module _ _ _
instance {A S} [Semiring R] [Semiring S] [AddCommMonoid A] [Module R A] [Module S A] [SMul R S]
[IsScalarTower R S A] : IsScalarTower R S (MvPowerSeries Ο A) :=
Pi.isScalarTower
section Semiring
variable (R) [Semiring R]
def monomial (n : Ο ββ β) : R ββ[R] MvPowerSeries Ο R :=
letI := Classical.decEq Ο
LinearMap.stdBasis R (fun _ β¦ R) n
#align mv_power_series.monomial MvPowerSeries.monomial
def coeff (n : Ο ββ β) : MvPowerSeries Ο R ββ[R] R :=
LinearMap.proj n
#align mv_power_series.coeff MvPowerSeries.coeff
variable {R}
@[ext]
theorem ext {Ο Ο} (h : β n : Ο ββ β, coeff R n Ο = coeff R n Ο) : Ο = Ο :=
funext h
#align mv_power_series.ext MvPowerSeries.ext
theorem ext_iff {Ο Ο : MvPowerSeries Ο R} : Ο = Ο β β n : Ο ββ β, coeff R n Ο = coeff R n Ο :=
Function.funext_iff
#align mv_power_series.ext_iff MvPowerSeries.ext_iff
theorem monomial_def [DecidableEq Ο] (n : Ο ββ β) :
(monomial R n) = LinearMap.stdBasis R (fun _ β¦ R) n := by
rw [monomial]
-- unify the `Decidable` arguments
convert rfl
#align mv_power_series.monomial_def MvPowerSeries.monomial_def
| Mathlib/RingTheory/MvPowerSeries/Basic.lean | 134 | 140 | theorem coeff_monomial [DecidableEq Ο] (m n : Ο ββ β) (a : R) :
coeff R m (monomial R n a) = if m = n then a else 0 := by |
-- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
erw [coeff, monomial_def, LinearMap.proj_apply (i := m)]
dsimp only
-- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
erw [LinearMap.stdBasis_apply, Function.update_apply, Pi.zero_apply]
| 5 | 148.413159 | 2 | 1.25 | 4 | 1,333 |
import Mathlib.Algebra.MvPolynomial.Basic
import Mathlib.Data.Finset.PiAntidiagonal
import Mathlib.LinearAlgebra.StdBasis
import Mathlib.Tactic.Linarith
#align_import ring_theory.power_series.basic from "leanprover-community/mathlib"@"2d5739b61641ee4e7e53eca5688a08f66f2e6a60"
noncomputable section
open Finset (antidiagonal mem_antidiagonal)
def MvPowerSeries (Ο : Type*) (R : Type*) :=
(Ο ββ β) β R
#align mv_power_series MvPowerSeries
namespace MvPowerSeries
open Finsupp
variable {Ο R : Type*}
instance [Inhabited R] : Inhabited (MvPowerSeries Ο R) :=
β¨fun _ => defaultβ©
instance [Zero R] : Zero (MvPowerSeries Ο R) :=
Pi.instZero
instance [AddMonoid R] : AddMonoid (MvPowerSeries Ο R) :=
Pi.addMonoid
instance [AddGroup R] : AddGroup (MvPowerSeries Ο R) :=
Pi.addGroup
instance [AddCommMonoid R] : AddCommMonoid (MvPowerSeries Ο R) :=
Pi.addCommMonoid
instance [AddCommGroup R] : AddCommGroup (MvPowerSeries Ο R) :=
Pi.addCommGroup
instance [Nontrivial R] : Nontrivial (MvPowerSeries Ο R) :=
Function.nontrivial
instance {A} [Semiring R] [AddCommMonoid A] [Module R A] : Module R (MvPowerSeries Ο A) :=
Pi.module _ _ _
instance {A S} [Semiring R] [Semiring S] [AddCommMonoid A] [Module R A] [Module S A] [SMul R S]
[IsScalarTower R S A] : IsScalarTower R S (MvPowerSeries Ο A) :=
Pi.isScalarTower
section Semiring
variable (R) [Semiring R]
def monomial (n : Ο ββ β) : R ββ[R] MvPowerSeries Ο R :=
letI := Classical.decEq Ο
LinearMap.stdBasis R (fun _ β¦ R) n
#align mv_power_series.monomial MvPowerSeries.monomial
def coeff (n : Ο ββ β) : MvPowerSeries Ο R ββ[R] R :=
LinearMap.proj n
#align mv_power_series.coeff MvPowerSeries.coeff
variable {R}
@[ext]
theorem ext {Ο Ο} (h : β n : Ο ββ β, coeff R n Ο = coeff R n Ο) : Ο = Ο :=
funext h
#align mv_power_series.ext MvPowerSeries.ext
theorem ext_iff {Ο Ο : MvPowerSeries Ο R} : Ο = Ο β β n : Ο ββ β, coeff R n Ο = coeff R n Ο :=
Function.funext_iff
#align mv_power_series.ext_iff MvPowerSeries.ext_iff
theorem monomial_def [DecidableEq Ο] (n : Ο ββ β) :
(monomial R n) = LinearMap.stdBasis R (fun _ β¦ R) n := by
rw [monomial]
-- unify the `Decidable` arguments
convert rfl
#align mv_power_series.monomial_def MvPowerSeries.monomial_def
theorem coeff_monomial [DecidableEq Ο] (m n : Ο ββ β) (a : R) :
coeff R m (monomial R n a) = if m = n then a else 0 := by
-- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
erw [coeff, monomial_def, LinearMap.proj_apply (i := m)]
dsimp only
-- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
erw [LinearMap.stdBasis_apply, Function.update_apply, Pi.zero_apply]
#align mv_power_series.coeff_monomial MvPowerSeries.coeff_monomial
@[simp]
| Mathlib/RingTheory/MvPowerSeries/Basic.lean | 144 | 147 | theorem coeff_monomial_same (n : Ο ββ β) (a : R) : coeff R n (monomial R n a) = a := by |
classical
rw [monomial_def]
exact LinearMap.stdBasis_same R (fun _ β¦ R) n a
| 3 | 20.085537 | 1 | 1.25 | 4 | 1,333 |
import Mathlib.Algebra.MvPolynomial.Basic
import Mathlib.Data.Finset.PiAntidiagonal
import Mathlib.LinearAlgebra.StdBasis
import Mathlib.Tactic.Linarith
#align_import ring_theory.power_series.basic from "leanprover-community/mathlib"@"2d5739b61641ee4e7e53eca5688a08f66f2e6a60"
noncomputable section
open Finset (antidiagonal mem_antidiagonal)
def MvPowerSeries (Ο : Type*) (R : Type*) :=
(Ο ββ β) β R
#align mv_power_series MvPowerSeries
namespace MvPowerSeries
open Finsupp
variable {Ο R : Type*}
instance [Inhabited R] : Inhabited (MvPowerSeries Ο R) :=
β¨fun _ => defaultβ©
instance [Zero R] : Zero (MvPowerSeries Ο R) :=
Pi.instZero
instance [AddMonoid R] : AddMonoid (MvPowerSeries Ο R) :=
Pi.addMonoid
instance [AddGroup R] : AddGroup (MvPowerSeries Ο R) :=
Pi.addGroup
instance [AddCommMonoid R] : AddCommMonoid (MvPowerSeries Ο R) :=
Pi.addCommMonoid
instance [AddCommGroup R] : AddCommGroup (MvPowerSeries Ο R) :=
Pi.addCommGroup
instance [Nontrivial R] : Nontrivial (MvPowerSeries Ο R) :=
Function.nontrivial
instance {A} [Semiring R] [AddCommMonoid A] [Module R A] : Module R (MvPowerSeries Ο A) :=
Pi.module _ _ _
instance {A S} [Semiring R] [Semiring S] [AddCommMonoid A] [Module R A] [Module S A] [SMul R S]
[IsScalarTower R S A] : IsScalarTower R S (MvPowerSeries Ο A) :=
Pi.isScalarTower
section Semiring
variable (R) [Semiring R]
def monomial (n : Ο ββ β) : R ββ[R] MvPowerSeries Ο R :=
letI := Classical.decEq Ο
LinearMap.stdBasis R (fun _ β¦ R) n
#align mv_power_series.monomial MvPowerSeries.monomial
def coeff (n : Ο ββ β) : MvPowerSeries Ο R ββ[R] R :=
LinearMap.proj n
#align mv_power_series.coeff MvPowerSeries.coeff
variable {R}
@[ext]
theorem ext {Ο Ο} (h : β n : Ο ββ β, coeff R n Ο = coeff R n Ο) : Ο = Ο :=
funext h
#align mv_power_series.ext MvPowerSeries.ext
theorem ext_iff {Ο Ο : MvPowerSeries Ο R} : Ο = Ο β β n : Ο ββ β, coeff R n Ο = coeff R n Ο :=
Function.funext_iff
#align mv_power_series.ext_iff MvPowerSeries.ext_iff
theorem monomial_def [DecidableEq Ο] (n : Ο ββ β) :
(monomial R n) = LinearMap.stdBasis R (fun _ β¦ R) n := by
rw [monomial]
-- unify the `Decidable` arguments
convert rfl
#align mv_power_series.monomial_def MvPowerSeries.monomial_def
theorem coeff_monomial [DecidableEq Ο] (m n : Ο ββ β) (a : R) :
coeff R m (monomial R n a) = if m = n then a else 0 := by
-- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
erw [coeff, monomial_def, LinearMap.proj_apply (i := m)]
dsimp only
-- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
erw [LinearMap.stdBasis_apply, Function.update_apply, Pi.zero_apply]
#align mv_power_series.coeff_monomial MvPowerSeries.coeff_monomial
@[simp]
theorem coeff_monomial_same (n : Ο ββ β) (a : R) : coeff R n (monomial R n a) = a := by
classical
rw [monomial_def]
exact LinearMap.stdBasis_same R (fun _ β¦ R) n a
#align mv_power_series.coeff_monomial_same MvPowerSeries.coeff_monomial_same
| Mathlib/RingTheory/MvPowerSeries/Basic.lean | 150 | 153 | theorem coeff_monomial_ne {m n : Ο ββ β} (h : m β n) (a : R) : coeff R m (monomial R n a) = 0 := by |
classical
rw [monomial_def]
exact LinearMap.stdBasis_ne R (fun _ β¦ R) _ _ h a
| 3 | 20.085537 | 1 | 1.25 | 4 | 1,333 |
import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace
#align_import linear_algebra.affine_space.restrict from "leanprover-community/mathlib"@"09258fb7f75d741b7eda9fa18d5c869e2135d9f1"
variable {k Vβ Pβ Vβ Pβ : Type*} [Ring k] [AddCommGroup Vβ] [AddCommGroup Vβ] [Module k Vβ]
[Module k Vβ] [AddTorsor Vβ Pβ] [AddTorsor Vβ Pβ]
-- not an instance because it loops with `Nonempty`
| Mathlib/LinearAlgebra/AffineSpace/Restrict.lean | 33 | 36 | theorem AffineSubspace.nonempty_map {E : AffineSubspace k Pβ} [Ene : Nonempty E] {Ο : Pβ βα΅[k] Pβ} :
Nonempty (E.map Ο) := by |
obtain β¨x, hxβ© := id Ene
exact β¨β¨Ο x, AffineSubspace.mem_map.mpr β¨x, hx, rflβ©β©β©
| 2 | 7.389056 | 1 | 1.25 | 4 | 1,334 |
import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace
#align_import linear_algebra.affine_space.restrict from "leanprover-community/mathlib"@"09258fb7f75d741b7eda9fa18d5c869e2135d9f1"
variable {k Vβ Pβ Vβ Pβ : Type*} [Ring k] [AddCommGroup Vβ] [AddCommGroup Vβ] [Module k Vβ]
[Module k Vβ] [AddTorsor Vβ Pβ] [AddTorsor Vβ Pβ]
-- not an instance because it loops with `Nonempty`
theorem AffineSubspace.nonempty_map {E : AffineSubspace k Pβ} [Ene : Nonempty E] {Ο : Pβ βα΅[k] Pβ} :
Nonempty (E.map Ο) := by
obtain β¨x, hxβ© := id Ene
exact β¨β¨Ο x, AffineSubspace.mem_map.mpr β¨x, hx, rflβ©β©β©
#align affine_subspace.nonempty_map AffineSubspace.nonempty_map
-- Porting note: removed "local nolint fails_quickly" attribute
attribute [local instance] AffineSubspace.nonempty_map AffineSubspace.toAddTorsor
def AffineMap.restrict (Ο : Pβ βα΅[k] Pβ) {E : AffineSubspace k Pβ} {F : AffineSubspace k Pβ}
[Nonempty E] [Nonempty F] (hEF : E.map Ο β€ F) : E βα΅[k] F := by
refine β¨?_, ?_, ?_β©
Β· exact fun x => β¨Ο x, hEF <| AffineSubspace.mem_map.mpr β¨x, x.property, rflβ©β©
Β· refine Ο.linear.restrict (?_ : E.direction β€ F.direction.comap Ο.linear)
rw [β Submodule.map_le_iff_le_comap, β AffineSubspace.map_direction]
exact AffineSubspace.direction_le hEF
Β· intro p v
simp only [Subtype.ext_iff, Subtype.coe_mk, AffineSubspace.coe_vadd]
apply AffineMap.map_vadd
#align affine_map.restrict AffineMap.restrict
theorem AffineMap.restrict.coe_apply (Ο : Pβ βα΅[k] Pβ) {E : AffineSubspace k Pβ}
{F : AffineSubspace k Pβ} [Nonempty E] [Nonempty F] (hEF : E.map Ο β€ F) (x : E) :
β(Ο.restrict hEF x) = Ο x :=
rfl
#align affine_map.restrict.coe_apply AffineMap.restrict.coe_apply
| Mathlib/LinearAlgebra/AffineSpace/Restrict.lean | 61 | 64 | theorem AffineMap.restrict.linear_aux {Ο : Pβ βα΅[k] Pβ} {E : AffineSubspace k Pβ}
{F : AffineSubspace k Pβ} (hEF : E.map Ο β€ F) : E.direction β€ F.direction.comap Ο.linear := by |
rw [β Submodule.map_le_iff_le_comap, β AffineSubspace.map_direction]
exact AffineSubspace.direction_le hEF
| 2 | 7.389056 | 1 | 1.25 | 4 | 1,334 |
import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace
#align_import linear_algebra.affine_space.restrict from "leanprover-community/mathlib"@"09258fb7f75d741b7eda9fa18d5c869e2135d9f1"
variable {k Vβ Pβ Vβ Pβ : Type*} [Ring k] [AddCommGroup Vβ] [AddCommGroup Vβ] [Module k Vβ]
[Module k Vβ] [AddTorsor Vβ Pβ] [AddTorsor Vβ Pβ]
-- not an instance because it loops with `Nonempty`
theorem AffineSubspace.nonempty_map {E : AffineSubspace k Pβ} [Ene : Nonempty E] {Ο : Pβ βα΅[k] Pβ} :
Nonempty (E.map Ο) := by
obtain β¨x, hxβ© := id Ene
exact β¨β¨Ο x, AffineSubspace.mem_map.mpr β¨x, hx, rflβ©β©β©
#align affine_subspace.nonempty_map AffineSubspace.nonempty_map
-- Porting note: removed "local nolint fails_quickly" attribute
attribute [local instance] AffineSubspace.nonempty_map AffineSubspace.toAddTorsor
def AffineMap.restrict (Ο : Pβ βα΅[k] Pβ) {E : AffineSubspace k Pβ} {F : AffineSubspace k Pβ}
[Nonempty E] [Nonempty F] (hEF : E.map Ο β€ F) : E βα΅[k] F := by
refine β¨?_, ?_, ?_β©
Β· exact fun x => β¨Ο x, hEF <| AffineSubspace.mem_map.mpr β¨x, x.property, rflβ©β©
Β· refine Ο.linear.restrict (?_ : E.direction β€ F.direction.comap Ο.linear)
rw [β Submodule.map_le_iff_le_comap, β AffineSubspace.map_direction]
exact AffineSubspace.direction_le hEF
Β· intro p v
simp only [Subtype.ext_iff, Subtype.coe_mk, AffineSubspace.coe_vadd]
apply AffineMap.map_vadd
#align affine_map.restrict AffineMap.restrict
theorem AffineMap.restrict.coe_apply (Ο : Pβ βα΅[k] Pβ) {E : AffineSubspace k Pβ}
{F : AffineSubspace k Pβ} [Nonempty E] [Nonempty F] (hEF : E.map Ο β€ F) (x : E) :
β(Ο.restrict hEF x) = Ο x :=
rfl
#align affine_map.restrict.coe_apply AffineMap.restrict.coe_apply
theorem AffineMap.restrict.linear_aux {Ο : Pβ βα΅[k] Pβ} {E : AffineSubspace k Pβ}
{F : AffineSubspace k Pβ} (hEF : E.map Ο β€ F) : E.direction β€ F.direction.comap Ο.linear := by
rw [β Submodule.map_le_iff_le_comap, β AffineSubspace.map_direction]
exact AffineSubspace.direction_le hEF
#align affine_map.restrict.linear_aux AffineMap.restrict.linear_aux
theorem AffineMap.restrict.linear (Ο : Pβ βα΅[k] Pβ) {E : AffineSubspace k Pβ}
{F : AffineSubspace k Pβ} [Nonempty E] [Nonempty F] (hEF : E.map Ο β€ F) :
(Ο.restrict hEF).linear = Ο.linear.restrict (AffineMap.restrict.linear_aux hEF) :=
rfl
#align affine_map.restrict.linear AffineMap.restrict.linear
| Mathlib/LinearAlgebra/AffineSpace/Restrict.lean | 73 | 78 | theorem AffineMap.restrict.injective {Ο : Pβ βα΅[k] Pβ} (hΟ : Function.Injective Ο)
{E : AffineSubspace k Pβ} {F : AffineSubspace k Pβ} [Nonempty E] [Nonempty F]
(hEF : E.map Ο β€ F) : Function.Injective (AffineMap.restrict Ο hEF) := by |
intro x y h
simp only [Subtype.ext_iff, Subtype.coe_mk, AffineMap.restrict.coe_apply] at h β’
exact hΟ h
| 3 | 20.085537 | 1 | 1.25 | 4 | 1,334 |
import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace
#align_import linear_algebra.affine_space.restrict from "leanprover-community/mathlib"@"09258fb7f75d741b7eda9fa18d5c869e2135d9f1"
variable {k Vβ Pβ Vβ Pβ : Type*} [Ring k] [AddCommGroup Vβ] [AddCommGroup Vβ] [Module k Vβ]
[Module k Vβ] [AddTorsor Vβ Pβ] [AddTorsor Vβ Pβ]
-- not an instance because it loops with `Nonempty`
theorem AffineSubspace.nonempty_map {E : AffineSubspace k Pβ} [Ene : Nonempty E] {Ο : Pβ βα΅[k] Pβ} :
Nonempty (E.map Ο) := by
obtain β¨x, hxβ© := id Ene
exact β¨β¨Ο x, AffineSubspace.mem_map.mpr β¨x, hx, rflβ©β©β©
#align affine_subspace.nonempty_map AffineSubspace.nonempty_map
-- Porting note: removed "local nolint fails_quickly" attribute
attribute [local instance] AffineSubspace.nonempty_map AffineSubspace.toAddTorsor
def AffineMap.restrict (Ο : Pβ βα΅[k] Pβ) {E : AffineSubspace k Pβ} {F : AffineSubspace k Pβ}
[Nonempty E] [Nonempty F] (hEF : E.map Ο β€ F) : E βα΅[k] F := by
refine β¨?_, ?_, ?_β©
Β· exact fun x => β¨Ο x, hEF <| AffineSubspace.mem_map.mpr β¨x, x.property, rflβ©β©
Β· refine Ο.linear.restrict (?_ : E.direction β€ F.direction.comap Ο.linear)
rw [β Submodule.map_le_iff_le_comap, β AffineSubspace.map_direction]
exact AffineSubspace.direction_le hEF
Β· intro p v
simp only [Subtype.ext_iff, Subtype.coe_mk, AffineSubspace.coe_vadd]
apply AffineMap.map_vadd
#align affine_map.restrict AffineMap.restrict
theorem AffineMap.restrict.coe_apply (Ο : Pβ βα΅[k] Pβ) {E : AffineSubspace k Pβ}
{F : AffineSubspace k Pβ} [Nonempty E] [Nonempty F] (hEF : E.map Ο β€ F) (x : E) :
β(Ο.restrict hEF x) = Ο x :=
rfl
#align affine_map.restrict.coe_apply AffineMap.restrict.coe_apply
theorem AffineMap.restrict.linear_aux {Ο : Pβ βα΅[k] Pβ} {E : AffineSubspace k Pβ}
{F : AffineSubspace k Pβ} (hEF : E.map Ο β€ F) : E.direction β€ F.direction.comap Ο.linear := by
rw [β Submodule.map_le_iff_le_comap, β AffineSubspace.map_direction]
exact AffineSubspace.direction_le hEF
#align affine_map.restrict.linear_aux AffineMap.restrict.linear_aux
theorem AffineMap.restrict.linear (Ο : Pβ βα΅[k] Pβ) {E : AffineSubspace k Pβ}
{F : AffineSubspace k Pβ} [Nonempty E] [Nonempty F] (hEF : E.map Ο β€ F) :
(Ο.restrict hEF).linear = Ο.linear.restrict (AffineMap.restrict.linear_aux hEF) :=
rfl
#align affine_map.restrict.linear AffineMap.restrict.linear
theorem AffineMap.restrict.injective {Ο : Pβ βα΅[k] Pβ} (hΟ : Function.Injective Ο)
{E : AffineSubspace k Pβ} {F : AffineSubspace k Pβ} [Nonempty E] [Nonempty F]
(hEF : E.map Ο β€ F) : Function.Injective (AffineMap.restrict Ο hEF) := by
intro x y h
simp only [Subtype.ext_iff, Subtype.coe_mk, AffineMap.restrict.coe_apply] at h β’
exact hΟ h
#align affine_map.restrict.injective AffineMap.restrict.injective
| Mathlib/LinearAlgebra/AffineSpace/Restrict.lean | 81 | 87 | theorem AffineMap.restrict.surjective (Ο : Pβ βα΅[k] Pβ) {E : AffineSubspace k Pβ}
{F : AffineSubspace k Pβ} [Nonempty E] [Nonempty F] (h : E.map Ο = F) :
Function.Surjective (AffineMap.restrict Ο (le_of_eq h)) := by |
rintro β¨x, hx : x β Fβ©
rw [β h, AffineSubspace.mem_map] at hx
obtain β¨y, hy, rflβ© := hx
exact β¨β¨y, hyβ©, rflβ©
| 4 | 54.59815 | 2 | 1.25 | 4 | 1,334 |
import Mathlib.Algebra.BigOperators.Group.Multiset
import Mathlib.Data.PNat.Prime
import Mathlib.Data.Nat.Factors
import Mathlib.Data.Multiset.Sort
#align_import data.pnat.factors from "leanprover-community/mathlib"@"e3d9ab8faa9dea8f78155c6c27d62a621f4c152d"
-- Porting note: `deriving` contained Inhabited, CanonicallyOrderedAddCommMonoid, DistribLattice,
-- SemilatticeSup, OrderBot, Sub, OrderedSub
def PrimeMultiset :=
Multiset Nat.Primes deriving Inhabited, CanonicallyOrderedAddCommMonoid, DistribLattice,
SemilatticeSup, Sub
#align prime_multiset PrimeMultiset
instance : OrderBot PrimeMultiset where
bot_le := by simp only [bot_le, forall_const]
instance : OrderedSub PrimeMultiset where
tsub_le_iff_right _ _ _ := Multiset.sub_le_iff_le_add
namespace PrimeMultiset
-- `@[derive]` doesn't work for `meta` instances
unsafe instance : Repr PrimeMultiset := by delta PrimeMultiset; infer_instance
def ofPrime (p : Nat.Primes) : PrimeMultiset :=
({p} : Multiset Nat.Primes)
#align prime_multiset.of_prime PrimeMultiset.ofPrime
theorem card_ofPrime (p : Nat.Primes) : Multiset.card (ofPrime p) = 1 :=
rfl
#align prime_multiset.card_of_prime PrimeMultiset.card_ofPrime
def toNatMultiset : PrimeMultiset β Multiset β := fun v => v.map Coe.coe
#align prime_multiset.to_nat_multiset PrimeMultiset.toNatMultiset
instance coeNat : Coe PrimeMultiset (Multiset β) :=
β¨toNatMultisetβ©
#align prime_multiset.coe_nat PrimeMultiset.coeNat
def coeNatMonoidHom : PrimeMultiset β+ Multiset β :=
{ Multiset.mapAddMonoidHom Coe.coe with toFun := Coe.coe }
#align prime_multiset.coe_nat_monoid_hom PrimeMultiset.coeNatMonoidHom
@[simp]
theorem coe_coeNatMonoidHom : (coeNatMonoidHom : PrimeMultiset β Multiset β) = Coe.coe :=
rfl
#align prime_multiset.coe_coe_nat_monoid_hom PrimeMultiset.coe_coeNatMonoidHom
theorem coeNat_injective : Function.Injective (Coe.coe : PrimeMultiset β Multiset β) :=
Multiset.map_injective Nat.Primes.coe_nat_injective
#align prime_multiset.coe_nat_injective PrimeMultiset.coeNat_injective
theorem coeNat_ofPrime (p : Nat.Primes) : (ofPrime p : Multiset β) = {(p : β)} :=
rfl
#align prime_multiset.coe_nat_of_prime PrimeMultiset.coeNat_ofPrime
| Mathlib/Data/PNat/Factors.lean | 89 | 91 | theorem coeNat_prime (v : PrimeMultiset) (p : β) (h : p β (v : Multiset β)) : p.Prime := by |
rcases Multiset.mem_map.mp h with β¨β¨_, hp'β©, β¨_, h_eqβ©β©
exact h_eq βΈ hp'
| 2 | 7.389056 | 1 | 1.25 | 4 | 1,335 |
import Mathlib.Algebra.BigOperators.Group.Multiset
import Mathlib.Data.PNat.Prime
import Mathlib.Data.Nat.Factors
import Mathlib.Data.Multiset.Sort
#align_import data.pnat.factors from "leanprover-community/mathlib"@"e3d9ab8faa9dea8f78155c6c27d62a621f4c152d"
-- Porting note: `deriving` contained Inhabited, CanonicallyOrderedAddCommMonoid, DistribLattice,
-- SemilatticeSup, OrderBot, Sub, OrderedSub
def PrimeMultiset :=
Multiset Nat.Primes deriving Inhabited, CanonicallyOrderedAddCommMonoid, DistribLattice,
SemilatticeSup, Sub
#align prime_multiset PrimeMultiset
instance : OrderBot PrimeMultiset where
bot_le := by simp only [bot_le, forall_const]
instance : OrderedSub PrimeMultiset where
tsub_le_iff_right _ _ _ := Multiset.sub_le_iff_le_add
namespace PrimeMultiset
-- `@[derive]` doesn't work for `meta` instances
unsafe instance : Repr PrimeMultiset := by delta PrimeMultiset; infer_instance
def ofPrime (p : Nat.Primes) : PrimeMultiset :=
({p} : Multiset Nat.Primes)
#align prime_multiset.of_prime PrimeMultiset.ofPrime
theorem card_ofPrime (p : Nat.Primes) : Multiset.card (ofPrime p) = 1 :=
rfl
#align prime_multiset.card_of_prime PrimeMultiset.card_ofPrime
def toNatMultiset : PrimeMultiset β Multiset β := fun v => v.map Coe.coe
#align prime_multiset.to_nat_multiset PrimeMultiset.toNatMultiset
instance coeNat : Coe PrimeMultiset (Multiset β) :=
β¨toNatMultisetβ©
#align prime_multiset.coe_nat PrimeMultiset.coeNat
def coeNatMonoidHom : PrimeMultiset β+ Multiset β :=
{ Multiset.mapAddMonoidHom Coe.coe with toFun := Coe.coe }
#align prime_multiset.coe_nat_monoid_hom PrimeMultiset.coeNatMonoidHom
@[simp]
theorem coe_coeNatMonoidHom : (coeNatMonoidHom : PrimeMultiset β Multiset β) = Coe.coe :=
rfl
#align prime_multiset.coe_coe_nat_monoid_hom PrimeMultiset.coe_coeNatMonoidHom
theorem coeNat_injective : Function.Injective (Coe.coe : PrimeMultiset β Multiset β) :=
Multiset.map_injective Nat.Primes.coe_nat_injective
#align prime_multiset.coe_nat_injective PrimeMultiset.coeNat_injective
theorem coeNat_ofPrime (p : Nat.Primes) : (ofPrime p : Multiset β) = {(p : β)} :=
rfl
#align prime_multiset.coe_nat_of_prime PrimeMultiset.coeNat_ofPrime
theorem coeNat_prime (v : PrimeMultiset) (p : β) (h : p β (v : Multiset β)) : p.Prime := by
rcases Multiset.mem_map.mp h with β¨β¨_, hp'β©, β¨_, h_eqβ©β©
exact h_eq βΈ hp'
#align prime_multiset.coe_nat_prime PrimeMultiset.coeNat_prime
def toPNatMultiset : PrimeMultiset β Multiset β+ := fun v => v.map Coe.coe
#align prime_multiset.to_pnat_multiset PrimeMultiset.toPNatMultiset
instance coePNat : Coe PrimeMultiset (Multiset β+) :=
β¨toPNatMultisetβ©
#align prime_multiset.coe_pnat PrimeMultiset.coePNat
def coePNatMonoidHom : PrimeMultiset β+ Multiset β+ :=
{ Multiset.mapAddMonoidHom Coe.coe with toFun := Coe.coe }
#align prime_multiset.coe_pnat_monoid_hom PrimeMultiset.coePNatMonoidHom
@[simp]
theorem coe_coePNatMonoidHom : (coePNatMonoidHom : PrimeMultiset β Multiset β+) = Coe.coe :=
rfl
#align prime_multiset.coe_coe_pnat_monoid_hom PrimeMultiset.coe_coePNatMonoidHom
theorem coePNat_injective : Function.Injective (Coe.coe : PrimeMultiset β Multiset β+) :=
Multiset.map_injective Nat.Primes.coe_pnat_injective
#align prime_multiset.coe_pnat_injective PrimeMultiset.coePNat_injective
theorem coePNat_ofPrime (p : Nat.Primes) : (ofPrime p : Multiset β+) = {(p : β+)} :=
rfl
#align prime_multiset.coe_pnat_of_prime PrimeMultiset.coePNat_ofPrime
| Mathlib/Data/PNat/Factors.lean | 121 | 123 | theorem coePNat_prime (v : PrimeMultiset) (p : β+) (h : p β (v : Multiset β+)) : p.Prime := by |
rcases Multiset.mem_map.mp h with β¨β¨_, hp'β©, β¨_, h_eqβ©β©
exact h_eq βΈ hp'
| 2 | 7.389056 | 1 | 1.25 | 4 | 1,335 |
import Mathlib.Algebra.BigOperators.Group.Multiset
import Mathlib.Data.PNat.Prime
import Mathlib.Data.Nat.Factors
import Mathlib.Data.Multiset.Sort
#align_import data.pnat.factors from "leanprover-community/mathlib"@"e3d9ab8faa9dea8f78155c6c27d62a621f4c152d"
-- Porting note: `deriving` contained Inhabited, CanonicallyOrderedAddCommMonoid, DistribLattice,
-- SemilatticeSup, OrderBot, Sub, OrderedSub
def PrimeMultiset :=
Multiset Nat.Primes deriving Inhabited, CanonicallyOrderedAddCommMonoid, DistribLattice,
SemilatticeSup, Sub
#align prime_multiset PrimeMultiset
instance : OrderBot PrimeMultiset where
bot_le := by simp only [bot_le, forall_const]
instance : OrderedSub PrimeMultiset where
tsub_le_iff_right _ _ _ := Multiset.sub_le_iff_le_add
namespace PrimeMultiset
-- `@[derive]` doesn't work for `meta` instances
unsafe instance : Repr PrimeMultiset := by delta PrimeMultiset; infer_instance
def ofPrime (p : Nat.Primes) : PrimeMultiset :=
({p} : Multiset Nat.Primes)
#align prime_multiset.of_prime PrimeMultiset.ofPrime
theorem card_ofPrime (p : Nat.Primes) : Multiset.card (ofPrime p) = 1 :=
rfl
#align prime_multiset.card_of_prime PrimeMultiset.card_ofPrime
def toNatMultiset : PrimeMultiset β Multiset β := fun v => v.map Coe.coe
#align prime_multiset.to_nat_multiset PrimeMultiset.toNatMultiset
instance coeNat : Coe PrimeMultiset (Multiset β) :=
β¨toNatMultisetβ©
#align prime_multiset.coe_nat PrimeMultiset.coeNat
def coeNatMonoidHom : PrimeMultiset β+ Multiset β :=
{ Multiset.mapAddMonoidHom Coe.coe with toFun := Coe.coe }
#align prime_multiset.coe_nat_monoid_hom PrimeMultiset.coeNatMonoidHom
@[simp]
theorem coe_coeNatMonoidHom : (coeNatMonoidHom : PrimeMultiset β Multiset β) = Coe.coe :=
rfl
#align prime_multiset.coe_coe_nat_monoid_hom PrimeMultiset.coe_coeNatMonoidHom
theorem coeNat_injective : Function.Injective (Coe.coe : PrimeMultiset β Multiset β) :=
Multiset.map_injective Nat.Primes.coe_nat_injective
#align prime_multiset.coe_nat_injective PrimeMultiset.coeNat_injective
theorem coeNat_ofPrime (p : Nat.Primes) : (ofPrime p : Multiset β) = {(p : β)} :=
rfl
#align prime_multiset.coe_nat_of_prime PrimeMultiset.coeNat_ofPrime
theorem coeNat_prime (v : PrimeMultiset) (p : β) (h : p β (v : Multiset β)) : p.Prime := by
rcases Multiset.mem_map.mp h with β¨β¨_, hp'β©, β¨_, h_eqβ©β©
exact h_eq βΈ hp'
#align prime_multiset.coe_nat_prime PrimeMultiset.coeNat_prime
def toPNatMultiset : PrimeMultiset β Multiset β+ := fun v => v.map Coe.coe
#align prime_multiset.to_pnat_multiset PrimeMultiset.toPNatMultiset
instance coePNat : Coe PrimeMultiset (Multiset β+) :=
β¨toPNatMultisetβ©
#align prime_multiset.coe_pnat PrimeMultiset.coePNat
def coePNatMonoidHom : PrimeMultiset β+ Multiset β+ :=
{ Multiset.mapAddMonoidHom Coe.coe with toFun := Coe.coe }
#align prime_multiset.coe_pnat_monoid_hom PrimeMultiset.coePNatMonoidHom
@[simp]
theorem coe_coePNatMonoidHom : (coePNatMonoidHom : PrimeMultiset β Multiset β+) = Coe.coe :=
rfl
#align prime_multiset.coe_coe_pnat_monoid_hom PrimeMultiset.coe_coePNatMonoidHom
theorem coePNat_injective : Function.Injective (Coe.coe : PrimeMultiset β Multiset β+) :=
Multiset.map_injective Nat.Primes.coe_pnat_injective
#align prime_multiset.coe_pnat_injective PrimeMultiset.coePNat_injective
theorem coePNat_ofPrime (p : Nat.Primes) : (ofPrime p : Multiset β+) = {(p : β+)} :=
rfl
#align prime_multiset.coe_pnat_of_prime PrimeMultiset.coePNat_ofPrime
theorem coePNat_prime (v : PrimeMultiset) (p : β+) (h : p β (v : Multiset β+)) : p.Prime := by
rcases Multiset.mem_map.mp h with β¨β¨_, hp'β©, β¨_, h_eqβ©β©
exact h_eq βΈ hp'
#align prime_multiset.coe_pnat_prime PrimeMultiset.coePNat_prime
instance coeMultisetPNatNat : Coe (Multiset β+) (Multiset β) :=
β¨fun v => v.map Coe.coeβ©
#align prime_multiset.coe_multiset_pnat_nat PrimeMultiset.coeMultisetPNatNat
| Mathlib/Data/PNat/Factors.lean | 130 | 133 | theorem coePNat_nat (v : PrimeMultiset) : ((v : Multiset β+) : Multiset β) = (v : Multiset β) := by |
change (v.map (Coe.coe : Nat.Primes β β+)).map Subtype.val = v.map Subtype.val
rw [Multiset.map_map]
congr
| 3 | 20.085537 | 1 | 1.25 | 4 | 1,335 |
import Mathlib.Algebra.BigOperators.Group.Multiset
import Mathlib.Data.PNat.Prime
import Mathlib.Data.Nat.Factors
import Mathlib.Data.Multiset.Sort
#align_import data.pnat.factors from "leanprover-community/mathlib"@"e3d9ab8faa9dea8f78155c6c27d62a621f4c152d"
-- Porting note: `deriving` contained Inhabited, CanonicallyOrderedAddCommMonoid, DistribLattice,
-- SemilatticeSup, OrderBot, Sub, OrderedSub
def PrimeMultiset :=
Multiset Nat.Primes deriving Inhabited, CanonicallyOrderedAddCommMonoid, DistribLattice,
SemilatticeSup, Sub
#align prime_multiset PrimeMultiset
instance : OrderBot PrimeMultiset where
bot_le := by simp only [bot_le, forall_const]
instance : OrderedSub PrimeMultiset where
tsub_le_iff_right _ _ _ := Multiset.sub_le_iff_le_add
namespace PrimeMultiset
-- `@[derive]` doesn't work for `meta` instances
unsafe instance : Repr PrimeMultiset := by delta PrimeMultiset; infer_instance
def ofPrime (p : Nat.Primes) : PrimeMultiset :=
({p} : Multiset Nat.Primes)
#align prime_multiset.of_prime PrimeMultiset.ofPrime
theorem card_ofPrime (p : Nat.Primes) : Multiset.card (ofPrime p) = 1 :=
rfl
#align prime_multiset.card_of_prime PrimeMultiset.card_ofPrime
def toNatMultiset : PrimeMultiset β Multiset β := fun v => v.map Coe.coe
#align prime_multiset.to_nat_multiset PrimeMultiset.toNatMultiset
instance coeNat : Coe PrimeMultiset (Multiset β) :=
β¨toNatMultisetβ©
#align prime_multiset.coe_nat PrimeMultiset.coeNat
def coeNatMonoidHom : PrimeMultiset β+ Multiset β :=
{ Multiset.mapAddMonoidHom Coe.coe with toFun := Coe.coe }
#align prime_multiset.coe_nat_monoid_hom PrimeMultiset.coeNatMonoidHom
@[simp]
theorem coe_coeNatMonoidHom : (coeNatMonoidHom : PrimeMultiset β Multiset β) = Coe.coe :=
rfl
#align prime_multiset.coe_coe_nat_monoid_hom PrimeMultiset.coe_coeNatMonoidHom
theorem coeNat_injective : Function.Injective (Coe.coe : PrimeMultiset β Multiset β) :=
Multiset.map_injective Nat.Primes.coe_nat_injective
#align prime_multiset.coe_nat_injective PrimeMultiset.coeNat_injective
theorem coeNat_ofPrime (p : Nat.Primes) : (ofPrime p : Multiset β) = {(p : β)} :=
rfl
#align prime_multiset.coe_nat_of_prime PrimeMultiset.coeNat_ofPrime
theorem coeNat_prime (v : PrimeMultiset) (p : β) (h : p β (v : Multiset β)) : p.Prime := by
rcases Multiset.mem_map.mp h with β¨β¨_, hp'β©, β¨_, h_eqβ©β©
exact h_eq βΈ hp'
#align prime_multiset.coe_nat_prime PrimeMultiset.coeNat_prime
def toPNatMultiset : PrimeMultiset β Multiset β+ := fun v => v.map Coe.coe
#align prime_multiset.to_pnat_multiset PrimeMultiset.toPNatMultiset
instance coePNat : Coe PrimeMultiset (Multiset β+) :=
β¨toPNatMultisetβ©
#align prime_multiset.coe_pnat PrimeMultiset.coePNat
def coePNatMonoidHom : PrimeMultiset β+ Multiset β+ :=
{ Multiset.mapAddMonoidHom Coe.coe with toFun := Coe.coe }
#align prime_multiset.coe_pnat_monoid_hom PrimeMultiset.coePNatMonoidHom
@[simp]
theorem coe_coePNatMonoidHom : (coePNatMonoidHom : PrimeMultiset β Multiset β+) = Coe.coe :=
rfl
#align prime_multiset.coe_coe_pnat_monoid_hom PrimeMultiset.coe_coePNatMonoidHom
theorem coePNat_injective : Function.Injective (Coe.coe : PrimeMultiset β Multiset β+) :=
Multiset.map_injective Nat.Primes.coe_pnat_injective
#align prime_multiset.coe_pnat_injective PrimeMultiset.coePNat_injective
theorem coePNat_ofPrime (p : Nat.Primes) : (ofPrime p : Multiset β+) = {(p : β+)} :=
rfl
#align prime_multiset.coe_pnat_of_prime PrimeMultiset.coePNat_ofPrime
theorem coePNat_prime (v : PrimeMultiset) (p : β+) (h : p β (v : Multiset β+)) : p.Prime := by
rcases Multiset.mem_map.mp h with β¨β¨_, hp'β©, β¨_, h_eqβ©β©
exact h_eq βΈ hp'
#align prime_multiset.coe_pnat_prime PrimeMultiset.coePNat_prime
instance coeMultisetPNatNat : Coe (Multiset β+) (Multiset β) :=
β¨fun v => v.map Coe.coeβ©
#align prime_multiset.coe_multiset_pnat_nat PrimeMultiset.coeMultisetPNatNat
theorem coePNat_nat (v : PrimeMultiset) : ((v : Multiset β+) : Multiset β) = (v : Multiset β) := by
change (v.map (Coe.coe : Nat.Primes β β+)).map Subtype.val = v.map Subtype.val
rw [Multiset.map_map]
congr
#align prime_multiset.coe_pnat_nat PrimeMultiset.coePNat_nat
def prod (v : PrimeMultiset) : β+ :=
(v : Multiset PNat).prod
#align prime_multiset.prod PrimeMultiset.prod
| Mathlib/Data/PNat/Factors.lean | 141 | 146 | theorem coe_prod (v : PrimeMultiset) : (v.prod : β) = (v : Multiset β).prod := by |
let h : (v.prod : β) = ((v.map Coe.coe).map Coe.coe).prod :=
PNat.coeMonoidHom.map_multiset_prod v.toPNatMultiset
rw [Multiset.map_map] at h
have : (Coe.coe : β+ β β) β (Coe.coe : Nat.Primes β β+) = Coe.coe := funext fun p => rfl
rw [this] at h; exact h
| 5 | 148.413159 | 2 | 1.25 | 4 | 1,335 |
import Mathlib.FieldTheory.SeparableDegree
import Mathlib.FieldTheory.IsSepClosed
open scoped Classical Polynomial
open FiniteDimensional Polynomial IntermediateField Field
noncomputable section
universe u v w
variable (F : Type u) (E : Type v) [Field F] [Field E] [Algebra F E]
variable (K : Type w) [Field K] [Algebra F K]
section separableClosure
def separableClosure : IntermediateField F E where
carrier := {x | (minpoly F x).Separable}
mul_mem' := separable_mul
add_mem' := separable_add
algebraMap_mem' := separable_algebraMap E
inv_mem' := separable_inv
variable {F E K}
theorem mem_separableClosure_iff {x : E} :
x β separableClosure F E β (minpoly F x).Separable := Iff.rfl
| Mathlib/FieldTheory/SeparableClosure.lean | 94 | 96 | theorem map_mem_separableClosure_iff (i : E ββ[F] K) {x : E} :
i x β separableClosure F K β x β separableClosure F E := by |
simp_rw [mem_separableClosure_iff, minpoly.algHom_eq i i.injective]
| 1 | 2.718282 | 0 | 1.25 | 4 | 1,336 |
import Mathlib.FieldTheory.SeparableDegree
import Mathlib.FieldTheory.IsSepClosed
open scoped Classical Polynomial
open FiniteDimensional Polynomial IntermediateField Field
noncomputable section
universe u v w
variable (F : Type u) (E : Type v) [Field F] [Field E] [Algebra F E]
variable (K : Type w) [Field K] [Algebra F K]
section separableClosure
def separableClosure : IntermediateField F E where
carrier := {x | (minpoly F x).Separable}
mul_mem' := separable_mul
add_mem' := separable_add
algebraMap_mem' := separable_algebraMap E
inv_mem' := separable_inv
variable {F E K}
theorem mem_separableClosure_iff {x : E} :
x β separableClosure F E β (minpoly F x).Separable := Iff.rfl
theorem map_mem_separableClosure_iff (i : E ββ[F] K) {x : E} :
i x β separableClosure F K β x β separableClosure F E := by
simp_rw [mem_separableClosure_iff, minpoly.algHom_eq i i.injective]
| Mathlib/FieldTheory/SeparableClosure.lean | 100 | 103 | theorem separableClosure.comap_eq_of_algHom (i : E ββ[F] K) :
(separableClosure F K).comap i = separableClosure F E := by |
ext x
exact map_mem_separableClosure_iff i
| 2 | 7.389056 | 1 | 1.25 | 4 | 1,336 |
import Mathlib.FieldTheory.SeparableDegree
import Mathlib.FieldTheory.IsSepClosed
open scoped Classical Polynomial
open FiniteDimensional Polynomial IntermediateField Field
noncomputable section
universe u v w
variable (F : Type u) (E : Type v) [Field F] [Field E] [Algebra F E]
variable (K : Type w) [Field K] [Algebra F K]
section separableClosure
def separableClosure : IntermediateField F E where
carrier := {x | (minpoly F x).Separable}
mul_mem' := separable_mul
add_mem' := separable_add
algebraMap_mem' := separable_algebraMap E
inv_mem' := separable_inv
variable {F E K}
theorem mem_separableClosure_iff {x : E} :
x β separableClosure F E β (minpoly F x).Separable := Iff.rfl
theorem map_mem_separableClosure_iff (i : E ββ[F] K) {x : E} :
i x β separableClosure F K β x β separableClosure F E := by
simp_rw [mem_separableClosure_iff, minpoly.algHom_eq i i.injective]
theorem separableClosure.comap_eq_of_algHom (i : E ββ[F] K) :
(separableClosure F K).comap i = separableClosure F E := by
ext x
exact map_mem_separableClosure_iff i
theorem separableClosure.map_le_of_algHom (i : E ββ[F] K) :
(separableClosure F E).map i β€ separableClosure F K :=
map_le_iff_le_comap.2 (comap_eq_of_algHom i).ge
variable (F) in
| Mathlib/FieldTheory/SeparableClosure.lean | 115 | 121 | theorem separableClosure.map_eq_of_separableClosure_eq_bot [Algebra E K] [IsScalarTower F E K]
(h : separableClosure E K = β₯) :
(separableClosure F E).map (IsScalarTower.toAlgHom F E K) = separableClosure F K := by |
refine le_antisymm (map_le_of_algHom _) (fun x hx β¦ ?_)
obtain β¨y, rflβ© := mem_bot.1 <| h βΈ mem_separableClosure_iff.2
(mem_separableClosure_iff.1 hx |>.map_minpoly E)
exact β¨y, (map_mem_separableClosure_iff <| IsScalarTower.toAlgHom F E K).mp hx, rflβ©
| 4 | 54.59815 | 2 | 1.25 | 4 | 1,336 |
import Mathlib.FieldTheory.SeparableDegree
import Mathlib.FieldTheory.IsSepClosed
open scoped Classical Polynomial
open FiniteDimensional Polynomial IntermediateField Field
noncomputable section
universe u v w
variable (F : Type u) (E : Type v) [Field F] [Field E] [Algebra F E]
variable (K : Type w) [Field K] [Algebra F K]
section separableClosure
def separableClosure : IntermediateField F E where
carrier := {x | (minpoly F x).Separable}
mul_mem' := separable_mul
add_mem' := separable_add
algebraMap_mem' := separable_algebraMap E
inv_mem' := separable_inv
variable {F E K}
theorem mem_separableClosure_iff {x : E} :
x β separableClosure F E β (minpoly F x).Separable := Iff.rfl
theorem map_mem_separableClosure_iff (i : E ββ[F] K) {x : E} :
i x β separableClosure F K β x β separableClosure F E := by
simp_rw [mem_separableClosure_iff, minpoly.algHom_eq i i.injective]
theorem separableClosure.comap_eq_of_algHom (i : E ββ[F] K) :
(separableClosure F K).comap i = separableClosure F E := by
ext x
exact map_mem_separableClosure_iff i
theorem separableClosure.map_le_of_algHom (i : E ββ[F] K) :
(separableClosure F E).map i β€ separableClosure F K :=
map_le_iff_le_comap.2 (comap_eq_of_algHom i).ge
variable (F) in
theorem separableClosure.map_eq_of_separableClosure_eq_bot [Algebra E K] [IsScalarTower F E K]
(h : separableClosure E K = β₯) :
(separableClosure F E).map (IsScalarTower.toAlgHom F E K) = separableClosure F K := by
refine le_antisymm (map_le_of_algHom _) (fun x hx β¦ ?_)
obtain β¨y, rflβ© := mem_bot.1 <| h βΈ mem_separableClosure_iff.2
(mem_separableClosure_iff.1 hx |>.map_minpoly E)
exact β¨y, (map_mem_separableClosure_iff <| IsScalarTower.toAlgHom F E K).mp hx, rflβ©
theorem separableClosure.map_eq_of_algEquiv (i : E ββ[F] K) :
(separableClosure F E).map i = separableClosure F K :=
(map_le_of_algHom i.toAlgHom).antisymm
(fun x h β¦ β¨_, (map_mem_separableClosure_iff i.symm).2 h, by simpβ©)
def separableClosure.algEquivOfAlgEquiv (i : E ββ[F] K) :
separableClosure F E ββ[F] separableClosure F K :=
(intermediateFieldMap i _).trans (equivOfEq (map_eq_of_algEquiv i))
alias AlgEquiv.separableClosure := separableClosure.algEquivOfAlgEquiv
variable (F E K)
instance separableClosure.isAlgebraic : Algebra.IsAlgebraic F (separableClosure F E) :=
β¨fun x β¦ isAlgebraic_iff.2 x.2.isIntegral.isAlgebraicβ©
instance separableClosure.isSeparable : IsSeparable F (separableClosure F E) :=
β¨fun x β¦ by simpa only [minpoly_eq] using x.2β©
theorem le_separableClosure' {L : IntermediateField F E} (hs : β x : L, (minpoly F x).Separable) :
L β€ separableClosure F E := fun x h β¦ by simpa only [minpoly_eq] using hs β¨x, hβ©
theorem le_separableClosure (L : IntermediateField F E) [IsSeparable F L] :
L β€ separableClosure F E := le_separableClosure' F E (IsSeparable.separable F)
theorem le_separableClosure_iff (L : IntermediateField F E) :
L β€ separableClosure F E β IsSeparable F L :=
β¨fun h β¦ β¨fun x β¦ by simpa only [minpoly_eq] using h x.2β©, fun _ β¦ le_separableClosure _ _ _β©
theorem separableClosure.separableClosure_eq_bot :
separableClosure (separableClosure F E) E = β₯ := bot_unique fun x hx β¦
mem_bot.2 β¨β¨x, mem_separableClosure_iff.1 hx |>.comap_minpoly_of_isSeparable Fβ©, rflβ©
theorem separableClosure.normalClosure_eq_self :
normalClosure F (separableClosure F E) E = separableClosure F E :=
le_antisymm (normalClosure_le_iff.2 fun i β¦
haveI : IsSeparable F i.fieldRange := (AlgEquiv.ofInjectiveField i).isSeparable
le_separableClosure F E _) (le_normalClosure _)
instance separableClosure.isGalois [Normal F E] : IsGalois F (separableClosure F E) where
to_isSeparable := separableClosure.isSeparable F E
to_normal := by
rw [β separableClosure.normalClosure_eq_self]
exact normalClosure.normal F _ E
| Mathlib/FieldTheory/SeparableClosure.lean | 186 | 192 | theorem IsSepClosed.separableClosure_eq_bot_iff [IsSepClosed E] :
separableClosure F E = β₯ β IsSepClosed F := by |
refine β¨fun h β¦ IsSepClosed.of_exists_root _ fun p _ hirr hsep β¦ ?_,
fun _ β¦ IntermediateField.eq_bot_of_isSepClosed_of_isSeparable _β©
obtain β¨x, hxβ© := IsSepClosed.exists_aeval_eq_zero E p (degree_pos_of_irreducible hirr).ne' hsep
obtain β¨x, rflβ© := h βΈ mem_separableClosure_iff.2 (hsep.of_dvd <| minpoly.dvd _ x hx)
exact β¨x, by simpa [Algebra.ofId_apply] using hxβ©
| 5 | 148.413159 | 2 | 1.25 | 4 | 1,336 |
import Mathlib.Algebra.Homology.Homotopy
import Mathlib.Algebra.Category.ModuleCat.Abelian
import Mathlib.Algebra.Category.ModuleCat.Subobject
import Mathlib.CategoryTheory.Limits.Shapes.ConcreteCategory
#align_import algebra.homology.Module from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
universe v u
open scoped Classical
noncomputable section
open CategoryTheory Limits HomologicalComplex
variable {R : Type v} [Ring R]
variable {ΞΉ : Type*} {c : ComplexShape ΞΉ} {C D : HomologicalComplex (ModuleCat.{u} R) c}
namespace ModuleCat
| Mathlib/Algebra/Homology/ModuleCat.lean | 37 | 49 | theorem homology'_ext {L M N K : ModuleCat.{u} R} {f : L βΆ M} {g : M βΆ N} (w : f β« g = 0)
{h k : homology' f g w βΆ K}
(w :
β x : LinearMap.ker g,
h (cokernel.Ο (imageToKernel _ _ w) (toKernelSubobject x)) =
k (cokernel.Ο (imageToKernel _ _ w) (toKernelSubobject x))) :
h = k := by |
refine Concrete.cokernel_funext fun n => ?_
-- Porting note: as `equiv_rw` was not ported, it was replaced by `Equiv.surjective`
-- Gosh it would be nice if `equiv_rw` could directly use an isomorphism, or an enriched `β`.
obtain β¨n, rflβ© := (kernelSubobjectIso g βͺβ«
ModuleCat.kernelIsoKer g).toLinearEquiv.toEquiv.symm.surjective n
exact w n
| 6 | 403.428793 | 2 | 1.25 | 4 | 1,337 |
import Mathlib.Algebra.Homology.Homotopy
import Mathlib.Algebra.Category.ModuleCat.Abelian
import Mathlib.Algebra.Category.ModuleCat.Subobject
import Mathlib.CategoryTheory.Limits.Shapes.ConcreteCategory
#align_import algebra.homology.Module from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
universe v u
open scoped Classical
noncomputable section
open CategoryTheory Limits HomologicalComplex
variable {R : Type v} [Ring R]
variable {ΞΉ : Type*} {c : ComplexShape ΞΉ} {C D : HomologicalComplex (ModuleCat.{u} R) c}
namespace ModuleCat
theorem homology'_ext {L M N K : ModuleCat.{u} R} {f : L βΆ M} {g : M βΆ N} (w : f β« g = 0)
{h k : homology' f g w βΆ K}
(w :
β x : LinearMap.ker g,
h (cokernel.Ο (imageToKernel _ _ w) (toKernelSubobject x)) =
k (cokernel.Ο (imageToKernel _ _ w) (toKernelSubobject x))) :
h = k := by
refine Concrete.cokernel_funext fun n => ?_
-- Porting note: as `equiv_rw` was not ported, it was replaced by `Equiv.surjective`
-- Gosh it would be nice if `equiv_rw` could directly use an isomorphism, or an enriched `β`.
obtain β¨n, rflβ© := (kernelSubobjectIso g βͺβ«
ModuleCat.kernelIsoKer g).toLinearEquiv.toEquiv.symm.surjective n
exact w n
set_option linter.uppercaseLean3 false in
#align Module.homology_ext ModuleCat.homology'_ext
abbrev toCycles' {C : HomologicalComplex (ModuleCat.{u} R) c} {i : ΞΉ}
(x : LinearMap.ker (C.dFrom i)) : (C.cycles' i : Type u) :=
toKernelSubobject x
set_option linter.uppercaseLean3 false in
#align Module.to_cycles ModuleCat.toCycles'
@[ext]
| Mathlib/Algebra/Homology/ModuleCat.lean | 61 | 65 | theorem cycles'_ext {C : HomologicalComplex (ModuleCat.{u} R) c} {i : ΞΉ}
{x y : (C.cycles' i : Type u)}
(w : (C.cycles' i).arrow x = (C.cycles' i).arrow y) : x = y := by |
apply_fun (C.cycles' i).arrow using (ModuleCat.mono_iff_injective _).mp (cycles' C i).arrow_mono
exact w
| 2 | 7.389056 | 1 | 1.25 | 4 | 1,337 |
import Mathlib.Algebra.Homology.Homotopy
import Mathlib.Algebra.Category.ModuleCat.Abelian
import Mathlib.Algebra.Category.ModuleCat.Subobject
import Mathlib.CategoryTheory.Limits.Shapes.ConcreteCategory
#align_import algebra.homology.Module from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
universe v u
open scoped Classical
noncomputable section
open CategoryTheory Limits HomologicalComplex
variable {R : Type v} [Ring R]
variable {ΞΉ : Type*} {c : ComplexShape ΞΉ} {C D : HomologicalComplex (ModuleCat.{u} R) c}
namespace ModuleCat
theorem homology'_ext {L M N K : ModuleCat.{u} R} {f : L βΆ M} {g : M βΆ N} (w : f β« g = 0)
{h k : homology' f g w βΆ K}
(w :
β x : LinearMap.ker g,
h (cokernel.Ο (imageToKernel _ _ w) (toKernelSubobject x)) =
k (cokernel.Ο (imageToKernel _ _ w) (toKernelSubobject x))) :
h = k := by
refine Concrete.cokernel_funext fun n => ?_
-- Porting note: as `equiv_rw` was not ported, it was replaced by `Equiv.surjective`
-- Gosh it would be nice if `equiv_rw` could directly use an isomorphism, or an enriched `β`.
obtain β¨n, rflβ© := (kernelSubobjectIso g βͺβ«
ModuleCat.kernelIsoKer g).toLinearEquiv.toEquiv.symm.surjective n
exact w n
set_option linter.uppercaseLean3 false in
#align Module.homology_ext ModuleCat.homology'_ext
abbrev toCycles' {C : HomologicalComplex (ModuleCat.{u} R) c} {i : ΞΉ}
(x : LinearMap.ker (C.dFrom i)) : (C.cycles' i : Type u) :=
toKernelSubobject x
set_option linter.uppercaseLean3 false in
#align Module.to_cycles ModuleCat.toCycles'
@[ext]
theorem cycles'_ext {C : HomologicalComplex (ModuleCat.{u} R) c} {i : ΞΉ}
{x y : (C.cycles' i : Type u)}
(w : (C.cycles' i).arrow x = (C.cycles' i).arrow y) : x = y := by
apply_fun (C.cycles' i).arrow using (ModuleCat.mono_iff_injective _).mp (cycles' C i).arrow_mono
exact w
set_option linter.uppercaseLean3 false in
#align Module.cycles_ext ModuleCat.cycles'_ext
-- Porting note: both proofs by `rw` were proofs by `simp` which no longer worked
-- see https://github.com/leanprover-community/mathlib4/issues/5026
@[simp]
| Mathlib/Algebra/Homology/ModuleCat.lean | 72 | 79 | theorem cycles'Map_toCycles' (f : C βΆ D) {i : ΞΉ} (x : LinearMap.ker (C.dFrom i)) :
(cycles'Map f i) (toCycles' x) = toCycles' β¨f.f i x.1, by
-- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
rw [LinearMap.mem_ker]; erw [Hom.comm_from_apply, x.2, map_zero]β© := by |
ext
-- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
erw [cycles'Map_arrow_apply, toKernelSubobject_arrow, toKernelSubobject_arrow]
rfl
| 4 | 54.59815 | 2 | 1.25 | 4 | 1,337 |
import Mathlib.Algebra.Homology.Homotopy
import Mathlib.Algebra.Category.ModuleCat.Abelian
import Mathlib.Algebra.Category.ModuleCat.Subobject
import Mathlib.CategoryTheory.Limits.Shapes.ConcreteCategory
#align_import algebra.homology.Module from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
universe v u
open scoped Classical
noncomputable section
open CategoryTheory Limits HomologicalComplex
variable {R : Type v} [Ring R]
variable {ΞΉ : Type*} {c : ComplexShape ΞΉ} {C D : HomologicalComplex (ModuleCat.{u} R) c}
namespace ModuleCat
theorem homology'_ext {L M N K : ModuleCat.{u} R} {f : L βΆ M} {g : M βΆ N} (w : f β« g = 0)
{h k : homology' f g w βΆ K}
(w :
β x : LinearMap.ker g,
h (cokernel.Ο (imageToKernel _ _ w) (toKernelSubobject x)) =
k (cokernel.Ο (imageToKernel _ _ w) (toKernelSubobject x))) :
h = k := by
refine Concrete.cokernel_funext fun n => ?_
-- Porting note: as `equiv_rw` was not ported, it was replaced by `Equiv.surjective`
-- Gosh it would be nice if `equiv_rw` could directly use an isomorphism, or an enriched `β`.
obtain β¨n, rflβ© := (kernelSubobjectIso g βͺβ«
ModuleCat.kernelIsoKer g).toLinearEquiv.toEquiv.symm.surjective n
exact w n
set_option linter.uppercaseLean3 false in
#align Module.homology_ext ModuleCat.homology'_ext
abbrev toCycles' {C : HomologicalComplex (ModuleCat.{u} R) c} {i : ΞΉ}
(x : LinearMap.ker (C.dFrom i)) : (C.cycles' i : Type u) :=
toKernelSubobject x
set_option linter.uppercaseLean3 false in
#align Module.to_cycles ModuleCat.toCycles'
@[ext]
theorem cycles'_ext {C : HomologicalComplex (ModuleCat.{u} R) c} {i : ΞΉ}
{x y : (C.cycles' i : Type u)}
(w : (C.cycles' i).arrow x = (C.cycles' i).arrow y) : x = y := by
apply_fun (C.cycles' i).arrow using (ModuleCat.mono_iff_injective _).mp (cycles' C i).arrow_mono
exact w
set_option linter.uppercaseLean3 false in
#align Module.cycles_ext ModuleCat.cycles'_ext
-- Porting note: both proofs by `rw` were proofs by `simp` which no longer worked
-- see https://github.com/leanprover-community/mathlib4/issues/5026
@[simp]
theorem cycles'Map_toCycles' (f : C βΆ D) {i : ΞΉ} (x : LinearMap.ker (C.dFrom i)) :
(cycles'Map f i) (toCycles' x) = toCycles' β¨f.f i x.1, by
-- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
rw [LinearMap.mem_ker]; erw [Hom.comm_from_apply, x.2, map_zero]β© := by
ext
-- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
erw [cycles'Map_arrow_apply, toKernelSubobject_arrow, toKernelSubobject_arrow]
rfl
set_option linter.uppercaseLean3 false in
#align Module.cycles_map_to_cycles ModuleCat.cycles'Map_toCycles'
abbrev toHomology' {C : HomologicalComplex (ModuleCat.{u} R) c} {i : ΞΉ}
(x : LinearMap.ker (C.dFrom i)) : C.homology' i :=
homology'.Ο (C.dTo i) (C.dFrom i) _ (toCycles' x)
set_option linter.uppercaseLean3 false in
#align Module.to_homology ModuleCat.toHomology'
@[ext]
| Mathlib/Algebra/Homology/ModuleCat.lean | 91 | 93 | theorem homology'_ext' {M : ModuleCat R} (i : ΞΉ) {h k : C.homology' i βΆ M}
(w : β x : LinearMap.ker (C.dFrom i), h (toHomology' x) = k (toHomology' x)) : h = k := by |
apply homology'_ext _ w
| 1 | 2.718282 | 0 | 1.25 | 4 | 1,337 |
import Mathlib.LinearAlgebra.Eigenspace.Basic
import Mathlib.FieldTheory.IsAlgClosed.Spectrum
#align_import linear_algebra.eigenspace.is_alg_closed from "leanprover-community/mathlib"@"6b0169218d01f2837d79ea2784882009a0da1aa1"
open Set Function Module FiniteDimensional
variable {K V : Type*} [Field K] [AddCommGroup V] [Module K V]
namespace Module.End
-- This is Lemma 5.21 of [axler2015], although we are no longer following that proof.
| Mathlib/LinearAlgebra/Eigenspace/Triangularizable.lean | 51 | 54 | theorem exists_eigenvalue [IsAlgClosed K] [FiniteDimensional K V] [Nontrivial V] (f : End K V) :
β c : K, f.HasEigenvalue c := by |
simp_rw [hasEigenvalue_iff_mem_spectrum]
exact spectrum.nonempty_of_isAlgClosed_of_finiteDimensional K f
| 2 | 7.389056 | 1 | 1.25 | 4 | 1,338 |
import Mathlib.LinearAlgebra.Eigenspace.Basic
import Mathlib.FieldTheory.IsAlgClosed.Spectrum
#align_import linear_algebra.eigenspace.is_alg_closed from "leanprover-community/mathlib"@"6b0169218d01f2837d79ea2784882009a0da1aa1"
open Set Function Module FiniteDimensional
variable {K V : Type*} [Field K] [AddCommGroup V] [Module K V]
namespace Module.End
-- This is Lemma 5.21 of [axler2015], although we are no longer following that proof.
theorem exists_eigenvalue [IsAlgClosed K] [FiniteDimensional K V] [Nontrivial V] (f : End K V) :
β c : K, f.HasEigenvalue c := by
simp_rw [hasEigenvalue_iff_mem_spectrum]
exact spectrum.nonempty_of_isAlgClosed_of_finiteDimensional K f
#align module.End.exists_eigenvalue Module.End.exists_eigenvalue
noncomputable instance [IsAlgClosed K] [FiniteDimensional K V] [Nontrivial V] (f : End K V) :
Inhabited f.Eigenvalues :=
β¨β¨f.exists_eigenvalue.choose, f.exists_eigenvalue.choose_specβ©β©
-- Lemma 8.21 of [axler2015]
| Mathlib/LinearAlgebra/Eigenspace/Triangularizable.lean | 64 | 123 | theorem iSup_genEigenspace_eq_top [IsAlgClosed K] [FiniteDimensional K V] (f : End K V) :
β¨ (ΞΌ : K) (k : β), f.genEigenspace ΞΌ k = β€ := by |
-- We prove the claim by strong induction on the dimension of the vector space.
induction' h_dim : finrank K V using Nat.strong_induction_on with n ih generalizing V
cases' n with n
-- If the vector space is 0-dimensional, the result is trivial.
Β· rw [β top_le_iff]
simp only [Submodule.finrank_eq_zero.1 (Eq.trans (finrank_top _ _) h_dim), bot_le]
-- Otherwise the vector space is nontrivial.
Β· haveI : Nontrivial V := finrank_pos_iff.1 (by rw [h_dim]; apply Nat.zero_lt_succ)
-- Hence, `f` has an eigenvalue `ΞΌβ`.
obtain β¨ΞΌβ, hΞΌββ© : β ΞΌβ, f.HasEigenvalue ΞΌβ := exists_eigenvalue f
-- We define `ES` to be the generalized eigenspace
let ES := f.genEigenspace ΞΌβ (finrank K V)
-- and `ER` to be the generalized eigenrange.
let ER := f.genEigenrange ΞΌβ (finrank K V)
-- `f` maps `ER` into itself.
have h_f_ER : β x : V, x β ER β f x β ER := fun x hx =>
map_genEigenrange_le (Submodule.mem_map_of_mem hx)
-- Therefore, we can define the restriction `f'` of `f` to `ER`.
let f' : End K ER := f.restrict h_f_ER
-- The dimension of `ES` is positive
have h_dim_ES_pos : 0 < finrank K ES := by
dsimp only [ES]
rw [h_dim]
apply pos_finrank_genEigenspace_of_hasEigenvalue hΞΌβ (Nat.zero_lt_succ n)
-- and the dimensions of `ES` and `ER` add up to `finrank K V`.
have h_dim_add : finrank K ER + finrank K ES = finrank K V := by
apply LinearMap.finrank_range_add_finrank_ker
-- Therefore the dimension `ER` mus be smaller than `finrank K V`.
have h_dim_ER : finrank K ER < n.succ := by linarith
-- This allows us to apply the induction hypothesis on `ER`:
have ih_ER : β¨ (ΞΌ : K) (k : β), f'.genEigenspace ΞΌ k = β€ :=
ih (finrank K ER) h_dim_ER f' rfl
-- The induction hypothesis gives us a statement about subspaces of `ER`. We can transfer this
-- to a statement about subspaces of `V` via `submodule.subtype`:
have ih_ER' : β¨ (ΞΌ : K) (k : β), (f'.genEigenspace ΞΌ k).map ER.subtype = ER := by
simp only [(Submodule.map_iSup _ _).symm, ih_ER, Submodule.map_subtype_top ER]
-- Moreover, every generalized eigenspace of `f'` is contained in the corresponding generalized
-- eigenspace of `f`.
have hff' :
β ΞΌ k, (f'.genEigenspace ΞΌ k).map ER.subtype β€ f.genEigenspace ΞΌ k := by
intros
rw [genEigenspace_restrict]
apply Submodule.map_comap_le
-- It follows that `ER` is contained in the span of all generalized eigenvectors.
have hER : ER β€ β¨ (ΞΌ : K) (k : β), f.genEigenspace ΞΌ k := by
rw [β ih_ER']
exact iSupβ_mono hff'
-- `ES` is contained in this span by definition.
have hES : ES β€ β¨ (ΞΌ : K) (k : β), f.genEigenspace ΞΌ k :=
le_trans (le_iSup (fun k => f.genEigenspace ΞΌβ k) (finrank K V))
(le_iSup (fun ΞΌ : K => β¨ k : β, f.genEigenspace ΞΌ k) ΞΌβ)
-- Moreover, we know that `ER` and `ES` are disjoint.
have h_disjoint : Disjoint ER ES := generalized_eigenvec_disjoint_range_ker f ΞΌβ
-- Since the dimensions of `ER` and `ES` add up to the dimension of `V`, it follows that the
-- span of all generalized eigenvectors is all of `V`.
show β¨ (ΞΌ : K) (k : β), f.genEigenspace ΞΌ k = β€
rw [β top_le_iff, β Submodule.eq_top_of_disjoint ER ES h_dim_add h_disjoint]
apply sup_le hER hES
| 58 | 15,455,389,355,901,040,000,000,000 | 2 | 1.25 | 4 | 1,338 |
import Mathlib.LinearAlgebra.Eigenspace.Basic
import Mathlib.FieldTheory.IsAlgClosed.Spectrum
#align_import linear_algebra.eigenspace.is_alg_closed from "leanprover-community/mathlib"@"6b0169218d01f2837d79ea2784882009a0da1aa1"
open Set Function Module FiniteDimensional
variable {K V : Type*} [Field K] [AddCommGroup V] [Module K V]
namespace Submodule
variable {p : Submodule K V} {f : Module.End K V}
| Mathlib/LinearAlgebra/Eigenspace/Triangularizable.lean | 132 | 192 | theorem inf_iSup_genEigenspace [FiniteDimensional K V] (h : β x β p, f x β p) :
p β β¨ ΞΌ, β¨ k, f.genEigenspace ΞΌ k = β¨ ΞΌ, β¨ k, p β f.genEigenspace ΞΌ k := by |
simp_rw [β (f.genEigenspace _).mono.directed_le.inf_iSup_eq]
refine le_antisymm (fun m hm β¦ ?_)
(le_inf_iff.mpr β¨iSup_le fun ΞΌ β¦ inf_le_left, iSup_mono fun ΞΌ β¦ inf_le_rightβ©)
classical
obtain β¨hmβ : m β p, hmβ : m β β¨ ΞΌ, β¨ k, f.genEigenspace ΞΌ kβ© := hm
obtain β¨m, hmβ, rflβ© := (mem_iSup_iff_exists_finsupp _ _).mp hmβ
suffices β ΞΌ, (m ΞΌ : V) β p by
exact (mem_iSup_iff_exists_finsupp _ _).mpr β¨m, fun ΞΌ β¦ mem_inf.mp β¨this ΞΌ, hmβ ΞΌβ©, rflβ©
intro ΞΌ
by_cases hΞΌ : ΞΌ β m.support; swap
Β· simp only [Finsupp.not_mem_support_iff.mp hΞΌ, p.zero_mem]
have h_comm : β (ΞΌβ ΞΌβ : K),
Commute ((f - algebraMap K (End K V) ΞΌβ) ^ finrank K V)
((f - algebraMap K (End K V) ΞΌβ) ^ finrank K V) := fun ΞΌβ ΞΌβ β¦
((Commute.sub_right rfl <| Algebra.commute_algebraMap_right _ _).sub_left
(Algebra.commute_algebraMap_left _ _)).pow_pow _ _
let g : End K V := (m.support.erase ΞΌ).noncommProd _ fun ΞΌβ _ ΞΌβ _ _ β¦ h_comm ΞΌβ ΞΌβ
have hfg : Commute f g := Finset.noncommProd_commute _ _ _ _ fun ΞΌ' _ β¦
(Commute.sub_right rfl <| Algebra.commute_algebraMap_right _ _).pow_right _
have hgβ : g (m.sum fun _ΞΌ mΞΌ β¦ mΞΌ) = g (m ΞΌ) := by
suffices β ΞΌ' β m.support, g (m ΞΌ') = if ΞΌ' = ΞΌ then g (m ΞΌ) else 0 by
rw [map_finsupp_sum, Finsupp.sum_congr (g2 := fun ΞΌ' _ β¦ if ΞΌ' = ΞΌ then g (m ΞΌ) else 0) this,
Finsupp.sum_ite_eq', if_pos hΞΌ]
rintro ΞΌ' hΞΌ'
split_ifs with hΞΌΞΌ'
Β· rw [hΞΌΞΌ']
replace hmβ : ((f - algebraMap K (End K V) ΞΌ') ^ finrank K V) (m ΞΌ') = 0 := by
obtain β¨k, hkβ© := (mem_iSup_of_chain _ _).mp (hmβ ΞΌ')
exact Module.End.genEigenspace_le_genEigenspace_finrank _ _ k hk
have : _ = g := (m.support.erase ΞΌ).noncommProd_erase_mul (Finset.mem_erase.mpr β¨hΞΌΞΌ', hΞΌ'β©)
(fun ΞΌ β¦ (f - algebraMap K (End K V) ΞΌ) ^ finrank K V) (fun ΞΌβ _ ΞΌβ _ _ β¦ h_comm ΞΌβ ΞΌβ)
rw [β this, LinearMap.mul_apply, hmβ, _root_.map_zero]
have hgβ : MapsTo g p p := Finset.noncommProd_induction _ _ _ (fun g' : End K V β¦ MapsTo g' p p)
(fun fβ fβ β¦ MapsTo.comp) (mapsTo_id _) fun ΞΌ' _ β¦ by
suffices MapsTo (f - algebraMap K (End K V) ΞΌ') p p by
simp only [LinearMap.coe_pow]; exact this.iterate (finrank K V)
intro x hx
rw [LinearMap.sub_apply, algebraMap_end_apply]
exact p.sub_mem (h _ hx) (smul_mem p ΞΌ' hx)
have hgβ : MapsTo g β(β¨ k, f.genEigenspace ΞΌ k) β(β¨ k, f.genEigenspace ΞΌ k) :=
f.mapsTo_iSup_genEigenspace_of_comm hfg ΞΌ
have hgβ : InjOn g β(β¨ k, f.genEigenspace ΞΌ k) := by
apply LinearMap.injOn_of_disjoint_ker (subset_refl _)
have this := f.independent_genEigenspace
simp_rw [f.iSup_genEigenspace_eq_genEigenspace_finrank] at this β’
rw [LinearMap.ker_noncommProd_eq_of_supIndep_ker _ _ <| this.supIndep' (m.support.erase ΞΌ),
β Finset.sup_eq_iSup]
exact Finset.supIndep_iff_disjoint_erase.mp (this.supIndep' m.support) ΞΌ hΞΌ
have hgβ : SurjOn g
β(p β β¨ k, f.genEigenspace ΞΌ k) β(p β β¨ k, f.genEigenspace ΞΌ k) := by
have : MapsTo g
β(p β β¨ k, f.genEigenspace ΞΌ k) β(p β β¨ k, f.genEigenspace ΞΌ k) :=
hgβ.inter_inter hgβ
rw [β LinearMap.injOn_iff_surjOn this]
exact hgβ.mono inter_subset_right
specialize hmβ ΞΌ
obtain β¨y, β¨hyβ : y β p, hyβ : y β β¨ k, f.genEigenspace ΞΌ kβ©, hyβ : g y = g (m ΞΌ)β© :=
hgβ β¨(hgβ βΈ hgβ hmβ), hgβ hmββ©
rwa [β hgβ hyβ hmβ hyβ]
| 59 | 42,012,104,037,905,144,000,000,000 | 2 | 1.25 | 4 | 1,338 |
import Mathlib.LinearAlgebra.Eigenspace.Basic
import Mathlib.FieldTheory.IsAlgClosed.Spectrum
#align_import linear_algebra.eigenspace.is_alg_closed from "leanprover-community/mathlib"@"6b0169218d01f2837d79ea2784882009a0da1aa1"
open Set Function Module FiniteDimensional
variable {K V : Type*} [Field K] [AddCommGroup V] [Module K V]
namespace Submodule
variable {p : Submodule K V} {f : Module.End K V}
theorem inf_iSup_genEigenspace [FiniteDimensional K V] (h : β x β p, f x β p) :
p β β¨ ΞΌ, β¨ k, f.genEigenspace ΞΌ k = β¨ ΞΌ, β¨ k, p β f.genEigenspace ΞΌ k := by
simp_rw [β (f.genEigenspace _).mono.directed_le.inf_iSup_eq]
refine le_antisymm (fun m hm β¦ ?_)
(le_inf_iff.mpr β¨iSup_le fun ΞΌ β¦ inf_le_left, iSup_mono fun ΞΌ β¦ inf_le_rightβ©)
classical
obtain β¨hmβ : m β p, hmβ : m β β¨ ΞΌ, β¨ k, f.genEigenspace ΞΌ kβ© := hm
obtain β¨m, hmβ, rflβ© := (mem_iSup_iff_exists_finsupp _ _).mp hmβ
suffices β ΞΌ, (m ΞΌ : V) β p by
exact (mem_iSup_iff_exists_finsupp _ _).mpr β¨m, fun ΞΌ β¦ mem_inf.mp β¨this ΞΌ, hmβ ΞΌβ©, rflβ©
intro ΞΌ
by_cases hΞΌ : ΞΌ β m.support; swap
Β· simp only [Finsupp.not_mem_support_iff.mp hΞΌ, p.zero_mem]
have h_comm : β (ΞΌβ ΞΌβ : K),
Commute ((f - algebraMap K (End K V) ΞΌβ) ^ finrank K V)
((f - algebraMap K (End K V) ΞΌβ) ^ finrank K V) := fun ΞΌβ ΞΌβ β¦
((Commute.sub_right rfl <| Algebra.commute_algebraMap_right _ _).sub_left
(Algebra.commute_algebraMap_left _ _)).pow_pow _ _
let g : End K V := (m.support.erase ΞΌ).noncommProd _ fun ΞΌβ _ ΞΌβ _ _ β¦ h_comm ΞΌβ ΞΌβ
have hfg : Commute f g := Finset.noncommProd_commute _ _ _ _ fun ΞΌ' _ β¦
(Commute.sub_right rfl <| Algebra.commute_algebraMap_right _ _).pow_right _
have hgβ : g (m.sum fun _ΞΌ mΞΌ β¦ mΞΌ) = g (m ΞΌ) := by
suffices β ΞΌ' β m.support, g (m ΞΌ') = if ΞΌ' = ΞΌ then g (m ΞΌ) else 0 by
rw [map_finsupp_sum, Finsupp.sum_congr (g2 := fun ΞΌ' _ β¦ if ΞΌ' = ΞΌ then g (m ΞΌ) else 0) this,
Finsupp.sum_ite_eq', if_pos hΞΌ]
rintro ΞΌ' hΞΌ'
split_ifs with hΞΌΞΌ'
Β· rw [hΞΌΞΌ']
replace hmβ : ((f - algebraMap K (End K V) ΞΌ') ^ finrank K V) (m ΞΌ') = 0 := by
obtain β¨k, hkβ© := (mem_iSup_of_chain _ _).mp (hmβ ΞΌ')
exact Module.End.genEigenspace_le_genEigenspace_finrank _ _ k hk
have : _ = g := (m.support.erase ΞΌ).noncommProd_erase_mul (Finset.mem_erase.mpr β¨hΞΌΞΌ', hΞΌ'β©)
(fun ΞΌ β¦ (f - algebraMap K (End K V) ΞΌ) ^ finrank K V) (fun ΞΌβ _ ΞΌβ _ _ β¦ h_comm ΞΌβ ΞΌβ)
rw [β this, LinearMap.mul_apply, hmβ, _root_.map_zero]
have hgβ : MapsTo g p p := Finset.noncommProd_induction _ _ _ (fun g' : End K V β¦ MapsTo g' p p)
(fun fβ fβ β¦ MapsTo.comp) (mapsTo_id _) fun ΞΌ' _ β¦ by
suffices MapsTo (f - algebraMap K (End K V) ΞΌ') p p by
simp only [LinearMap.coe_pow]; exact this.iterate (finrank K V)
intro x hx
rw [LinearMap.sub_apply, algebraMap_end_apply]
exact p.sub_mem (h _ hx) (smul_mem p ΞΌ' hx)
have hgβ : MapsTo g β(β¨ k, f.genEigenspace ΞΌ k) β(β¨ k, f.genEigenspace ΞΌ k) :=
f.mapsTo_iSup_genEigenspace_of_comm hfg ΞΌ
have hgβ : InjOn g β(β¨ k, f.genEigenspace ΞΌ k) := by
apply LinearMap.injOn_of_disjoint_ker (subset_refl _)
have this := f.independent_genEigenspace
simp_rw [f.iSup_genEigenspace_eq_genEigenspace_finrank] at this β’
rw [LinearMap.ker_noncommProd_eq_of_supIndep_ker _ _ <| this.supIndep' (m.support.erase ΞΌ),
β Finset.sup_eq_iSup]
exact Finset.supIndep_iff_disjoint_erase.mp (this.supIndep' m.support) ΞΌ hΞΌ
have hgβ : SurjOn g
β(p β β¨ k, f.genEigenspace ΞΌ k) β(p β β¨ k, f.genEigenspace ΞΌ k) := by
have : MapsTo g
β(p β β¨ k, f.genEigenspace ΞΌ k) β(p β β¨ k, f.genEigenspace ΞΌ k) :=
hgβ.inter_inter hgβ
rw [β LinearMap.injOn_iff_surjOn this]
exact hgβ.mono inter_subset_right
specialize hmβ ΞΌ
obtain β¨y, β¨hyβ : y β p, hyβ : y β β¨ k, f.genEigenspace ΞΌ kβ©, hyβ : g y = g (m ΞΌ)β© :=
hgβ β¨(hgβ βΈ hgβ hmβ), hgβ hmββ©
rwa [β hgβ hyβ hmβ hyβ]
| Mathlib/LinearAlgebra/Eigenspace/Triangularizable.lean | 194 | 197 | theorem eq_iSup_inf_genEigenspace [FiniteDimensional K V]
(h : β x β p, f x β p) (h' : β¨ ΞΌ, β¨ k, f.genEigenspace ΞΌ k = β€) :
p = β¨ ΞΌ, β¨ k, p β f.genEigenspace ΞΌ k := by |
rw [β inf_iSup_genEigenspace h, h', inf_top_eq]
| 1 | 2.718282 | 0 | 1.25 | 4 | 1,338 |
import Mathlib.Algebra.MonoidAlgebra.Division
import Mathlib.Algebra.MvPolynomial.Basic
#align_import data.mv_polynomial.division from "leanprover-community/mathlib"@"72c366d0475675f1309d3027d3d7d47ee4423951"
variable {Ο R : Type*} [CommSemiring R]
namespace MvPolynomial
| Mathlib/Algebra/MvPolynomial/Division.lean | 221 | 240 | theorem monomial_dvd_monomial {r s : R} {i j : Ο ββ β} :
monomial i r β£ monomial j s β (s = 0 β¨ i β€ j) β§ r β£ s := by |
constructor
Β· rintro β¨x, hxβ©
rw [MvPolynomial.ext_iff] at hx
have hj := hx j
have hi := hx i
classical
simp_rw [coeff_monomial, if_pos] at hj hi
simp_rw [coeff_monomial_mul'] at hi hj
split_ifs at hi hj with hi hi
Β· exact β¨Or.inr hi, _, hjβ©
Β· exact β¨Or.inl hj, hj.symm βΈ dvd_zero _β©
-- Porting note: two goals remain at this point in Lean 4
Β· simp_all only [or_true, dvd_mul_right, and_self]
Β· simp_all only [ite_self, le_refl, ite_true, dvd_mul_right, or_false, and_self]
Β· rintro β¨h | hij, d, rflβ©
Β· simp_rw [h, monomial_zero, dvd_zero]
Β· refine β¨monomial (j - i) d, ?_β©
rw [monomial_mul, add_tsub_cancel_of_le hij]
| 18 | 65,659,969.137331 | 2 | 1.25 | 4 | 1,339 |
import Mathlib.Algebra.MonoidAlgebra.Division
import Mathlib.Algebra.MvPolynomial.Basic
#align_import data.mv_polynomial.division from "leanprover-community/mathlib"@"72c366d0475675f1309d3027d3d7d47ee4423951"
variable {Ο R : Type*} [CommSemiring R]
namespace MvPolynomial
theorem monomial_dvd_monomial {r s : R} {i j : Ο ββ β} :
monomial i r β£ monomial j s β (s = 0 β¨ i β€ j) β§ r β£ s := by
constructor
Β· rintro β¨x, hxβ©
rw [MvPolynomial.ext_iff] at hx
have hj := hx j
have hi := hx i
classical
simp_rw [coeff_monomial, if_pos] at hj hi
simp_rw [coeff_monomial_mul'] at hi hj
split_ifs at hi hj with hi hi
Β· exact β¨Or.inr hi, _, hjβ©
Β· exact β¨Or.inl hj, hj.symm βΈ dvd_zero _β©
-- Porting note: two goals remain at this point in Lean 4
Β· simp_all only [or_true, dvd_mul_right, and_self]
Β· simp_all only [ite_self, le_refl, ite_true, dvd_mul_right, or_false, and_self]
Β· rintro β¨h | hij, d, rflβ©
Β· simp_rw [h, monomial_zero, dvd_zero]
Β· refine β¨monomial (j - i) d, ?_β©
rw [monomial_mul, add_tsub_cancel_of_le hij]
#align mv_polynomial.monomial_dvd_monomial MvPolynomial.monomial_dvd_monomial
@[simp]
| Mathlib/Algebra/MvPolynomial/Division.lean | 244 | 247 | theorem monomial_one_dvd_monomial_one [Nontrivial R] {i j : Ο ββ β} :
monomial i (1 : R) β£ monomial j 1 β i β€ j := by |
rw [monomial_dvd_monomial]
simp_rw [one_ne_zero, false_or_iff, dvd_rfl, and_true_iff]
| 2 | 7.389056 | 1 | 1.25 | 4 | 1,339 |
import Mathlib.Algebra.MonoidAlgebra.Division
import Mathlib.Algebra.MvPolynomial.Basic
#align_import data.mv_polynomial.division from "leanprover-community/mathlib"@"72c366d0475675f1309d3027d3d7d47ee4423951"
variable {Ο R : Type*} [CommSemiring R]
namespace MvPolynomial
theorem monomial_dvd_monomial {r s : R} {i j : Ο ββ β} :
monomial i r β£ monomial j s β (s = 0 β¨ i β€ j) β§ r β£ s := by
constructor
Β· rintro β¨x, hxβ©
rw [MvPolynomial.ext_iff] at hx
have hj := hx j
have hi := hx i
classical
simp_rw [coeff_monomial, if_pos] at hj hi
simp_rw [coeff_monomial_mul'] at hi hj
split_ifs at hi hj with hi hi
Β· exact β¨Or.inr hi, _, hjβ©
Β· exact β¨Or.inl hj, hj.symm βΈ dvd_zero _β©
-- Porting note: two goals remain at this point in Lean 4
Β· simp_all only [or_true, dvd_mul_right, and_self]
Β· simp_all only [ite_self, le_refl, ite_true, dvd_mul_right, or_false, and_self]
Β· rintro β¨h | hij, d, rflβ©
Β· simp_rw [h, monomial_zero, dvd_zero]
Β· refine β¨monomial (j - i) d, ?_β©
rw [monomial_mul, add_tsub_cancel_of_le hij]
#align mv_polynomial.monomial_dvd_monomial MvPolynomial.monomial_dvd_monomial
@[simp]
theorem monomial_one_dvd_monomial_one [Nontrivial R] {i j : Ο ββ β} :
monomial i (1 : R) β£ monomial j 1 β i β€ j := by
rw [monomial_dvd_monomial]
simp_rw [one_ne_zero, false_or_iff, dvd_rfl, and_true_iff]
#align mv_polynomial.monomial_one_dvd_monomial_one MvPolynomial.monomial_one_dvd_monomial_one
@[simp]
| Mathlib/Algebra/MvPolynomial/Division.lean | 251 | 255 | theorem X_dvd_X [Nontrivial R] {i j : Ο} :
(X i : MvPolynomial Ο R) β£ (X j : MvPolynomial Ο R) β i = j := by |
refine monomial_one_dvd_monomial_one.trans ?_
simp_rw [Finsupp.single_le_iff, Nat.one_le_iff_ne_zero, Finsupp.single_apply_ne_zero,
ne_eq, not_false_eq_true, and_true]
| 3 | 20.085537 | 1 | 1.25 | 4 | 1,339 |
import Mathlib.Algebra.MonoidAlgebra.Division
import Mathlib.Algebra.MvPolynomial.Basic
#align_import data.mv_polynomial.division from "leanprover-community/mathlib"@"72c366d0475675f1309d3027d3d7d47ee4423951"
variable {Ο R : Type*} [CommSemiring R]
namespace MvPolynomial
theorem monomial_dvd_monomial {r s : R} {i j : Ο ββ β} :
monomial i r β£ monomial j s β (s = 0 β¨ i β€ j) β§ r β£ s := by
constructor
Β· rintro β¨x, hxβ©
rw [MvPolynomial.ext_iff] at hx
have hj := hx j
have hi := hx i
classical
simp_rw [coeff_monomial, if_pos] at hj hi
simp_rw [coeff_monomial_mul'] at hi hj
split_ifs at hi hj with hi hi
Β· exact β¨Or.inr hi, _, hjβ©
Β· exact β¨Or.inl hj, hj.symm βΈ dvd_zero _β©
-- Porting note: two goals remain at this point in Lean 4
Β· simp_all only [or_true, dvd_mul_right, and_self]
Β· simp_all only [ite_self, le_refl, ite_true, dvd_mul_right, or_false, and_self]
Β· rintro β¨h | hij, d, rflβ©
Β· simp_rw [h, monomial_zero, dvd_zero]
Β· refine β¨monomial (j - i) d, ?_β©
rw [monomial_mul, add_tsub_cancel_of_le hij]
#align mv_polynomial.monomial_dvd_monomial MvPolynomial.monomial_dvd_monomial
@[simp]
theorem monomial_one_dvd_monomial_one [Nontrivial R] {i j : Ο ββ β} :
monomial i (1 : R) β£ monomial j 1 β i β€ j := by
rw [monomial_dvd_monomial]
simp_rw [one_ne_zero, false_or_iff, dvd_rfl, and_true_iff]
#align mv_polynomial.monomial_one_dvd_monomial_one MvPolynomial.monomial_one_dvd_monomial_one
@[simp]
theorem X_dvd_X [Nontrivial R] {i j : Ο} :
(X i : MvPolynomial Ο R) β£ (X j : MvPolynomial Ο R) β i = j := by
refine monomial_one_dvd_monomial_one.trans ?_
simp_rw [Finsupp.single_le_iff, Nat.one_le_iff_ne_zero, Finsupp.single_apply_ne_zero,
ne_eq, not_false_eq_true, and_true]
set_option linter.uppercaseLean3 false in
#align mv_polynomial.X_dvd_X MvPolynomial.X_dvd_X
@[simp]
| Mathlib/Algebra/MvPolynomial/Division.lean | 260 | 263 | theorem X_dvd_monomial {i : Ο} {j : Ο ββ β} {r : R} :
(X i : MvPolynomial Ο R) β£ monomial j r β r = 0 β¨ j i β 0 := by |
refine monomial_dvd_monomial.trans ?_
simp_rw [one_dvd, and_true_iff, Finsupp.single_le_iff, Nat.one_le_iff_ne_zero]
| 2 | 7.389056 | 1 | 1.25 | 4 | 1,339 |
import Mathlib.Algebra.Bounds
import Mathlib.Algebra.Order.Field.Basic -- Porting note: `LinearOrderedField`, etc
import Mathlib.Data.Set.Pointwise.SMul
#align_import algebra.order.pointwise from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
open Function Set
open Pointwise
variable {Ξ± : Type*}
-- Porting note: Swapped the place of `CompleteLattice` and `ConditionallyCompleteLattice`
-- due to simpNF problem between `sSup_xx` `csSup_xx`.
section CompleteLattice
variable [CompleteLattice Ξ±]
section Group
variable [Group Ξ±] [CovariantClass Ξ± Ξ± (Β· * Β·) (Β· β€ Β·)] [CovariantClass Ξ± Ξ± (swap (Β· * Β·)) (Β· β€ Β·)]
(s t : Set Ξ±)
@[to_additive]
| Mathlib/Algebra/Order/Pointwise.lean | 61 | 63 | theorem sSup_inv (s : Set Ξ±) : sSup sβ»ΒΉ = (sInf s)β»ΒΉ := by |
rw [β image_inv, sSup_image]
exact ((OrderIso.inv Ξ±).map_sInf _).symm
| 2 | 7.389056 | 1 | 1.25 | 16 | 1,340 |
import Mathlib.Algebra.Bounds
import Mathlib.Algebra.Order.Field.Basic -- Porting note: `LinearOrderedField`, etc
import Mathlib.Data.Set.Pointwise.SMul
#align_import algebra.order.pointwise from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
open Function Set
open Pointwise
variable {Ξ± : Type*}
-- Porting note: Swapped the place of `CompleteLattice` and `ConditionallyCompleteLattice`
-- due to simpNF problem between `sSup_xx` `csSup_xx`.
section CompleteLattice
variable [CompleteLattice Ξ±]
section Group
variable [Group Ξ±] [CovariantClass Ξ± Ξ± (Β· * Β·) (Β· β€ Β·)] [CovariantClass Ξ± Ξ± (swap (Β· * Β·)) (Β· β€ Β·)]
(s t : Set Ξ±)
@[to_additive]
theorem sSup_inv (s : Set Ξ±) : sSup sβ»ΒΉ = (sInf s)β»ΒΉ := by
rw [β image_inv, sSup_image]
exact ((OrderIso.inv Ξ±).map_sInf _).symm
#align Sup_inv sSup_inv
#align Sup_neg sSup_neg
@[to_additive]
| Mathlib/Algebra/Order/Pointwise.lean | 68 | 70 | theorem sInf_inv (s : Set Ξ±) : sInf sβ»ΒΉ = (sSup s)β»ΒΉ := by |
rw [β image_inv, sInf_image]
exact ((OrderIso.inv Ξ±).map_sSup _).symm
| 2 | 7.389056 | 1 | 1.25 | 16 | 1,340 |
import Mathlib.Algebra.Bounds
import Mathlib.Algebra.Order.Field.Basic -- Porting note: `LinearOrderedField`, etc
import Mathlib.Data.Set.Pointwise.SMul
#align_import algebra.order.pointwise from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
open Function Set
open Pointwise
variable {Ξ± : Type*}
-- Porting note: Swapped the place of `CompleteLattice` and `ConditionallyCompleteLattice`
-- due to simpNF problem between `sSup_xx` `csSup_xx`.
section CompleteLattice
variable [CompleteLattice Ξ±]
section Group
variable [Group Ξ±] [CovariantClass Ξ± Ξ± (Β· * Β·) (Β· β€ Β·)] [CovariantClass Ξ± Ξ± (swap (Β· * Β·)) (Β· β€ Β·)]
(s t : Set Ξ±)
@[to_additive]
theorem sSup_inv (s : Set Ξ±) : sSup sβ»ΒΉ = (sInf s)β»ΒΉ := by
rw [β image_inv, sSup_image]
exact ((OrderIso.inv Ξ±).map_sInf _).symm
#align Sup_inv sSup_inv
#align Sup_neg sSup_neg
@[to_additive]
theorem sInf_inv (s : Set Ξ±) : sInf sβ»ΒΉ = (sSup s)β»ΒΉ := by
rw [β image_inv, sInf_image]
exact ((OrderIso.inv Ξ±).map_sSup _).symm
#align Inf_inv sInf_inv
#align Inf_neg sInf_neg
@[to_additive]
theorem sSup_mul : sSup (s * t) = sSup s * sSup t :=
(sSup_image2_eq_sSup_sSup fun _ => (OrderIso.mulRight _).to_galoisConnection) fun _ =>
(OrderIso.mulLeft _).to_galoisConnection
#align Sup_mul sSup_mul
#align Sup_add sSup_add
@[to_additive]
theorem sInf_mul : sInf (s * t) = sInf s * sInf t :=
(sInf_image2_eq_sInf_sInf fun _ => (OrderIso.mulRight _).symm.to_galoisConnection) fun _ =>
(OrderIso.mulLeft _).symm.to_galoisConnection
#align Inf_mul sInf_mul
#align Inf_add sInf_add
@[to_additive]
| Mathlib/Algebra/Order/Pointwise.lean | 89 | 89 | theorem sSup_div : sSup (s / t) = sSup s / sInf t := by | simp_rw [div_eq_mul_inv, sSup_mul, sSup_inv]
| 1 | 2.718282 | 0 | 1.25 | 16 | 1,340 |
import Mathlib.Algebra.Bounds
import Mathlib.Algebra.Order.Field.Basic -- Porting note: `LinearOrderedField`, etc
import Mathlib.Data.Set.Pointwise.SMul
#align_import algebra.order.pointwise from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
open Function Set
open Pointwise
variable {Ξ± : Type*}
-- Porting note: Swapped the place of `CompleteLattice` and `ConditionallyCompleteLattice`
-- due to simpNF problem between `sSup_xx` `csSup_xx`.
section CompleteLattice
variable [CompleteLattice Ξ±]
section Group
variable [Group Ξ±] [CovariantClass Ξ± Ξ± (Β· * Β·) (Β· β€ Β·)] [CovariantClass Ξ± Ξ± (swap (Β· * Β·)) (Β· β€ Β·)]
(s t : Set Ξ±)
@[to_additive]
theorem sSup_inv (s : Set Ξ±) : sSup sβ»ΒΉ = (sInf s)β»ΒΉ := by
rw [β image_inv, sSup_image]
exact ((OrderIso.inv Ξ±).map_sInf _).symm
#align Sup_inv sSup_inv
#align Sup_neg sSup_neg
@[to_additive]
theorem sInf_inv (s : Set Ξ±) : sInf sβ»ΒΉ = (sSup s)β»ΒΉ := by
rw [β image_inv, sInf_image]
exact ((OrderIso.inv Ξ±).map_sSup _).symm
#align Inf_inv sInf_inv
#align Inf_neg sInf_neg
@[to_additive]
theorem sSup_mul : sSup (s * t) = sSup s * sSup t :=
(sSup_image2_eq_sSup_sSup fun _ => (OrderIso.mulRight _).to_galoisConnection) fun _ =>
(OrderIso.mulLeft _).to_galoisConnection
#align Sup_mul sSup_mul
#align Sup_add sSup_add
@[to_additive]
theorem sInf_mul : sInf (s * t) = sInf s * sInf t :=
(sInf_image2_eq_sInf_sInf fun _ => (OrderIso.mulRight _).symm.to_galoisConnection) fun _ =>
(OrderIso.mulLeft _).symm.to_galoisConnection
#align Inf_mul sInf_mul
#align Inf_add sInf_add
@[to_additive]
theorem sSup_div : sSup (s / t) = sSup s / sInf t := by simp_rw [div_eq_mul_inv, sSup_mul, sSup_inv]
#align Sup_div sSup_div
#align Sup_sub sSup_sub
@[to_additive]
| Mathlib/Algebra/Order/Pointwise.lean | 94 | 94 | theorem sInf_div : sInf (s / t) = sInf s / sSup t := by | simp_rw [div_eq_mul_inv, sInf_mul, sInf_inv]
| 1 | 2.718282 | 0 | 1.25 | 16 | 1,340 |
import Mathlib.Algebra.Bounds
import Mathlib.Algebra.Order.Field.Basic -- Porting note: `LinearOrderedField`, etc
import Mathlib.Data.Set.Pointwise.SMul
#align_import algebra.order.pointwise from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
open Function Set
open Pointwise
variable {Ξ± : Type*}
-- Porting note: Swapped the place of `CompleteLattice` and `ConditionallyCompleteLattice`
-- due to simpNF problem between `sSup_xx` `csSup_xx`.
section CompleteLattice
variable [CompleteLattice Ξ±]
section Group
variable [Group Ξ±] [CovariantClass Ξ± Ξ± (Β· * Β·) (Β· β€ Β·)] [CovariantClass Ξ± Ξ± (swap (Β· * Β·)) (Β· β€ Β·)]
{s t : Set Ξ±}
@[to_additive]
| Mathlib/Algebra/Order/Pointwise.lean | 130 | 132 | theorem csSup_inv (hsβ : s.Nonempty) (hsβ : BddBelow s) : sSup sβ»ΒΉ = (sInf s)β»ΒΉ := by |
rw [β image_inv]
exact ((OrderIso.inv Ξ±).map_csInf' hsβ hsβ).symm
| 2 | 7.389056 | 1 | 1.25 | 16 | 1,340 |
import Mathlib.Algebra.Bounds
import Mathlib.Algebra.Order.Field.Basic -- Porting note: `LinearOrderedField`, etc
import Mathlib.Data.Set.Pointwise.SMul
#align_import algebra.order.pointwise from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
open Function Set
open Pointwise
variable {Ξ± : Type*}
-- Porting note: Swapped the place of `CompleteLattice` and `ConditionallyCompleteLattice`
-- due to simpNF problem between `sSup_xx` `csSup_xx`.
section CompleteLattice
variable [CompleteLattice Ξ±]
section Group
variable [Group Ξ±] [CovariantClass Ξ± Ξ± (Β· * Β·) (Β· β€ Β·)] [CovariantClass Ξ± Ξ± (swap (Β· * Β·)) (Β· β€ Β·)]
{s t : Set Ξ±}
@[to_additive]
theorem csSup_inv (hsβ : s.Nonempty) (hsβ : BddBelow s) : sSup sβ»ΒΉ = (sInf s)β»ΒΉ := by
rw [β image_inv]
exact ((OrderIso.inv Ξ±).map_csInf' hsβ hsβ).symm
#align cSup_inv csSup_inv
#align cSup_neg csSup_neg
@[to_additive]
| Mathlib/Algebra/Order/Pointwise.lean | 137 | 139 | theorem csInf_inv (hsβ : s.Nonempty) (hsβ : BddAbove s) : sInf sβ»ΒΉ = (sSup s)β»ΒΉ := by |
rw [β image_inv]
exact ((OrderIso.inv Ξ±).map_csSup' hsβ hsβ).symm
| 2 | 7.389056 | 1 | 1.25 | 16 | 1,340 |
import Mathlib.Algebra.Bounds
import Mathlib.Algebra.Order.Field.Basic -- Porting note: `LinearOrderedField`, etc
import Mathlib.Data.Set.Pointwise.SMul
#align_import algebra.order.pointwise from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
open Function Set
open Pointwise
variable {Ξ± : Type*}
-- Porting note: Swapped the place of `CompleteLattice` and `ConditionallyCompleteLattice`
-- due to simpNF problem between `sSup_xx` `csSup_xx`.
section CompleteLattice
variable [CompleteLattice Ξ±]
section Group
variable [Group Ξ±] [CovariantClass Ξ± Ξ± (Β· * Β·) (Β· β€ Β·)] [CovariantClass Ξ± Ξ± (swap (Β· * Β·)) (Β· β€ Β·)]
{s t : Set Ξ±}
@[to_additive]
theorem csSup_inv (hsβ : s.Nonempty) (hsβ : BddBelow s) : sSup sβ»ΒΉ = (sInf s)β»ΒΉ := by
rw [β image_inv]
exact ((OrderIso.inv Ξ±).map_csInf' hsβ hsβ).symm
#align cSup_inv csSup_inv
#align cSup_neg csSup_neg
@[to_additive]
theorem csInf_inv (hsβ : s.Nonempty) (hsβ : BddAbove s) : sInf sβ»ΒΉ = (sSup s)β»ΒΉ := by
rw [β image_inv]
exact ((OrderIso.inv Ξ±).map_csSup' hsβ hsβ).symm
#align cInf_inv csInf_inv
#align cInf_neg csInf_neg
@[to_additive]
theorem csSup_mul (hsβ : s.Nonempty) (hsβ : BddAbove s) (htβ : t.Nonempty) (htβ : BddAbove t) :
sSup (s * t) = sSup s * sSup t :=
csSup_image2_eq_csSup_csSup (fun _ => (OrderIso.mulRight _).to_galoisConnection)
(fun _ => (OrderIso.mulLeft _).to_galoisConnection) hsβ hsβ htβ htβ
#align cSup_mul csSup_mul
#align cSup_add csSup_add
@[to_additive]
theorem csInf_mul (hsβ : s.Nonempty) (hsβ : BddBelow s) (htβ : t.Nonempty) (htβ : BddBelow t) :
sInf (s * t) = sInf s * sInf t :=
csInf_image2_eq_csInf_csInf (fun _ => (OrderIso.mulRight _).symm.to_galoisConnection)
(fun _ => (OrderIso.mulLeft _).symm.to_galoisConnection) hsβ hsβ htβ htβ
#align cInf_mul csInf_mul
#align cInf_add csInf_add
@[to_additive]
| Mathlib/Algebra/Order/Pointwise.lean | 160 | 162 | theorem csSup_div (hsβ : s.Nonempty) (hsβ : BddAbove s) (htβ : t.Nonempty) (htβ : BddBelow t) :
sSup (s / t) = sSup s / sInf t := by |
rw [div_eq_mul_inv, csSup_mul hsβ hsβ htβ.inv htβ.inv, csSup_inv htβ htβ, div_eq_mul_inv]
| 1 | 2.718282 | 0 | 1.25 | 16 | 1,340 |
import Mathlib.Algebra.Bounds
import Mathlib.Algebra.Order.Field.Basic -- Porting note: `LinearOrderedField`, etc
import Mathlib.Data.Set.Pointwise.SMul
#align_import algebra.order.pointwise from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
open Function Set
open Pointwise
variable {Ξ± : Type*}
-- Porting note: Swapped the place of `CompleteLattice` and `ConditionallyCompleteLattice`
-- due to simpNF problem between `sSup_xx` `csSup_xx`.
section CompleteLattice
variable [CompleteLattice Ξ±]
section Group
variable [Group Ξ±] [CovariantClass Ξ± Ξ± (Β· * Β·) (Β· β€ Β·)] [CovariantClass Ξ± Ξ± (swap (Β· * Β·)) (Β· β€ Β·)]
{s t : Set Ξ±}
@[to_additive]
theorem csSup_inv (hsβ : s.Nonempty) (hsβ : BddBelow s) : sSup sβ»ΒΉ = (sInf s)β»ΒΉ := by
rw [β image_inv]
exact ((OrderIso.inv Ξ±).map_csInf' hsβ hsβ).symm
#align cSup_inv csSup_inv
#align cSup_neg csSup_neg
@[to_additive]
theorem csInf_inv (hsβ : s.Nonempty) (hsβ : BddAbove s) : sInf sβ»ΒΉ = (sSup s)β»ΒΉ := by
rw [β image_inv]
exact ((OrderIso.inv Ξ±).map_csSup' hsβ hsβ).symm
#align cInf_inv csInf_inv
#align cInf_neg csInf_neg
@[to_additive]
theorem csSup_mul (hsβ : s.Nonempty) (hsβ : BddAbove s) (htβ : t.Nonempty) (htβ : BddAbove t) :
sSup (s * t) = sSup s * sSup t :=
csSup_image2_eq_csSup_csSup (fun _ => (OrderIso.mulRight _).to_galoisConnection)
(fun _ => (OrderIso.mulLeft _).to_galoisConnection) hsβ hsβ htβ htβ
#align cSup_mul csSup_mul
#align cSup_add csSup_add
@[to_additive]
theorem csInf_mul (hsβ : s.Nonempty) (hsβ : BddBelow s) (htβ : t.Nonempty) (htβ : BddBelow t) :
sInf (s * t) = sInf s * sInf t :=
csInf_image2_eq_csInf_csInf (fun _ => (OrderIso.mulRight _).symm.to_galoisConnection)
(fun _ => (OrderIso.mulLeft _).symm.to_galoisConnection) hsβ hsβ htβ htβ
#align cInf_mul csInf_mul
#align cInf_add csInf_add
@[to_additive]
theorem csSup_div (hsβ : s.Nonempty) (hsβ : BddAbove s) (htβ : t.Nonempty) (htβ : BddBelow t) :
sSup (s / t) = sSup s / sInf t := by
rw [div_eq_mul_inv, csSup_mul hsβ hsβ htβ.inv htβ.inv, csSup_inv htβ htβ, div_eq_mul_inv]
#align cSup_div csSup_div
#align cSup_sub csSup_sub
@[to_additive]
| Mathlib/Algebra/Order/Pointwise.lean | 167 | 169 | theorem csInf_div (hsβ : s.Nonempty) (hsβ : BddBelow s) (htβ : t.Nonempty) (htβ : BddAbove t) :
sInf (s / t) = sInf s / sSup t := by |
rw [div_eq_mul_inv, csInf_mul hsβ hsβ htβ.inv htβ.inv, csInf_inv htβ htβ, div_eq_mul_inv]
| 1 | 2.718282 | 0 | 1.25 | 16 | 1,340 |
import Mathlib.Algebra.Bounds
import Mathlib.Algebra.Order.Field.Basic -- Porting note: `LinearOrderedField`, etc
import Mathlib.Data.Set.Pointwise.SMul
#align_import algebra.order.pointwise from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
open Function Set
open Pointwise
variable {Ξ± : Type*}
-- Porting note: Swapped the place of `CompleteLattice` and `ConditionallyCompleteLattice`
-- due to simpNF problem between `sSup_xx` `csSup_xx`.
section CompleteLattice
variable [CompleteLattice Ξ±]
namespace LinearOrderedField
variable {K : Type*} [LinearOrderedField K] {a b r : K} (hr : 0 < r)
open Set
| Mathlib/Algebra/Order/Pointwise.lean | 183 | 194 | theorem smul_Ioo : r β’ Ioo a b = Ioo (r β’ a) (r β’ b) := by |
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Ioo]
constructor
Β· rintro β¨a, β¨a_h_left_left, a_h_left_rightβ©, rflβ©
constructor
Β· exact (mul_lt_mul_left hr).mpr a_h_left_left
Β· exact (mul_lt_mul_left hr).mpr a_h_left_right
Β· rintro β¨a_left, a_rightβ©
use x / r
refine β¨β¨(lt_div_iff' hr).mpr a_left, (div_lt_iff' hr).mpr a_rightβ©, ?_β©
rw [mul_div_cancelβ _ (ne_of_gt hr)]
| 11 | 59,874.141715 | 2 | 1.25 | 16 | 1,340 |
import Mathlib.Algebra.Bounds
import Mathlib.Algebra.Order.Field.Basic -- Porting note: `LinearOrderedField`, etc
import Mathlib.Data.Set.Pointwise.SMul
#align_import algebra.order.pointwise from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
open Function Set
open Pointwise
variable {Ξ± : Type*}
-- Porting note: Swapped the place of `CompleteLattice` and `ConditionallyCompleteLattice`
-- due to simpNF problem between `sSup_xx` `csSup_xx`.
section CompleteLattice
variable [CompleteLattice Ξ±]
namespace LinearOrderedField
variable {K : Type*} [LinearOrderedField K] {a b r : K} (hr : 0 < r)
open Set
theorem smul_Ioo : r β’ Ioo a b = Ioo (r β’ a) (r β’ b) := by
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Ioo]
constructor
Β· rintro β¨a, β¨a_h_left_left, a_h_left_rightβ©, rflβ©
constructor
Β· exact (mul_lt_mul_left hr).mpr a_h_left_left
Β· exact (mul_lt_mul_left hr).mpr a_h_left_right
Β· rintro β¨a_left, a_rightβ©
use x / r
refine β¨β¨(lt_div_iff' hr).mpr a_left, (div_lt_iff' hr).mpr a_rightβ©, ?_β©
rw [mul_div_cancelβ _ (ne_of_gt hr)]
#align linear_ordered_field.smul_Ioo LinearOrderedField.smul_Ioo
| Mathlib/Algebra/Order/Pointwise.lean | 197 | 208 | theorem smul_Icc : r β’ Icc a b = Icc (r β’ a) (r β’ b) := by |
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Icc]
constructor
Β· rintro β¨a, β¨a_h_left_left, a_h_left_rightβ©, rflβ©
constructor
Β· exact (mul_le_mul_left hr).mpr a_h_left_left
Β· exact (mul_le_mul_left hr).mpr a_h_left_right
Β· rintro β¨a_left, a_rightβ©
use x / r
refine β¨β¨(le_div_iff' hr).mpr a_left, (div_le_iff' hr).mpr a_rightβ©, ?_β©
rw [mul_div_cancelβ _ (ne_of_gt hr)]
| 11 | 59,874.141715 | 2 | 1.25 | 16 | 1,340 |
import Mathlib.Algebra.Bounds
import Mathlib.Algebra.Order.Field.Basic -- Porting note: `LinearOrderedField`, etc
import Mathlib.Data.Set.Pointwise.SMul
#align_import algebra.order.pointwise from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
open Function Set
open Pointwise
variable {Ξ± : Type*}
-- Porting note: Swapped the place of `CompleteLattice` and `ConditionallyCompleteLattice`
-- due to simpNF problem between `sSup_xx` `csSup_xx`.
section CompleteLattice
variable [CompleteLattice Ξ±]
namespace LinearOrderedField
variable {K : Type*} [LinearOrderedField K] {a b r : K} (hr : 0 < r)
open Set
theorem smul_Ioo : r β’ Ioo a b = Ioo (r β’ a) (r β’ b) := by
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Ioo]
constructor
Β· rintro β¨a, β¨a_h_left_left, a_h_left_rightβ©, rflβ©
constructor
Β· exact (mul_lt_mul_left hr).mpr a_h_left_left
Β· exact (mul_lt_mul_left hr).mpr a_h_left_right
Β· rintro β¨a_left, a_rightβ©
use x / r
refine β¨β¨(lt_div_iff' hr).mpr a_left, (div_lt_iff' hr).mpr a_rightβ©, ?_β©
rw [mul_div_cancelβ _ (ne_of_gt hr)]
#align linear_ordered_field.smul_Ioo LinearOrderedField.smul_Ioo
theorem smul_Icc : r β’ Icc a b = Icc (r β’ a) (r β’ b) := by
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Icc]
constructor
Β· rintro β¨a, β¨a_h_left_left, a_h_left_rightβ©, rflβ©
constructor
Β· exact (mul_le_mul_left hr).mpr a_h_left_left
Β· exact (mul_le_mul_left hr).mpr a_h_left_right
Β· rintro β¨a_left, a_rightβ©
use x / r
refine β¨β¨(le_div_iff' hr).mpr a_left, (div_le_iff' hr).mpr a_rightβ©, ?_β©
rw [mul_div_cancelβ _ (ne_of_gt hr)]
#align linear_ordered_field.smul_Icc LinearOrderedField.smul_Icc
| Mathlib/Algebra/Order/Pointwise.lean | 211 | 222 | theorem smul_Ico : r β’ Ico a b = Ico (r β’ a) (r β’ b) := by |
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Ico]
constructor
Β· rintro β¨a, β¨a_h_left_left, a_h_left_rightβ©, rflβ©
constructor
Β· exact (mul_le_mul_left hr).mpr a_h_left_left
Β· exact (mul_lt_mul_left hr).mpr a_h_left_right
Β· rintro β¨a_left, a_rightβ©
use x / r
refine β¨β¨(le_div_iff' hr).mpr a_left, (div_lt_iff' hr).mpr a_rightβ©, ?_β©
rw [mul_div_cancelβ _ (ne_of_gt hr)]
| 11 | 59,874.141715 | 2 | 1.25 | 16 | 1,340 |
import Mathlib.Algebra.Bounds
import Mathlib.Algebra.Order.Field.Basic -- Porting note: `LinearOrderedField`, etc
import Mathlib.Data.Set.Pointwise.SMul
#align_import algebra.order.pointwise from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
open Function Set
open Pointwise
variable {Ξ± : Type*}
-- Porting note: Swapped the place of `CompleteLattice` and `ConditionallyCompleteLattice`
-- due to simpNF problem between `sSup_xx` `csSup_xx`.
section CompleteLattice
variable [CompleteLattice Ξ±]
namespace LinearOrderedField
variable {K : Type*} [LinearOrderedField K] {a b r : K} (hr : 0 < r)
open Set
theorem smul_Ioo : r β’ Ioo a b = Ioo (r β’ a) (r β’ b) := by
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Ioo]
constructor
Β· rintro β¨a, β¨a_h_left_left, a_h_left_rightβ©, rflβ©
constructor
Β· exact (mul_lt_mul_left hr).mpr a_h_left_left
Β· exact (mul_lt_mul_left hr).mpr a_h_left_right
Β· rintro β¨a_left, a_rightβ©
use x / r
refine β¨β¨(lt_div_iff' hr).mpr a_left, (div_lt_iff' hr).mpr a_rightβ©, ?_β©
rw [mul_div_cancelβ _ (ne_of_gt hr)]
#align linear_ordered_field.smul_Ioo LinearOrderedField.smul_Ioo
theorem smul_Icc : r β’ Icc a b = Icc (r β’ a) (r β’ b) := by
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Icc]
constructor
Β· rintro β¨a, β¨a_h_left_left, a_h_left_rightβ©, rflβ©
constructor
Β· exact (mul_le_mul_left hr).mpr a_h_left_left
Β· exact (mul_le_mul_left hr).mpr a_h_left_right
Β· rintro β¨a_left, a_rightβ©
use x / r
refine β¨β¨(le_div_iff' hr).mpr a_left, (div_le_iff' hr).mpr a_rightβ©, ?_β©
rw [mul_div_cancelβ _ (ne_of_gt hr)]
#align linear_ordered_field.smul_Icc LinearOrderedField.smul_Icc
theorem smul_Ico : r β’ Ico a b = Ico (r β’ a) (r β’ b) := by
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Ico]
constructor
Β· rintro β¨a, β¨a_h_left_left, a_h_left_rightβ©, rflβ©
constructor
Β· exact (mul_le_mul_left hr).mpr a_h_left_left
Β· exact (mul_lt_mul_left hr).mpr a_h_left_right
Β· rintro β¨a_left, a_rightβ©
use x / r
refine β¨β¨(le_div_iff' hr).mpr a_left, (div_lt_iff' hr).mpr a_rightβ©, ?_β©
rw [mul_div_cancelβ _ (ne_of_gt hr)]
#align linear_ordered_field.smul_Ico LinearOrderedField.smul_Ico
| Mathlib/Algebra/Order/Pointwise.lean | 225 | 236 | theorem smul_Ioc : r β’ Ioc a b = Ioc (r β’ a) (r β’ b) := by |
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Ioc]
constructor
Β· rintro β¨a, β¨a_h_left_left, a_h_left_rightβ©, rflβ©
constructor
Β· exact (mul_lt_mul_left hr).mpr a_h_left_left
Β· exact (mul_le_mul_left hr).mpr a_h_left_right
Β· rintro β¨a_left, a_rightβ©
use x / r
refine β¨β¨(lt_div_iff' hr).mpr a_left, (div_le_iff' hr).mpr a_rightβ©, ?_β©
rw [mul_div_cancelβ _ (ne_of_gt hr)]
| 11 | 59,874.141715 | 2 | 1.25 | 16 | 1,340 |
import Mathlib.Algebra.Bounds
import Mathlib.Algebra.Order.Field.Basic -- Porting note: `LinearOrderedField`, etc
import Mathlib.Data.Set.Pointwise.SMul
#align_import algebra.order.pointwise from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
open Function Set
open Pointwise
variable {Ξ± : Type*}
-- Porting note: Swapped the place of `CompleteLattice` and `ConditionallyCompleteLattice`
-- due to simpNF problem between `sSup_xx` `csSup_xx`.
section CompleteLattice
variable [CompleteLattice Ξ±]
namespace LinearOrderedField
variable {K : Type*} [LinearOrderedField K] {a b r : K} (hr : 0 < r)
open Set
theorem smul_Ioo : r β’ Ioo a b = Ioo (r β’ a) (r β’ b) := by
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Ioo]
constructor
Β· rintro β¨a, β¨a_h_left_left, a_h_left_rightβ©, rflβ©
constructor
Β· exact (mul_lt_mul_left hr).mpr a_h_left_left
Β· exact (mul_lt_mul_left hr).mpr a_h_left_right
Β· rintro β¨a_left, a_rightβ©
use x / r
refine β¨β¨(lt_div_iff' hr).mpr a_left, (div_lt_iff' hr).mpr a_rightβ©, ?_β©
rw [mul_div_cancelβ _ (ne_of_gt hr)]
#align linear_ordered_field.smul_Ioo LinearOrderedField.smul_Ioo
theorem smul_Icc : r β’ Icc a b = Icc (r β’ a) (r β’ b) := by
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Icc]
constructor
Β· rintro β¨a, β¨a_h_left_left, a_h_left_rightβ©, rflβ©
constructor
Β· exact (mul_le_mul_left hr).mpr a_h_left_left
Β· exact (mul_le_mul_left hr).mpr a_h_left_right
Β· rintro β¨a_left, a_rightβ©
use x / r
refine β¨β¨(le_div_iff' hr).mpr a_left, (div_le_iff' hr).mpr a_rightβ©, ?_β©
rw [mul_div_cancelβ _ (ne_of_gt hr)]
#align linear_ordered_field.smul_Icc LinearOrderedField.smul_Icc
theorem smul_Ico : r β’ Ico a b = Ico (r β’ a) (r β’ b) := by
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Ico]
constructor
Β· rintro β¨a, β¨a_h_left_left, a_h_left_rightβ©, rflβ©
constructor
Β· exact (mul_le_mul_left hr).mpr a_h_left_left
Β· exact (mul_lt_mul_left hr).mpr a_h_left_right
Β· rintro β¨a_left, a_rightβ©
use x / r
refine β¨β¨(le_div_iff' hr).mpr a_left, (div_lt_iff' hr).mpr a_rightβ©, ?_β©
rw [mul_div_cancelβ _ (ne_of_gt hr)]
#align linear_ordered_field.smul_Ico LinearOrderedField.smul_Ico
theorem smul_Ioc : r β’ Ioc a b = Ioc (r β’ a) (r β’ b) := by
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Ioc]
constructor
Β· rintro β¨a, β¨a_h_left_left, a_h_left_rightβ©, rflβ©
constructor
Β· exact (mul_lt_mul_left hr).mpr a_h_left_left
Β· exact (mul_le_mul_left hr).mpr a_h_left_right
Β· rintro β¨a_left, a_rightβ©
use x / r
refine β¨β¨(lt_div_iff' hr).mpr a_left, (div_le_iff' hr).mpr a_rightβ©, ?_β©
rw [mul_div_cancelβ _ (ne_of_gt hr)]
#align linear_ordered_field.smul_Ioc LinearOrderedField.smul_Ioc
| Mathlib/Algebra/Order/Pointwise.lean | 239 | 249 | theorem smul_Ioi : r β’ Ioi a = Ioi (r β’ a) := by |
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Ioi]
constructor
Β· rintro β¨a_w, a_h_left, rflβ©
exact (mul_lt_mul_left hr).mpr a_h_left
Β· rintro h
use x / r
constructor
Β· exact (lt_div_iff' hr).mpr h
Β· exact mul_div_cancelβ _ (ne_of_gt hr)
| 10 | 22,026.465795 | 2 | 1.25 | 16 | 1,340 |
import Mathlib.Algebra.Bounds
import Mathlib.Algebra.Order.Field.Basic -- Porting note: `LinearOrderedField`, etc
import Mathlib.Data.Set.Pointwise.SMul
#align_import algebra.order.pointwise from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
open Function Set
open Pointwise
variable {Ξ± : Type*}
-- Porting note: Swapped the place of `CompleteLattice` and `ConditionallyCompleteLattice`
-- due to simpNF problem between `sSup_xx` `csSup_xx`.
section CompleteLattice
variable [CompleteLattice Ξ±]
namespace LinearOrderedField
variable {K : Type*} [LinearOrderedField K] {a b r : K} (hr : 0 < r)
open Set
theorem smul_Ioo : r β’ Ioo a b = Ioo (r β’ a) (r β’ b) := by
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Ioo]
constructor
Β· rintro β¨a, β¨a_h_left_left, a_h_left_rightβ©, rflβ©
constructor
Β· exact (mul_lt_mul_left hr).mpr a_h_left_left
Β· exact (mul_lt_mul_left hr).mpr a_h_left_right
Β· rintro β¨a_left, a_rightβ©
use x / r
refine β¨β¨(lt_div_iff' hr).mpr a_left, (div_lt_iff' hr).mpr a_rightβ©, ?_β©
rw [mul_div_cancelβ _ (ne_of_gt hr)]
#align linear_ordered_field.smul_Ioo LinearOrderedField.smul_Ioo
theorem smul_Icc : r β’ Icc a b = Icc (r β’ a) (r β’ b) := by
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Icc]
constructor
Β· rintro β¨a, β¨a_h_left_left, a_h_left_rightβ©, rflβ©
constructor
Β· exact (mul_le_mul_left hr).mpr a_h_left_left
Β· exact (mul_le_mul_left hr).mpr a_h_left_right
Β· rintro β¨a_left, a_rightβ©
use x / r
refine β¨β¨(le_div_iff' hr).mpr a_left, (div_le_iff' hr).mpr a_rightβ©, ?_β©
rw [mul_div_cancelβ _ (ne_of_gt hr)]
#align linear_ordered_field.smul_Icc LinearOrderedField.smul_Icc
theorem smul_Ico : r β’ Ico a b = Ico (r β’ a) (r β’ b) := by
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Ico]
constructor
Β· rintro β¨a, β¨a_h_left_left, a_h_left_rightβ©, rflβ©
constructor
Β· exact (mul_le_mul_left hr).mpr a_h_left_left
Β· exact (mul_lt_mul_left hr).mpr a_h_left_right
Β· rintro β¨a_left, a_rightβ©
use x / r
refine β¨β¨(le_div_iff' hr).mpr a_left, (div_lt_iff' hr).mpr a_rightβ©, ?_β©
rw [mul_div_cancelβ _ (ne_of_gt hr)]
#align linear_ordered_field.smul_Ico LinearOrderedField.smul_Ico
theorem smul_Ioc : r β’ Ioc a b = Ioc (r β’ a) (r β’ b) := by
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Ioc]
constructor
Β· rintro β¨a, β¨a_h_left_left, a_h_left_rightβ©, rflβ©
constructor
Β· exact (mul_lt_mul_left hr).mpr a_h_left_left
Β· exact (mul_le_mul_left hr).mpr a_h_left_right
Β· rintro β¨a_left, a_rightβ©
use x / r
refine β¨β¨(lt_div_iff' hr).mpr a_left, (div_le_iff' hr).mpr a_rightβ©, ?_β©
rw [mul_div_cancelβ _ (ne_of_gt hr)]
#align linear_ordered_field.smul_Ioc LinearOrderedField.smul_Ioc
theorem smul_Ioi : r β’ Ioi a = Ioi (r β’ a) := by
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Ioi]
constructor
Β· rintro β¨a_w, a_h_left, rflβ©
exact (mul_lt_mul_left hr).mpr a_h_left
Β· rintro h
use x / r
constructor
Β· exact (lt_div_iff' hr).mpr h
Β· exact mul_div_cancelβ _ (ne_of_gt hr)
#align linear_ordered_field.smul_Ioi LinearOrderedField.smul_Ioi
| Mathlib/Algebra/Order/Pointwise.lean | 252 | 262 | theorem smul_Iio : r β’ Iio a = Iio (r β’ a) := by |
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Iio]
constructor
Β· rintro β¨a_w, a_h_left, rflβ©
exact (mul_lt_mul_left hr).mpr a_h_left
Β· rintro h
use x / r
constructor
Β· exact (div_lt_iff' hr).mpr h
Β· exact mul_div_cancelβ _ (ne_of_gt hr)
| 10 | 22,026.465795 | 2 | 1.25 | 16 | 1,340 |
import Mathlib.Algebra.Bounds
import Mathlib.Algebra.Order.Field.Basic -- Porting note: `LinearOrderedField`, etc
import Mathlib.Data.Set.Pointwise.SMul
#align_import algebra.order.pointwise from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
open Function Set
open Pointwise
variable {Ξ± : Type*}
-- Porting note: Swapped the place of `CompleteLattice` and `ConditionallyCompleteLattice`
-- due to simpNF problem between `sSup_xx` `csSup_xx`.
section CompleteLattice
variable [CompleteLattice Ξ±]
namespace LinearOrderedField
variable {K : Type*} [LinearOrderedField K] {a b r : K} (hr : 0 < r)
open Set
theorem smul_Ioo : r β’ Ioo a b = Ioo (r β’ a) (r β’ b) := by
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Ioo]
constructor
Β· rintro β¨a, β¨a_h_left_left, a_h_left_rightβ©, rflβ©
constructor
Β· exact (mul_lt_mul_left hr).mpr a_h_left_left
Β· exact (mul_lt_mul_left hr).mpr a_h_left_right
Β· rintro β¨a_left, a_rightβ©
use x / r
refine β¨β¨(lt_div_iff' hr).mpr a_left, (div_lt_iff' hr).mpr a_rightβ©, ?_β©
rw [mul_div_cancelβ _ (ne_of_gt hr)]
#align linear_ordered_field.smul_Ioo LinearOrderedField.smul_Ioo
theorem smul_Icc : r β’ Icc a b = Icc (r β’ a) (r β’ b) := by
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Icc]
constructor
Β· rintro β¨a, β¨a_h_left_left, a_h_left_rightβ©, rflβ©
constructor
Β· exact (mul_le_mul_left hr).mpr a_h_left_left
Β· exact (mul_le_mul_left hr).mpr a_h_left_right
Β· rintro β¨a_left, a_rightβ©
use x / r
refine β¨β¨(le_div_iff' hr).mpr a_left, (div_le_iff' hr).mpr a_rightβ©, ?_β©
rw [mul_div_cancelβ _ (ne_of_gt hr)]
#align linear_ordered_field.smul_Icc LinearOrderedField.smul_Icc
theorem smul_Ico : r β’ Ico a b = Ico (r β’ a) (r β’ b) := by
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Ico]
constructor
Β· rintro β¨a, β¨a_h_left_left, a_h_left_rightβ©, rflβ©
constructor
Β· exact (mul_le_mul_left hr).mpr a_h_left_left
Β· exact (mul_lt_mul_left hr).mpr a_h_left_right
Β· rintro β¨a_left, a_rightβ©
use x / r
refine β¨β¨(le_div_iff' hr).mpr a_left, (div_lt_iff' hr).mpr a_rightβ©, ?_β©
rw [mul_div_cancelβ _ (ne_of_gt hr)]
#align linear_ordered_field.smul_Ico LinearOrderedField.smul_Ico
theorem smul_Ioc : r β’ Ioc a b = Ioc (r β’ a) (r β’ b) := by
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Ioc]
constructor
Β· rintro β¨a, β¨a_h_left_left, a_h_left_rightβ©, rflβ©
constructor
Β· exact (mul_lt_mul_left hr).mpr a_h_left_left
Β· exact (mul_le_mul_left hr).mpr a_h_left_right
Β· rintro β¨a_left, a_rightβ©
use x / r
refine β¨β¨(lt_div_iff' hr).mpr a_left, (div_le_iff' hr).mpr a_rightβ©, ?_β©
rw [mul_div_cancelβ _ (ne_of_gt hr)]
#align linear_ordered_field.smul_Ioc LinearOrderedField.smul_Ioc
theorem smul_Ioi : r β’ Ioi a = Ioi (r β’ a) := by
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Ioi]
constructor
Β· rintro β¨a_w, a_h_left, rflβ©
exact (mul_lt_mul_left hr).mpr a_h_left
Β· rintro h
use x / r
constructor
Β· exact (lt_div_iff' hr).mpr h
Β· exact mul_div_cancelβ _ (ne_of_gt hr)
#align linear_ordered_field.smul_Ioi LinearOrderedField.smul_Ioi
theorem smul_Iio : r β’ Iio a = Iio (r β’ a) := by
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Iio]
constructor
Β· rintro β¨a_w, a_h_left, rflβ©
exact (mul_lt_mul_left hr).mpr a_h_left
Β· rintro h
use x / r
constructor
Β· exact (div_lt_iff' hr).mpr h
Β· exact mul_div_cancelβ _ (ne_of_gt hr)
#align linear_ordered_field.smul_Iio LinearOrderedField.smul_Iio
| Mathlib/Algebra/Order/Pointwise.lean | 265 | 275 | theorem smul_Ici : r β’ Ici a = Ici (r β’ a) := by |
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Ioi]
constructor
Β· rintro β¨a_w, a_h_left, rflβ©
exact (mul_le_mul_left hr).mpr a_h_left
Β· rintro h
use x / r
constructor
Β· exact (le_div_iff' hr).mpr h
Β· exact mul_div_cancelβ _ (ne_of_gt hr)
| 10 | 22,026.465795 | 2 | 1.25 | 16 | 1,340 |
import Mathlib.Algebra.Bounds
import Mathlib.Algebra.Order.Field.Basic -- Porting note: `LinearOrderedField`, etc
import Mathlib.Data.Set.Pointwise.SMul
#align_import algebra.order.pointwise from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
open Function Set
open Pointwise
variable {Ξ± : Type*}
-- Porting note: Swapped the place of `CompleteLattice` and `ConditionallyCompleteLattice`
-- due to simpNF problem between `sSup_xx` `csSup_xx`.
section CompleteLattice
variable [CompleteLattice Ξ±]
namespace LinearOrderedField
variable {K : Type*} [LinearOrderedField K] {a b r : K} (hr : 0 < r)
open Set
theorem smul_Ioo : r β’ Ioo a b = Ioo (r β’ a) (r β’ b) := by
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Ioo]
constructor
Β· rintro β¨a, β¨a_h_left_left, a_h_left_rightβ©, rflβ©
constructor
Β· exact (mul_lt_mul_left hr).mpr a_h_left_left
Β· exact (mul_lt_mul_left hr).mpr a_h_left_right
Β· rintro β¨a_left, a_rightβ©
use x / r
refine β¨β¨(lt_div_iff' hr).mpr a_left, (div_lt_iff' hr).mpr a_rightβ©, ?_β©
rw [mul_div_cancelβ _ (ne_of_gt hr)]
#align linear_ordered_field.smul_Ioo LinearOrderedField.smul_Ioo
theorem smul_Icc : r β’ Icc a b = Icc (r β’ a) (r β’ b) := by
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Icc]
constructor
Β· rintro β¨a, β¨a_h_left_left, a_h_left_rightβ©, rflβ©
constructor
Β· exact (mul_le_mul_left hr).mpr a_h_left_left
Β· exact (mul_le_mul_left hr).mpr a_h_left_right
Β· rintro β¨a_left, a_rightβ©
use x / r
refine β¨β¨(le_div_iff' hr).mpr a_left, (div_le_iff' hr).mpr a_rightβ©, ?_β©
rw [mul_div_cancelβ _ (ne_of_gt hr)]
#align linear_ordered_field.smul_Icc LinearOrderedField.smul_Icc
theorem smul_Ico : r β’ Ico a b = Ico (r β’ a) (r β’ b) := by
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Ico]
constructor
Β· rintro β¨a, β¨a_h_left_left, a_h_left_rightβ©, rflβ©
constructor
Β· exact (mul_le_mul_left hr).mpr a_h_left_left
Β· exact (mul_lt_mul_left hr).mpr a_h_left_right
Β· rintro β¨a_left, a_rightβ©
use x / r
refine β¨β¨(le_div_iff' hr).mpr a_left, (div_lt_iff' hr).mpr a_rightβ©, ?_β©
rw [mul_div_cancelβ _ (ne_of_gt hr)]
#align linear_ordered_field.smul_Ico LinearOrderedField.smul_Ico
theorem smul_Ioc : r β’ Ioc a b = Ioc (r β’ a) (r β’ b) := by
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Ioc]
constructor
Β· rintro β¨a, β¨a_h_left_left, a_h_left_rightβ©, rflβ©
constructor
Β· exact (mul_lt_mul_left hr).mpr a_h_left_left
Β· exact (mul_le_mul_left hr).mpr a_h_left_right
Β· rintro β¨a_left, a_rightβ©
use x / r
refine β¨β¨(lt_div_iff' hr).mpr a_left, (div_le_iff' hr).mpr a_rightβ©, ?_β©
rw [mul_div_cancelβ _ (ne_of_gt hr)]
#align linear_ordered_field.smul_Ioc LinearOrderedField.smul_Ioc
theorem smul_Ioi : r β’ Ioi a = Ioi (r β’ a) := by
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Ioi]
constructor
Β· rintro β¨a_w, a_h_left, rflβ©
exact (mul_lt_mul_left hr).mpr a_h_left
Β· rintro h
use x / r
constructor
Β· exact (lt_div_iff' hr).mpr h
Β· exact mul_div_cancelβ _ (ne_of_gt hr)
#align linear_ordered_field.smul_Ioi LinearOrderedField.smul_Ioi
theorem smul_Iio : r β’ Iio a = Iio (r β’ a) := by
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Iio]
constructor
Β· rintro β¨a_w, a_h_left, rflβ©
exact (mul_lt_mul_left hr).mpr a_h_left
Β· rintro h
use x / r
constructor
Β· exact (div_lt_iff' hr).mpr h
Β· exact mul_div_cancelβ _ (ne_of_gt hr)
#align linear_ordered_field.smul_Iio LinearOrderedField.smul_Iio
theorem smul_Ici : r β’ Ici a = Ici (r β’ a) := by
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Ioi]
constructor
Β· rintro β¨a_w, a_h_left, rflβ©
exact (mul_le_mul_left hr).mpr a_h_left
Β· rintro h
use x / r
constructor
Β· exact (le_div_iff' hr).mpr h
Β· exact mul_div_cancelβ _ (ne_of_gt hr)
#align linear_ordered_field.smul_Ici LinearOrderedField.smul_Ici
| Mathlib/Algebra/Order/Pointwise.lean | 278 | 288 | theorem smul_Iic : r β’ Iic a = Iic (r β’ a) := by |
ext x
simp only [mem_smul_set, smul_eq_mul, mem_Iio]
constructor
Β· rintro β¨a_w, a_h_left, rflβ©
exact (mul_le_mul_left hr).mpr a_h_left
Β· rintro h
use x / r
constructor
Β· exact (div_le_iff' hr).mpr h
Β· exact mul_div_cancelβ _ (ne_of_gt hr)
| 10 | 22,026.465795 | 2 | 1.25 | 16 | 1,340 |
import Mathlib.Analysis.Normed.Group.InfiniteSum
import Mathlib.Topology.Instances.ENNReal
#align_import analysis.calculus.series from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
open Set Metric TopologicalSpace Function Filter
open scoped Topology NNReal
variable {Ξ± Ξ² F : Type*} [NormedAddCommGroup F] [CompleteSpace F] {u : Ξ± β β}
| Mathlib/Analysis/NormedSpace/FunctionSeries.lean | 28 | 39 | theorem tendstoUniformlyOn_tsum {f : Ξ± β Ξ² β F} (hu : Summable u) {s : Set Ξ²}
(hfu : β n x, x β s β βf n xβ β€ u n) :
TendstoUniformlyOn (fun t : Finset Ξ± => fun x => β n β t, f n x) (fun x => β' n, f n x) atTop
s := by |
refine tendstoUniformlyOn_iff.2 fun Ξ΅ Ξ΅pos => ?_
filter_upwards [(tendsto_order.1 (tendsto_tsum_compl_atTop_zero u)).2 _ Ξ΅pos] with t ht x hx
have A : Summable fun n => βf n xβ :=
.of_nonneg_of_le (fun _ β¦ norm_nonneg _) (fun n => hfu n x hx) hu
rw [dist_eq_norm, β sum_add_tsum_subtype_compl A.of_norm t, add_sub_cancel_left]
apply lt_of_le_of_lt _ ht
apply (norm_tsum_le_tsum_norm (A.subtype _)).trans
exact tsum_le_tsum (fun n => hfu _ _ hx) (A.subtype _) (hu.subtype _)
| 8 | 2,980.957987 | 2 | 1.25 | 4 | 1,341 |
import Mathlib.Analysis.Normed.Group.InfiniteSum
import Mathlib.Topology.Instances.ENNReal
#align_import analysis.calculus.series from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
open Set Metric TopologicalSpace Function Filter
open scoped Topology NNReal
variable {Ξ± Ξ² F : Type*} [NormedAddCommGroup F] [CompleteSpace F] {u : Ξ± β β}
theorem tendstoUniformlyOn_tsum {f : Ξ± β Ξ² β F} (hu : Summable u) {s : Set Ξ²}
(hfu : β n x, x β s β βf n xβ β€ u n) :
TendstoUniformlyOn (fun t : Finset Ξ± => fun x => β n β t, f n x) (fun x => β' n, f n x) atTop
s := by
refine tendstoUniformlyOn_iff.2 fun Ξ΅ Ξ΅pos => ?_
filter_upwards [(tendsto_order.1 (tendsto_tsum_compl_atTop_zero u)).2 _ Ξ΅pos] with t ht x hx
have A : Summable fun n => βf n xβ :=
.of_nonneg_of_le (fun _ β¦ norm_nonneg _) (fun n => hfu n x hx) hu
rw [dist_eq_norm, β sum_add_tsum_subtype_compl A.of_norm t, add_sub_cancel_left]
apply lt_of_le_of_lt _ ht
apply (norm_tsum_le_tsum_norm (A.subtype _)).trans
exact tsum_le_tsum (fun n => hfu _ _ hx) (A.subtype _) (hu.subtype _)
#align tendsto_uniformly_on_tsum tendstoUniformlyOn_tsum
theorem tendstoUniformlyOn_tsum_nat {f : β β Ξ² β F} {u : β β β} (hu : Summable u) {s : Set Ξ²}
(hfu : β n x, x β s β βf n xβ β€ u n) :
TendstoUniformlyOn (fun N => fun x => β n β Finset.range N, f n x) (fun x => β' n, f n x) atTop
s :=
fun v hv => tendsto_finset_range.eventually (tendstoUniformlyOn_tsum hu hfu v hv)
#align tendsto_uniformly_on_tsum_nat tendstoUniformlyOn_tsum_nat
| Mathlib/Analysis/NormedSpace/FunctionSeries.lean | 53 | 56 | theorem tendstoUniformly_tsum {f : Ξ± β Ξ² β F} (hu : Summable u) (hfu : β n x, βf n xβ β€ u n) :
TendstoUniformly (fun t : Finset Ξ± => fun x => β n β t, f n x)
(fun x => β' n, f n x) atTop := by |
rw [β tendstoUniformlyOn_univ]; exact tendstoUniformlyOn_tsum hu fun n x _ => hfu n x
| 1 | 2.718282 | 0 | 1.25 | 4 | 1,341 |
import Mathlib.Analysis.Normed.Group.InfiniteSum
import Mathlib.Topology.Instances.ENNReal
#align_import analysis.calculus.series from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
open Set Metric TopologicalSpace Function Filter
open scoped Topology NNReal
variable {Ξ± Ξ² F : Type*} [NormedAddCommGroup F] [CompleteSpace F] {u : Ξ± β β}
theorem tendstoUniformlyOn_tsum {f : Ξ± β Ξ² β F} (hu : Summable u) {s : Set Ξ²}
(hfu : β n x, x β s β βf n xβ β€ u n) :
TendstoUniformlyOn (fun t : Finset Ξ± => fun x => β n β t, f n x) (fun x => β' n, f n x) atTop
s := by
refine tendstoUniformlyOn_iff.2 fun Ξ΅ Ξ΅pos => ?_
filter_upwards [(tendsto_order.1 (tendsto_tsum_compl_atTop_zero u)).2 _ Ξ΅pos] with t ht x hx
have A : Summable fun n => βf n xβ :=
.of_nonneg_of_le (fun _ β¦ norm_nonneg _) (fun n => hfu n x hx) hu
rw [dist_eq_norm, β sum_add_tsum_subtype_compl A.of_norm t, add_sub_cancel_left]
apply lt_of_le_of_lt _ ht
apply (norm_tsum_le_tsum_norm (A.subtype _)).trans
exact tsum_le_tsum (fun n => hfu _ _ hx) (A.subtype _) (hu.subtype _)
#align tendsto_uniformly_on_tsum tendstoUniformlyOn_tsum
theorem tendstoUniformlyOn_tsum_nat {f : β β Ξ² β F} {u : β β β} (hu : Summable u) {s : Set Ξ²}
(hfu : β n x, x β s β βf n xβ β€ u n) :
TendstoUniformlyOn (fun N => fun x => β n β Finset.range N, f n x) (fun x => β' n, f n x) atTop
s :=
fun v hv => tendsto_finset_range.eventually (tendstoUniformlyOn_tsum hu hfu v hv)
#align tendsto_uniformly_on_tsum_nat tendstoUniformlyOn_tsum_nat
theorem tendstoUniformly_tsum {f : Ξ± β Ξ² β F} (hu : Summable u) (hfu : β n x, βf n xβ β€ u n) :
TendstoUniformly (fun t : Finset Ξ± => fun x => β n β t, f n x)
(fun x => β' n, f n x) atTop := by
rw [β tendstoUniformlyOn_univ]; exact tendstoUniformlyOn_tsum hu fun n x _ => hfu n x
#align tendsto_uniformly_tsum tendstoUniformly_tsum
theorem tendstoUniformly_tsum_nat {f : β β Ξ² β F} {u : β β β} (hu : Summable u)
(hfu : β n x, βf n xβ β€ u n) :
TendstoUniformly (fun N => fun x => β n β Finset.range N, f n x) (fun x => β' n, f n x)
atTop :=
fun v hv => tendsto_finset_range.eventually (tendstoUniformly_tsum hu hfu v hv)
#align tendsto_uniformly_tsum_nat tendstoUniformly_tsum_nat
| Mathlib/Analysis/NormedSpace/FunctionSeries.lean | 70 | 76 | theorem continuousOn_tsum [TopologicalSpace Ξ²] {f : Ξ± β Ξ² β F} {s : Set Ξ²}
(hf : β i, ContinuousOn (f i) s) (hu : Summable u) (hfu : β n x, x β s β βf n xβ β€ u n) :
ContinuousOn (fun x => β' n, f n x) s := by |
classical
refine (tendstoUniformlyOn_tsum hu hfu).continuousOn (eventually_of_forall ?_)
intro t
exact continuousOn_finset_sum _ fun i _ => hf i
| 4 | 54.59815 | 2 | 1.25 | 4 | 1,341 |
import Mathlib.Analysis.Normed.Group.InfiniteSum
import Mathlib.Topology.Instances.ENNReal
#align_import analysis.calculus.series from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
open Set Metric TopologicalSpace Function Filter
open scoped Topology NNReal
variable {Ξ± Ξ² F : Type*} [NormedAddCommGroup F] [CompleteSpace F] {u : Ξ± β β}
theorem tendstoUniformlyOn_tsum {f : Ξ± β Ξ² β F} (hu : Summable u) {s : Set Ξ²}
(hfu : β n x, x β s β βf n xβ β€ u n) :
TendstoUniformlyOn (fun t : Finset Ξ± => fun x => β n β t, f n x) (fun x => β' n, f n x) atTop
s := by
refine tendstoUniformlyOn_iff.2 fun Ξ΅ Ξ΅pos => ?_
filter_upwards [(tendsto_order.1 (tendsto_tsum_compl_atTop_zero u)).2 _ Ξ΅pos] with t ht x hx
have A : Summable fun n => βf n xβ :=
.of_nonneg_of_le (fun _ β¦ norm_nonneg _) (fun n => hfu n x hx) hu
rw [dist_eq_norm, β sum_add_tsum_subtype_compl A.of_norm t, add_sub_cancel_left]
apply lt_of_le_of_lt _ ht
apply (norm_tsum_le_tsum_norm (A.subtype _)).trans
exact tsum_le_tsum (fun n => hfu _ _ hx) (A.subtype _) (hu.subtype _)
#align tendsto_uniformly_on_tsum tendstoUniformlyOn_tsum
theorem tendstoUniformlyOn_tsum_nat {f : β β Ξ² β F} {u : β β β} (hu : Summable u) {s : Set Ξ²}
(hfu : β n x, x β s β βf n xβ β€ u n) :
TendstoUniformlyOn (fun N => fun x => β n β Finset.range N, f n x) (fun x => β' n, f n x) atTop
s :=
fun v hv => tendsto_finset_range.eventually (tendstoUniformlyOn_tsum hu hfu v hv)
#align tendsto_uniformly_on_tsum_nat tendstoUniformlyOn_tsum_nat
theorem tendstoUniformly_tsum {f : Ξ± β Ξ² β F} (hu : Summable u) (hfu : β n x, βf n xβ β€ u n) :
TendstoUniformly (fun t : Finset Ξ± => fun x => β n β t, f n x)
(fun x => β' n, f n x) atTop := by
rw [β tendstoUniformlyOn_univ]; exact tendstoUniformlyOn_tsum hu fun n x _ => hfu n x
#align tendsto_uniformly_tsum tendstoUniformly_tsum
theorem tendstoUniformly_tsum_nat {f : β β Ξ² β F} {u : β β β} (hu : Summable u)
(hfu : β n x, βf n xβ β€ u n) :
TendstoUniformly (fun N => fun x => β n β Finset.range N, f n x) (fun x => β' n, f n x)
atTop :=
fun v hv => tendsto_finset_range.eventually (tendstoUniformly_tsum hu hfu v hv)
#align tendsto_uniformly_tsum_nat tendstoUniformly_tsum_nat
theorem continuousOn_tsum [TopologicalSpace Ξ²] {f : Ξ± β Ξ² β F} {s : Set Ξ²}
(hf : β i, ContinuousOn (f i) s) (hu : Summable u) (hfu : β n x, x β s β βf n xβ β€ u n) :
ContinuousOn (fun x => β' n, f n x) s := by
classical
refine (tendstoUniformlyOn_tsum hu hfu).continuousOn (eventually_of_forall ?_)
intro t
exact continuousOn_finset_sum _ fun i _ => hf i
#align continuous_on_tsum continuousOn_tsum
| Mathlib/Analysis/NormedSpace/FunctionSeries.lean | 81 | 84 | theorem continuous_tsum [TopologicalSpace Ξ²] {f : Ξ± β Ξ² β F} (hf : β i, Continuous (f i))
(hu : Summable u) (hfu : β n x, βf n xβ β€ u n) : Continuous fun x => β' n, f n x := by |
simp_rw [continuous_iff_continuousOn_univ] at hf β’
exact continuousOn_tsum hf hu fun n x _ => hfu n x
| 2 | 7.389056 | 1 | 1.25 | 4 | 1,341 |
import Mathlib.Algebra.CharP.Basic
import Mathlib.Algebra.CharP.Algebra
import Mathlib.Data.Nat.Prime
#align_import algebra.char_p.exp_char from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
universe u
variable (R : Type u)
section Semiring
variable [Semiring R]
class inductive ExpChar (R : Type u) [Semiring R] : β β Prop
| zero [CharZero R] : ExpChar R 1
| prime {q : β} (hprime : q.Prime) [hchar : CharP R q] : ExpChar R q
#align exp_char ExpChar
#align exp_char.prime ExpChar.prime
instance expChar_prime (p) [CharP R p] [Fact p.Prime] : ExpChar R p := ExpChar.prime Fact.out
instance expChar_zero [CharZero R] : ExpChar R 1 := ExpChar.zero
instance (S : Type*) [Semiring S] (p) [ExpChar R p] [ExpChar S p] : ExpChar (R Γ S) p := by
obtain hp | β¨hpβ© := βΉExpChar R pβΊ
Β· have := Prod.charZero_of_left R S; exact .zero
obtain _ | _ := βΉExpChar S pβΊ
Β· exact (Nat.not_prime_one hp).elim
Β· have := Prod.charP R S p; exact .prime hp
variable {R} in
| Mathlib/Algebra/CharP/ExpChar.lean | 61 | 67 | theorem ExpChar.eq {p q : β} (hp : ExpChar R p) (hq : ExpChar R q) : p = q := by |
cases' hp with hp _ hp' hp
Β· cases' hq with hq _ hq' hq
exacts [rfl, False.elim (Nat.not_prime_zero (CharP.eq R hq (CharP.ofCharZero R) βΈ hq'))]
Β· cases' hq with hq _ hq' hq
exacts [False.elim (Nat.not_prime_zero (CharP.eq R hp (CharP.ofCharZero R) βΈ hp')),
CharP.eq R hp hq]
| 6 | 403.428793 | 2 | 1.272727 | 11 | 1,345 |
import Mathlib.Algebra.CharP.Basic
import Mathlib.Algebra.CharP.Algebra
import Mathlib.Data.Nat.Prime
#align_import algebra.char_p.exp_char from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
universe u
variable (R : Type u)
section Semiring
variable [Semiring R]
class inductive ExpChar (R : Type u) [Semiring R] : β β Prop
| zero [CharZero R] : ExpChar R 1
| prime {q : β} (hprime : q.Prime) [hchar : CharP R q] : ExpChar R q
#align exp_char ExpChar
#align exp_char.prime ExpChar.prime
instance expChar_prime (p) [CharP R p] [Fact p.Prime] : ExpChar R p := ExpChar.prime Fact.out
instance expChar_zero [CharZero R] : ExpChar R 1 := ExpChar.zero
instance (S : Type*) [Semiring S] (p) [ExpChar R p] [ExpChar S p] : ExpChar (R Γ S) p := by
obtain hp | β¨hpβ© := βΉExpChar R pβΊ
Β· have := Prod.charZero_of_left R S; exact .zero
obtain _ | _ := βΉExpChar S pβΊ
Β· exact (Nat.not_prime_one hp).elim
Β· have := Prod.charP R S p; exact .prime hp
variable {R} in
theorem ExpChar.eq {p q : β} (hp : ExpChar R p) (hq : ExpChar R q) : p = q := by
cases' hp with hp _ hp' hp
Β· cases' hq with hq _ hq' hq
exacts [rfl, False.elim (Nat.not_prime_zero (CharP.eq R hq (CharP.ofCharZero R) βΈ hq'))]
Β· cases' hq with hq _ hq' hq
exacts [False.elim (Nat.not_prime_zero (CharP.eq R hp (CharP.ofCharZero R) βΈ hp')),
CharP.eq R hp hq]
theorem ExpChar.congr {p : β} (q : β) [hq : ExpChar R q] (h : q = p) : ExpChar R p := h βΈ hq
noncomputable def ringExpChar (R : Type*) [NonAssocSemiring R] : β := max (ringChar R) 1
| Mathlib/Algebra/CharP/ExpChar.lean | 74 | 79 | theorem ringExpChar.eq (q : β) [h : ExpChar R q] : ringExpChar R = q := by |
cases' h with _ _ h _
Β· haveI := CharP.ofCharZero R
rw [ringExpChar, ringChar.eq R 0]; rfl
rw [ringExpChar, ringChar.eq R q]
exact Nat.max_eq_left h.one_lt.le
| 5 | 148.413159 | 2 | 1.272727 | 11 | 1,345 |
import Mathlib.Algebra.CharP.Basic
import Mathlib.Algebra.CharP.Algebra
import Mathlib.Data.Nat.Prime
#align_import algebra.char_p.exp_char from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
universe u
variable (R : Type u)
section Semiring
variable [Semiring R]
class inductive ExpChar (R : Type u) [Semiring R] : β β Prop
| zero [CharZero R] : ExpChar R 1
| prime {q : β} (hprime : q.Prime) [hchar : CharP R q] : ExpChar R q
#align exp_char ExpChar
#align exp_char.prime ExpChar.prime
instance expChar_prime (p) [CharP R p] [Fact p.Prime] : ExpChar R p := ExpChar.prime Fact.out
instance expChar_zero [CharZero R] : ExpChar R 1 := ExpChar.zero
instance (S : Type*) [Semiring S] (p) [ExpChar R p] [ExpChar S p] : ExpChar (R Γ S) p := by
obtain hp | β¨hpβ© := βΉExpChar R pβΊ
Β· have := Prod.charZero_of_left R S; exact .zero
obtain _ | _ := βΉExpChar S pβΊ
Β· exact (Nat.not_prime_one hp).elim
Β· have := Prod.charP R S p; exact .prime hp
variable {R} in
theorem ExpChar.eq {p q : β} (hp : ExpChar R p) (hq : ExpChar R q) : p = q := by
cases' hp with hp _ hp' hp
Β· cases' hq with hq _ hq' hq
exacts [rfl, False.elim (Nat.not_prime_zero (CharP.eq R hq (CharP.ofCharZero R) βΈ hq'))]
Β· cases' hq with hq _ hq' hq
exacts [False.elim (Nat.not_prime_zero (CharP.eq R hp (CharP.ofCharZero R) βΈ hp')),
CharP.eq R hp hq]
theorem ExpChar.congr {p : β} (q : β) [hq : ExpChar R q] (h : q = p) : ExpChar R p := h βΈ hq
noncomputable def ringExpChar (R : Type*) [NonAssocSemiring R] : β := max (ringChar R) 1
theorem ringExpChar.eq (q : β) [h : ExpChar R q] : ringExpChar R = q := by
cases' h with _ _ h _
Β· haveI := CharP.ofCharZero R
rw [ringExpChar, ringChar.eq R 0]; rfl
rw [ringExpChar, ringChar.eq R q]
exact Nat.max_eq_left h.one_lt.le
@[simp]
| Mathlib/Algebra/CharP/ExpChar.lean | 82 | 83 | theorem ringExpChar.eq_one (R : Type*) [NonAssocSemiring R] [CharZero R] : ringExpChar R = 1 := by |
rw [ringExpChar, ringChar.eq_zero, max_eq_right zero_le_one]
| 1 | 2.718282 | 0 | 1.272727 | 11 | 1,345 |
import Mathlib.Algebra.CharP.Basic
import Mathlib.Algebra.CharP.Algebra
import Mathlib.Data.Nat.Prime
#align_import algebra.char_p.exp_char from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
universe u
variable (R : Type u)
section Semiring
variable [Semiring R]
class inductive ExpChar (R : Type u) [Semiring R] : β β Prop
| zero [CharZero R] : ExpChar R 1
| prime {q : β} (hprime : q.Prime) [hchar : CharP R q] : ExpChar R q
#align exp_char ExpChar
#align exp_char.prime ExpChar.prime
instance expChar_prime (p) [CharP R p] [Fact p.Prime] : ExpChar R p := ExpChar.prime Fact.out
instance expChar_zero [CharZero R] : ExpChar R 1 := ExpChar.zero
instance (S : Type*) [Semiring S] (p) [ExpChar R p] [ExpChar S p] : ExpChar (R Γ S) p := by
obtain hp | β¨hpβ© := βΉExpChar R pβΊ
Β· have := Prod.charZero_of_left R S; exact .zero
obtain _ | _ := βΉExpChar S pβΊ
Β· exact (Nat.not_prime_one hp).elim
Β· have := Prod.charP R S p; exact .prime hp
variable {R} in
theorem ExpChar.eq {p q : β} (hp : ExpChar R p) (hq : ExpChar R q) : p = q := by
cases' hp with hp _ hp' hp
Β· cases' hq with hq _ hq' hq
exacts [rfl, False.elim (Nat.not_prime_zero (CharP.eq R hq (CharP.ofCharZero R) βΈ hq'))]
Β· cases' hq with hq _ hq' hq
exacts [False.elim (Nat.not_prime_zero (CharP.eq R hp (CharP.ofCharZero R) βΈ hp')),
CharP.eq R hp hq]
theorem ExpChar.congr {p : β} (q : β) [hq : ExpChar R q] (h : q = p) : ExpChar R p := h βΈ hq
noncomputable def ringExpChar (R : Type*) [NonAssocSemiring R] : β := max (ringChar R) 1
theorem ringExpChar.eq (q : β) [h : ExpChar R q] : ringExpChar R = q := by
cases' h with _ _ h _
Β· haveI := CharP.ofCharZero R
rw [ringExpChar, ringChar.eq R 0]; rfl
rw [ringExpChar, ringChar.eq R q]
exact Nat.max_eq_left h.one_lt.le
@[simp]
theorem ringExpChar.eq_one (R : Type*) [NonAssocSemiring R] [CharZero R] : ringExpChar R = 1 := by
rw [ringExpChar, ringChar.eq_zero, max_eq_right zero_le_one]
| Mathlib/Algebra/CharP/ExpChar.lean | 86 | 89 | theorem expChar_one_of_char_zero (q : β) [hp : CharP R 0] [hq : ExpChar R q] : q = 1 := by |
cases' hq with q hq_one hq_prime hq_hchar
Β· rfl
Β· exact False.elim <| hq_prime.ne_zero <| hq_hchar.eq R hp
| 3 | 20.085537 | 1 | 1.272727 | 11 | 1,345 |
import Mathlib.Algebra.CharP.Basic
import Mathlib.Algebra.CharP.Algebra
import Mathlib.Data.Nat.Prime
#align_import algebra.char_p.exp_char from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
universe u
variable (R : Type u)
section Semiring
variable [Semiring R]
class inductive ExpChar (R : Type u) [Semiring R] : β β Prop
| zero [CharZero R] : ExpChar R 1
| prime {q : β} (hprime : q.Prime) [hchar : CharP R q] : ExpChar R q
#align exp_char ExpChar
#align exp_char.prime ExpChar.prime
instance expChar_prime (p) [CharP R p] [Fact p.Prime] : ExpChar R p := ExpChar.prime Fact.out
instance expChar_zero [CharZero R] : ExpChar R 1 := ExpChar.zero
instance (S : Type*) [Semiring S] (p) [ExpChar R p] [ExpChar S p] : ExpChar (R Γ S) p := by
obtain hp | β¨hpβ© := βΉExpChar R pβΊ
Β· have := Prod.charZero_of_left R S; exact .zero
obtain _ | _ := βΉExpChar S pβΊ
Β· exact (Nat.not_prime_one hp).elim
Β· have := Prod.charP R S p; exact .prime hp
variable {R} in
theorem ExpChar.eq {p q : β} (hp : ExpChar R p) (hq : ExpChar R q) : p = q := by
cases' hp with hp _ hp' hp
Β· cases' hq with hq _ hq' hq
exacts [rfl, False.elim (Nat.not_prime_zero (CharP.eq R hq (CharP.ofCharZero R) βΈ hq'))]
Β· cases' hq with hq _ hq' hq
exacts [False.elim (Nat.not_prime_zero (CharP.eq R hp (CharP.ofCharZero R) βΈ hp')),
CharP.eq R hp hq]
theorem ExpChar.congr {p : β} (q : β) [hq : ExpChar R q] (h : q = p) : ExpChar R p := h βΈ hq
noncomputable def ringExpChar (R : Type*) [NonAssocSemiring R] : β := max (ringChar R) 1
theorem ringExpChar.eq (q : β) [h : ExpChar R q] : ringExpChar R = q := by
cases' h with _ _ h _
Β· haveI := CharP.ofCharZero R
rw [ringExpChar, ringChar.eq R 0]; rfl
rw [ringExpChar, ringChar.eq R q]
exact Nat.max_eq_left h.one_lt.le
@[simp]
theorem ringExpChar.eq_one (R : Type*) [NonAssocSemiring R] [CharZero R] : ringExpChar R = 1 := by
rw [ringExpChar, ringChar.eq_zero, max_eq_right zero_le_one]
theorem expChar_one_of_char_zero (q : β) [hp : CharP R 0] [hq : ExpChar R q] : q = 1 := by
cases' hq with q hq_one hq_prime hq_hchar
Β· rfl
Β· exact False.elim <| hq_prime.ne_zero <| hq_hchar.eq R hp
#align exp_char_one_of_char_zero expChar_one_of_char_zero
| Mathlib/Algebra/CharP/ExpChar.lean | 93 | 97 | theorem char_eq_expChar_iff (p q : β) [hp : CharP R p] [hq : ExpChar R q] : p = q β p.Prime := by |
cases' hq with q hq_one hq_prime hq_hchar
Β· rw [(CharP.eq R hp inferInstance : p = 0)]
decide
Β· exact β¨fun hpq => hpq.symm βΈ hq_prime, fun _ => CharP.eq R hp hq_hcharβ©
| 4 | 54.59815 | 2 | 1.272727 | 11 | 1,345 |
import Mathlib.Algebra.CharP.Basic
import Mathlib.Algebra.CharP.Algebra
import Mathlib.Data.Nat.Prime
#align_import algebra.char_p.exp_char from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
universe u
variable (R : Type u)
section Semiring
variable [Semiring R]
class inductive ExpChar (R : Type u) [Semiring R] : β β Prop
| zero [CharZero R] : ExpChar R 1
| prime {q : β} (hprime : q.Prime) [hchar : CharP R q] : ExpChar R q
#align exp_char ExpChar
#align exp_char.prime ExpChar.prime
instance expChar_prime (p) [CharP R p] [Fact p.Prime] : ExpChar R p := ExpChar.prime Fact.out
instance expChar_zero [CharZero R] : ExpChar R 1 := ExpChar.zero
instance (S : Type*) [Semiring S] (p) [ExpChar R p] [ExpChar S p] : ExpChar (R Γ S) p := by
obtain hp | β¨hpβ© := βΉExpChar R pβΊ
Β· have := Prod.charZero_of_left R S; exact .zero
obtain _ | _ := βΉExpChar S pβΊ
Β· exact (Nat.not_prime_one hp).elim
Β· have := Prod.charP R S p; exact .prime hp
variable {R} in
theorem ExpChar.eq {p q : β} (hp : ExpChar R p) (hq : ExpChar R q) : p = q := by
cases' hp with hp _ hp' hp
Β· cases' hq with hq _ hq' hq
exacts [rfl, False.elim (Nat.not_prime_zero (CharP.eq R hq (CharP.ofCharZero R) βΈ hq'))]
Β· cases' hq with hq _ hq' hq
exacts [False.elim (Nat.not_prime_zero (CharP.eq R hp (CharP.ofCharZero R) βΈ hp')),
CharP.eq R hp hq]
theorem ExpChar.congr {p : β} (q : β) [hq : ExpChar R q] (h : q = p) : ExpChar R p := h βΈ hq
noncomputable def ringExpChar (R : Type*) [NonAssocSemiring R] : β := max (ringChar R) 1
theorem ringExpChar.eq (q : β) [h : ExpChar R q] : ringExpChar R = q := by
cases' h with _ _ h _
Β· haveI := CharP.ofCharZero R
rw [ringExpChar, ringChar.eq R 0]; rfl
rw [ringExpChar, ringChar.eq R q]
exact Nat.max_eq_left h.one_lt.le
@[simp]
theorem ringExpChar.eq_one (R : Type*) [NonAssocSemiring R] [CharZero R] : ringExpChar R = 1 := by
rw [ringExpChar, ringChar.eq_zero, max_eq_right zero_le_one]
theorem expChar_one_of_char_zero (q : β) [hp : CharP R 0] [hq : ExpChar R q] : q = 1 := by
cases' hq with q hq_one hq_prime hq_hchar
Β· rfl
Β· exact False.elim <| hq_prime.ne_zero <| hq_hchar.eq R hp
#align exp_char_one_of_char_zero expChar_one_of_char_zero
theorem char_eq_expChar_iff (p q : β) [hp : CharP R p] [hq : ExpChar R q] : p = q β p.Prime := by
cases' hq with q hq_one hq_prime hq_hchar
Β· rw [(CharP.eq R hp inferInstance : p = 0)]
decide
Β· exact β¨fun hpq => hpq.symm βΈ hq_prime, fun _ => CharP.eq R hp hq_hcharβ©
#align char_eq_exp_char_iff char_eq_expChar_iff
section Nontrivial
variable [Nontrivial R]
| Mathlib/Algebra/CharP/ExpChar.lean | 105 | 108 | theorem char_zero_of_expChar_one (p : β) [hp : CharP R p] [hq : ExpChar R 1] : p = 0 := by |
cases hq
Β· exact CharP.eq R hp inferInstance
Β· exact False.elim (CharP.char_ne_one R 1 rfl)
| 3 | 20.085537 | 1 | 1.272727 | 11 | 1,345 |
import Mathlib.Algebra.CharP.Basic
import Mathlib.Algebra.CharP.Algebra
import Mathlib.Data.Nat.Prime
#align_import algebra.char_p.exp_char from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
universe u
variable (R : Type u)
section Semiring
variable [Semiring R]
class inductive ExpChar (R : Type u) [Semiring R] : β β Prop
| zero [CharZero R] : ExpChar R 1
| prime {q : β} (hprime : q.Prime) [hchar : CharP R q] : ExpChar R q
#align exp_char ExpChar
#align exp_char.prime ExpChar.prime
instance expChar_prime (p) [CharP R p] [Fact p.Prime] : ExpChar R p := ExpChar.prime Fact.out
instance expChar_zero [CharZero R] : ExpChar R 1 := ExpChar.zero
instance (S : Type*) [Semiring S] (p) [ExpChar R p] [ExpChar S p] : ExpChar (R Γ S) p := by
obtain hp | β¨hpβ© := βΉExpChar R pβΊ
Β· have := Prod.charZero_of_left R S; exact .zero
obtain _ | _ := βΉExpChar S pβΊ
Β· exact (Nat.not_prime_one hp).elim
Β· have := Prod.charP R S p; exact .prime hp
variable {R} in
theorem ExpChar.eq {p q : β} (hp : ExpChar R p) (hq : ExpChar R q) : p = q := by
cases' hp with hp _ hp' hp
Β· cases' hq with hq _ hq' hq
exacts [rfl, False.elim (Nat.not_prime_zero (CharP.eq R hq (CharP.ofCharZero R) βΈ hq'))]
Β· cases' hq with hq _ hq' hq
exacts [False.elim (Nat.not_prime_zero (CharP.eq R hp (CharP.ofCharZero R) βΈ hp')),
CharP.eq R hp hq]
theorem ExpChar.congr {p : β} (q : β) [hq : ExpChar R q] (h : q = p) : ExpChar R p := h βΈ hq
noncomputable def ringExpChar (R : Type*) [NonAssocSemiring R] : β := max (ringChar R) 1
theorem ringExpChar.eq (q : β) [h : ExpChar R q] : ringExpChar R = q := by
cases' h with _ _ h _
Β· haveI := CharP.ofCharZero R
rw [ringExpChar, ringChar.eq R 0]; rfl
rw [ringExpChar, ringChar.eq R q]
exact Nat.max_eq_left h.one_lt.le
@[simp]
theorem ringExpChar.eq_one (R : Type*) [NonAssocSemiring R] [CharZero R] : ringExpChar R = 1 := by
rw [ringExpChar, ringChar.eq_zero, max_eq_right zero_le_one]
theorem expChar_one_of_char_zero (q : β) [hp : CharP R 0] [hq : ExpChar R q] : q = 1 := by
cases' hq with q hq_one hq_prime hq_hchar
Β· rfl
Β· exact False.elim <| hq_prime.ne_zero <| hq_hchar.eq R hp
#align exp_char_one_of_char_zero expChar_one_of_char_zero
theorem char_eq_expChar_iff (p q : β) [hp : CharP R p] [hq : ExpChar R q] : p = q β p.Prime := by
cases' hq with q hq_one hq_prime hq_hchar
Β· rw [(CharP.eq R hp inferInstance : p = 0)]
decide
Β· exact β¨fun hpq => hpq.symm βΈ hq_prime, fun _ => CharP.eq R hp hq_hcharβ©
#align char_eq_exp_char_iff char_eq_expChar_iff
section Nontrivial
variable [Nontrivial R]
theorem char_zero_of_expChar_one (p : β) [hp : CharP R p] [hq : ExpChar R 1] : p = 0 := by
cases hq
Β· exact CharP.eq R hp inferInstance
Β· exact False.elim (CharP.char_ne_one R 1 rfl)
#align char_zero_of_exp_char_one char_zero_of_expChar_one
-- This could be an instance, but there are no `ExpChar R 1` instances in mathlib.
| Mathlib/Algebra/CharP/ExpChar.lean | 113 | 116 | theorem charZero_of_expChar_one' [hq : ExpChar R 1] : CharZero R := by |
cases hq
Β· assumption
Β· exact False.elim (CharP.char_ne_one R 1 rfl)
| 3 | 20.085537 | 1 | 1.272727 | 11 | 1,345 |
import Mathlib.Algebra.CharP.Basic
import Mathlib.Algebra.CharP.Algebra
import Mathlib.Data.Nat.Prime
#align_import algebra.char_p.exp_char from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
universe u
variable (R : Type u)
section Semiring
variable [Semiring R]
class inductive ExpChar (R : Type u) [Semiring R] : β β Prop
| zero [CharZero R] : ExpChar R 1
| prime {q : β} (hprime : q.Prime) [hchar : CharP R q] : ExpChar R q
#align exp_char ExpChar
#align exp_char.prime ExpChar.prime
instance expChar_prime (p) [CharP R p] [Fact p.Prime] : ExpChar R p := ExpChar.prime Fact.out
instance expChar_zero [CharZero R] : ExpChar R 1 := ExpChar.zero
instance (S : Type*) [Semiring S] (p) [ExpChar R p] [ExpChar S p] : ExpChar (R Γ S) p := by
obtain hp | β¨hpβ© := βΉExpChar R pβΊ
Β· have := Prod.charZero_of_left R S; exact .zero
obtain _ | _ := βΉExpChar S pβΊ
Β· exact (Nat.not_prime_one hp).elim
Β· have := Prod.charP R S p; exact .prime hp
variable {R} in
theorem ExpChar.eq {p q : β} (hp : ExpChar R p) (hq : ExpChar R q) : p = q := by
cases' hp with hp _ hp' hp
Β· cases' hq with hq _ hq' hq
exacts [rfl, False.elim (Nat.not_prime_zero (CharP.eq R hq (CharP.ofCharZero R) βΈ hq'))]
Β· cases' hq with hq _ hq' hq
exacts [False.elim (Nat.not_prime_zero (CharP.eq R hp (CharP.ofCharZero R) βΈ hp')),
CharP.eq R hp hq]
theorem ExpChar.congr {p : β} (q : β) [hq : ExpChar R q] (h : q = p) : ExpChar R p := h βΈ hq
noncomputable def ringExpChar (R : Type*) [NonAssocSemiring R] : β := max (ringChar R) 1
theorem ringExpChar.eq (q : β) [h : ExpChar R q] : ringExpChar R = q := by
cases' h with _ _ h _
Β· haveI := CharP.ofCharZero R
rw [ringExpChar, ringChar.eq R 0]; rfl
rw [ringExpChar, ringChar.eq R q]
exact Nat.max_eq_left h.one_lt.le
@[simp]
theorem ringExpChar.eq_one (R : Type*) [NonAssocSemiring R] [CharZero R] : ringExpChar R = 1 := by
rw [ringExpChar, ringChar.eq_zero, max_eq_right zero_le_one]
theorem expChar_one_of_char_zero (q : β) [hp : CharP R 0] [hq : ExpChar R q] : q = 1 := by
cases' hq with q hq_one hq_prime hq_hchar
Β· rfl
Β· exact False.elim <| hq_prime.ne_zero <| hq_hchar.eq R hp
#align exp_char_one_of_char_zero expChar_one_of_char_zero
theorem char_eq_expChar_iff (p q : β) [hp : CharP R p] [hq : ExpChar R q] : p = q β p.Prime := by
cases' hq with q hq_one hq_prime hq_hchar
Β· rw [(CharP.eq R hp inferInstance : p = 0)]
decide
Β· exact β¨fun hpq => hpq.symm βΈ hq_prime, fun _ => CharP.eq R hp hq_hcharβ©
#align char_eq_exp_char_iff char_eq_expChar_iff
section Nontrivial
variable [Nontrivial R]
theorem char_zero_of_expChar_one (p : β) [hp : CharP R p] [hq : ExpChar R 1] : p = 0 := by
cases hq
Β· exact CharP.eq R hp inferInstance
Β· exact False.elim (CharP.char_ne_one R 1 rfl)
#align char_zero_of_exp_char_one char_zero_of_expChar_one
-- This could be an instance, but there are no `ExpChar R 1` instances in mathlib.
theorem charZero_of_expChar_one' [hq : ExpChar R 1] : CharZero R := by
cases hq
Β· assumption
Β· exact False.elim (CharP.char_ne_one R 1 rfl)
#align char_zero_of_exp_char_one' charZero_of_expChar_one'
| Mathlib/Algebra/CharP/ExpChar.lean | 120 | 125 | theorem expChar_one_iff_char_zero (p q : β) [CharP R p] [ExpChar R q] : q = 1 β p = 0 := by |
constructor
Β· rintro rfl
exact char_zero_of_expChar_one R p
Β· rintro rfl
exact expChar_one_of_char_zero R q
| 5 | 148.413159 | 2 | 1.272727 | 11 | 1,345 |
import Mathlib.Algebra.CharP.Basic
import Mathlib.Algebra.CharP.Algebra
import Mathlib.Data.Nat.Prime
#align_import algebra.char_p.exp_char from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
universe u
variable (R : Type u)
section Semiring
variable [Semiring R]
class inductive ExpChar (R : Type u) [Semiring R] : β β Prop
| zero [CharZero R] : ExpChar R 1
| prime {q : β} (hprime : q.Prime) [hchar : CharP R q] : ExpChar R q
#align exp_char ExpChar
#align exp_char.prime ExpChar.prime
instance expChar_prime (p) [CharP R p] [Fact p.Prime] : ExpChar R p := ExpChar.prime Fact.out
instance expChar_zero [CharZero R] : ExpChar R 1 := ExpChar.zero
instance (S : Type*) [Semiring S] (p) [ExpChar R p] [ExpChar S p] : ExpChar (R Γ S) p := by
obtain hp | β¨hpβ© := βΉExpChar R pβΊ
Β· have := Prod.charZero_of_left R S; exact .zero
obtain _ | _ := βΉExpChar S pβΊ
Β· exact (Nat.not_prime_one hp).elim
Β· have := Prod.charP R S p; exact .prime hp
variable {R} in
theorem ExpChar.eq {p q : β} (hp : ExpChar R p) (hq : ExpChar R q) : p = q := by
cases' hp with hp _ hp' hp
Β· cases' hq with hq _ hq' hq
exacts [rfl, False.elim (Nat.not_prime_zero (CharP.eq R hq (CharP.ofCharZero R) βΈ hq'))]
Β· cases' hq with hq _ hq' hq
exacts [False.elim (Nat.not_prime_zero (CharP.eq R hp (CharP.ofCharZero R) βΈ hp')),
CharP.eq R hp hq]
theorem ExpChar.congr {p : β} (q : β) [hq : ExpChar R q] (h : q = p) : ExpChar R p := h βΈ hq
noncomputable def ringExpChar (R : Type*) [NonAssocSemiring R] : β := max (ringChar R) 1
theorem ringExpChar.eq (q : β) [h : ExpChar R q] : ringExpChar R = q := by
cases' h with _ _ h _
Β· haveI := CharP.ofCharZero R
rw [ringExpChar, ringChar.eq R 0]; rfl
rw [ringExpChar, ringChar.eq R q]
exact Nat.max_eq_left h.one_lt.le
@[simp]
theorem ringExpChar.eq_one (R : Type*) [NonAssocSemiring R] [CharZero R] : ringExpChar R = 1 := by
rw [ringExpChar, ringChar.eq_zero, max_eq_right zero_le_one]
theorem expChar_one_of_char_zero (q : β) [hp : CharP R 0] [hq : ExpChar R q] : q = 1 := by
cases' hq with q hq_one hq_prime hq_hchar
Β· rfl
Β· exact False.elim <| hq_prime.ne_zero <| hq_hchar.eq R hp
#align exp_char_one_of_char_zero expChar_one_of_char_zero
theorem char_eq_expChar_iff (p q : β) [hp : CharP R p] [hq : ExpChar R q] : p = q β p.Prime := by
cases' hq with q hq_one hq_prime hq_hchar
Β· rw [(CharP.eq R hp inferInstance : p = 0)]
decide
Β· exact β¨fun hpq => hpq.symm βΈ hq_prime, fun _ => CharP.eq R hp hq_hcharβ©
#align char_eq_exp_char_iff char_eq_expChar_iff
section Nontrivial
variable [Nontrivial R]
theorem char_zero_of_expChar_one (p : β) [hp : CharP R p] [hq : ExpChar R 1] : p = 0 := by
cases hq
Β· exact CharP.eq R hp inferInstance
Β· exact False.elim (CharP.char_ne_one R 1 rfl)
#align char_zero_of_exp_char_one char_zero_of_expChar_one
-- This could be an instance, but there are no `ExpChar R 1` instances in mathlib.
theorem charZero_of_expChar_one' [hq : ExpChar R 1] : CharZero R := by
cases hq
Β· assumption
Β· exact False.elim (CharP.char_ne_one R 1 rfl)
#align char_zero_of_exp_char_one' charZero_of_expChar_one'
theorem expChar_one_iff_char_zero (p q : β) [CharP R p] [ExpChar R q] : q = 1 β p = 0 := by
constructor
Β· rintro rfl
exact char_zero_of_expChar_one R p
Β· rintro rfl
exact expChar_one_of_char_zero R q
#align exp_char_one_iff_char_zero expChar_one_iff_char_zero
section NoZeroDivisors
variable [NoZeroDivisors R]
| Mathlib/Algebra/CharP/ExpChar.lean | 133 | 136 | theorem char_prime_of_ne_zero {p : β} [hp : CharP R p] (p_ne_zero : p β 0) : Nat.Prime p := by |
cases' CharP.char_is_prime_or_zero R p with h h
Β· exact h
Β· contradiction
| 3 | 20.085537 | 1 | 1.272727 | 11 | 1,345 |
import Mathlib.Algebra.CharP.Basic
import Mathlib.Algebra.CharP.Algebra
import Mathlib.Data.Nat.Prime
#align_import algebra.char_p.exp_char from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
universe u
variable (R : Type u)
section Semiring
variable [Semiring R]
class inductive ExpChar (R : Type u) [Semiring R] : β β Prop
| zero [CharZero R] : ExpChar R 1
| prime {q : β} (hprime : q.Prime) [hchar : CharP R q] : ExpChar R q
#align exp_char ExpChar
#align exp_char.prime ExpChar.prime
instance expChar_prime (p) [CharP R p] [Fact p.Prime] : ExpChar R p := ExpChar.prime Fact.out
instance expChar_zero [CharZero R] : ExpChar R 1 := ExpChar.zero
instance (S : Type*) [Semiring S] (p) [ExpChar R p] [ExpChar S p] : ExpChar (R Γ S) p := by
obtain hp | β¨hpβ© := βΉExpChar R pβΊ
Β· have := Prod.charZero_of_left R S; exact .zero
obtain _ | _ := βΉExpChar S pβΊ
Β· exact (Nat.not_prime_one hp).elim
Β· have := Prod.charP R S p; exact .prime hp
variable {R} in
theorem ExpChar.eq {p q : β} (hp : ExpChar R p) (hq : ExpChar R q) : p = q := by
cases' hp with hp _ hp' hp
Β· cases' hq with hq _ hq' hq
exacts [rfl, False.elim (Nat.not_prime_zero (CharP.eq R hq (CharP.ofCharZero R) βΈ hq'))]
Β· cases' hq with hq _ hq' hq
exacts [False.elim (Nat.not_prime_zero (CharP.eq R hp (CharP.ofCharZero R) βΈ hp')),
CharP.eq R hp hq]
theorem ExpChar.congr {p : β} (q : β) [hq : ExpChar R q] (h : q = p) : ExpChar R p := h βΈ hq
noncomputable def ringExpChar (R : Type*) [NonAssocSemiring R] : β := max (ringChar R) 1
theorem ringExpChar.eq (q : β) [h : ExpChar R q] : ringExpChar R = q := by
cases' h with _ _ h _
Β· haveI := CharP.ofCharZero R
rw [ringExpChar, ringChar.eq R 0]; rfl
rw [ringExpChar, ringChar.eq R q]
exact Nat.max_eq_left h.one_lt.le
@[simp]
theorem ringExpChar.eq_one (R : Type*) [NonAssocSemiring R] [CharZero R] : ringExpChar R = 1 := by
rw [ringExpChar, ringChar.eq_zero, max_eq_right zero_le_one]
theorem expChar_one_of_char_zero (q : β) [hp : CharP R 0] [hq : ExpChar R q] : q = 1 := by
cases' hq with q hq_one hq_prime hq_hchar
Β· rfl
Β· exact False.elim <| hq_prime.ne_zero <| hq_hchar.eq R hp
#align exp_char_one_of_char_zero expChar_one_of_char_zero
theorem char_eq_expChar_iff (p q : β) [hp : CharP R p] [hq : ExpChar R q] : p = q β p.Prime := by
cases' hq with q hq_one hq_prime hq_hchar
Β· rw [(CharP.eq R hp inferInstance : p = 0)]
decide
Β· exact β¨fun hpq => hpq.symm βΈ hq_prime, fun _ => CharP.eq R hp hq_hcharβ©
#align char_eq_exp_char_iff char_eq_expChar_iff
section Nontrivial
variable [Nontrivial R]
theorem char_zero_of_expChar_one (p : β) [hp : CharP R p] [hq : ExpChar R 1] : p = 0 := by
cases hq
Β· exact CharP.eq R hp inferInstance
Β· exact False.elim (CharP.char_ne_one R 1 rfl)
#align char_zero_of_exp_char_one char_zero_of_expChar_one
-- This could be an instance, but there are no `ExpChar R 1` instances in mathlib.
theorem charZero_of_expChar_one' [hq : ExpChar R 1] : CharZero R := by
cases hq
Β· assumption
Β· exact False.elim (CharP.char_ne_one R 1 rfl)
#align char_zero_of_exp_char_one' charZero_of_expChar_one'
theorem expChar_one_iff_char_zero (p q : β) [CharP R p] [ExpChar R q] : q = 1 β p = 0 := by
constructor
Β· rintro rfl
exact char_zero_of_expChar_one R p
Β· rintro rfl
exact expChar_one_of_char_zero R q
#align exp_char_one_iff_char_zero expChar_one_iff_char_zero
section NoZeroDivisors
variable [NoZeroDivisors R]
theorem char_prime_of_ne_zero {p : β} [hp : CharP R p] (p_ne_zero : p β 0) : Nat.Prime p := by
cases' CharP.char_is_prime_or_zero R p with h h
Β· exact h
Β· contradiction
#align char_prime_of_ne_zero char_prime_of_ne_zero
| Mathlib/Algebra/CharP/ExpChar.lean | 141 | 144 | theorem expChar_is_prime_or_one (q : β) [hq : ExpChar R q] : Nat.Prime q β¨ q = 1 := by |
cases hq with
| zero => exact .inr rfl
| prime hp => exact .inl hp
| 3 | 20.085537 | 1 | 1.272727 | 11 | 1,345 |
import Mathlib.Algebra.CharP.Basic
import Mathlib.Algebra.CharP.Algebra
import Mathlib.Data.Nat.Prime
#align_import algebra.char_p.exp_char from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
universe u
variable (R : Type u)
section Semiring
variable [Semiring R]
class inductive ExpChar (R : Type u) [Semiring R] : β β Prop
| zero [CharZero R] : ExpChar R 1
| prime {q : β} (hprime : q.Prime) [hchar : CharP R q] : ExpChar R q
#align exp_char ExpChar
#align exp_char.prime ExpChar.prime
instance expChar_prime (p) [CharP R p] [Fact p.Prime] : ExpChar R p := ExpChar.prime Fact.out
instance expChar_zero [CharZero R] : ExpChar R 1 := ExpChar.zero
instance (S : Type*) [Semiring S] (p) [ExpChar R p] [ExpChar S p] : ExpChar (R Γ S) p := by
obtain hp | β¨hpβ© := βΉExpChar R pβΊ
Β· have := Prod.charZero_of_left R S; exact .zero
obtain _ | _ := βΉExpChar S pβΊ
Β· exact (Nat.not_prime_one hp).elim
Β· have := Prod.charP R S p; exact .prime hp
variable {R} in
theorem ExpChar.eq {p q : β} (hp : ExpChar R p) (hq : ExpChar R q) : p = q := by
cases' hp with hp _ hp' hp
Β· cases' hq with hq _ hq' hq
exacts [rfl, False.elim (Nat.not_prime_zero (CharP.eq R hq (CharP.ofCharZero R) βΈ hq'))]
Β· cases' hq with hq _ hq' hq
exacts [False.elim (Nat.not_prime_zero (CharP.eq R hp (CharP.ofCharZero R) βΈ hp')),
CharP.eq R hp hq]
theorem ExpChar.congr {p : β} (q : β) [hq : ExpChar R q] (h : q = p) : ExpChar R p := h βΈ hq
noncomputable def ringExpChar (R : Type*) [NonAssocSemiring R] : β := max (ringChar R) 1
theorem ringExpChar.eq (q : β) [h : ExpChar R q] : ringExpChar R = q := by
cases' h with _ _ h _
Β· haveI := CharP.ofCharZero R
rw [ringExpChar, ringChar.eq R 0]; rfl
rw [ringExpChar, ringChar.eq R q]
exact Nat.max_eq_left h.one_lt.le
@[simp]
theorem ringExpChar.eq_one (R : Type*) [NonAssocSemiring R] [CharZero R] : ringExpChar R = 1 := by
rw [ringExpChar, ringChar.eq_zero, max_eq_right zero_le_one]
theorem expChar_one_of_char_zero (q : β) [hp : CharP R 0] [hq : ExpChar R q] : q = 1 := by
cases' hq with q hq_one hq_prime hq_hchar
Β· rfl
Β· exact False.elim <| hq_prime.ne_zero <| hq_hchar.eq R hp
#align exp_char_one_of_char_zero expChar_one_of_char_zero
theorem char_eq_expChar_iff (p q : β) [hp : CharP R p] [hq : ExpChar R q] : p = q β p.Prime := by
cases' hq with q hq_one hq_prime hq_hchar
Β· rw [(CharP.eq R hp inferInstance : p = 0)]
decide
Β· exact β¨fun hpq => hpq.symm βΈ hq_prime, fun _ => CharP.eq R hp hq_hcharβ©
#align char_eq_exp_char_iff char_eq_expChar_iff
section Nontrivial
variable [Nontrivial R]
theorem char_zero_of_expChar_one (p : β) [hp : CharP R p] [hq : ExpChar R 1] : p = 0 := by
cases hq
Β· exact CharP.eq R hp inferInstance
Β· exact False.elim (CharP.char_ne_one R 1 rfl)
#align char_zero_of_exp_char_one char_zero_of_expChar_one
-- This could be an instance, but there are no `ExpChar R 1` instances in mathlib.
theorem charZero_of_expChar_one' [hq : ExpChar R 1] : CharZero R := by
cases hq
Β· assumption
Β· exact False.elim (CharP.char_ne_one R 1 rfl)
#align char_zero_of_exp_char_one' charZero_of_expChar_one'
theorem expChar_one_iff_char_zero (p q : β) [CharP R p] [ExpChar R q] : q = 1 β p = 0 := by
constructor
Β· rintro rfl
exact char_zero_of_expChar_one R p
Β· rintro rfl
exact expChar_one_of_char_zero R q
#align exp_char_one_iff_char_zero expChar_one_iff_char_zero
section NoZeroDivisors
variable [NoZeroDivisors R]
theorem char_prime_of_ne_zero {p : β} [hp : CharP R p] (p_ne_zero : p β 0) : Nat.Prime p := by
cases' CharP.char_is_prime_or_zero R p with h h
Β· exact h
Β· contradiction
#align char_prime_of_ne_zero char_prime_of_ne_zero
theorem expChar_is_prime_or_one (q : β) [hq : ExpChar R q] : Nat.Prime q β¨ q = 1 := by
cases hq with
| zero => exact .inr rfl
| prime hp => exact .inl hp
#align exp_char_is_prime_or_one expChar_is_prime_or_one
| Mathlib/Algebra/CharP/ExpChar.lean | 148 | 150 | theorem expChar_pos (q : β) [ExpChar R q] : 0 < q := by |
rcases expChar_is_prime_or_one R q with h | rfl
exacts [Nat.Prime.pos h, Nat.one_pos]
| 2 | 7.389056 | 1 | 1.272727 | 11 | 1,345 |
import Mathlib.Algebra.BigOperators.NatAntidiagonal
import Mathlib.Algebra.GeomSum
import Mathlib.Data.Fintype.BigOperators
import Mathlib.RingTheory.PowerSeries.Inverse
import Mathlib.RingTheory.PowerSeries.WellKnown
import Mathlib.Tactic.FieldSimp
#align_import number_theory.bernoulli from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2"
open Nat Finset Finset.Nat PowerSeries
variable (A : Type*) [CommRing A] [Algebra β A]
def bernoulli' : β β β :=
WellFounded.fix Nat.lt_wfRel.wf fun n bernoulli' =>
1 - β k : Fin n, n.choose k / (n - k + 1) * bernoulli' k k.2
#align bernoulli' bernoulli'
theorem bernoulli'_def' (n : β) :
bernoulli' n = 1 - β k : Fin n, n.choose k / (n - k + 1) * bernoulli' k :=
WellFounded.fix_eq _ _ _
#align bernoulli'_def' bernoulli'_def'
| Mathlib/NumberTheory/Bernoulli.lean | 78 | 80 | theorem bernoulli'_def (n : β) :
bernoulli' n = 1 - β k β range n, n.choose k / (n - k + 1) * bernoulli' k := by |
rw [bernoulli'_def', β Fin.sum_univ_eq_sum_range]
| 1 | 2.718282 | 0 | 1.272727 | 11 | 1,346 |
import Mathlib.Algebra.BigOperators.NatAntidiagonal
import Mathlib.Algebra.GeomSum
import Mathlib.Data.Fintype.BigOperators
import Mathlib.RingTheory.PowerSeries.Inverse
import Mathlib.RingTheory.PowerSeries.WellKnown
import Mathlib.Tactic.FieldSimp
#align_import number_theory.bernoulli from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2"
open Nat Finset Finset.Nat PowerSeries
variable (A : Type*) [CommRing A] [Algebra β A]
def bernoulli' : β β β :=
WellFounded.fix Nat.lt_wfRel.wf fun n bernoulli' =>
1 - β k : Fin n, n.choose k / (n - k + 1) * bernoulli' k k.2
#align bernoulli' bernoulli'
theorem bernoulli'_def' (n : β) :
bernoulli' n = 1 - β k : Fin n, n.choose k / (n - k + 1) * bernoulli' k :=
WellFounded.fix_eq _ _ _
#align bernoulli'_def' bernoulli'_def'
theorem bernoulli'_def (n : β) :
bernoulli' n = 1 - β k β range n, n.choose k / (n - k + 1) * bernoulli' k := by
rw [bernoulli'_def', β Fin.sum_univ_eq_sum_range]
#align bernoulli'_def bernoulli'_def
| Mathlib/NumberTheory/Bernoulli.lean | 83 | 88 | theorem bernoulli'_spec (n : β) :
(β k β range n.succ, (n.choose (n - k) : β) / (n - k + 1) * bernoulli' k) = 1 := by |
rw [sum_range_succ_comm, bernoulli'_def n, tsub_self, choose_zero_right, sub_self, zero_add,
div_one, cast_one, one_mul, sub_add, β sum_sub_distrib, β sub_eq_zero, sub_sub_cancel_left,
neg_eq_zero]
exact Finset.sum_eq_zero (fun x hx => by rw [choose_symm (le_of_lt (mem_range.1 hx)), sub_self])
| 4 | 54.59815 | 2 | 1.272727 | 11 | 1,346 |
import Mathlib.Algebra.BigOperators.NatAntidiagonal
import Mathlib.Algebra.GeomSum
import Mathlib.Data.Fintype.BigOperators
import Mathlib.RingTheory.PowerSeries.Inverse
import Mathlib.RingTheory.PowerSeries.WellKnown
import Mathlib.Tactic.FieldSimp
#align_import number_theory.bernoulli from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2"
open Nat Finset Finset.Nat PowerSeries
variable (A : Type*) [CommRing A] [Algebra β A]
def bernoulli' : β β β :=
WellFounded.fix Nat.lt_wfRel.wf fun n bernoulli' =>
1 - β k : Fin n, n.choose k / (n - k + 1) * bernoulli' k k.2
#align bernoulli' bernoulli'
theorem bernoulli'_def' (n : β) :
bernoulli' n = 1 - β k : Fin n, n.choose k / (n - k + 1) * bernoulli' k :=
WellFounded.fix_eq _ _ _
#align bernoulli'_def' bernoulli'_def'
theorem bernoulli'_def (n : β) :
bernoulli' n = 1 - β k β range n, n.choose k / (n - k + 1) * bernoulli' k := by
rw [bernoulli'_def', β Fin.sum_univ_eq_sum_range]
#align bernoulli'_def bernoulli'_def
theorem bernoulli'_spec (n : β) :
(β k β range n.succ, (n.choose (n - k) : β) / (n - k + 1) * bernoulli' k) = 1 := by
rw [sum_range_succ_comm, bernoulli'_def n, tsub_self, choose_zero_right, sub_self, zero_add,
div_one, cast_one, one_mul, sub_add, β sum_sub_distrib, β sub_eq_zero, sub_sub_cancel_left,
neg_eq_zero]
exact Finset.sum_eq_zero (fun x hx => by rw [choose_symm (le_of_lt (mem_range.1 hx)), sub_self])
#align bernoulli'_spec bernoulli'_spec
| Mathlib/NumberTheory/Bernoulli.lean | 91 | 95 | theorem bernoulli'_spec' (n : β) :
(β k β antidiagonal n, ((k.1 + k.2).choose k.2 : β) / (k.2 + 1) * bernoulli' k.1) = 1 := by |
refine ((sum_antidiagonal_eq_sum_range_succ_mk _ n).trans ?_).trans (bernoulli'_spec n)
refine sum_congr rfl fun x hx => ?_
simp only [add_tsub_cancel_of_le, mem_range_succ_iff.mp hx, cast_sub]
| 3 | 20.085537 | 1 | 1.272727 | 11 | 1,346 |
import Mathlib.Algebra.BigOperators.NatAntidiagonal
import Mathlib.Algebra.GeomSum
import Mathlib.Data.Fintype.BigOperators
import Mathlib.RingTheory.PowerSeries.Inverse
import Mathlib.RingTheory.PowerSeries.WellKnown
import Mathlib.Tactic.FieldSimp
#align_import number_theory.bernoulli from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2"
open Nat Finset Finset.Nat PowerSeries
variable (A : Type*) [CommRing A] [Algebra β A]
def bernoulli' : β β β :=
WellFounded.fix Nat.lt_wfRel.wf fun n bernoulli' =>
1 - β k : Fin n, n.choose k / (n - k + 1) * bernoulli' k k.2
#align bernoulli' bernoulli'
theorem bernoulli'_def' (n : β) :
bernoulli' n = 1 - β k : Fin n, n.choose k / (n - k + 1) * bernoulli' k :=
WellFounded.fix_eq _ _ _
#align bernoulli'_def' bernoulli'_def'
theorem bernoulli'_def (n : β) :
bernoulli' n = 1 - β k β range n, n.choose k / (n - k + 1) * bernoulli' k := by
rw [bernoulli'_def', β Fin.sum_univ_eq_sum_range]
#align bernoulli'_def bernoulli'_def
theorem bernoulli'_spec (n : β) :
(β k β range n.succ, (n.choose (n - k) : β) / (n - k + 1) * bernoulli' k) = 1 := by
rw [sum_range_succ_comm, bernoulli'_def n, tsub_self, choose_zero_right, sub_self, zero_add,
div_one, cast_one, one_mul, sub_add, β sum_sub_distrib, β sub_eq_zero, sub_sub_cancel_left,
neg_eq_zero]
exact Finset.sum_eq_zero (fun x hx => by rw [choose_symm (le_of_lt (mem_range.1 hx)), sub_self])
#align bernoulli'_spec bernoulli'_spec
theorem bernoulli'_spec' (n : β) :
(β k β antidiagonal n, ((k.1 + k.2).choose k.2 : β) / (k.2 + 1) * bernoulli' k.1) = 1 := by
refine ((sum_antidiagonal_eq_sum_range_succ_mk _ n).trans ?_).trans (bernoulli'_spec n)
refine sum_congr rfl fun x hx => ?_
simp only [add_tsub_cancel_of_le, mem_range_succ_iff.mp hx, cast_sub]
#align bernoulli'_spec' bernoulli'_spec'
section Examples
@[simp]
| Mathlib/NumberTheory/Bernoulli.lean | 104 | 106 | theorem bernoulli'_zero : bernoulli' 0 = 1 := by |
rw [bernoulli'_def]
norm_num
| 2 | 7.389056 | 1 | 1.272727 | 11 | 1,346 |
import Mathlib.Algebra.BigOperators.NatAntidiagonal
import Mathlib.Algebra.GeomSum
import Mathlib.Data.Fintype.BigOperators
import Mathlib.RingTheory.PowerSeries.Inverse
import Mathlib.RingTheory.PowerSeries.WellKnown
import Mathlib.Tactic.FieldSimp
#align_import number_theory.bernoulli from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2"
open Nat Finset Finset.Nat PowerSeries
variable (A : Type*) [CommRing A] [Algebra β A]
def bernoulli' : β β β :=
WellFounded.fix Nat.lt_wfRel.wf fun n bernoulli' =>
1 - β k : Fin n, n.choose k / (n - k + 1) * bernoulli' k k.2
#align bernoulli' bernoulli'
theorem bernoulli'_def' (n : β) :
bernoulli' n = 1 - β k : Fin n, n.choose k / (n - k + 1) * bernoulli' k :=
WellFounded.fix_eq _ _ _
#align bernoulli'_def' bernoulli'_def'
theorem bernoulli'_def (n : β) :
bernoulli' n = 1 - β k β range n, n.choose k / (n - k + 1) * bernoulli' k := by
rw [bernoulli'_def', β Fin.sum_univ_eq_sum_range]
#align bernoulli'_def bernoulli'_def
theorem bernoulli'_spec (n : β) :
(β k β range n.succ, (n.choose (n - k) : β) / (n - k + 1) * bernoulli' k) = 1 := by
rw [sum_range_succ_comm, bernoulli'_def n, tsub_self, choose_zero_right, sub_self, zero_add,
div_one, cast_one, one_mul, sub_add, β sum_sub_distrib, β sub_eq_zero, sub_sub_cancel_left,
neg_eq_zero]
exact Finset.sum_eq_zero (fun x hx => by rw [choose_symm (le_of_lt (mem_range.1 hx)), sub_self])
#align bernoulli'_spec bernoulli'_spec
theorem bernoulli'_spec' (n : β) :
(β k β antidiagonal n, ((k.1 + k.2).choose k.2 : β) / (k.2 + 1) * bernoulli' k.1) = 1 := by
refine ((sum_antidiagonal_eq_sum_range_succ_mk _ n).trans ?_).trans (bernoulli'_spec n)
refine sum_congr rfl fun x hx => ?_
simp only [add_tsub_cancel_of_le, mem_range_succ_iff.mp hx, cast_sub]
#align bernoulli'_spec' bernoulli'_spec'
section Examples
@[simp]
theorem bernoulli'_zero : bernoulli' 0 = 1 := by
rw [bernoulli'_def]
norm_num
#align bernoulli'_zero bernoulli'_zero
@[simp]
| Mathlib/NumberTheory/Bernoulli.lean | 110 | 112 | theorem bernoulli'_one : bernoulli' 1 = 1 / 2 := by |
rw [bernoulli'_def]
norm_num
| 2 | 7.389056 | 1 | 1.272727 | 11 | 1,346 |
import Mathlib.Algebra.BigOperators.NatAntidiagonal
import Mathlib.Algebra.GeomSum
import Mathlib.Data.Fintype.BigOperators
import Mathlib.RingTheory.PowerSeries.Inverse
import Mathlib.RingTheory.PowerSeries.WellKnown
import Mathlib.Tactic.FieldSimp
#align_import number_theory.bernoulli from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2"
open Nat Finset Finset.Nat PowerSeries
variable (A : Type*) [CommRing A] [Algebra β A]
def bernoulli' : β β β :=
WellFounded.fix Nat.lt_wfRel.wf fun n bernoulli' =>
1 - β k : Fin n, n.choose k / (n - k + 1) * bernoulli' k k.2
#align bernoulli' bernoulli'
theorem bernoulli'_def' (n : β) :
bernoulli' n = 1 - β k : Fin n, n.choose k / (n - k + 1) * bernoulli' k :=
WellFounded.fix_eq _ _ _
#align bernoulli'_def' bernoulli'_def'
theorem bernoulli'_def (n : β) :
bernoulli' n = 1 - β k β range n, n.choose k / (n - k + 1) * bernoulli' k := by
rw [bernoulli'_def', β Fin.sum_univ_eq_sum_range]
#align bernoulli'_def bernoulli'_def
theorem bernoulli'_spec (n : β) :
(β k β range n.succ, (n.choose (n - k) : β) / (n - k + 1) * bernoulli' k) = 1 := by
rw [sum_range_succ_comm, bernoulli'_def n, tsub_self, choose_zero_right, sub_self, zero_add,
div_one, cast_one, one_mul, sub_add, β sum_sub_distrib, β sub_eq_zero, sub_sub_cancel_left,
neg_eq_zero]
exact Finset.sum_eq_zero (fun x hx => by rw [choose_symm (le_of_lt (mem_range.1 hx)), sub_self])
#align bernoulli'_spec bernoulli'_spec
theorem bernoulli'_spec' (n : β) :
(β k β antidiagonal n, ((k.1 + k.2).choose k.2 : β) / (k.2 + 1) * bernoulli' k.1) = 1 := by
refine ((sum_antidiagonal_eq_sum_range_succ_mk _ n).trans ?_).trans (bernoulli'_spec n)
refine sum_congr rfl fun x hx => ?_
simp only [add_tsub_cancel_of_le, mem_range_succ_iff.mp hx, cast_sub]
#align bernoulli'_spec' bernoulli'_spec'
section Examples
@[simp]
theorem bernoulli'_zero : bernoulli' 0 = 1 := by
rw [bernoulli'_def]
norm_num
#align bernoulli'_zero bernoulli'_zero
@[simp]
theorem bernoulli'_one : bernoulli' 1 = 1 / 2 := by
rw [bernoulli'_def]
norm_num
#align bernoulli'_one bernoulli'_one
@[simp]
| Mathlib/NumberTheory/Bernoulli.lean | 116 | 118 | theorem bernoulli'_two : bernoulli' 2 = 1 / 6 := by |
rw [bernoulli'_def]
norm_num [sum_range_succ, sum_range_succ, sum_range_zero]
| 2 | 7.389056 | 1 | 1.272727 | 11 | 1,346 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.