/- Research programme 0026 -- route 176 / return #2039 follow-up. The route-107 defect object F(h) of the served engine `outputs/job2038/def.c`, certified in exact rational arithmetic with no `sorry`. nu_p(h) = #{0, 2, h, h+2 mod p} (distinct residues mod p) f_p(h) = (1 - nu_p(h)/p) / (1 - 2/p)^2 head(h) = prod_{3<=p<=h+2} f_p(h) head(6) = 7/5 T(h) = prod_{8 inWin h p)).map (fun p => f p h)).prod def tailT (h : Nat) : Rat := ((primes.filter (fun p => inTail h p)).map (fun p => (((p : Rat) - 1) / ((p : Rat) - 2)))).prod /-- The defect value: the identity that replaces the (false) divisor form. -/ def Fval (h : Nat) : Rat := (25 / 21 : Rat) * head h * tailT h theorem head_six : head 6 = ((7 : Rat) / 5) := by native_decide theorem anchor_six : Fval 6 = ((5 : Rat) / 3) := by native_decide theorem anchor_twelve : Fval 12 = ((145600 : Rat) / 29403) := by native_decide theorem anchor_thirty : Fval 30 = ((89086806016000 : Rat) / 9945797677893) := by native_decide theorem anchor_fortyeight : Fval 48 = ((155478051278362247168 : Rat) / 30162390056072659035) := by native_decide /-- `F(h) = 0` exactly on `h = +-2 (mod 3)`, checked on `[4, 400]`. -/ theorem support_window : (List.range (400 + 1)).filter (fun h => decide (4 <= h && Fval h = 0)) = (List.range (400 + 1)).filter (fun h => decide (4 <= h && h % 3 != 0)) := by native_decide /-! ## The counterexample to the divisor form of return #2039 -/ /-- The served form: `F(h)/F(6) = prod_{p | h(h-2)(h+2), p >= 3} (p-1)/(p-2) / 2`, i.e. `F_served(h) = (5/3) * prod / 2` because the return fixes `F(6) = 5/3`. -/ def isDiv (p h : Nat) : Bool := h % p == 0 def servedRatio (h : Nat) : Rat := ((primes.filter (fun p => decide (3 <= p && p <= h + 2 && (isDiv p h || isDiv p (h + p - 2) || isDiv p (h + 2))))).map (fun p => (((p : Rat) - 1) / ((p : Rat) - 2)))).prod def servedF (h : Nat) : Rat := (5 / 3 : Rat) * servedRatio h / 2 theorem served_ratio_twelve : servedRatio 12 = ((16 : Rat) / 5) := by native_decide theorem served_twelve : servedF 12 = ((8 : Rat) / 3) := by native_decide theorem true_twelve : Fval 12 = ((145600 : Rat) / 29403) := by native_decide /-- **The counterexample.** The served divisor form and the definition disagree at `h = 12`, so the divisor identity asserted by return #2039 is false. -/ theorem divisor_form_false : servedF 12 != Fval 12 := by native_decide end Route176