Datasets:

Modalities:
Text
Formats:
json
Size:
< 1K
License:
zxclara010's picture
Name full collection and document query splits
989cdb8 verified
Raw History Blame Contribute Delete
69.2 kB
{"id":"ZHat.multiples","label":"ZHat.multiples","background_color":"#1CAC78","border_color":"green","kind":"ellipse","dep_graph_url":"https://imperialcollegelondon.github.io/FLT/blueprint/dep_graph_chapter_5.html","dependencies":["ZHat.commRing"],"nlp_text":"The multiples of&#160;\\(N\\) in \\(\\widehat{\\mathbb {Z}}\\) are precisely the compatible collections \\((z_i)_i\\in \\widehat{\\mathbb {Z}}\\) with \\(z_N=0\\).","doc_url":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/ZHat.multiples","latex_link":"sect0002.html#ZHat.multiples","lean_link":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/ZHat.multiples","lean_decl_name":"ZHat.multiples","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"FLT_ch5","source_path":"FLT/Data/QHat.lean","lean4_code":"lemma multiples (N : ℕ+) (z : ZHat) : (∃ (y : ZHat), N * y = z) ↔ z N = 0 := by\n constructor\n · intro ⟨y, hy⟩\n rw [← hy]\n change N * (y N) = 0\n simp\n · intro h\n let y : ZHat := {\n val := fun j ↦ (z (N * j)).val / (N : ℕ)\n property := by\n intro j k hjk\n have hj := z.prop N (N * j) (by simp only [PNat.mul_coe, dvd_mul_right])\n have hk := z.prop N (N * k) (by simp only [PNat.mul_coe, dvd_mul_right])\n rw [h, ZMod.castHom_apply, ZMod.cast_eq_val, ZMod.natCast_eq_zero_iff] at hj\n rw [h, ZMod.castHom_apply, ZMod.cast_eq_val, ZMod.natCast_eq_zero_iff] at hk\n have hNjk := z.prop (N * j) (N * k) (mul_dvd_mul (dvd_refl _) hjk)\n rw [ZMod.castHom_apply, ZMod.cast_eq_val] at hNjk\n simp only [PNat.mul_coe, map_natCast, ZMod.natCast_eq_natCast_iff]\n apply Nat.ModEq.mul_right_cancel' (c := N) (by simp)\n rw [Nat.div_mul_cancel hj, Nat.div_mul_cancel hk,\n mul_comm (j : ℕ) (N : ℕ), ← ZMod.natCast_eq_natCast_iff, hNjk]\n simp\n }\n refine ⟨y, ?_⟩\n ext j\n exact y_mul_N_eq_z N z h j\n","line":238,"end_line":263,"proof_status":"formalized"}
{"id":"QHat.unitsrat_join_unitszHat","label":"QHat.unitsrat_join_unitszHat","background_color":"#1CAC78","border_color":"green","kind":"ellipse","dep_graph_url":"https://imperialcollegelondon.github.io/FLT/blueprint/dep_graph_chapter_5.html","dependencies":["ZHat.multiples","QHat.canonicalForm"],"nlp_text":"The product of \\(\\mathbb {Q}^\\times \\) and \\(\\widehat{\\mathbb {Z}}^\\times \\) in \\(\\widehat{\\mathbb {Q}}^\\times \\) is all of \\(\\widehat{\\mathbb {Q}}^\\times \\). More precisely, every element of \\(\\widehat{\\mathbb {Q}}^\\times \\) can be written as \\(qz\\) with \\(q\\in \\mathbb {Q}^\\times \\) and \\(z\\in \\widehat{\\mathbb {Z}}^\\times \\).","doc_url":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/QHat.unitsrat_join_unitszHat","latex_link":"sect0002.html#QHat.unitsrat_join_unitszHat","lean_link":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/QHat.unitsrat_join_unitszHat","lean_decl_name":"QHat.unitsrat_join_unitszHat","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"FLT_ch5","source_path":"FLT/Data/QHat.lean","lean4_code":"lemma unitsrat_join_unitszHat : unitsratsub ⊔ unitszHatsub = ⊤ := by\n rw [eq_top_iff]\n rintro y -\n rcases canonicalForm y.val with ⟨N, x, hy⟩\n rcases canonicalForm (y⁻¹.val) with ⟨N2, x2, hy2⟩\n set xinv := (1 / (N * N2) : ℚ) ⊗ₜ[ℤ] x2 with xinv_def\n have : (i₂ x) * xinv = 1 := by\n rw [xinv_def, Algebra.TensorProduct.includeRight_apply, one_div, mul_inv_rev,\n Algebra.TensorProduct.tmul_mul_tmul,one_mul,mul_comm,← Algebra.TensorProduct.tmul_mul_tmul,\n ← one_div, ← one_div, ← hy, ← hy2, ← Units.val_mul, mul_inv_cancel, Units.val_one]\n let xunit : QHatˣ := ⟨i₂ x, xinv, this, by rw [mul_comm]; exact this⟩\n suffices h : ∀ (u : QHatˣ), (u : QHat) ∈ zHatsub → u ∈ unitsratsub ⊔ unitszHatsub by\n specialize h xunit\n simp only [Algebra.TensorProduct.includeRight_apply, AddMonoidHom.mem_range,\n AddMonoidHom.coe_coe, exists_apply_eq_apply, forall_const, Subgroup.mem_sup, xunit] at h\n rcases h with ⟨w, ⟨v, rfl⟩, z, ⟨t, rfl⟩, wzx⟩\n rw [Subgroup.mem_sup]\n let q : ℚˣ := ⟨v / N, N / v, by field_simp, by field_simp⟩\n use ((Units.map ↑i₁) q)\n simp only [MonoidHom.mem_range, exists_exists_eq_and]\n refine ⟨⟨q, rfl⟩, t, ?_⟩\n simp only [← Units.val_inj, hy, Units.map_mk, MonoidHom.coe_coe,\n Algebra.TensorProduct.includeLeft_apply, Units.val_mul, one_div, q]\n rw [← mul_one (N⁻¹ : ℚ), ← one_mul x, ← Algebra.TensorProduct.tmul_mul_tmul, div_eq_mul_inv,\n mul_comm (v : ℚ), ← mul_one 1, ← Algebra.TensorProduct.tmul_mul_tmul, mul_assoc, mul_one]\n congr\n simpa only [← Units.val_inj, Units.val_mul, Units.coe_map, MonoidHom.coe_coe,\n Algebra.TensorProduct.includeLeft_apply, xunit, q] using wzx\n clear * -\n intro x hx\n rcases canonicalForm (x⁻¹.val) with ⟨M, y, hxinv⟩\n have : x * (i₂ y) = M := by\n rw [← one_mul (M : QHat), ← Units.val_one, ← mul_inv_cancel x, Units.val_mul, mul_assoc]\n congr!\n have h : (M : QHat) = (M : ℚ) ⊗ₜ[ℤ] 1 := by norm_cast\n rw [Algebra.TensorProduct.includeRight_apply, hxinv, h, Algebra.TensorProduct.tmul_mul_tmul,\n mul_one, one_div, inv_mul_cancel₀]\n simp only [ne_eq, Rat.natCast_eq_zero_iff, PNat.ne_zero, not_false_eq_true]\n rcases hx with ⟨X, hX⟩\n let I := Ideal.span {X}\n let J := I.comap (Int.castRingHom ZHat)\n have Jnonzero : (M : ℤ) ∈ J := by\n simp only [J, I, Ideal.mem_comap]\n rw [Ideal.mem_span_singleton']\n use y\n apply injective_zHat\n simp only [mul_comm, ← hX, AddMonoidHom.coe_coe, Algebra.TensorProduct.includeRight_apply,\n Algebra.TensorProduct.tmul_mul_tmul, mul_one] at this\n rw [Algebra.TensorProduct.includeRight_apply, this, map_natCast,\n Algebra.TensorProduct.includeRight_apply, Algebra.TensorProduct.one_tmul_natCast]\n obtain ⟨g, hg⟩ := IsPrincipalIdealRing.principal (R := ℤ) J\n wlog gpos : 0 < g with H\n · specialize H x M y hxinv this X hX Jnonzero (-g)\n apply H (by rw [← Set.neg_singleton, Submodule.span_neg, ← hg])\n rw [Int.neg_pos, Int.lt_iff_le_and_ne, ← Int.not_gt_eq]\n refine ⟨gpos, ?_⟩\n rintro rfl\n rw [Submodule.span_zero_singleton, Submodule.eq_bot_iff] at hg\n specialize hg (M : ℤ) Jnonzero\n simp only [Int.natCast_eq_zero, PNat.ne_zero] at hg\n clear this hxinv y Jnonzero M\n let N : ℕ+ := ⟨g.toNat, Int.pos_iff_toNat_pos.1 gpos⟩\n suffices h : Ideal.span {X} = Ideal.span {(g : ZHat)} by\n obtain ⟨y, hy⟩ : ∃ y, y * X = g := by\n rw [← Ideal.mem_span_singleton', h, Ideal.mem_span_singleton]\n obtain ⟨z, hz⟩ : ∃ z, z * g = X := by\n rw [← Ideal.mem_span_singleton', ← h, Ideal.mem_span_singleton]\n have : y * z = 1 := by\n rw [mul_comm, ← sub_right_inj (a := (1 : ZHat)), sub_self]\n apply ZHat.eq_zero_of_mul_eq_zero N\n rw [PNat.mk_coe, ← Int.cast_natCast, Int.natCast_toNat_eq_self.2 (le_of_lt gpos), mul_sub,\n mul_one, sub_eq_zero, ← mul_assoc, mul_comm _ z, hz, mul_comm, hy]\n simp only [Subgroup.mem_sup, MonoidHom.mem_range, exists_exists_eq_and]\n set G : ℚ := 1 / g with G_def\n have gG : g * G = 1 := by\n rw [G_def, one_div, mul_inv_cancel₀]\n simp only [ne_eq, Rat.intCast_eq_zero_iff, Int.ne_of_gt gpos, not_false_eq_true]\n use ⟨g, G, gG, mul_comm _ G ▸ gG⟩\n use ⟨z, y, by rw[mul_comm]; exact this, this⟩\n simp only [← Units.val_inj, ← hX, Units.map_mk, MonoidHom.coe_coe, map_intCast,\n Algebra.TensorProduct.includeLeft_apply, Algebra.TensorProduct.includeRight_apply,\n Units.val_mul, AddMonoidHom.coe_coe]\n rw [← hz, ← mul_one 1, ← Algebra.TensorProduct.tmul_mul_tmul, mul_one, mul_comm,\n Algebra.TensorProduct.one_tmul_intCast]\n have hgx : Ideal.span {(g : ZHat)} ≤ Ideal.span {X} := by\n have : g ∈ J := by\n rw [hg, Ideal.submodule_span_eq]\n apply Ideal.mem_span_singleton_self\n simp only [J, I] at this\n exact (Ideal.span_singleton_le_iff_mem _).2 this\n refine le_antisymm ?_ hgx\n suffices h : X N = 0 by\n rcases (ZHat.multiples N X).2 h with ⟨y, hy⟩\n rw [Ideal.span_singleton_le_span_singleton, ← hy, PNat.mk_coe]\n exact ⟨y, by rw [← Int.cast_natCast, Int.natCast_toNat_eq_self.2 (le_of_lt gpos)]⟩\n let xg := (X N).val\n have : (xg - X) N = 0 := by\n simp only [ZHat, ZMod.castHom_apply, ZHat.instDFunLikePNatZModVal,\n AddSubgroupClass.coe_sub, SubringClass.coe_natCast, Pi.sub_apply, Pi.natCast_apply, xg]\n simp only [ZMod.natCast_val, ZMod.cast_id', id_eq, sub_self]\n rcases (ZHat.multiples N _).2 this with ⟨y, hy⟩\n have : (xg : ZHat) ∈ Ideal.span {X} := by\n rw [← sub_add_cancel (xg : ZHat) X]\n apply Ideal.add_mem\n · apply hgx\n rw [Ideal.mem_span_singleton', ← hy, mul_comm, PNat.mk_coe]\n exact ⟨y, by rw [← Int.cast_natCast, Int.natCast_toNat_eq_self.2 (le_of_lt gpos)]⟩\n apply Ideal.mem_span_singleton_self\n have hxg : (xg : ℤ) ∈ J := by\n rw [Ideal.mem_comap]\n simp only [Int.coe_castRingHom, Int.cast_natCast, I, this]\n rw [hg, Submodule.mem_span_singleton] at hxg\n rcases hxg with ⟨a, ha⟩\n rw [← ZMod.val_eq_zero, ← Int.natCast_eq_zero]\n apply Int.eq_zero_of_dvd_of_nonneg_of_lt (n := g) (Int.natCast_nonneg _)\n · exact Int.lt_of_toNat_lt (ZMod.val_lt (X N))\n exact ⟨a, by rw [mul_comm, ← smul_eq_mul, ha]⟩\n","line":654,"end_line":770,"proof_status":"formalized"}
{"id":"QHat.rat_join_zHat","label":"QHat.rat_join_zHat","background_color":"#1CAC78","border_color":"green","kind":"ellipse","dep_graph_url":"https://imperialcollegelondon.github.io/FLT/blueprint/dep_graph_chapter_5.html","dependencies":["QHat.canonicalForm"],"nlp_text":"The sum of \\(\\mathbb {Q}\\) and \\(\\widehat{\\mathbb {Z}}\\) in \\(\\widehat{\\mathbb {Q}}\\) is \\(\\widehat{\\mathbb {Q}}\\). More precisely, every element of \\(\\widehat{\\mathbb {Q}}\\) can be written as \\(q+z\\) with \\(q\\in \\mathbb {Q}\\) and \\(z\\in \\widehat{\\mathbb {Z}}\\), or more precisely as \\(q\\otimes _t 1+1\\otimes _t z\\).","doc_url":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/QHat.rat_join_zHat","latex_link":"sect0002.html#QHat.rat_join_zHat","lean_link":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/QHat.rat_join_zHat","lean_decl_name":"QHat.rat_join_zHat","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"FLT_ch5","source_path":"FLT/Data/QHat.lean","lean4_code":"lemma rat_join_zHat : ratsub ⊔ zHatsub = ⊤ := by\n rw [eq_top_iff]\n intro x _\n rcases x.canonicalForm with ⟨N, z, hNz⟩\n rcases ZHat.nat_dense N z with ⟨q, r, hz, _⟩\n have h : z - r = N * q := sub_eq_of_eq_add hz\n rw [AddSubgroup.mem_sup]\n use ((r : ℤ) / N : ℚ) ⊗ₜ[ℤ] 1\n constructor\n · simp\n use 1 ⊗ₜ[ℤ] q\n constructor\n · simp\n nth_rw 1 [← mul_one ((r : ℤ) / N : ℚ), div_mul_comm,\n mul_comm, ← zsmul_eq_mul, TensorProduct.smul_tmul, zsmul_eq_mul, mul_one]\n have : 1 = 1 / (N : ℚ) * (N : ℤ) := by simp\n nth_rw 2 [this]\n rw [mul_comm, ← zsmul_eq_mul, TensorProduct.smul_tmul, zsmul_eq_mul]\n norm_cast; rw [← h, ← TensorProduct.tmul_add]\n simp [hNz]\n","line":543,"end_line":562,"proof_status":"formalized"}
{"id":"Hurwitz.norm_eq_mul_conj","label":"Hurwitz.norm_eq_mul_conj","background_color":"#1CAC78","border_color":"green","kind":"ellipse","dep_graph_url":"https://imperialcollegelondon.github.io/FLT/blueprint/dep_graph_chapter_5.html","dependencies":["Hurwitz.norm","Hurwitz.starRing"],"nlp_text":"We have \\(N(x)=x\\overline{x}\\).","doc_url":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/Hurwitz.norm_eq_mul_conj","latex_link":"sect0002.html#Hurwitz.norm_eq_mul_conj","lean_link":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/Hurwitz.norm_eq_mul_conj","lean_decl_name":"Hurwitz.norm_eq_mul_conj","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"FLT_ch5","source_path":"FLT/Data/Hurwitz.lean","lean4_code":"lemma norm_eq_mul_conj (z : 𝓞) : (norm z : 𝓞) = z * star z := by\n ext <;> simp only [norm, intCast_re, intCast_im_o, intCast_im_i, intCast_im_oi,\n mul_re, mul_im_o, mul_im_i, mul_im_oi, star_re, star_im_o, star_im_i, star_im_oi] <;> ring\n","line":371,"end_line":373,"proof_status":"formalized"}
{"id":"Hurwitz.norm_zero","label":"Hurwitz.norm_zero","background_color":"#1CAC78","border_color":"green","kind":"ellipse","dep_graph_url":"https://imperialcollegelondon.github.io/FLT/blueprint/dep_graph_chapter_5.html","dependencies":["Hurwitz.norm"],"nlp_text":"The norm of \\(0\\) is \\(0\\).","doc_url":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/Hurwitz.norm_zero","latex_link":"sect0002.html#Hurwitz.norm_zero","lean_link":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/Hurwitz.norm_zero","lean_decl_name":"Hurwitz.norm_zero","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"FLT_ch5","source_path":"FLT/Data/Hurwitz.lean","lean4_code":"lemma norm_zero : norm 0 = 0 := by simp [norm]\n","line":386,"end_line":386,"proof_status":"formalized"}
{"id":"Hurwitz.left_ideal_princ","label":"Hurwitz.left_ideal_princ","background_color":"#1CAC78","border_color":"green","kind":"ellipse","dep_graph_url":"https://imperialcollegelondon.github.io/FLT/blueprint/dep_graph_chapter_5.html","dependencies":["Hurwitz.quot_rem"],"nlp_text":"All left ideals of \\(\\mathcal{O}\\) are principal.","doc_url":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/Hurwitz.left_ideal_princ","latex_link":"sect0002.html#Hurwitz.left_ideal_princ","lean_link":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/Hurwitz.left_ideal_princ","lean_decl_name":"Hurwitz.left_ideal_princ","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"FLT_ch5","source_path":"FLT/Data/Hurwitz.lean","lean4_code":"lemma left_ideal_princ (I : Submodule 𝓞 𝓞) : ∃ a : 𝓞, I = Submodule.span 𝓞 {a} := by\n by_cases h_bot : I = ⊥\n · use 0\n rw [Eq.comm]\n simp only [h_bot, Submodule.span_singleton_eq_bot]\n let S := {a : 𝓞 // a ∈ I ∧ a ≠ 0}\n have : Nonempty S := by\n simp only [ne_eq, nonempty_subtype, S]\n exact Submodule.exists_mem_ne_zero_of_ne_bot h_bot\n have hbdd : BddBelow <| Set.range (fun i : S ↦ norm i) := by\n use 0\n simp only [ne_eq, mem_lowerBounds, Set.mem_range]\n rintro _ ⟨_, rfl⟩\n exact norm_nonneg _\n obtain ⟨a, ha⟩ : ∃ a : S, norm a = ⨅ i : S, norm i :=\n exists_eq_ciInf_of_not_isPredPrelimit hbdd (Order.not_isPredPrelimit)\n use a\n apply le_antisymm\n · intro i hi\n rw [Submodule.mem_span_singleton]\n simp only [ne_eq]\n obtain ⟨q, r, hqr⟩ := quot_rem i a a.2.2\n rw [ha] at hqr\n have hrI : r ∈ I := by\n rw [show r = i - q • a by apply eq_sub_of_add_eq; rw [add_comm]; exact hqr.1.symm ]\n apply I.sub_mem hi (I.smul_mem _ a.2.1)\n have hr : r = 0 := by\n by_contra hr\n lift r to S using ⟨hrI, hr⟩\n apply (ciInf_le hbdd r).not_gt hqr.2\n rw [hr, add_zero] at hqr\n refine ⟨q, hqr.1.symm⟩\n · rw [Submodule.span_singleton_le_iff_mem]\n exact a.2.1\n","line":525,"end_line":558,"proof_status":"formalized"}
{"id":"QHat.injective_zHat","label":"QHat.injective_zHat","background_color":"#1CAC78","border_color":"green","kind":"ellipse","dep_graph_url":"https://imperialcollegelondon.github.io/FLT/blueprint/dep_graph_chapter_5.html","dependencies":["QHat","ZHat.torsionfree"],"nlp_text":"The ring homomorphism \\(\\widehat{\\mathbb {Z}}\\to \\widehat{\\mathbb {Q}}\\) sending \\(z\\) to \\(1\\otimes _t z\\) is injective.","doc_url":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/QHat.injective_zHat","latex_link":"sect0002.html#QHat.injective_zHat","lean_link":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/QHat.injective_zHat","lean_decl_name":"QHat.injective_zHat","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"FLT_ch5","source_path":"FLT/Data/QHat.lean","lean4_code":"lemma injective_zHat :\n Function.Injective i₂ := by\n intro a b h\n have h₁ := LinearMap.rTensor_tmul ZHat (f := Algebra.linearMap ℤ ℚ) a 1\n have h₂ := LinearMap.rTensor_tmul ZHat (f := Algebra.linearMap ℤ ℚ) b 1\n simp only [Algebra.linearMap_apply, map_one] at h₁ h₂\n dsimp at h\n rw [← h₁, ← h₂] at h\n replace h := Module.Flat.rTensor_preserves_injective_linearMap\n (M := ZHat) (Algebra.linearMap ℤ ℚ) (fun _ _ ↦ by simp) h\n simp only at h\n have := congrArg (TensorProduct.lid ℤ ZHat) h\n simpa using this\n","line":329,"end_line":341,"proof_status":"formalized"}
{"id":"Qhat.unitsrat_meet_unitszHat","label":"Qhat.unitsrat_meet_unitszHat","background_color":"#9CEC8B","border_color":"green","kind":"ellipse","dep_graph_url":"https://imperialcollegelondon.github.io/FLT/blueprint/dep_graph_chapter_5.html","dependencies":["QHat.rat_meet_zHat"],"nlp_text":"The intersection of \\(\\mathbb {Q}^\\times \\) and \\(\\widehat{\\mathbb {Z}}^\\times \\) in \\(\\widehat{\\mathbb {Q}}^\\times \\) is \\(\\mathbb {Z}^\\times \\).","doc_url":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/QHat.unitsrat_meet_unitszHat","latex_link":"sect0002.html#Qhat.unitsrat_meet_unitszHat","lean_link":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/QHat.unitsrat_meet_unitszHat","lean_decl_name":"QHat.unitsrat_meet_unitszHat","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"FLT_ch5","source_path":"FLT/Data/QHat.lean","lean4_code":"lemma unitsrat_meet_unitszHat : unitsratsub ⊓ unitszHatsub = unitszsub := by\n apply le_antisymm\n · intro x ⟨⟨q, hxq⟩, ⟨zHat, hxzHat⟩⟩\n obtain ⟨z, (hz : (z : QHat) = x)⟩ : (x : QHat) ∈ zsub := by\n rw [← rat_meet_zHat]\n exact ⟨⟨q, by simp [← hxq]⟩, zHat, by simp [← hxzHat]⟩\n have znez : z ≠ 0 := by\n rintro rfl\n simp [Eq.comm] at hz\n let a := Int.sign z\n let b := Int.natAbs z\n set zinvRat : ℚ := a / b with zinvRat_def\n have hzinvRat : z * zinvRat = 1 := by\n rw [mul_div, div_eq_one_iff_eq]\n · rw_mod_cast [Int.mul_sign_self z]\n · exact_mod_cast Int.natAbs_ne_zero.mpr znez\n let zinvZHat : ZHatˣ := zHat⁻¹\n have hzinvZHat : ↑zHat * ↑zinvZHat = (1 : ZHat) := Units.mul_inv zHat\n let xinv : QHatˣ := x⁻¹\n have h1 : zinvRat ⊗ₜ[ℤ] (1 : ZHat) = xinv := by\n apply Units.eq_inv_of_mul_eq_one_left\n rw [← hz, ← zsmul_eq_mul, TensorProduct.smul_tmul', zsmul_eq_mul,\n hzinvRat, Algebra.TensorProduct.one_def]\n have h2 : (1 : ℚ) ⊗ₜ[ℤ] (Units.val zinvZHat) = xinv := by\n apply Units.eq_inv_of_mul_eq_one_left\n have hzHat : (1 : ℚ) ⊗ₜ[ℤ] (zHat : ZHat) = (x : QHat) := by simp [← hxzHat]\n rw [← hzHat, Algebra.TensorProduct.tmul_mul_tmul, mul_one, hzinvZHat,\n Algebra.TensorProduct.one_def]\n have h3 : zinvRat ⊗ₜ[ℤ] (1 : ZHat) = (1 / b : ℚ) ⊗ₜ[ℤ] (a : ZHat) := by\n rw [zinvRat_def, ← mul_one (a : ℚ), ← mul_div,\n ← zsmul_eq_mul, TensorProduct.smul_tmul, zsmul_eq_mul, mul_one]\n have bpos : 0 < b := Int.natAbs_pos.2 znez\n have heq : (1 / (((Nat.toPNat b bpos) : ℕ) : ℚ)) ⊗ₜ[ℤ] (a : ZHat) =\n (1 / (((1 : ℕ+) : ℕ) : ℚ)) ⊗ₜ[ℤ] ↑zinvZHat := by\n have : ↑(Nat.toPNat b bpos) = b := by\n unfold Nat.toPNat\n rw [PNat.mk_coe]\n rw [PNat.val_ofNat, Nat.cast_one, div_self one_ne_zero, this, ← h3, h1, h2]\n have cop1 : IsCoprime (b.toPNat bpos) ↑a := by\n rw [IsCoprime, ZHat.intCast_val, ← ZMod.isUnit_natAbs,\n ZMod.isUnit_iff_coprime, Int.natAbs_sign_of_ne_zero znez]\n exact Nat.coprime_one_left _\n have cop2 : IsCoprime 1 ↑zinvZHat := by\n simp only [IsCoprime, PNat.val_ofNat, isUnit_of_subsingleton]\n obtain ⟨hb, ha⟩ := (lowestTerms ↑x).2 (Nat.toPNat b bpos) 1 ↑a ↑zinvZHat ⟨cop1, cop2, heq⟩\n have b1 : b = 1 := PNat.coe_eq_one_iff.2 hb\n obtain ⟨u, rfl⟩ := Int.isUnit_iff_natAbs_eq.2 b1\n use u\n ext\n norm_cast at hz\n · intro x ⟨xz, hxz⟩\n constructor\n · use (Units.map ↑(Int.castRingHom ℚ)) xz\n norm_cast\n · use (Units.map ↑(Int.castRingHom ZHat)) xz\n rw [← hxz, ← MonoidHom.comp_apply, ← Units.map_comp]\n congr\n ext x\n · simp only [MonoidHom.coe_comp, MonoidHom.coe_coe, Function.comp_apply, Int.coe_castRingHom,\n Algebra.TensorProduct.includeRight_apply, Algebra.TensorProduct.one_tmul_intCast]\n simp\n","line":577,"end_line":637,"proof_status":"formalized"}
{"id":"Hurwitz.norm_mul","label":"Hurwitz.norm_mul","background_color":"#1CAC78","border_color":"green","kind":"ellipse","dep_graph_url":"https://imperialcollegelondon.github.io/FLT/blueprint/dep_graph_chapter_5.html","dependencies":["Hurwitz.norm"],"nlp_text":"The norm of a product is the product of the norms.","doc_url":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/Hurwitz.norm_mul","latex_link":"sect0002.html#Hurwitz.norm_mul","lean_link":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/Hurwitz.norm_mul","lean_decl_name":"Hurwitz.norm_mul","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"FLT_ch5","source_path":"FLT/Data/Hurwitz.lean","lean4_code":"lemma norm_mul (x y : 𝓞) : norm (x * y) = norm x * norm y := by\n rw [← Int.cast_inj (α := 𝓞)]\n simp_rw [norm_eq_mul_conj, star_mul]\n rw [mul_assoc, ← mul_assoc y, ← norm_eq_mul_conj]\n rw [Int.cast_comm, ← mul_assoc, ← norm_eq_mul_conj, Int.cast_mul]\n","line":390,"end_line":394,"proof_status":"formalized"}
{"id":"Hurwitz.quot_rem","label":"Hurwitz.quot_rem","background_color":"#1CAC78","border_color":"green","kind":"ellipse","dep_graph_url":"https://imperialcollegelondon.github.io/FLT/blueprint/dep_graph_chapter_5.html","dependencies":["Hurwitz.exists_near"],"nlp_text":"Given two Hurwitz quaternions \\(a\\) and \\(b\\) with \\(b\\) nonzero, there exists \\(q\\) and \\(r\\) such that \\(a=qb+r\\) and \\(N(r){\\lt}N(b)\\).","doc_url":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/Hurwitz.quot_rem","latex_link":"sect0002.html#Hurwitz.quot_rem","lean_link":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/Hurwitz.quot_rem","lean_decl_name":"Hurwitz.quot_rem","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"FLT_ch5","source_path":"FLT/Data/Hurwitz.lean","lean4_code":"lemma quot_rem (a b : 𝓞) (hb : b ≠ 0) : ∃ q r : 𝓞, a = q * b + r ∧ norm r < norm b := by\n let a' := toQuaternion a\n let b' := toQuaternion b\n have hb' : b' ≠ 0 := toQuaternion_ne_zero_iff.mpr hb\n let q' := a' / b'\n obtain ⟨q : 𝓞, hq : dist q' (toQuaternion q) < 1⟩ : ∃ _, _ := exists_near q'\n refine ⟨q, a - q * b, (add_sub_cancel _ _).symm, ?_⟩\n rw [← Int.cast_lt (R := ℝ), ← normSq_toQuaternion, ← normSq_toQuaternion]\n rw [normSq_eq_norm_mul_self, normSq_eq_norm_mul_self]\n refine mul_self_lt_mul_self ?_ ?_\n · exact _root_.norm_nonneg (a - q * b).toQuaternion\n rw [toQuaternion_sub, ← dist_eq_norm]\n calc\n _ = dist (q' * b') (q.toQuaternion * b') := ?_\n _ = dist q' (q.toQuaternion) * ‖b'‖ := ?_\n _ < _ := ?_\n · rw [toQuaternion_mul]\n dsimp only [b', q']\n rw [div_mul_cancel₀ a' hb']\n · -- Surprised that this doesn't seem to exist in mathlib.\n rw [dist_eq_norm_sub', ← sub_mul, _root_.norm_mul, ← dist_eq_norm_sub']\n · rw [← norm_pos_iff] at hb'\n exact mul_lt_of_lt_one_left hb' hq\n","line":501,"end_line":523,"proof_status":"formalized"}
{"id":"QHat","label":"QHat","background_color":"#B0ECA3","border_color":"green","kind":"box","dep_graph_url":"https://imperialcollegelondon.github.io/FLT/blueprint/dep_graph_chapter_5.html","dependencies":["ZHat"],"nlp_text":"The profinite completion \\(\\widehat{\\mathbb {Q}}\\) of \\(\\mathbb {Q}\\) is the tensor product \\(\\mathbb {Q}\\otimes _{\\mathbb {Z}}\\widehat{\\mathbb {Z}}\\), or \\(\\widehat{\\mathbb {Q}}=\\mathbb {Q}\\otimes \\widehat{\\mathbb {Z}}\\) for short.","doc_url":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/QHat","latex_link":"sect0002.html#QHat","lean_link":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/QHat","lean_decl_name":"QHat","kind_description":"definitions","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"FLT_ch5","source_path":"./FLT/Data/QHat.lean","lean4_code":"instance nontrivial_QHat : Nontrivial QHat where\n exists_pair_ne := ⟨1 ⊗ₜ 0, 1 ⊗ₜ 1, injective_zHat.ne ZHat.zeroNeOne⟩\n\nnoncomputable abbrev i₁ : ℚ →ₐ[ℤ] QHat := Algebra.TensorProduct.includeLeft\n","line":343,"end_line":346,"proof_status":"formalized"}
{"id":"QHat.injective_rat","label":"QHat.injective_rat","background_color":"#1CAC78","border_color":"green","kind":"ellipse","dep_graph_url":"https://imperialcollegelondon.github.io/FLT/blueprint/dep_graph_chapter_5.html","dependencies":["QHat","ZHat.commRing"],"nlp_text":"The ring homomorphism \\(\\mathbb {Q}\\to \\widehat{\\mathbb {Q}}\\) sending \\(q\\) to \\(q\\otimes _t 1\\) is injective.","doc_url":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/QHat.injective_rat","latex_link":"sect0002.html#QHat.injective_rat","lean_link":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/QHat.injective_rat","lean_decl_name":"QHat.injective_rat","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"FLT_ch5","source_path":"FLT/Data/QHat.lean","lean4_code":"lemma injective_rat :\n Function.Injective i₁ := RingHom.injective i₁.toRingHom\n","line":347,"end_line":348,"proof_status":"formalized"}
{"id":"HurwitzRatHat.canonicalForm","label":"HurwitzRatHat.canonicalForm","background_color":"#A3D6FF","border_color":"green","kind":"ellipse","dep_graph_url":"https://imperialcollegelondon.github.io/FLT/blueprint/dep_graph_chapter_5.html","dependencies":["QHat","Hurwitz"],"nlp_text":"Every element of \\(\\widehat{D}\\) can be written as \\(z/N\\) with \\(z\\in \\widehat{\\mathcal{O}}\\) and \\(N\\in \\mathbb {N}^+\\).","doc_url":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/HurwitzRatHat.canonicalForm","latex_link":"sect0002.html#HurwitzRatHat.canonicalForm","lean_link":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/HurwitzRatHat.canonicalForm","lean_decl_name":"HurwitzRatHat.canonicalForm","kind_description":"theorems and lemmas","status_from_color":"ready_to_formalize","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"FLT_ch5","source_path":"FLT/Data/QHat.lean","lean4_code":"lemma canonicalForm (z : QHat) : ∃ (N : ℕ+) (z' : ZHat), z = (1 / N : ℚ) ⊗ₜ z' := by\n induction z using TensorProduct.induction_on with\n | zero =>\n refine ⟨1, 0, ?_⟩\n simp\n | tmul q z =>\n refine ⟨⟨q.den, q.den_pos ⟩, q.num * z, ?_⟩\n simp_rw [← zsmul_eq_mul, TensorProduct.tmul_smul, TensorProduct.smul_tmul']\n simp only [PNat.mk_coe, zsmul_eq_mul]\n simp only [← q.mul_den_eq_num, mul_assoc,\n one_div, ne_eq, Nat.cast_eq_zero, Rat.den_ne_zero, not_false_eq_true,\n mul_one, mul_inv_cancel₀]\n | add x y hx hy =>\n obtain ⟨N₁, z₁, rfl⟩ := hx\n obtain ⟨N₂, z₂, rfl⟩ := hy\n refine ⟨N₁ * N₂, (N₁ : ℤ) * z₂ + (N₂ : ℤ) * z₁, ?_⟩\n simp only [TensorProduct.tmul_add, ← zsmul_eq_mul,\n TensorProduct.tmul_smul, TensorProduct.smul_tmul']\n simp only [one_div, PNat.mul_coe, Nat.cast_mul, mul_inv_rev, zsmul_eq_mul, Int.cast_natCast,\n ne_eq, Nat.cast_eq_zero, PNat.ne_zero, not_false_eq_true, mul_inv_cancel_left₀]\n rw [add_comm]\n congr\n simp [mul_comm]\n","line":285,"end_line":307,"proof_status":"statement_formalized"}
{"id":"QHat.canonicalForm","label":"QHat.canonicalForm","background_color":"#1CAC78","border_color":"green","kind":"ellipse","dep_graph_url":"https://imperialcollegelondon.github.io/FLT/blueprint/dep_graph_chapter_5.html","dependencies":["QHat","ZHat.commRing"],"nlp_text":"Every element of \\(\\widehat{\\mathbb {Q}}:=\\mathbb {Q}\\otimes \\widehat{\\mathbb {Z}}\\) can be written as \\(q\\otimes _t z\\) with \\(q\\in \\mathbb {Q}\\) and \\(z\\in \\widehat{\\mathbb {Z}}\\). Furthermore one can even assume that \\(q=\\frac{1}{N}\\) for some positive integer \\(N\\).","doc_url":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/QHat.canonicalForm","latex_link":"sect0002.html#QHat.canonicalForm","lean_link":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/QHat.canonicalForm","lean_decl_name":"QHat.canonicalForm","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"FLT_ch5","source_path":"FLT/Data/QHat.lean","lean4_code":"lemma canonicalForm (z : QHat) : ∃ (N : ℕ+) (z' : ZHat), z = (1 / N : ℚ) ⊗ₜ z' := by\n induction z using TensorProduct.induction_on with\n | zero =>\n refine ⟨1, 0, ?_⟩\n simp\n | tmul q z =>\n refine ⟨⟨q.den, q.den_pos ⟩, q.num * z, ?_⟩\n simp_rw [← zsmul_eq_mul, TensorProduct.tmul_smul, TensorProduct.smul_tmul']\n simp only [PNat.mk_coe, zsmul_eq_mul]\n simp only [← q.mul_den_eq_num, mul_assoc,\n one_div, ne_eq, Nat.cast_eq_zero, Rat.den_ne_zero, not_false_eq_true,\n mul_one, mul_inv_cancel₀]\n | add x y hx hy =>\n obtain ⟨N₁, z₁, rfl⟩ := hx\n obtain ⟨N₂, z₂, rfl⟩ := hy\n refine ⟨N₁ * N₂, (N₁ : ℤ) * z₂ + (N₂ : ℤ) * z₁, ?_⟩\n simp only [TensorProduct.tmul_add, ← zsmul_eq_mul,\n TensorProduct.tmul_smul, TensorProduct.smul_tmul']\n simp only [one_div, PNat.mul_coe, Nat.cast_mul, mul_inv_rev, zsmul_eq_mul, Int.cast_natCast,\n ne_eq, Nat.cast_eq_zero, PNat.ne_zero, not_false_eq_true, mul_inv_cancel_left₀]\n rw [add_comm]\n congr\n simp [mul_comm]\n","line":285,"end_line":307,"proof_status":"formalized"}
{"id":"QHat.rat_meet_zHat","label":"QHat.rat_meet_zHat","background_color":"#9CEC8B","border_color":"green","kind":"ellipse","dep_graph_url":"https://imperialcollegelondon.github.io/FLT/blueprint/dep_graph_chapter_5.html","dependencies":["QHat","QHat.lowestTerms"],"nlp_text":"The intersection of \\(\\mathbb {Q}\\) and \\(\\widehat{\\mathbb {Z}}\\) in \\(\\widehat{\\mathbb {Q}}\\) is \\(\\mathbb {Z}\\).","doc_url":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/QHat.rat_meet_zHat","latex_link":"sect0002.html#QHat.rat_meet_zHat","lean_link":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/QHat.rat_meet_zHat","lean_decl_name":"QHat.rat_meet_zHat","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"FLT_ch5","source_path":"FLT/Data/QHat.lean","lean4_code":"lemma rat_meet_zHat : ratsub ⊓ zHatsub = zsub := by\n apply le_antisymm\n · intro x ⟨⟨l, hl⟩, ⟨r, hr⟩⟩\n simp only [AddMonoidHom.coe_coe, Algebra.TensorProduct.includeLeft_apply,\n Algebra.TensorProduct.includeRight_apply] at hl hr\n rcases lowestTerms x with ⟨⟨N, z, hNz, hx⟩, unique⟩\n have cop1 : IsCoprime l.den.toPNat' l.num := by\n simp_rw [IsCoprime, ZHat.intCast_val, ← ZMod.isUnit_natAbs, ZMod.isUnit_iff_coprime,\n PNat.toPNat'_coe l.den_pos]\n exact l.reduced\n have cop2 : IsCoprime 1 r := by\n simp only [IsCoprime, PNat.val_ofNat]\n exact isUnit_of_subsingleton _\n have hcanon : x = (1/(l.den : ℚ)) ⊗ₜ[ℤ] (l.num : ZHat) := by\n nth_rw 1 [← hl, ← Rat.num_div_den l, ← mul_one ((l.num : ℚ) / l.den), div_mul_comm,\n mul_comm, ← zsmul_eq_mul, TensorProduct.smul_tmul, zsmul_eq_mul, mul_one]\n rw [← PNat.toPNat'_coe l.den_pos, hx] at hcanon\n obtain ⟨rfl, rfl⟩ := unique _ _ _ _ ⟨hNz, cop1, hcanon⟩\n have : 1 = 1 / (((1 : ℕ+) : ℕ) : ℚ) := by simp\n nth_rw 1 [← hx, ← hr, this] at hcanon\n use l.num; rw [hx, (unique _ 1 _ r ⟨hNz, cop2, hcanon.symm⟩).1]\n simp\n · exact fun x ⟨k, hk⟩ ↦ by constructor <;>\n (use k; simp only [AddMonoidHom.coe_coe,\n map_intCast]; exact hk)\n","line":517,"end_line":541,"proof_status":"formalized"}
{"id":"HurwitzRatHat.completed_units","label":"HurwitzRatHat.completed_units","background_color":"#A3D6FF","border_color":"green","kind":"ellipse","dep_graph_url":"https://imperialcollegelondon.github.io/FLT/blueprint/dep_graph_chapter_5.html","dependencies":["HurwitzRatHat.canonicalForm"],"nlp_text":"The group of units of \\(\\widehat{D}\\) is \\(D^\\times \\widehat{\\mathcal{O}}^\\times \\). More precisely, every element of \\(\\widehat{D}^\\times \\) can be written as a product \\(\\delta u\\) with \\(\\delta \\in D^\\times \\) and \\(u\\in \\widehat{\\mathcal{O}}^\\times \\).","doc_url":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/HurwitzRatHat.completed_units","latex_link":"sect0002.html#HurwitzRatHat.completed_units","lean_link":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/HurwitzRatHat.completed_units","lean_decl_name":"HurwitzRatHat.completed_units","kind_description":"theorems and lemmas","status_from_color":"ready_to_formalize","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"FLT_ch5","source_path":"FLT/Data/HurwitzRatHat.lean","lean4_code":"lemma completed_units (z : D^ˣ) : ∃ (u : Dˣ) (v : 𝓞^ˣ), (z : D^) = j₁ u * j₂ v := sorry\n","line":64,"end_line":64,"proof_status":"statement_formalized"}
{"id":"ZHat.charZero","label":"ZHat.charZero","background_color":"#1CAC78","border_color":"green","kind":"ellipse","dep_graph_url":"https://imperialcollegelondon.github.io/FLT/blueprint/dep_graph_chapter_5.html","dependencies":[],"nlp_text":"The map from the naturals into \\(\\widehat{\\mathbb {Z}}\\) sending \\(n\\) to \\(n\\) is injective.","doc_url":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/ZHat.charZero","latex_link":"sect0002.html#ZHat.charZero","lean_link":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/ZHat.charZero","lean_decl_name":"ZHat.charZero","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":true,"found_in_mathlib4v4.22.0":true,"source_repo":"mathlib","source_path":"./Mathlib/Algebra/Ring/CharZero.lean","lean4_code":"lemma charZero (ϕ : R →+* S) [CharZero S] : CharZero R where\n cast_injective a b h := CharZero.cast_injective (R := S) <| by\n rw [← map_natCast ϕ, ← map_natCast ϕ, h]\n\n","line":48,"end_line":51,"proof_status":"formalized"}
{"id":"ZHat.torsionfree","label":"ZHat.torsionfree","background_color":"#1CAC78","border_color":"green","kind":"ellipse","dep_graph_url":"https://imperialcollegelondon.github.io/FLT/blueprint/dep_graph_chapter_5.html","dependencies":["ZHat.charZero","ZHat.commRing"],"nlp_text":"If \\(0{\\lt}N\\) is an integer then multiplication by \\(N\\) is injective on \\(\\widehat{\\mathbb {Z}}\\).","doc_url":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/ZHat.torsionfree","latex_link":"sect0002.html#ZHat.torsionfree","lean_link":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/ZHat.torsionfree","lean_decl_name":"ZHat.torsionfree","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"FLT_ch5","source_path":"FLT/Data/QHat.lean","lean4_code":"lemma torsionfree (N : ℕ+) : Function.Injective (fun z : ZHat ↦ N * z) := by\n rw [← AddMonoidHom.coe_mulLeft, injective_iff_map_eq_zero]\n intro a ha\n rw [AddMonoidHom.coe_mulLeft] at ha\n exact eq_zero_of_mul_eq_zero N a ha\n","line":205,"end_line":209,"proof_status":"formalized"}
{"id":"ZHat.e_not_in_Int","label":"ZHat.e_not_in_Int","background_color":"#1CAC78","border_color":"green","kind":"ellipse","dep_graph_url":"https://imperialcollegelondon.github.io/FLT/blueprint/dep_graph_chapter_5.html","dependencies":["ZHat.e"],"nlp_text":"The element \\((e_N)_N\\) of \\(\\widehat{\\mathbb {Z}}\\) is not in \\(\\mathbb {Z}\\).","doc_url":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/ZHat.e_not_in_Int","latex_link":"sect0002.html#ZHat.e_not_in_Int","lean_link":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/ZHat.e_not_in_Int","lean_decl_name":"ZHat.e_not_in_Int","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"FLT_ch5","source_path":"FLT/Data/QHat.lean","lean4_code":"/-- Nonarchimedean $e$ is not an integer. -/\nlemma e_not_in_Int : ∀ a : ℤ, e ≠ a := by\n rintro (a|a) ha\n · obtain ⟨j, honelt, hj⟩ : ∃ j : ℕ, 1 < j ∧ a < ∑ i ∈ range (j + 1), i ! := by\n refine ⟨a + 2, ?_, ?_⟩\n · simp only [lt_add_iff_pos_left, add_pos_iff, zero_lt_one, or_true]\n rw [sum_range_add]\n apply lt_add_of_nonneg_of_lt\n · positivity\n rw [range_one, sum_singleton, add_zero]\n exact (Nat.lt_add_of_pos_right two_pos).trans_le (self_le_factorial _)\n let N : ℕ+ := ⟨(j + 1)!, by positivity⟩\n apply lt_irrefl (e N).val\n have h₀ : ∑ i ∈ range (j + 1), i ! < (j + 1) ! := sum_factorial_lt_factorial_succ honelt\n calc\n _ = _ := by simp [ha, N, mod_eq_of_lt (hj.trans h₀)]\n _ < _ := hj\n _ = _ := by simp only [PNat.mk_coe, e_factorial_succ, ZMod.val_natCast, mod_eq_of_lt h₀, N]\n · obtain ⟨j, honelt, hj⟩ : ∃ j, 1 < j ∧ (a + 1) + ∑ i ∈ range (j + 1), i ! < (j + 1)! := by\n refine ⟨a + 3, ?_, ?_⟩\n · omega\n calc\n _ < (a + 1) * 1 + 2 * (a + 3)! := ?_\n _ ≤ (a + 1) * (a + 3)! + 2 * (a + 3)! + 0 := ?_\n _ < (a + 1) * (a + 3)! + 2 * (a + 3)! + (a + 3)! := ?_\n _ = (a + 4)! := ?_\n · rw [mul_one]\n have : 3 ≤ a + 3 := by omega\n have := sum_factorial_lt_two_mul_factorial this\n gcongr\n · rw [add_zero]\n have : 1 ≤ (a + 3)! := Nat.one_le_of_lt (factorial_pos _)\n gcongr\n · gcongr\n exact factorial_pos _\n · rw [factorial_succ (a + 3)]\n ring\n let N : ℕ+ := ⟨(j + 1)!, by positivity⟩\n apply lt_irrefl (e N).val\n calc\n _ < N - (a + 1) := ?_\n _ = (e N).val := ?_\n · dsimp [N]\n apply lt_sub_of_add_lt\n rwa [add_comm, e_factorial_succ, ZMod.val_natCast,\n mod_eq_of_lt (sum_factorial_lt_factorial_succ honelt)]\n · have : a + 1 < N := lt_of_le_of_lt (Nat.le_add_right _ _) hj\n rw [ha, intCast_val, Int.cast_negSucc, ZMod.neg_val, ZMod.val_natCast, if_neg,\n mod_eq_of_lt this]\n rw [ZMod.natCast_eq_zero_iff]\n contrapose! this\n apply le_of_dvd (zero_lt_succ a) this\n","line":124,"end_line":175,"proof_status":"formalized"}
{"id":"QHat.lowestTerms","label":"QHat.lowestTerms","background_color":"#A3D6FF","border_color":"green","kind":"ellipse","dep_graph_url":"https://imperialcollegelondon.github.io/FLT/blueprint/dep_graph_chapter_5.html","dependencies":["QHat.IsCoprime"],"nlp_text":"Every element of \\(\\widehat{\\mathbb {Q}}\\) can be uniquely written as \\(z/N\\) with \\(z\\in \\widehat{\\mathbb {Z}}\\), \\(N\\in \\mathbb {N}^+\\), and with \\(N\\) and \\(z\\) coprime.","doc_url":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/QHat.lowestTerms","latex_link":"sect0002.html#QHat.lowestTerms","lean_link":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/QHat.lowestTerms","lean_decl_name":"QHat.lowestTerms","kind_description":"theorems and lemmas","status_from_color":"ready_to_formalize","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"FLT_ch5","source_path":"FLT/Data/QHat.lean","lean4_code":"lemma lowestTerms (x : QHat) : (∃ N z, IsCoprime N z ∧ x = (1 / N : ℚ) ⊗ₜ z) ∧\n (∀ N₁ N₂ z₁ z₂,\n IsCoprime N₁ z₁ ∧ IsCoprime N₂ z₂ ∧ (1 / N₁ : ℚ) ⊗ₜ z₁ = (1 / N₂ : ℚ) ⊗ₜ[ℤ] z₂ →\n N₁ = N₂ ∧ z₁ = z₂) := by\n constructor\n · -- Existence: by the previous lemma, an arbitrary element [x] can be written as z/N;\n obtain ⟨N, z, h⟩ := canonicalForm x\n -- let D be the greatest common divisor of N and z_N (lifted to a natural).\n let D : PNat := ⟨Nat.gcd N (z N).val, Nat.gcd_pos_of_pos_left _ N.pos⟩\n cases D.one_le.eq_or_lt with\n | inl hD =>\n -- If D = 1 then the fraction is by definition in lowest terms.\n use N, z, ?_, h\n symm at hD\n simp_rw [D, ← PNat.coe_eq_one_iff, PNat.mk_coe] at hD\n rwa [isCoprime_iff_coprime, Nat.coprime_iff_gcd_eq_one]\n | inr hD =>\n -- However if 1 < D ∣ N then z_D is the reduction of z_N and is hence 0.\n have hDN : D ∣ N := PNat.dvd_iff.mpr (Nat.gcd_dvd_left N (z N).val)\n have := z.prop D N (PNat.dvd_iff.mp hDN)\n have : z D = 0 := by\n rw [← this, ZMod.castHom_apply, ZMod.cast_eq_val, ZMod.natCast_eq_zero_iff]\n exact Nat.gcd_dvd_right N (z N).val\n -- By lemma 5.9 (ZHat.multiples) we deduce that z = Dy is a multiple of D,\n obtain ⟨y, hy⟩ : ∃ y, D * y = z := by rwa [ZHat.multiples]\n obtain ⟨E, hE⟩ := hDN\n use E, y, ?_, ?_\n swap\n · -- and hence [x = ] z / N = 1/N ⨂ₜ Dy = 1/E ⨂ y, where E = N / D.\n rw [h, hE, ← hy]\n have : (D : ZHat) • y = (D : ℤ) • y := by simp\n simp_rw [PNat.mul_coe, Nat.cast_mul, one_div, mul_inv, ← smul_eq_mul, this,\n ← TensorProduct.smul_tmul]\n simp\n · -- Now if a natural divided both y_E and E\n rw [isCoprime_iff_coprime]\n apply Nat.coprime_of_dvd fun k hk hk1 hk2 => ?_\n -- then this natural would divide both z_N/D [ = z_ED/D = y_N = y_ED] and N/D [ = E],\n -- contradicting the fact that D is the greatest common divisors\n suffices k ∣ (z N).val / D ∧ k ∣ N / D by\n have := Nat.dvd_gcd this.2 this.1\n simp [D, Nat.gcd_div_gcd_div_gcd_of_pos_left, hk.ne_one] at this\n constructor\n swap\n · simp [hE, hk1]\n simp only [← hy, ZHat.nat_mul_apply, ZMod.val_mul, ZMod.val_natCast, Nat.mod_mul_mod]\n nth_rw 3 [hE]\n have := y.prop E N (by simp [hE])\n simp only [ZMod.castHom_apply, ZMod.cast_eq_val] at this\n rwa [PNat.mul_coe, Nat.mul_mod_mul_left, Nat.mul_div_cancel_left _ (by simp),\n ← ZMod.val_natCast, this]\n · -- Uniqueness:\n rintro N M z w ⟨hcpz, hcpw, h⟩\n -- if z/N = w/M, we deduce 1 ⨂ₜ Mz = 1 ⨂ₜ Nw\n have : i₂ (M * z) = i₂ (N * w) := by\n apply_fun ((M * N : ℤ) • ·) at h\n conv_lhs at h => rw [mul_comm]\n simpa [← TensorProduct.smul_tmul_smul] using h\n let y := M * z\n -- and by injectivity of ZHat → QHat\n have hNz := injective_zHat this\n -- we deduce that Mz = Nw = y.\n have hy₁ : y = M * z := rfl\n have hy₂ : y = N * w := by rw [← hNz]\n -- In particular, if L is the lowest common multiple of M and N\n let L : ℕ+ := PNat.lcm N M\n -- then y_L is a multiple of both M and N and is hence zero,\n have : y L = 0 := by\n suffices (L : ℕ) ∣ (y L).val by\n simpa [← ZMod.natCast_eq_zero_iff]\n apply lcm_dvd <;> [rw [hy₂]; rw [hy₁]] <;>\n · simp only [ZHat.pnat_mul_apply, ZMod.val_mul, ZMod.val_natCast, Nat.mod_mul_mod]\n refine (Nat.dvd_mod_iff ?_).mpr (Nat.dvd_mul_right _ _)\n simp only [PNat.lcm_coe, Nat.dvd_lcm_left, Nat.dvd_lcm_right, L]\n -- so y = Lx is a multiple of L by 5.9 (ZHat.multiples),\n obtain ⟨x, hx⟩ := (ZHat.multiples _ _).mpr this\n -- and we deduce from torsionfreeness that z = (L/M)x [ = M'x] and w = (L/N)x [ = N'x].\n obtain ⟨N', hN'⟩ : N ∣ L := PNat.dvd_lcm_left N M\n have hN'' : (N' : ℕ) = L / N := by simp [hN']\n obtain ⟨M', hM'⟩ : M ∣ L := PNat.dvd_lcm_right N M\n have hM'' : (M' : ℕ) = L / M := by simp [hM']\n have hz : z = M' * x := by\n apply ZHat.torsionfree M\n dsimp\n rw [← hy₁, ← hx, ← mul_assoc, ← Nat.cast_mul, ← PNat.mul_coe, ← hM']\n have hw : w = N' * x := by\n apply ZHat.torsionfree N\n dsimp\n rw [← hy₂, ← hx, ← mul_assoc, ← Nat.cast_mul, ← PNat.mul_coe, ← hN']\n -- If some prime divided L/M [ = M'] then it would have to divide N\n -- which means that z is not in lowest terms;\n -- similarly if some prime divided L/N [ = N'] then w/M would not be in lowest terms.\n have dvd (n m p : Nat) (hm : 0 < m) : p ∣ (n.lcm m / m) → p ∣ n := by\n intro h\n rw [Nat.lcm_eq_mul_div] at h\n rw [Nat.div_div_eq_div_mul] at h\n rw [Nat.mul_div_mul_right _ _ hm] at h\n apply h.trans\n refine Nat.div_dvd_of_dvd ?_\n exact Nat.gcd_dvd_left n m\n -- We deduce that L = M = N and hence z = w by torsionfreeness.\n have {n m : ℕ+} {Z : ZHat} (hcp : IsCoprime m Z) (hZ : ((n.lcm m / n : ℕ) : ZHat) ∣ Z) :\n n.lcm m = n := by\n rw [isCoprime_iff_coprime] at *\n apply PNat.eq\n symm\n apply Nat.eq_of_dvd_of_div_eq_one\n · refine PNat.dvd_iff.mp ?_\n exact PNat.dvd_lcm_left n m\n contrapose! hcp\n let f := Nat.minFac (n.lcm m / n : ℕ)\n have hf : f ∣ _ := Nat.minFac_dvd (n.lcm m / n : ℕ)\n have hfprime : Nat.Prime f := Nat.minFac_prime <| by simpa\n have := dvd m n f (by simp) (by simpa [← PNat.lcm_coe, Nat.lcm_comm] using hf)\n apply Nat.not_coprime_of_dvd_of_dvd hfprime.one_lt this\n obtain ⟨g, hg⟩ : (f : ZHat) ∣ Z := by\n apply dvd_trans ?_ hZ\n obtain ⟨g, hg⟩ := hf\n simp only [PNat.lcm_coe] at hg\n simp [hg]\n rw [hg]\n simp only [ZHat.nat_mul_apply, ZMod.val_mul, Nat.dvd_mod_iff this]\n apply dvd_mul_of_dvd_left\n simp only [ZMod.val_natCast]\n rw [Nat.dvd_mod_iff this]\n have hw' : ((L / N : ℕ) : ZHat) ∣ w := by\n rw [hw, hN'']\n exact dvd_mul_right _ _\n have hz' : ((M.lcm N / M : ℕ) : ZHat) ∣ z := by\n rw [hz, hM'', PNat.lcm_comm]\n exact dvd_mul_right _ _\n have hN : L = N := this hcpw hw'\n have hM : L = M := PNat.lcm_comm _ _ |>.trans <| this hcpz hz'\n have hNM' : N' = M' := by\n apply mul_left_cancel (a := L)\n conv_lhs =>\n rw [hN, ← hN']\n conv_rhs =>\n rw [hM, ← hM']\n rw [hz, hw, ← hN, ← hM, hNM']\n exact ⟨rfl, rfl⟩\n","line":353,"end_line":493,"proof_status":"statement_formalized"}
{"id":"Hurwitz.norm_one","label":"Hurwitz.norm_one","background_color":"#1CAC78","border_color":"green","kind":"ellipse","dep_graph_url":"https://imperialcollegelondon.github.io/FLT/blueprint/dep_graph_chapter_5.html","dependencies":["Hurwitz.norm"],"nlp_text":"The norm of \\(1\\) is \\(1\\).","doc_url":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/Hurwitz.norm_one","latex_link":"sect0002.html#Hurwitz.norm_one","lean_link":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/Hurwitz.norm_one","lean_decl_name":"Hurwitz.norm_one","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"FLT_ch5","source_path":"FLT/Data/Hurwitz.lean","lean4_code":"lemma norm_one : norm 1 = 1 := by simp [norm]\n","line":388,"end_line":388,"proof_status":"formalized"}
{"id":"ZHat.e","label":"ZHat.e","background_color":"#B0ECA3","border_color":"green","kind":"box","dep_graph_url":"https://imperialcollegelondon.github.io/FLT/blueprint/dep_graph_chapter_5.html","dependencies":["ZHat.commRing"],"nlp_text":"The infinite sum \\(0!+1!+2!+3!+4!+5!+\\cdots \\) looks like it makes no sense at all; it is the sum of an infinite series of larger and larger positive numbers. However, the sum is finite modulo \\(N\\) for every positive integer \\(N\\), because all the terms from \\(N!\\) onwards are multiples of \\(N\\) and thus are zero in \\(\\mathbb {Z}/N\\mathbb {Z}\\). Thus it makes sense to define \\(e_N\\) to be the value of the finite sum modulo \\(N\\). Explicitly, \\(e_N=0!+1!+\\cdots +(N-1)!\\) modulo \\(N\\).","doc_url":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/ZHat.e","latex_link":"sect0002.html#ZHat.e","lean_link":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/ZHat.e","lean_decl_name":"ZHat.e","kind_description":"definitions","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"FLT_ch5","source_path":"./FLT/Deformations/Lemmas.lean","lean4_code":"instance {R S} [Semiring R] [Semiring S] (e : R ≃+* S) : IsLocalHom e.toRingHom :=\n ⟨fun x hx ↦ by convert hx.map e.symm; simp⟩\n\n","line":154,"end_line":156,"proof_status":"formalized"}
{"id":"ZHat.e_def","label":"ZHat.e_def","background_color":"#1CAC78","border_color":"green","kind":"ellipse","dep_graph_url":"https://imperialcollegelondon.github.io/FLT/blueprint/dep_graph_chapter_5.html","dependencies":["ZHat.e"],"nlp_text":"The collection \\((e_N)_N\\) is an element of \\(\\widehat{\\mathbb {Z}}\\).","doc_url":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/ZHat.e_def","latex_link":"sect0002.html#ZHat.e_def","lean_link":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/ZHat.e_def","lean_decl_name":"ZHat.e_def","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"FLT_ch5","source_path":"FLT/Data/QHat.lean","lean4_code":"lemma e_def (n : ℕ+) : e n = ∑ i ∈ range (n : ℕ), (i ! : ZMod n) := rfl\n","line":90,"end_line":90,"proof_status":"formalized"}
{"id":"Hurwitz.norm","label":"Hurwitz.norm","background_color":"#B0ECA3","border_color":"green","kind":"box","dep_graph_url":"https://imperialcollegelondon.github.io/FLT/blueprint/dep_graph_chapter_5.html","dependencies":["Hurwitz"],"nlp_text":"The Hurwitz quaternions come equipped with an integer-valued norm, which is \\(a^2+b^2+c^2+d^2\\) on \\(a+bi+cj+dk\\) but needs to be modified a bit to deal with \\(\\omega \\).","doc_url":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/Hurwitz.norm","latex_link":"sect0002.html#Hurwitz.norm","lean_link":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/Hurwitz.norm","lean_decl_name":"Hurwitz.norm","kind_description":"definitions","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"FLT_ch5","source_path":"FLT/Data/Hurwitz.lean","lean4_code":"def norm (z : 𝓞) : ℤ :=\n z.re * z.re + z.im_o * z.im_o + z.im_i * z.im_i + z.im_oi * z.im_oi\n - z.re * (z.im_o + z.im_oi) + z.im_i * (z.im_o - z.im_oi)\n","line":367,"end_line":369,"proof_status":"formalized"}
{"id":"Hurwitz.norm_nonneg","label":"Hurwitz.norm_nonneg","background_color":"#1CAC78","border_color":"green","kind":"ellipse","dep_graph_url":"https://imperialcollegelondon.github.io/FLT/blueprint/dep_graph_chapter_5.html","dependencies":["Hurwitz.norm"],"nlp_text":"The norm of an element is nonnegative.","doc_url":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/Hurwitz.norm_nonneg","latex_link":"sect0002.html#Hurwitz.norm_nonneg","lean_link":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/Hurwitz.norm_nonneg","lean_decl_name":"Hurwitz.norm_nonneg","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"FLT_ch5","source_path":"FLT/Data/Hurwitz.lean","lean4_code":"lemma norm_nonneg (x : 𝓞) : 0 ≤ norm x := by\n rw [← Int.cast_nonneg_iff (R := ℝ), coe_norm]\n positivity\n","line":396,"end_line":398,"proof_status":"formalized"}
{"id":"Hurwitz.norm_eq_zero","label":"Hurwitz.norm_eq_zero","background_color":"#1CAC78","border_color":"green","kind":"ellipse","dep_graph_url":"https://imperialcollegelondon.github.io/FLT/blueprint/dep_graph_chapter_5.html","dependencies":["Hurwitz.norm"],"nlp_text":"The norm of an element is zero if and only if the element is zero.","doc_url":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/Hurwitz.norm_eq_zero","latex_link":"sect0002.html#Hurwitz.norm_eq_zero","lean_link":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/Hurwitz.norm_eq_zero","lean_decl_name":"Hurwitz.norm_eq_zero","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"FLT_ch5","source_path":"FLT/Data/Hurwitz.lean","lean4_code":"lemma norm_eq_zero (x : 𝓞) : norm x = 0 ↔ x = 0 := by\n constructor\n swap\n · rintro rfl; exact norm_zero\n intro h\n rw [← Int.cast_eq_zero (α := ℝ), coe_norm] at h\n field_simp at h\n norm_cast at h\n have h4 := eq_zero_of_add_nonpos_right (by positivity) (by positivity) h.le\n rw [sq_eq_zero_iff, sub_eq_zero] at h4\n have h1 := eq_zero_of_add_nonpos_left (by positivity) (by positivity) h.le\n have h3 := eq_zero_of_add_nonpos_right (by positivity) (by positivity) h1.le\n rw [h4] at h3\n simp only [ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, pow_eq_zero_iff, add_self_eq_zero] at h3\n rw [h3] at h4\n simp only [h4, sub_zero, h3, add_zero, ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, zero_pow]\n at h1\n have h2 := eq_zero_of_add_nonpos_right (by positivity) (by positivity) h1.le\n simp only [ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, pow_eq_zero_iff, mul_eq_zero,\n false_or] at h2\n simp only [h2, mul_zero, ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, zero_pow, add_zero,\n pow_eq_zero_iff, mul_eq_zero, or_false] at h1\n ext <;> assumption\n","line":400,"end_line":422,"proof_status":"formalized"}
{"id":"Hurwitz.exists_near","label":"Hurwitz.exists_near","background_color":"#1CAC78","border_color":"green","kind":"ellipse","dep_graph_url":"https://imperialcollegelondon.github.io/FLT/blueprint/dep_graph_chapter_5.html","dependencies":["Hurwitz.norm"],"nlp_text":"Given a “usual” quaternion \\(a=x+yi+zj+wk\\) with \\(x,y,z,w\\in \\mathbb {R}\\), there exists a Hurwitz quaternion \\(q\\) such that \\(N(a-q){\\lt}1\\).","doc_url":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/Hurwitz.exists_near","latex_link":"sect0002.html#Hurwitz.exists_near","lean_link":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/Hurwitz.exists_near","lean_decl_name":"Hurwitz.exists_near","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"FLT_ch5","source_path":"FLT/Data/Hurwitz.lean","lean4_code":"lemma exists_near (a : ℍ) : ∃ q : 𝓞, dist a (toQuaternion q) < 1 := by\n have four_inv : (4⁻¹ : ℝ) = 2⁻¹ ^ 2 := by norm_num\n have (r : ℝ) : (r - round r) ^ 2 ≤ 4⁻¹ := by\n rw [four_inv, sq_le_sq]\n apply (abs_sub_round _).trans_eq\n rw [abs_of_nonneg]\n all_goals norm_num\n let x := round a.re\n let y := round a.imI\n let z := round a.imJ\n let w := round a.imK\n by_cases H : |a.re - x| = 2⁻¹ ∧ |a.imI - y| = 2⁻¹ ∧ |a.imJ - z| = 2⁻¹ ∧ |a.imK - w| = 2⁻¹\n · use fromQuaternion a\n convert zero_lt_one' ℝ\n rw [NormedRing.dist_eq, ← sq_eq_zero_iff, sq, ← Quaternion.normSq_eq_norm_mul_self, normSq_def']\n rw [add_eq_zero_iff_of_nonneg (by positivity) (by positivity)]\n rw [add_eq_zero_iff_of_nonneg (by positivity) (by positivity)]\n rw [add_eq_zero_iff_of_nonneg (by positivity) (by positivity)]\n simp_rw [and_assoc, sq_eq_zero_iff, re_sub, imI_sub, imJ_sub, imK_sub, sub_eq_zero,\n ← Quaternion.ext_iff]\n symm\n apply leftInvOn_toQuaternion_fromQuaternion\n · simp only [Set.mem_setOf]\n have {r : ℝ} {z : ℤ} (h : |r - z| = 2⁻¹) : ∃ z' : ℤ, r = z' + 2⁻¹ := by\n cases (abs_eq (by positivity)).mp h with (rw [sub_eq_iff_eq_add'] at h)\n | inl h => use z\n | inr h => use z - 1; rw [h, Int.cast_sub, Int.cast_one, add_comm_sub]; norm_num\n obtain ⟨x', hx'⟩ := this H.1\n obtain ⟨y', hy'⟩ := this H.2.1\n obtain ⟨z', hz'⟩ := this H.2.2.1\n obtain ⟨w', hw'⟩ := this H.2.2.2\n use x', y', z', w', Or.inr ?_\n ext <;> simp [*]\n use fromQuaternion ⟨x,y,z,w⟩\n rw [aux]\n rw [NormedRing.dist_eq, ← sq_lt_one_iff₀ (_root_.norm_nonneg _), sq,\n ← Quaternion.normSq_eq_norm_mul_self, normSq_def']\n simp only [re_sub, imI_sub, imJ_sub, imK_sub]\n apply aux2 <;> try apply this\n contrapose! H\n suffices ∀ r : ℝ, |r| = 2⁻¹ ↔ r ^ 2 = 4⁻¹ by\n simpa [this]\n intro r\n rw [four_inv, sq_eq_sq_iff_abs_eq_abs, abs_of_nonneg (a := (2⁻¹ : ℝ))]\n norm_num\n","line":454,"end_line":498,"proof_status":"formalized"}
{"id":"ZHat.commRing","label":"ZHat.commRing","background_color":"#1CAC78","border_color":"green","kind":"ellipse","dep_graph_url":"https://imperialcollegelondon.github.io/FLT/blueprint/dep_graph_chapter_5.html","dependencies":["ZHat"],"nlp_text":"\\(\\widehat{\\mathbb {Z}}\\) is a subring of \\(\\prod _{N\\geq 1}(Z/N\\mathbb {Z})\\) and in particular is a ring.","doc_url":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/ZHat.commRing","latex_link":"sect0002.html#ZHat.commRing","lean_link":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/ZHat.commRing","lean_decl_name":"ZHat.commRing","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":true,"found_in_mathlib4v4.22.0":false,"source_repo":"remote_github","source_path":"https://raw.githubusercontent.com/ImperialCollegeLondon/FLT/712e8a20d2647895feed1cbf5518dce4056f58cb/FLT/Data/QHat.lean","lean4_code":"instance commRing : CommRing ZHat := inferInstance","line":56,"end_line":56,"proof_status":"formalized"}
{"id":"ZHat.nontrivial","label":"ZHat.nontrivial","background_color":"#1CAC78","border_color":"green","kind":"ellipse","dep_graph_url":"https://imperialcollegelondon.github.io/FLT/blueprint/dep_graph_chapter_5.html","dependencies":["ZHat.commRing"],"nlp_text":"\\(0\\not=1\\) in \\(\\widehat{\\mathbb {Z}}\\).","doc_url":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/ZHat.nontrivial","latex_link":"sect0002.html#ZHat.nontrivial","lean_link":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/ZHat.nontrivial","lean_decl_name":"ZHat.nontrivial","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":true,"found_in_mathlib4v4.22.0":true,"source_repo":"mathlib","source_path":"./Mathlib/Logic/Nontrivial/Basic.lean","lean4_code":"/-- As a convenience, provide an instance automatically if `(f default)` is nontrivial.\n\nIf a different index has the non-trivial type, then use `haveI := nontrivial_at that_index`.\n-/\n","line":84,"end_line":87,"proof_status":"formalized"}
{"id":"QHat.IsCoprime","label":"QHat.IsCoprime","background_color":"#B0ECA3","border_color":"green","kind":"box","dep_graph_url":"https://imperialcollegelondon.github.io/FLT/blueprint/dep_graph_chapter_5.html","dependencies":["ZHat.commRing"],"nlp_text":"If \\(N\\in \\mathbb {N}^+\\) and \\(z\\in \\widehat{\\mathbb {Z}}\\) then we say that \\(N\\) and \\(z\\) are coprime if \\(z_N\\in (\\mathbb {Z}/N\\mathbb {Z})^\\times \\). We write \\(z/N\\) as notation for the element \\(\\frac{1}{N}\\otimes _tz\\).","doc_url":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/QHat.IsCoprime","latex_link":"sect0002.html#QHat.IsCoprime","lean_link":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/QHat.IsCoprime","lean_decl_name":"QHat.IsCoprime","kind_description":"definitions","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"FLT_ch5","source_path":"FLT/Data/QHat.lean","lean4_code":"def IsCoprime (N : ℕ+) (z : ZHat) : Prop := IsUnit (z N)\n","line":309,"end_line":309,"proof_status":"formalized"}
{"id":"ZHat","label":"ZHat","background_color":"#B0ECA3","border_color":"green","kind":"box","dep_graph_url":"https://imperialcollegelondon.github.io/FLT/blueprint/dep_graph_chapter_5.html","dependencies":[],"nlp_text":"The profinite completion \\(\\widehat{\\mathbb {Z}}\\) of \\(\\mathbb {Z}\\) is the set of all compatible collections \\(c=(c_N)_N\\) of elements of \\(\\mathbb {Z}/N\\mathbb {Z}\\) indexed by \\(\\mathbb {N}^+:=\\{ 1,2,3,\\ldots \\} \\). A collection is said to be compatible if for all positive integers \\(D\\mid N\\), we have \\(c_N\\) mod \\(D\\) equals \\(c_D\\).","doc_url":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/ZHat","latex_link":"sect0002.html#ZHat","lean_link":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/ZHat","lean_decl_name":"ZHat","kind_description":"definitions","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"FLT_ch5","source_path":"FLT/Data/QHat.lean","lean4_code":"/-- We define the profinite completion of ℤ explicitly as compatible elements of ℤ/Nℤ for\nall positive integers `N`. We declare it as a subring of `∏_{N ≥ 1} (ℤ/Nℤ)`, and then promote it\nto a type. -/\ndef ZHat : Type := {\n carrier := { f : Π M : ℕ+, ZMod M | ∀ (D N : ℕ+) (h : (D : ℕ) ∣ N),\n ZMod.castHom h (ZMod D) (f N) = f D },\n zero_mem' := by simp\n neg_mem' := fun {x} hx => by\n simp only [ZMod.castHom_apply, Set.mem_setOf_eq, Pi.neg_apply] at *\n peel hx with D N hD hx\n rw [ZMod.cast_neg hD, hx]\n add_mem' := fun {a b} ha hb => by\n simp only [ZMod.castHom_apply, Set.mem_setOf_eq, Pi.add_apply] at *\n intro D N hD\n rw [ZMod.cast_add hD, ha _ _ hD, hb _ _ hD]\n one_mem' := by\n simp only [ZMod.castHom_apply, Set.mem_setOf_eq, Pi.one_apply]\n intro D N hD\n rw [ZMod.cast_one hD]\n mul_mem' := fun {a b} ha hb => by\n simp only [ZMod.castHom_apply, Set.mem_setOf_eq, Pi.mul_apply] at *\n intro D N hD\n rw [ZMod.cast_mul hD, ha _ _ hD, hb _ _ hD]\n : Subring (Π n : ℕ+, ZMod n)}\nderiving CommRing\n","line":11,"end_line":35,"proof_status":"formalized"}
{"id":"Hurwitz.starRing","label":"Hurwitz.starRing","background_color":"#B0ECA3","border_color":"green","kind":"box","dep_graph_url":"https://imperialcollegelondon.github.io/FLT/blueprint/dep_graph_chapter_5.html","dependencies":["Hurwitz.ring"],"nlp_text":"There’s a conjugation map (which we’ll call \"star\") from the Hurwitz quaternions to themselves, sending integers to themselves and purely imaginary elements like \\(2\\omega +1\\) to minus themselves. It satisfies \\((x^*)^*=x\\), \\((xy)^*=y^*x^*\\) and \\((x+y)^*=x^*+y^*\\). In particular, the Hurwitz quaternions are a \"star ring\" in the sense of mathlib.","doc_url":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/Hurwitz.starRing","latex_link":"sect0002.html#Hurwitz.starRing","lean_link":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/Hurwitz.starRing","lean_decl_name":"Hurwitz.starRing","kind_description":"definitions","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":true,"found_in_mathlib4v4.22.0":true,"source_repo":"mathlib","source_path":"./Mathlib/Algebra/Star/RingQuot.lean","lean4_code":"def starRing {R : Type u} [Semiring R] [StarRing R] (r : R → R → Prop)\n (hr : ∀ a b, r a b → r (star a) (star b)) : StarRing (RingQuot r) where\n star := star' r hr\n star_involutive := by\n rintro ⟨⟨⟩⟩\n simp [star'_quot]\n star_mul := by\n rintro ⟨⟨⟩⟩ ⟨⟨⟩⟩\n simp [star'_quot, mul_quot, star_mul]\n star_add := by\n rintro ⟨⟨⟩⟩ ⟨⟨⟩⟩\n simp [star'_quot, add_quot, star_add]\n\nend StarRing\n\n","line":41,"end_line":55,"proof_status":"formalized"}
{"id":"Hurwitz.ring","label":"Hurwitz.ring","background_color":"#1CAC78","border_color":"green","kind":"ellipse","dep_graph_url":"https://imperialcollegelondon.github.io/FLT/blueprint/dep_graph_chapter_5.html","dependencies":["Hurwitz"],"nlp_text":"The Hurwitz quaternions form a ring.","doc_url":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/Hurwitz.ring","latex_link":"sect0002.html#Hurwitz.ring","lean_link":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/Hurwitz.ring","lean_decl_name":"Hurwitz.ring","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"FLT_ch5","source_path":"./FLT/Hacks/RightActionInstances.lean","lean4_code":"noncomputable section ring\n\nvariable (R A B M : Type*) [CommRing R]\n [CommRing A] [Algebra R A]\n [Ring B] [Algebra R B]\n [AddCommGroup M] [Module R M]\n\nscoped instance [TopologicalSpace A] [Module.Finite R M] :\n IsTopologicalAddGroup (M ⊗[R] A) := IsModuleTopology.topologicalAddGroup A (M ⊗[R] A)\n\nscoped instance [TopologicalSpace A] [IsTopologicalRing A] [Module.Finite R B] :\n IsTopologicalRing (B ⊗[R] A) :=\n IsModuleTopology.Module.topologicalRing A _\n\nscoped instance [TopologicalSpace A] [IsTopologicalRing A] [Module.Finite R B] :\n IsTopologicalRing (B ⊗[R] A) :=\n IsModuleTopology.Module.topologicalRing A _\n\nscoped instance [TopologicalSpace A] [IsTopologicalRing A]\n [LocallyCompactSpace A] [Module.Finite R M] :\n LocallyCompactSpace (M ⊗[R] A) := IsModuleTopology.locallyCompactSpaceOfFinite A\n\nend ring -- section\n\n","line":201,"end_line":224,"proof_status":"formalized"}
{"id":"Hurwitz.surjective_pnat_quotient","label":"Hurwitz.surjective_pnat_quotient","background_color":"#A3D6FF","border_color":"blue","kind":"ellipse","dep_graph_url":"https://imperialcollegelondon.github.io/FLT/blueprint/dep_graph_chapter_5.html","dependencies":["Hurwitz"],"nlp_text":"If \\(N\\) is a positive natural then the obvious map \\(\\mathcal{O}\\to \\widehat{\\mathcal{O}}/N\\widehat{\\mathcal{O}}\\) is surjective.","doc_url":null,"latex_link":"sect0002.html#Hurwitz.surjective_pnat_quotient","lean_link":null,"lean_decl_name":"Hurwitz.surjective_pnat_quotient","kind_description":"theorems and lemmas","status_from_color":"ready_to_formalize","lookup_in_mathlib4v4.22.0":true,"found_in_mathlib4v4.22.0":false,"proof_status":"nlp_only"}
{"id":"Hurwitz","label":"Hurwitz","background_color":"#B0ECA3","border_color":"green","kind":"box","dep_graph_url":"https://imperialcollegelondon.github.io/FLT/blueprint/dep_graph_chapter_5.html","dependencies":[],"nlp_text":"The Hurwitz quaternions are the set \\(\\mathcal{O}:= \\mathbb {Z}\\oplus \\mathbb {Z}\\omega \\oplus \\mathbb {Z}i\\oplus \\mathbb {Z}i\\omega \\) (as an abstract abelian group or as a subgroup of the usual quaternions). Here \\(\\omega =\\frac{-1+(i+j+k)}{2}\\) and note that \\((i+j+k)^2=-3\\). We have \\(\\overline{\\omega }=\\omega ^2=-(\\omega +1)\\). A general quaternion \\(a+bi+cj+dk\\) is a Hurwitz quaternion if either \\(a,b,c,d\\in \\mathbb {Z}\\) or \\(a,b,c,d\\in \\mathbb {Z}+\\frac{1}{2}\\).","doc_url":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/Hurwitz","latex_link":"sect0002.html#Hurwitz","lean_link":"https://ImperialCollegeLondon.github.io/FLT/docs/find/#doc/Hurwitz","lean_decl_name":"Hurwitz","kind_description":"definitions","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"FLT_ch5","source_path":"./FLT/Data/Hurwitz.lean","lean4_code":"structure Hurwitz : Type where\n re : ℤ -- 1\n im_o : ℤ -- ω\n im_i : ℤ -- i\n im_oi : ℤ -- ωi -- note iω + ωi + 1 + i = 0\n\nnotation \"𝓞\" => Hurwitz -- 𝓞 = \\MCO\nnamespace Hurwitz\n\nopen Quaternion in\n","line":4,"end_line":13,"proof_status":"formalized"}