Lean / janjarosz05/0kwas / Erdos1094Split.lean
Lean reader

Kwas/Erdos1094Split.lean

22 lines3 declarationsno sorryimports Kwas.Erdos1094Classify

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

  1. import Kwas.Erdos1094Classify
  2. /-! Erdős Problem 1094: the finite check of `Erdos1094Classify` split into parts with a fixed cofactor, so that
  3. the kernel evaluates each part separately (continues namespace Erdos1093). -/
  4. namespace Erdos1093
  5. /-- the check of `chk` restricted to the divisors `c * d`, `d ∈ divs l` -/
  6. def chkM (ps : List ℕ) (c : ℕ) (l : List (ℕ × ℕ)) (k : ℕ) (known : List ℕ) : Bool :=
  7. (divs l).all fun d => (List.range k).all fun i =>
  8. ((c * d) % k != 0) || decide (c * d + i < 2 * k) || known.contains (c * d + i) || killB ps (c * d + i) k
  9. theorem chkM_one (ps : List ℕ) (l : List (ℕ × ℕ)) (k : ℕ) (known : List ℕ) :
  10. chkM ps 1 l k known = chk ps l k known := by
  11. simp [chkM, chk]
  12. theorem chkM_cons (ps : List ℕ) (c p e : ℕ) (t : List (ℕ × ℕ)) (k : ℕ) (known : List ℕ) :
  13. chkM ps c ((p, e) :: t) k known = (List.range (e + 1)).all fun j => chkM ps (c * p ^ j) t k known := by
  14. simp only [chkM, divs, List.all_flatMap, List.all_map, Function.comp_def, mul_assoc]
  15. end Erdos1093