AFTD Auto-Formalizing Theoretical Domains

simple_graph_endpoint_sum_edges

def

Given a finite simple graph G and a vertex labeling φ : V → ℕ, the finset simple_graph_endpoint_sum_edges G φ r consists of all edges uv of G such that the sum of the endpoint labels φ(u) + φ(v) equals r.

Statement

noncomputable def simple_graph_endpoint_sum_edges {V : Type*} [Fintype V]
    (G : SimpleGraph V) (φ : V → ℕ) (r : ℕ) : Finset (Sym2 V)
Defined in
arXiv:2611.16338, Section 2
Verified
14 Nov 2026
Axioms
none listed
Used by 5
  • admissibility_lemma_necessityLet s ≥ 3, let G be a finite simple graph, and let φ : V → ℕ be a vertex labeling such that φ(v) ∈ {1, s} for all v. Let a = |E_2|, b =…
  • simple_graph_endpoint_sum_edges_subsetFor any finite simple graph G, vertex labeling φ : V → ℕ, and natural number r, the finset simple_graph_endpoint_sum_edges G φ r is a…
  • admissibility_lemma_binary_labelingLet s ≥ 3, let G be a finite simple graph, and let φ : V → ℕ be a vertex labeling such that φ(v) ∈ {1, s} for all v. Let a = |E_2|, b =…
  • admissibility_lemma_edge_partitionLet s ≥ 3 and let φ : V → ℕ be a vertex labeling of a finite simple graph G such that every vertex receives label 1 or s. Then the edge…
  • admissibility_lemma_sufficiencyLet s ≥ 3, let G be a finite simple graph, and let φ : V → ℕ be a vertex labeling such that φ(v) ∈ {1, s} for all v. Let a = |E_2|, b =…

Read back from the Lean

For a finite type V, a simple graph G on V, a vertex weighting function φ : V → ℕ, and a natural number r, simple_graph_endpoint_sum_edges G φ r is defined as the Finset (Sym2 V) consisting of all edges e of G such that the sum of φ evaluated at the two endpoints of e equals r.

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

/-- The finset of edges of G whose endpoint labels sum to r. -/
noncomputable def simple_graph_endpoint_sum_edges {V : Type*} [Fintype V]
    (G : SimpleGraph V) (φ : V → ℕ) (r : ℕ) : Finset (Sym2 V) :=
  open scoped Classical in
  G.edgeFinset.filter (fun e => Sym2.lift ⟨fun u v => φ u + φ v, fun _ _ => add_comm _ _⟩ e = r)
See it in the graphDiscuss this resultChallenge it