op874_binary_path_close_almost_complete
A finite chain of two-state constraints that each contains a bijection can be closed by any constraint excluding at most one pair.
Statement
theorem op874_binary_path_close_almost_complete (rs : List (Bool → Bool → Prop)) (R : Bool → Bool → Prop) (hr : ∀ T ∈ rs, ∃ f : Bool → Bool, f false ≠ f true ∧ ∀ a, T a (f a)) (hR : ∀ a b c d : Bool, (a,b) ≠ (c,d) → R a b ∨ R c d) : ∃ a b, op874_binary_chain rs a b ∧ R b a
- Source
- Finite local-phase reduction for OP-874, https://arxiv.org/abs/2610.41950, Section 2.
- Verified
- 27 Nov 2026
- Axioms
propext- Built on 2
- op874_binary_chainComposition of two-state compatibility relations along a finite path.
- op874_binary_chain_contains_permutationIf each two-state constraint on a finite path contains a bijection, their composition contains a bijection.
- Used by 1
- op874_binary_cycle_with_one_flexible_relationA cyclic collection of two-state constraints is satisfiable if every constraint contains a bijection and at least one excludes at most one…
The proof, explained
By composing the permutations present in each relation along the chain, the entire chain contains a bijection f : Bool → Bool that connects each state a to f(a). Since R excludes at most one pair overall, it must contain at least one of any two distinct pairs. The pairs (f(false), false) and (f(true), true) have distinct second components and are therefore distinct, so R must hold for at least one of them, providing a pair (a, f(a)) that closes the chain with R(f(a), a).
The relation chain contains a function f : Bool → Bool, so that for every state a, the chain connects a to f(a).
By op874_binary_chain_contains_permutation, since every relation in the list rs contains a bijection on Bool, their composition also contains a bijection f. We extract f along with the fact that the chain connects every a to f(a).
uses
op874_binary_chain_contains_permutationobtain ⟨f, -, hf⟩ := op874_binary_chain_contains_permutation rs hrAt least one of R(f(false), false) or R(f(true), true) holds.
By hypothesis hR, R contains at least one of any two distinct pairs in Bool × Bool. The pairs (f(false), false) and (f(true), true) are distinct because projecting onto the second coordinate via Prod.snd yields false and true, which cannot be equal. Thus, R must relate at least one of these two pairs.
uses
congrArg,Prod.sndhave h := hR (f false) false (f true) true (by intro he; have := congrArg Prod.snd he; cases this)
There exist states a, b such that the chain connects a to b and R(b, a) holds.
We perform a case split on the disjunction from the previous step. If R(f(false), false) holds, we choose a = false and b = f(false). If R(f(true), true) holds, we choose a = true and b = f(true). In either case, the chain relates a to b and R(b, a) holds.
rcases h with h | h · exact ⟨false, f false, hf false, h⟩ · exact ⟨true, f true, hf true, h⟩
op874_binary_chain_contains_permutation- If every relation in a list contains a permutation (a bijection) on Bool, then the chained composition of those relations also contains a permutation on Bool.
congrArg- Functions respect equality: if x = y, then g(x) = g(y).
Prod.snd- The second projection of an ordered pair, mapping (x, y) to y.
Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.
Lean source view module on GitHub
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
theorem op874_binary_path_close_almost_complete (rs : List (Bool → Bool → Prop)) (R : Bool → Bool → Prop) (hr : ∀ T ∈ rs, ∃ f : Bool → Bool, f false ≠ f true ∧ ∀ a, T a (f a)) (hR : ∀ a b c d : Bool, (a,b) ≠ (c,d) → R a b ∨ R c d) : ∃ a b, op874_binary_chain rs a b ∧ R b a := by obtain ⟨f, -, hf⟩ := op874_binary_chain_contains_permutation rs hr have h := hR (f false) false (f true) true (by intro he; have := congrArg Prod.snd he; cases this) rcases h with h | h · exact ⟨false, f false, hf false, h⟩ · exact ⟨true, f true, hf true, h⟩