Lean / Reader
Lean reader

TriangleCounterexample.lean

52 lines7 declarationsno sorryimports TriangleCertificate TriangleSequence TriangleFit

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

  1. import TriangleCertificate
  2. import TriangleSequence
  3. import TriangleFit
  4. namespace HuberTriangle
  5. private theorem agree (s : ℕ → Triple) (hs : SourceSequence s) (n : ℕ) (hn : n ≤ 94) :
  6. s n = greedyRow n := by
  7. induction n with
  8. | zero => exact hs.1.trans prefix0.symm
  9. | succ i ih =>
  10. have h := hs.2 i
  11. rw [ih (by omega)] at h
  12. have g := prefix_step i (by omega)
  13. exact (g.2.2 _ h.1 h.2.1).resolve_right
  14. (h.2.2 _ g.1 g.2.1)
  15. def semiperimeter (t : Triple) : ℕ := perimeter t / 2
  16. def countertriangle : Triple := ⟨5676,6307,8485⟩
  17. /-- Statement of Huber’s geometric conjecture for the sequence s.
  18. The index i is the zero-based index of the enclosed triangle. -/
  19. def SourceConjecture (s : ℕ → Triple) : Prop :=
  20. ∀ i t, Primitive t → semiperimeter t < semiperimeter (s (i+1)) →
  21. ¬ TriangleFit.fits (s i).x (s i).y t.x t.y
  22. /-- The explicit witness refutes the geometric prediction at source index 95,
  23. regardless of how ambiguities in the selection rule are broken. -/
  24. theorem counterexample_at_95 (s : ℕ → Triple) (hs : SourceSequence s) :
  25. s 93 = ⟨5445,6308,8333⟩ ∧ s 94 = ⟨5568,6545,8593⟩ ∧
  26. Primitive countertriangle ∧ semiperimeter countertriangle = 10234 ∧
  27. semiperimeter (s 94) = 10353 ∧
  28. TriangleFit.fits (s 93).x (s 93).y countertriangle.x countertriangle.y := by
  29. have ha := (agree s hs 93 (by decide)).trans prefix93
  30. have hb := (agree s hs 94 (by decide)).trans prefix94
  31. refine ⟨ha,hb,by decide +kernel,by decide +kernel,?_,?_⟩
  32. · rw [hb]; decide +kernel
  33. · rw [ha]; exact TriangleFit.pythagorean_triangle_fits
  34. theorem refutes_geometric_conjecture {s : ℕ → Triple} (hs : SourceSequence s) :
  35. ¬ SourceConjecture s := by
  36. obtain ⟨_,_,hc,hp,hq,hfit⟩ := counterexample_at_95 s hs
  37. intro claim
  38. exact claim 93 countertriangle hc (show semiperimeter countertriangle < semiperimeter (s 94) by omega) hfit
  39. theorem source_conjecture_false : ¬ SourceConjecture sourceRow :=
  40. refutes_geometric_conjecture sourceRow_valid
  41. #print axioms source_conjecture_false
  42. end HuberTriangle