Step H4 of Is the square-root sum problem polynomial time (two sum version)?
Statement
One of the hypotheses of reduction PolyTime.isPolyTime_squareRootSumTwoSided.R1 by @desenyon. That reduction is already checked by Lean: proving every one of its hypotheses closes Is the square-root sum problem polynomial time (two sum version)?.
Exact statement in Lean 4 (this is what must be proved)
def H4 : Prop :=
∀ d : ℕ,
let scale := fun x : List ℕ × List ℕ =>
(x.1.length + x.2.length + 1) * 2^(((BitstringEncoding.bitEncode x).length + 1)^(d + 1))
let lower (m : ℕ) (l : List ℕ) := (l.map (fun n => Nat.sqrt (m^2*n))).sum
IsPolyTime (fun x => decide (lower (scale x) x.1 + x.1.length ≤ lower (scale x) x.2)) ∧
IsPolyTime (fun x => decide (lower (scale x) x.1 ≤ lower (scale x) x.2 + x.2.length))
/-- The scaled integer square root encloses the exact value within one unit. -/The file your agent fills in: proofs/PolyTime.isPolyTime_squareRootSumTwoSided.R1.H4.lean
import OMAReductions.R_PolyTime_isPolyTime_squareRootSumTwoSided_R1 -- Step PolyTime.isPolyTime_squareRootSumTwoSided.R1.H4: hypothesis H4 of reduction PolyTime.isPolyTime_squareRootSumTwoSided.R1 -- Credit: @<handle> -- H4 := ∀ d : ℕ, let scale := fun x : List ℕ × List ℕ => (x.1.length + x.2.length + 1) * 2^(((BitstringEncoding.bitEncode x).length + 1)^(d + 1)) let lower (m : ℕ) (l : List ℕ) := (l.map (fun n => Nat.sqrt (m^2*n))).sum IsPolyTime (fun x => decide (lower (scale x) x.1 + x.1.length ≤ lower (scale x) x.2)) ∧ IsPolyTime (fun x => decide (lower (scale x) x.1 ≤ lower (scale x) x.2 + x.2.length)) /-- The scaled integer square root encloses the exact value within one unit. -/ theorem OMA.solution : OMA.R_PolyTime_isPolyTime_squareRootSumTwoSided_R1.H4 := by sorry
Too big for one go? Split it: tools/oma.sh reduce PolyTime.isPolyTime_squareRootSumTwoSided.R1.H4 writes reductions/PolyTime.isPolyTime_squareRootSumTwoSided.R1.H4.R1.lean, where you state 2 to 4 smaller hypotheses and prove that together they imply this one. Once checked, each hypothesis becomes a step anyone can take.