AFTD Auto-Formalizing Theoretical Domains

triangle_matching_port_forces_fourth_high

theoremverified

The triangle palette constraints force the same fourth high color at two outgoing ports.

Statement

theorem triangle_matching_port_forces_fourth_high
    {Ω : Type*} (a b d x y u v z w t : Ω)
    (h5 : (x = b ∧ y = d) ∨ (x = d ∧ y = b))
    (h7 : (u = a ∧ v = d) ∨ (u = d ∧ v = a))
    (hxu : x ≠ u) (hxv : x ≠ v)
    (h6 : z = d ∨ w = d ∨ t = d)
    (hyw : y ≠ w) (hyt : y ≠ t) (hzv : z ≠ v) :
    y = d ∧ z = d ∧ u = d
Source
Palette obstruction reduction for the OP-874 campaign.
Verified
19 Nov 2026
Axioms
none — Lean reports it depends on no axioms

The proof, explained

The theorem is proved by determining the values of y, z, and u in turn, using the disequality hypotheses to rule out competing alternatives. First, the disjunction for (x, y) forces y = d, because the alternative x = d would equate x to either u or v, contradicting x ≠ u or x ≠ v. Next, of the three options for z = d ∨ w = d ∨ t = d, the latter two contradict y ≠ w and y ≠ t since y = d, forcing z = d. Finally, in the disjunction for (u, v), the case v = d contradicts z ≠ v since z = d, which forces u = d. Combining these three equalities yields the desired conclusion.

  1. y = d

    By hypothesis h5, either (x = b ∧ y = d) or (x = d ∧ y = b). In the first case, y = d is immediate. In the second case (x = d), we inspect hypothesis h7: if u = a and v = d, then x = d = v, which contradicts x ≠ v (hxv); if u = d and v = a, then x = d = u, which contradicts x ≠ u (hxu). Both branches of the second case yield a contradiction, leaving y = d as the only possibility.

    lines 9–14

    uses False.elim

      have hy : y = d := by
        rcases h5 with h | h
        · exact h.2
        · rcases h7 with h' | h'
          · exact False.elim (hxv (h.1.trans h'.2.symm))
          · exact False.elim (hxu (h.1.trans h'.1.symm))
  2. z = d

    Hypothesis h6 gives three possibilities: z = d, w = d, or t = d. If z = d, we are done. If w = d, then transitivity with y = d implies y = w, contradicting y ≠ w (hyw). If t = d, then transitivity with y = d implies y = t, contradicting y ≠ t (hyt). Both alternative branches are thus ruled out by contradiction, establishing z = d.

    lines 15–19

    uses False.elim

      have hz : z = d := by
        rcases h6 with h | h | h
        · exact h
        · exact False.elim (hyw (hy.trans h.symm))
        · exact False.elim (hyt (hy.trans h.symm))
  3. u = d

    Hypothesis h7 gives two possibilities: either (u = a ∧ v = d) or (u = d ∧ v = a). In the first case, v = d together with z = d gives z = v, contradicting z ≠ v (hzv). This contradiction leaves the second case, which directly asserts u = d.

    lines 20–23

    uses False.elim

      have hu : u = d := by
        rcases h7 with h | h
        · exact False.elim (hzv (hz.trans h.2.symm))
        · exact h.1
  4. y = d ∧ z = d ∧ u = d

    Combine the three established equalities y = d, z = d, and u = d into the required conjunction.

    line 24

      exact ⟨hy, hz, hu⟩
False.elim
from a contradiction (an instance of False), any conclusion follows (ex falso quodlibet)

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 triangle_matching_port_forces_fourth_high    {Ω : Type*} (a b d x y u v z w t : Ω)    (h5 : (x = b ∧ y = d) ∨ (x = d ∧ y = b))    (h7 : (u = a ∧ v = d) ∨ (u = d ∧ v = a))    (hxu : x ≠ u) (hxv : x ≠ v)    (h6 : z = d ∨ w = d ∨ t = d)    (hyw : y ≠ w) (hyt : y ≠ t) (hzv : z ≠ v) :    y = d ∧ z = d ∧ u = d := by  have hy : y = d := by    rcases h5 with h | h    · exact h.2    · rcases h7 with h' | h'      · exact False.elim (hxv (h.1.trans h'.2.symm))      · exact False.elim (hxu (h.1.trans h'.1.symm))  have hz : z = d := by    rcases h6 with h | h | h    · exact h    · exact False.elim (hyw (hy.trans h.symm))    · exact False.elim (hyt (hy.trans h.symm))  have hu : u = d := by    rcases h7 with h | h    · exact False.elim (hzv (hz.trans h.2.symm))    · exact h.1  exact ⟨hy, hz, hu⟩
See it in the graphDiscuss this resultChallenge it