@@ -77,6 +77,9 @@ protected theorem Walk.reachable {G : SimpleGraph V} {u v : V} (p : G.Walk u v)
7777protected theorem Adj.reachable {u v : V} (h : G.Adj u v) : G.Reachable u v :=
7878 h.toWalk.reachable
7979
80+ theorem adj_le_reachable (G : SimpleGraph V) : G.Adj ≤ G.Reachable :=
81+ fun _ _ ↦ Adj.reachable
82+
8083@[refl]
8184protected theorem Reachable.refl (u : V) : G.Reachable u u := ⟨Walk.nil⟩
8285
@@ -106,6 +109,21 @@ theorem reachable_iff_reflTransGen (u v : V) :
106109 | refl => rfl
107110 | tail _ ha hr => exact Reachable.trans hr ⟨Walk.cons ha Walk.nil⟩
108111
112+ theorem reachable_eq_reflTransGen : G.Reachable = Relation.ReflTransGen G.Adj := by
113+ ext
114+ exact reachable_iff_reflTransGen ..
115+
116+ theorem reachable_fromEdgeSet_eq_reflTransGen_toRel {s : Set (Sym2 V)} :
117+ (fromEdgeSet s).Reachable = Relation.ReflTransGen (Sym2.ToRel s) := by
118+ rw [reachable_eq_reflTransGen, ← Relation.transGen_reflGen, ← Relation.transGen_reflGen]
119+ congr 1
120+ ext
121+ simpa [Relation.reflGen_iff] using by tauto
122+
123+ theorem reachable_fromEdgeSet_fromRel_eq_reflTransGen {r : V → V → Prop } (sym : Symmetric r) :
124+ (fromEdgeSet <| Sym2.fromRel sym).Reachable = Relation.ReflTransGen r :=
125+ reachable_fromEdgeSet_eq_reflTransGen_toRel
126+
109127protected theorem Reachable.map {u v : V} {G : SimpleGraph V} {G' : SimpleGraph V'} (f : G →g G')
110128 (h : G.Reachable u v) : G'.Reachable (f u) (f v) :=
111129 h.elim fun p => ⟨p.map f⟩
@@ -114,6 +132,10 @@ protected theorem Reachable.map {u v : V} {G : SimpleGraph V} {G' : SimpleGraph
114132protected lemma Reachable.mono {u v : V} {G G' : SimpleGraph V}
115133 (h : G ≤ G') (Guv : G.Reachable u v) : G'.Reachable u v := Guv.map (.ofLE h)
116134
135+ @[mono]
136+ theorem Reachable.mono' {G G' : SimpleGraph V} (h : G ≤ G') : G.Reachable ≤ G'.Reachable :=
137+ fun _ _ ↦ Reachable.mono h
138+
117139theorem Reachable.exists_isPath {u v} (hr : G.Reachable u v) : ∃ p : G.Walk u v, p.IsPath := by
118140 classical
119141 obtain ⟨W⟩ := hr
0 commit comments