digraph_in_degree
def
The in-degree of a vertex v in a finite directed graph D is the number of vertices u such that D.Adj u v.
Statement
def digraph_in_degree {V : Type*} [Fintype V] (D : Digraph V) [DecidableRel D.Adj] (v : V) : ℕ
- Defined in
- folklore
- Verified
- 15 Nov 2026
- Axioms
- none listed
- Used by 2
- oriented_star_one_edge_os_and_oasIf an oriented star D has one edge (two vertices), then D is both OS and OAS.
- oriented_star_densityThe homomorphism density of an oriented star with center c in a digraphon W is the integral over x in [0, 1] of (W^-(x))^(inDegree c) *…
Read back from the Lean
The definition digraph_in_degree assigns to each vertex v : V in a directed graph D on a finite type V (with decidable adjacency relation D.Adj) the natural number given by the cardinality of the set of all vertices u : V such that D.Adj u v holds (i.e., the in-degree of v, counting vertices with a directed edge to v).
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 in-degree of a vertex in a finite directed graph. -/ def digraph_in_degree {V : Type*} [Fintype V] (D : Digraph V) [DecidableRel D.Adj] (v : V) : ℕ := (Finset.univ.filter (fun u => D.Adj u v)).card