FormalConjecturesForMathlib/Combinatorics/SimpleGraph/VertexDistance.lean
Explanation legend Lean4 Domain Explanation Language (L4DEL)
L4DEL explanations are a separate layer. They do not change the Lean source. Intuition is explanatory prose; numbered items are a reading path; sources link the wording back to evidence.
- L4DEL
- Lean4 Domain Explanation Language
Credit: The upstream authors and contributors retain credit for the project and mathematics. lean4-explainer only renders their pinned source and adds the separately disclosed explanation layer.
Project sources: Pinned project documentation, Formal Conjectures paper, arXiv v1
30 declarations, 0 contain sorry, 0 declared as axioms
Imports (5)
Imported by 5 files
- def
SimpleGraph.distToSetDistance from a vertex to a finite set line 31 sourceSource documentation
Distance from a vertex to a finite set.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fintype,SimpleGraph,Set,NatProof uses:
dite,Finset.Nonempty,Set.toFinset,Membership.mem,Classical.propDecidable,Finset.min',Finset.image,SimpleGraph.dist,Not,OfNat.ofNat7 instances, coercions and auxiliary constants left out.
noncomputable def distToSet (G : SimpleGraph α) (v : α) (S : Set α) : ℕ := …
Mentions: SimpleGraph.S
- def
SimpleGraph.averageDistanceAverage distance ofGline 38 sourceSource documentation
Average distance of
G.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fintype,SimpleGraph,RealProof uses:
ite,GT.gt,Nat,Fintype.card,OfNat.ofNat,HDiv.hDiv,Finset.sum,Finset.univ,SimpleGraph.dist,HMul.hMul,HSub.hSub17 instances, coercions and auxiliary constants left out.
noncomputable def averageDistance (G : SimpleGraph α) : ℝ := …
- def
SimpleGraph.isInducedPathCheck if a list of vertices forms an induced path inGline 46 sourceSource documentation
Check if a list of vertices forms an induced path in
G.no axioms what this means
Statement uses:
SimpleGraph,ListProof uses:
And,List.Nodup,Fin,List.length,Iff,SimpleGraph.Adj,List.get,Or,Eq,Nat,HAdd.hAdd,OfNat.ofNat4 instances, coercions and auxiliary constants left out.
def isInducedPath (G : SimpleGraph α) (l : List α) : Prop := …
Mentions: SimpleGraph.l
- def
SimpleGraph.pathThe path number of a graph: The number of vertices of a largest induced path of the graph line 50 sourceSource documentation
The path number of a graph: The number of vertices of a largest induced path of the graph.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fintype,DecidableEq,SimpleGraph,NatProof uses:
Finset,Finset.filter,Exists,List,And,Eq,List.toFinset, SimpleGraph.isInducedPath,Classical.propDecidable,Finset.univ,Option.getD,Finset.max,Finset.image,Finset.card,OfNat.ofNat4 instances, coercions and auxiliary constants left out.
noncomputable def path (G : SimpleGraph α) : ℕ := …
- theorem
SimpleGraph.length_le_path_of_isInducedPathAn explicit induced path witnesses a lower bound forpathline 57 sourceSource documentation
An explicit induced path witnesses a lower bound for
path.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fintype,DecidableEq,SimpleGraph,List, SimpleGraph.isInducedPath,LE.le,Nat,List.length, SimpleGraph.pathProof uses:
id,Finset,Finset.filter,Exists,And,Eq,List.toFinset,Classical.propDecidable,Finset.univ,Membership.mem,Eq.mpr,Eq.trans,True,congrFun',congrArg,true_and,Exists.intro,And.intro,rfl,Finset.imageand 26 more31 instances, coercions and auxiliary constants left out.
Tactic trace: 15 steps
Open to load the checked before-and-after goal states.
theorem length_le_path_of_isInducedPath (G : SimpleGraph α) (l : List α) (hl : G.isInducedPath l) : l.length ≤ path G := by …Mentions: SimpleGraph.l, SimpleGraph.path
- theorem
SimpleGraph.path_le_of_isInducedPath_length_leA uniform upper bound on the lengths of induced paths boundspathline 79 sourceSource documentation
A uniform upper bound on the lengths of induced paths bounds
path.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fintype,DecidableEq,SimpleGraph,Nat,List, SimpleGraph.isInducedPath,LE.le,List.length, SimpleGraph.pathProof uses:
id,Finset,Finset.filter,Exists,And,Eq,List.toFinset,Classical.propDecidable,Finset.univ,Option.getD,Finset.max,Finset.image,Finset.card,OfNat.ofNat,WithBot,Finset.max_le,Membership.mem,Iff.mp,Finset.mem_image,Finset.mem_filterand 19 more29 instances, coercions and auxiliary constants left out.
Tactic trace: 17 steps
Open to load the checked before-and-after goal states.
theorem path_le_of_isInducedPath_length_le (G : SimpleGraph α) (k : ℕ) (h : ∀ l : List α, G.isInducedPath l → l.length ≤ k) : path G ≤ k := by …Mentions: SimpleGraph.l, SimpleGraph.path
- theorem
SimpleGraph.path_le_of_not_exists_inducedPath_succIfGhas no induced path onk + 1vertices, thenpath G ≤ kline 102 sourceSource documentation
If
Ghas no induced path onk + 1vertices, thenpath G ≤ k.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fintype,DecidableEq,SimpleGraph,Nat,Not,Exists,Fin,HAdd.hAdd,OfNat.ofNat,And,Function.Injective,Iff,SimpleGraph.Adj,Or,Eq,LE.le, SimpleGraph.pathProof uses: SimpleGraph.path_le_of_isInducedPath_length_le,
List, SimpleGraph.isInducedPath,Decidable.byContradiction,List.length,List.get,Fin.mk,lt_of_lt_of_le,Fin.isLt,Exists.intro,And.intro,Fin.ext,congrArg,List.Nodup.injective_get,And.left,List.Nodup,id,And.right13 instances, coercions and auxiliary constants left out.
Tactic trace: 16 steps
Open to load the checked before-and-after goal states.
theorem path_le_of_not_exists_inducedPath_succ (G : SimpleGraph α) (k : ℕ) (h : ¬ ∃ e : Fin (k + 1) → α, Function.Injective e ∧ ∀ i j : Fin (k + 1), G.Adj (e i) (e j) ↔ i.val + 1 = j.val ∨ j.val + 1 = i.val) : path G ≤ k := by …Mentions: SimpleGraph.path
- def
SimpleGraph.eccAuxiliary quantityeccused in conjecture 34 line 122 sourceSource documentation
Auxiliary quantity
eccused in conjecture 34.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fintype,SimpleGraph,Set,NatProof uses:
Finset,Finset.filter,Not,Membership.mem,Classical.propDecidable,Finset.univ,dite,Finset.Nonempty,Finset.max',Finset.image, SimpleGraph.distToSet,OfNat.ofNat7 instances, coercions and auxiliary constants left out.
noncomputable def ecc (G : SimpleGraph α) (S : Set α) : ℕ := …
Mentions: SimpleGraph.S
- def
SimpleGraph.distMinThe minimum distance between distinct vertices of $S$: $\min \{\operatorname{dist}_G(u, v) \mid u, v \in S, u \ne v\}$ line 132 sourceSource documentation
The minimum distance between distinct vertices of $S$: $\min \{\operatorname{dist}_G(u, v) \mid u, v \in S, u \ne v\}$. Returns
0when $S$ contains fewer than two vertices.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fintype,DecidableEq,SimpleGraph,Set,NatProof uses:
Finset,Prod,Finset.filter,Ne,Prod.fst,Prod.snd,Eq,SProd.sprod,Set.toFinset,Membership.mem,Classical.propDecidable,dite,Finset.Nonempty,Finset.min',Finset.image,SimpleGraph.dist,Not,OfNat.ofNat9 instances, coercions and auxiliary constants left out.
noncomputable def distMin (G : SimpleGraph α) (S : Set α) : ℕ := …
Mentions: SimpleGraph.S
- def
SimpleGraph.eccSetThe eccentricity of a setS: the maximum, over all verticesvofG, of the minimum distance fromvto any vertex inSline 147 sourceSource documentation
The eccentricity of a set
S: the maximum, over all verticesvofG, of the minimum distance fromvto any vertex inS. (This includes vertices inSitself, which contribute distance0.) Returns0whenSis empty.Unlike
ecc, which restricts the outer maximum to verticesv ∉ S,eccSetdoes not exclude any vertex; it is the conventional definition of "set eccentricity" used in DeLaVina's WOWII conjectures 142, 145 and 146.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fintype,SimpleGraph,Set,NatProof uses:
Finset,Finset.image, SimpleGraph.distToSet,Finset.univ,dite,Finset.Nonempty,Finset.max',Not,OfNat.ofNat4 instances, coercions and auxiliary constants left out.
noncomputable def eccSet (G : SimpleGraph α) (S : Set α) : ℕ := …
Mentions: SimpleGraph.S
- def
SimpleGraph.distMaxSetThe maximum distance between two vertices of a setS: $\operatorname{dist}_{\max}(S) = \max\{\operatorname{dist}_G(u,v) \mid u, v \in S\}$ line 158 sourceSource documentation
The maximum distance between two vertices of a set
S: $\operatorname{dist}_{\max}(S) = \max\{\operatorname{dist}_G(u,v) \mid u, v \in S\}$. Returns0whenSis empty or a singleton.This is DeLaVina's
dist_max(S)invariant ("distance between maximum degree vertices" whenS = M), used in WOWII conjecture 18. It is distinct fromeccSet, which measures distances from arbitrary vertices to the set.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fintype,SimpleGraph,Set,NatProof uses:
Finset,Finset.filter,Membership.mem,Classical.propDecidable,Finset.univ,Finset.sup,Prod,SProd.sprod,SimpleGraph.dist,Prod.fst,Prod.snd5 instances, coercions and auxiliary constants left out.
noncomputable def distMaxSet (G : SimpleGraph α) (S : Set α) : ℕ := …
Mentions: SimpleGraph.S
- def
SimpleGraph.distAvgSetThe average distance between distinct vertices of a setSline 171 sourceSource documentation
The average distance between distinct vertices of a set
S: $\operatorname{dist}_{\operatorname{avg}}(S)$ is the mean of $\operatorname{dist}_G(u, v)$ over all ordered pairs $(u, v)$ of distinct vertices of $S$. Returns0when $S$ contains fewer than two vertices.This is DeLaVina's
dist_avg(S)invariant ("average distance between maximum degree vertices" whenS = M), used in WOWII conjecture 23. It is distinct fromdistavg, which averages the distances from all vertices ofGto the set.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fintype,DecidableEq,SimpleGraph,Set,RealProof uses:
Finset,Prod,Finset.filter,Ne,Prod.fst,Prod.snd,Eq,SProd.sprod,Set.toFinset,Membership.mem,Classical.propDecidable,ite,Finset.Nonempty,HDiv.hDiv,Finset.sum,SimpleGraph.dist,Finset.card,OfNat.ofNat13 instances, coercions and auxiliary constants left out.
noncomputable def distAvgSet (G : SimpleGraph α) (S : Set α) : ℝ := …
Mentions: SimpleGraph.S
- def
SimpleGraph.distavgAverage distance from all vertices to a given set line 179 sourceSource documentation
Average distance from all vertices to a given set.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fintype,SimpleGraph,Set,RealProof uses:
ite,GT.gt,Nat,Fintype.card,OfNat.ofNat,HDiv.hDiv,Finset.sum,Finset.univ, SimpleGraph.distToSet11 instances, coercions and auxiliary constants left out.
noncomputable def distavg (G : SimpleGraph α) (S : Set α) : ℝ := …
Mentions: SimpleGraph.S
- def
SimpleGraph.graphSquareThe square of a graphG, denotedG²: two distinct vertices are adjacent iff their distance inGis at most 2 line 192 sourceSource documentation
The square of a graph
G, denotedG²: two distinct vertices are adjacent iff their distance inGis at most 2.The bound uses the extended distance
SimpleGraph.edist, which is⊤for unreachable vertices. The natural-valuedSimpleGraph.distis0there, so it would make distinct vertices in different components adjacent: the square of the edgeless graph on two vertices would be the complete graph.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
SimpleGraphProof uses:
SimpleGraph.mk,And,Ne,LE.le,ENat,SimpleGraph.edist,OfNat.ofNat6 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
def graphSquare (G : SimpleGraph α) : SimpleGraph α where …
- def
SimpleGraph.isInducedC4Check whether four distinct vertices form an induced 4-cycle inGline 200 sourceSource documentation
Check whether four distinct vertices form an induced 4-cycle in
G. We test all three perfect-matching pairings of the four vertices to find a cyclic ordering and verify that the induced subgraph has exactly those 4 edges.no axioms what this means
Statement uses:
SimpleGraph,DecidableRel,SimpleGraph.Adj,BoolProof uses:
Bool.and,Decidable.decide,Bool.not,Bool.ornoncomputable def isInducedC4 (G : SimpleGraph α) [DecidableRel G.Adj] (a b c d : α) : Bool := …Mentions: SimpleGraph.b, c
- def
SimpleGraph.countInducedC4Count of induced C₄ subgraphs ofGline 218 sourceSource documentation
Count of induced C₄ subgraphs of
G. We count ordered 4-tuples(a,b,c,d)of distinct vertices for whichisInducedC4 G a b c d = true, then divide by24 = 4!.Why 24 (and not 8)?
isInducedC4tests all three perfect-matching pairings of the four vertices, so any of the4! = 24orderings of a fixed unordered induced 4-cycle satisfies the predicate. Dividing by8(the size of the dihedral groupD₄) would overcount each induced 4-cycle by a factor of3— once for each of the three cyclic structuresisInducedC4accepts.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fintype,DecidableEq,SimpleGraph,DecidableRel,SimpleGraph.Adj,NatProof uses:
HDiv.hDiv,Finset.sum,Finset.univ,ite,And,Ne,Eq,Bool, SimpleGraph.isInducedC4,Bool.true,OfNat.ofNat7 instances, coercions and auxiliary constants left out.
noncomputable def countInducedC4 (G : SimpleGraph α) [DecidableRel G.Adj] : ℕ := …
- def
SimpleGraph.bfs_dist_auxline 223 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fintype,DecidableEq,SimpleGraph,DecidableRel,SimpleGraph.Adj,Nat,Finset2 instances, coercions and auxiliary constants left out.
- def
SimpleGraph.computable_distComputable graph distance via BFS line 231 sourceSource documentation
Computable graph distance via BFS. Returns 0 if u = v or if v is unreachable from u.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fintype,DecidableEq,SimpleGraph,DecidableRel,SimpleGraph.Adj,NatProof uses:
ite,Eq,OfNat.ofNat, SimpleGraph.bfs_dist_aux,Fintype.card, SimpleGraph.bfsStep,Singleton.singleton,Finset2 instances, coercions and auxiliary constants left out.
def computable_dist (G : SimpleGraph α) [DecidableRel G.Adj] (u v : α) : ℕ := …
- def
SimpleGraph.computableDistMinA computable version ofdistMinfor aFinsetof vertices line 236 sourceSource documentation
A computable version of
distMinfor aFinsetof vertices.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fintype,DecidableEq,SimpleGraph,DecidableRel,SimpleGraph.Adj,Finset,NatProof uses:
Prod,Finset.filter,Ne,Prod.fst,Prod.snd,Eq,SProd.sprod,dite,Finset.Nonempty,Finset.min',Finset.image, SimpleGraph.computable_dist,Not,OfNat.ofNat7 instances, coercions and auxiliary constants left out.
def computableDistMin (G : SimpleGraph α) [DecidableRel G.Adj] (S : Finset α) : ℕ := …
Mentions: SimpleGraph.S
- def
SimpleGraph.computable_avg_distComputable average distance as a rational line 243 sourceSource documentation
Computable average distance as a rational.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fintype,DecidableEq,SimpleGraph,DecidableRel,SimpleGraph.Adj,RatProof uses:
ite,GT.gt,Nat,Fintype.card,OfNat.ofNat,HDiv.hDiv,Finset.sum,Finset.univ, SimpleGraph.computable_dist,HMul.hMul,HSub.hSub13 instances, coercions and auxiliary constants left out.
def computable_avg_dist (G : SimpleGraph α) [DecidableRel G.Adj] : ℚ := …
- lemma
SimpleGraph.mem_iterate_bfsStep_dist_leline 250 source - lemma
SimpleGraph.dist_le_mem_iterate_bfsStepline 275 source - theorem
SimpleGraph.dist_eq_computableline 302 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fintype,DecidableEq,SimpleGraph,DecidableRel,SimpleGraph.Adj,Eq,Nat,SimpleGraph.dist, SimpleGraph.computable_distProof uses:
id,dite,ite,OfNat.ofNat, SimpleGraph.bfs_dist_aux,Fintype.card, SimpleGraph.bfsStep,Singleton.singleton,Finset,Eq.mpr,congrArg,if_pos,of_eq_true,Eq.trans,True,congrFun',SimpleGraph.dist_self,eq_self,Not,if_negand 53 more32 instances, coercions and auxiliary constants left out.
Tactic trace: 55 steps
Open to load the checked before-and-after goal states.
- theorem
SimpleGraph.distMin_eq_computableDistMincomputableDistMinagrees withdistMinon a finite vertex set line 361 sourceSource documentation
computableDistMinagrees withdistMinon a finite vertex set.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fintype,DecidableEq,SimpleGraph,DecidableRel,SimpleGraph.Adj,Finset,Eq,Nat, SimpleGraph.distMin, SimpleGraph.computableDistMinProof uses:
id,Prod,Finset.filter,Ne,Prod.fst,Prod.snd,SProd.sprod,Set.toFinset,Membership.mem,Set,Classical.propDecidable,dite,Finset.Nonempty,Finset.min',Finset.image,SimpleGraph.dist,Not,OfNat.ofNat,Eq.mpr, SimpleGraph.computable_dist and 22 more19 instances, coercions and auxiliary constants left out.
Tactic trace: 16 steps
Open to load the checked before-and-after goal states.
theorem distMin_eq_computableDistMin (G : SimpleGraph α) [DecidableRel G.Adj] (S : Finset α) : distMin G (S : Set α) = computableDistMin G S := by …Mentions: SimpleGraph.S, SimpleGraph.distMin, SimpleGraph.computableDistMin
- theorem
SimpleGraph.avg_dist_eq_computableline 376 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fintype,DecidableEq,SimpleGraph,DecidableRel,SimpleGraph.Adj,Eq,Real, SimpleGraph.averageDistance, SimpleGraph.computable_avg_distProof uses:
id,ite,GT.gt,Nat,Fintype.card,OfNat.ofNat,HDiv.hDiv,Finset.sum,Finset.univ,SimpleGraph.dist,HMul.hMul,HSub.hSub,dite,Rat, SimpleGraph.computable_dist,Eq.mpr,congr,congrArg,if_pos,Eq.transand 64 more82 instances, coercions and auxiliary constants left out.
Tactic trace: 15 steps
Open to load the checked before-and-after goal states.
- def
SimpleGraph.distEvendistEven G vcounts the vertices at even distance fromvinGline 396 sourceSource documentation
distEven G vcounts the vertices at even distance fromvinG. This is DeLaVina'sdist_even(v)invariant appearing in several WOWII conjectures. Distance zero is even, sovitself is always counted.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fintype,SimpleGraph,NatProof uses:
Finset.card,Finset.filter,Even,SimpleGraph.dist,Finset.univ2 instances, coercions and auxiliary constants left out.
noncomputable def distEven (G : SimpleGraph α) (v : α) : ℕ := …
- def
SimpleGraph.evenDistancePairsThe set of pairs of distinct vertices with even distance > 0 line 400 sourceSource documentation
The set of pairs of distinct vertices with even distance > 0.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fintype,SimpleGraph,Finset,ProdProof uses:
Finset.filter,And,Eq,Nat,HMod.hMod,SimpleGraph.dist,Prod.fst,Prod.snd,OfNat.ofNat,GT.gt,Finset.univ8 instances, coercions and auxiliary constants left out.
noncomputable def evenDistancePairs (G : SimpleGraph α) : Finset (α × α) := …
- def
SimpleGraph.minEvenDistanceMinimum even distance between distinct vertices inGline 405 sourceSource documentation
Minimum even distance between distinct vertices in
G. Only positive even distances are considered. Returns 0 if no such distance exists.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fintype,SimpleGraph,NatProof uses:
dite,Finset.Nonempty,Prod, SimpleGraph.evenDistancePairs,Finset.min',Finset.image,SimpleGraph.dist,Prod.fst,Prod.snd,Not,OfNat.ofNat5 instances, coercions and auxiliary constants left out.
noncomputable def minEvenDistance (G : SimpleGraph α) : ℕ := …
- def
SimpleGraph.maxEvenDistanceMaximum even distance between distinct vertices inGline 414 sourceSource documentation
Maximum even distance between distinct vertices in
G. Only positive even distances are considered. Returns 0 if no such distance exists.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fintype,SimpleGraph,NatProof uses:
dite,Finset.Nonempty,Prod, SimpleGraph.evenDistancePairs,Finset.max',Finset.image,SimpleGraph.dist,Prod.fst,Prod.snd,Not,OfNat.ofNat5 instances, coercions and auxiliary constants left out.
noncomputable def maxEvenDistance (G : SimpleGraph α) : ℕ := …
- def
SimpleGraph.averageEvenDistanceAverage even distance between distinct vertices inGline 423 sourceSource documentation
Average even distance between distinct vertices in
G. Only positive even distances are considered. Returns 0 if no such distance exists.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fintype,SimpleGraph,RatProof uses:
ite,GT.gt,Nat,Finset.card,Prod, SimpleGraph.evenDistancePairs,OfNat.ofNat,HDiv.hDiv,Finset.sum,SimpleGraph.dist,Prod.fst,Prod.snd9 instances, coercions and auxiliary constants left out.
noncomputable def averageEvenDistance (G : SimpleGraph α) : ℚ := …