op874_binary_chain_contains_permutation
If each two-state constraint on a finite path contains a bijection, their composition contains a bijection.
Statement
theorem op874_binary_chain_contains_permutation (rs : List (Bool → Bool → Prop)) (hr : ∀ R ∈ rs, ∃ f : Bool → Bool, f false ≠ f true ∧ ∀ a, R a (f a)) : ∃ f : Bool → Bool, f false ≠ f true ∧ ∀ a, op874_binary_chain rs a (f 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 1
- op874_binary_chainComposition of two-state compatibility relations along a finite path.
- Used by 2
- 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…
- op874_binary_path_close_almost_completeA finite chain of two-state constraints that each contains a bijection can be closed by any constraint excluding at most one pair.
The proof, explained
The proof proceeds by induction on the list of relations rs. In the base case of an empty list, the relation is equality, which contains the identity permutation. In the inductive step R :: rs, the hypothesis gives a permutation f contained in R, and the induction hypothesis gives a permutation g contained in the chain rs; since g is an injective map on the two-element set Bool, the composition g ∘ f is also a permutation, and taking f(a) as the intermediate state witnesses that g ∘ f is contained in the composite relation.
The theorem holds in the base case where the list of relations is empty.
We proceed by induction on rs. When rs is empty ([]), the relation op874_binary_chain [] a b is defined as a = b. The identity map id satisfies id false ≠ id true by computational evaluation (decide), and op874_binary_chain [] a (id a) reduces definitionally to a = a (rfl).
induction rs with | nil => exact ⟨id, by decide, by intro a; rfl⟩
For a composite relation list R :: rs, there exist bijections f for R and g for the tail chain rs.
Applying the hypothesis hr to R (which is trivially in R :: rs) yields a function f : Bool → Bool with f false ≠ f true such that R a (f a) holds for all a. Since every relation T in the tail rs is also an element of R :: rs, the induction hypothesis ih applies to rs, yielding a function g : Bool → Bool with g false ≠ g true such that op874_binary_chain rs a (g a) holds for all a.
| cons R rs ih => obtain ⟨f, hfne, hf⟩ := hr R (by simp) obtain ⟨g, hgne, hg⟩ := ih (by intro T hT; exact hr T (by simp [hT]))The tail function g is injective.
Suppose g a = g b. Considering all four possibilities for the pair (a, b) in Bool × Bool, the off-diagonal cases (a = false, b = true or a = true, b = false) contradict the hypothesis that g false ≠ g true, while the diagonal cases immediately give a = b. The simp_all tactic finishes each case.
uses
Function.Injectivehave hginj : Function.Injective g := by intro a b hab cases a <;> cases b <;> simp_all
The composition g ∘ f is a permutation of Bool (it takes distinct values on false and true).
We propose the composite map fun a => g (f a) as the witness. If g (f false) = g (f true), then applying injectivity of g (hginj) would imply f false = f true, which directly contradicts the fact that f false ≠ f true (hfne).
refine ⟨fun a => g (f a), ?_, ?_⟩ · intro he; exact hfne (hginj he)
The composition g ∘ f satisfies the chained relation op874_binary_chain (R :: rs).
By definition of op874_binary_chain on R :: rs, we need an intermediate element c such that R a c and op874_binary_chain rs c (g (f a)). Choosing c = f a, R a (f a) holds by hf, and op874_binary_chain rs (f a) (g (f a)) holds by hg applied to f a.
· intro a; exact ⟨f a, hf a, hg (f a)⟩
Function.Injective- A function f is injective if f a = f b implies a = b.
- On the two-element type Bool, any function f satisfying f false ≠ f true is a bijection. In the formal proof, injectivity of g is established by an exhaustive four-case case split on Bool × Bool using cases and simp_all.
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_chain_contains_permutation (rs : List (Bool → Bool → Prop)) (hr : ∀ R ∈ rs, ∃ f : Bool → Bool, f false ≠ f true ∧ ∀ a, R a (f a)) : ∃ f : Bool → Bool, f false ≠ f true ∧ ∀ a, op874_binary_chain rs a (f a) := by induction rs with | nil => exact ⟨id, by decide, by intro a; rfl⟩ | cons R rs ih => obtain ⟨f, hfne, hf⟩ := hr R (by simp) obtain ⟨g, hgne, hg⟩ := ih (by intro T hT; exact hr T (by simp [hT])) have hginj : Function.Injective g := by intro a b hab cases a <;> cases b <;> simp_all refine ⟨fun a => g (f a), ?_, ?_⟩ · intro he; exact hfne (hginj he) · intro a; exact ⟨f a, hf a, hg (f a)⟩