Lean / Reader
Lean reader

AxialMultiplicative.lean

122 lines11 declarationsno sorryimports AxialTorus AxialScale

Lean 4 Web has Mathlib, so it can check files that import only Mathlib. This one also imports AxialTorus, AxialScale, which it does not have: you can read it there, but it will not check. Build the project itself to check it.

  1. import AxialTorus
  2. import AxialScale
  3. namespace Axial.Multiplicative
  4. noncomputable section
  5. open Classical
  6. private theorem scale_entries {t : ℚˣ} {c : ℚ} (hm : IntegralMat (c • conjugate t)) :
  7. Integral c ∧ Integral (c*(t:ℚ)) ∧ Integral (c*(((t:ℚ)-2)/5)) ∧
  8. Integral (c*(↑t⁻¹:ℚ)) := by
  9. refine ⟨?_,hm 2 3,hm 2 4,hm 2 5⟩
  10. simpa only [mul_one] using (show Integral (c*1) from hm 0 1)
  11. private theorem integral_form (c t s : ℚ) (hc : Integral c) (ht : Integral (c*t))
  12. (hq : Integral (c*((t-2)/5))) (hs : Integral (c*s)) : IntegralMat (c • form t s) := by
  13. intro i j
  14. fin_cases i <;> fin_cases j <;>
  15. simp [form,Matrix.smul_apply,smul_eq_mul] <;>
  16. first | exact hc | exact ht | exact hq | exact hs | exact ⟨0,by norm_num⟩
  17. theorem axial_description (c : ℚ) (t : ℚˣ) (z : ℤ) :
  18. z ∈ AxialImage (c • conjugate t) axis ↔ ∃ a : ℤ, c*(a:ℚ)=z := by
  19. constructor
  20. · rintro ⟨v,hv,he⟩
  21. obtain ⟨a,ha⟩ := hv 1
  22. refine ⟨a,?_⟩
  23. rw [Matrix.smul_mulVec,conjugate,form_vec] at he
  24. have h0 := congrFun he 0
  25. change c*v 1=(z:ℚ)*1 at h0
  26. rwa [ha,mul_one] at *
  27. · rintro ⟨a,ha⟩
  28. let v : Vec 6 := ![0,(a:ℚ),0,0,0,0]
  29. refine ⟨v,?_,?_⟩
  30. · intro i; fin_cases i <;> first | exact ⟨a,rfl⟩ | exact ⟨0,rfl⟩
  31. · rw [Matrix.smul_mulVec,conjugate,form_vec]
  32. funext i; fin_cases i <;> simp [v,axis,ha]
  33. private theorem hit {t : ℚˣ} {p : ℕ} (hp : 0<p) (ht : (t:ℚ)=p) {c : ℚ}
  34. (hc : Normalized (conjugate t) c) (hclear : IntegralMat ((p:ℚ) • conjugate t)) :
  35. (p:ℤ) ∈ AxialImage (c • conjugate t) axis := by
  36. obtain ⟨a,ha⟩ := (scale_entries hc.2.1).2.2.2
  37. rw [Units.val_inv_eq_inv_val,ht] at ha
  38. have pp : (0:ℚ)<p := by exact_mod_cast hp
  39. have he : (a:ℚ)*p=c := by
  40. calc
  41. _ = (c*(p:ℚ)⁻¹)*p := by rw [ha]
  42. _ = c := by field_simp
  43. have hb := hc.2.2 p pp.ne' hclear
  44. rw [abs_of_pos pp,← he,abs_mul,abs_of_pos pp] at hb
  45. have hab : |(a:ℚ)| ≤ 1 := by nlinarith
  46. have hai : |a| ≤ 1 := by exact_mod_cast hab
  47. have han : a ≠ 0 := by intro hz; apply hc.1; simpa [hz] using he.symm
  48. have hpm : a=1 ∨ a = -1 := by
  49. have h := abs_le.mp hai; omega
  50. apply (axial_description _ _ _).mpr
  51. rcases hpm with h|h
  52. · exact ⟨1,by simpa [h] using he.symm⟩
  53. · refine ⟨-1,?_⟩; rw [←he,h]; push_cast; ring
  54. def u2 : ℚˣ := Units.mk0 2 (by norm_num)
  55. def u7 : ℚˣ := Units.mk0 7 (by norm_num)
  56. private theorem clear2 : IntegralMat ((2:ℚ) • conjugate u2) := by
  57. apply integral_form
  58. · exact ⟨2,by norm_num⟩
  59. · exact ⟨4,by norm_num [u2]⟩
  60. · exact ⟨0,by norm_num [u2]⟩
  61. · exact ⟨1,by norm_num [u2]⟩
  62. private theorem clear7 : IntegralMat ((7:ℚ) • conjugate u7) := by
  63. apply integral_form
  64. · exact ⟨7,by norm_num⟩
  65. · exact ⟨49,by norm_num [u7]⟩
  66. · exact ⟨7,by norm_num [u7]⟩
  67. · exact ⟨1,by norm_num [u7]⟩
  68. theorem no_one {c : ℚ} {t : ℚˣ} (hc : IntegralMat (c • conjugate t)) :
  69. (1:ℤ) ∉ AxialImage (c • conjugate t) axis := by
  70. intro h
  71. obtain ⟨a,ha⟩ := (axial_description _ _ _).mp h
  72. obtain ⟨⟨b,hb⟩,ht,hshift,hinv⟩ := scale_entries hc
  73. have hac : b*a=1 := by exact_mod_cast (show (b:ℚ)*(a:ℚ)=1 by rw [hb]; exact ha)
  74. have hunit : c=1 ∨ c = -1 := by
  75. rcases Int.eq_one_or_neg_one_of_mul_eq_one hac with e|e <;> simp [←hb,e]
  76. have unscale (q : ℚ) (hiq : Integral (c*q)) : Integral q := by
  77. rcases hunit with he|he
  78. · simpa [he] using hiq
  79. · simpa [he] using hiq.neg
  80. obtain ⟨v,hv⟩ := unscale _ ht
  81. obtain ⟨w,hw⟩ := unscale _ hinv
  82. obtain ⟨z,hz⟩ := unscale _ hshift
  83. have hvw : v*w=1 := by exact_mod_cast (show (v:ℚ)*(w:ℚ)=1 by rw [hv,hw]; exact t.mul_inv)
  84. rw [←hv] at hz
  85. have e : 5*z=v-2 := by exact_mod_cast (show 5*(z:ℚ)=(v:ℚ)-2 by linarith)
  86. rcases Int.eq_one_or_neg_one_of_mul_eq_one hvw with hh|hh <;> omega
  87. theorem not_subgroup (scale : ℚˣ → ℚ) (hn : ∀t,Normalized (conjugate t) (scale t)) :
  88. ¬ ∃ H : AddSubgroup ℤ, (H:Set ℤ)=AxialUnion conjugate scale axis := by
  89. rintro ⟨H,hH⟩
  90. have htwo : (2:ℤ)∈H := by
  91. change (2:ℤ)∈(H:Set ℤ); rw [hH]
  92. exact ⟨u2,hit (p:=2) (by decide) rfl (hn u2) clear2⟩
  93. have hseven : (7:ℤ)∈H := by
  94. change (7:ℤ)∈(H:Set ℤ); rw [hH]
  95. exact ⟨u7,hit (p:=7) (by decide) rfl (hn u7) clear7⟩
  96. have hone : (1:ℤ)∈H := by
  97. convert H.sub_mem hseven (H.add_mem htwo (H.add_mem htwo htwo)) using 1
  98. change (1:ℤ)∈(H:Set ℤ) at hone
  99. rw [hH] at hone
  100. obtain ⟨t,ht⟩ := hone
  101. exact no_one (hn t).2.1 ht
  102. theorem counterexample :
  103. ∃ scale : ℚˣ → ℚ, (∀t, Normalized (conjugate t) (scale t)) ∧
  104. ¬ ∃ H : AddSubgroup ℤ, (H:Set ℤ)=AxialUnion conjugate scale axis := by
  105. choose scale h using fun t : ℚˣ => exists_normalized_of_one (conjugate t) 0 1 rfl
  106. exact ⟨scale,h,not_subgroup scale h⟩
  107. #print axioms counterexample
  108. end
  109. end Axial.Multiplicative