Lean / Reader
Lean reader

Bruhat6.lean

119 lines22 declarationsno sorryimports Mathlib.Data.Real.Basic Mathlib.Tactic.NormNum Mathlib.Tactic.Ring Mathlib.Tactic.Linarith Mathlib.Tactic.Positivity Mathlib.Data.Nat.Choose.Basic
  1. import Mathlib.Data.Real.Basic
  2. import Mathlib.Tactic.NormNum
  3. import Mathlib.Tactic.Ring
  4. import Mathlib.Tactic.Linarith
  5. import Mathlib.Tactic.Positivity
  6. import Mathlib.Data.Nat.Choose.Basic
  7. namespace Bruhat6
  8. def lowerWord : List Nat := [2,3,4,2,3,0]
  9. def upperWord : List Nat := [2,3,4,0,1,2,3]
  10. def lowerRow : List Nat := [1,81,512,592,131,3]
  11. def upperRow : List Nat := [1,698,13492,44537,34836,6086,135]
  12. def exchange {α : Type} [Inhabited α] (x : List α) (i j : Nat) : List α :=
  13. (x.set i x[j]!).set j x[i]!
  14. def permutation (w : List Nat) := w.foldl (fun x i => exchange x i (i+1)) (List.range 6)
  15. def inversions (w : List Nat) : Nat :=
  16. ((List.range 6).map (fun i => ((List.range 6).filter (fun j => i < j && w[i]! > w[j]!)).length)).foldl (·+·) 0
  17. theorem strong_cover_data :
  18. permutation lowerWord = [1,0,4,5,3,2] ∧ permutation upperWord = [1,3,4,5,0,2] ∧
  19. exchange (permutation lowerWord) 1 4 = permutation upperWord ∧
  20. inversions (permutation lowerWord) = lowerWord.length ∧
  21. inversions (permutation upperWord) = upperWord.length ∧
  22. upperWord.length = lowerWord.length + 1 := by decide
  23. def keyEval (j : Nat) : List Nat → List Int → Int
  24. | [], x => x[0]!^(5*j) * x[1]!^(4*j) * x[2]!^(3*j) * x[3]!^(2*j) * x[4]!^j
  25. | i::w, x =>
  26. (x[i]! * keyEval j w x - x[i+1]! * keyEval j w (exchange x i (i+1))) /
  27. (x[i]! - x[i+1]!)
  28. def modulus : Nat := 2^64
  29. def specialized (w : List Nat) (j : Nat) : Int :=
  30. (keyEval j w ((List.range 6).map fun i => (1+(i+1)*modulus : Nat))) % (modulus : Int)
  31. def predicted (row : List Nat) (d j : Nat) :=
  32. ((List.range row.length).map (fun h => if h ≤ j then row[h]! * (j+d-h).choose d else 0)).foldl (·+·) 0
  33. def checks (w row : List Nat) : Bool :=
  34. (List.range (w.length+2)).all fun j =>
  35. (2*(15*j+1)^w.length < modulus) &&
  36. (2*predicted row w.length j < modulus) &&
  37. (specialized w j == (predicted row w.length j : Int))
  38. set_option maxRecDepth 100000 in
  39. set_option maxHeartbeats 0 in
  40. theorem coefficient_transcripts : checks lowerWord lowerRow ∧ checks upperWord upperRow := by decide
  41. noncomputable def P (x : ℝ) :=
  42. 1 + x*(81 + x*(512 + x*(592 + x*(131 + x*3))))
  43. noncomputable def Q (x : ℝ) :=
  44. 1 + x*(698 + x*(13492 + x*(44537 + x*(34836 + x*(6086 + x*135)))))
  45. /-- Alternating real linear factors in degrees five and six, with positive leading coefficients. -/
  46. def Interlaces56 (f g : ℝ → ℝ) : Prop :=
  47. ∃ (b₀ b₁ b₂ b₃ b₄ b₅ a₀ a₁ a₂ a₃ a₄ k l : ℝ),
  48. b₀ ≤ a₀ ∧ a₀ ≤ b₁ ∧ b₁ ≤ a₁ ∧ a₁ ≤ b₂ ∧ b₂ ≤ a₂ ∧ a₂ ≤ b₃ ∧
  49. b₃ ≤ a₃ ∧ a₃ ≤ b₄ ∧ b₄ ≤ a₄ ∧ a₄ ≤ b₅ ∧ 0 < k ∧ 0 < l ∧
  50. (∀ x, f x = k*(x-a₀)*(x-a₁)*(x-a₂)*(x-a₃)*(x-a₄)) ∧
  51. (∀ x, g x = l*(x-b₀)*(x-b₁)*(x-b₂)*(x-b₃)*(x-b₄)*(x-b₅))
  52. theorem Q_positive_left (x : ℝ) (hx : x ≤ -116/3) : 0 < Q x := by
  53. let u := -116 - 3*x
  54. have hu : 0 ≤ u := by dsimp [u]; linarith
  55. have h : (729:ℝ)*Q x =
  56. 338723068929 + u*(2392665031554 + u*(106561375584 + u*(1901895357 +
  57. u*(16972284 + u*(75702 + u*135))))) := by dsimp [Q,u]; ring
  58. have hpos : (0:ℝ) < 338723068929 + u*(2392665031554 + u*(106561375584 +
  59. u*(1901895357 + u*(16972284 + u*(75702 + u*135))))) := by positivity
  60. linarith only [h,hpos]
  61. theorem numerators_do_not_interlace : ¬ Interlaces56 P Q := by
  62. rintro ⟨b₀,b₁,b₂,b₃,b₄,b₅,a₀,a₁,a₂,a₃,a₄,k,l,h₀,h₁,h₂,h₃,h₄,h₅,h₆,h₇,h₈,_,hk,_,hp,hq⟩
  63. have hzero : Q b₀ = 0 := by simpa using hq b₀
  64. have hleft : (-116:ℝ)/3 < b₀ := by
  65. by_contra! h
  66. exact (ne_of_gt (Q_positive_left b₀ h)) hzero
  67. let r : ℝ := -116/3
  68. have j₀ : 0 < a₀-r := by dsimp [r]; linarith
  69. have j₁ : 0 < a₁-r := by dsimp [r]; linarith
  70. have j₂ : 0 < a₂-r := by dsimp [r]; linarith
  71. have j₃ : 0 < a₃-r := by dsimp [r]; linarith
  72. have j₄ : 0 < a₄-r := by dsimp [r]; linarith
  73. have hprod : 0 < k*(a₀-r)*(a₁-r)*(a₂-r)*(a₃-r)*(a₄-r) := by positivity
  74. have hneg : P r = -(k*(a₀-r)*(a₁-r)*(a₂-r)*(a₃-r)*(a₄-r)) := by
  75. rw [hp]; ring
  76. have hval : 0 < P r := by norm_num [P,r]
  77. linarith only [hprod,hneg,hval]
  78. noncomputable def rowAt (row : List Nat) (x : ℝ) :=
  79. row.foldr (fun (a : Nat) (s : ℝ) => (a:ℝ)+x*s) 0
  80. def ReducedSix (w : List Nat) : Prop :=
  81. (w.all (fun i => i < 5)) ∧ inversions (permutation w) = w.length
  82. /-- A restricted universal consequence of Conjecture 6.4, negated by the witness.
  83. The interpretation of the finite coefficient transcript uses the degree and
  84. magnitude bounds described in the accompanying proof. -/
  85. theorem not_every_certified_cover_interlaces :
  86. ¬ (∀ (u v p q : List Nat), ReducedSix u → ReducedSix v →
  87. (∃ i j : Fin 6, exchange (permutation u) i j = permutation v) →
  88. v.length = u.length+1 → checks u p → checks v q →
  89. p.length = 6 → q.length = 7 → Interlaces56 (rowAt p) (rowAt q)) := by
  90. intro h
  91. have bad := h lowerWord upperWord lowerRow upperRow (by unfold ReducedSix; decide) (by unfold ReducedSix; decide)
  92. ⟨1,4,by decide⟩ (by decide) coefficient_transcripts.1 coefficient_transcripts.2 rfl rfl
  93. have hp : rowAt lowerRow = P := by funext x; simp [rowAt,lowerRow,P]
  94. have hq : rowAt upperRow = Q := by funext x; simp [rowAt,upperRow,Q]
  95. rw [hp,hq] at bad
  96. exact numerators_do_not_interlace bad
  97. end Bruhat6
  98. #print axioms Bruhat6.not_every_certified_cover_interlaces