Skip to content

Commit 6419beb

Browse files
IvanRenisonvlad902
andcommitted
Use proof of IsPath.bypass_eq_self from #35398
Co-authored-by: Vlad Tsyrklevich <vlad@tsyrklevi.ch>
1 parent 6a2936e commit 6419beb

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

Mathlib/Combinatorics/SimpleGraph/Paths.lean

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -785,15 +785,16 @@ theorem darts_toPath_subset (p : G.Walk u v) : (p.toPath : G.Walk u v).darts ⊆
785785
theorem edges_toPath_subset (p : G.Walk u v) : (p.toPath : G.Walk u v).edges ⊆ p.edges :=
786786
edges_bypass_subset _
787787

788+
@[simp]
789+
lemma bypass_cons_nil (hadj : G.Adj u v) : (cons hadj nil).bypass = cons hadj nil := by
790+
grind [bypass, support_nil, SimpleGraph.irrefl]
791+
792+
@[simp]
793+
lemma bypass_eq_nil (p : G.Walk u u) : p.bypass = nil := by
794+
grind [p.bypass_isPath, isPath_iff_eq_nil]
795+
788796
theorem IsPath.bypass_eq_self {p : G.Walk u v} (hp : p.IsPath) : p.bypass = p := by
789-
induction p with
790-
| nil => rfl
791-
| @cons u v w h p ih =>
792-
simp only [bypass]
793-
have hu : u ∉ p.support := ((p.cons_isPath_iff h).mp hp).right
794-
have hu' : u ∉ p.bypass.support := List.notMem_subset p.support_bypass_subset hu
795-
simp only [hu', reduceDIte, cons.injEq, heq_eq_eq, true_and]
796-
exact ih hp.of_cons
797+
induction p <;> grind [cons_isPath_iff, bypass]
797798

798799
theorem bypass_eq_self_iff_isPath (p : G.Walk u v) : p.bypass = p ↔ p.IsPath := by
799800
constructor

0 commit comments

Comments
 (0)