Lean / Reader
Lean readerErdos824Examples.lean
Lean 4 Web has Mathlib, so it can check files that import only Mathlib. This one also imports Erdos824Grading, which it does not have: you can read it there, but it will not check. Build the project itself to check it.
import Erdos824Gradingnamespace Erdos824Witnessesset_option maxRecDepth 100000set_option maxHeartbeats 4000000def left1 : List ℕ := [15809, 196307, 3672041, 6025967, 23518013]private theorem left1_good : GoodFactors left1 := byunfold left1refine ⟨by norm_num1, by decide, ?_⟩refine ⟨by norm_num1, by decide, ?_⟩refine ⟨by norm_num1, by decide, ?_⟩refine ⟨by norm_num1, by decide, ?_⟩refine ⟨by norm_num1, by decide, ?_⟩trivialdef right1 : List ℕ := [21089, 158507, 2776421, 6677423, 26060501]private theorem right1_good : GoodFactors right1 := byunfold right1refine ⟨by norm_num1, by decide, ?_⟩refine ⟨by norm_num1, by decide, ?_⟩refine ⟨by norm_num1, by decide, ?_⟩refine ⟨by norm_num1, by decide, ?_⟩refine ⟨by norm_num1, by decide, ?_⟩trivialtheorem example1 : pairAt left1.prod right1.prod :=certify left1_good right1_good (by decide) (by decide) (by decide) (by decide) (by decide) (by decide)#print axioms example1def left2 : List ℕ := [136879, 7065953, 1308911, 19052617, 27245893, 17823241, 62648161, 10560617, 95697451, 106974563, 260685587, 284053817, 335983217]private theorem left2_good : GoodFactors left2 := byunfold left2refine ⟨by norm_num1, by decide, ?_⟩refine ⟨by norm_num1, by decide, ?_⟩refine ⟨by norm_num1, by decide, ?_⟩refine ⟨by norm_num1, by decide, ?_⟩refine ⟨by norm_num1, by decide, ?_⟩refine ⟨by norm_num1, by decide, ?_⟩refine ⟨by norm_num1, by decide, ?_⟩refine ⟨by norm_num1, by decide, ?_⟩refine ⟨by norm_num1, by decide, ?_⟩refine ⟨by norm_num1, by decide, ?_⟩refine ⟨by norm_num1, by decide, ?_⟩refine ⟨by norm_num1, by decide, ?_⟩refine ⟨by norm_num1, by decide, ?_⟩trivialdef right2 : List ℕ := [151279, 6018137, 1152623, 23257753, 33259381, 16528657, 58097737, 9692621, 87831907, 109987931, 268028843, 292055333, 345447533]private theorem right2_good : GoodFactors right2 := byunfold right2refine ⟨by norm_num1, by decide, ?_⟩refine ⟨by norm_num1, by decide, ?_⟩refine ⟨by norm_num1, by decide, ?_⟩refine ⟨by norm_num1, by decide, ?_⟩refine ⟨by norm_num1, by decide, ?_⟩refine ⟨by norm_num1, by decide, ?_⟩refine ⟨by norm_num1, by decide, ?_⟩refine ⟨by norm_num1, by decide, ?_⟩refine ⟨by norm_num1, by decide, ?_⟩refine ⟨by norm_num1, by decide, ?_⟩refine ⟨by norm_num1, by decide, ?_⟩refine ⟨by norm_num1, by decide, ?_⟩refine ⟨by norm_num1, by decide, ?_⟩trivialprivate def marks2 : List (ℕ × ℕ) := [(5, 7), (13, 10), (17, 12), (19, 12), (23, 11), (29, 7), (41, 11), (61, 6), (67, 1), (71, 3), (73, 2)]theorem example2 : pairAt left2.prod right2.prod := byhave hp : marks2.all (fun q => decide (Nat.Prime q.1)) = true := by decidehave hl := Erdos824Grading.gradeTest_sound (k:=left2.length) (c:=1) (ps:=left2) hp (by decide)have hr := Erdos824Grading.gradeTest_sound (k:=left2.length) (c:=0) (ps:=right2) hp (by decide)refine ⟨by decide, by decide, by decide, by decide, squarefree_prod left2_good,squarefree_prod right2_good, ?_, ?_⟩· rw [sigma_product left2_good,sigma_product right2_good]decide· exact proper_of_common left2_good right2_good fun _ hu hv =>Erdos824Grading.grading_excludes_partial marks2 hl hr hu hv#print axioms example2theorem example1_sum : ArithmeticFunction.sigma 1 left1.prod = 1615120665430338480476646904320 := byrw [sigma_product left1_good]decidetheorem example_sizes :(values left1).length = 32 ∧ (values right1).length = 32 ∧(values left2).length = 8192 ∧ (values right2).length = 8192 ∧10^30 ≤ max left1.prod right1.prod ∧ max left1.prod right1.prod < 10^31 ∧10^96 ≤ max left2.prod right2.prod ∧ max left2.prod right2.prod < 10^97 := byhave length_values (ps : List ℕ) : (values ps).length = 2 ^ ps.length := byinduction ps with| nil => simp [values]| cons h t ih => simp [values, ih, pow_succ, Nat.mul_two]simp only [length_values]decide#print axioms example1_sum#print axioms example_sizesend Erdos824Witnesses