category_theory.fin_categoryMathlib.CategoryTheory.FinCategory.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)

(last sync)

chore(category_theory): simps should not add hom lemmas (#18742)

@[simps] should not be used to simplify the hom field of a category instance.

Very little needs to be changed when removing it.

However the problem in https://github.com/leanprover-community/mathlib4/pull/3244 with a proof by simp failing seems to be implicated by this problem. If we remove the @[simps] generated lemma for Hom there, the original proof works (although is extremely slow).

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

Diff
@@ -60,15 +60,14 @@ noncomputable def obj_as_type_equiv : obj_as_type α ≌ α :=
 /-- A fin_category `α` is equivalent to a fin_category with in `Type`. -/
 @[nolint unused_arguments] abbreviation as_type : Type := fin (fintype.card α)
 
-@[simps hom id comp (lemmas_only)] noncomputable
+@[simps id comp (lemmas_only)] noncomputable
 instance category_as_type : small_category (as_type α) :=
 { hom := λ i j, fin (fintype.card (@quiver.hom (obj_as_type α) _ i j)),
   id := λ i, fintype.equiv_fin _ (𝟙 i),
   comp := λ i j k f g, fintype.equiv_fin _
     ((fintype.equiv_fin _).symm f ≫ (fintype.equiv_fin _).symm g) }
 
-local attribute [simp] category_as_type_hom category_as_type_id
-  category_as_type_comp
+local attribute [simp] category_as_type_id category_as_type_comp
 
 /-- The "identity" functor from `as_type α` to `obj_as_type α`. -/
 @[simps] noncomputable def as_type_to_obj_as_type : as_type α ⥤ obj_as_type α :=

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(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
@@ -6,7 +6,7 @@ Authors: Scott Morrison
 import Data.Fintype.Card
 import CategoryTheory.DiscreteCategory
 import CategoryTheory.Opposites
-import CategoryTheory.Category.Ulift
+import CategoryTheory.Category.ULift
 
 #align_import category_theory.fin_category from "leanprover-community/mathlib"@"2efd2423f8d25fa57cf7a179f5d8652ab4d0df44"
 
Diff
@@ -3,10 +3,10 @@ Copyright (c) 2019 Scott Morrison. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Scott Morrison
 -/
-import Mathbin.Data.Fintype.Card
-import Mathbin.CategoryTheory.DiscreteCategory
-import Mathbin.CategoryTheory.Opposites
-import Mathbin.CategoryTheory.Category.Ulift
+import Data.Fintype.Card
+import CategoryTheory.DiscreteCategory
+import CategoryTheory.Opposites
+import CategoryTheory.Category.Ulift
 
 #align_import category_theory.fin_category from "leanprover-community/mathlib"@"2efd2423f8d25fa57cf7a179f5d8652ab4d0df44"
 
Diff
@@ -2,17 +2,14 @@
 Copyright (c) 2019 Scott Morrison. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Scott Morrison
-
-! This file was ported from Lean 3 source module category_theory.fin_category
-! leanprover-community/mathlib commit 2efd2423f8d25fa57cf7a179f5d8652ab4d0df44
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Data.Fintype.Card
 import Mathbin.CategoryTheory.DiscreteCategory
 import Mathbin.CategoryTheory.Opposites
 import Mathbin.CategoryTheory.Category.Ulift
 
+#align_import category_theory.fin_category from "leanprover-community/mathlib"@"2efd2423f8d25fa57cf7a179f5d8652ab4d0df44"
+
 /-!
 # Finite categories
 
Diff
@@ -68,22 +68,28 @@ namespace FinCategory
 
 variable (α : Type _) [Fintype α] [SmallCategory α] [FinCategory α]
 
+#print CategoryTheory.FinCategory.ObjAsType /-
 /-- A fin_category `α` is equivalent to a category with objects in `Type`. -/
 @[nolint unused_arguments]
 abbrev ObjAsType : Type :=
   InducedCategory α (Fintype.equivFin α).symm
 #align category_theory.fin_category.obj_as_type CategoryTheory.FinCategory.ObjAsType
+-/
 
+#print CategoryTheory.FinCategory.objAsTypeEquiv /-
 /-- The constructed category is indeed equivalent to `α`. -/
 noncomputable def objAsTypeEquiv : ObjAsType α ≌ α :=
   (inducedFunctor (Fintype.equivFin α).symm).asEquivalence
 #align category_theory.fin_category.obj_as_type_equiv CategoryTheory.FinCategory.objAsTypeEquiv
+-/
 
+#print CategoryTheory.FinCategory.AsType /-
 /-- A fin_category `α` is equivalent to a fin_category with in `Type`. -/
 @[nolint unused_arguments]
 abbrev AsType : Type :=
   Fin (Fintype.card α)
 #align category_theory.fin_category.as_type CategoryTheory.FinCategory.AsType
+-/
 
 #print CategoryTheory.FinCategory.categoryAsType /-
 @[simps (config := lemmasOnly) id comp]
Diff
@@ -31,7 +31,7 @@ having to supply instances or delay with non-defeq conflicts between instances.
 
 universe w v u
 
-open Classical
+open scoped Classical
 
 noncomputable section
 
Diff
@@ -68,35 +68,17 @@ namespace FinCategory
 
 variable (α : Type _) [Fintype α] [SmallCategory α] [FinCategory α]
 
-/- warning: category_theory.fin_category.obj_as_type -> CategoryTheory.FinCategory.ObjAsType is a dubious translation:
-lean 3 declaration is
-  forall (α : Type.{u1}) [_inst_1 : Fintype.{u1} α] [_inst_2 : CategoryTheory.SmallCategory.{u1} α] [_inst_3 : CategoryTheory.FinCategory.{u1} α _inst_2], Type
-but is expected to have type
-  forall (α : Type.{u1}) [_inst_1 : Fintype.{u1} α], Type
-Case conversion may be inaccurate. Consider using '#align category_theory.fin_category.obj_as_type CategoryTheory.FinCategory.ObjAsTypeₓ'. -/
 /-- A fin_category `α` is equivalent to a category with objects in `Type`. -/
 @[nolint unused_arguments]
 abbrev ObjAsType : Type :=
   InducedCategory α (Fintype.equivFin α).symm
 #align category_theory.fin_category.obj_as_type CategoryTheory.FinCategory.ObjAsType
 
-/- warning: category_theory.fin_category.obj_as_type_equiv -> CategoryTheory.FinCategory.objAsTypeEquiv is a dubious translation:
-lean 3 declaration is
-  forall (α : Type.{u1}) [_inst_1 : Fintype.{u1} α] [_inst_2 : CategoryTheory.SmallCategory.{u1} α] [_inst_3 : CategoryTheory.FinCategory.{u1} α _inst_2], CategoryTheory.Equivalence.{u1, u1, 0, u1} (CategoryTheory.FinCategory.ObjAsType.{u1} α _inst_1 _inst_2 _inst_3) (CategoryTheory.InducedCategory.category.{u1, 0, u1} (Fin (Fintype.card.{u1} α _inst_1)) α _inst_2 (coeFn.{succ u1, succ u1} (Equiv.{1, succ u1} (Fin (Fintype.card.{u1} α _inst_1)) α) (fun (_x : Equiv.{1, succ u1} (Fin (Fintype.card.{u1} α _inst_1)) α) => (Fin (Fintype.card.{u1} α _inst_1)) -> α) (Equiv.hasCoeToFun.{1, succ u1} (Fin (Fintype.card.{u1} α _inst_1)) α) (Equiv.symm.{succ u1, 1} α (Fin (Fintype.card.{u1} α _inst_1)) (Fintype.equivFin.{u1} α _inst_1)))) α _inst_2
-but is expected to have type
-  forall (α : Type.{u1}) [_inst_1 : Fintype.{u1} α] [_inst_2 : CategoryTheory.SmallCategory.{u1} α], CategoryTheory.Equivalence.{u1, u1, 0, u1} (CategoryTheory.FinCategory.ObjAsType.{u1} α _inst_1) α (CategoryTheory.InducedCategory.category.{u1, 0, u1} (Fin (Fintype.card.{u1} α _inst_1)) α _inst_2 (FunLike.coe.{succ u1, 1, succ u1} (Equiv.{1, succ u1} (Fin (Fintype.card.{u1} α _inst_1)) α) (Fin (Fintype.card.{u1} α _inst_1)) (fun (a : Fin (Fintype.card.{u1} α _inst_1)) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Fin (Fintype.card.{u1} α _inst_1)) => α) a) (Equiv.instFunLikeEquiv.{1, succ u1} (Fin (Fintype.card.{u1} α _inst_1)) α) (Equiv.symm.{succ u1, 1} α (Fin (Fintype.card.{u1} α _inst_1)) (Fintype.equivFin.{u1} α _inst_1)))) _inst_2
-Case conversion may be inaccurate. Consider using '#align category_theory.fin_category.obj_as_type_equiv CategoryTheory.FinCategory.objAsTypeEquivₓ'. -/
 /-- The constructed category is indeed equivalent to `α`. -/
 noncomputable def objAsTypeEquiv : ObjAsType α ≌ α :=
   (inducedFunctor (Fintype.equivFin α).symm).asEquivalence
 #align category_theory.fin_category.obj_as_type_equiv CategoryTheory.FinCategory.objAsTypeEquiv
 
-/- warning: category_theory.fin_category.as_type -> CategoryTheory.FinCategory.AsType is a dubious translation:
-lean 3 declaration is
-  forall (α : Type.{u1}) [_inst_1 : Fintype.{u1} α] [_inst_2 : CategoryTheory.SmallCategory.{u1} α] [_inst_3 : CategoryTheory.FinCategory.{u1} α _inst_2], Type
-but is expected to have type
-  forall (α : Type.{u1}) [_inst_1 : Fintype.{u1} α], Type
-Case conversion may be inaccurate. Consider using '#align category_theory.fin_category.as_type CategoryTheory.FinCategory.AsTypeₓ'. -/
 /-- A fin_category `α` is equivalent to a fin_category with in `Type`. -/
 @[nolint unused_arguments]
 abbrev AsType : Type :=
Diff
@@ -139,12 +139,8 @@ noncomputable def objAsTypeToAsType : ObjAsType α ⥤ AsType α
 /-- The constructed category (`as_type α`) is equivalent to `obj_as_type α`. -/
 noncomputable def asTypeEquivObjAsType : AsType α ≌ ObjAsType α :=
   Equivalence.mk (asTypeToObjAsType α) (objAsTypeToAsType α)
-    (NatIso.ofComponents Iso.refl fun _ _ _ => by
-      dsimp
-      simp)
-    (NatIso.ofComponents Iso.refl fun _ _ _ => by
-      dsimp
-      simp)
+    (NatIso.ofComponents Iso.refl fun _ _ _ => by dsimp; simp)
+    (NatIso.ofComponents Iso.refl fun _ _ _ => by dsimp; simp)
 #align category_theory.fin_category.as_type_equiv_obj_as_type CategoryTheory.FinCategory.asTypeEquivObjAsType
 -/
 
Diff
@@ -84,7 +84,7 @@ abbrev ObjAsType : Type :=
 lean 3 declaration is
   forall (α : Type.{u1}) [_inst_1 : Fintype.{u1} α] [_inst_2 : CategoryTheory.SmallCategory.{u1} α] [_inst_3 : CategoryTheory.FinCategory.{u1} α _inst_2], CategoryTheory.Equivalence.{u1, u1, 0, u1} (CategoryTheory.FinCategory.ObjAsType.{u1} α _inst_1 _inst_2 _inst_3) (CategoryTheory.InducedCategory.category.{u1, 0, u1} (Fin (Fintype.card.{u1} α _inst_1)) α _inst_2 (coeFn.{succ u1, succ u1} (Equiv.{1, succ u1} (Fin (Fintype.card.{u1} α _inst_1)) α) (fun (_x : Equiv.{1, succ u1} (Fin (Fintype.card.{u1} α _inst_1)) α) => (Fin (Fintype.card.{u1} α _inst_1)) -> α) (Equiv.hasCoeToFun.{1, succ u1} (Fin (Fintype.card.{u1} α _inst_1)) α) (Equiv.symm.{succ u1, 1} α (Fin (Fintype.card.{u1} α _inst_1)) (Fintype.equivFin.{u1} α _inst_1)))) α _inst_2
 but is expected to have type
-  forall (α : Type.{u1}) [_inst_1 : Fintype.{u1} α] [_inst_2 : CategoryTheory.SmallCategory.{u1} α], CategoryTheory.Equivalence.{u1, u1, 0, u1} (CategoryTheory.FinCategory.ObjAsType.{u1} α _inst_1) α (CategoryTheory.InducedCategory.category.{u1, 0, u1} (Fin (Fintype.card.{u1} α _inst_1)) α _inst_2 (FunLike.coe.{succ u1, 1, succ u1} (Equiv.{1, succ u1} (Fin (Fintype.card.{u1} α _inst_1)) α) (Fin (Fintype.card.{u1} α _inst_1)) (fun (a : Fin (Fintype.card.{u1} α _inst_1)) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Fin (Fintype.card.{u1} α _inst_1)) => α) a) (Equiv.instFunLikeEquiv.{1, succ u1} (Fin (Fintype.card.{u1} α _inst_1)) α) (Equiv.symm.{succ u1, 1} α (Fin (Fintype.card.{u1} α _inst_1)) (Fintype.equivFin.{u1} α _inst_1)))) _inst_2
+  forall (α : Type.{u1}) [_inst_1 : Fintype.{u1} α] [_inst_2 : CategoryTheory.SmallCategory.{u1} α], CategoryTheory.Equivalence.{u1, u1, 0, u1} (CategoryTheory.FinCategory.ObjAsType.{u1} α _inst_1) α (CategoryTheory.InducedCategory.category.{u1, 0, u1} (Fin (Fintype.card.{u1} α _inst_1)) α _inst_2 (FunLike.coe.{succ u1, 1, succ u1} (Equiv.{1, succ u1} (Fin (Fintype.card.{u1} α _inst_1)) α) (Fin (Fintype.card.{u1} α _inst_1)) (fun (a : Fin (Fintype.card.{u1} α _inst_1)) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Fin (Fintype.card.{u1} α _inst_1)) => α) a) (Equiv.instFunLikeEquiv.{1, succ u1} (Fin (Fintype.card.{u1} α _inst_1)) α) (Equiv.symm.{succ u1, 1} α (Fin (Fintype.card.{u1} α _inst_1)) (Fintype.equivFin.{u1} α _inst_1)))) _inst_2
 Case conversion may be inaccurate. Consider using '#align category_theory.fin_category.obj_as_type_equiv CategoryTheory.FinCategory.objAsTypeEquivₓ'. -/
 /-- The constructed category is indeed equivalent to `α`. -/
 noncomputable def objAsTypeEquiv : ObjAsType α ≌ α :=
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Scott Morrison
 
 ! This file was ported from Lean 3 source module category_theory.fin_category
-! leanprover-community/mathlib commit 3dadefa3f544b1db6214777fe47910739b54c66a
+! leanprover-community/mathlib commit 2efd2423f8d25fa57cf7a179f5d8652ab4d0df44
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -104,7 +104,7 @@ abbrev AsType : Type :=
 #align category_theory.fin_category.as_type CategoryTheory.FinCategory.AsType
 
 #print CategoryTheory.FinCategory.categoryAsType /-
-@[simps (config := lemmasOnly) hom id comp]
+@[simps (config := lemmasOnly) id comp]
 noncomputable instance categoryAsType : SmallCategory (AsType α)
     where
   hom i j := Fin (Fintype.card (@Quiver.Hom (ObjAsType α) _ i j))
@@ -113,7 +113,7 @@ noncomputable instance categoryAsType : SmallCategory (AsType α)
 #align category_theory.fin_category.category_as_type CategoryTheory.FinCategory.categoryAsType
 -/
 
-attribute [local simp] category_as_type_hom category_as_type_id category_as_type_comp
+attribute [local simp] category_as_type_id category_as_type_comp
 
 #print CategoryTheory.FinCategory.asTypeToObjAsType /-
 /-- The "identity" functor from `as_type α` to `obj_as_type α`. -/
Diff
@@ -84,7 +84,7 @@ abbrev ObjAsType : Type :=
 lean 3 declaration is
   forall (α : Type.{u1}) [_inst_1 : Fintype.{u1} α] [_inst_2 : CategoryTheory.SmallCategory.{u1} α] [_inst_3 : CategoryTheory.FinCategory.{u1} α _inst_2], CategoryTheory.Equivalence.{u1, u1, 0, u1} (CategoryTheory.FinCategory.ObjAsType.{u1} α _inst_1 _inst_2 _inst_3) (CategoryTheory.InducedCategory.category.{u1, 0, u1} (Fin (Fintype.card.{u1} α _inst_1)) α _inst_2 (coeFn.{succ u1, succ u1} (Equiv.{1, succ u1} (Fin (Fintype.card.{u1} α _inst_1)) α) (fun (_x : Equiv.{1, succ u1} (Fin (Fintype.card.{u1} α _inst_1)) α) => (Fin (Fintype.card.{u1} α _inst_1)) -> α) (Equiv.hasCoeToFun.{1, succ u1} (Fin (Fintype.card.{u1} α _inst_1)) α) (Equiv.symm.{succ u1, 1} α (Fin (Fintype.card.{u1} α _inst_1)) (Fintype.equivFin.{u1} α _inst_1)))) α _inst_2
 but is expected to have type
-  forall (α : Type.{u1}) [_inst_1 : Fintype.{u1} α] [_inst_2 : CategoryTheory.SmallCategory.{u1} α], CategoryTheory.Equivalence.{u1, u1, 0, u1} (CategoryTheory.FinCategory.ObjAsType.{u1} α _inst_1) α (CategoryTheory.InducedCategory.category.{u1, 0, u1} (Fin (Fintype.card.{u1} α _inst_1)) α _inst_2 (FunLike.coe.{succ u1, 1, succ u1} (Equiv.{1, succ u1} (Fin (Fintype.card.{u1} α _inst_1)) α) (Fin (Fintype.card.{u1} α _inst_1)) (fun (a : Fin (Fintype.card.{u1} α _inst_1)) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Fin (Fintype.card.{u1} α _inst_1)) => α) a) (Equiv.instFunLikeEquiv.{1, succ u1} (Fin (Fintype.card.{u1} α _inst_1)) α) (Equiv.symm.{succ u1, 1} α (Fin (Fintype.card.{u1} α _inst_1)) (Fintype.equivFin.{u1} α _inst_1)))) _inst_2
+  forall (α : Type.{u1}) [_inst_1 : Fintype.{u1} α] [_inst_2 : CategoryTheory.SmallCategory.{u1} α], CategoryTheory.Equivalence.{u1, u1, 0, u1} (CategoryTheory.FinCategory.ObjAsType.{u1} α _inst_1) α (CategoryTheory.InducedCategory.category.{u1, 0, u1} (Fin (Fintype.card.{u1} α _inst_1)) α _inst_2 (FunLike.coe.{succ u1, 1, succ u1} (Equiv.{1, succ u1} (Fin (Fintype.card.{u1} α _inst_1)) α) (Fin (Fintype.card.{u1} α _inst_1)) (fun (a : Fin (Fintype.card.{u1} α _inst_1)) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Fin (Fintype.card.{u1} α _inst_1)) => α) a) (Equiv.instFunLikeEquiv.{1, succ u1} (Fin (Fintype.card.{u1} α _inst_1)) α) (Equiv.symm.{succ u1, 1} α (Fin (Fintype.card.{u1} α _inst_1)) (Fintype.equivFin.{u1} α _inst_1)))) _inst_2
 Case conversion may be inaccurate. Consider using '#align category_theory.fin_category.obj_as_type_equiv CategoryTheory.FinCategory.objAsTypeEquivₓ'. -/
 /-- The constructed category is indeed equivalent to `α`. -/
 noncomputable def objAsTypeEquiv : ObjAsType α ≌ α :=
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Scott Morrison
 
 ! This file was ported from Lean 3 source module category_theory.fin_category
-! leanprover-community/mathlib commit c3019c79074b0619edb4b27553a91b2e82242395
+! leanprover-community/mathlib commit 3dadefa3f544b1db6214777fe47910739b54c66a
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -16,6 +16,9 @@ import Mathbin.CategoryTheory.Category.Ulift
 /-!
 # Finite categories
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 A category is finite in this sense if it has finitely many objects, and finitely many morphisms.
 
 ## Implementation
Diff
@@ -34,46 +34,73 @@ noncomputable section
 
 namespace CategoryTheory
 
+#print CategoryTheory.discreteFintype /-
 instance discreteFintype {α : Type _} [Fintype α] : Fintype (Discrete α) :=
   Fintype.ofEquiv α discreteEquiv.symm
 #align category_theory.discrete_fintype CategoryTheory.discreteFintype
+-/
 
+#print CategoryTheory.discreteHomFintype /-
 instance discreteHomFintype {α : Type _} (X Y : Discrete α) : Fintype (X ⟶ Y) := by
   apply ULift.fintype
 #align category_theory.discrete_hom_fintype CategoryTheory.discreteHomFintype
+-/
 
+#print CategoryTheory.FinCategory /-
 /-- A category with a `fintype` of objects, and a `fintype` for each morphism space. -/
 class FinCategory (J : Type v) [SmallCategory J] where
   fintypeObj : Fintype J := by infer_instance
   fintypeHom : ∀ j j' : J, Fintype (j ⟶ j') := by infer_instance
 #align category_theory.fin_category CategoryTheory.FinCategory
+-/
 
 attribute [instance] fin_category.fintype_obj fin_category.fintype_hom
 
+#print CategoryTheory.finCategoryDiscreteOfFintype /-
 instance finCategoryDiscreteOfFintype (J : Type v) [Fintype J] : FinCategory (Discrete J) where
 #align category_theory.fin_category_discrete_of_fintype CategoryTheory.finCategoryDiscreteOfFintype
+-/
 
 namespace FinCategory
 
 variable (α : Type _) [Fintype α] [SmallCategory α] [FinCategory α]
 
+/- warning: category_theory.fin_category.obj_as_type -> CategoryTheory.FinCategory.ObjAsType is a dubious translation:
+lean 3 declaration is
+  forall (α : Type.{u1}) [_inst_1 : Fintype.{u1} α] [_inst_2 : CategoryTheory.SmallCategory.{u1} α] [_inst_3 : CategoryTheory.FinCategory.{u1} α _inst_2], Type
+but is expected to have type
+  forall (α : Type.{u1}) [_inst_1 : Fintype.{u1} α], Type
+Case conversion may be inaccurate. Consider using '#align category_theory.fin_category.obj_as_type CategoryTheory.FinCategory.ObjAsTypeₓ'. -/
 /-- A fin_category `α` is equivalent to a category with objects in `Type`. -/
 @[nolint unused_arguments]
 abbrev ObjAsType : Type :=
   InducedCategory α (Fintype.equivFin α).symm
 #align category_theory.fin_category.obj_as_type CategoryTheory.FinCategory.ObjAsType
 
+/- warning: category_theory.fin_category.obj_as_type_equiv -> CategoryTheory.FinCategory.objAsTypeEquiv is a dubious translation:
+lean 3 declaration is
+  forall (α : Type.{u1}) [_inst_1 : Fintype.{u1} α] [_inst_2 : CategoryTheory.SmallCategory.{u1} α] [_inst_3 : CategoryTheory.FinCategory.{u1} α _inst_2], CategoryTheory.Equivalence.{u1, u1, 0, u1} (CategoryTheory.FinCategory.ObjAsType.{u1} α _inst_1 _inst_2 _inst_3) (CategoryTheory.InducedCategory.category.{u1, 0, u1} (Fin (Fintype.card.{u1} α _inst_1)) α _inst_2 (coeFn.{succ u1, succ u1} (Equiv.{1, succ u1} (Fin (Fintype.card.{u1} α _inst_1)) α) (fun (_x : Equiv.{1, succ u1} (Fin (Fintype.card.{u1} α _inst_1)) α) => (Fin (Fintype.card.{u1} α _inst_1)) -> α) (Equiv.hasCoeToFun.{1, succ u1} (Fin (Fintype.card.{u1} α _inst_1)) α) (Equiv.symm.{succ u1, 1} α (Fin (Fintype.card.{u1} α _inst_1)) (Fintype.equivFin.{u1} α _inst_1)))) α _inst_2
+but is expected to have type
+  forall (α : Type.{u1}) [_inst_1 : Fintype.{u1} α] [_inst_2 : CategoryTheory.SmallCategory.{u1} α], CategoryTheory.Equivalence.{u1, u1, 0, u1} (CategoryTheory.FinCategory.ObjAsType.{u1} α _inst_1) α (CategoryTheory.InducedCategory.category.{u1, 0, u1} (Fin (Fintype.card.{u1} α _inst_1)) α _inst_2 (FunLike.coe.{succ u1, 1, succ u1} (Equiv.{1, succ u1} (Fin (Fintype.card.{u1} α _inst_1)) α) (Fin (Fintype.card.{u1} α _inst_1)) (fun (a : Fin (Fintype.card.{u1} α _inst_1)) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Fin (Fintype.card.{u1} α _inst_1)) => α) a) (Equiv.instFunLikeEquiv.{1, succ u1} (Fin (Fintype.card.{u1} α _inst_1)) α) (Equiv.symm.{succ u1, 1} α (Fin (Fintype.card.{u1} α _inst_1)) (Fintype.equivFin.{u1} α _inst_1)))) _inst_2
+Case conversion may be inaccurate. Consider using '#align category_theory.fin_category.obj_as_type_equiv CategoryTheory.FinCategory.objAsTypeEquivₓ'. -/
 /-- The constructed category is indeed equivalent to `α`. -/
 noncomputable def objAsTypeEquiv : ObjAsType α ≌ α :=
   (inducedFunctor (Fintype.equivFin α).symm).asEquivalence
 #align category_theory.fin_category.obj_as_type_equiv CategoryTheory.FinCategory.objAsTypeEquiv
 
+/- warning: category_theory.fin_category.as_type -> CategoryTheory.FinCategory.AsType is a dubious translation:
+lean 3 declaration is
+  forall (α : Type.{u1}) [_inst_1 : Fintype.{u1} α] [_inst_2 : CategoryTheory.SmallCategory.{u1} α] [_inst_3 : CategoryTheory.FinCategory.{u1} α _inst_2], Type
+but is expected to have type
+  forall (α : Type.{u1}) [_inst_1 : Fintype.{u1} α], Type
+Case conversion may be inaccurate. Consider using '#align category_theory.fin_category.as_type CategoryTheory.FinCategory.AsTypeₓ'. -/
 /-- A fin_category `α` is equivalent to a fin_category with in `Type`. -/
 @[nolint unused_arguments]
 abbrev AsType : Type :=
   Fin (Fintype.card α)
 #align category_theory.fin_category.as_type CategoryTheory.FinCategory.AsType
 
+#print CategoryTheory.FinCategory.categoryAsType /-
 @[simps (config := lemmasOnly) hom id comp]
 noncomputable instance categoryAsType : SmallCategory (AsType α)
     where
@@ -81,9 +108,11 @@ noncomputable instance categoryAsType : SmallCategory (AsType α)
   id i := Fintype.equivFin _ (𝟙 i)
   comp i j k f g := Fintype.equivFin _ ((Fintype.equivFin _).symm f ≫ (Fintype.equivFin _).symm g)
 #align category_theory.fin_category.category_as_type CategoryTheory.FinCategory.categoryAsType
+-/
 
 attribute [local simp] category_as_type_hom category_as_type_id category_as_type_comp
 
+#print CategoryTheory.FinCategory.asTypeToObjAsType /-
 /-- The "identity" functor from `as_type α` to `obj_as_type α`. -/
 @[simps]
 noncomputable def asTypeToObjAsType : AsType α ⥤ ObjAsType α
@@ -91,7 +120,9 @@ noncomputable def asTypeToObjAsType : AsType α ⥤ ObjAsType α
   obj := id
   map i j := (Fintype.equivFin _).symm
 #align category_theory.fin_category.as_type_to_obj_as_type CategoryTheory.FinCategory.asTypeToObjAsType
+-/
 
+#print CategoryTheory.FinCategory.objAsTypeToAsType /-
 /-- The "identity" functor from `obj_as_type α` to `as_type α`. -/
 @[simps]
 noncomputable def objAsTypeToAsType : ObjAsType α ⥤ AsType α
@@ -99,7 +130,9 @@ noncomputable def objAsTypeToAsType : ObjAsType α ⥤ AsType α
   obj := id
   map i j := Fintype.equivFin _
 #align category_theory.fin_category.obj_as_type_to_as_type CategoryTheory.FinCategory.objAsTypeToAsType
+-/
 
+#print CategoryTheory.FinCategory.asTypeEquivObjAsType /-
 /-- The constructed category (`as_type α`) is equivalent to `obj_as_type α`. -/
 noncomputable def asTypeEquivObjAsType : AsType α ≌ ObjAsType α :=
   Equivalence.mk (asTypeToObjAsType α) (objAsTypeToAsType α)
@@ -110,19 +143,25 @@ noncomputable def asTypeEquivObjAsType : AsType α ≌ ObjAsType α :=
       dsimp
       simp)
 #align category_theory.fin_category.as_type_equiv_obj_as_type CategoryTheory.FinCategory.asTypeEquivObjAsType
+-/
 
+#print CategoryTheory.FinCategory.asTypeFinCategory /-
 noncomputable instance asTypeFinCategory : FinCategory (AsType α) where
 #align category_theory.fin_category.as_type_fin_category CategoryTheory.FinCategory.asTypeFinCategory
+-/
 
+#print CategoryTheory.FinCategory.equivAsType /-
 /-- The constructed category (`as_type α`) is indeed equivalent to `α`. -/
 noncomputable def equivAsType : AsType α ≌ α :=
   (asTypeEquivObjAsType α).trans (objAsTypeEquiv α)
 #align category_theory.fin_category.equiv_as_type CategoryTheory.FinCategory.equivAsType
+-/
 
 end FinCategory
 
 open Opposite
 
+#print CategoryTheory.finCategoryOpposite /-
 /-- The opposite of a finite category is finite.
 -/
 instance finCategoryOpposite {J : Type v} [SmallCategory J] [FinCategory J] : FinCategory Jᵒᵖ
@@ -130,12 +169,15 @@ instance finCategoryOpposite {J : Type v} [SmallCategory J] [FinCategory J] : Fi
   fintypeObj := Fintype.ofEquiv _ equivToOpposite
   fintypeHom j j' := Fintype.ofEquiv _ (opEquiv j j').symm
 #align category_theory.fin_category_opposite CategoryTheory.finCategoryOpposite
+-/
 
+#print CategoryTheory.finCategoryUlift /-
 /-- Applying `ulift` to morphisms and objects of a category preserves finiteness. -/
 instance finCategoryUlift {J : Type v} [SmallCategory J] [FinCategory J] :
     FinCategory.{max w v} (ULiftHom.{w, max w v} (ULift.{w, v} J))
     where fintypeObj := ULift.fintype J
 #align category_theory.fin_category_ulift CategoryTheory.finCategoryUlift
+-/
 
 end CategoryTheory
 

Changes in mathlib4

mathlib3
mathlib4
chore: scope open Classical (#11199)

We remove all but one open Classicals, instead preferring to use open scoped Classical. The only real side-effect this led to is moving a couple declarations to use Exists.choose instead of Classical.choose.

The first few commits are explicitly labelled regex replaces for ease of review.

Diff
@@ -25,7 +25,7 @@ having to supply instances or delay with non-defeq conflicts between instances.
 
 universe w v u
 
-open Classical
+open scoped Classical
 
 noncomputable section
 
chore: scope open Classical (#11199)

We remove all but one open Classicals, instead preferring to use open scoped Classical. The only real side-effect this led to is moving a couple declarations to use Exists.choose instead of Classical.choose.

The first few commits are explicitly labelled regex replaces for ease of review.

Diff
@@ -15,7 +15,7 @@ import Mathlib.CategoryTheory.FinCategory.Basic
 
 universe w v u
 
-open Classical
+open scoped Classical
 
 noncomputable section
 
chore: split CategoryTheory.FinCategory (#9923)

Minor clean up of imports, getting ready to minimize the heartbeats variation observed/reduced in #9732.

This has the effect of slightly (although not enough) delaying the import of positivity (which in turn imports the kitchen sink) into the category theory development.

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

chore: split CategoryTheory.FinCategory (#9923)

Minor clean up of imports, getting ready to minimize the heartbeats variation observed/reduced in #9732.

This has the effect of slightly (although not enough) delaying the import of positivity (which in turn imports the kitchen sink) into the category theory development.

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

Diff
@@ -4,22 +4,12 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Scott Morrison
 -/
 import Mathlib.Data.Fintype.Card
-import Mathlib.CategoryTheory.DiscreteCategory
-import Mathlib.CategoryTheory.Opposites
-import Mathlib.CategoryTheory.Category.ULift
+import Mathlib.CategoryTheory.FinCategory.Basic
 
 #align_import category_theory.fin_category from "leanprover-community/mathlib"@"2efd2423f8d25fa57cf7a179f5d8652ab4d0df44"
 
 /-!
-# Finite categories
-
-A category is finite in this sense if it has finitely many objects, and finitely many morphisms.
-
-## Implementation
-Prior to #14046, `FinCategory` required a `DecidableEq` instance on the object and morphism types.
-This does not seem to have had any practical payoff (i.e. making some definition constructive)
-so we have removed these requirements to avoid
-having to supply instances or delay with non-defeq conflicts between instances.
+# Finite categories are equivalent to category in `Type 0`.
 -/
 
 
@@ -31,25 +21,6 @@ noncomputable section
 
 namespace CategoryTheory
 
-instance discreteFintype {α : Type*} [Fintype α] : Fintype (Discrete α) :=
-  Fintype.ofEquiv α discreteEquiv.symm
-#align category_theory.discrete_fintype CategoryTheory.discreteFintype
-
-instance discreteHomFintype {α : Type*} (X Y : Discrete α) : Fintype (X ⟶ Y) := by
-  apply ULift.fintype
-#align category_theory.discrete_hom_fintype CategoryTheory.discreteHomFintype
-
-/-- A category with a `Fintype` of objects, and a `Fintype` for each morphism space. -/
-class FinCategory (J : Type v) [SmallCategory J] where
-  fintypeObj : Fintype J := by infer_instance
-  fintypeHom : ∀ j j' : J, Fintype (j ⟶ j') := by infer_instance
-#align category_theory.fin_category CategoryTheory.FinCategory
-
-attribute [instance] FinCategory.fintypeObj FinCategory.fintypeHom
-
-instance finCategoryDiscreteOfFintype (J : Type v) [Fintype J] : FinCategory (Discrete J) where
-#align category_theory.fin_category_discrete_of_fintype CategoryTheory.finCategoryDiscreteOfFintype
-
 namespace FinCategory
 
 variable (α : Type*) [Fintype α] [SmallCategory α] [FinCategory α]
@@ -118,22 +89,4 @@ noncomputable def equivAsType : AsType α ≌ α :=
 
 end FinCategory
 
-open Opposite
-
-/-- The opposite of a finite category is finite.
--/
-instance finCategoryOpposite {J : Type v} [SmallCategory J] [FinCategory J] : FinCategory Jᵒᵖ
-    where
-  fintypeObj := Fintype.ofEquiv _ equivToOpposite
-  fintypeHom j j' := Fintype.ofEquiv _ (opEquiv j j').symm
-#align category_theory.fin_category_opposite CategoryTheory.finCategoryOpposite
-
-/-- Applying `ULift` to morphisms and objects of a category preserves finiteness. -/
-instance finCategoryUlift {J : Type v} [SmallCategory J] [FinCategory J] :
-    FinCategory.{max w v} (ULiftHom.{w, max w v} (ULift.{w, v} J))
-    where
-  fintypeObj := ULift.fintype J
-  fintypeHom := fun _ _ => ULift.fintype _
-#align category_theory.fin_category_ulift CategoryTheory.finCategoryUlift
-
 end CategoryTheory
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
@@ -31,11 +31,11 @@ noncomputable section
 
 namespace CategoryTheory
 
-instance discreteFintype {α : Type _} [Fintype α] : Fintype (Discrete α) :=
+instance discreteFintype {α : Type*} [Fintype α] : Fintype (Discrete α) :=
   Fintype.ofEquiv α discreteEquiv.symm
 #align category_theory.discrete_fintype CategoryTheory.discreteFintype
 
-instance discreteHomFintype {α : Type _} (X Y : Discrete α) : Fintype (X ⟶ Y) := by
+instance discreteHomFintype {α : Type*} (X Y : Discrete α) : Fintype (X ⟶ Y) := by
   apply ULift.fintype
 #align category_theory.discrete_hom_fintype CategoryTheory.discreteHomFintype
 
@@ -52,7 +52,7 @@ instance finCategoryDiscreteOfFintype (J : Type v) [Fintype J] : FinCategory (Di
 
 namespace FinCategory
 
-variable (α : Type _) [Fintype α] [SmallCategory α] [FinCategory α]
+variable (α : Type*) [Fintype α] [SmallCategory α] [FinCategory α]
 
 /-- A FinCategory `α` is equivalent to a category with objects in `Type`. -/
 --@[nolint unused_arguments]
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
@@ -2,17 +2,14 @@
 Copyright (c) 2019 Scott Morrison. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Scott Morrison
-
-! This file was ported from Lean 3 source module category_theory.fin_category
-! leanprover-community/mathlib commit 2efd2423f8d25fa57cf7a179f5d8652ab4d0df44
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Data.Fintype.Card
 import Mathlib.CategoryTheory.DiscreteCategory
 import Mathlib.CategoryTheory.Opposites
 import Mathlib.CategoryTheory.Category.ULift
 
+#align_import category_theory.fin_category from "leanprover-community/mathlib"@"2efd2423f8d25fa57cf7a179f5d8652ab4d0df44"
+
 /-!
 # Finite categories
 
chore: review of automation in category theory (#4793)

Clean up of automation in the category theory library. Leaving out unnecessary proof steps, or fields done by aesop_cat, and making more use of available autoparameters.

Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au>

Diff
@@ -106,12 +106,8 @@ noncomputable def objAsTypeToAsType : ObjAsType α ⥤ AsType α
 /-- The constructed category (`AsType α`) is equivalent to `ObjAsType α`. -/
 noncomputable def asTypeEquivObjAsType : AsType α ≌ ObjAsType α :=
   Equivalence.mk (asTypeToObjAsType α) (objAsTypeToAsType α)
-    (NatIso.ofComponents Iso.refl fun _ => by
-      dsimp
-      simp)
-    (NatIso.ofComponents Iso.refl fun _ => by
-      dsimp
-      simp)
+    (NatIso.ofComponents Iso.refl)
+    (NatIso.ofComponents Iso.refl)
 #align category_theory.fin_category.as_type_equiv_obj_as_type CategoryTheory.FinCategory.asTypeEquivObjAsType
 
 noncomputable instance asTypeFinCategory : FinCategory (AsType α) where
chore: forward port of #18742, no simps lemmas for Category.Hom (#3340)

This is the forward port of https://github.com/leanprover-community/mathlib/pull/18742. That PR hasn't landed yet, so this PR still needs to be updated with the new commit SHA.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Joël Riou <joel.riou@universite-paris-saclay.fr>

Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Scott Morrison
 
 ! This file was ported from Lean 3 source module category_theory.fin_category
-! leanprover-community/mathlib commit c3019c79074b0619edb4b27553a91b2e82242395
+! leanprover-community/mathlib commit 2efd2423f8d25fa57cf7a179f5d8652ab4d0df44
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -77,7 +77,7 @@ abbrev AsType : Type :=
   Fin (Fintype.card α)
 #align category_theory.fin_category.as_type CategoryTheory.FinCategory.AsType
 
-@[simps (config := .lemmasOnly) Hom id comp]
+@[simps (config := .lemmasOnly) id comp]
 noncomputable instance categoryAsType : SmallCategory (AsType α)
     where
   Hom i j := Fin (Fintype.card (@Quiver.Hom (ObjAsType α) _ i j))
@@ -85,7 +85,7 @@ noncomputable instance categoryAsType : SmallCategory (AsType α)
   comp f g := Fintype.equivFin _ ((Fintype.equivFin _).symm f ≫ (Fintype.equivFin _).symm g)
 #align category_theory.fin_category.category_as_type CategoryTheory.FinCategory.categoryAsType
 
-attribute [local simp] categoryAsType_Hom categoryAsType_id categoryAsType_comp
+attribute [local simp] categoryAsType_id categoryAsType_comp
 
 /-- The "identity" functor from `AsType α` to `ObjAsType α`. -/
 @[simps]
refactor: Rename instances in Data.Fintype.Basic (#2798)

Co-authored-by: ChrisHughes24 <chrishughes24@gmail.com>

Diff
@@ -39,7 +39,7 @@ instance discreteFintype {α : Type _} [Fintype α] : Fintype (Discrete α) :=
 #align category_theory.discrete_fintype CategoryTheory.discreteFintype
 
 instance discreteHomFintype {α : Type _} (X Y : Discrete α) : Fintype (X ⟶ Y) := by
-  apply instFintypeULift
+  apply ULift.fintype
 #align category_theory.discrete_hom_fintype CategoryTheory.discreteHomFintype
 
 /-- A category with a `Fintype` of objects, and a `Fintype` for each morphism space. -/
@@ -139,8 +139,8 @@ instance finCategoryOpposite {J : Type v} [SmallCategory J] [FinCategory J] : Fi
 instance finCategoryUlift {J : Type v} [SmallCategory J] [FinCategory J] :
     FinCategory.{max w v} (ULiftHom.{w, max w v} (ULift.{w, v} J))
     where
-  fintypeObj := instFintypeULift J
-  fintypeHom := fun _ _ => instFintypeULift _
+  fintypeObj := ULift.fintype J
+  fintypeHom := fun _ _ => ULift.fintype _
 #align category_theory.fin_category_ulift CategoryTheory.finCategoryUlift
 
 end CategoryTheory
feat: simps support additional simp-attributes (#2398)
  • Also fix the configuration option Simps.Config.lemmasOnly and use it in the library
  • Also use @[simps!] in the test file
  • Also remove the temporary configuration in LocalHomeomorph
  • Zulip thread
  • Fixes #2350
Diff
@@ -77,8 +77,7 @@ abbrev AsType : Type :=
   Fin (Fintype.card α)
 #align category_theory.fin_category.as_type CategoryTheory.FinCategory.AsType
 
--- Porting note: The `lemmasOnly` simps configuration changed to `{ attrs := [] }`.
-@[simps (config := { attrs := [] }) Hom id comp]
+@[simps (config := .lemmasOnly) Hom id comp]
 noncomputable instance categoryAsType : SmallCategory (AsType α)
     where
   Hom i j := Fin (Fintype.card (@Quiver.Hom (ObjAsType α) _ i j))
feat: port CategoryTheory.FinCategory (#2423)

Co-authored-by: Adam Topaz <adamtopaz@users.noreply.github.com>

Dependencies 2 + 180

181 files ported (98.9%)
80273 lines ported (99.8%)
Show graph

The unported dependencies are