Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Deterministic correctness and cost of Repair

Proved
KSATSingleFlip.Connect.repair_deterministic

by wcysai · Nov 13, 2026 · Mathlib 0df444a (Lean v4.33.1)

For every k≥1k\ge1k≥1 there is a constant Ck>0C_k>0Ck​>0 with the following property. Let Φ+\Phi^+Φ+ be a finite proper kkk-CNF with nnn variables and mmm clauses, let Φ0⊆Φ+\Phi_0\subseteq\Phi^+Φ0​⊆Φ+, let xxx satisfy Φ0\Phi_0Φ0​, and let WWW be a set of variables. Algorithm 3 has a completed run. Every completed run either returns failure or returns an (x,W)(x,W)(x,W)-repair (U,y)(U,y)(U,y), and every completed or partial run has declared cost at most

Ckn(n+m).C_k n(n+m).Ck​n(n+m).

A repair satisfies W⊆UW\subseteq UW⊆U, y⊨Φ+y\models\Phi^+y⊨Φ+, and y=xy=xy=x outside UUU. Moreover, for every subformula Ψ⊆Φ+\Psi\subseteq\Phi^+Ψ⊆Φ+, every solution σ\sigmaσ of Ψ\PsiΨ that agrees with xxx outside UUU is connected to yyy within the solutions of Ψ\PsiΨ by a path of exactly dH(σ,y)d_H(\sigma,y)dH​(σ,y) single-variable flips. The statement covers every allowed choice in the nondeterministic formalization; the separate high-probability good-repair guarantee is not included.

Preamble
import Definitions.Def_KSATSingleFlip_Connect_Repair
import Definitions.Def_SATComputability

open scoped Classical BigOperators
open OAI.FixedClauseThreshold

Formal statement
namespace KSATSingleFlip.Connect

theorem repair_deterministic :
    ∀ k : ℕ, 1 ≤ k → ∃ C : ℝ, 0 < C ∧ ∀ (n : ℕ) (Φp : List (ProperClause n k))
      (I0 : Finset (Fin (ofList Φp).length)) (x : Fin n → Bool) (W : Finset (Fin n)),
      x ∈ sols (subF (ofList Φp) I0) →
        (∃ r i, RepairRun k (ofList Φp) I0 x (RState.init (ofList Φp) x W) r i) ∧
        (∀ (r : Option (Finset (Fin n) × (Fin n → Bool))) (i : ℕ),
          RepairRun k (ofList Φp) I0 x (RState.init (ofList Φp) x W) r i →
            (r = none ∨ ∃ U y, r = some (U, y) ∧ IsRepair (ofList Φp) x W U y) ∧
            (repairCost n Φp.length i : ℝ) ≤ C * n * (n + Φp.length)) ∧
        (∀ (s : RState (ofList Φp) x) (j : ℕ),
          RepairReach k (ofList Φp) I0 x (RState.init (ofList Φp) x W) s j →
            (repairCost n Φp.length j : ℝ) ≤ C * n * (n + Φp.length)) := by sorry

end KSATSingleFlip.Connect
Source
Wang, Yin, Yu, and Zhang, Single-Variable Connectivity in Random k-SAT, https://arxiv.org/abs/2611.05981, Algorithm 3 and deterministic branch of Lemma 7.4, printed pp. 60–62.

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me