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