Lean / Reader
Lean reader

AxialSource.lean

68 lines6 declarationsno sorryimports AxialScale AxialAdditive

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

  1. import AxialScale
  2. import AxialAdditive
  3. namespace Axial
  4. /-- Entrywise integrality is exactly preservation of the standard integer lattice. -/
  5. theorem integralMat_iff_maps_lattice {n : ℕ} (A : Mat n) :
  6. IntegralMat A ↔ ∀ v : Vec n, IntegralVec v → IntegralVec (A.mulVec v) := by
  7. refine ⟨fun h _ hv => h.mulVec hv,?_⟩
  8. intro h i j
  9. let v : Vec n := fun k => if k=j then 1 else 0
  10. have hv : IntegralVec v := by
  11. intro k; by_cases hk : k=j <;> simp [v,hk,Integral.zero,Integral.one]
  12. have hi := h v hv i
  13. simpa [v,Matrix.mulVec,dotProduct,mul_ite] using hi
  14. theorem exists_normalized {n : ℕ} (A : Mat n) (hA : A ≠ 0) :
  15. ∃ t : ℚ, Normalized A t := by
  16. have he : ∃ i j, A i j ≠ 0 := by
  17. by_contra! h; apply hA; ext i j; exact h i j
  18. obtain ⟨i,j,ha⟩ := he
  19. let a := A i j
  20. have hass : a ≠ 0 := ha
  21. obtain ⟨s,hs⟩ := exists_normalized_of_one (a⁻¹ • A) i j (by
  22. change a⁻¹*a=1; exact inv_mul_cancel₀ hass)
  23. refine ⟨s/a,div_ne_zero hs.1 hass,?_,?_⟩
  24. · simpa only [smul_smul,div_eq_mul_inv] using hs.2.1
  25. · intro u hu hmat
  26. have hi : IntegralMat ((u*a) • (a⁻¹ • A)) := by
  27. simpa only [smul_smul,mul_assoc,mul_inv_cancel₀ hass,mul_one] using hmat
  28. have hmin := hs.2.2 _ (mul_ne_zero hu hass) hi
  29. rw [abs_div, div_le_iff₀ (abs_pos.mpr hass),←abs_mul]
  30. exact hmin
  31. theorem AdditiveAction.conjugate_ne_zero {n : ℕ} (g : AdditiveAction n) (A : Mat n)
  32. (hn : A ≠ 0) (s : ℚ) : g.conjugate A s ≠ 0 := by
  33. intro h
  34. have hinv : g.matrix s * g.matrix (-s) = 1 := by rw [←g.at_add,add_neg_cancel,g.at_zero]
  35. apply hn
  36. have he := congrArg (fun M : Mat n => g.matrix s*M*g.matrix (-s)) h
  37. simp [conjugate,←Matrix.mul_assoc,hinv] at he
  38. simpa [Matrix.mul_assoc,hinv] using he
  39. theorem AdditiveAction.exists_scale {n : ℕ} (g : AdditiveAction n) (A : Mat n) (hn : A ≠ 0) :
  40. ∃ scale : ℚ → ℚ, ∀ s, Normalized (g.conjugate A s) (scale s) :=
  41. Classical.axiomOfChoice fun s => exists_normalized _ (g.conjugate_ne_zero A hn s)
  42. theorem zero_axial {n : ℕ} (axis : Vec n) (ha : axis ≠ 0) :
  43. AxialImage (0 : Mat n) axis = {0} := by
  44. ext z; constructor
  45. · rintro ⟨v,hv,he⟩
  46. simp only [Matrix.zero_mulVec,eq_comm (a := (0 : Vec n)),smul_eq_zero,ha,or_false,
  47. Int.cast_eq_zero] at he
  48. exact he
  49. · rintro rfl; use 0
  50. exact ⟨fun _ => Integral.zero,by simp⟩
  51. theorem no_minimum_at_zero {n : ℕ} (t : ℚ) : ¬ Normalized (0 : Mat n) t := by
  52. intro ht
  53. have hi : IntegralMat ((t/2) • (0:Mat n)) := by
  54. simp only [smul_zero]; exact fun _ _ => Integral.zero
  55. have h := ht.2.2 _ (div_ne_zero ht.1 (by norm_num)) hi
  56. rw [abs_div,abs_of_pos (by norm_num : (0:ℚ)<2)] at h
  57. have := abs_pos.mpr ht.1
  58. linarith
  59. end Axial