AFTD Auto-Formalizing Theoretical Domains

op874_opposite_paired_cover_is_bijective

theoremverified

For a finite set split into two classes by a fixed-point-free class-switching involution, any map for which each true vertex has a false preimage restricts to a bijection from the false vertices onto the true vertices.

Statement

theorem op874_opposite_paired_cover_is_bijective {V : Type*} [Fintype V] [DecidableEq V]
    (flag : V → Bool) (mate own : V → V)
    (hmate : ∀ v, mate (mate v) = v)
    (hflip : ∀ v, flag (mate v) = !flag v)
    (hcover : ∀ p, flag p = true → ∃ q, flag q = false ∧ own q = p) :
    ∀ q, flag q = false → flag (own q) = true ∧
      ∀ r, flag r = false → own r = own q → r = q
Source
Structural reduction for the exact-owner global-pair route to OP-874; experiment 43048 tests the hypotheses.
Verified
29 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Used by 1

The proof, explained

The involution mate swaps the truth value of flag, setting up a bijection between the true vertices P and the false vertices Q, so |P| = |Q|. By hypothesis, each p ∈ P has a preimage in Q under own, which defines a choice section choose : P → Q satisfying own ∘ choose = id_P. This identity makes choose injective, and because P and Q are finite sets of the same size, choose must also be surjective. Inverting this bijection shows that own maps Q into P and is injective on Q.

  1. The subsets P of true vertices and Q of false vertices have the same finite cardinality.

    We define P and Q as the subtypes of vertices where flag is true and false, respectively. The map mate is an involution that flips the flag, so it restricts to mutually inverse bijections between P and Q. By Fintype.card_congr, |P| = |Q|.

    lines 8–16

    uses Subtype.ext, Fintype.card_congr

      classical
      let P := {v : V // flag v = true}
      let Q := {v : V // flag v = false}
      let eqv : P ≃ Q :=
        { toFun := fun p => ⟨mate p.1, by simp [hflip, p.2]⟩
          invFun := fun q => ⟨mate q.1, by simp [hflip, q.2]⟩
          left_inv := fun p => Subtype.ext (hmate p.1)
          right_inv := fun q => Subtype.ext (hmate q.1) }
      have hcard : Fintype.card P = Fintype.card Q := Fintype.card_congr eqv
  2. There is a selection map choose : P → Q such that own (choose p) = p for every p ∈ P.

    By the covering assumption hcover, every vertex p in P has at least one preimage q in Q under own. Using classical choice (Classical.choose), we select one such preimage for each p, yielding a map choose : P → Q that satisfies own (choose p) = p by Classical.choose_spec.

    lines 17–20

    uses Classical.choose, Classical.choose_spec

      let choose : P → Q := fun p => ⟨Classical.choose (hcover p.1 p.2),
        (Classical.choose_spec (hcover p.1 p.2)).1⟩
      have hchoose : ∀ p : P, own (choose p).1 = p.1 := fun p =>
        (Classical.choose_spec (hcover p.1 p.2)).2
  3. The selection map choose : P → Q is injective, and therefore surjective.

    If choose p = choose r, applying own to both sides yields p = own (choose p) = own (choose r) = r, proving choose is injective. Since P and Q are finite types with equal cardinality, any injective map between them is also surjective (by Fintype.bijective_iff_injective_and_card).

    lines 21–27

    uses Subtype.ext, congrArg, Fintype.bijective_iff_injective_and_card

      have hinj : Function.Injective choose := by
        intro p r h
        apply Subtype.ext
        have h' := congrArg (fun q : Q => own q.1) h
        simpa only [hchoose] using h'
      have hsurj : Function.Surjective choose :=
        (Fintype.bijective_iff_injective_and_card choose).2 ⟨hinj, hcard⟩ |>.2
  4. For any false vertex q, own q is a true vertex.

    Given q with flag q = false, surjectivity of choose yields some p ∈ P such that choose p = q. Applying own gives own q = own (choose p) = p. Because p ∈ P, its flag is true, which establishes flag (own q) = true.

    lines 28–32

    uses congrArg, Subtype.val

      intro q hq
      obtain ⟨p, hp⟩ := hsurj ⟨q,hq⟩
      have hval : (choose p).1 = q := congrArg Subtype.val hp
      have hown : own q = p.1 := by rw [←hval]; exact hchoose p
      refine ⟨hown ▸ p.2, ?_⟩
  5. The map own is injective on the false vertices: if flag r = false and own r = own q, then r = q.

    By surjectivity, r = choose s for some s ∈ P, so own r = s. Since own r = own q, we have s = p. Substituting s = p then gives r = choose s = choose p = q.

    lines 33–39

    uses congrArg, Subtype.val, Subtype.ext

      intro r hr heq
      obtain ⟨s, hs⟩ := hsurj ⟨r,hr⟩
      have hval' : (choose s).1 = r := congrArg Subtype.val hs
      have hown' : own r = s.1 := by rw [←hval']; exact hchoose s
      have hps : p = s := Subtype.ext (by rw [← hown, ← hown']; exact heq.symm)
      subst s
      exact hval'.symm.trans hval
Subtype.ext
Two elements of a subtype are equal if their underlying values are equal.
Fintype.card_congr
An equivalence (bijection) between two finite types implies that they have the same cardinality.
Classical.choose
Given an existential statement, produces a witness satisfying the predicate.
Classical.choose_spec
The witness produced by Classical.choose satisfies the existential predicate.
congrArg
If two arguments are equal, the values of a function applied to them are equal.
Fintype.bijective_iff_injective_and_card
A map between finite types of the same cardinality is bijective if and only if it is injective.
Subtype.val
The canonical projection from a subtype element to its underlying value.

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_opposite_paired_cover_is_bijective {V : Type*} [Fintype V] [DecidableEq V]    (flag : V → Bool) (mate own : V → V)    (hmate : ∀ v, mate (mate v) = v)    (hflip : ∀ v, flag (mate v) = !flag v)    (hcover : ∀ p, flag p = true → ∃ q, flag q = false ∧ own q = p) :    ∀ q, flag q = false → flag (own q) = true ∧      ∀ r, flag r = false → own r = own q → r = q := by  classical  let P := {v : V // flag v = true}  let Q := {v : V // flag v = false}  let eqv : P ≃ Q :=    { toFun := fun p => ⟨mate p.1, by simp [hflip, p.2]⟩      invFun := fun q => ⟨mate q.1, by simp [hflip, q.2]⟩      left_inv := fun p => Subtype.ext (hmate p.1)      right_inv := fun q => Subtype.ext (hmate q.1) }  have hcard : Fintype.card P = Fintype.card Q := Fintype.card_congr eqv  let choose : P → Q := fun p => ⟨Classical.choose (hcover p.1 p.2),    (Classical.choose_spec (hcover p.1 p.2)).1⟩  have hchoose : ∀ p : P, own (choose p).1 = p.1 := fun p =>    (Classical.choose_spec (hcover p.1 p.2)).2  have hinj : Function.Injective choose := by    intro p r h    apply Subtype.ext    have h' := congrArg (fun q : Q => own q.1) h    simpa only [hchoose] using h'  have hsurj : Function.Surjective choose :=    (Fintype.bijective_iff_injective_and_card choose).2 ⟨hinj, hcard⟩ |>.2  intro q hq  obtain ⟨p, hp⟩ := hsurj ⟨q,hq⟩  have hval : (choose p).1 = q := congrArg Subtype.val hp  have hown : own q = p.1 := by rw [←hval]; exact hchoose p  refine ⟨hown ▸ p.2, ?_⟩  intro r hr heq  obtain ⟨s, hs⟩ := hsurj ⟨r,hr⟩  have hval' : (choose s).1 = r := congrArg Subtype.val hs  have hown' : own r = s.1 := by rw [←hval']; exact hchoose s  have hps : p = s := Subtype.ext (by rw [← hown, ← hown']; exact heq.symm)  subst s  exact hval'.symm.trans hval
See it in the graphDiscuss this resultChallenge it