combinatorics.quiver.basicMathlib.Combinatorics.Quiver.Basic

This file has been ported!

Changes since the initial port

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.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(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)

feat(combinatorics/quiver/single_obj): single object quivers (#17846)

I think it makes sense for category_theory/single_obj to depend on combinatorics/quiver/single_obj, but I'd like to know what people working with category theory think of that.

Co-authored by: Remi Bottinelli https://github.com/bottine

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>

Diff
@@ -103,7 +103,7 @@ lemma comp_assoc
 
 infix ` ⥤q `:50 := prefunctor
 
-infix ` ⋙q `:50 := prefunctor.comp
+infix ` ⋙q `:60 := prefunctor.comp
 
 notation `𝟭q` := id
 

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

feat(combinatorics/quiver/*) 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>

Diff
@@ -90,6 +90,12 @@ def comp {U : Type*} [quiver U] {V : Type*} [quiver V] {W : Type*} [quiver W]
 { obj := λ X, G.obj (F.obj X),
   map := λ X Y f, G.map (F.map f), }
 
+@[simp] lemma comp_id {U : Type*} [quiver U] {V : Type*} [quiver V] (F : prefunctor U V) :
+  F.comp (id _) = F := by { cases F, refl, }
+
+@[simp] lemma id_comp {U : Type*} [quiver U] {V : Type*} [quiver V] (F : prefunctor U V) :
+  (id _).comp F = F := by { cases F, refl, }
+
 @[simp]
 lemma comp_assoc
   {U V W Z : Type*} [quiver U] [quiver V] [quiver W] [quiver Z]

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

feat(quiver/basic): push arrows of a quiver along a map (#17618)

Co-authored-by: Rémi Bottinelli <bottine@users.noreply.github.com>

Diff
@@ -129,7 +129,6 @@ instance empty_quiver (V : Type u) : quiver.{u} (empty V) := ⟨λ a b, pempty
 
 @[simp] lemma empty_arrow {V : Type u} (a b : empty V) : (a ⟶ b) = pempty := rfl
 
-
 /-- A quiver is thin if it has no parallel arrows. -/
 @[reducible] def is_thin (V : Type u) [quiver V] := ∀ (a b : V), subsingleton (a ⟶ b)
 

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(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)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -52,7 +52,7 @@ class Quiver (V : Type u) where
 infixr:10 " ⟶ " => Quiver.Hom
 
 #print Prefunctor /-
-/- ./././Mathport/Syntax/Translate/Command.lean:404:30: infer kinds are unsupported in Lean 4: #[`obj] [] -/
+/- ./././Mathport/Syntax/Translate/Command.lean:400:30: infer kinds are unsupported in Lean 4: #[`obj] [] -/
 -- type as \h
 /-- A morphism of quivers. As we will later have categorical functors extend this structure,
 we call it a `prefunctor`.
Diff
@@ -52,7 +52,7 @@ class Quiver (V : Type u) where
 infixr:10 " ⟶ " => Quiver.Hom
 
 #print Prefunctor /-
-/- ./././Mathport/Syntax/Translate/Command.lean:394:30: infer kinds are unsupported in Lean 4: #[`obj] [] -/
+/- ./././Mathport/Syntax/Translate/Command.lean:404:30: infer kinds are unsupported in Lean 4: #[`obj] [] -/
 -- type as \h
 /-- A morphism of quivers. As we will later have categorical functors extend this structure,
 we call it a `prefunctor`.
Diff
@@ -3,7 +3,7 @@ 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.Data.Opposite
+import Data.Opposite
 
 #align_import combinatorics.quiver.basic from "leanprover-community/mathlib"@"56adee5b5eef9e734d82272918300fca4f3e7cef"
 
@@ -52,7 +52,7 @@ class Quiver (V : Type u) where
 infixr:10 " ⟶ " => Quiver.Hom
 
 #print Prefunctor /-
-/- ./././Mathport/Syntax/Translate/Command.lean:393:30: infer kinds are unsupported in Lean 4: #[`obj] [] -/
+/- ./././Mathport/Syntax/Translate/Command.lean:394:30: infer kinds are unsupported in Lean 4: #[`obj] [] -/
 -- type as \h
 /-- A morphism of quivers. As we will later have categorical functors extend this structure,
 we call it a `prefunctor`.
Diff
@@ -2,14 +2,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
-
-! This file was ported from Lean 3 source module combinatorics.quiver.basic
-! leanprover-community/mathlib commit 56adee5b5eef9e734d82272918300fca4f3e7cef
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Data.Opposite
 
+#align_import combinatorics.quiver.basic from "leanprover-community/mathlib"@"56adee5b5eef9e734d82272918300fca4f3e7cef"
+
 /-!
 # Quivers
 
Diff
@@ -52,10 +52,10 @@ class Quiver (V : Type u) where
 #align quiver Quiver
 -/
 
--- mathport name: «expr ⟶ »
 infixr:10 " ⟶ " => Quiver.Hom
 
-/- ./././Mathport/Syntax/Translate/Command.lean:394:30: infer kinds are unsupported in Lean 4: #[`obj] [] -/
+#print Prefunctor /-
+/- ./././Mathport/Syntax/Translate/Command.lean:393:30: infer kinds are unsupported in Lean 4: #[`obj] [] -/
 -- type as \h
 /-- A morphism of quivers. As we will later have categorical functors extend this structure,
 we call it a `prefunctor`.
@@ -64,6 +64,7 @@ structure Prefunctor (V : Type u₁) [Quiver.{v₁} V] (W : Type u₂) [Quiver.{
   obj : V → W
   map : ∀ {X Y : V}, (X ⟶ Y) → (obj X ⟶ obj Y)
 #align prefunctor Prefunctor
+-/
 
 namespace Prefunctor
 
@@ -109,40 +110,45 @@ def comp {U : Type _} [Quiver U] {V : Type _} [Quiver V] {W : Type _} [Quiver W]
 #align prefunctor.comp Prefunctor.comp
 -/
 
+#print Prefunctor.comp_id /-
 @[simp]
 theorem comp_id {U : Type _} [Quiver U] {V : Type _} [Quiver V] (F : Prefunctor U V) :
     F.comp (id _) = F := by cases F; rfl
 #align prefunctor.comp_id Prefunctor.comp_id
+-/
 
+#print Prefunctor.id_comp /-
 @[simp]
 theorem id_comp {U : Type _} [Quiver U] {V : Type _} [Quiver V] (F : Prefunctor U V) :
     (id _).comp F = F := by cases F; rfl
 #align prefunctor.id_comp Prefunctor.id_comp
+-/
 
+#print Prefunctor.comp_assoc /-
 @[simp]
 theorem comp_assoc {U V W Z : Type _} [Quiver U] [Quiver V] [Quiver W] [Quiver Z]
     (F : Prefunctor U V) (G : Prefunctor V W) (H : Prefunctor W Z) :
     (F.comp G).comp H = F.comp (G.comp H) :=
   rfl
 #align prefunctor.comp_assoc Prefunctor.comp_assoc
+-/
 
--- mathport name: «expr ⥤q »
 infixl:50 " ⥤q " => Prefunctor
 
--- mathport name: «expr ⋙q »
 infixl:60 " ⋙q " => Prefunctor.comp
 
--- mathport name: «expr𝟭q»
 notation "𝟭q" => id
 
 end Prefunctor
 
 namespace Quiver
 
+#print Quiver.opposite /-
 /-- `Vᵒᵖ` reverses the direction of all arrows of `V`. -/
 instance opposite {V} [Quiver V] : Quiver Vᵒᵖ :=
   ⟨fun a b => unop b ⟶ unop a⟩
 #align quiver.opposite Quiver.opposite
+-/
 
 #print Quiver.Hom.op /-
 /-- The opposite of an arrow in `V`.
Diff
@@ -55,7 +55,7 @@ class Quiver (V : Type u) where
 -- mathport name: «expr ⟶ »
 infixr:10 " ⟶ " => Quiver.Hom
 
-/- ./././Mathport/Syntax/Translate/Command.lean:393:30: infer kinds are unsupported in Lean 4: #[`obj] [] -/
+/- ./././Mathport/Syntax/Translate/Command.lean:394:30: infer kinds are unsupported in Lean 4: #[`obj] [] -/
 -- type as \h
 /-- A morphism of quivers. As we will later have categorical functors extend this structure,
 we call it a `prefunctor`.
Diff
@@ -55,12 +55,6 @@ class Quiver (V : Type u) where
 -- mathport name: «expr ⟶ »
 infixr:10 " ⟶ " => Quiver.Hom
 
-/- warning: prefunctor -> Prefunctor is a dubious translation:
-lean 3 declaration is
-  forall (V : Type.{u3}) [_inst_1 : Quiver.{u1, u3} V] (W : Type.{u4}) [_inst_2 : Quiver.{u2, u4} W], Sort.{max (imax (succ u3) (succ u3) u1 u2) (succ u3) (succ u4)}
-but is expected to have type
-  forall (V : Type.{u3}) [_inst_1 : Quiver.{u1, u3} V] (W : Type.{u4}) [_inst_2 : Quiver.{u2, u4} W], Sort.{max (max (max (succ u3) (succ u4)) u1) u2}
-Case conversion may be inaccurate. Consider using '#align prefunctor Prefunctorₓ'. -/
 /- ./././Mathport/Syntax/Translate/Command.lean:393:30: infer kinds are unsupported in Lean 4: #[`obj] [] -/
 -- type as \h
 /-- A morphism of quivers. As we will later have categorical functors extend this structure,
@@ -115,34 +109,16 @@ def comp {U : Type _} [Quiver U] {V : Type _} [Quiver V] {W : Type _} [Quiver W]
 #align prefunctor.comp Prefunctor.comp
 -/
 
-/- warning: prefunctor.comp_id -> Prefunctor.comp_id is a dubious translation:
-lean 3 declaration is
-  forall {U : Type.{u1}} [_inst_1 : Quiver.{u2, u1} U] {V : Type.{u3}} [_inst_2 : Quiver.{u4, u3} V] (F : Prefunctor.{u2, u4, u1, u3} U _inst_1 V _inst_2), Eq.{max (imax (succ u1) (succ u1) u2 u4) (succ u1) (succ u3)} (Prefunctor.{u2, u4, u1, u3} U _inst_1 V _inst_2) (Prefunctor.comp.{u1, u2, u3, u4, u3, u4} U _inst_1 V _inst_2 V _inst_2 F (Prefunctor.id.{u3, u4} V _inst_2)) F
-but is expected to have type
-  forall {U : Type.{u4}} {_inst_1 : Type.{u3}} [V : Quiver.{u2, u4} U] [_inst_2 : Quiver.{u1, u3} _inst_1] (F : Prefunctor.{u2, u1, u4, u3} U V _inst_1 _inst_2), Eq.{max (max (max (succ u4) (succ u3)) u2) u1} (Prefunctor.{u2, u1, u4, u3} U V _inst_1 _inst_2) (Prefunctor.comp.{u4, u2, u3, u1, u3, u1} U V _inst_1 _inst_2 _inst_1 _inst_2 F (Prefunctor.id.{u3, u1} _inst_1 _inst_2)) F
-Case conversion may be inaccurate. Consider using '#align prefunctor.comp_id Prefunctor.comp_idₓ'. -/
 @[simp]
 theorem comp_id {U : Type _} [Quiver U] {V : Type _} [Quiver V] (F : Prefunctor U V) :
     F.comp (id _) = F := by cases F; rfl
 #align prefunctor.comp_id Prefunctor.comp_id
 
-/- warning: prefunctor.id_comp -> Prefunctor.id_comp is a dubious translation:
-lean 3 declaration is
-  forall {U : Type.{u1}} [_inst_1 : Quiver.{u2, u1} U] {V : Type.{u3}} [_inst_2 : Quiver.{u4, u3} V] (F : Prefunctor.{u2, u4, u1, u3} U _inst_1 V _inst_2), Eq.{max (imax (succ u1) (succ u1) u2 u4) (succ u1) (succ u3)} (Prefunctor.{u2, u4, u1, u3} U _inst_1 V _inst_2) (Prefunctor.comp.{u1, u2, u1, u2, u3, u4} U _inst_1 U _inst_1 V _inst_2 (Prefunctor.id.{u1, u2} U _inst_1) F) F
-but is expected to have type
-  forall {U : Type.{u4}} {_inst_1 : Type.{u3}} [V : Quiver.{u2, u4} U] [_inst_2 : Quiver.{u1, u3} _inst_1] (F : Prefunctor.{u2, u1, u4, u3} U V _inst_1 _inst_2), Eq.{max (max (max (succ u4) (succ u3)) u2) u1} (Prefunctor.{u2, u1, u4, u3} U V _inst_1 _inst_2) (Prefunctor.comp.{u4, u2, u4, u2, u3, u1} U V U V _inst_1 _inst_2 (Prefunctor.id.{u4, u2} U V) F) F
-Case conversion may be inaccurate. Consider using '#align prefunctor.id_comp Prefunctor.id_compₓ'. -/
 @[simp]
 theorem id_comp {U : Type _} [Quiver U] {V : Type _} [Quiver V] (F : Prefunctor U V) :
     (id _).comp F = F := by cases F; rfl
 #align prefunctor.id_comp Prefunctor.id_comp
 
-/- warning: prefunctor.comp_assoc -> Prefunctor.comp_assoc is a dubious translation:
-lean 3 declaration is
-  forall {U : Type.{u1}} {V : Type.{u2}} {W : Type.{u3}} {Z : Type.{u4}} [_inst_1 : Quiver.{u5, u1} U] [_inst_2 : Quiver.{u6, u2} V] [_inst_3 : Quiver.{u7, u3} W] [_inst_4 : Quiver.{u8, u4} Z] (F : Prefunctor.{u5, u6, u1, u2} U _inst_1 V _inst_2) (G : Prefunctor.{u6, u7, u2, u3} V _inst_2 W _inst_3) (H : Prefunctor.{u7, u8, u3, u4} W _inst_3 Z _inst_4), Eq.{max (imax (succ u1) (succ u1) u5 u8) (succ u1) (succ u4)} (Prefunctor.{u5, u8, u1, u4} U _inst_1 Z _inst_4) (Prefunctor.comp.{u1, u5, u3, u7, u4, u8} U _inst_1 W _inst_3 Z _inst_4 (Prefunctor.comp.{u1, u5, u2, u6, u3, u7} U _inst_1 V _inst_2 W _inst_3 F G) H) (Prefunctor.comp.{u1, u5, u2, u6, u4, u8} U _inst_1 V _inst_2 Z _inst_4 F (Prefunctor.comp.{u2, u6, u3, u7, u4, u8} V _inst_2 W _inst_3 Z _inst_4 G H))
-but is expected to have type
-  forall {U : Type.{u8}} {V : Type.{u7}} {W : Type.{u6}} {Z : Type.{u5}} [_inst_1 : Quiver.{u4, u8} U] [_inst_2 : Quiver.{u3, u7} V] [_inst_3 : Quiver.{u2, u6} W] [_inst_4 : Quiver.{u1, u5} Z] (F : Prefunctor.{u4, u3, u8, u7} U _inst_1 V _inst_2) (G : Prefunctor.{u3, u2, u7, u6} V _inst_2 W _inst_3) (H : Prefunctor.{u2, u1, u6, u5} W _inst_3 Z _inst_4), Eq.{max (max (max (succ u8) (succ u5)) u4) u1} (Prefunctor.{u4, u1, u8, u5} U _inst_1 Z _inst_4) (Prefunctor.comp.{u8, u4, u6, u2, u5, u1} U _inst_1 W _inst_3 Z _inst_4 (Prefunctor.comp.{u8, u4, u7, u3, u6, u2} U _inst_1 V _inst_2 W _inst_3 F G) H) (Prefunctor.comp.{u8, u4, u7, u3, u5, u1} U _inst_1 V _inst_2 Z _inst_4 F (Prefunctor.comp.{u7, u3, u6, u2, u5, u1} V _inst_2 W _inst_3 Z _inst_4 G H))
-Case conversion may be inaccurate. Consider using '#align prefunctor.comp_assoc Prefunctor.comp_assocₓ'. -/
 @[simp]
 theorem comp_assoc {U V W Z : Type _} [Quiver U] [Quiver V] [Quiver W] [Quiver Z]
     (F : Prefunctor U V) (G : Prefunctor V W) (H : Prefunctor W Z) :
@@ -163,12 +139,6 @@ end Prefunctor
 
 namespace Quiver
 
-/- warning: quiver.opposite -> Quiver.opposite is a dubious translation:
-lean 3 declaration is
-  forall {V : Type.{u1}} [_inst_1 : Quiver.{u2, u1} V], Quiver.{u2, u1} (Opposite.{succ u1} V)
-but is expected to have type
-  forall {V : Type.{u1}} [_inst_1 : Quiver.{u2, u1} V], Quiver.{max 1 u2, u1} (Opposite.{succ u1} V)
-Case conversion may be inaccurate. Consider using '#align quiver.opposite Quiver.oppositeₓ'. -/
 /-- `Vᵒᵖ` reverses the direction of all arrows of `V`. -/
 instance opposite {V} [Quiver V] : Quiver Vᵒᵖ :=
   ⟨fun a b => unop b ⟶ unop a⟩
Diff
@@ -81,11 +81,8 @@ theorem ext {V : Type u} [Quiver.{v₁} V] {W : Type u₂} [Quiver.{v₂} W] {F
       ∀ (X Y : V) (f : X ⟶ Y),
         F.map f = Eq.recOn (h_obj Y).symm (Eq.recOn (h_obj X).symm (G.map f))) :
     F = G := by
-  cases' F with F_obj _
-  cases' G with G_obj _
-  obtain rfl : F_obj = G_obj := by
-    ext X
-    apply h_obj
+  cases' F with F_obj _; cases' G with G_obj _
+  obtain rfl : F_obj = G_obj := by ext X; apply h_obj
   congr
   funext X Y f
   simpa using h_map X Y f
@@ -126,9 +123,7 @@ but is expected to have type
 Case conversion may be inaccurate. Consider using '#align prefunctor.comp_id Prefunctor.comp_idₓ'. -/
 @[simp]
 theorem comp_id {U : Type _} [Quiver U] {V : Type _} [Quiver V] (F : Prefunctor U V) :
-    F.comp (id _) = F := by
-  cases F
-  rfl
+    F.comp (id _) = F := by cases F; rfl
 #align prefunctor.comp_id Prefunctor.comp_id
 
 /- warning: prefunctor.id_comp -> Prefunctor.id_comp is a dubious translation:
@@ -139,9 +134,7 @@ but is expected to have type
 Case conversion may be inaccurate. Consider using '#align prefunctor.id_comp Prefunctor.id_compₓ'. -/
 @[simp]
 theorem id_comp {U : Type _} [Quiver U] {V : Type _} [Quiver V] (F : Prefunctor U V) :
-    (id _).comp F = F := by
-  cases F
-  rfl
+    (id _).comp F = F := by cases F; rfl
 #align prefunctor.id_comp Prefunctor.id_comp
 
 /- warning: prefunctor.comp_assoc -> Prefunctor.comp_assoc is a dubious translation:
Diff
@@ -61,7 +61,7 @@ lean 3 declaration is
 but is expected to have type
   forall (V : Type.{u3}) [_inst_1 : Quiver.{u1, u3} V] (W : Type.{u4}) [_inst_2 : Quiver.{u2, u4} W], Sort.{max (max (max (succ u3) (succ u4)) u1) u2}
 Case conversion may be inaccurate. Consider using '#align prefunctor Prefunctorₓ'. -/
-/- ./././Mathport/Syntax/Translate/Command.lean:388:30: infer kinds are unsupported in Lean 4: #[`obj] [] -/
+/- ./././Mathport/Syntax/Translate/Command.lean:393:30: infer kinds are unsupported in Lean 4: #[`obj] [] -/
 -- type as \h
 /-- A morphism of quivers. As we will later have categorical functors extend this structure,
 we call it a `prefunctor`.
Diff
@@ -170,12 +170,16 @@ end Prefunctor
 
 namespace Quiver
 
-#print Quiver.opposite /-
+/- warning: quiver.opposite -> Quiver.opposite is a dubious translation:
+lean 3 declaration is
+  forall {V : Type.{u1}} [_inst_1 : Quiver.{u2, u1} V], Quiver.{u2, u1} (Opposite.{succ u1} V)
+but is expected to have type
+  forall {V : Type.{u1}} [_inst_1 : Quiver.{u2, u1} V], Quiver.{max 1 u2, u1} (Opposite.{succ u1} V)
+Case conversion may be inaccurate. Consider using '#align quiver.opposite Quiver.oppositeₓ'. -/
 /-- `Vᵒᵖ` reverses the direction of all arrows of `V`. -/
 instance opposite {V} [Quiver V] : Quiver Vᵒᵖ :=
   ⟨fun a b => unop b ⟶ unop a⟩
 #align quiver.opposite Quiver.opposite
--/
 
 #print Quiver.Hom.op /-
 /-- The opposite of an arrow in `V`.

Changes in mathlib4

mathlib3
mathlib4
feat(CategoryTheory/EqToHom): generalize Functor.congr_map to Prefunctor.congr_map (#12384)
Diff
@@ -135,6 +135,10 @@ infixl:60 " ⋙q " => Prefunctor.comp
 /-- Notation for the identity prefunctor on a quiver. -/
 notation "𝟭q" => id
 
+theorem congr_map {U V : Type*} [Quiver U] [Quiver V] (F : U ⥤q V) {X Y : U} {f g : X ⟶ Y}
+    (h : f = g) : F.map f = F.map g := by
+  rw [h]
+
 end Prefunctor
 
 namespace Quiver
chore: remove autoImplicit from more files (#11798)

and reduce its scope in a few other instances. Mostly in CategoryTheory and Data this time; some Combinatorics also.

Co-authored-by: Richard Osborn <richardosborn@mac.com>

Diff
@@ -24,9 +24,6 @@ There's some balance here: it's nice to allow `Prop` to ensure there are no mult
 but it is also results in error-prone universe signatures when constraints require a `Type`.
 -/
 
-set_option autoImplicit true
-
-
 open Opposite
 
 -- We use the same universe order as in category theory.
@@ -69,8 +66,10 @@ namespace Prefunctor
 -- Porting note: added during port.
 -- These lemmas can not be `@[simp]` because after `whnfR` they have a variable on the LHS.
 -- Nevertheless they are sometimes useful when building functors.
-lemma mk_obj [Quiver V] {obj : V → V} {map} {X : V} : (Prefunctor.mk obj map).obj X = obj X := rfl
-lemma mk_map [Quiver V] {obj : V → V} {map} {X Y : V} {f : X ⟶ Y} :
+lemma mk_obj {V : Type*} [Quiver V] {obj : V → V} {map} {X : V} :
+    (Prefunctor.mk obj map).obj X = obj X := rfl
+
+lemma mk_map {V : Type*} [Quiver V] {obj : V → V} {map} {X Y : V} {f : X ⟶ Y} :
     (Prefunctor.mk obj map).map f = map f := rfl
 
 @[ext]
chore: classify porting notes referring to missing linters (#12098)

Reference the newly created issues #12094 and #12096, as well as the pre-existing #5171. Change all references to #10927 to #5171. Some of these changes were not labelled as "porting note"; change this for good measure.

Diff
@@ -156,7 +156,7 @@ def Hom.unop {V} [Quiver V] {X Y : Vᵒᵖ} (f : X ⟶ Y) : unop Y ⟶ unop X :=
 #align quiver.hom.unop Quiver.Hom.unop
 
 /-- A type synonym for a quiver with no arrows. -/
--- Porting note: no has_nonempty_instance linter yet
+-- Porting note(#5171): this linter isn't ported yet.
 -- @[nolint has_nonempty_instance]
 def Empty (V : Type u) : Type u := V
 #align quiver.empty Quiver.Empty
chore: remove unnecessary pp_dots (#11166)

Release 4.7.0-rc1 makes it unnecessary to add pp_dot to structure fields. It used to be that function fields wouldn't pretty print using dot notation when the function was applied unless pp_dot was added.

Diff
@@ -64,8 +64,6 @@ structure Prefunctor (V : Type u₁) [Quiver.{v₁} V] (W : Type u₂) [Quiver.{
   map : ∀ {X Y : V}, (X ⟶ Y) → (obj X ⟶ obj Y)
 #align prefunctor Prefunctor
 
-attribute [pp_dot] Prefunctor.obj Prefunctor.map
-
 namespace Prefunctor
 
 -- Porting note: added during port.
doc: Make the docs more uniform for the Category and Quiver modules (#8928)

Fix the description of the definition of Quiver and change the example of the use of to be consistent with the above use of .

Diff
@@ -17,7 +17,7 @@ is a very permissive notion of directed graph.
 
 ## Implementation notes
 
-Currently `Quiver` is defined with `arrow : V → V → Sort v`.
+Currently `Quiver` is defined with `Hom : V → V → Sort v`.
 This is different from the category theory setup,
 where we insist that morphisms live in some `Type`.
 There's some balance here: it's nice to allow `Prop` to ensure there are no multiple arrows,
chore: delay import of Tactic.Common (#7000)

I know that this is contrary to what we've done previously, but:

  • I'm trying to upstream a great many tactics from Mathlib to Std (essentially, everything that non-mathematicians want too).
  • This makes it much easier for me to see what is going on, and understand the import requirements (particularly for the "big" tactics norm_num / ring / linarith)
  • It's actually not as bad as it looks here, because as these tactics move up to Std they will start disappearing again from explicit imports, but Mathlib can happily import all of Std.

(Oh

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: David Wärn, Scott Morrison
 -/
 import Mathlib.Data.Opposite
+import Mathlib.Tactic.Cases
 
 #align_import combinatorics.quiver.basic from "leanprover-community/mathlib"@"56adee5b5eef9e734d82272918300fca4f3e7cef"
 
fix: disable autoImplicit globally (#6528)

Autoimplicits are highly controversial and also defeat the performance-improving work in #6474.

The intent of this PR is to make autoImplicit opt-in on a per-file basis, by disabling it in the lakefile and enabling it again with set_option autoImplicit true in the few files that rely on it.

That also keeps this PR small, as opposed to attempting to "fix" files to not need it any more.

I claim that many of the uses of autoImplicit in these files are accidental; situations such as:

  • Assuming variables are in scope, but pasting the lemma in the wrong section
  • Pasting in a lemma from a scratch file without checking to see if the variable names are consistent with the rest of the file
  • Making a copy-paste error between lemmas and forgetting to add an explicit arguments.

Having set_option autoImplicit false as the default prevents these types of mistake being made in the 90% of files where autoImplicits are not used at all, and causes them to be caught by CI during review.

I think there were various points during the port where we encouraged porters to delete the universes u v lines; I think having autoparams for universe variables only would cover a lot of the cases we actually use them, while avoiding any real shortcomings.

A Zulip poll (after combining overlapping votes accordingly) was in favor of this change with 5:5:18 as the no:dontcare:yes vote ratio.

While this PR was being reviewed, a handful of files gained some more likely-accidental autoImplicits. In these places, set_option autoImplicit true has been placed locally within a section, rather than at the top of the file.

Diff
@@ -23,6 +23,8 @@ There's some balance here: it's nice to allow `Prop` to ensure there are no mult
 but it is also results in error-prone universe signatures when constraints require a `Type`.
 -/
 
+set_option autoImplicit true
+
 
 open Opposite
 
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -89,19 +89,19 @@ theorem ext {V : Type u} [Quiver.{v₁} V] {W : Type u₂} [Quiver.{v₂} W] {F
 
 /-- The identity morphism between quivers. -/
 @[simps]
-def id (V : Type _) [Quiver V] : Prefunctor V V where
+def id (V : Type*) [Quiver V] : Prefunctor V V where
   obj := fun X => X
   map f := f
 #align prefunctor.id Prefunctor.id
 #align prefunctor.id_obj Prefunctor.id_obj
 #align prefunctor.id_map Prefunctor.id_map
 
-instance (V : Type _) [Quiver V] : Inhabited (Prefunctor V V) :=
+instance (V : Type*) [Quiver V] : Inhabited (Prefunctor V V) :=
   ⟨id V⟩
 
 /-- Composition of morphisms between quivers. -/
 @[simps, pp_dot]
-def comp {U : Type _} [Quiver U] {V : Type _} [Quiver V] {W : Type _} [Quiver W]
+def comp {U : Type*} [Quiver U] {V : Type*} [Quiver V] {W : Type*} [Quiver W]
     (F : Prefunctor U V) (G : Prefunctor V W) : Prefunctor U W where
   obj X := G.obj (F.obj X)
   map f := G.map (F.map f)
@@ -110,17 +110,17 @@ def comp {U : Type _} [Quiver U] {V : Type _} [Quiver V] {W : Type _} [Quiver W]
 #align prefunctor.comp_map Prefunctor.comp_map
 
 @[simp]
-theorem comp_id {U V : Type _} [Quiver U] [Quiver V] (F : Prefunctor U V) :
+theorem comp_id {U V : Type*} [Quiver U] [Quiver V] (F : Prefunctor U V) :
     F.comp (id _) = F := rfl
 #align prefunctor.comp_id Prefunctor.comp_id
 
 @[simp]
-theorem id_comp {U V : Type _} [Quiver U] [Quiver V] (F : Prefunctor U V) :
+theorem id_comp {U V : Type*} [Quiver U] [Quiver V] (F : Prefunctor U V) :
     (id _).comp F = F := rfl
 #align prefunctor.id_comp Prefunctor.id_comp
 
 @[simp]
-theorem comp_assoc {U V W Z : Type _} [Quiver U] [Quiver V] [Quiver W] [Quiver Z]
+theorem comp_assoc {U V W Z : Type*} [Quiver U] [Quiver V] [Quiver W] [Quiver Z]
     (F : Prefunctor U V) (G : Prefunctor V W) (H : Prefunctor W Z) :
     (F.comp G).comp H = F.comp (G.comp H) :=
   rfl
chore: remove 'Ported by' headers (#6018)

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>

Diff
@@ -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: Scott Morrison
 -/
 import Mathlib.Data.Opposite
 
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -3,14 +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: Scott Morrison
-
-! This file was ported from Lean 3 source module combinatorics.quiver.basic
-! leanprover-community/mathlib commit 56adee5b5eef9e734d82272918300fca4f3e7cef
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Data.Opposite
 
+#align_import combinatorics.quiver.basic from "leanprover-community/mathlib"@"56adee5b5eef9e734d82272918300fca4f3e7cef"
+
 /-!
 # Quivers
 
feat: pp_dot attribute to replace pp_extended_field_notation command (#5632)
Diff
@@ -65,8 +65,7 @@ structure Prefunctor (V : Type u₁) [Quiver.{v₁} V] (W : Type u₂) [Quiver.{
   map : ∀ {X Y : V}, (X ⟶ Y) → (obj X ⟶ obj Y)
 #align prefunctor Prefunctor
 
-pp_extended_field_notation Prefunctor.obj
-pp_extended_field_notation Prefunctor.map
+attribute [pp_dot] Prefunctor.obj Prefunctor.map
 
 namespace Prefunctor
 
@@ -105,7 +104,7 @@ instance (V : Type _) [Quiver V] : Inhabited (Prefunctor V V) :=
   ⟨id V⟩
 
 /-- Composition of morphisms between quivers. -/
-@[simps]
+@[simps, pp_dot]
 def comp {U : Type _} [Quiver U] {V : Type _} [Quiver V] {W : Type _} [Quiver W]
     (F : Prefunctor U V) (G : Prefunctor V W) : Prefunctor U W where
   obj X := G.obj (F.obj X)
@@ -114,8 +113,6 @@ def comp {U : Type _} [Quiver U] {V : Type _} [Quiver V] {W : Type _} [Quiver W]
 #align prefunctor.comp_obj Prefunctor.comp_obj
 #align prefunctor.comp_map Prefunctor.comp_map
 
-pp_extended_field_notation Prefunctor.comp
-
 @[simp]
 theorem comp_id {U V : Type _} [Quiver U] [Quiver V] (F : Prefunctor U V) :
     F.comp (id _) = F := rfl
@@ -151,20 +148,16 @@ instance opposite {V} [Quiver V] : Quiver Vᵒᵖ :=
   ⟨fun a b => (unop b ⟶ unop a)ᵒᵖ⟩
 #align quiver.opposite Quiver.opposite
 
-/-- The opposite of an arrow in `V`.
--/
+/-- The opposite of an arrow in `V`. -/
+@[pp_dot]
 def Hom.op {V} [Quiver V] {X Y : V} (f : X ⟶ Y) : op Y ⟶ op X := ⟨f⟩
 #align quiver.hom.op Quiver.Hom.op
 
-pp_extended_field_notation Quiver.Hom.op
-
-/-- Given an arrow in `Vᵒᵖ`, we can take the "unopposite" back in `V`.
--/
+/-- Given an arrow in `Vᵒᵖ`, we can take the "unopposite" back in `V`. -/
+@[pp_dot]
 def Hom.unop {V} [Quiver V] {X Y : Vᵒᵖ} (f : X ⟶ Y) : unop Y ⟶ unop X := Opposite.unop f
 #align quiver.hom.unop Quiver.Hom.unop
 
-pp_extended_field_notation Quiver.Hom.unop
-
 /-- A type synonym for a quiver with no arrows. -/
 -- Porting note: no has_nonempty_instance linter yet
 -- @[nolint has_nonempty_instance]
doc: fix typo (#5664)

"hom" should be "Hom".

Diff
@@ -41,7 +41,7 @@ For graphs with no repeated edges, one can use `Quiver.{0} V`, which ensures
 `a ⟶ b : Prop`. For multigraphs, one can use `Quiver.{v+1} V`, which ensures
 `a ⟶ b : Type v`.
 
-Because `Category` will later extend this class, we call the field `hom`.
+Because `Category` will later extend this class, we call the field `Hom`.
 Except when constructing instances, you should rarely see this, and use the `⟶` notation instead.
 -/
 class Quiver (V : Type u) where
chore: cleanup in PresheafedSpace (#4558)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -70,6 +70,13 @@ pp_extended_field_notation Prefunctor.map
 
 namespace Prefunctor
 
+-- Porting note: added during port.
+-- These lemmas can not be `@[simp]` because after `whnfR` they have a variable on the LHS.
+-- Nevertheless they are sometimes useful when building functors.
+lemma mk_obj [Quiver V] {obj : V → V} {map} {X : V} : (Prefunctor.mk obj map).obj X = obj X := rfl
+lemma mk_map [Quiver V] {obj : V → V} {map} {X Y : V} {f : X ⟶ Y} :
+    (Prefunctor.mk obj map).map f = map f := rfl
+
 @[ext]
 theorem ext {V : Type u} [Quiver.{v₁} V] {W : Type u₂} [Quiver.{v₂} W] {F G : Prefunctor V W}
     (h_obj : ∀ X, F.obj X = G.obj X)
feat: add Mathlib.Tactic.Common, and import (#4056)

This makes a mathlib4 version of mathlib3's tactic.basic, now called Mathlib.Tactic.Common, which imports all tactics which do not have significant theory requirements, and then is imported all across the base of the hierarchy.

This ensures that all common tactics are available nearly everywhere in the library, rather than having to be imported one-by-one as you need them.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -10,7 +10,6 @@ Ported by: Scott Morrison
 ! if you have ported upstream changes.
 -/
 import Mathlib.Data.Opposite
-import Mathlib.Tactic.ProjectionNotation
 
 /-!
 # Quivers
feat: let pp_extended_field_notation work for non-structures (#3946)

Co-authored-by: Kevin Buzzard <k.buzzard@imperial.ac.uk>

Diff
@@ -150,11 +150,15 @@ instance opposite {V} [Quiver V] : Quiver Vᵒᵖ :=
 def Hom.op {V} [Quiver V] {X Y : V} (f : X ⟶ Y) : op Y ⟶ op X := ⟨f⟩
 #align quiver.hom.op Quiver.Hom.op
 
+pp_extended_field_notation Quiver.Hom.op
+
 /-- Given an arrow in `Vᵒᵖ`, we can take the "unopposite" back in `V`.
 -/
 def Hom.unop {V} [Quiver V] {X Y : Vᵒᵖ} (f : X ⟶ Y) : unop Y ⟶ unop X := Opposite.unop f
 #align quiver.hom.unop Quiver.Hom.unop
 
+pp_extended_field_notation Quiver.Hom.unop
+
 /-- A type synonym for a quiver with no arrows. -/
 -- Porting note: no has_nonempty_instance linter yet
 -- @[nolint has_nonempty_instance]
feat: pp_extended_field_notation command to pretty print with dot notation (#3811)

The projection notation delaborator that comes from core Lean has some limitations. We introduce a new projection notation delaborator that is able to collapse parent projection sequences, for example x.toC.toB.toA.val into x.val.

The other limitation of the delaborator is that it can only handle true projections that do not have any additional arguments. This commit adds a pp_extended_field_notation command to switch on projection notation for specific functions. This command defines app unexpanders that pretty print that function application using dot notation.

The app unexpander it produces has a small hack to completely collapse parent projection sequences. Since it is an app unexpander, we do not have access to the actual types, so we use a heuristic that, for example with A.foo, if we are looking at A.foo x.toA y z ... then we can pretty print this as x.foo y z. The projection delaborator is able to collapse parent projection sequences except for the vary last one, so this finishes it off. Note that this heuristic can lead to output that does not round trip if there is a toA function that is not a parent projection that happens to be pretty printed with dot notation.

Diff
@@ -10,6 +10,7 @@ Ported by: Scott Morrison
 ! if you have ported upstream changes.
 -/
 import Mathlib.Data.Opposite
+import Mathlib.Tactic.ProjectionNotation
 
 /-!
 # Quivers
@@ -65,6 +66,9 @@ structure Prefunctor (V : Type u₁) [Quiver.{v₁} V] (W : Type u₂) [Quiver.{
   map : ∀ {X Y : V}, (X ⟶ Y) → (obj X ⟶ obj Y)
 #align prefunctor Prefunctor
 
+pp_extended_field_notation Prefunctor.obj
+pp_extended_field_notation Prefunctor.map
+
 namespace Prefunctor
 
 @[ext]
@@ -104,6 +108,8 @@ def comp {U : Type _} [Quiver U] {V : Type _} [Quiver V] {W : Type _} [Quiver W]
 #align prefunctor.comp_obj Prefunctor.comp_obj
 #align prefunctor.comp_map Prefunctor.comp_map
 
+pp_extended_field_notation Prefunctor.comp
+
 @[simp]
 theorem comp_id {U V : Type _} [Quiver U] [Quiver V] (F : Prefunctor U V) :
     F.comp (id _) = F := rfl
chore: made Opposite a structure (#3193)

The opposite category is no longer a type synonym, but a structure.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Parcly Taxel <reddeloostw@gmail.com> Co-authored-by: Scott Morrison <scott@tqft.net>

Diff
@@ -136,17 +136,17 @@ namespace Quiver
 
 /-- `Vᵒᵖ` reverses the direction of all arrows of `V`. -/
 instance opposite {V} [Quiver V] : Quiver Vᵒᵖ :=
-  ⟨fun a b => unop b ⟶ unop a⟩
+  ⟨fun a b => (unop b ⟶ unop a)ᵒᵖ⟩
 #align quiver.opposite Quiver.opposite
 
 /-- The opposite of an arrow in `V`.
 -/
-def Hom.op {V} [Quiver V] {X Y : V} (f : X ⟶ Y) : op Y ⟶ op X := f
+def Hom.op {V} [Quiver V] {X Y : V} (f : X ⟶ Y) : op Y ⟶ op X := ⟨f⟩
 #align quiver.hom.op Quiver.Hom.op
 
 /-- Given an arrow in `Vᵒᵖ`, we can take the "unopposite" back in `V`.
 -/
-def Hom.unop {V} [Quiver V] {X Y : Vᵒᵖ} (f : X ⟶ Y) : unop Y ⟶ unop X := f
+def Hom.unop {V} [Quiver V] {X Y : Vᵒᵖ} (f : X ⟶ Y) : unop Y ⟶ unop X := Opposite.unop f
 #align quiver.hom.unop Quiver.Hom.unop
 
 /-- A type synonym for a quiver with no arrows. -/
fix: category_theory -> CategoryTheory in note (#2357)

This changes the name of a library_note from "category_theory universes" to "CategoryTheory universes" to be more in line with the new naming conventions.

Co-authored-by: Moritz Firsching <firsching@google.com>

Diff
@@ -31,7 +31,7 @@ but it is also results in error-prone universe signatures when constraints requi
 open Opposite
 
 -- We use the same universe order as in category theory.
--- See note [category_theory universes]
+-- See note [CategoryTheory universes]
 universe v v₁ v₂ u u₁ u₂
 
 /-- A quiver `G` on a type `V` of vertices assigns to every pair `a b : V` of vertices
chore: add missing #align statements (#1902)

This PR is the result of a slight variant on the following "algorithm"

  • take all mathlib 3 names, remove _ and make all uppercase letters into lowercase
  • take all mathlib 4 names, remove _ and make all uppercase letters into lowercase
  • look for matches, and create pairs (original_lean3_name, OriginalLean4Name)
  • for pairs that do not have an align statement:
    • use Lean 4 to lookup the file + position of the Lean 4 name
    • add an #align statement just before the next empty line
  • manually fix some tiny mistakes (e.g., empty lines in proofs might cause the #align statement to have been inserted too early)
Diff
@@ -88,6 +88,8 @@ def id (V : Type _) [Quiver V] : Prefunctor V V where
   obj := fun X => X
   map f := f
 #align prefunctor.id Prefunctor.id
+#align prefunctor.id_obj Prefunctor.id_obj
+#align prefunctor.id_map Prefunctor.id_map
 
 instance (V : Type _) [Quiver V] : Inhabited (Prefunctor V V) :=
   ⟨id V⟩
@@ -99,6 +101,8 @@ def comp {U : Type _} [Quiver U] {V : Type _} [Quiver V] {W : Type _} [Quiver W]
   obj X := G.obj (F.obj X)
   map f := G.map (F.map f)
 #align prefunctor.comp Prefunctor.comp
+#align prefunctor.comp_obj Prefunctor.comp_obj
+#align prefunctor.comp_map Prefunctor.comp_map
 
 @[simp]
 theorem comp_id {U V : Type _} [Quiver U] [Quiver V] (F : Prefunctor U V) :
Change notation precedence in Quiver/Basic (#1518)

This matches the corresponding change in the mathlib3 PR #17846

Diff
@@ -5,7 +5,7 @@ Authors: David Wärn, Scott Morrison
 Ported by: Scott Morrison
 
 ! This file was ported from Lean 3 source module combinatorics.quiver.basic
-! leanprover-community/mathlib commit 18a5306c091183ac90884daa9373fa3b178e8607
+! leanprover-community/mathlib commit 56adee5b5eef9e734d82272918300fca4f3e7cef
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -121,7 +121,7 @@ theorem comp_assoc {U V W Z : Type _} [Quiver U] [Quiver V] [Quiver W] [Quiver Z
 infixl:50 " ⥤q " => Prefunctor
 
 /-- Notation for composition of prefunctors. -/
-infixl:50 " ⋙q " => Prefunctor.comp
+infixl:60 " ⋙q " => Prefunctor.comp
 
 /-- Notation for the identity prefunctor on a quiver. -/
 notation "𝟭q" => id
chore: remove space from commit hash (#1400)
Diff
@@ -5,7 +5,7 @@ Authors: David Wärn, Scott Morrison
 Ported by: Scott Morrison
 
 ! This file was ported from Lean 3 source module combinatorics.quiver.basic
-! 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.
 -/
chore: Update some synchronization SHAs (#1377)

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.

Diff
@@ -5,7 +5,7 @@ Authors: David Wärn, Scott Morrison
 Ported by: Scott Morrison
 
 ! This file was ported from Lean 3 source module combinatorics.quiver.basic
-! leanprover-community/mathlib commit 8350c34a64b9bc3fc64335df8006bffcadc7baa6
+! leanprover-community/mathlib commit 18a5306c091183ac90884daa9373fa3b178e8607 
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
chore: fix more casing errors per naming scheme (#1232)

I've avoided anything under Tactic or test.

In correcting the names, I found Option.isNone_iff_eq_none duplicated between Std and Mathlib, so the Mathlib one has been removed.

Co-authored-by: Reid Barton <rwbarton@gmail.com>

Diff
@@ -57,7 +57,7 @@ in a quiver or category.
 infixr:10 " ⟶ " => Quiver.Hom
 
 /-- A morphism of quivers. As we will later have categorical functors extend this structure,
-we call it a `prefunctor`. -/
+we call it a `Prefunctor`. -/
 structure Prefunctor (V : Type u₁) [Quiver.{v₁} V] (W : Type u₂) [Quiver.{v₂} W] where
   /-- The action of a (pre)functor on vertices/objects. -/
   obj : V → W
chore: add source headers to ported theory files (#1094)

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

Diff
@@ -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: Scott Morrison
+
+! This file was ported from Lean 3 source module combinatorics.quiver.basic
+! leanprover-community/mathlib commit 8350c34a64b9bc3fc64335df8006bffcadc7baa6
+! Please do not edit these lines, except to modify the commit id
+! if you have ported upstream changes.
 -/
 import Mathlib.Data.Opposite
 

Dependencies 11

12 files ported (100.0%)
4850 lines ported (100.0%)

All dependencies are ported!