AFTD Auto-Formalizing Theoretical Domains

op874_binary_chain_contains_permutation

theoremverified

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
Used by 2

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.

  1. 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).

    lines 5–6

      induction rs with
      | nil => exact ⟨id, by decide, by intro a; rfl⟩
  2. 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.

    lines 7–9

      | 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]))
  3. 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.

    lines 10–12

    uses Function.Injective

        have hginj : Function.Injective g := by
          intro a b hab
          cases a <;> cases b <;> simp_all
  4. 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).

    lines 13–14

        refine ⟨fun a => g (f a), ?_, ?_⟩
        · intro he; exact hfne (hginj he)
  5. 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.

    line 15

        · 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.

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

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)⟩
See it in the graphDiscuss this resultChallenge it