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