Lean / Reader
Lean reader

SquarePencilReduction.lean

92 lines3 declarationsno sorryimports Mathlib.Algebra.MvPolynomial.Funext Mathlib.RingTheory.MvPolynomial.Symmetric.Defs Mathlib.Order.Interval.Set.Infinite Mathlib.Tactic
  1. import Mathlib.Algebra.MvPolynomial.Funext
  2. import Mathlib.RingTheory.MvPolynomial.Symmetric.Defs
  3. import Mathlib.Order.Interval.Set.Infinite
  4. import Mathlib.Tactic
  5. /-!
  6. # Specializing a symmetric square pencil to one variable
  7. A nonzero rational polynomial can be kept nonzero while all but one of its
  8. variables are specialized to distinct rational numbers. The four fixed
  9. variables and the remaining free one then produce the five square identities.
  10. -/
  11. namespace SquarePencil
  12. open MvPolynomial
  13. private theorem exists_distinct_specialization {n : ℕ}
  14. {p : MvPolynomial (Fin n) ℚ} (hp : p ≠ 0) :
  15. ∃ c : Fin n → ℚ, Function.Injective c ∧ eval c p ≠ 0 := by
  16. classical
  17. let box (i : Fin n) := Set.Ioo (i.val : ℚ) (i.val+1 : ℚ)
  18. have hbox (i : Fin n) : (box i).Infinite := Set.Ioo_infinite (by linarith)
  19. by_contra! no_point
  20. apply hp
  21. apply MvPolynomial.funext_set box hbox
  22. intro c hc
  23. have hc' (i : Fin n) : (i.val : ℚ) < c i ∧ c i < (i.val : ℚ)+1 := hc i (Set.mem_univ i)
  24. have hstrict : StrictMono c := by
  25. intro i j hij
  26. have hs : (i.val : ℚ)+1 ≤ (j.val : ℚ) := by exact_mod_cast hij
  27. exact ((hc' i).2.trans_le hs).trans (hc' j).1
  28. simpa using no_point c hstrict.injective
  29. private theorem square_at_every_index {n : ℕ} (i₀ : Fin n)
  30. (S₁ S₂ P : MvPolynomial (Fin n) ℚ)
  31. (h₁ : S₁.IsSymmetric) (h₂ : S₂.IsSymmetric)
  32. (hP : P^2 = S₁ + X i₀ * S₂) (i : Fin n) :
  33. ∃ Q : MvPolynomial (Fin n) ℚ, Q^2 = S₁ + X i * S₂ := by
  34. classical
  35. let e := Equiv.swap i₀ i
  36. refine ⟨rename e P, ?_⟩
  37. simpa only [map_pow, map_add, map_mul, rename_X, h₁ e, h₂ e,
  38. e, Equiv.swap_apply_left] using congrArg (rename (R := ℚ) e) hP
  39. /-- Every nondegenerate symmetric example in n > 4 variables gives a
  40. one-variable example with four distinct fixed rational parameters. -/
  41. theorem exists_five {n : ℕ} (hn : 4 < n) (i₀ : Fin n)
  42. (S₁ S₂ P : MvPolynomial (Fin n) ℚ)
  43. (h₁ : S₁.IsSymmetric) (h₂ : S₂.IsSymmetric) (hnz : S₂ ≠ 0)
  44. (hP : P^2 = S₁ + X i₀ * S₂) :
  45. ∃ (A B : Polynomial ℚ) (c : Fin 4 → ℚ) (y : Fin 4 → Polynomial ℚ) (z : Polynomial ℚ),
  46. B ≠ 0 ∧ Function.Injective c ∧
  47. (∀ i, y i ^ 2 = A + Polynomial.C (c i) * B) ∧ z ^ 2 = A + Polynomial.X * B := by
  48. classical
  49. obtain ⟨v,hv,hvB⟩ := exists_distinct_specialization hnz
  50. choose Q hQ using square_at_every_index i₀ S₁ S₂ P h₁ h₂ hP
  51. let f : Fin n := ⟨4,hn⟩
  52. let ι (i : Fin 4) : Fin n := ⟨i.val,by omega⟩
  53. let g (i : Fin n) : Polynomial ℚ := if i = f then Polynomial.X else Polynomial.C (v i)
  54. let φ := eval₂Hom Polynomial.C g
  55. have hrecover (p : MvPolynomial (Fin n) ℚ) :
  56. Polynomial.eval (v f) (φ p) = eval v p := by
  57. change Polynomial.eval (v f) (eval₂ Polynomial.C g p) = _
  58. rw [polynomial_eval_eval₂]
  59. have hc : (Polynomial.evalRingHom (v f)).comp Polynomial.C = RingHom.id ℚ := by
  60. ext; simp
  61. rw [hc]
  62. have hg : (fun i => Polynomial.eval (v f) (g i)) = v := by
  63. funext i
  64. by_cases h : i=f <;> simp [g,h]
  65. rw [hg,eval₂_id]
  66. refine ⟨φ S₁,φ S₂,fun i => v (ι i),fun i => φ (Q (ι i)),φ (Q f),?_,?_,?_,?_⟩
  67. · intro he
  68. apply hvB
  69. rw [← hrecover,he,Polynomial.eval_zero]
  70. · apply hv.comp
  71. intro i j hij
  72. exact Fin.ext (congrArg (Fin.val : Fin n → ℕ) hij)
  73. · intro i
  74. have h : ι i ≠ f := by
  75. intro he
  76. have := congrArg Fin.val he
  77. dsimp [ι,f] at this
  78. omega
  79. simpa only [map_pow,map_add,map_mul,φ,eval₂Hom_X',g,if_neg h] using congrArg φ (hQ (ι i))
  80. · simpa only [map_pow,map_add,map_mul,φ,eval₂Hom_X',g,if_pos rfl] using congrArg φ (hQ f)
  81. #print axioms exists_five
  82. end SquarePencil