AFTD Auto-Formalizing Theoretical Domains

digraph_residual_contains_self

theoremverified

For a finite type V with decidable equality, directed graphs G and H of type Digraph V with decidable adjacency relations, if G ≤ H, then every vertex v : V satisfies v ∈ digraph_residual_at G H v.

Statement

theorem digraph_residual_contains_self {V : Type*} [Fintype V] [DecidableEq V]
    (G H : Digraph V) [DecidableRel G.Adj] [DecidableRel H.Adj]
    (hGH : G ≤ H) (v : V) :
    v ∈ digraph_residual_at G H v
Source
arXiv:2611.32872 p. 3
Verified
26 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 1
  • digraph_residual_atFor a finite type V with decidable equality, directed graphs G and H of type Digraph V with decidable adjacency relations, and a vertex v…
Used by 1

Read back from the Lean

For any finite type $V$ with decidable equality, directed graphs $G$ and $H$ on $V$ with decidable adjacency relations, if $G \le H$, then for every vertex $v \in V$, $v$ is an element of digraph_residual_at G H v (the set of all vertices $w \in V$ such that every in-neighbor of $v$ in $G$, as well as $v$ itself, is an in-neighbor of $w$ in $H$ or equal to $w$).

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

The proof, explained

By definition of the residual set, a vertex v belongs to digraph_residual_at G H v if every vertex u that is equal to v or has an edge to v in G also satisfies this condition in H with respect to v. The proof proceeds by case analysis on whether u = v or G.Adj u v: the equality case holds by reflexivity, and the adjacency case follows directly from the sub-digraph hypothesis G ≤ H.

  1. Membership v ∈ digraph_residual_at G H v is equivalent to showing that for all u : V, if u = v or G.Adj u v, then u = v or H.Adj u v

    Unfolding the definition of digraph_residual_at and simplifying the condition for membership in a filtered universal set via Finset.mem_filter, Finset.mem_univ, and true_and reduces the goal to checking the defining implication with w instantiated at v.

    line 6

    uses digraph_residual_at, Finset.mem_filter, Finset.mem_univ, true_and

      simp only [digraph_residual_at, Finset.mem_filter, Finset.mem_univ, true_and]
  2. To establish the implication for an arbitrary vertex u, it suffices to consider the cases u = v and G.Adj u v separately

    We introduce an arbitrary vertex u and the assumption that u = v ∨ G.Adj u v, then perform a case split on this disjunction.

    lines 7–8

      intro u hu
      rcases hu with rfl | hadj
  3. In the case u = v, the required disjunction u = v ∨ H.Adj u v holds

    Substituting u = v, the first alternative u = v holds immediately by reflexivity.

    line 9

      · left; rfl
  4. In the case G.Adj u v, the required disjunction u = v ∨ H.Adj u v holds

    Since G ≤ H means any directed edge in G is also a directed edge in H, the assumption G.Adj u v directly gives H.Adj u v, satisfying the second alternative.

    line 10

      · right; exact hGH hadj
digraph_residual_at
the definition of the residual set: digraph_residual_at G H v is the finset of vertices w such that for all u, if u = v or G.Adj u v, then u = w or H.Adj u w
Finset.mem_filter
an element a is in Finset.filter p s if and only if a ∈ s and p a holds
Finset.mem_univ
every element of a finite type belongs to Finset.univ
true_and
True ∧ p simplifies to p

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

/-- Every vertex v belongs to its own residual R_v. -/theorem digraph_residual_contains_self {V : Type*} [Fintype V] [DecidableEq V]    (G H : Digraph V) [DecidableRel G.Adj] [DecidableRel H.Adj]    (hGH : G ≤ H) (v : V) :    v ∈ digraph_residual_at G H v := by  simp only [digraph_residual_at, Finset.mem_filter, Finset.mem_univ, true_and]  intro u hu  rcases hu with rfl | hadj  · left; rfl  · right; exact hGH hadj
See it in the graphDiscuss this resultChallenge it