AFTD Auto-Formalizing Theoretical Domains

op309_injective_padded_ports_canonical

theoremverified

If the port map is injective on original edges, then it makes no extra identification of unselected edge ports.

Statement

theorem op309_injective_padded_ports_canonical
    {V A : Type*} [Fintype V] [DecidableEq V]
    (G : SimpleGraph V) [DecidableRel G.Adj] (R : Finset G.edgeSet)
    (q : Sum G.edgeSet (V × Fin 3) → A)
    (hinj : Function.Injective (fun e : G.edgeSet => q (.inl e))) :
    op309_canonical_padded_port_classes G R q
Source
Sanity check for op309_canonical_padded_port_classes.
Verified
27 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 2

The proof, explained

To show that the port assignment q produces canonical port classes on unselected edges, we consider any two unselected edges e and f mapped to the same port. By the assumed injectivity of q on edges, e and f must in fact be the identical edge. The definition requires connecting e and f via a reflexive-transitive closure, which holds immediately by reflexivity.

  1. Any two unselected edges e and f with the same port assignment under q must be identical (e = f).

    Unfolding the definition of `op309_canonical_padded_port_classes`, we consider two arbitrary edges e, f ∉ R such that q(.inl e) = q(.inl f). Since the map e ↦ q(.inl e) is injective by hypothesis (hinj), this equality immediately implies e = f.

    lines 7–8

      intro e f he hf hq
      have h : e = f := hinj hq
  2. The edges e and f are connected in the reflexive-transitive closure required by the definition.

    Substituting e for f reduces the goal to showing that e is connected to itself in the relation's reflexive-transitive closure. Since the reflexive-transitive closure of any binary relation is reflexive, `Relation.ReflTransGen.refl` closes the goal.

    lines 9–10

    uses Relation.ReflTransGen.refl

      subst f
      exact Relation.ReflTransGen.refl
Relation.ReflTransGen.refl
For any binary relation r, its reflexive-transitive closure is reflexive: every element is related to itself.

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 op309_injective_padded_ports_canonical    {V A : Type*} [Fintype V] [DecidableEq V]    (G : SimpleGraph V) [DecidableRel G.Adj] (R : Finset G.edgeSet)    (q : Sum G.edgeSet (V × Fin 3) → A)    (hinj : Function.Injective (fun e : G.edgeSet => q (.inl e))) :    op309_canonical_padded_port_classes G R q := by  intro e f he hf hq  have h : e = f := hinj hq  subst f  exact Relation.ReflTransGen.refl
See it in the graphDiscuss this resultChallenge it