AFTD Auto-Formalizing Theoretical Domains

op874_bad_ports_unselected_matching_crosses

theoremverified

Under the displayed local high-color palette and interface conditions, an involutive unselected-edge matching exchanges the two classes whenever the original matching does.

Statement

theorem op874_bad_ports_unselected_matching_crosses
    {V : Type*} [Fintype V] [DecidableEq V]
    (flag : V → Bool) (mate other : V → V)
    (t s x y : V → Fin 6)
    (hmate : ∀ v, mate (mate v) = v)
    (hflip : ∀ v, flag (mate v) = !flag v)
    (hother : ∀ v, other (other v) = v)
    (htsame : ∀ v, t (other v) = t v)
    (hlocal : ∀ v, flag v = false →
      2 ≤ (t v).val ∧ (t v).val ≤ 3 ∧ 4 ≤ (s v).val ∧ 4 ≤ (x v).val ∧
      2 ≤ (y v).val ∧ s v ≠ x v ∧ y v ≠ s v ∧ y v ≠ x v ∧ y v ≠ t v)
    (hcross : ∀ v, flag v = false → flag (other v) = false → y v ≠ y (other v)) :
    ∀ v, flag (other v) = !flag v
Source
Structural two-port reduction for OP-874; experiments 43048, 43073 and 43075 test the local-state implications.
Verified
29 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 2
Used by 1

The proof, explained

The theorem reduces proving that the involution `other` exchanges the two flag classes to showing that no edge of `other` connects two vertices that both have `flag = false`. Assuming for contradiction that such an edge exists, both endpoints satisfy the local palette bounds and pairwise distinctness constraints on colors in Fin 6, while sharing the same target color t and having distinct crossing colors y. This finite combinatorial configuration is proven impossible by `op874_unselected_edge_two_bad_nonowners_impossible`, completing the proof.

  1. It suffices to show that `other` maps every vertex with `flag v = false` to a vertex with `flag (other v) = true`.

    Applying `op874_one_sided_perfect_matching_crosses`, the involution `other` flips `flag` everywhere as long as it never connects two vertices that both have flag `false`, given that `mate` is an involution that flips `flag`.

    line 14

    uses op874_one_sided_perfect_matching_crosses

      apply op874_one_sided_perfect_matching_crosses flag mate other hmate hflip hother
  2. It suffices to deduce a contradiction from assuming `flag v = false` and `flag (other v) = false`.

    We fix an arbitrary vertex `v` with `flag v = false` (`hv`) and split into cases on `flag (other v)`. If `flag (other v) = true`, the goal holds immediately by definition. It therefore suffices to rule out the remaining case where `flag (other v) = false` (`ho`).

    lines 15–18

      intro v hv
      cases ho : flag (other v) with
      | true => rfl
      | false =>
  3. Both `v` and `other v` satisfy the local palette bounds and distinctness constraints.

    Because both `flag v = false` and `flag (other v) = false`, hypothesis `hlocal` applies to both vertices. This gives the range bounds 2 ≤ t ≤ 3, s ≥ 4, x ≥ 4, and y ≥ 2, along with the pairwise inequalities s ≠ x, y ≠ s, y ≠ x, and y ≠ t at both `v` and `other v`.

    lines 19–20

        obtain ⟨htl,hth,hs,hx,hy,hsx,hys,hyx,hyt⟩ := hlocal v hv
        obtain ⟨htl',hth',hs',hx',hy',hsx',hys',hyx',hyt'⟩ := hlocal (other v) ho
  4. y (other v) ≠ t v

    The local distinctness condition at `other v` guarantees `y (other v) ≠ t (other v)`. Since `t (other v) = t v` by hypothesis `htsame`, this inequality simplifies directly to `y (other v) ≠ t v`.

    line 21

        have ht' : y (other v) ≠ t v := by simpa [htsame v] using hyt'
  5. The case `flag (other v) = false` leads to a contradiction, concluding the proof.

    We invoke `op874_unselected_edge_two_bad_nonowners_impossible` with the colors at `v` and `other v`, which share `t v` and satisfy `y v ≠ y (other v)` by hypothesis `hcross`. The lemma proves that no such assignment in Fin 6 can satisfy all these inequalities simultaneously, yielding `False`, from which the goal follows via `False.elim`.

    lines 22–24

    uses False.elim, op874_unselected_edge_two_bad_nonowners_impossible

        exact False.elim (op874_unselected_edge_two_bad_nonowners_impossible
          (t v) (s v) (s (other v)) (x v) (x (other v)) (y v) (y (other v))
          htl hth hs hs' hx hx' hy hy' hsx hsx' hys hys' hyx hyx' hyt ht' (hcross v hv ho))
op874_one_sided_perfect_matching_crosses
If two involutive permutations act on a finite type and the first flips a boolean flag everywhere, then the second also flips the flag everywhere provided it maps every element with flag `false` to an element with flag `true`.
op874_unselected_edge_two_bad_nonowners_impossible
There do not exist elements t, s₁, s₂, x₁, x₂, y₁, y₂ in Fin 6 satisfying 2 ≤ t ≤ 3, sᵢ ≥ 4, xᵢ ≥ 4, yᵢ ≥ 2, sᵢ ≠ xᵢ, yᵢ ∉ {sᵢ, xᵢ, t}, and y₁ ≠ y₂.
False.elim
From a proof of False, any proposition follows (principle of explosion).

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_bad_ports_unselected_matching_crosses    {V : Type*} [Fintype V] [DecidableEq V]    (flag : V → Bool) (mate other : V → V)    (t s x y : V → Fin 6)    (hmate : ∀ v, mate (mate v) = v)    (hflip : ∀ v, flag (mate v) = !flag v)    (hother : ∀ v, other (other v) = v)    (htsame : ∀ v, t (other v) = t v)    (hlocal : ∀ v, flag v = false →      2 ≤ (t v).val ∧ (t v).val ≤ 3 ∧ 4 ≤ (s v).val ∧ 4 ≤ (x v).val ∧      2 ≤ (y v).val ∧ s v ≠ x v ∧ y v ≠ s v ∧ y v ≠ x v ∧ y v ≠ t v)    (hcross : ∀ v, flag v = false → flag (other v) = false → y v ≠ y (other v)) :    ∀ v, flag (other v) = !flag v := by  apply op874_one_sided_perfect_matching_crosses flag mate other hmate hflip hother  intro v hv  cases ho : flag (other v) with  | true => rfl  | false =>    obtain ⟨htl,hth,hs,hx,hy,hsx,hys,hyx,hyt⟩ := hlocal v hv    obtain ⟨htl',hth',hs',hx',hy',hsx',hys',hyx',hyt'⟩ := hlocal (other v) ho    have ht' : y (other v) ≠ t v := by simpa [htsame v] using hyt'    exact False.elim (op874_unselected_edge_two_bad_nonowners_impossible      (t v) (s v) (s (other v)) (x v) (x (other v)) (y v) (y (other v))      htl hth hs hs' hx hx' hy hy' hsx hsx' hys hys' hyx hyx' hyt ht' (hcross v hv ho))
See it in the graphDiscuss this resultChallenge it