combinatorics.quiver.path
⟷
Mathlib.Combinatorics.Quiver.Path
The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(last sync)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
cast
arrows and paths along equalities (#17617)
Authored-by: Antoine Labelle <antoinelab01@gmail.com>
Co-authored-by: antoinelab01 <66086247+antoinelab01@users.noreply.github.com> Co-authored-by: Antoine Labelle <antoinelab01@gmail.com> Co-authored-by: Rémi Bottinelli <bottine@users.noreply.github.com>
@@ -34,7 +34,20 @@ path.nil.cons e
namespace path
-variables {V : Type u} [quiver V] {a b c : V}
+variables {V : Type u} [quiver V] {a b c d : V}
+
+lemma nil_ne_cons (p : path a b) (e : b ⟶ a) : path.nil ≠ p.cons e.
+
+lemma cons_ne_nil (p : path a b) (e : b ⟶ a) : p.cons e ≠ path.nil.
+
+lemma obj_eq_of_cons_eq_cons {p : path a b} {p' : path a c}
+ {e : b ⟶ d} {e' : c ⟶ d} (h : p.cons e = p'.cons e') : b = c := by injection h
+
+lemma heq_of_cons_eq_cons {p : path a b} {p' : path a c}
+ {e : b ⟶ d} {e' : c ⟶ d} (h : p.cons e = p'.cons e') : p == p' := by injection h
+
+lemma hom_heq_of_cons_eq_cons {p : path a b} {p' : path a c}
+ {e : b ⟶ d} {e' : c ⟶ d} (h : p.cons e = p'.cons e') : e == e' := by injection h
/-- The length of a path is the number of arrows it uses. -/
def length {a : V} : Π {b : V}, path a b → ℕ
@@ -59,10 +72,13 @@ def comp {a b : V} : Π {c}, path a b → path b c → path a c
@[simp] lemma comp_cons {a b c d : V} (p : path a b) (q : path b c) (e : c ⟶ d) :
p.comp (q.cons e) = (p.comp q).cons e := rfl
+
@[simp] lemma comp_nil {a b : V} (p : path a b) : p.comp path.nil = p := rfl
+
@[simp] lemma nil_comp {a : V} : ∀ {b} (p : path a b), path.nil.comp p = p
| a path.nil := rfl
| b (path.cons p e) := by rw [comp_cons, nil_comp]
+
@[simp] lemma comp_assoc {a b c : V} : ∀ {d}
(p : path a b) (q : path b c) (r : path c d),
(p.comp q).comp r = p.comp (q.comp r)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(first ported)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -162,7 +162,7 @@ theorem comp_inj {p₁ p₂ : Path a b} {q₁ q₂ : Path b c} (hq : q₁.length
· exact ⟨h, rfl⟩
· cases hq
· cases hq
- simp only [comp_cons] at h
+ simp only [comp_cons] at h
obtain rfl := h.1
obtain ⟨rfl, rfl⟩ := ih (Nat.succ.inj hq) h.2.1.Eq
rw [h.2.2.Eq]
@@ -239,7 +239,7 @@ theorem toList_injective (a : V) : ∀ b, Injective (toList : Path a b → List
| b, @cons _ _ _ c _ p f, nil, h => by cases h
| b, @cons _ _ _ c _ p f, @cons _ _ s t u C D, h =>
by
- simp only [to_list] at h
+ simp only [to_list] at h
obtain ⟨rfl, hAC⟩ := h
simp [to_list_injective _ hAC]
#align quiver.path.to_list_injective Quiver.Path.toList_injective
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,8 +3,8 @@ Copyright (c) 2021 David Wärn,. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: David Wärn, Scott Morrison
-/
-import Mathbin.Combinatorics.Quiver.Basic
-import Mathbin.Logic.Lemmas
+import Combinatorics.Quiver.Basic
+import Logic.Lemmas
#align_import combinatorics.quiver.path from "leanprover-community/mathlib"@"448144f7ae193a8990cb7473c9e9a01990f64ac7"
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,15 +2,12 @@
Copyright (c) 2021 David Wärn,. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: David Wärn, Scott Morrison
-
-! This file was ported from Lean 3 source module combinatorics.quiver.path
-! leanprover-community/mathlib commit 448144f7ae193a8990cb7473c9e9a01990f64ac7
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Combinatorics.Quiver.Basic
import Mathbin.Logic.Lemmas
+#align_import combinatorics.quiver.path from "leanprover-community/mathlib"@"448144f7ae193a8990cb7473c9e9a01990f64ac7"
+
/-!
# Paths in quivers
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -47,25 +47,35 @@ namespace Path
variable {V : Type u} [Quiver V] {a b c d : V}
+#print Quiver.Path.nil_ne_cons /-
theorem nil_ne_cons (p : Path a b) (e : b ⟶ a) : Path.nil ≠ p.cons e :=
fun.
#align quiver.path.nil_ne_cons Quiver.Path.nil_ne_cons
+-/
+#print Quiver.Path.cons_ne_nil /-
theorem cons_ne_nil (p : Path a b) (e : b ⟶ a) : p.cons e ≠ Path.nil :=
fun.
#align quiver.path.cons_ne_nil Quiver.Path.cons_ne_nil
+-/
+#print Quiver.Path.obj_eq_of_cons_eq_cons /-
theorem obj_eq_of_cons_eq_cons {p : Path a b} {p' : Path a c} {e : b ⟶ d} {e' : c ⟶ d}
(h : p.cons e = p'.cons e') : b = c := by injection h
#align quiver.path.obj_eq_of_cons_eq_cons Quiver.Path.obj_eq_of_cons_eq_cons
+-/
+#print Quiver.Path.heq_of_cons_eq_cons /-
theorem heq_of_cons_eq_cons {p : Path a b} {p' : Path a c} {e : b ⟶ d} {e' : c ⟶ d}
(h : p.cons e = p'.cons e') : HEq p p' := by injection h
#align quiver.path.heq_of_cons_eq_cons Quiver.Path.heq_of_cons_eq_cons
+-/
+#print Quiver.Path.hom_heq_of_cons_eq_cons /-
theorem hom_heq_of_cons_eq_cons {p : Path a b} {p' : Path a c} {e : b ⟶ d} {e' : c ⟶ d}
(h : p.cons e = p'.cons e') : HEq e e' := by injection h
#align quiver.path.hom_heq_of_cons_eq_cons Quiver.Path.hom_heq_of_cons_eq_cons
+-/
#print Quiver.Path.length /-
/-- The length of a path is the number of arrows it uses. -/
@@ -78,19 +88,25 @@ def length {a : V} : ∀ {b : V}, Path a b → ℕ
instance {a : V} : Inhabited (Path a a) :=
⟨Path.nil⟩
+#print Quiver.Path.length_nil /-
@[simp]
theorem length_nil {a : V} : (Path.nil : Path a a).length = 0 :=
rfl
#align quiver.path.length_nil Quiver.Path.length_nil
+-/
+#print Quiver.Path.length_cons /-
@[simp]
theorem length_cons (a b c : V) (p : Path a b) (e : b ⟶ c) : (p.cons e).length = p.length + 1 :=
rfl
#align quiver.path.length_cons Quiver.Path.length_cons
+-/
+#print Quiver.Path.eq_of_length_zero /-
theorem eq_of_length_zero (p : Path a b) (hzero : p.length = 0) : a = b := by cases p; · rfl;
· cases Nat.succ_ne_zero _ hzero
#align quiver.path.eq_of_length_zero Quiver.Path.eq_of_length_zero
+-/
#print Quiver.Path.comp /-
/-- Composition of paths. -/
@@ -100,36 +116,47 @@ def comp {a b : V} : ∀ {c}, Path a b → Path b c → Path a c
#align quiver.path.comp Quiver.Path.comp
-/
+#print Quiver.Path.comp_cons /-
@[simp]
theorem comp_cons {a b c d : V} (p : Path a b) (q : Path b c) (e : c ⟶ d) :
p.comp (q.cons e) = (p.comp q).cons e :=
rfl
#align quiver.path.comp_cons Quiver.Path.comp_cons
+-/
+#print Quiver.Path.comp_nil /-
@[simp]
theorem comp_nil {a b : V} (p : Path a b) : p.comp Path.nil = p :=
rfl
#align quiver.path.comp_nil Quiver.Path.comp_nil
+-/
+#print Quiver.Path.nil_comp /-
@[simp]
theorem nil_comp {a : V} : ∀ {b} (p : Path a b), Path.nil.comp p = p
| a, path.nil => rfl
| b, path.cons p e => by rw [comp_cons, nil_comp]
#align quiver.path.nil_comp Quiver.Path.nil_comp
+-/
+#print Quiver.Path.comp_assoc /-
@[simp]
theorem comp_assoc {a b c : V} :
∀ {d} (p : Path a b) (q : Path b c) (r : Path c d), (p.comp q).comp r = p.comp (q.comp r)
| c, p, q, path.nil => rfl
| d, p, q, path.cons r e => by rw [comp_cons, comp_cons, comp_cons, comp_assoc]
#align quiver.path.comp_assoc Quiver.Path.comp_assoc
+-/
+#print Quiver.Path.length_comp /-
@[simp]
theorem length_comp (p : Path a b) : ∀ {c} (q : Path b c), (p.comp q).length = p.length + q.length
| c, nil => rfl
| c, cons q h => congr_arg Nat.succ q.length_comp
#align quiver.path.length_comp Quiver.Path.length_comp
+-/
+#print Quiver.Path.comp_inj /-
theorem comp_inj {p₁ p₂ : Path a b} {q₁ q₂ : Path b c} (hq : q₁.length = q₂.length) :
p₁.comp q₁ = p₂.comp q₂ ↔ p₁ = p₂ ∧ q₁ = q₂ :=
by
@@ -144,30 +171,41 @@ theorem comp_inj {p₁ p₂ : Path a b} {q₁ q₂ : Path b c} (hq : q₁.length
rw [h.2.2.Eq]
exact ⟨rfl, rfl⟩
#align quiver.path.comp_inj Quiver.Path.comp_inj
+-/
+#print Quiver.Path.comp_inj' /-
theorem comp_inj' {p₁ p₂ : Path a b} {q₁ q₂ : Path b c} (h : p₁.length = p₂.length) :
p₁.comp q₁ = p₂.comp q₂ ↔ p₁ = p₂ ∧ q₁ = q₂ :=
⟨fun h_eq => (comp_inj <| Nat.add_left_cancel <| by simpa [h] using congr_arg length h_eq).1 h_eq,
by rintro ⟨rfl, rfl⟩; rfl⟩
#align quiver.path.comp_inj' Quiver.Path.comp_inj'
+-/
+#print Quiver.Path.comp_injective_left /-
theorem comp_injective_left (q : Path b c) : Injective fun p : Path a b => p.comp q :=
fun p₁ p₂ h => ((comp_inj rfl).1 h).1
#align quiver.path.comp_injective_left Quiver.Path.comp_injective_left
+-/
+#print Quiver.Path.comp_injective_right /-
theorem comp_injective_right (p : Path a b) : Injective (p.comp : Path b c → Path a c) :=
fun q₁ q₂ h => ((comp_inj' rfl).1 h).2
#align quiver.path.comp_injective_right Quiver.Path.comp_injective_right
+-/
+#print Quiver.Path.comp_inj_left /-
@[simp]
theorem comp_inj_left {p₁ p₂ : Path a b} {q : Path b c} : p₁.comp q = p₂.comp q ↔ p₁ = p₂ :=
q.comp_injective_left.eq_iff
#align quiver.path.comp_inj_left Quiver.Path.comp_inj_left
+-/
+#print Quiver.Path.comp_inj_right /-
@[simp]
theorem comp_inj_right {p : Path a b} {q₁ q₂ : Path b c} : p.comp q₁ = p.comp q₂ ↔ q₁ = q₂ :=
p.comp_injective_right.eq_iff
#align quiver.path.comp_inj_right Quiver.Path.comp_inj_right
+-/
#print Quiver.Path.toList /-
/-- Turn a path into a list. The list contains `a` at its head, but not `b` a priori. -/
@@ -178,6 +216,7 @@ def toList : ∀ {b : V}, Path a b → List V
#align quiver.path.to_list Quiver.Path.toList
-/
+#print Quiver.Path.toList_comp /-
/-- `quiver.path.to_list` is a contravariant functor. The inversion comes from `quiver.path` and
`list` having different preferred directions for adding elements. -/
@[simp]
@@ -185,14 +224,18 @@ theorem toList_comp (p : Path a b) : ∀ {c} (q : Path b c), (p.comp q).toList =
| c, nil => by simp
| c, @cons _ _ _ d _ q f => by simp [to_list_comp]
#align quiver.path.to_list_comp Quiver.Path.toList_comp
+-/
+#print Quiver.Path.toList_chain_nonempty /-
theorem toList_chain_nonempty : ∀ {b} (p : Path a b), p.toList.Chain (fun x y => Nonempty (y ⟶ x)) b
| b, nil => List.Chain.nil
| b, cons p f => p.toList_chain_nonempty.cons ⟨f⟩
#align quiver.path.to_list_chain_nonempty Quiver.Path.toList_chain_nonempty
+-/
variable [∀ a b : V, Subsingleton (a ⟶ b)]
+#print Quiver.Path.toList_injective /-
theorem toList_injective (a : V) : ∀ b, Injective (toList : Path a b → List V)
| b, nil, nil, h => rfl
| b, nil, @cons _ _ _ c _ p f, h => by cases h
@@ -203,11 +246,14 @@ theorem toList_injective (a : V) : ∀ b, Injective (toList : Path a b → List
obtain ⟨rfl, hAC⟩ := h
simp [to_list_injective _ hAC]
#align quiver.path.to_list_injective Quiver.Path.toList_injective
+-/
+#print Quiver.Path.toList_inj /-
@[simp]
theorem toList_inj {p q : Path a b} : p.toList = q.toList ↔ p = q :=
(toList_injective _ _).eq_iff
#align quiver.path.to_list_inj Quiver.Path.toList_inj
+-/
end Path
mathlib commit https://github.com/leanprover-community/mathlib/commit/cca40788df1b8755d5baf17ab2f27dacc2e17acb
@@ -138,7 +138,7 @@ theorem comp_inj {p₁ p₂ : Path a b} {q₁ q₂ : Path b c} (hq : q₁.length
· exact ⟨h, rfl⟩
· cases hq
· cases hq
- simp only [comp_cons] at h
+ simp only [comp_cons] at h
obtain rfl := h.1
obtain ⟨rfl, rfl⟩ := ih (Nat.succ.inj hq) h.2.1.Eq
rw [h.2.2.Eq]
@@ -199,7 +199,7 @@ theorem toList_injective (a : V) : ∀ b, Injective (toList : Path a b → List
| b, @cons _ _ _ c _ p f, nil, h => by cases h
| b, @cons _ _ _ c _ p f, @cons _ _ s t u C D, h =>
by
- simp only [to_list] at h
+ simp only [to_list] at h
obtain ⟨rfl, hAC⟩ := h
simp [to_list_injective _ hAC]
#align quiver.path.to_list_injective Quiver.Path.toList_injective
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -47,52 +47,22 @@ namespace Path
variable {V : Type u} [Quiver V] {a b c d : V}
-/- warning: quiver.path.nil_ne_cons -> Quiver.Path.nil_ne_cons is a dubious translation:
-lean 3 declaration is
- forall {V : Type.{u1}} [_inst_1 : Quiver.{u2, u1} V] {a : V} {b : V} (p : Quiver.Path.{u2, u1} V _inst_1 a b) (e : Quiver.Hom.{u2, u1} V _inst_1 b a), Ne.{max (succ u1) u2} (Quiver.Path.{u2, u1} V _inst_1 a a) (Quiver.Path.nil.{u2, u1} V _inst_1 a) (Quiver.Path.cons.{u2, u1} V _inst_1 a b a p e)
-but is expected to have type
- forall {V : Type.{u2}} [_inst_1 : Quiver.{u1, u2} V] {a : V} {b : V} (p : Quiver.Path.{u1, u2} V _inst_1 a b) (e : Quiver.Hom.{u1, u2} V _inst_1 b a), Ne.{max (succ u2) u1} (Quiver.Path.{u1, u2} V _inst_1 a a) (Quiver.Path.nil.{u1, u2} V _inst_1 a) (Quiver.Path.cons.{u1, u2} V _inst_1 a b a p e)
-Case conversion may be inaccurate. Consider using '#align quiver.path.nil_ne_cons Quiver.Path.nil_ne_consₓ'. -/
theorem nil_ne_cons (p : Path a b) (e : b ⟶ a) : Path.nil ≠ p.cons e :=
fun.
#align quiver.path.nil_ne_cons Quiver.Path.nil_ne_cons
-/- warning: quiver.path.cons_ne_nil -> Quiver.Path.cons_ne_nil is a dubious translation:
-lean 3 declaration is
- forall {V : Type.{u1}} [_inst_1 : Quiver.{u2, u1} V] {a : V} {b : V} (p : Quiver.Path.{u2, u1} V _inst_1 a b) (e : Quiver.Hom.{u2, u1} V _inst_1 b a), Ne.{max (succ u1) u2} (Quiver.Path.{u2, u1} V _inst_1 a a) (Quiver.Path.cons.{u2, u1} V _inst_1 a b a p e) (Quiver.Path.nil.{u2, u1} V _inst_1 a)
-but is expected to have type
- forall {V : Type.{u2}} [_inst_1 : Quiver.{u1, u2} V] {a : V} {b : V} (p : Quiver.Path.{u1, u2} V _inst_1 a b) (e : Quiver.Hom.{u1, u2} V _inst_1 b a), Ne.{max (succ u2) u1} (Quiver.Path.{u1, u2} V _inst_1 a a) (Quiver.Path.cons.{u1, u2} V _inst_1 a b a p e) (Quiver.Path.nil.{u1, u2} V _inst_1 a)
-Case conversion may be inaccurate. Consider using '#align quiver.path.cons_ne_nil Quiver.Path.cons_ne_nilₓ'. -/
theorem cons_ne_nil (p : Path a b) (e : b ⟶ a) : p.cons e ≠ Path.nil :=
fun.
#align quiver.path.cons_ne_nil Quiver.Path.cons_ne_nil
-/- warning: quiver.path.obj_eq_of_cons_eq_cons -> Quiver.Path.obj_eq_of_cons_eq_cons is a dubious translation:
-lean 3 declaration is
- forall {V : Type.{u1}} [_inst_1 : Quiver.{u2, u1} V] {a : V} {b : V} {c : V} {d : V} {p : Quiver.Path.{u2, u1} V _inst_1 a b} {p' : Quiver.Path.{u2, u1} V _inst_1 a c} {e : Quiver.Hom.{u2, u1} V _inst_1 b d} {e' : Quiver.Hom.{u2, u1} V _inst_1 c d}, (Eq.{max (succ u1) u2} (Quiver.Path.{u2, u1} V _inst_1 a d) (Quiver.Path.cons.{u2, u1} V _inst_1 a b d p e) (Quiver.Path.cons.{u2, u1} V _inst_1 a c d p' e')) -> (Eq.{succ u1} V b c)
-but is expected to have type
- forall {V : Type.{u2}} [_inst_1 : Quiver.{u1, u2} V] {a : V} {b : V} {c : V} {d : V} {p : Quiver.Path.{u1, u2} V _inst_1 a b} {p' : Quiver.Path.{u1, u2} V _inst_1 a c} {e : Quiver.Hom.{u1, u2} V _inst_1 b d} {e' : Quiver.Hom.{u1, u2} V _inst_1 c d}, (Eq.{max (succ u2) u1} (Quiver.Path.{u1, u2} V _inst_1 a d) (Quiver.Path.cons.{u1, u2} V _inst_1 a b d p e) (Quiver.Path.cons.{u1, u2} V _inst_1 a c d p' e')) -> (Eq.{succ u2} V b c)
-Case conversion may be inaccurate. Consider using '#align quiver.path.obj_eq_of_cons_eq_cons Quiver.Path.obj_eq_of_cons_eq_consₓ'. -/
theorem obj_eq_of_cons_eq_cons {p : Path a b} {p' : Path a c} {e : b ⟶ d} {e' : c ⟶ d}
(h : p.cons e = p'.cons e') : b = c := by injection h
#align quiver.path.obj_eq_of_cons_eq_cons Quiver.Path.obj_eq_of_cons_eq_cons
-/- warning: quiver.path.heq_of_cons_eq_cons -> Quiver.Path.heq_of_cons_eq_cons is a dubious translation:
-lean 3 declaration is
- forall {V : Type.{u1}} [_inst_1 : Quiver.{u2, u1} V] {a : V} {b : V} {c : V} {d : V} {p : Quiver.Path.{u2, u1} V _inst_1 a b} {p' : Quiver.Path.{u2, u1} V _inst_1 a c} {e : Quiver.Hom.{u2, u1} V _inst_1 b d} {e' : Quiver.Hom.{u2, u1} V _inst_1 c d}, (Eq.{max (succ u1) u2} (Quiver.Path.{u2, u1} V _inst_1 a d) (Quiver.Path.cons.{u2, u1} V _inst_1 a b d p e) (Quiver.Path.cons.{u2, u1} V _inst_1 a c d p' e')) -> (HEq.{max (succ u1) u2} (Quiver.Path.{u2, u1} V _inst_1 a b) p (Quiver.Path.{u2, u1} V _inst_1 a c) p')
-but is expected to have type
- forall {V : Type.{u2}} [_inst_1 : Quiver.{u1, u2} V] {a : V} {b : V} {c : V} {d : V} {p : Quiver.Path.{u1, u2} V _inst_1 a b} {p' : Quiver.Path.{u1, u2} V _inst_1 a c} {e : Quiver.Hom.{u1, u2} V _inst_1 b d} {e' : Quiver.Hom.{u1, u2} V _inst_1 c d}, (Eq.{max (succ u2) u1} (Quiver.Path.{u1, u2} V _inst_1 a d) (Quiver.Path.cons.{u1, u2} V _inst_1 a b d p e) (Quiver.Path.cons.{u1, u2} V _inst_1 a c d p' e')) -> (HEq.{max (succ u2) u1} (Quiver.Path.{u1, u2} V _inst_1 a b) p (Quiver.Path.{u1, u2} V _inst_1 a c) p')
-Case conversion may be inaccurate. Consider using '#align quiver.path.heq_of_cons_eq_cons Quiver.Path.heq_of_cons_eq_consₓ'. -/
theorem heq_of_cons_eq_cons {p : Path a b} {p' : Path a c} {e : b ⟶ d} {e' : c ⟶ d}
(h : p.cons e = p'.cons e') : HEq p p' := by injection h
#align quiver.path.heq_of_cons_eq_cons Quiver.Path.heq_of_cons_eq_cons
-/- warning: quiver.path.hom_heq_of_cons_eq_cons -> Quiver.Path.hom_heq_of_cons_eq_cons is a dubious translation:
-lean 3 declaration is
- forall {V : Type.{u1}} [_inst_1 : Quiver.{u2, u1} V] {a : V} {b : V} {c : V} {d : V} {p : Quiver.Path.{u2, u1} V _inst_1 a b} {p' : Quiver.Path.{u2, u1} V _inst_1 a c} {e : Quiver.Hom.{u2, u1} V _inst_1 b d} {e' : Quiver.Hom.{u2, u1} V _inst_1 c d}, (Eq.{max (succ u1) u2} (Quiver.Path.{u2, u1} V _inst_1 a d) (Quiver.Path.cons.{u2, u1} V _inst_1 a b d p e) (Quiver.Path.cons.{u2, u1} V _inst_1 a c d p' e')) -> (HEq.{u2} (Quiver.Hom.{u2, u1} V _inst_1 b d) e (Quiver.Hom.{u2, u1} V _inst_1 c d) e')
-but is expected to have type
- forall {V : Type.{u2}} [_inst_1 : Quiver.{u1, u2} V] {a : V} {b : V} {c : V} {d : V} {p : Quiver.Path.{u1, u2} V _inst_1 a b} {p' : Quiver.Path.{u1, u2} V _inst_1 a c} {e : Quiver.Hom.{u1, u2} V _inst_1 b d} {e' : Quiver.Hom.{u1, u2} V _inst_1 c d}, (Eq.{max (succ u2) u1} (Quiver.Path.{u1, u2} V _inst_1 a d) (Quiver.Path.cons.{u1, u2} V _inst_1 a b d p e) (Quiver.Path.cons.{u1, u2} V _inst_1 a c d p' e')) -> (HEq.{u1} (Quiver.Hom.{u1, u2} V _inst_1 b d) e (Quiver.Hom.{u1, u2} V _inst_1 c d) e')
-Case conversion may be inaccurate. Consider using '#align quiver.path.hom_heq_of_cons_eq_cons Quiver.Path.hom_heq_of_cons_eq_consₓ'. -/
theorem hom_heq_of_cons_eq_cons {p : Path a b} {p' : Path a c} {e : b ⟶ d} {e' : c ⟶ d}
(h : p.cons e = p'.cons e') : HEq e e' := by injection h
#align quiver.path.hom_heq_of_cons_eq_cons Quiver.Path.hom_heq_of_cons_eq_cons
@@ -108,34 +78,16 @@ def length {a : V} : ∀ {b : V}, Path a b → ℕ
instance {a : V} : Inhabited (Path a a) :=
⟨Path.nil⟩
-/- warning: quiver.path.length_nil -> Quiver.Path.length_nil is a dubious translation:
-lean 3 declaration is
- forall {V : Type.{u1}} [_inst_1 : Quiver.{u2, u1} V] {a : V}, Eq.{1} Nat (Quiver.Path.length.{u1, u2} V _inst_1 a a (Quiver.Path.nil.{u2, u1} V _inst_1 a)) (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))
-but is expected to have type
- forall {V : Type.{u2}} [_inst_1 : Quiver.{u1, u2} V] {a : V}, Eq.{1} Nat (Quiver.Path.length.{u2, u1} V _inst_1 a a (Quiver.Path.nil.{u1, u2} V _inst_1 a)) (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))
-Case conversion may be inaccurate. Consider using '#align quiver.path.length_nil Quiver.Path.length_nilₓ'. -/
@[simp]
theorem length_nil {a : V} : (Path.nil : Path a a).length = 0 :=
rfl
#align quiver.path.length_nil Quiver.Path.length_nil
-/- warning: quiver.path.length_cons -> Quiver.Path.length_cons is a dubious translation:
-lean 3 declaration is
- forall {V : Type.{u1}} [_inst_1 : Quiver.{u2, u1} V] (a : V) (b : V) (c : V) (p : Quiver.Path.{u2, u1} V _inst_1 a b) (e : Quiver.Hom.{u2, u1} V _inst_1 b c), Eq.{1} Nat (Quiver.Path.length.{u1, u2} V _inst_1 a c (Quiver.Path.cons.{u2, u1} V _inst_1 a b c p e)) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) (Quiver.Path.length.{u1, u2} V _inst_1 a b p) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))
-but is expected to have type
- forall {V : Type.{u2}} [_inst_1 : Quiver.{u1, u2} V] (a : V) (b : V) (c : V) (p : Quiver.Path.{u1, u2} V _inst_1 a b) (e : Quiver.Hom.{u1, u2} V _inst_1 b c), Eq.{1} Nat (Quiver.Path.length.{u2, u1} V _inst_1 a c (Quiver.Path.cons.{u1, u2} V _inst_1 a b c p e)) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) (Quiver.Path.length.{u2, u1} V _inst_1 a b p) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))
-Case conversion may be inaccurate. Consider using '#align quiver.path.length_cons Quiver.Path.length_consₓ'. -/
@[simp]
theorem length_cons (a b c : V) (p : Path a b) (e : b ⟶ c) : (p.cons e).length = p.length + 1 :=
rfl
#align quiver.path.length_cons Quiver.Path.length_cons
-/- warning: quiver.path.eq_of_length_zero -> Quiver.Path.eq_of_length_zero is a dubious translation:
-lean 3 declaration is
- forall {V : Type.{u1}} [_inst_1 : Quiver.{u2, u1} V] {a : V} {b : V} (p : Quiver.Path.{u2, u1} V _inst_1 a b), (Eq.{1} Nat (Quiver.Path.length.{u1, u2} V _inst_1 a b p) (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> (Eq.{succ u1} V a b)
-but is expected to have type
- forall {V : Type.{u2}} [_inst_1 : Quiver.{u1, u2} V] {a : V} {b : V} (p : Quiver.Path.{u1, u2} V _inst_1 a b), (Eq.{1} Nat (Quiver.Path.length.{u2, u1} V _inst_1 a b p) (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> (Eq.{succ u2} V a b)
-Case conversion may be inaccurate. Consider using '#align quiver.path.eq_of_length_zero Quiver.Path.eq_of_length_zeroₓ'. -/
theorem eq_of_length_zero (p : Path a b) (hzero : p.length = 0) : a = b := by cases p; · rfl;
· cases Nat.succ_ne_zero _ hzero
#align quiver.path.eq_of_length_zero Quiver.Path.eq_of_length_zero
@@ -148,47 +100,23 @@ def comp {a b : V} : ∀ {c}, Path a b → Path b c → Path a c
#align quiver.path.comp Quiver.Path.comp
-/
-/- warning: quiver.path.comp_cons -> Quiver.Path.comp_cons is a dubious translation:
-lean 3 declaration is
- forall {V : Type.{u1}} [_inst_1 : Quiver.{u2, u1} V] {a : V} {b : V} {c : V} {d : V} (p : Quiver.Path.{u2, u1} V _inst_1 a b) (q : Quiver.Path.{u2, u1} V _inst_1 b c) (e : Quiver.Hom.{u2, u1} V _inst_1 c d), Eq.{max (succ u1) u2} (Quiver.Path.{u2, u1} V _inst_1 a d) (Quiver.Path.comp.{u1, u2} V _inst_1 a b d p (Quiver.Path.cons.{u2, u1} V _inst_1 b c d q e)) (Quiver.Path.cons.{u2, u1} V _inst_1 a c d (Quiver.Path.comp.{u1, u2} V _inst_1 a b c p q) e)
-but is expected to have type
- forall {V : Type.{u2}} [_inst_1 : Quiver.{u1, u2} V] {a : V} {b : V} {c : V} {d : V} (p : Quiver.Path.{u1, u2} V _inst_1 a b) (q : Quiver.Path.{u1, u2} V _inst_1 b c) (e : Quiver.Hom.{u1, u2} V _inst_1 c d), Eq.{max (succ u2) u1} (Quiver.Path.{u1, u2} V _inst_1 a d) (Quiver.Path.comp.{u2, u1} V _inst_1 a b d p (Quiver.Path.cons.{u1, u2} V _inst_1 b c d q e)) (Quiver.Path.cons.{u1, u2} V _inst_1 a c d (Quiver.Path.comp.{u2, u1} V _inst_1 a b c p q) e)
-Case conversion may be inaccurate. Consider using '#align quiver.path.comp_cons Quiver.Path.comp_consₓ'. -/
@[simp]
theorem comp_cons {a b c d : V} (p : Path a b) (q : Path b c) (e : c ⟶ d) :
p.comp (q.cons e) = (p.comp q).cons e :=
rfl
#align quiver.path.comp_cons Quiver.Path.comp_cons
-/- warning: quiver.path.comp_nil -> Quiver.Path.comp_nil is a dubious translation:
-lean 3 declaration is
- forall {V : Type.{u1}} [_inst_1 : Quiver.{u2, u1} V] {a : V} {b : V} (p : Quiver.Path.{u2, u1} V _inst_1 a b), Eq.{max (succ u1) u2} (Quiver.Path.{u2, u1} V _inst_1 a b) (Quiver.Path.comp.{u1, u2} V _inst_1 a b b p (Quiver.Path.nil.{u2, u1} V _inst_1 b)) p
-but is expected to have type
- forall {V : Type.{u2}} [_inst_1 : Quiver.{u1, u2} V] {a : V} {b : V} (p : Quiver.Path.{u1, u2} V _inst_1 a b), Eq.{max (succ u2) u1} (Quiver.Path.{u1, u2} V _inst_1 a b) (Quiver.Path.comp.{u2, u1} V _inst_1 a b b p (Quiver.Path.nil.{u1, u2} V _inst_1 b)) p
-Case conversion may be inaccurate. Consider using '#align quiver.path.comp_nil Quiver.Path.comp_nilₓ'. -/
@[simp]
theorem comp_nil {a b : V} (p : Path a b) : p.comp Path.nil = p :=
rfl
#align quiver.path.comp_nil Quiver.Path.comp_nil
-/- warning: quiver.path.nil_comp -> Quiver.Path.nil_comp is a dubious translation:
-lean 3 declaration is
- forall {V : Type.{u1}} [_inst_1 : Quiver.{u2, u1} V] {a : V} {b : V} (p : Quiver.Path.{u2, u1} V _inst_1 a b), Eq.{max (succ u1) u2} (Quiver.Path.{u2, u1} V _inst_1 a b) (Quiver.Path.comp.{u1, u2} V _inst_1 a a b (Quiver.Path.nil.{u2, u1} V _inst_1 a) p) p
-but is expected to have type
- forall {V : Type.{u2}} [_inst_1 : Quiver.{u1, u2} V] {a : V} {b : V} (p : Quiver.Path.{u1, u2} V _inst_1 a b), Eq.{max (succ u2) u1} (Quiver.Path.{u1, u2} V _inst_1 a b) (Quiver.Path.comp.{u2, u1} V _inst_1 a a b (Quiver.Path.nil.{u1, u2} V _inst_1 a) p) p
-Case conversion may be inaccurate. Consider using '#align quiver.path.nil_comp Quiver.Path.nil_compₓ'. -/
@[simp]
theorem nil_comp {a : V} : ∀ {b} (p : Path a b), Path.nil.comp p = p
| a, path.nil => rfl
| b, path.cons p e => by rw [comp_cons, nil_comp]
#align quiver.path.nil_comp Quiver.Path.nil_comp
-/- warning: quiver.path.comp_assoc -> Quiver.Path.comp_assoc is a dubious translation:
-lean 3 declaration is
- forall {V : Type.{u1}} [_inst_1 : Quiver.{u2, u1} V] {a : V} {b : V} {c : V} {d : V} (p : Quiver.Path.{u2, u1} V _inst_1 a b) (q : Quiver.Path.{u2, u1} V _inst_1 b c) (r : Quiver.Path.{u2, u1} V _inst_1 c d), Eq.{max (succ u1) u2} (Quiver.Path.{u2, u1} V _inst_1 a d) (Quiver.Path.comp.{u1, u2} V _inst_1 a c d (Quiver.Path.comp.{u1, u2} V _inst_1 a b c p q) r) (Quiver.Path.comp.{u1, u2} V _inst_1 a b d p (Quiver.Path.comp.{u1, u2} V _inst_1 b c d q r))
-but is expected to have type
- forall {V : Type.{u2}} [_inst_1 : Quiver.{u1, u2} V] {a : V} {b : V} {c : V} {d : V} (p : Quiver.Path.{u1, u2} V _inst_1 a b) (q : Quiver.Path.{u1, u2} V _inst_1 b c) (r : Quiver.Path.{u1, u2} V _inst_1 c d), Eq.{max (succ u2) u1} (Quiver.Path.{u1, u2} V _inst_1 a d) (Quiver.Path.comp.{u2, u1} V _inst_1 a c d (Quiver.Path.comp.{u2, u1} V _inst_1 a b c p q) r) (Quiver.Path.comp.{u2, u1} V _inst_1 a b d p (Quiver.Path.comp.{u2, u1} V _inst_1 b c d q r))
-Case conversion may be inaccurate. Consider using '#align quiver.path.comp_assoc Quiver.Path.comp_assocₓ'. -/
@[simp]
theorem comp_assoc {a b c : V} :
∀ {d} (p : Path a b) (q : Path b c) (r : Path c d), (p.comp q).comp r = p.comp (q.comp r)
@@ -196,24 +124,12 @@ theorem comp_assoc {a b c : V} :
| d, p, q, path.cons r e => by rw [comp_cons, comp_cons, comp_cons, comp_assoc]
#align quiver.path.comp_assoc Quiver.Path.comp_assoc
-/- warning: quiver.path.length_comp -> Quiver.Path.length_comp is a dubious translation:
-lean 3 declaration is
- forall {V : Type.{u1}} [_inst_1 : Quiver.{u2, u1} V] {a : V} {b : V} (p : Quiver.Path.{u2, u1} V _inst_1 a b) {c : V} (q : Quiver.Path.{u2, u1} V _inst_1 b c), Eq.{1} Nat (Quiver.Path.length.{u1, u2} V _inst_1 a c (Quiver.Path.comp.{u1, u2} V _inst_1 a b c p q)) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) (Quiver.Path.length.{u1, u2} V _inst_1 a b p) (Quiver.Path.length.{u1, u2} V _inst_1 b c q))
-but is expected to have type
- forall {V : Type.{u2}} [_inst_1 : Quiver.{u1, u2} V] {a : V} {b : V} (p : Quiver.Path.{u1, u2} V _inst_1 a b) {c : V} (q : Quiver.Path.{u1, u2} V _inst_1 b c), Eq.{1} Nat (Quiver.Path.length.{u2, u1} V _inst_1 a c (Quiver.Path.comp.{u2, u1} V _inst_1 a b c p q)) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) (Quiver.Path.length.{u2, u1} V _inst_1 a b p) (Quiver.Path.length.{u2, u1} V _inst_1 b c q))
-Case conversion may be inaccurate. Consider using '#align quiver.path.length_comp Quiver.Path.length_compₓ'. -/
@[simp]
theorem length_comp (p : Path a b) : ∀ {c} (q : Path b c), (p.comp q).length = p.length + q.length
| c, nil => rfl
| c, cons q h => congr_arg Nat.succ q.length_comp
#align quiver.path.length_comp Quiver.Path.length_comp
-/- warning: quiver.path.comp_inj -> Quiver.Path.comp_inj is a dubious translation:
-lean 3 declaration is
- forall {V : Type.{u1}} [_inst_1 : Quiver.{u2, u1} V] {a : V} {b : V} {c : V} {p₁ : Quiver.Path.{u2, u1} V _inst_1 a b} {p₂ : Quiver.Path.{u2, u1} V _inst_1 a b} {q₁ : Quiver.Path.{u2, u1} V _inst_1 b c} {q₂ : Quiver.Path.{u2, u1} V _inst_1 b c}, (Eq.{1} Nat (Quiver.Path.length.{u1, u2} V _inst_1 b c q₁) (Quiver.Path.length.{u1, u2} V _inst_1 b c q₂)) -> (Iff (Eq.{max (succ u1) u2} (Quiver.Path.{u2, u1} V _inst_1 a c) (Quiver.Path.comp.{u1, u2} V _inst_1 a b c p₁ q₁) (Quiver.Path.comp.{u1, u2} V _inst_1 a b c p₂ q₂)) (And (Eq.{max (succ u1) u2} (Quiver.Path.{u2, u1} V _inst_1 a b) p₁ p₂) (Eq.{max (succ u1) u2} (Quiver.Path.{u2, u1} V _inst_1 b c) q₁ q₂)))
-but is expected to have type
- forall {V : Type.{u2}} [_inst_1 : Quiver.{u1, u2} V] {a : V} {b : V} {c : V} {p₁ : Quiver.Path.{u1, u2} V _inst_1 a b} {p₂ : Quiver.Path.{u1, u2} V _inst_1 a b} {q₁ : Quiver.Path.{u1, u2} V _inst_1 b c} {q₂ : Quiver.Path.{u1, u2} V _inst_1 b c}, (Eq.{1} Nat (Quiver.Path.length.{u2, u1} V _inst_1 b c q₁) (Quiver.Path.length.{u2, u1} V _inst_1 b c q₂)) -> (Iff (Eq.{max (succ u2) u1} (Quiver.Path.{u1, u2} V _inst_1 a c) (Quiver.Path.comp.{u2, u1} V _inst_1 a b c p₁ q₁) (Quiver.Path.comp.{u2, u1} V _inst_1 a b c p₂ q₂)) (And (Eq.{max (succ u2) u1} (Quiver.Path.{u1, u2} V _inst_1 a b) p₁ p₂) (Eq.{max (succ u2) u1} (Quiver.Path.{u1, u2} V _inst_1 b c) q₁ q₂)))
-Case conversion may be inaccurate. Consider using '#align quiver.path.comp_inj Quiver.Path.comp_injₓ'. -/
theorem comp_inj {p₁ p₂ : Path a b} {q₁ q₂ : Path b c} (hq : q₁.length = q₂.length) :
p₁.comp q₁ = p₂.comp q₂ ↔ p₁ = p₂ ∧ q₁ = q₂ :=
by
@@ -229,55 +145,25 @@ theorem comp_inj {p₁ p₂ : Path a b} {q₁ q₂ : Path b c} (hq : q₁.length
exact ⟨rfl, rfl⟩
#align quiver.path.comp_inj Quiver.Path.comp_inj
-/- warning: quiver.path.comp_inj' -> Quiver.Path.comp_inj' is a dubious translation:
-lean 3 declaration is
- forall {V : Type.{u1}} [_inst_1 : Quiver.{u2, u1} V] {a : V} {b : V} {c : V} {p₁ : Quiver.Path.{u2, u1} V _inst_1 a b} {p₂ : Quiver.Path.{u2, u1} V _inst_1 a b} {q₁ : Quiver.Path.{u2, u1} V _inst_1 b c} {q₂ : Quiver.Path.{u2, u1} V _inst_1 b c}, (Eq.{1} Nat (Quiver.Path.length.{u1, u2} V _inst_1 a b p₁) (Quiver.Path.length.{u1, u2} V _inst_1 a b p₂)) -> (Iff (Eq.{max (succ u1) u2} (Quiver.Path.{u2, u1} V _inst_1 a c) (Quiver.Path.comp.{u1, u2} V _inst_1 a b c p₁ q₁) (Quiver.Path.comp.{u1, u2} V _inst_1 a b c p₂ q₂)) (And (Eq.{max (succ u1) u2} (Quiver.Path.{u2, u1} V _inst_1 a b) p₁ p₂) (Eq.{max (succ u1) u2} (Quiver.Path.{u2, u1} V _inst_1 b c) q₁ q₂)))
-but is expected to have type
- forall {V : Type.{u2}} [_inst_1 : Quiver.{u1, u2} V] {a : V} {b : V} {c : V} {p₁ : Quiver.Path.{u1, u2} V _inst_1 a b} {p₂ : Quiver.Path.{u1, u2} V _inst_1 a b} {q₁ : Quiver.Path.{u1, u2} V _inst_1 b c} {q₂ : Quiver.Path.{u1, u2} V _inst_1 b c}, (Eq.{1} Nat (Quiver.Path.length.{u2, u1} V _inst_1 a b p₁) (Quiver.Path.length.{u2, u1} V _inst_1 a b p₂)) -> (Iff (Eq.{max (succ u2) u1} (Quiver.Path.{u1, u2} V _inst_1 a c) (Quiver.Path.comp.{u2, u1} V _inst_1 a b c p₁ q₁) (Quiver.Path.comp.{u2, u1} V _inst_1 a b c p₂ q₂)) (And (Eq.{max (succ u2) u1} (Quiver.Path.{u1, u2} V _inst_1 a b) p₁ p₂) (Eq.{max (succ u2) u1} (Quiver.Path.{u1, u2} V _inst_1 b c) q₁ q₂)))
-Case conversion may be inaccurate. Consider using '#align quiver.path.comp_inj' Quiver.Path.comp_inj'ₓ'. -/
theorem comp_inj' {p₁ p₂ : Path a b} {q₁ q₂ : Path b c} (h : p₁.length = p₂.length) :
p₁.comp q₁ = p₂.comp q₂ ↔ p₁ = p₂ ∧ q₁ = q₂ :=
⟨fun h_eq => (comp_inj <| Nat.add_left_cancel <| by simpa [h] using congr_arg length h_eq).1 h_eq,
by rintro ⟨rfl, rfl⟩; rfl⟩
#align quiver.path.comp_inj' Quiver.Path.comp_inj'
-/- warning: quiver.path.comp_injective_left -> Quiver.Path.comp_injective_left is a dubious translation:
-lean 3 declaration is
- forall {V : Type.{u1}} [_inst_1 : Quiver.{u2, u1} V] {a : V} {b : V} {c : V} (q : Quiver.Path.{u2, u1} V _inst_1 b c), Function.Injective.{max (succ u1) u2, max (succ u1) u2} (Quiver.Path.{u2, u1} V _inst_1 a b) (Quiver.Path.{u2, u1} V _inst_1 a c) (fun (p : Quiver.Path.{u2, u1} V _inst_1 a b) => Quiver.Path.comp.{u1, u2} V _inst_1 a b c p q)
-but is expected to have type
- forall {V : Type.{u2}} [_inst_1 : Quiver.{u1, u2} V] {a : V} {b : V} {c : V} (q : Quiver.Path.{u1, u2} V _inst_1 b c), Function.Injective.{max (succ u2) u1, max (succ u2) u1} (Quiver.Path.{u1, u2} V _inst_1 a b) (Quiver.Path.{u1, u2} V _inst_1 a c) (fun (p : Quiver.Path.{u1, u2} V _inst_1 a b) => Quiver.Path.comp.{u2, u1} V _inst_1 a b c p q)
-Case conversion may be inaccurate. Consider using '#align quiver.path.comp_injective_left Quiver.Path.comp_injective_leftₓ'. -/
theorem comp_injective_left (q : Path b c) : Injective fun p : Path a b => p.comp q :=
fun p₁ p₂ h => ((comp_inj rfl).1 h).1
#align quiver.path.comp_injective_left Quiver.Path.comp_injective_left
-/- warning: quiver.path.comp_injective_right -> Quiver.Path.comp_injective_right is a dubious translation:
-lean 3 declaration is
- forall {V : Type.{u1}} [_inst_1 : Quiver.{u2, u1} V] {a : V} {b : V} {c : V} (p : Quiver.Path.{u2, u1} V _inst_1 a b), Function.Injective.{max (succ u1) u2, max (succ u1) u2} (Quiver.Path.{u2, u1} V _inst_1 b c) (Quiver.Path.{u2, u1} V _inst_1 a c) (Quiver.Path.comp.{u1, u2} V _inst_1 a b c p)
-but is expected to have type
- forall {V : Type.{u2}} [_inst_1 : Quiver.{u1, u2} V] {a : V} {b : V} {c : V} (p : Quiver.Path.{u1, u2} V _inst_1 a b), Function.Injective.{max (succ u2) u1, max (succ u2) u1} (Quiver.Path.{u1, u2} V _inst_1 b c) (Quiver.Path.{u1, u2} V _inst_1 a c) (Quiver.Path.comp.{u2, u1} V _inst_1 a b c p)
-Case conversion may be inaccurate. Consider using '#align quiver.path.comp_injective_right Quiver.Path.comp_injective_rightₓ'. -/
theorem comp_injective_right (p : Path a b) : Injective (p.comp : Path b c → Path a c) :=
fun q₁ q₂ h => ((comp_inj' rfl).1 h).2
#align quiver.path.comp_injective_right Quiver.Path.comp_injective_right
-/- warning: quiver.path.comp_inj_left -> Quiver.Path.comp_inj_left is a dubious translation:
-lean 3 declaration is
- forall {V : Type.{u1}} [_inst_1 : Quiver.{u2, u1} V] {a : V} {b : V} {c : V} {p₁ : Quiver.Path.{u2, u1} V _inst_1 a b} {p₂ : Quiver.Path.{u2, u1} V _inst_1 a b} {q : Quiver.Path.{u2, u1} V _inst_1 b c}, Iff (Eq.{max (succ u1) u2} (Quiver.Path.{u2, u1} V _inst_1 a c) (Quiver.Path.comp.{u1, u2} V _inst_1 a b c p₁ q) (Quiver.Path.comp.{u1, u2} V _inst_1 a b c p₂ q)) (Eq.{max (succ u1) u2} (Quiver.Path.{u2, u1} V _inst_1 a b) p₁ p₂)
-but is expected to have type
- forall {V : Type.{u2}} [_inst_1 : Quiver.{u1, u2} V] {a : V} {b : V} {c : V} {p₁ : Quiver.Path.{u1, u2} V _inst_1 a b} {p₂ : Quiver.Path.{u1, u2} V _inst_1 a b} {q : Quiver.Path.{u1, u2} V _inst_1 b c}, Iff (Eq.{max (succ u2) u1} (Quiver.Path.{u1, u2} V _inst_1 a c) (Quiver.Path.comp.{u2, u1} V _inst_1 a b c p₁ q) (Quiver.Path.comp.{u2, u1} V _inst_1 a b c p₂ q)) (Eq.{max (succ u2) u1} (Quiver.Path.{u1, u2} V _inst_1 a b) p₁ p₂)
-Case conversion may be inaccurate. Consider using '#align quiver.path.comp_inj_left Quiver.Path.comp_inj_leftₓ'. -/
@[simp]
theorem comp_inj_left {p₁ p₂ : Path a b} {q : Path b c} : p₁.comp q = p₂.comp q ↔ p₁ = p₂ :=
q.comp_injective_left.eq_iff
#align quiver.path.comp_inj_left Quiver.Path.comp_inj_left
-/- warning: quiver.path.comp_inj_right -> Quiver.Path.comp_inj_right is a dubious translation:
-lean 3 declaration is
- forall {V : Type.{u1}} [_inst_1 : Quiver.{u2, u1} V] {a : V} {b : V} {c : V} {p : Quiver.Path.{u2, u1} V _inst_1 a b} {q₁ : Quiver.Path.{u2, u1} V _inst_1 b c} {q₂ : Quiver.Path.{u2, u1} V _inst_1 b c}, Iff (Eq.{max (succ u1) u2} (Quiver.Path.{u2, u1} V _inst_1 a c) (Quiver.Path.comp.{u1, u2} V _inst_1 a b c p q₁) (Quiver.Path.comp.{u1, u2} V _inst_1 a b c p q₂)) (Eq.{max (succ u1) u2} (Quiver.Path.{u2, u1} V _inst_1 b c) q₁ q₂)
-but is expected to have type
- forall {V : Type.{u2}} [_inst_1 : Quiver.{u1, u2} V] {a : V} {b : V} {c : V} {p : Quiver.Path.{u1, u2} V _inst_1 a b} {q₁ : Quiver.Path.{u1, u2} V _inst_1 b c} {q₂ : Quiver.Path.{u1, u2} V _inst_1 b c}, Iff (Eq.{max (succ u2) u1} (Quiver.Path.{u1, u2} V _inst_1 a c) (Quiver.Path.comp.{u2, u1} V _inst_1 a b c p q₁) (Quiver.Path.comp.{u2, u1} V _inst_1 a b c p q₂)) (Eq.{max (succ u2) u1} (Quiver.Path.{u1, u2} V _inst_1 b c) q₁ q₂)
-Case conversion may be inaccurate. Consider using '#align quiver.path.comp_inj_right Quiver.Path.comp_inj_rightₓ'. -/
@[simp]
theorem comp_inj_right {p : Path a b} {q₁ q₂ : Path b c} : p.comp q₁ = p.comp q₂ ↔ q₁ = q₂ :=
p.comp_injective_right.eq_iff
@@ -292,12 +178,6 @@ def toList : ∀ {b : V}, Path a b → List V
#align quiver.path.to_list Quiver.Path.toList
-/
-/- warning: quiver.path.to_list_comp -> Quiver.Path.toList_comp is a dubious translation:
-lean 3 declaration is
- forall {V : Type.{u1}} [_inst_1 : Quiver.{u2, u1} V] {a : V} {b : V} (p : Quiver.Path.{u2, u1} V _inst_1 a b) {c : V} (q : Quiver.Path.{u2, u1} V _inst_1 b c), Eq.{succ u1} (List.{u1} V) (Quiver.Path.toList.{u1, u2} V _inst_1 a c (Quiver.Path.comp.{u1, u2} V _inst_1 a b c p q)) (Append.append.{u1} (List.{u1} V) (List.hasAppend.{u1} V) (Quiver.Path.toList.{u1, u2} V _inst_1 b c q) (Quiver.Path.toList.{u1, u2} V _inst_1 a b p))
-but is expected to have type
- forall {V : Type.{u2}} [_inst_1 : Quiver.{u1, u2} V] {a : V} {b : V} (p : Quiver.Path.{u1, u2} V _inst_1 a b) {c : V} (q : Quiver.Path.{u1, u2} V _inst_1 b c), Eq.{succ u2} (List.{u2} V) (Quiver.Path.toList.{u2, u1} V _inst_1 a c (Quiver.Path.comp.{u2, u1} V _inst_1 a b c p q)) (HAppend.hAppend.{u2, u2, u2} (List.{u2} V) (List.{u2} V) (List.{u2} V) (instHAppend.{u2} (List.{u2} V) (List.instAppendList.{u2} V)) (Quiver.Path.toList.{u2, u1} V _inst_1 b c q) (Quiver.Path.toList.{u2, u1} V _inst_1 a b p))
-Case conversion may be inaccurate. Consider using '#align quiver.path.to_list_comp Quiver.Path.toList_compₓ'. -/
/-- `quiver.path.to_list` is a contravariant functor. The inversion comes from `quiver.path` and
`list` having different preferred directions for adding elements. -/
@[simp]
@@ -306,12 +186,6 @@ theorem toList_comp (p : Path a b) : ∀ {c} (q : Path b c), (p.comp q).toList =
| c, @cons _ _ _ d _ q f => by simp [to_list_comp]
#align quiver.path.to_list_comp Quiver.Path.toList_comp
-/- warning: quiver.path.to_list_chain_nonempty -> Quiver.Path.toList_chain_nonempty is a dubious translation:
-lean 3 declaration is
- forall {V : Type.{u1}} [_inst_1 : Quiver.{u2, u1} V] {a : V} {b : V} (p : Quiver.Path.{u2, u1} V _inst_1 a b), List.Chain.{u1} V (fun (x : V) (y : V) => Nonempty.{u2} (Quiver.Hom.{u2, u1} V _inst_1 y x)) b (Quiver.Path.toList.{u1, u2} V _inst_1 a b p)
-but is expected to have type
- forall {V : Type.{u2}} [_inst_1 : Quiver.{u1, u2} V] {a : V} {b : V} (p : Quiver.Path.{u1, u2} V _inst_1 a b), List.Chain.{u2} V (fun (x : V) (y : V) => Nonempty.{u1} (Quiver.Hom.{u1, u2} V _inst_1 y x)) b (Quiver.Path.toList.{u2, u1} V _inst_1 a b p)
-Case conversion may be inaccurate. Consider using '#align quiver.path.to_list_chain_nonempty Quiver.Path.toList_chain_nonemptyₓ'. -/
theorem toList_chain_nonempty : ∀ {b} (p : Path a b), p.toList.Chain (fun x y => Nonempty (y ⟶ x)) b
| b, nil => List.Chain.nil
| b, cons p f => p.toList_chain_nonempty.cons ⟨f⟩
@@ -319,12 +193,6 @@ theorem toList_chain_nonempty : ∀ {b} (p : Path a b), p.toList.Chain (fun x y
variable [∀ a b : V, Subsingleton (a ⟶ b)]
-/- warning: quiver.path.to_list_injective -> Quiver.Path.toList_injective is a dubious translation:
-lean 3 declaration is
- forall {V : Type.{u1}} [_inst_1 : Quiver.{u2, u1} V] [_inst_2 : forall (a : V) (b : V), Subsingleton.{u2} (Quiver.Hom.{u2, u1} V _inst_1 a b)] (a : V) (b : V), Function.Injective.{max (succ u1) u2, succ u1} (Quiver.Path.{u2, u1} V _inst_1 a b) (List.{u1} V) (Quiver.Path.toList.{u1, u2} V _inst_1 a b)
-but is expected to have type
- forall {V : Type.{u2}} [_inst_1 : Quiver.{u1, u2} V] [_inst_2 : forall (a : V) (b : V), Subsingleton.{u1} (Quiver.Hom.{u1, u2} V _inst_1 a b)] (a : V) (b : V), Function.Injective.{max (succ u2) u1, succ u2} (Quiver.Path.{u1, u2} V _inst_1 a b) (List.{u2} V) (Quiver.Path.toList.{u2, u1} V _inst_1 a b)
-Case conversion may be inaccurate. Consider using '#align quiver.path.to_list_injective Quiver.Path.toList_injectiveₓ'. -/
theorem toList_injective (a : V) : ∀ b, Injective (toList : Path a b → List V)
| b, nil, nil, h => rfl
| b, nil, @cons _ _ _ c _ p f, h => by cases h
@@ -336,12 +204,6 @@ theorem toList_injective (a : V) : ∀ b, Injective (toList : Path a b → List
simp [to_list_injective _ hAC]
#align quiver.path.to_list_injective Quiver.Path.toList_injective
-/- warning: quiver.path.to_list_inj -> Quiver.Path.toList_inj is a dubious translation:
-lean 3 declaration is
- forall {V : Type.{u1}} [_inst_1 : Quiver.{u2, u1} V] {a : V} {b : V} [_inst_2 : forall (a : V) (b : V), Subsingleton.{u2} (Quiver.Hom.{u2, u1} V _inst_1 a b)] {p : Quiver.Path.{u2, u1} V _inst_1 a b} {q : Quiver.Path.{u2, u1} V _inst_1 a b}, Iff (Eq.{succ u1} (List.{u1} V) (Quiver.Path.toList.{u1, u2} V _inst_1 a b p) (Quiver.Path.toList.{u1, u2} V _inst_1 a b q)) (Eq.{max (succ u1) u2} (Quiver.Path.{u2, u1} V _inst_1 a b) p q)
-but is expected to have type
- forall {V : Type.{u2}} [_inst_1 : Quiver.{u1, u2} V] {a : V} {b : V} [_inst_2 : forall (a : V) (b : V), Subsingleton.{u1} (Quiver.Hom.{u1, u2} V _inst_1 a b)] {p : Quiver.Path.{u1, u2} V _inst_1 a b} {q : Quiver.Path.{u1, u2} V _inst_1 a b}, Iff (Eq.{succ u2} (List.{u2} V) (Quiver.Path.toList.{u2, u1} V _inst_1 a b p) (Quiver.Path.toList.{u2, u1} V _inst_1 a b q)) (Eq.{max (succ u2) u1} (Quiver.Path.{u1, u2} V _inst_1 a b) p q)
-Case conversion may be inaccurate. Consider using '#align quiver.path.to_list_inj Quiver.Path.toList_injₓ'. -/
@[simp]
theorem toList_inj {p q : Path a b} : p.toList = q.toList ↔ p = q :=
(toList_injective _ _).eq_iff
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -136,10 +136,7 @@ lean 3 declaration is
but is expected to have type
forall {V : Type.{u2}} [_inst_1 : Quiver.{u1, u2} V] {a : V} {b : V} (p : Quiver.Path.{u1, u2} V _inst_1 a b), (Eq.{1} Nat (Quiver.Path.length.{u2, u1} V _inst_1 a b p) (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> (Eq.{succ u2} V a b)
Case conversion may be inaccurate. Consider using '#align quiver.path.eq_of_length_zero Quiver.Path.eq_of_length_zeroₓ'. -/
-theorem eq_of_length_zero (p : Path a b) (hzero : p.length = 0) : a = b :=
- by
- cases p
- · rfl
+theorem eq_of_length_zero (p : Path a b) (hzero : p.length = 0) : a = b := by cases p; · rfl;
· cases Nat.succ_ne_zero _ hzero
#align quiver.path.eq_of_length_zero Quiver.Path.eq_of_length_zero
@@ -220,10 +217,7 @@ Case conversion may be inaccurate. Consider using '#align quiver.path.comp_inj Q
theorem comp_inj {p₁ p₂ : Path a b} {q₁ q₂ : Path b c} (hq : q₁.length = q₂.length) :
p₁.comp q₁ = p₂.comp q₂ ↔ p₁ = p₂ ∧ q₁ = q₂ :=
by
- refine'
- ⟨fun h => _, by
- rintro ⟨rfl, rfl⟩
- rfl⟩
+ refine' ⟨fun h => _, by rintro ⟨rfl, rfl⟩; rfl⟩
induction' q₁ with d₁ e₁ q₁ f₁ ih generalizing q₂ <;> obtain _ | ⟨q₂, f₂⟩ := q₂
· exact ⟨h, rfl⟩
· cases hq
@@ -244,9 +238,7 @@ Case conversion may be inaccurate. Consider using '#align quiver.path.comp_inj'
theorem comp_inj' {p₁ p₂ : Path a b} {q₁ q₂ : Path b c} (h : p₁.length = p₂.length) :
p₁.comp q₁ = p₂.comp q₂ ↔ p₁ = p₂ ∧ q₁ = q₂ :=
⟨fun h_eq => (comp_inj <| Nat.add_left_cancel <| by simpa [h] using congr_arg length h_eq).1 h_eq,
- by
- rintro ⟨rfl, rfl⟩
- rfl⟩
+ by rintro ⟨rfl, rfl⟩; rfl⟩
#align quiver.path.comp_inj' Quiver.Path.comp_inj'
/- warning: quiver.path.comp_injective_left -> Quiver.Path.comp_injective_left is a dubious translation:
mathlib commit https://github.com/leanprover-community/mathlib/commit/57e09a1296bfb4330ddf6624f1028ba186117d82
@@ -31,8 +31,8 @@ namespace Quiver
#print Quiver.Path /-
/-- `G.path a b` is the type of paths from `a` to `b` through the arrows of `G`. -/
inductive Path {V : Type u} [Quiver.{v} V] (a : V) : V → Sort max (u + 1) v
- | nil : path a
- | cons : ∀ {b c : V}, path b → (b ⟶ c) → path c
+ | nil : Path a
+ | cons : ∀ {b c : V}, Path b → (b ⟶ c) → Path c
#align quiver.path Quiver.Path
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
attribute [simp] ... in
-> attribute [local simp] ... in
(#7678)
Mathlib.Logic.Unique contains the line attribute [simp] eq_iff_true_of_subsingleton in ...
:
Despite what the in
part may imply, this adds the lemma to the simp set "globally", including for downstream files; it is likely that attribute [local simp] eq_iff_true_of_subsingleton in ...
was meant instead (or maybe scoped simp
, but I think "scoped" refers to the current namespace). Indeed, the relevant lemma is not marked with @[simp]
for possible slowness: https://github.com/leanprover/std4/blob/846e9e1d6bb534774d1acd2dc430e70987da3c18/Std/Logic.lean#L749. Adding it to the simp set causes the example at https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/Regression.20in.20simp to slow down.
This PR changes this and fixes the relevant downstream simp
s. There was also one ocurrence of attribute [simp] FullSubcategory.comp_def FullSubcategory.id_def in
in Mathlib.CategoryTheory.Monoidal.Subcategory but that was much easier to fix.
@@ -188,7 +188,7 @@ theorem toList_injective (a : V) : ∀ b, Injective (toList : Path a b → List
| _, @cons _ _ _ c _ p f, @cons _ _ _ t _ C D, h => by
simp only [toList, List.cons.injEq] at h
obtain ⟨rfl, hAC⟩ := h
- simp [toList_injective _ _ hAC]
+ simp [toList_injective _ _ hAC, eq_iff_true_of_subsingleton]
#align quiver.path.to_list_injective Quiver.Path.toList_injective
@[simp]
@@ -48,15 +48,15 @@ lemma cons_ne_nil (p : Path a b) (e : b ⟶ a) : p.cons e ≠ Path.nil :=
#align quiver.path.cons_ne_nil Quiver.Path.cons_ne_nil
lemma obj_eq_of_cons_eq_cons {p : Path a b} {p' : Path a c}
- {e : b ⟶ d} {e' : c ⟶ d} (h : p.cons e = p'.cons e') : b = c := by injection h
+ {e : b ⟶ d} {e' : c ⟶ d} (h : p.cons e = p'.cons e') : b = c := by injection h
#align quiver.path.obj_eq_of_cons_eq_cons Quiver.Path.obj_eq_of_cons_eq_cons
lemma heq_of_cons_eq_cons {p : Path a b} {p' : Path a c}
- {e : b ⟶ d} {e' : c ⟶ d} (h : p.cons e = p'.cons e') : HEq p p' := by injection h
+ {e : b ⟶ d} {e' : c ⟶ d} (h : p.cons e = p'.cons e') : HEq p p' := by injection h
#align quiver.path.heq_of_cons_eq_cons Quiver.Path.heq_of_cons_eq_cons
lemma hom_heq_of_cons_eq_cons {p : Path a b} {p' : Path a c}
- {e : b ⟶ d} {e' : c ⟶ d} (h : p.cons e = p'.cons e') : HEq e e' := by injection h
+ {e : b ⟶ d} {e' : c ⟶ d} (h : p.cons e = p'.cons e') : HEq e e' := by injection h
#align quiver.path.hom_heq_of_cons_eq_cons Quiver.Path.hom_heq_of_cons_eq_cons
/-- The length of a path is the number of arrows it uses. -/
Briefly during the port we were adding "Ported by" headers, but only ~60 / 3000 files ended up with such a header.
I propose deleting them.
We could consider adding these uniformly via a script, as part of the great history rewrite...?
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
@@ -2,7 +2,6 @@
Copyright (c) 2021 David Wärn,. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: David Wärn, Scott Morrison
-Ported by: Joël Riou
-/
import Mathlib.Combinatorics.Quiver.Basic
import Mathlib.Logic.Lemmas
@@ -3,15 +3,12 @@ Copyright (c) 2021 David Wärn,. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: David Wärn, Scott Morrison
Ported by: Joël Riou
-
-! This file was ported from Lean 3 source module combinatorics.quiver.path
-! leanprover-community/mathlib commit 18a5306c091183ac90884daa9373fa3b178e8607
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Combinatorics.Quiver.Basic
import Mathlib.Logic.Lemmas
+#align_import combinatorics.quiver.path from "leanprover-community/mathlib"@"18a5306c091183ac90884daa9373fa3b178e8607"
+
/-!
# Paths in quivers
@@ -44,11 +44,11 @@ namespace Path
variable {V : Type u} [Quiver V] {a b c d : V}
lemma nil_ne_cons (p : Path a b) (e : b ⟶ a) : Path.nil ≠ p.cons e :=
-fun h => by injection h
+ fun h => by injection h
#align quiver.path.nil_ne_cons Quiver.Path.nil_ne_cons
lemma cons_ne_nil (p : Path a b) (e : b ⟶ a) : p.cons e ≠ Path.nil :=
-fun h => by injection h
+ fun h => by injection h
#align quiver.path.cons_ne_nil Quiver.Path.cons_ne_nil
lemma obj_eq_of_cons_eq_cons {p : Path a b} {p' : Path a c}
compile_inductive%
and compile_def%
commands (#4097)
Add a #compile inductive
command to compile the recursors of an inductive type, which works by creating a recursive definition and using @[csimp]
.
Co-authored-by: Parth Shastri <31370288+cppio@users.noreply.github.com> Co-authored-by: Mario Carneiro <di.gama@gmail.com>
@@ -32,20 +32,7 @@ inductive Path {V : Type u} [Quiver.{v} V] (a : V) : V → Sort max (u + 1) v
#align quiver.path Quiver.Path
-- See issue lean4#2049
-/-- A computable version of `Quiver.Path.rec`. Workaround until Lean has native support for this. -/
-def Path.recC.{w, z, t} {V : Type t} [Quiver.{z} V] {a : V} {motive : (b : V) → Path a b → Sort w}
- (nil : motive a Path.nil)
- (cons : ({b c : V} → (p : Path a b) → (e : b ⟶ c) → motive b p → motive c (p.cons e))) :
- {b : V} → (p : Path a b) → motive b p
- | _, .nil => nil
- | _, (.cons p e) => cons p e (Quiver.Path.recC nil cons p)
-
-@[csimp] lemma Path.rec_eq_recC : @Path.rec = @Path.recC := by
- ext V _ a motive nil cons b p
- induction p with
- | nil => rfl
- | cons p e ih =>
- rw [Path.recC, ←ih]
+compile_inductive% Path
/-- An arrow viewed as a path of length one. -/
def Hom.toPath {V} [Quiver V] {a b : V} (e : a ⟶ b) : Path a b :=
by
s! (#3825)
This PR puts, with one exception, every single remaining by
that lies all by itself on its own line to the previous line, thus matching the current behaviour of start-port.sh
. The exception is when the by
begins the second or later argument to a tuple or anonymous constructor; see https://github.com/leanprover-community/mathlib4/pull/3825#discussion_r1186702599.
Essentially this is s/\n *by$/ by/g
, but with manual editing to satisfy the linter's max-100-char-line requirement. The Python style linter is also modified to catch these "isolated by
s".
@@ -154,9 +154,7 @@ theorem comp_inj {p₁ p₂ : Path a b} {q₁ q₂ : Path b c} (hq : q₁.length
theorem comp_inj' {p₁ p₂ : Path a b} {q₁ q₂ : Path b c} (h : p₁.length = p₂.length) :
p₁.comp q₁ = p₂.comp q₂ ↔ p₁ = p₂ ∧ q₁ = q₂ :=
⟨fun h_eq => (comp_inj <| Nat.add_left_cancel <| by simpa [h] using congr_arg length h_eq).1 h_eq,
- by
- rintro ⟨rfl, rfl⟩
- rfl⟩
+ by rintro ⟨rfl, rfl⟩; rfl⟩
#align quiver.path.comp_inj' Quiver.Path.comp_inj'
theorem comp_injective_left (q : Path b c) : Injective fun p : Path a b => p.comp q :=
@@ -31,6 +31,22 @@ inductive Path {V : Type u} [Quiver.{v} V] (a : V) : V → Sort max (u + 1) v
| cons : ∀ {b c : V}, Path a b → (b ⟶ c) → Path a c
#align quiver.path Quiver.Path
+-- See issue lean4#2049
+/-- A computable version of `Quiver.Path.rec`. Workaround until Lean has native support for this. -/
+def Path.recC.{w, z, t} {V : Type t} [Quiver.{z} V] {a : V} {motive : (b : V) → Path a b → Sort w}
+ (nil : motive a Path.nil)
+ (cons : ({b c : V} → (p : Path a b) → (e : b ⟶ c) → motive b p → motive c (p.cons e))) :
+ {b : V} → (p : Path a b) → motive b p
+ | _, .nil => nil
+ | _, (.cons p e) => cons p e (Quiver.Path.recC nil cons p)
+
+@[csimp] lemma Path.rec_eq_recC : @Path.rec = @Path.recC := by
+ ext V _ a motive nil cons b p
+ induction p with
+ | nil => rfl
+ | cons p e ih =>
+ rw [Path.recC, ←ih]
+
/-- An arrow viewed as a path of length one. -/
def Hom.toPath {V} [Quiver V] {a b : V} (e : a ⟶ b) : Path a b :=
Path.nil.cons e
This PR is the result of a slight variant on the following "algorithm"
_
and make all uppercase letters into lowercase_
and make all uppercase letters into lowercase(original_lean3_name, OriginalLean4Name)
#align
statement just before the next empty line#align
statement to have been inserted too early)@@ -29,10 +29,12 @@ namespace Quiver
inductive Path {V : Type u} [Quiver.{v} V] (a : V) : V → Sort max (u + 1) v
| nil : Path a a
| cons : ∀ {b c : V}, Path a b → (b ⟶ c) → Path a c
+#align quiver.path Quiver.Path
/-- An arrow viewed as a path of length one. -/
def Hom.toPath {V} [Quiver V] {a b : V} (e : a ⟶ b) : Path a b :=
Path.nil.cons e
+#align quiver.hom.to_path Quiver.Hom.toPath
namespace Path
@@ -40,23 +42,29 @@ variable {V : Type u} [Quiver V] {a b c d : V}
lemma nil_ne_cons (p : Path a b) (e : b ⟶ a) : Path.nil ≠ p.cons e :=
fun h => by injection h
+#align quiver.path.nil_ne_cons Quiver.Path.nil_ne_cons
lemma cons_ne_nil (p : Path a b) (e : b ⟶ a) : p.cons e ≠ Path.nil :=
fun h => by injection h
+#align quiver.path.cons_ne_nil Quiver.Path.cons_ne_nil
lemma obj_eq_of_cons_eq_cons {p : Path a b} {p' : Path a c}
{e : b ⟶ d} {e' : c ⟶ d} (h : p.cons e = p'.cons e') : b = c := by injection h
+#align quiver.path.obj_eq_of_cons_eq_cons Quiver.Path.obj_eq_of_cons_eq_cons
lemma heq_of_cons_eq_cons {p : Path a b} {p' : Path a c}
{e : b ⟶ d} {e' : c ⟶ d} (h : p.cons e = p'.cons e') : HEq p p' := by injection h
+#align quiver.path.heq_of_cons_eq_cons Quiver.Path.heq_of_cons_eq_cons
lemma hom_heq_of_cons_eq_cons {p : Path a b} {p' : Path a c}
{e : b ⟶ d} {e' : c ⟶ d} (h : p.cons e = p'.cons e') : HEq e e' := by injection h
+#align quiver.path.hom_heq_of_cons_eq_cons Quiver.Path.hom_heq_of_cons_eq_cons
/-- The length of a path is the number of arrows it uses. -/
def length {a : V} : ∀ {b : V}, Path a b → ℕ
| _, nil => 0
| _, cons p _ => p.length + 1
+#align quiver.path.length Quiver.Path.length
instance {a : V} : Inhabited (Path a a) :=
⟨nil⟩
@@ -64,45 +72,54 @@ instance {a : V} : Inhabited (Path a a) :=
@[simp]
theorem length_nil {a : V} : (nil : Path a a).length = 0 :=
rfl
+#align quiver.path.length_nil Quiver.Path.length_nil
@[simp]
theorem length_cons (a b c : V) (p : Path a b) (e : b ⟶ c) : (p.cons e).length = p.length + 1 :=
rfl
+#align quiver.path.length_cons Quiver.Path.length_cons
theorem eq_of_length_zero (p : Path a b) (hzero : p.length = 0) : a = b := by
cases p
· rfl
· cases Nat.succ_ne_zero _ hzero
+#align quiver.path.eq_of_length_zero Quiver.Path.eq_of_length_zero
/-- Composition of paths. -/
def comp {a b : V} : ∀ {c}, Path a b → Path b c → Path a c
| _, p, nil => p
| _, p, cons q e => (p.comp q).cons e
+#align quiver.path.comp Quiver.Path.comp
@[simp]
theorem comp_cons {a b c d : V} (p : Path a b) (q : Path b c) (e : c ⟶ d) :
p.comp (q.cons e) = (p.comp q).cons e :=
rfl
+#align quiver.path.comp_cons Quiver.Path.comp_cons
@[simp]
theorem comp_nil {a b : V} (p : Path a b) : p.comp Path.nil = p :=
rfl
+#align quiver.path.comp_nil Quiver.Path.comp_nil
@[simp]
theorem nil_comp {a : V} : ∀ {b} (p : Path a b), Path.nil.comp p = p
| _, nil => rfl
| _, cons p _ => by rw [comp_cons, nil_comp p]
+#align quiver.path.nil_comp Quiver.Path.nil_comp
@[simp]
theorem comp_assoc {a b c : V} :
∀ {d} (p : Path a b) (q : Path b c) (r : Path c d), (p.comp q).comp r = p.comp (q.comp r)
| _, _, _, nil => rfl
| _, p, q, cons r _ => by rw [comp_cons, comp_cons, comp_cons, comp_assoc p q r]
+#align quiver.path.comp_assoc Quiver.Path.comp_assoc
@[simp]
theorem length_comp (p : Path a b) : ∀ {c} (q : Path b c), (p.comp q).length = p.length + q.length
| _, nil => rfl
| _, cons _ _ => congr_arg Nat.succ (length_comp _ _)
+#align quiver.path.length_comp Quiver.Path.length_comp
theorem comp_inj {p₁ p₂ : Path a b} {q₁ q₂ : Path b c} (hq : q₁.length = q₂.length) :
p₁.comp q₁ = p₂.comp q₂ ↔ p₁ = p₂ ∧ q₁ = q₂ := by
@@ -116,6 +133,7 @@ theorem comp_inj {p₁ p₂ : Path a b} {q₁ q₂ : Path b c} (hq : q₁.length
obtain ⟨rfl, rfl⟩ := ih (Nat.succ.inj hq) h.2.1.eq
rw [h.2.2.eq]
exact ⟨rfl, rfl⟩
+#align quiver.path.comp_inj Quiver.Path.comp_inj
theorem comp_inj' {p₁ p₂ : Path a b} {q₁ q₂ : Path b c} (h : p₁.length = p₂.length) :
p₁.comp q₁ = p₂.comp q₂ ↔ p₁ = p₂ ∧ q₁ = q₂ :=
@@ -123,26 +141,32 @@ theorem comp_inj' {p₁ p₂ : Path a b} {q₁ q₂ : Path b c} (h : p₁.length
by
rintro ⟨rfl, rfl⟩
rfl⟩
+#align quiver.path.comp_inj' Quiver.Path.comp_inj'
theorem comp_injective_left (q : Path b c) : Injective fun p : Path a b => p.comp q :=
fun _ _ h => ((comp_inj rfl).1 h).1
+#align quiver.path.comp_injective_left Quiver.Path.comp_injective_left
theorem comp_injective_right (p : Path a b) : Injective (p.comp : Path b c → Path a c) :=
fun _ _ h => ((comp_inj' rfl).1 h).2
+#align quiver.path.comp_injective_right Quiver.Path.comp_injective_right
@[simp]
theorem comp_inj_left {p₁ p₂ : Path a b} {q : Path b c} : p₁.comp q = p₂.comp q ↔ p₁ = p₂ :=
q.comp_injective_left.eq_iff
+#align quiver.path.comp_inj_left Quiver.Path.comp_inj_left
@[simp]
theorem comp_inj_right {p : Path a b} {q₁ q₂ : Path b c} : p.comp q₁ = p.comp q₂ ↔ q₁ = q₂ :=
p.comp_injective_right.eq_iff
+#align quiver.path.comp_inj_right Quiver.Path.comp_inj_right
/-- Turn a path into a list. The list contains `a` at its head, but not `b` a priori. -/
@[simp]
def toList : ∀ {b : V}, Path a b → List V
| _, nil => []
| _, @cons _ _ _ c _ p _ => c :: p.toList
+#align quiver.path.to_list Quiver.Path.toList
/-- `Quiver.Path.toList` is a contravariant functor. The inversion comes from `Quiver.Path` and
`List` having different preferred directions for adding elements. -/
@@ -5,7 +5,7 @@ Authors: David Wärn, Scott Morrison
Ported by: Joël Riou
! This file was ported from Lean 3 source module combinatorics.quiver.path
-! leanprover-community/mathlib commit 18a5306c091183ac90884daa9373fa3b178e8607
+! leanprover-community/mathlib commit 18a5306c091183ac90884daa9373fa3b178e8607
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
Note that the SHA for Data.Set.Function
has not be bumped to HEAD
since some functions introduced in https://github.com/leanprover-community/mathlib/commit/d1723c047a091ae3fca0af8aeab1743e1a898611 are missing.
@@ -5,7 +5,7 @@ Authors: David Wärn, Scott Morrison
Ported by: Joël Riou
! This file was ported from Lean 3 source module combinatorics.quiver.path
-! leanprover-community/mathlib commit 62a5626868683c104774de8d85b9855234ac807c
+! leanprover-community/mathlib commit 18a5306c091183ac90884daa9373fa3b178e8607
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
The script used to do this is included. The yaml file was obtained from https://raw.githubusercontent.com/wiki/leanprover-community/mathlib/mathlib4-port-status.md
@@ -3,6 +3,11 @@ Copyright (c) 2021 David Wärn,. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: David Wärn, Scott Morrison
Ported by: Joël Riou
+
+! This file was ported from Lean 3 source module combinatorics.quiver.path
+! leanprover-community/mathlib commit 62a5626868683c104774de8d85b9855234ac807c
+! Please do not edit these lines, except to modify the commit id
+! if you have ported upstream changes.
-/
import Mathlib.Combinatorics.Quiver.Basic
import Mathlib.Logic.Lemmas
All dependencies are ported!