Lean / Reader
Lean reader

Morse785.lean

39 lines6 declarationsno sorry
  1. import MorseCert
  2. namespace Morse785
  3. theorem recover (n r : ℕ) (e : lookup (row (2*n)) 0 = r) (hr : r<modulus) :
  4. link n % modulus = r := by
  5. have c : walks (2*n) 0 % modulus = lookup (row (2*n)) 0 % modulus :=
  6. (correct (2*n) 0 (by decide)).symm
  7. exact c.trans ((congrArg (fun x => x % modulus) e).trans (Nat.mod_eq_of_lt hr))
  8. theorem residue : link 785 % modulus = 7812500 :=
  9. recover 785 7812500 finite_calculation (by decide)
  10. def exactFive (v n : ℕ) : Prop := 5^v ∣ n ∧ ¬5^(v+1) ∣ n
  11. /-- The 5-adic formula, with the printed center scaled by its unit denominator 4. -/
  12. def conjecture : Prop := ∀ n : ℕ, 4 ≤ n →
  13. (Even n → exactFive 2 (link n)) ∧
  14. (Odd n → ∀ v : ℕ, exactFive v (4*n-15) → exactFive (v+3) (link n))
  15. theorem actual_valuation : exactFive 9 (link 785) := by
  16. have c : link 785 ≡ 7812500 [MOD modulus] := residue
  17. constructor
  18. · apply Nat.modEq_zero_iff_dvd.mp
  19. exact (c.of_dvd (by decide : 5^9 ∣ modulus)).trans (by decide)
  20. · intro h
  21. have h0 := Nat.modEq_zero_iff_dvd.mpr h
  22. have bad := c.symm.trans h0
  23. exact (by decide : ¬ 7812500 ≡ 0 [MOD modulus]) bad
  24. theorem not_conjecture : ¬conjecture := by
  25. intro h
  26. have got := (h 785 (by decide)).2 (by decide) 5 (by unfold exactFive; decide)
  27. exact got.2 actual_valuation.1
  28. end Morse785
  29. #print axioms Morse785.not_conjecture