Dataset Viewer
Auto-converted to Parquet Duplicate
fact
stringlengths
19
5.66k
type
stringclasses
8 values
library
stringclasses
2 values
imports
listlengths
1
14
filename
stringclasses
160 values
symbolic_name
stringlengths
1
92
docstring
stringlengths
12
499
PNat.pow_add_pow_ne_pow (x y z : ℕ+) (n : ℕ) (hn : n > 2) : x^n + y^n ≠ z^n := PNat.pow_add_pow_ne_pow_of_FermatLastTheorem Wiles_Taylor_Wiles x y z n hn #print axioms PNat.pow_add_pow_ne_pow /- 'PNat.pow_add_pow_ne_pow' depends on axioms: [propext, sorryAx, Classical.choice, Quot.sound] -/ -- The project will be compl...
theorem
root
[ "import FLT -- import the project files" ]
FermatsLastTheorem.lean
PNat.pow_add_pow_ne_pow
/-- Fermat's Last Theorem for positive naturals. -/
knownin1980s {P : Prop} : P /-- `knownin1980s` is a term which provides a proof of an arbitrary proposition. In this current phase of the FLT project, `knownin1980s` will be allowed as a proof of any theorem which would have been easy for an expert to deduce from the pre-1990 literature. This stretches from standard ea...
axiom
FLT
[ "import Mathlib.Init" ]
FLT/Assumptions/KnownIn1980s.lean
knownin1980s
null
Mazur_statement (E : WeierstrassCurve ℚ) [E.IsElliptic] : (AddCommGroup.torsion E⟮ℚ⟯ : Set E⟮ℚ⟯).ncard ≤ 16
axiom
FLT
[ "import Mathlib.GroupTheory.Torsion", "import Mathlib.AlgebraicGeometry.EllipticCurve.Affine.Point" ]
FLT/Assumptions/Mazur.lean
Mazur_statement
/-- Mazur's bound for the size of the torsion subgroup of an elliptic curve over the rationals . -/
Odlyzko_statement (K : Type*) [Field K] [NumberField K] [IsTotallyComplex K] (hdim : finrank ℚ K ≥ 18) : |(discr K : ℝ)| ≥ 8.25 ^ finrank ℚ K
axiom
FLT
[ "import Mathlib.NumberTheory.NumberField.Discriminant.Defs", "import Mathlib.NumberTheory.NumberField.InfinitePlace.TotallyRealComplex" ]
FLT/Assumptions/Odlyzko.lean
Odlyzko_statement
/-- An "Odlyzko bound" for the root discriminant of a totally complex number field of degree 18 and above. -/
PNat.pow_add_pow_ne_pow_of_FermatLastTheorem : FermatLastTheorem → ∀ (a b c : ℕ+) (n : ℕ) (_ : n > 2), a ^ n + b ^ n ≠ c ^ n := by intro h₁ a b c n h₂ specialize h₁ n h₂ a b c (by simp) (by simp) (by simp) assumption_mod_cast /-- If Fermat's Last Theorem is true for primes `p ≥ 5`, then FLT is true. -/
theorem
FLT
[ "import Mathlib.Algebra.Polynomial.Bivariate", "import Mathlib.AlgebraicGeometry.EllipticCurve.Weierstrass", "import Mathlib.AlgebraicGeometry.EllipticCurve.VariableChange", "import Mathlib.Data.PNat.Basic", "import Mathlib.NumberTheory.FLT.Four", "import Mathlib.NumberTheory.FLT.Three", "import Mathlib...
FLT/Basic/FreyPackage.lean
PNat.pow_add_pow_ne_pow_of_FermatLastTheorem
/-- Fermat's Last Theorem as stated in mathlib (a statement `FermatLastTheorem` about naturals) implies Fermat's Last Theorem stated in terms of positive integers. -/
FermatLastTheorem.of_p_ge_5 (H : ∀ p ≥ 5, p.Prime → FermatLastTheoremFor p) : FermatLastTheorem := by apply FermatLastTheorem.of_odd_primes -- this is Fermat's proof for n=4, plus reduction to -- the case n prime. intro p pp p_odd if hp5 : 5 ≤ p then exact H _ hp5 pp else have hp2 := pp.two_le interval_cases p · contra...
lemma
FLT
[ "import Mathlib.Algebra.Polynomial.Bivariate", "import Mathlib.AlgebraicGeometry.EllipticCurve.Weierstrass", "import Mathlib.AlgebraicGeometry.EllipticCurve.VariableChange", "import Mathlib.Data.PNat.Basic", "import Mathlib.NumberTheory.FLT.Four", "import Mathlib.NumberTheory.FLT.Three", "import Mathlib...
FLT/Basic/FreyPackage.lean
FermatLastTheorem.of_p_ge_5
/-- If Fermat's Last Theorem is true for primes `p ≥ 5`, then FLT is true. -/
FreyPackage where /-- The integer `a` in the Frey package. -/ a : ℤ /-- The integer `b` in the Frey package. -/ b : ℤ /-- The integer `c` in the Frey package. -/ c : ℤ ha0 : a ≠ 0 hb0 : b ≠ 0 hc0 : c ≠ 0 /-- The prime number `p` in the Frey package. -/ p : ℕ pp : Nat.Prime p hp5 : 5 ≤ p hFLT : a ^ p + b ^ p = c ^ p hgc...
structure
FLT
[ "import Mathlib.Algebra.Polynomial.Bivariate", "import Mathlib.AlgebraicGeometry.EllipticCurve.Weierstrass", "import Mathlib.AlgebraicGeometry.EllipticCurve.VariableChange", "import Mathlib.Data.PNat.Basic", "import Mathlib.NumberTheory.FLT.Four", "import Mathlib.NumberTheory.FLT.Three", "import Mathlib...
FLT/Basic/FreyPackage.lean
FreyPackage
/-- A *Frey Package* is a 4-tuple (a,b,c,p) of integers satisfying $a^p+b^p=c^p$ and some other inequalities and congruences. These facts guarantee that all of the all the results in section 4.1 of Serre's paper [serre] apply to the curve $Y^2=X(X-a^p)(X+b^p).$ -/
hppos (P : FreyPackage) : 0 < P.p := lt_of_lt_of_le (by omega) P.hp5
lemma
FLT
[ "import Mathlib.Algebra.Polynomial.Bivariate", "import Mathlib.AlgebraicGeometry.EllipticCurve.Weierstrass", "import Mathlib.AlgebraicGeometry.EllipticCurve.VariableChange", "import Mathlib.Data.PNat.Basic", "import Mathlib.NumberTheory.FLT.Four", "import Mathlib.NumberTheory.FLT.Three", "import Mathlib...
FLT/Basic/FreyPackage.lean
hppos
/-- The prime number `p` in the Frey package. -/
hp0 (P : FreyPackage) : P.p ≠ 0 := P.hppos.ne'
lemma
FLT
[ "import Mathlib.Algebra.Polynomial.Bivariate", "import Mathlib.AlgebraicGeometry.EllipticCurve.Weierstrass", "import Mathlib.AlgebraicGeometry.EllipticCurve.VariableChange", "import Mathlib.Data.PNat.Basic", "import Mathlib.NumberTheory.FLT.Four", "import Mathlib.NumberTheory.FLT.Three", "import Mathlib...
FLT/Basic/FreyPackage.lean
hp0
/-- The prime number `p` in the Frey package. -/
hp_odd (P : FreyPackage) : Odd P.p := Nat.Prime.odd_of_ne_two P.pp <| have := P.hp5; by linarith
lemma
FLT
[ "import Mathlib.Algebra.Polynomial.Bivariate", "import Mathlib.AlgebraicGeometry.EllipticCurve.Weierstrass", "import Mathlib.AlgebraicGeometry.EllipticCurve.VariableChange", "import Mathlib.Data.PNat.Basic", "import Mathlib.NumberTheory.FLT.Four", "import Mathlib.NumberTheory.FLT.Three", "import Mathlib...
FLT/Basic/FreyPackage.lean
hp_odd
/-- The prime number `p` in the Frey package. -/
gcdab_eq_gcdac {a b c : ℤ} {p : ℕ} (hp : 0 < p) (h : a ^ p + b ^ p = c ^ p) : gcd a b = gcd a c := by have foo : gcd a b ∣ gcd a c := by apply dvd_gcd (gcd_dvd_left a b) rw [← Int.pow_dvd_pow_iff hp.ne', ← h] apply dvd_add <;> rw [Int.pow_dvd_pow_iff hp.ne'] · exact gcd_dvd_left a b · exact gcd_dvd_right a b have bar :...
lemma
FLT
[ "import Mathlib.Algebra.Polynomial.Bivariate", "import Mathlib.AlgebraicGeometry.EllipticCurve.Weierstrass", "import Mathlib.AlgebraicGeometry.EllipticCurve.VariableChange", "import Mathlib.Data.PNat.Basic", "import Mathlib.NumberTheory.FLT.Four", "import Mathlib.NumberTheory.FLT.Three", "import Mathlib...
FLT/Basic/FreyPackage.lean
gcdab_eq_gcdac
/-- The prime number `p` in the Frey package. -/
hgcdac (P : FreyPackage) : gcd P.a P.c = 1 := by rw [← gcdab_eq_gcdac P.hppos P.hFLT, P.hgcdab]
lemma
FLT
[ "import Mathlib.Algebra.Polynomial.Bivariate", "import Mathlib.AlgebraicGeometry.EllipticCurve.Weierstrass", "import Mathlib.AlgebraicGeometry.EllipticCurve.VariableChange", "import Mathlib.Data.PNat.Basic", "import Mathlib.NumberTheory.FLT.Four", "import Mathlib.NumberTheory.FLT.Three", "import Mathlib...
FLT/Basic/FreyPackage.lean
hgcdac
null
hgcdbc (P : FreyPackage) : gcd P.b P.c = 1 := by rw [← gcdab_eq_gcdac P.hppos, gcd_comm, P.hgcdab] rw [add_comm] exact P.hFLT -- for mathlib? I thought I needed it but I got around it -- lemma Int.dvd_div_iff {a b c : ℤ} (hbc : c ∣ b) : a ∣ b / c ↔ c * a ∣ b := by -- constructor -- · rintro ⟨x, hx⟩ -- use x -- rcases h...
lemma
FLT
[ "import Mathlib.Algebra.Polynomial.Bivariate", "import Mathlib.AlgebraicGeometry.EllipticCurve.Weierstrass", "import Mathlib.AlgebraicGeometry.EllipticCurve.VariableChange", "import Mathlib.Data.PNat.Basic", "import Mathlib.NumberTheory.FLT.Four", "import Mathlib.NumberTheory.FLT.Three", "import Mathlib...
FLT/Basic/FreyPackage.lean
hgcdbc
null
of_not_FermatLastTheorem_p_ge_5 {a b c : ℤ} (ha : a ≠ 0) (hb : b ≠ 0) (hc : c ≠ 0) {p : ℕ} (pp : p.Prime) (hp5 : 5 ≤ p) (H : a ^ p + b ^ p = c ^ p) : Nonempty FreyPackage := by have p_odd := pp.odd_of_ne_two (by omega) -- First, show that we can make a,b coprime by dividing through by gcd a b have ⟨a, b, c, a0, b0, c0,...
lemma
FLT
[ "import Mathlib.Algebra.Polynomial.Bivariate", "import Mathlib.AlgebraicGeometry.EllipticCurve.Weierstrass", "import Mathlib.AlgebraicGeometry.EllipticCurve.VariableChange", "import Mathlib.Data.PNat.Basic", "import Mathlib.NumberTheory.FLT.Four", "import Mathlib.NumberTheory.FLT.Three", "import Mathlib...
FLT/Basic/FreyPackage.lean
of_not_FermatLastTheorem_p_ge_5
/-- Given a counterexample a^p+b^p=c^p to Fermat's Last Theorem with p>=5, there exists a Frey package. -/
of_not_FermatLastTheorem (h : ¬ FermatLastTheorem) : Nonempty (FreyPackage) := by contrapose! h refine FermatLastTheorem.of_p_ge_5 fun p hp5 pp a b c ha hb _ h2 ↦ Nonempty.elim ?_ h.false apply FreyPackage.of_not_FermatLastTheorem_p_ge_5 (a := a) (b := b) (c := c) <;> assumption_mod_cast /-- The Weierstrass curve over ...
lemma
FLT
[ "import Mathlib.Algebra.Polynomial.Bivariate", "import Mathlib.AlgebraicGeometry.EllipticCurve.Weierstrass", "import Mathlib.AlgebraicGeometry.EllipticCurve.VariableChange", "import Mathlib.Data.PNat.Basic", "import Mathlib.NumberTheory.FLT.Four", "import Mathlib.NumberTheory.FLT.Three", "import Mathlib...
FLT/Basic/FreyPackage.lean
of_not_FermatLastTheorem
/-- If Fermat's Last Theorem is false, then there exists a Frey Package. -/
freyCurveInt (P : FreyPackage) : WeierstrassCurve ℤ where a₁ := 1 -- Note that the numerator of a₂ is a multiple of 4 a₂ := (P.b ^ P.p - 1 - P.a ^ P.p) / 4 a₃ := 0 a₄ := -(P.a ^ P.p) * (P.b ^ P.p) / 16 -- Note: numerator is multiple of 16 a₆ := 0 /-- The elliptic curve over `ℚ` associated to a Frey package. The conditi...
def
FLT
[ "import Mathlib.Algebra.Polynomial.Bivariate", "import Mathlib.AlgebraicGeometry.EllipticCurve.Weierstrass", "import Mathlib.AlgebraicGeometry.EllipticCurve.VariableChange", "import Mathlib.Data.PNat.Basic", "import Mathlib.NumberTheory.FLT.Four", "import Mathlib.NumberTheory.FLT.Three", "import Mathlib...
FLT/Basic/FreyPackage.lean
freyCurveInt
/-- The Weierstrass curve over `ℤ` associated to a Frey package. The conditions imposed upon a Frey package guarantee that the running hypotheses in Section 4.1 of [Serre] all hold. We put the curve into the form where the equation is semistable at 2, rather than the usual `Y^2=X(X-a^p)(X+b^p)` form. The change of vari...
freyCurve (P : FreyPackage) : WeierstrassCurve ℚ where a₁ := 1 -- a₂ is an integer because of the congruences assumed e.g. P.ha4 a₂ := (P.b ^ P.p - 1 - P.a ^ P.p) / 4 a₃ := 0 a₄ := -(P.a ^ P.p) * (P.b ^ P.p) / 16 -- this is also an integer a₆ := 0
def
FLT
[ "import Mathlib.Algebra.Polynomial.Bivariate", "import Mathlib.AlgebraicGeometry.EllipticCurve.Weierstrass", "import Mathlib.AlgebraicGeometry.EllipticCurve.VariableChange", "import Mathlib.Data.PNat.Basic", "import Mathlib.NumberTheory.FLT.Four", "import Mathlib.NumberTheory.FLT.Three", "import Mathlib...
FLT/Basic/FreyPackage.lean
freyCurve
/-- The elliptic curve over `ℚ` associated to a Frey package. The conditions imposed upon a Frey package guarantee that the running hypotheses in Section 4.1 of [Serre] all hold. We put the curve into the form where the equation is semistable at 2, rather than the usual `Y^2=X(X-a^p)(X+b^p)` form. The change of variabl...
map (P : FreyPackage) : (freyCurveInt P).map (algebraMap ℤ ℚ) = freyCurve P := by have two_dvd_b : 2 ∣ P.b := (ZMod.intCast_zmod_eq_zero_iff_dvd P.b 2).1 P.hb2 ext · rfl · change (((P.b ^ P.p - 1 - P.a ^ P.p) / 4 : ℤ) : ℚ) = (P.b ^ P.p - 1 - P.a ^ P.p) / 4 rw [Rat.intCast_div] · norm_cast · rw [sub_sub] apply Int.dvd_s...
theorem
FLT
[ "import Mathlib.Algebra.Polynomial.Bivariate", "import Mathlib.AlgebraicGeometry.EllipticCurve.Weierstrass", "import Mathlib.AlgebraicGeometry.EllipticCurve.VariableChange", "import Mathlib.Data.PNat.Basic", "import Mathlib.NumberTheory.FLT.Four", "import Mathlib.NumberTheory.FLT.Three", "import Mathlib...
FLT/Basic/FreyPackage.lean
map
null
Δ (P : FreyPackage) : P.freyCurve.Δ = (P.a*P.b*P.c)^(2*P.p) / 2 ^ 8 := by trans (P.a ^ P.p) ^ 2 * (P.b ^ P.p) ^ 2 * (P.c ^ P.p) ^ 2 / 2 ^ 8 · field_simp norm_cast simp [← P.hFLT, WeierstrassCurve.Δ, freyCurve, WeierstrassCurve.b₂, WeierstrassCurve.b₄, WeierstrassCurve.b₆, WeierstrassCurve.b₈] ring · simp [← mul_pow, ← ...
lemma
FLT
[ "import Mathlib.Algebra.Polynomial.Bivariate", "import Mathlib.AlgebraicGeometry.EllipticCurve.Weierstrass", "import Mathlib.AlgebraicGeometry.EllipticCurve.VariableChange", "import Mathlib.Data.PNat.Basic", "import Mathlib.NumberTheory.FLT.Four", "import Mathlib.NumberTheory.FLT.Three", "import Mathlib...
FLT/Basic/FreyPackage.lean
Δ
null
b₂ (P : FreyPackage) : P.freyCurve.b₂ = P.b ^ P.p - P.a ^ P.p := by simp [freyCurve, WeierstrassCurve.b₂] ring
lemma
FLT
[ "import Mathlib.Algebra.Polynomial.Bivariate", "import Mathlib.AlgebraicGeometry.EllipticCurve.Weierstrass", "import Mathlib.AlgebraicGeometry.EllipticCurve.VariableChange", "import Mathlib.Data.PNat.Basic", "import Mathlib.NumberTheory.FLT.Four", "import Mathlib.NumberTheory.FLT.Three", "import Mathlib...
FLT/Basic/FreyPackage.lean
b₂
null
b₄ (P : FreyPackage) : P.freyCurve.b₄ = - (P.a * P.b) ^ P.p / 8 := by simp [freyCurve, WeierstrassCurve.b₄] ring
lemma
FLT
[ "import Mathlib.Algebra.Polynomial.Bivariate", "import Mathlib.AlgebraicGeometry.EllipticCurve.Weierstrass", "import Mathlib.AlgebraicGeometry.EllipticCurve.VariableChange", "import Mathlib.Data.PNat.Basic", "import Mathlib.NumberTheory.FLT.Four", "import Mathlib.NumberTheory.FLT.Three", "import Mathlib...
FLT/Basic/FreyPackage.lean
b₄
null
c₄ (P : FreyPackage) : P.freyCurve.c₄ = (P.a ^ P.p) ^ 2 + P.a ^ P.p * P.b ^ P.p + (P.b ^ P.p) ^ 2 := by simp [FreyCurve.b₂, FreyCurve.b₄, WeierstrassCurve.c₄] ring
lemma
FLT
[ "import Mathlib.Algebra.Polynomial.Bivariate", "import Mathlib.AlgebraicGeometry.EllipticCurve.Weierstrass", "import Mathlib.AlgebraicGeometry.EllipticCurve.VariableChange", "import Mathlib.Data.PNat.Basic", "import Mathlib.NumberTheory.FLT.Four", "import Mathlib.NumberTheory.FLT.Three", "import Mathlib...
FLT/Basic/FreyPackage.lean
c₄
null
c₄' (P : FreyPackage) : P.freyCurve.c₄ = P.c ^ (2 * P.p) - (P.a * P.b) ^ P.p := by rw [FreyCurve.c₄] rw_mod_cast [pow_mul', ← hFLT] ring
lemma
FLT
[ "import Mathlib.Algebra.Polynomial.Bivariate", "import Mathlib.AlgebraicGeometry.EllipticCurve.Weierstrass", "import Mathlib.AlgebraicGeometry.EllipticCurve.VariableChange", "import Mathlib.Data.PNat.Basic", "import Mathlib.NumberTheory.FLT.Four", "import Mathlib.NumberTheory.FLT.Three", "import Mathlib...
FLT/Basic/FreyPackage.lean
c₄'
null
Δ'inv (P : FreyPackage) : (↑(P.freyCurve.Δ'⁻¹) : ℚ) = 2 ^ 8 / (P.a*P.b*P.c)^(2*P.p) := by simp [FreyCurve.Δ]
lemma
FLT
[ "import Mathlib.Algebra.Polynomial.Bivariate", "import Mathlib.AlgebraicGeometry.EllipticCurve.Weierstrass", "import Mathlib.AlgebraicGeometry.EllipticCurve.VariableChange", "import Mathlib.Data.PNat.Basic", "import Mathlib.NumberTheory.FLT.Four", "import Mathlib.NumberTheory.FLT.Three", "import Mathlib...
FLT/Basic/FreyPackage.lean
Δ'inv
null
j (P : FreyPackage) : P.freyCurve.j = 2^8*(P.c^(2*P.p)-(P.a*P.b)^P.p) ^ 3 /(P.a*P.b*P.c)^(2*P.p) := by rw [mul_div_right_comm, WeierstrassCurve.j, FreyCurve.Δ'inv, FreyCurve.c₄']
lemma
FLT
[ "import Mathlib.Algebra.Polynomial.Bivariate", "import Mathlib.AlgebraicGeometry.EllipticCurve.Weierstrass", "import Mathlib.AlgebraicGeometry.EllipticCurve.VariableChange", "import Mathlib.Data.PNat.Basic", "import Mathlib.NumberTheory.FLT.Four", "import Mathlib.NumberTheory.FLT.Three", "import Mathlib...
FLT/Basic/FreyPackage.lean
j
null
j_pos_aux (a b : ℤ) (hb : b ≠ 0) : 0 < (a + b) ^ 2 - a * b := by rify calc (0 : ℝ) < (a ^ 2 + (a + b) ^ 2 + b ^ 2) / 2 := by positivity _ = (a + b) ^ 2 - a * b := by ring /-- The q-adic valuation of the j-invariant of the Frey curve is a multiple of p if 2 < q is a prime of bad reduction. -/
lemma
FLT
[ "import Mathlib.Algebra.Polynomial.Bivariate", "import Mathlib.AlgebraicGeometry.EllipticCurve.Weierstrass", "import Mathlib.AlgebraicGeometry.EllipticCurve.VariableChange", "import Mathlib.Data.PNat.Basic", "import Mathlib.NumberTheory.FLT.Four", "import Mathlib.NumberTheory.FLT.Three", "import Mathlib...
FLT/Basic/FreyPackage.lean
j_pos_aux
null
j_valuation_of_bad_prime (P : FreyPackage) {q : ℕ} (hqPrime : q.Prime) (hqbad : (q : ℤ) ∣ P.a * P.b * P.c) (hqodd : 2 < q) : (P.p : ℤ) ∣ padicValRat q P.freyCurve.j := by have := Fact.mk hqPrime have hqPrime' := Nat.prime_iff_prime_int.mp hqPrime have h₀ : ((P.c ^ (2 * P.p) - (P.a * P.b) ^ P.p) ^ 3 : ℚ) ≠ 0 := by rw_mo...
lemma
FLT
[ "import Mathlib.Algebra.Polynomial.Bivariate", "import Mathlib.AlgebraicGeometry.EllipticCurve.Weierstrass", "import Mathlib.AlgebraicGeometry.EllipticCurve.VariableChange", "import Mathlib.Data.PNat.Basic", "import Mathlib.NumberTheory.FLT.Four", "import Mathlib.NumberTheory.FLT.Three", "import Mathlib...
FLT/Basic/FreyPackage.lean
j_valuation_of_bad_prime
/-- The q-adic valuation of the j-invariant of the Frey curve is a multiple of p if 2 < q is a prime of bad reduction. -/
Mazur_Frey (P : FreyPackage) : haveI : Fact P.p.Prime := ⟨P.pp⟩ GaloisRep.IsIrreducible (P.freyCurve.galoisRep P.p P.hppos) := sorry /-! But it follows from a profound theorem of Ribet, and the even more profound theorem (proved by Wiles) that the representation cannot be irreducible. -/
theorem
FLT
[ "import FLT.GaloisRepresentation.HardlyRamified.Frey" ]
FLT/Basic/Reductions.lean
Mazur_Frey
/-- A classical decidable instance on `AlgebraicClosure ℚ`, given that there is no hope of a constructive one with the current definition of algebraic closure. -/
Wiles_Frey (P : FreyPackage) : haveI : Fact P.p.Prime := ⟨P.pp⟩ ¬ GaloisRep.IsIrreducible (P.freyCurve.galoisRep P.p P.hppos) := FreyCurve.torsion_not_isIrreducible P /-! It follows that there is no Frey package. -/ /-- There is no Frey package. This profound result is proved using work of Mazur and Wiles/Ribet to rule...
theorem
FLT
[ "import FLT.GaloisRepresentation.HardlyRamified.Frey" ]
FLT/Basic/Reductions.lean
Wiles_Frey
null
FreyPackage.false (P : FreyPackage) : False := by -- by Wiles' result, the p-torsion is not irreducible apply Wiles_Frey P -- but by Mazur's result, the p-torsion is irreducible! exact Mazur_Frey P -- Contradiction! /-- Fermat's Last Theorem is true -/
theorem
FLT
[ "import FLT.GaloisRepresentation.HardlyRamified.Frey" ]
FLT/Basic/Reductions.lean
FreyPackage.false
/-- There is no Frey package. This profound result is proved using work of Mazur and Wiles/Ribet to rule out all possibilities for the $p$-torsion in the corresponding Frey curve. -/
Wiles_Taylor_Wiles : FermatLastTheorem := by -- Suppose Fermat's Last Theorem is false by_contra h -- then there exists a Frey package obtain ⟨P : FreyPackage⟩ := FreyPackage.of_not_FermatLastTheorem h -- but there is no Frey package exact P.false
theorem
FLT
[ "import FLT.GaloisRepresentation.HardlyRamified.Frey" ]
FLT/Basic/Reductions.lean
Wiles_Taylor_Wiles
/-- Fermat's Last Theorem is true -/
Hurwitz : Type where re : ℤ -- 1 im_o : ℤ -- ω im_i : ℤ -- i im_oi : ℤ -- ωi -- note iω + ωi + 1 + i = 0 notation "𝓞" => Hurwitz -- 𝓞 = \MCO namespace Hurwitz open Quaternion in
structure
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
Hurwitz
null
toQuaternion (z : 𝓞) : ℍ where re := z.re - 2⁻¹ * z.im_o - 2⁻¹ * z.im_oi imI := z.im_i + 2⁻¹ * z.im_o - 2⁻¹ * z.im_oi imJ := 2⁻¹ * z.im_o + 2⁻¹ * z.im_oi imK := 2⁻¹ * z.im_o - 2⁻¹ * z.im_oi open Quaternion in
def
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
toQuaternion
null
fromQuaternion (z : ℍ) : 𝓞 where re := Int.floor <| z.re + z.imJ im_o := Int.floor <| z.imJ + z.imK im_i := Int.floor <| z.imI - z.imK im_oi := Int.floor <| z.imJ - z.imK
def
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
fromQuaternion
null
leftInverse_fromQuaternion_toQuaternion : Function.LeftInverse fromQuaternion toQuaternion := by intro z simp only [fromQuaternion, toQuaternion, sub_add_add_cancel, sub_add_cancel, Int.floor_intCast, add_add_sub_cancel, ← two_mul, ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, mul_inv_cancel_left₀, sub_sub_sub_cancel_...
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
leftInverse_fromQuaternion_toQuaternion
null
toQuaternion_injective : Function.Injective toQuaternion := leftInverse_fromQuaternion_toQuaternion.injective open Quaternion in
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
toQuaternion_injective
null
leftInvOn_toQuaternion_fromQuaternion : Set.LeftInvOn toQuaternion fromQuaternion { q : ℍ | ∃ a b c d : ℤ, q = ⟨a, b, c, d⟩ ∨ q = ⟨a + 2⁻¹, b + 2⁻¹, c + 2⁻¹, d + 2⁻¹⟩ } := by have h₀ (x y : ℤ) : (x + 2 ⁻¹ : ℝ) + (y + 2⁻¹) = ↑(x + y + 1) := by field_simp; norm_cast; ring intro q hq simp only [Set.mem_setOf] at hq simp o...
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
leftInvOn_toQuaternion_fromQuaternion
null
fromQuaternion_injOn : Set.InjOn fromQuaternion { q : ℍ | ∃ a b c d : ℤ, q = ⟨a, b, c, d⟩ ∨ q = ⟨a + 2⁻¹, b + 2⁻¹, c + 2⁻¹, d + 2⁻¹⟩ } := leftInvOn_toQuaternion_fromQuaternion.injOn /-! ## zero (0) -/ /-- The Hurwitz number 0 -/
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
fromQuaternion_injOn
null
zero : 𝓞 := ⟨0, 0, 0, 0⟩ /-- notation `0` for `zero` -/
def
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
zero
/-- The Hurwitz number 0 -/
zero_re : re (0 : 𝓞) = 0 := rfl @[simp] lemma zero_im_o : im_o (0 : 𝓞) = 0 := rfl @[simp] lemma zero_im_i : im_i (0 : 𝓞) = 0 := rfl @[simp] lemma zero_im_oi : im_oi (0 : 𝓞) = 0 := rfl
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
zero_re
/-- notation `0` for `zero` -/
toQuaternion_zero : toQuaternion 0 = 0 := by ext <;> (simp [toQuaternion]) @[simp]
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
toQuaternion_zero
/-- notation `0` for `zero` -/
toQuaternion_eq_zero_iff {z} : toQuaternion z = 0 ↔ z = 0 := toQuaternion_injective.eq_iff' toQuaternion_zero
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
toQuaternion_eq_zero_iff
/-- notation `0` for `zero` -/
toQuaternion_ne_zero_iff {z} : toQuaternion z ≠ 0 ↔ z ≠ 0 := toQuaternion_injective.ne_iff' toQuaternion_zero /-! ## one (1) -/
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
toQuaternion_ne_zero_iff
/-- notation `0` for `zero` -/
one : 𝓞 := ⟨1, 0, 0, 0⟩ /-- Notation `1` for `one` -/
def
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
one
null
one_re : re (1 : 𝓞) = 1 := rfl @[simp] lemma one_im_o : im_o (1 : 𝓞) = 0 := rfl @[simp] lemma one_im_i : im_i (1 : 𝓞) = 0 := rfl @[simp] lemma one_im_oi : im_oi (1 : 𝓞) = 0 := rfl
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
one_re
/-- Notation `1` for `one` -/
toQuaternion_one : toQuaternion 1 = 1 := by ext <;> (simp [toQuaternion]) /-! ## Neg (-) -/ -- negation /-- The negation `-z` of a Hurwitz number -/
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
toQuaternion_one
/-- Notation `1` for `one` -/
neg (z : 𝓞) : 𝓞 := ⟨-re z, -im_o z, -im_i z, -im_oi z⟩ /-- Notation `-` for negation -/
def
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
neg
/-- The negation `-z` of a Hurwitz number -/
neg_re (z : 𝓞) : re (-z) = -re z := rfl @[simp] lemma neg_im_o (z : 𝓞) : im_o (-z) = -im_o z := rfl @[simp] lemma neg_im_i (z : 𝓞) : im_i (-z) = -im_i z := rfl @[simp] lemma neg_im_oi (z : 𝓞) : im_oi (-z) = -im_oi z := rfl
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
neg_re
/-- Notation `-` for negation -/
toQuaternion_neg (z : 𝓞) : toQuaternion (-z) = - toQuaternion z := by ext <;> simp [toQuaternion] <;> ring /-! ## add (+) -/ -- Now let's define addition /-- addition `z+w` of complex numbers -/
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
toQuaternion_neg
/-- Notation `-` for negation -/
add (z w : 𝓞) : 𝓞 := ⟨z.re + w.re, z.im_o + w.im_o, z.im_i + w.im_i, z.im_oi + w.im_oi⟩ /-- Notation `+` for addition -/
def
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
add
/-- addition `z+w` of complex numbers -/
add_re (z w : 𝓞) : re (z + w) = re z + re w := rfl @[simp] lemma add_im_o (z w : 𝓞) : im_o (z + w) = im_o z + im_o w := rfl @[simp] lemma add_im_i (z w : 𝓞) : im_i (z + w) = im_i z + im_i w := rfl @[simp] lemma add_im_oi (z w : 𝓞) : im_oi (z + w) = im_oi z + im_oi w := rfl
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
add_re
/-- Notation `+` for addition -/
toQuaternion_add (z w : 𝓞) : toQuaternion (z + w) = toQuaternion z + toQuaternion w := by ext <;> simp [toQuaternion] <;> ring /-- Notation `+` for addition -/
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
toQuaternion_add
/-- Notation `+` for addition -/
toQuaternion_sub (z w : 𝓞) : toQuaternion (z - w) = toQuaternion z - toQuaternion w := by convert toQuaternion_add z (-w) using 1 rw [sub_eq_add_neg, toQuaternion_neg] -- instance : AddCommGroup 𝓞 where -- add_assoc := by intros; ext <;> simp [add_assoc] -- zero_add := by intros; ext <;> simp -- add_zero := by intros...
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
toQuaternion_sub
/-- Notation `+` for addition -/
preserves_nsmulRec {M N : Type*} [Zero M] [Add M] [AddMonoid N] (f : M → N) (zero : f 0 = 0) (add : ∀ x y, f (x + y) = f x + f y) (n : ℕ) (x : M) : f (nsmulRec n x) = n • f x := by induction n with | zero => rw [nsmulRec, zero, zero_smul] | succ n ih => rw [nsmulRec, add, add_nsmul, one_nsmul, ih]
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
preserves_nsmulRec
null
toQuaternion_nsmul (z : 𝓞) (n : ℕ) : toQuaternion (n • z) = n • toQuaternion z := preserves_nsmulRec _ toQuaternion_zero toQuaternion_add _ _
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
toQuaternion_nsmul
null
preserves_zsmul {G H : Type*} [Zero G] [Add G] [Neg G] [SMul ℕ G] [SubNegMonoid H] (f : G → H) (nsmul : ∀ (g : G) (n : ℕ), f (n • g) = n • f g) (neg : ∀ x, f (-x) = -f x) (z : ℤ) (g : G) : f (zsmulRec (· • ·) z g) = z • f g := by cases z with | ofNat n => rw [zsmulRec, nsmul, Int.ofNat_eq_natCast, natCast_zsmul] | negS...
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
preserves_zsmul
null
toQuaternion_zsmul (z : 𝓞) (n : ℤ) : toQuaternion (n • z) = n • toQuaternion z := preserves_zsmul _ toQuaternion_nsmul toQuaternion_neg n z -- noncomputable instance : AddCommGroup 𝓞 := -- toQuaternion_injective.addCommGroup -- _ -- toQuaternion_zero -- toQuaternion_add -- toQuaternion_neg -- toQuaternion_sub -- toQu...
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
toQuaternion_zsmul
null
mul (z w : 𝓞) : 𝓞 where re := z.re * w.re - z.im_o * w.im_o - z.im_i * w.im_o - z.im_i * w.im_i + z.im_i * w.im_oi - z.im_oi * w.im_oi im_o := z.im_o * w.re + z.re * w.im_o - z.im_o * w.im_o - z.im_oi * w.im_o - z.im_oi * w.im_i + z.im_i * w.im_oi im_i := z.im_i * w.re - z.im_i * w.im_o + z.im_oi * w.im_o + z.re * w....
def
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
mul
/-- Multiplication `z*w` of two Hurwitz numbers -/
mul_re (z w : 𝓞) : re (z * w) = z.re * w.re - z.im_o * w.im_o - z.im_i * w.im_o - z.im_i * w.im_i + z.im_i * w.im_oi - z.im_oi * w.im_oi := rfl @[simp] lemma mul_im_o (z w : 𝓞) : im_o (z * w) = z.im_o * w.re + z.re * w.im_o - z.im_o * w.im_o - z.im_oi * w.im_o - z.im_oi * w.im_i + z.im_i * w.im_oi := rfl @[simp] lemm...
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
mul_re
/-- Notation `*` for multiplication -/
toQuaternion_mul (z w : 𝓞) : toQuaternion (z * w) = toQuaternion z * toQuaternion w := by ext <;> simp [toQuaternion] <;> ring
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
toQuaternion_mul
null
o_mul_i : { re := 0, im_o := 1, im_i := 0, im_oi := 0 } * { re := 0, im_o := 0, im_i := 1, im_oi := 0 } = ({ re := 0, im_o := 0, im_i := 0, im_oi := 1 } : 𝓞) := by ext <;> simp
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
o_mul_i
null
preserves_npowRec {M N : Type*} [One M] [Mul M] [Monoid N] (f : M → N) (one : f 1 = 1) (mul : ∀ x y : M, f (x * y) = f x * f y) (z : M) (n : ℕ) : f (npowRec n z) = (f z) ^ n := by induction n with | zero => rw [npowRec, one, pow_zero] | succ n ih => rw [npowRec, pow_succ, mul, ih]
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
preserves_npowRec
null
toQuaternion_npow (z : 𝓞) (n : ℕ) : toQuaternion (z ^ n) = (toQuaternion z) ^ n := preserves_npowRec toQuaternion toQuaternion_one toQuaternion_mul z n
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
toQuaternion_npow
null
preserves_unaryCast {R S : Type*} [One R] [Zero R] [Add R] [AddMonoidWithOne S] (f : R → S) (zero : f 0 = 0) (one : f 1 = 1) (add : ∀ x y, f (x + y) = f x + f y) (n : ℕ) : f (Nat.unaryCast n) = n := by induction n with | zero => rw [Nat.unaryCast, zero, Nat.cast_zero] | succ n ih => rw [Nat.unaryCast, add, one, Nat.cas...
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
preserves_unaryCast
null
toQuaternion_natCast (n : ℕ) : toQuaternion n = n := preserves_unaryCast _ toQuaternion_zero toQuaternion_one toQuaternion_add n
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
toQuaternion_natCast
null
Int.castDef_ofNat {R : Type*} [NatCast R] [Neg R] (n : ℕ) : (Int.castDef (Int.ofNat n) : R) = n := rfl
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
Int.castDef_ofNat
null
Int.castDef_negSucc {R : Type*} [NatCast R] [Neg R] (n : ℕ) : (Int.castDef (Int.negSucc n) : R) = -(n + 1 : ℕ) := rfl
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
Int.castDef_negSucc
null
preserves_castDef {R S : Type*} [NatCast R] [Neg R] [AddGroupWithOne S] (f : R → S) (natCast : ∀ n : ℕ, f n = n) (neg : ∀ x, f (-x) = - f x) (n : ℤ) : f (Int.castDef n) = n := by cases n with | ofNat n => rw [Int.castDef_ofNat, natCast, Int.ofNat_eq_natCast, Int.cast_natCast] | negSucc _ => rw [Int.castDef_negSucc, neg...
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
preserves_castDef
null
toQuaternion_intCast (n : ℤ) : toQuaternion n = n := preserves_castDef _ toQuaternion_natCast toQuaternion_neg n
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
toQuaternion_intCast
null
ring : Ring 𝓞 := toQuaternion_injective.ring _ toQuaternion_zero toQuaternion_one toQuaternion_add toQuaternion_mul toQuaternion_neg toQuaternion_sub (fun _ _ => toQuaternion_nsmul _ _) -- TODO for Yaël: these are inconsistent with addCommGroup (fun _ _ => toQuaternion_zsmul _ _) -- TODO for Yaël: these are inconsiste...
instance
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
ring
null
starRing : StarRing 𝓞 where star z := ⟨z.re - z.im_o - z.im_oi, -z.im_o, -z.im_i, -z.im_oi⟩ star_involutive x := by ext <;> simp only <;> ring star_mul x y := by ext <;> simp <;> ring star_add x y := by ext <;> simp <;> ring @[simp] lemma star_re (z : 𝓞) : (star z).re = z.re - z.im_o - z.im_oi := rfl @[simp] lemma st...
instance
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
starRing
/-- Conjugate; sends $a+bi+cj+dk$ to $a-bi-cj-dk$. -/
toQuaternion_star (z : 𝓞) : toQuaternion (star z) = star (toQuaternion z) := by ext <;> simp only [star_re, star_im_o, star_im_i, star_im_oi, toQuaternion, Quaternion.re_star, Quaternion.imI_star, Quaternion.imJ_star, Quaternion.imK_star] <;> field_simp <;> norm_cast <;> ring
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
toQuaternion_star
null
star_eq (z : 𝓞) : star z = (fromQuaternion ∘ star ∘ toQuaternion) z := by simp only [Function.comp_apply, ← toQuaternion_star] rw [leftInverse_fromQuaternion_toQuaternion]
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
star_eq
null
norm (z : 𝓞) : ℤ := z.re * z.re + z.im_o * z.im_o + z.im_i * z.im_i + z.im_oi * z.im_oi - z.re * (z.im_o + z.im_oi) + z.im_i * (z.im_o - z.im_oi)
def
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
norm
null
norm_eq_mul_conj (z : 𝓞) : (norm z : 𝓞) = z * star z := by ext <;> simp only [norm, intCast_re, intCast_im_o, intCast_im_i, intCast_im_oi, mul_re, mul_im_o, mul_im_i, mul_im_oi, star_re, star_im_o, star_im_i, star_im_oi] <;> ring
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
norm_eq_mul_conj
null
coe_norm (z : 𝓞) : (norm z : ℝ) = (z.re - 2⁻¹ * z.im_o - 2⁻¹ * z.im_oi) ^ 2 + (z.im_i + 2⁻¹ * z.im_o - 2⁻¹ * z.im_oi) ^ 2 + (2⁻¹ * z.im_o + 2⁻¹ * z.im_oi) ^ 2 + (2⁻¹ * z.im_o - 2⁻¹ * z.im_oi) ^ 2 := by rw [norm] field_simp norm_cast ring
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
coe_norm
null
norm_zero : norm 0 = 0 := by simp [norm]
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
norm_zero
null
norm_one : norm 1 = 1 := by simp [norm]
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
norm_one
null
norm_mul (x y : 𝓞) : norm (x * y) = norm x * norm y := by rw [← Int.cast_inj (α := 𝓞)] simp_rw [norm_eq_mul_conj, star_mul] rw [mul_assoc, ← mul_assoc y, ← norm_eq_mul_conj] rw [Int.cast_comm, ← mul_assoc, ← norm_eq_mul_conj, Int.cast_mul]
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
norm_mul
null
norm_nonneg (x : 𝓞) : 0 ≤ norm x := by rw [← Int.cast_nonneg_iff (R := ℝ), coe_norm] positivity
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
norm_nonneg
null
norm_eq_zero (x : 𝓞) : norm x = 0 ↔ x = 0 := by constructor swap · rintro rfl; exact norm_zero intro h rw [← Int.cast_eq_zero (α := ℝ), coe_norm] at h field_simp at h norm_cast at h have h4 := eq_zero_of_add_nonpos_right (by positivity) (by positivity) h.le rw [sq_eq_zero_iff, sub_eq_zero] at h4 have h1 := eq_zero_of_...
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
norm_eq_zero
null
normSq_toQuaternion (z : 𝓞) : normSq (toQuaternion z) = norm z := by apply coe_injective rw [← self_mul_star, ← toQuaternion_star, ← toQuaternion_mul, ← norm_eq_mul_conj, toQuaternion_intCast, coe_intCast]
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
normSq_toQuaternion
null
aux (x y z w : ℤ) : toQuaternion (fromQuaternion ⟨x,y,z,w⟩) = ⟨x,y,z,w⟩ := by apply leftInvOn_toQuaternion_fromQuaternion simp only [Set.mem_setOf] use x, y, z, w simp
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
aux
null
aux2 (a b c d : ℝ) (ha : a ≤ 4⁻¹) (hb : b ≤ 4⁻¹) (hc : c ≤ 4⁻¹) (hd : d ≤ 4⁻¹) (H : ¬ (a = 4⁻¹ ∧ b = 4⁻¹ ∧ c = 4⁻¹ ∧ d = 4⁻¹)) : a + b + c + d < 1 := by apply lt_of_le_of_ne · calc _ ≤ (4 : ℝ)⁻¹ + 4⁻¹ + 4⁻¹ + 4⁻¹ := by gcongr _ = 1 := by norm_num contrapose! H have invs : (1 : ℝ) - 4⁻¹ = 4⁻¹ + 4⁻¹ + 4⁻¹ := by norm_num ...
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
aux2
null
exists_near (a : ℍ) : ∃ q : 𝓞, dist a (toQuaternion q) < 1 := by have four_inv : (4⁻¹ : ℝ) = 2⁻¹ ^ 2 := by norm_num have (r : ℝ) : (r - round r) ^ 2 ≤ 4⁻¹ := by rw [four_inv, sq_le_sq] apply (abs_sub_round _).trans_eq rw [abs_of_nonneg] all_goals norm_num let x := round a.re let y := round a.imI let z := round a.imJ l...
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
exists_near
null
quot_rem (a b : 𝓞) (hb : b ≠ 0) : ∃ q r : 𝓞, a = q * b + r ∧ norm r < norm b := by let a' := toQuaternion a let b' := toQuaternion b have hb' : b' ≠ 0 := toQuaternion_ne_zero_iff.mpr hb let q' := a' / b' obtain ⟨q : 𝓞, hq : dist q' (toQuaternion q) < 1⟩ : ∃ _, _ := exists_near q' refine ⟨q, a - q * b, (add_sub_cance...
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
quot_rem
null
left_ideal_princ (I : Submodule 𝓞 𝓞) : ∃ a : 𝓞, I = Submodule.span 𝓞 {a} := by by_cases h_bot : I = ⊥ · use 0 rw [Eq.comm] simp only [h_bot, Submodule.span_singleton_eq_bot] let S := {a : 𝓞 // a ∈ I ∧ a ≠ 0} have : Nonempty S := by simp only [ne_eq, nonempty_subtype, S] exact Submodule.exists_mem_ne_zero_of_ne_bot...
lemma
FLT
[ "import Mathlib.Analysis.Quaternion" ]
FLT/Data/Hurwitz.lean
left_ideal_princ
null
HurwitzHat : Type := 𝓞 ⊗[ℤ] ZHat namespace HurwitzHat /-- The base change of the Hurwitz quaternions to ZHat. -/ scoped notation "𝓞^" => HurwitzHat
def
FLT
[ "import FLT.Data.Hurwitz", "import FLT.Data.QHat" ]
FLT/Data/HurwitzRatHat.lean
HurwitzHat
/-- The base change of the Hurwitz quaternions to ZHat. -/
HurwitzRat : Type := ℚ ⊗[ℤ] 𝓞 namespace HurwitzRat /-- The quaternion algebra ℚ + ℚi + ℚj + ℚk. -/ scoped notation "D" => HurwitzRat
def
FLT
[ "import FLT.Data.Hurwitz", "import FLT.Data.QHat" ]
FLT/Data/HurwitzRatHat.lean
HurwitzRat
/-- The quaternion algebra ℚ + ℚi + ℚj + ℚk. -/
HurwitzRatHat : Type := D ⊗[ℤ] ZHat namespace HurwitzRatHat /-- The "profinite Hurwitz quaternions" over the finite adeles of ℚ; a free rank 4 module generated by 1, i, j, and (1+i+j+k)/2. -/ scoped notation "D^" => HurwitzRatHat
def
FLT
[ "import FLT.Data.Hurwitz", "import FLT.Data.QHat" ]
FLT/Data/HurwitzRatHat.lean
HurwitzRatHat
/-- The "profinite Hurwitz quaternions" over the finite adeles of ℚ; a free rank 4 module generated by 1, i, j, and (1+i+j+k)/2. -/
j₁ : D →ₐ[ℤ] D^ := Algebra.TensorProduct.includeLeft -- (Algebra.TensorProduct.assoc ℤ ℚ 𝓞 ZHat).symm.trans Algebra.TensorProduct.includeLeft
abbrev
FLT
[ "import FLT.Data.Hurwitz", "import FLT.Data.QHat" ]
FLT/Data/HurwitzRatHat.lean
j₁
/-- The inclusion from D=ℚ+ℚi+ℚj+ℚk to D ⊗ 𝔸, with 𝔸 the finite adeles of ℚ. -/
injective_hRat : Function.Injective j₁ := sorry -- flatness /-- The inclusion from the profinite Hurwitz quaternions to to 𝔸+𝔸i+𝔸j+𝔸k, with 𝔸 the finite adeles of ℚ. -/
lemma
FLT
[ "import FLT.Data.Hurwitz", "import FLT.Data.QHat" ]
FLT/Data/HurwitzRatHat.lean
injective_hRat
/-- The inclusion from D=ℚ+ℚi+ℚj+ℚk to D ⊗ 𝔸, with 𝔸 the finite adeles of ℚ. -/
j₂ : 𝓞^ →ₐ[ℤ] D^ := ((Algebra.TensorProduct.assoc ℤ ℤ ℚ 𝓞 ZHat).symm : ℚ ⊗ 𝓞^ ≃ₐ[ℤ] D ⊗ ZHat).toAlgHom.comp (Algebra.TensorProduct.includeRight : 𝓞^ →ₐ[ℤ] ℚ ⊗ 𝓞^)
abbrev
FLT
[ "import FLT.Data.Hurwitz", "import FLT.Data.QHat" ]
FLT/Data/HurwitzRatHat.lean
j₂
/-- The inclusion from the profinite Hurwitz quaternions to to 𝔸+𝔸i+𝔸j+𝔸k, with 𝔸 the finite adeles of ℚ. -/
injective_zHat : Function.Injective j₂ := sorry -- flatness -- should I rearrange tensors? Not sure if D^ should be (ℚ ⊗ 𝓞) ⊗ ℤhat or ℚ ⊗ (𝓞 ⊗ Zhat)
lemma
FLT
[ "import FLT.Data.Hurwitz", "import FLT.Data.QHat" ]
FLT/Data/HurwitzRatHat.lean
injective_zHat
/-- The inclusion from the profinite Hurwitz quaternions to to 𝔸+𝔸i+𝔸j+𝔸k, with 𝔸 the finite adeles of ℚ. -/
canonicalForm (z : D^) : ∃ (N : ℕ+) (z' : 𝓞^), z = j₁ ((N⁻¹ : ℚ) ⊗ₜ 1 : D) * j₂ z' := by sorry
lemma
FLT
[ "import FLT.Data.Hurwitz", "import FLT.Data.QHat" ]
FLT/Data/HurwitzRatHat.lean
canonicalForm
/-- The inclusion from the profinite Hurwitz quaternions to to 𝔸+𝔸i+𝔸j+𝔸k, with 𝔸 the finite adeles of ℚ. -/
completed_units (z : D^ˣ) : ∃ (u : Dˣ) (v : 𝓞^ˣ), (z : D^) = j₁ u * j₂ v := sorry
lemma
FLT
[ "import FLT.Data.Hurwitz", "import FLT.Data.QHat" ]
FLT/Data/HurwitzRatHat.lean
completed_units
null
ZHat : Type := { carrier := { f : Π M : ℕ+, ZMod M | ∀ (D N : ℕ+) (h : (D : ℕ) ∣ N), ZMod.castHom h (ZMod D) (f N) = f D }, zero_mem' := by simp neg_mem' := fun {x} hx => by simp only [ZMod.castHom_apply, Set.mem_setOf_eq, Pi.neg_apply] at * peel hx with D N hD hx rw [ZMod.cast_neg hD, hx] add_mem' := fun {a b} ha hb =...
def
FLT
[ "import Mathlib.Algebra.Order.Star.Basic", "import Mathlib.Analysis.Normed.Field.Lemmas", "import Mathlib.Data.PNat.Prime", "import Mathlib.RingTheory.Flat.TorsionFree" ]
FLT/Data/QHat.lean
ZHat
/-- We define the profinite completion of ℤ explicitly as compatible elements of ℤ/Nℤ for all positive integers `N`. We declare it as a subring of `∏_{N ≥ 1} (ℤ/Nℤ)`, and then promote it to a type. -/
prop (z : ZHat) (D N : ℕ+) (h : (D : ℕ) ∣ N) : ZMod.castHom h (ZMod D) (z N) = z D := z.2 .. @[ext]
lemma
FLT
[ "import Mathlib.Algebra.Order.Star.Basic", "import Mathlib.Analysis.Normed.Field.Lemmas", "import Mathlib.Data.PNat.Prime", "import Mathlib.RingTheory.Flat.TorsionFree" ]
FLT/Data/QHat.lean
prop
null
ext (x y : ZHat) (h : ∀ n : ℕ+, x n = y n) : x = y := Subtype.ext <| funext <| h @[simp] lemma zero_val (n : ℕ+) : (0 : ZHat) n = 0 := rfl @[simp] lemma one_val (n : ℕ+) : (1 : ZHat) n = 1 := rfl @[simp] lemma ofNat_val (m : ℕ) [m.AtLeastTwo] (n : ℕ+) : (OfNat.ofNat m : ZHat) n = (OfNat.ofNat m : ZMod n) := rfl @[simp]...
lemma
FLT
[ "import Mathlib.Algebra.Order.Star.Basic", "import Mathlib.Analysis.Normed.Field.Lemmas", "import Mathlib.Data.PNat.Prime", "import Mathlib.RingTheory.Flat.TorsionFree" ]
FLT/Data/QHat.lean
ext
null
commRing : CommRing ZHat := inferInstance
instance
FLT
[ "import Mathlib.Algebra.Order.Star.Basic", "import Mathlib.Analysis.Normed.Field.Lemmas", "import Mathlib.Data.PNat.Prime", "import Mathlib.RingTheory.Flat.TorsionFree" ]
FLT/Data/QHat.lean
commRing
null
End of preview. Expand in Data Studio

Lean4-FLT

Structured dataset from FLT — Formalization of Fermat's Last Theorem.

1,755 declarations extracted from Lean 4 source files.

Applications

  • Training language models on formal proofs
  • Fine-tuning theorem provers
  • Retrieval-augmented generation for proof assistants
  • Learning proof embeddings and representations

Source

Schema

Column Type Description
fact string Declaration body
type string theorem, def, lemma, etc.
library string Source module
imports list Required imports
filename string Source file path
symbolic_name string Identifier
docstring string Documentation (if present)
Downloads last month
14

Collection including phanerozoic/Lean4-FLT