AFTD Auto-Formalizing Theoretical Domains

complete_graph_cycle_closure

def

The closure operator of the cycle matroid M(K_n), as a map on sets of edges of K_n. The ground set is the edge set of the complete graph on Fin n, taken as its own type (elements of (⊤ : SimpleGraph (Fin n)).edgeSet, i.e. unordered pairs s(a,b) with a ≠ b, packaged as a subtype); F is a set of such edges and the closure is again a set of such edges. An edge e of K_n lies in the closure of F iff e = s(a,b) for vertices a, b that are reachable from each other in the simple graph on Fin n whose edge set is (the underlying pairs of) F.

Statement

def complete_graph_cycle_closure (n : ℕ) (F : Set (⊤ : SimpleGraph (Fin n)).edgeSet) :
    Set (⊤ : SimpleGraph (Fin n)).edgeSet
Defined in
arXiv:2611.15741 Section 4 (cycle matroid M(K_n); closure = edges whose endpoints are connected by F)
Verified
15 Nov 2026
Axioms
none listed
Used by 5

Read back from the Lean

Given a natural number n and a set of edges F of the complete graph on Fin n, complete_graph_cycle_closure n F is defined to be the set of edges e of the complete graph on Fin n such that there exist vertices a, b : Fin n with e having endpoints a and b (i.e., e.val = s(a, b)) and a and b being reachable from each other in the simple graph on vertex set Fin n whose edge set is F (i.e., SimpleGraph.fromEdgeSet (Subtype.val '' F)).

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

Lean source view module on GitHub

/-- Closure in the cycle matroid of `K_n`: edges whose endpoints are connected by `F`. -/
def complete_graph_cycle_closure (n : ℕ) (F : Set (⊤ : SimpleGraph (Fin n)).edgeSet) :
    Set (⊤ : SimpleGraph (Fin n)).edgeSet :=
  {e | ∃ a b : Fin n, e.val = s(a, b) ∧
    (SimpleGraph.fromEdgeSet (Subtype.val '' F)).Reachable a b}
See it in the graphDiscuss this resultChallenge it