order.category.FinBoolAlgMathlib.Order.Category.FinBoolAlg

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)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -100,10 +100,10 @@ instance hasForgetToFinBddDistLat : HasForget₂ FinBoolAlg FinBddDistLat
 #align FinBoolAlg.has_forget_to_FinBddDistLat FinBoolAlg.hasForgetToFinBddDistLat
 -/
 
-#print FinBoolAlg.forgetToBoolAlgFull /-
-instance forgetToBoolAlgFull : CategoryTheory.Functor.Full (forget₂ FinBoolAlg BoolAlg) :=
+#print FinBoolAlg.forgetToBoolAlg_full /-
+instance forgetToBoolAlg_full : CategoryTheory.Functor.Full (forget₂ FinBoolAlg BoolAlg) :=
   InducedCategory.full _
-#align FinBoolAlg.forget_to_BoolAlg_full FinBoolAlg.forgetToBoolAlgFull
+#align FinBoolAlg.forget_to_BoolAlg_full FinBoolAlg.forgetToBoolAlg_full
 -/
 
 #print FinBoolAlg.forgetToBoolAlgFaithful /-
Diff
@@ -101,13 +101,13 @@ instance hasForgetToFinBddDistLat : HasForget₂ FinBoolAlg FinBddDistLat
 -/
 
 #print FinBoolAlg.forgetToBoolAlgFull /-
-instance forgetToBoolAlgFull : Full (forget₂ FinBoolAlg BoolAlg) :=
+instance forgetToBoolAlgFull : CategoryTheory.Functor.Full (forget₂ FinBoolAlg BoolAlg) :=
   InducedCategory.full _
 #align FinBoolAlg.forget_to_BoolAlg_full FinBoolAlg.forgetToBoolAlgFull
 -/
 
 #print FinBoolAlg.forgetToBoolAlgFaithful /-
-instance forgetToBoolAlgFaithful : Faithful (forget₂ FinBoolAlg BoolAlg) :=
+instance forgetToBoolAlgFaithful : CategoryTheory.Functor.Faithful (forget₂ FinBoolAlg BoolAlg) :=
   InducedCategory.faithful _
 #align FinBoolAlg.forget_to_BoolAlg_faithful FinBoolAlg.forgetToBoolAlgFaithful
 -/
@@ -122,7 +122,8 @@ instance hasForgetToFinPartOrd : HasForget₂ FinBoolAlg FinPartOrd
 -/
 
 #print FinBoolAlg.forgetToFinPartOrdFaithful /-
-instance forgetToFinPartOrdFaithful : Faithful (forget₂ FinBoolAlg FinPartOrd) :=
+instance forgetToFinPartOrdFaithful :
+    CategoryTheory.Functor.Faithful (forget₂ FinBoolAlg FinPartOrd) :=
   ⟨fun X Y f g h =>
     haveI := congr_arg (coeFn : _ → X → Y) h
     DFunLike.coe_injective this⟩
Diff
@@ -125,7 +125,7 @@ instance hasForgetToFinPartOrd : HasForget₂ FinBoolAlg FinPartOrd
 instance forgetToFinPartOrdFaithful : Faithful (forget₂ FinBoolAlg FinPartOrd) :=
   ⟨fun X Y f g h =>
     haveI := congr_arg (coeFn : _ → X → Y) h
-    FunLike.coe_injective this⟩
+    DFunLike.coe_injective this⟩
 #align FinBoolAlg.forget_to_FinPartOrd_faithful FinBoolAlg.forgetToFinPartOrdFaithful
 -/
 
Diff
@@ -3,10 +3,10 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 -/
-import Mathbin.Data.Fintype.Powerset
-import Mathbin.Order.Category.BoolAlg
-import Mathbin.Order.Category.FinBddDistLat
-import Mathbin.Order.Hom.CompleteLattice
+import Data.Fintype.Powerset
+import Order.Category.BoolAlg
+import Order.Category.FinBddDistLat
+import Order.Hom.CompleteLattice
 
 #align_import order.category.FinBoolAlg from "leanprover-community/mathlib"@"2a0ce625dbb0ffbc7d1316597de0b25c1ec75303"
 
@@ -32,154 +32,153 @@ universe u
 
 open CategoryTheory OrderDual Opposite
 
-#print FinBoolAlgCat /-
+#print FinBoolAlg /-
 /-- The category of finite boolean algebras with bounded lattice morphisms. -/
-structure FinBoolAlgCat where
-  toBoolAlg : BoolAlgCat
+structure FinBoolAlg where
+  toBoolAlg : BoolAlg
   [isFintype : Fintype to_BoolAlg]
-#align FinBoolAlg FinBoolAlgCat
+#align FinBoolAlg FinBoolAlg
 -/
 
-namespace FinBoolAlgCat
+namespace FinBoolAlg
 
-instance : CoeSort FinBoolAlgCat (Type _) :=
+instance : CoeSort FinBoolAlg (Type _) :=
   ⟨fun X => X.toBoolAlg⟩
 
-instance (X : FinBoolAlgCat) : BooleanAlgebra X :=
+instance (X : FinBoolAlg) : BooleanAlgebra X :=
   X.toBoolAlg.str
 
-attribute [instance] FinBoolAlgCat.isFintype
+attribute [instance] FinBoolAlg.isFintype
 
 @[simp]
-theorem coe_toBoolAlg (X : FinBoolAlgCat) : ↥X.toBoolAlg = ↥X :=
+theorem coe_toBoolAlg (X : FinBoolAlg) : ↥X.toBoolAlg = ↥X :=
   rfl
-#align FinBoolAlg.coe_to_BoolAlg FinBoolAlgCat.coe_toBoolAlg
+#align FinBoolAlg.coe_to_BoolAlg FinBoolAlg.coe_toBoolAlg
 
-#print FinBoolAlgCat.of /-
+#print FinBoolAlg.of /-
 /-- Construct a bundled `FinBoolAlg` from `boolean_algebra` + `fintype`. -/
-def of (α : Type _) [BooleanAlgebra α] [Fintype α] : FinBoolAlgCat :=
+def of (α : Type _) [BooleanAlgebra α] [Fintype α] : FinBoolAlg :=
   ⟨⟨α⟩⟩
-#align FinBoolAlg.of FinBoolAlgCat.of
+#align FinBoolAlg.of FinBoolAlg.of
 -/
 
-#print FinBoolAlgCat.coe_of /-
+#print FinBoolAlg.coe_of /-
 @[simp]
 theorem coe_of (α : Type _) [BooleanAlgebra α] [Fintype α] : ↥(of α) = α :=
   rfl
-#align FinBoolAlg.coe_of FinBoolAlgCat.coe_of
+#align FinBoolAlg.coe_of FinBoolAlg.coe_of
 -/
 
-instance : Inhabited FinBoolAlgCat :=
+instance : Inhabited FinBoolAlg :=
   ⟨of PUnit⟩
 
-#print FinBoolAlgCat.largeCategory /-
-instance largeCategory : LargeCategory FinBoolAlgCat :=
-  InducedCategory.category FinBoolAlgCat.toBoolAlg
-#align FinBoolAlg.large_category FinBoolAlgCat.largeCategory
+#print FinBoolAlg.largeCategory /-
+instance largeCategory : LargeCategory FinBoolAlg :=
+  InducedCategory.category FinBoolAlg.toBoolAlg
+#align FinBoolAlg.large_category FinBoolAlg.largeCategory
 -/
 
-#print FinBoolAlgCat.concreteCategory /-
-instance concreteCategory : ConcreteCategory FinBoolAlgCat :=
-  InducedCategory.concreteCategory FinBoolAlgCat.toBoolAlg
-#align FinBoolAlg.concrete_category FinBoolAlgCat.concreteCategory
+#print FinBoolAlg.concreteCategory /-
+instance concreteCategory : ConcreteCategory FinBoolAlg :=
+  InducedCategory.concreteCategory FinBoolAlg.toBoolAlg
+#align FinBoolAlg.concrete_category FinBoolAlg.concreteCategory
 -/
 
-#print FinBoolAlgCat.hasForgetToBoolAlg /-
-instance hasForgetToBoolAlg : HasForget₂ FinBoolAlgCat BoolAlgCat :=
-  InducedCategory.hasForget₂ FinBoolAlgCat.toBoolAlg
-#align FinBoolAlg.has_forget_to_BoolAlg FinBoolAlgCat.hasForgetToBoolAlg
+#print FinBoolAlg.hasForgetToBoolAlg /-
+instance hasForgetToBoolAlg : HasForget₂ FinBoolAlg BoolAlg :=
+  InducedCategory.hasForget₂ FinBoolAlg.toBoolAlg
+#align FinBoolAlg.has_forget_to_BoolAlg FinBoolAlg.hasForgetToBoolAlg
 -/
 
-#print FinBoolAlgCat.hasForgetToFinBddDistLat /-
-instance hasForgetToFinBddDistLat : HasForget₂ FinBoolAlgCat FinBddDistLatCat
+#print FinBoolAlg.hasForgetToFinBddDistLat /-
+instance hasForgetToFinBddDistLat : HasForget₂ FinBoolAlg FinBddDistLat
     where
   forget₂ :=
-    { obj := fun X => FinBddDistLatCat.of X
+    { obj := fun X => FinBddDistLat.of X
       map := fun X Y f => f }
   forget_comp := rfl
-#align FinBoolAlg.has_forget_to_FinBddDistLat FinBoolAlgCat.hasForgetToFinBddDistLat
+#align FinBoolAlg.has_forget_to_FinBddDistLat FinBoolAlg.hasForgetToFinBddDistLat
 -/
 
-#print FinBoolAlgCat.forgetToBoolAlgFull /-
-instance forgetToBoolAlgFull : Full (forget₂ FinBoolAlgCat BoolAlgCat) :=
+#print FinBoolAlg.forgetToBoolAlgFull /-
+instance forgetToBoolAlgFull : Full (forget₂ FinBoolAlg BoolAlg) :=
   InducedCategory.full _
-#align FinBoolAlg.forget_to_BoolAlg_full FinBoolAlgCat.forgetToBoolAlgFull
+#align FinBoolAlg.forget_to_BoolAlg_full FinBoolAlg.forgetToBoolAlgFull
 -/
 
-#print FinBoolAlgCat.forgetToBoolAlgFaithful /-
-instance forgetToBoolAlgFaithful : Faithful (forget₂ FinBoolAlgCat BoolAlgCat) :=
+#print FinBoolAlg.forgetToBoolAlgFaithful /-
+instance forgetToBoolAlgFaithful : Faithful (forget₂ FinBoolAlg BoolAlg) :=
   InducedCategory.faithful _
-#align FinBoolAlg.forget_to_BoolAlg_faithful FinBoolAlgCat.forgetToBoolAlgFaithful
+#align FinBoolAlg.forget_to_BoolAlg_faithful FinBoolAlg.forgetToBoolAlgFaithful
 -/
 
-#print FinBoolAlgCat.hasForgetToFinPartOrd /-
+#print FinBoolAlg.hasForgetToFinPartOrd /-
 @[simps]
-instance hasForgetToFinPartOrd : HasForget₂ FinBoolAlgCat FinPartOrd
+instance hasForgetToFinPartOrd : HasForget₂ FinBoolAlg FinPartOrd
     where forget₂ :=
     { obj := fun X => FinPartOrd.of X
       map := fun X Y f => show OrderHom X Y from ↑(show BoundedLatticeHom X Y from f) }
-#align FinBoolAlg.has_forget_to_FinPartOrd FinBoolAlgCat.hasForgetToFinPartOrd
+#align FinBoolAlg.has_forget_to_FinPartOrd FinBoolAlg.hasForgetToFinPartOrd
 -/
 
-#print FinBoolAlgCat.forgetToFinPartOrdFaithful /-
-instance forgetToFinPartOrdFaithful : Faithful (forget₂ FinBoolAlgCat FinPartOrd) :=
+#print FinBoolAlg.forgetToFinPartOrdFaithful /-
+instance forgetToFinPartOrdFaithful : Faithful (forget₂ FinBoolAlg FinPartOrd) :=
   ⟨fun X Y f g h =>
     haveI := congr_arg (coeFn : _ → X → Y) h
     FunLike.coe_injective this⟩
-#align FinBoolAlg.forget_to_FinPartOrd_faithful FinBoolAlgCat.forgetToFinPartOrdFaithful
+#align FinBoolAlg.forget_to_FinPartOrd_faithful FinBoolAlg.forgetToFinPartOrdFaithful
 -/
 
-#print FinBoolAlgCat.Iso.mk /-
+#print FinBoolAlg.Iso.mk /-
 /-- Constructs an equivalence between finite Boolean algebras from an order isomorphism between
 them. -/
 @[simps]
-def Iso.mk {α β : FinBoolAlgCat.{u}} (e : α ≃o β) : α ≅ β
+def Iso.mk {α β : FinBoolAlg.{u}} (e : α ≃o β) : α ≅ β
     where
   hom := (e : BoundedLatticeHom α β)
   inv := (e.symm : BoundedLatticeHom β α)
   hom_inv_id' := by ext; exact e.symm_apply_apply _
   inv_hom_id' := by ext; exact e.apply_symm_apply _
-#align FinBoolAlg.iso.mk FinBoolAlgCat.Iso.mk
+#align FinBoolAlg.iso.mk FinBoolAlg.Iso.mk
 -/
 
-#print FinBoolAlgCat.dual /-
+#print FinBoolAlg.dual /-
 /-- `order_dual` as a functor. -/
 @[simps]
-def dual : FinBoolAlgCat ⥤ FinBoolAlgCat
-    where
+def dual : FinBoolAlg ⥤ FinBoolAlg where
   obj X := of Xᵒᵈ
   map X Y := BoundedLatticeHom.dual
-#align FinBoolAlg.dual FinBoolAlgCat.dual
+#align FinBoolAlg.dual FinBoolAlg.dual
 -/
 
-#print FinBoolAlgCat.dualEquiv /-
+#print FinBoolAlg.dualEquiv /-
 /-- The equivalence between `FinBoolAlg` and itself induced by `order_dual` both ways. -/
 @[simps Functor inverse]
-def dualEquiv : FinBoolAlgCat ≌ FinBoolAlgCat :=
+def dualEquiv : FinBoolAlg ≌ FinBoolAlg :=
   Equivalence.mk dual dual
     (NatIso.ofComponents (fun X => Iso.mk <| OrderIso.dualDual X) fun X Y f => rfl)
     (NatIso.ofComponents (fun X => Iso.mk <| OrderIso.dualDual X) fun X Y f => rfl)
-#align FinBoolAlg.dual_equiv FinBoolAlgCat.dualEquiv
+#align FinBoolAlg.dual_equiv FinBoolAlg.dualEquiv
 -/
 
-end FinBoolAlgCat
+end FinBoolAlg
 
-#print finBoolAlgCat_dual_comp_forget_to_finBddDistLatCat /-
-theorem finBoolAlgCat_dual_comp_forget_to_finBddDistLatCat :
-    FinBoolAlgCat.dual ⋙ forget₂ FinBoolAlgCat FinBddDistLatCat =
-      forget₂ FinBoolAlgCat FinBddDistLatCat ⋙ FinBddDistLatCat.dual :=
+#print finBoolAlg_dual_comp_forget_to_finBddDistLat /-
+theorem finBoolAlg_dual_comp_forget_to_finBddDistLat :
+    FinBoolAlg.dual ⋙ forget₂ FinBoolAlg FinBddDistLat =
+      forget₂ FinBoolAlg FinBddDistLat ⋙ FinBddDistLat.dual :=
   rfl
-#align FinBoolAlg_dual_comp_forget_to_FinBddDistLat finBoolAlgCat_dual_comp_forget_to_finBddDistLatCat
+#align FinBoolAlg_dual_comp_forget_to_FinBddDistLat finBoolAlg_dual_comp_forget_to_finBddDistLat
 -/
 
-#print fintypeToFinBoolAlgCatOp /-
+#print fintypeToFinBoolAlgOp /-
 /-- The powerset functor. `set` as a functor. -/
 @[simps]
-def fintypeToFinBoolAlgCatOp : FintypeCat ⥤ FinBoolAlgCatᵒᵖ
+def fintypeToFinBoolAlgOp : FintypeCat ⥤ FinBoolAlgᵒᵖ
     where
-  obj X := op <| FinBoolAlgCat.of (Set X)
+  obj X := op <| FinBoolAlg.of (Set X)
   map X Y f :=
     Quiver.Hom.op <| (CompleteLatticeHom.setPreimage f : BoundedLatticeHom (Set Y) (Set X))
-#align Fintype_to_FinBoolAlg_op fintypeToFinBoolAlgCatOp
+#align Fintype_to_FinBoolAlg_op fintypeToFinBoolAlgOp
 -/
 
Diff
@@ -2,17 +2,14 @@
 Copyright (c) 2022 Yaël Dillies. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
-
-! This file was ported from Lean 3 source module order.category.FinBoolAlg
-! leanprover-community/mathlib commit 2a0ce625dbb0ffbc7d1316597de0b25c1ec75303
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Data.Fintype.Powerset
 import Mathbin.Order.Category.BoolAlg
 import Mathbin.Order.Category.FinBddDistLat
 import Mathbin.Order.Hom.CompleteLattice
 
+#align_import order.category.FinBoolAlg from "leanprover-community/mathlib"@"2a0ce625dbb0ffbc7d1316597de0b25c1ec75303"
+
 /-!
 # The category of finite boolean algebras
 
Diff
@@ -35,121 +35,154 @@ universe u
 
 open CategoryTheory OrderDual Opposite
 
+#print FinBoolAlgCat /-
 /-- The category of finite boolean algebras with bounded lattice morphisms. -/
-structure FinBoolAlg where
-  toBoolAlg : BoolAlg
+structure FinBoolAlgCat where
+  toBoolAlg : BoolAlgCat
   [isFintype : Fintype to_BoolAlg]
-#align FinBoolAlg FinBoolAlg
+#align FinBoolAlg FinBoolAlgCat
+-/
 
-namespace FinBoolAlg
+namespace FinBoolAlgCat
 
-instance : CoeSort FinBoolAlg (Type _) :=
+instance : CoeSort FinBoolAlgCat (Type _) :=
   ⟨fun X => X.toBoolAlg⟩
 
-instance (X : FinBoolAlg) : BooleanAlgebra X :=
+instance (X : FinBoolAlgCat) : BooleanAlgebra X :=
   X.toBoolAlg.str
 
-attribute [instance] FinBoolAlg.isFintype
+attribute [instance] FinBoolAlgCat.isFintype
 
 @[simp]
-theorem coe_toBoolAlg (X : FinBoolAlg) : ↥X.toBoolAlg = ↥X :=
+theorem coe_toBoolAlg (X : FinBoolAlgCat) : ↥X.toBoolAlg = ↥X :=
   rfl
-#align FinBoolAlg.coe_to_BoolAlg FinBoolAlg.coe_toBoolAlg
+#align FinBoolAlg.coe_to_BoolAlg FinBoolAlgCat.coe_toBoolAlg
 
+#print FinBoolAlgCat.of /-
 /-- Construct a bundled `FinBoolAlg` from `boolean_algebra` + `fintype`. -/
-def of (α : Type _) [BooleanAlgebra α] [Fintype α] : FinBoolAlg :=
+def of (α : Type _) [BooleanAlgebra α] [Fintype α] : FinBoolAlgCat :=
   ⟨⟨α⟩⟩
-#align FinBoolAlg.of FinBoolAlg.of
+#align FinBoolAlg.of FinBoolAlgCat.of
+-/
 
+#print FinBoolAlgCat.coe_of /-
 @[simp]
 theorem coe_of (α : Type _) [BooleanAlgebra α] [Fintype α] : ↥(of α) = α :=
   rfl
-#align FinBoolAlg.coe_of FinBoolAlg.coe_of
+#align FinBoolAlg.coe_of FinBoolAlgCat.coe_of
+-/
 
-instance : Inhabited FinBoolAlg :=
+instance : Inhabited FinBoolAlgCat :=
   ⟨of PUnit⟩
 
-instance largeCategory : LargeCategory FinBoolAlg :=
-  InducedCategory.category FinBoolAlg.toBoolAlg
-#align FinBoolAlg.large_category FinBoolAlg.largeCategory
+#print FinBoolAlgCat.largeCategory /-
+instance largeCategory : LargeCategory FinBoolAlgCat :=
+  InducedCategory.category FinBoolAlgCat.toBoolAlg
+#align FinBoolAlg.large_category FinBoolAlgCat.largeCategory
+-/
 
-instance concreteCategory : ConcreteCategory FinBoolAlg :=
-  InducedCategory.concreteCategory FinBoolAlg.toBoolAlg
-#align FinBoolAlg.concrete_category FinBoolAlg.concreteCategory
+#print FinBoolAlgCat.concreteCategory /-
+instance concreteCategory : ConcreteCategory FinBoolAlgCat :=
+  InducedCategory.concreteCategory FinBoolAlgCat.toBoolAlg
+#align FinBoolAlg.concrete_category FinBoolAlgCat.concreteCategory
+-/
 
-instance hasForgetToBoolAlg : HasForget₂ FinBoolAlg BoolAlg :=
-  InducedCategory.hasForget₂ FinBoolAlg.toBoolAlg
-#align FinBoolAlg.has_forget_to_BoolAlg FinBoolAlg.hasForgetToBoolAlg
+#print FinBoolAlgCat.hasForgetToBoolAlg /-
+instance hasForgetToBoolAlg : HasForget₂ FinBoolAlgCat BoolAlgCat :=
+  InducedCategory.hasForget₂ FinBoolAlgCat.toBoolAlg
+#align FinBoolAlg.has_forget_to_BoolAlg FinBoolAlgCat.hasForgetToBoolAlg
+-/
 
-instance hasForgetToFinBddDistLat : HasForget₂ FinBoolAlg FinBddDistLat
+#print FinBoolAlgCat.hasForgetToFinBddDistLat /-
+instance hasForgetToFinBddDistLat : HasForget₂ FinBoolAlgCat FinBddDistLatCat
     where
   forget₂ :=
-    { obj := fun X => FinBddDistLat.of X
+    { obj := fun X => FinBddDistLatCat.of X
       map := fun X Y f => f }
   forget_comp := rfl
-#align FinBoolAlg.has_forget_to_FinBddDistLat FinBoolAlg.hasForgetToFinBddDistLat
+#align FinBoolAlg.has_forget_to_FinBddDistLat FinBoolAlgCat.hasForgetToFinBddDistLat
+-/
 
-instance forgetToBoolAlgFull : Full (forget₂ FinBoolAlg BoolAlg) :=
+#print FinBoolAlgCat.forgetToBoolAlgFull /-
+instance forgetToBoolAlgFull : Full (forget₂ FinBoolAlgCat BoolAlgCat) :=
   InducedCategory.full _
-#align FinBoolAlg.forget_to_BoolAlg_full FinBoolAlg.forgetToBoolAlgFull
+#align FinBoolAlg.forget_to_BoolAlg_full FinBoolAlgCat.forgetToBoolAlgFull
+-/
 
-instance forget_to_boolAlg_faithful : Faithful (forget₂ FinBoolAlg BoolAlg) :=
+#print FinBoolAlgCat.forgetToBoolAlgFaithful /-
+instance forgetToBoolAlgFaithful : Faithful (forget₂ FinBoolAlgCat BoolAlgCat) :=
   InducedCategory.faithful _
-#align FinBoolAlg.forget_to_BoolAlg_faithful FinBoolAlg.forget_to_boolAlg_faithful
+#align FinBoolAlg.forget_to_BoolAlg_faithful FinBoolAlgCat.forgetToBoolAlgFaithful
+-/
 
+#print FinBoolAlgCat.hasForgetToFinPartOrd /-
 @[simps]
-instance hasForgetToFinPartOrd : HasForget₂ FinBoolAlg FinPartOrd
+instance hasForgetToFinPartOrd : HasForget₂ FinBoolAlgCat FinPartOrd
     where forget₂ :=
     { obj := fun X => FinPartOrd.of X
       map := fun X Y f => show OrderHom X Y from ↑(show BoundedLatticeHom X Y from f) }
-#align FinBoolAlg.has_forget_to_FinPartOrd FinBoolAlg.hasForgetToFinPartOrd
+#align FinBoolAlg.has_forget_to_FinPartOrd FinBoolAlgCat.hasForgetToFinPartOrd
+-/
 
-instance forget_to_finPartOrd_faithful : Faithful (forget₂ FinBoolAlg FinPartOrd) :=
+#print FinBoolAlgCat.forgetToFinPartOrdFaithful /-
+instance forgetToFinPartOrdFaithful : Faithful (forget₂ FinBoolAlgCat FinPartOrd) :=
   ⟨fun X Y f g h =>
     haveI := congr_arg (coeFn : _ → X → Y) h
     FunLike.coe_injective this⟩
-#align FinBoolAlg.forget_to_FinPartOrd_faithful FinBoolAlg.forget_to_finPartOrd_faithful
+#align FinBoolAlg.forget_to_FinPartOrd_faithful FinBoolAlgCat.forgetToFinPartOrdFaithful
+-/
 
+#print FinBoolAlgCat.Iso.mk /-
 /-- Constructs an equivalence between finite Boolean algebras from an order isomorphism between
 them. -/
 @[simps]
-def Iso.mk {α β : FinBoolAlg.{u}} (e : α ≃o β) : α ≅ β
+def Iso.mk {α β : FinBoolAlgCat.{u}} (e : α ≃o β) : α ≅ β
     where
   hom := (e : BoundedLatticeHom α β)
   inv := (e.symm : BoundedLatticeHom β α)
   hom_inv_id' := by ext; exact e.symm_apply_apply _
   inv_hom_id' := by ext; exact e.apply_symm_apply _
-#align FinBoolAlg.iso.mk FinBoolAlg.Iso.mk
+#align FinBoolAlg.iso.mk FinBoolAlgCat.Iso.mk
+-/
 
+#print FinBoolAlgCat.dual /-
 /-- `order_dual` as a functor. -/
 @[simps]
-def dual : FinBoolAlg ⥤ FinBoolAlg where
+def dual : FinBoolAlgCat ⥤ FinBoolAlgCat
+    where
   obj X := of Xᵒᵈ
   map X Y := BoundedLatticeHom.dual
-#align FinBoolAlg.dual FinBoolAlg.dual
+#align FinBoolAlg.dual FinBoolAlgCat.dual
+-/
 
+#print FinBoolAlgCat.dualEquiv /-
 /-- The equivalence between `FinBoolAlg` and itself induced by `order_dual` both ways. -/
 @[simps Functor inverse]
-def dualEquiv : FinBoolAlg ≌ FinBoolAlg :=
+def dualEquiv : FinBoolAlgCat ≌ FinBoolAlgCat :=
   Equivalence.mk dual dual
     (NatIso.ofComponents (fun X => Iso.mk <| OrderIso.dualDual X) fun X Y f => rfl)
     (NatIso.ofComponents (fun X => Iso.mk <| OrderIso.dualDual X) fun X Y f => rfl)
-#align FinBoolAlg.dual_equiv FinBoolAlg.dualEquiv
+#align FinBoolAlg.dual_equiv FinBoolAlgCat.dualEquiv
+-/
 
-end FinBoolAlg
+end FinBoolAlgCat
 
-theorem finBoolAlg_dual_comp_forget_to_finBddDistLat :
-    FinBoolAlg.dual ⋙ forget₂ FinBoolAlg FinBddDistLat =
-      forget₂ FinBoolAlg FinBddDistLat ⋙ FinBddDistLat.dual :=
+#print finBoolAlgCat_dual_comp_forget_to_finBddDistLatCat /-
+theorem finBoolAlgCat_dual_comp_forget_to_finBddDistLatCat :
+    FinBoolAlgCat.dual ⋙ forget₂ FinBoolAlgCat FinBddDistLatCat =
+      forget₂ FinBoolAlgCat FinBddDistLatCat ⋙ FinBddDistLatCat.dual :=
   rfl
-#align FinBoolAlg_dual_comp_forget_to_FinBddDistLat finBoolAlg_dual_comp_forget_to_finBddDistLat
+#align FinBoolAlg_dual_comp_forget_to_FinBddDistLat finBoolAlgCat_dual_comp_forget_to_finBddDistLatCat
+-/
 
+#print fintypeToFinBoolAlgCatOp /-
 /-- The powerset functor. `set` as a functor. -/
 @[simps]
-def fintypeToFinBoolAlgOp : FintypeCat ⥤ FinBoolAlgᵒᵖ
+def fintypeToFinBoolAlgCatOp : FintypeCat ⥤ FinBoolAlgCatᵒᵖ
     where
-  obj X := op <| FinBoolAlg.of (Set X)
+  obj X := op <| FinBoolAlgCat.of (Set X)
   map X Y f :=
     Quiver.Hom.op <| (CompleteLatticeHom.setPreimage f : BoundedLatticeHom (Set Y) (Set X))
-#align Fintype_to_FinBoolAlg_op fintypeToFinBoolAlgOp
+#align Fintype_to_FinBoolAlg_op fintypeToFinBoolAlgCatOp
+-/
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 
 ! This file was ported from Lean 3 source module order.category.FinBoolAlg
-! leanprover-community/mathlib commit 937b1c59c58710ef8ed91f8727ef402d49d621a2
+! leanprover-community/mathlib commit 2a0ce625dbb0ffbc7d1316597de0b25c1ec75303
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -16,6 +16,9 @@ import Mathbin.Order.Hom.CompleteLattice
 /-!
 # The category of finite boolean algebras
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 This file defines `FinBoolAlg`, the category of finite boolean algebras.
 
 ## TODO
Diff
@@ -114,12 +114,8 @@ def Iso.mk {α β : FinBoolAlg.{u}} (e : α ≃o β) : α ≅ β
     where
   hom := (e : BoundedLatticeHom α β)
   inv := (e.symm : BoundedLatticeHom β α)
-  hom_inv_id' := by
-    ext
-    exact e.symm_apply_apply _
-  inv_hom_id' := by
-    ext
-    exact e.apply_symm_apply _
+  hom_inv_id' := by ext; exact e.symm_apply_apply _
+  inv_hom_id' := by ext; exact e.apply_symm_apply _
 #align FinBoolAlg.iso.mk FinBoolAlg.Iso.mk
 
 /-- `order_dual` as a functor. -/
Diff
@@ -4,13 +4,13 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 
 ! This file was ported from Lean 3 source module order.category.FinBoolAlg
-! leanprover-community/mathlib commit e8ac6315bcfcbaf2d19a046719c3b553206dac75
+! leanprover-community/mathlib commit 937b1c59c58710ef8ed91f8727ef402d49d621a2
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
 import Mathbin.Data.Fintype.Powerset
 import Mathbin.Order.Category.BoolAlg
-import Mathbin.Order.Category.FinPartOrd
+import Mathbin.Order.Category.FinBddDistLat
 import Mathbin.Order.Hom.CompleteLattice
 
 /-!
@@ -78,6 +78,14 @@ instance hasForgetToBoolAlg : HasForget₂ FinBoolAlg BoolAlg :=
   InducedCategory.hasForget₂ FinBoolAlg.toBoolAlg
 #align FinBoolAlg.has_forget_to_BoolAlg FinBoolAlg.hasForgetToBoolAlg
 
+instance hasForgetToFinBddDistLat : HasForget₂ FinBoolAlg FinBddDistLat
+    where
+  forget₂ :=
+    { obj := fun X => FinBddDistLat.of X
+      map := fun X Y f => f }
+  forget_comp := rfl
+#align FinBoolAlg.has_forget_to_FinBddDistLat FinBoolAlg.hasForgetToFinBddDistLat
+
 instance forgetToBoolAlgFull : Full (forget₂ FinBoolAlg BoolAlg) :=
   InducedCategory.full _
 #align FinBoolAlg.forget_to_BoolAlg_full FinBoolAlg.forgetToBoolAlgFull
@@ -131,6 +139,12 @@ def dualEquiv : FinBoolAlg ≌ FinBoolAlg :=
 
 end FinBoolAlg
 
+theorem finBoolAlg_dual_comp_forget_to_finBddDistLat :
+    FinBoolAlg.dual ⋙ forget₂ FinBoolAlg FinBddDistLat =
+      forget₂ FinBoolAlg FinBddDistLat ⋙ FinBddDistLat.dual :=
+  rfl
+#align FinBoolAlg_dual_comp_forget_to_FinBddDistLat finBoolAlg_dual_comp_forget_to_finBddDistLat
+
 /-- The powerset functor. `set` as a functor. -/
 @[simps]
 def fintypeToFinBoolAlgOp : FintypeCat ⥤ FinBoolAlgᵒᵖ
Diff
@@ -4,13 +4,13 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 
 ! This file was ported from Lean 3 source module order.category.FinBoolAlg
-! leanprover-community/mathlib commit c3019c79074b0619edb4b27553a91b2e82242395
+! leanprover-community/mathlib commit e8ac6315bcfcbaf2d19a046719c3b553206dac75
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
 import Mathbin.Data.Fintype.Powerset
 import Mathbin.Order.Category.BoolAlg
-import Mathbin.Order.Category.FinPartialOrder
+import Mathbin.Order.Category.FinPartOrd
 import Mathbin.Order.Hom.CompleteLattice
 
 /-!
@@ -87,17 +87,17 @@ instance forget_to_boolAlg_faithful : Faithful (forget₂ FinBoolAlg BoolAlg) :=
 #align FinBoolAlg.forget_to_BoolAlg_faithful FinBoolAlg.forget_to_boolAlg_faithful
 
 @[simps]
-instance hasForgetToFinPartialOrder : HasForget₂ FinBoolAlg FinPartialOrder
+instance hasForgetToFinPartOrd : HasForget₂ FinBoolAlg FinPartOrd
     where forget₂ :=
-    { obj := fun X => FinPartialOrder.of X
+    { obj := fun X => FinPartOrd.of X
       map := fun X Y f => show OrderHom X Y from ↑(show BoundedLatticeHom X Y from f) }
-#align FinBoolAlg.has_forget_to_FinPartialOrder FinBoolAlg.hasForgetToFinPartialOrder
+#align FinBoolAlg.has_forget_to_FinPartOrd FinBoolAlg.hasForgetToFinPartOrd
 
-instance forget_to_finPartialOrder_faithful : Faithful (forget₂ FinBoolAlg FinPartialOrder) :=
+instance forget_to_finPartOrd_faithful : Faithful (forget₂ FinBoolAlg FinPartOrd) :=
   ⟨fun X Y f g h =>
     haveI := congr_arg (coeFn : _ → X → Y) h
     FunLike.coe_injective this⟩
-#align FinBoolAlg.forget_to_FinPartialOrder_faithful FinBoolAlg.forget_to_finPartialOrder_faithful
+#align FinBoolAlg.forget_to_FinPartOrd_faithful FinBoolAlg.forget_to_finPartOrd_faithful
 
 /-- Constructs an equivalence between finite Boolean algebras from an order isomorphism between
 them. -/

Changes in mathlib4

mathlib3
mathlib4
chore(CategoryTheory): make Functor.Full a Prop (#12449)

Before this PR, Functor.Full contained the data of the preimage of maps by a full functor F. This PR makes Functor.Full a proposition. This is to prevent any diamond to appear.

The lemma Functor.image_preimage is also renamed Functor.map_preimage.

Co-authored-by: Joël Riou <37772949+joelriou@users.noreply.github.com>

Diff
@@ -99,9 +99,9 @@ instance hasForgetToFinBddDistLat : HasForget₂ FinBoolAlg FinBddDistLat where
   forget_comp := rfl
 #align FinBoolAlg.has_forget_to_FinBddDistLat FinBoolAlg.hasForgetToFinBddDistLat
 
-instance forgetToBoolAlgFull : (forget₂ FinBoolAlg BoolAlg).Full :=
+instance forgetToBoolAlg_full : (forget₂ FinBoolAlg BoolAlg).Full :=
   InducedCategory.full _
-#align FinBoolAlg.forget_to_BoolAlg_full FinBoolAlg.forgetToBoolAlgFull
+#align FinBoolAlg.forget_to_BoolAlg_full FinBoolAlg.forgetToBoolAlg_full
 
 instance forgetToBoolAlgFaithful : (forget₂ FinBoolAlg BoolAlg).Faithful :=
   InducedCategory.faithful _
chore: split Subsingleton,Nontrivial off of Data.Set.Basic (#11832)

Moves definition of and lemmas related to Set.Subsingleton and Set.Nontrivial to a new file, so that Basic can be shorter.

Diff
@@ -8,7 +8,7 @@ import Mathlib.Order.Category.BoolAlg
 import Mathlib.Order.Category.FinBddDistLat
 import Mathlib.Order.Hom.CompleteLattice
 import Mathlib.Tactic.ApplyFun
-import Mathlib.Data.Set.Basic
+import Mathlib.Data.Set.Subsingleton
 
 #align_import order.category.FinBoolAlg from "leanprover-community/mathlib"@"937b1c59c58710ef8ed91f8727ef402d49d621a2"
 
chore(CategoryTheory): move Full, Faithful, EssSurj, IsEquivalence and ReflectsIsomorphisms to the Functor namespace (#11985)

These notions on functors are now Functor.Full, Functor.Faithful, Functor.EssSurj, Functor.IsEquivalence, Functor.ReflectsIsomorphisms. Deprecated aliases are introduced for the previous names.

Diff
@@ -99,11 +99,11 @@ instance hasForgetToFinBddDistLat : HasForget₂ FinBoolAlg FinBddDistLat where
   forget_comp := rfl
 #align FinBoolAlg.has_forget_to_FinBddDistLat FinBoolAlg.hasForgetToFinBddDistLat
 
-instance forgetToBoolAlgFull : Full (forget₂ FinBoolAlg BoolAlg) :=
+instance forgetToBoolAlgFull : (forget₂ FinBoolAlg BoolAlg).Full :=
   InducedCategory.full _
 #align FinBoolAlg.forget_to_BoolAlg_full FinBoolAlg.forgetToBoolAlgFull
 
-instance forgetToBoolAlgFaithful : Faithful (forget₂ FinBoolAlg BoolAlg) :=
+instance forgetToBoolAlgFaithful : (forget₂ FinBoolAlg BoolAlg).Faithful :=
   InducedCategory.faithful _
 #align FinBoolAlg.forget_to_BoolAlg_faithful FinBoolAlg.forgetToBoolAlgFaithful
 
@@ -113,7 +113,7 @@ instance hasForgetToFinPartOrd : HasForget₂ FinBoolAlg FinPartOrd where
   forget₂.map {X Y} f := show OrderHom X Y from ↑(show BoundedLatticeHom X Y from f)
 #align FinBoolAlg.has_forget_to_FinPartOrd FinBoolAlg.hasForgetToFinPartOrd
 
-instance forgetToFinPartOrdFaithful : Faithful (forget₂ FinBoolAlg FinPartOrd) :=
+instance forgetToFinPartOrdFaithful : (forget₂ FinBoolAlg FinPartOrd).Faithful :=
   -- Porting note: original code
   -- ⟨fun {X Y} f g h =>
   --   haveI := congr_arg (coeFn : _ → X → Y) h
refactor(Data/FunLike): use unbundled inheritance from FunLike (#8386)

The FunLike hierarchy is very big and gets scanned through each time we need a coercion (via the CoeFun instance). It looks like unbundled inheritance suits Lean 4 better here. The only class that still extends FunLike is EquivLike, since that has a custom coe_injective' field that is easier to implement. All other classes should take FunLike or EquivLike as a parameter.

Zulip thread

Important changes

Previously, morphism classes would be Type-valued and extend FunLike:

/-- `MyHomClass F A B` states that `F` is a type of `MyClass.op`-preserving morphisms.
You should extend this class when you extend `MyHom`. -/
class MyHomClass (F : Type*) (A B : outParam <| Type*) [MyClass A] [MyClass B]
  extends FunLike F A B :=
(map_op : ∀ (f : F) (x y : A), f (MyClass.op x y) = MyClass.op (f x) (f y))

After this PR, they should be Prop-valued and take FunLike as a parameter:

/-- `MyHomClass F A B` states that `F` is a type of `MyClass.op`-preserving morphisms.
You should extend this class when you extend `MyHom`. -/
class MyHomClass (F : Type*) (A B : outParam <| Type*) [MyClass A] [MyClass B]
  [FunLike F A B] : Prop :=
(map_op : ∀ (f : F) (x y : A), f (MyClass.op x y) = MyClass.op (f x) (f y))

(Note that A B stay marked as outParam even though they are not purely required to be so due to the FunLike parameter already filling them in. This is required to see through type synonyms, which is important in the category theory library. Also, I think keeping them as outParam is slightly faster.)

Similarly, MyEquivClass should take EquivLike as a parameter.

As a result, every mention of [MyHomClass F A B] should become [FunLike F A B] [MyHomClass F A B].

Remaining issues

Slower (failing) search

While overall this gives some great speedups, there are some cases that are noticeably slower. In particular, a failing application of a lemma such as map_mul is more expensive. This is due to suboptimal processing of arguments. For example:

variable [FunLike F M N] [Mul M] [Mul N] (f : F) (x : M) (y : M)

theorem map_mul [MulHomClass F M N] : f (x * y) = f x * f y

example [AddHomClass F A B] : f (x * y) = f x * f y := map_mul f _ _

Before this PR, applying map_mul f gives the goals [Mul ?M] [Mul ?N] [MulHomClass F ?M ?N]. Since M and N are out_params, [MulHomClass F ?M ?N] is synthesized first, supplies values for ?M and ?N and then the Mul M and Mul N instances can be found.

After this PR, the goals become [FunLike F ?M ?N] [Mul ?M] [Mul ?N] [MulHomClass F ?M ?N]. Now [FunLike F ?M ?N] is synthesized first, supplies values for ?M and ?N and then the Mul M and Mul N instances can be found, before trying MulHomClass F M N which fails. Since the Mul hierarchy is very big, this can be slow to fail, especially when there is no such Mul instance.

A long-term but harder to achieve solution would be to specify the order in which instance goals get solved. For example, we'd like to change the arguments to map_mul to look like [FunLike F M N] [Mul M] [Mul N] [highPriority <| MulHomClass F M N] because MulHomClass fails or succeeds much faster than the others.

As a consequence, the simpNF linter is much slower since by design it tries and fails to apply many map_ lemmas. The same issue occurs a few times in existing calls to simp [map_mul], where map_mul is tried "too soon" and fails. Thanks to the speedup of leanprover/lean4#2478 the impact is very limited, only in files that already were close to the timeout.

simp not firing sometimes

This affects map_smulₛₗ and related definitions. For simp lemmas Lean apparently uses a slightly different mechanism to find instances, so that rw can find every argument to map_smulₛₗ successfully but simp can't: leanprover/lean4#3701.

Missing instances due to unification failing

Especially in the category theory library, we might sometimes have a type A which is also accessible as a synonym (Bundled A hA).1. Instance synthesis doesn't always work if we have f : A →* B but x * y : (Bundled A hA).1 or vice versa. This seems to be mostly fixed by keeping A B as outParams in MulHomClass F A B. (Presumably because Lean will do a definitional check A =?= (Bundled A hA).1 instead of using the syntax in the discrimination tree.)

Workaround for issues

The timeouts can be worked around for now by specifying which map_mul we mean, either as map_mul f for some explicit f, or as e.g. MonoidHomClass.map_mul.

map_smulₛₗ not firing as simp lemma can be worked around by going back to the pre-FunLike situation and making LinearMap.map_smulₛₗ a simp lemma instead of the generic map_smulₛₗ. Writing simp [map_smulₛₗ _] also works.

Co-authored-by: Matthew Ballard <matt@mrb.email> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Scott Morrison <scott@tqft.net> Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>

Diff
@@ -79,6 +79,9 @@ instance concreteCategory : ConcreteCategory FinBoolAlg :=
   InducedCategory.concreteCategory FinBoolAlg.toBoolAlg
 #align FinBoolAlg.concrete_category FinBoolAlg.concreteCategory
 
+instance instFunLike {X Y : FinBoolAlg} : FunLike (X ⟶ Y) X Y :=
+  BoundedLatticeHom.instFunLike
+
 -- Porting note: added
 -- TODO: in all of the earlier bundled order categories,
 -- we should be constructing instances analogous to this,
chore(*): shake imports (#10199)
  • Remove Data.Set.Basic from scripts/noshake.json.
  • Remove an exception that was used by examples only, move these examples to a new test file.
  • Drop an exception for Order.Filter.Basic dependency on Control.Traversable.Instances, as the relevant parts were moved to Order.Filter.ListTraverse.
  • Run lake exe shake --fix.
Diff
@@ -8,6 +8,7 @@ import Mathlib.Order.Category.BoolAlg
 import Mathlib.Order.Category.FinBddDistLat
 import Mathlib.Order.Hom.CompleteLattice
 import Mathlib.Tactic.ApplyFun
+import Mathlib.Data.Set.Basic
 
 #align_import order.category.FinBoolAlg from "leanprover-community/mathlib"@"937b1c59c58710ef8ed91f8727ef402d49d621a2"
 
chore(*): rename FunLike to DFunLike (#9785)

This prepares for the introduction of a non-dependent synonym of FunLike, which helps a lot with keeping #8386 readable.

This is entirely search-and-replace in 680197f combined with manual fixes in 4145626, e900597 and b8428f8. The commands that generated this change:

sed -i 's/\bFunLike\b/DFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\btoFunLike\b/toDFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/import Mathlib.Data.DFunLike/import Mathlib.Data.FunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\bHom_FunLike\b/Hom_DFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean     
sed -i 's/\binstFunLike\b/instDFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\bfunLike\b/instDFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\btoo many metavariables to apply `fun_like.has_coe_to_fun`/too many metavariables to apply `DFunLike.hasCoeToFun`/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean

Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>

Diff
@@ -113,12 +113,12 @@ instance forgetToFinPartOrdFaithful : Faithful (forget₂ FinBoolAlg FinPartOrd)
   -- Porting note: original code
   -- ⟨fun {X Y} f g h =>
   --   haveI := congr_arg (coeFn : _ → X → Y) h
-  --   FunLike.coe_injective this⟩
+  --   DFunLike.coe_injective this⟩
   -- Porting note: the coercions to functions for the various bundled order categories
   -- are quite inconsistent. We need to go back through and make all these files uniform.
   ⟨fun {X Y} f g h => by
     dsimp at *
-    apply FunLike.coe_injective
+    apply DFunLike.coe_injective
     dsimp
     ext x
     apply_fun (fun f => f x) at h
chore: Remove Cat suffixes (#3730)

These names needn't change in the first place.

style: fix wrapping of where (#7149)
Diff
@@ -105,8 +105,8 @@ instance forgetToBoolAlgFaithful : Faithful (forget₂ FinBoolAlgCat BoolAlgCat)
 #align FinBoolAlg.forget_to_BoolAlg_faithful FinBoolAlgCat.forgetToBoolAlgFaithful
 
 @[simps]
-instance hasForgetToFinPartOrd : HasForget₂ FinBoolAlgCat FinPartOrd
-    where forget₂ :=
+instance hasForgetToFinPartOrd : HasForget₂ FinBoolAlgCat FinPartOrd where
+  forget₂ :=
     { obj := fun X => FinPartOrd.of X
       map := fun {X Y} f => show OrderHom X Y from ↑(show BoundedLatticeHom X Y from f) }
 #align FinBoolAlg.has_forget_to_FinPartOrd FinBoolAlgCat.hasForgetToFinPartOrd
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
@@ -42,7 +42,7 @@ structure FinBoolAlgCat where
 
 namespace FinBoolAlgCat
 
-instance : CoeSort FinBoolAlgCat (Type _) :=
+instance : CoeSort FinBoolAlgCat (Type*) :=
   ⟨fun X => X.toBoolAlgCat⟩
 
 instance (X : FinBoolAlgCat) : BooleanAlgebra X :=
@@ -58,12 +58,12 @@ attribute [instance] FinBoolAlgCat.isFintype
 #noalign FinBoolAlg.coe_to_BoolAlg
 
 /-- Construct a bundled `FinBoolAlgCat` from `BooleanAlgebra` + `Fintype`. -/
-def of (α : Type _) [BooleanAlgebra α] [Fintype α] : FinBoolAlgCat :=
+def of (α : Type*) [BooleanAlgebra α] [Fintype α] : FinBoolAlgCat :=
   ⟨{α := α}⟩
 #align FinBoolAlg.of FinBoolAlgCat.of
 
 @[simp]
-theorem coe_of (α : Type _) [BooleanAlgebra α] [Fintype α] : ↥(of α) = α :=
+theorem coe_of (α : Type*) [BooleanAlgebra α] [Fintype α] : ↥(of α) = α :=
   rfl
 #align FinBoolAlg.coe_of FinBoolAlgCat.coe_of
 
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,11 +2,6 @@
 Copyright (c) 2022 Yaël Dillies. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
-
-! This file was ported from Lean 3 source module order.category.FinBoolAlg
-! leanprover-community/mathlib commit 937b1c59c58710ef8ed91f8727ef402d49d621a2
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Data.Fintype.Powerset
 import Mathlib.Order.Category.BoolAlgCat
@@ -14,6 +9,8 @@ import Mathlib.Order.Category.FinBddDistLatCat
 import Mathlib.Order.Hom.CompleteLattice
 import Mathlib.Tactic.ApplyFun
 
+#align_import order.category.FinBoolAlg from "leanprover-community/mathlib"@"937b1c59c58710ef8ed91f8727ef402d49d621a2"
+
 /-!
 # The category of finite boolean algebras
 
feat: port Order.Category.FinBoolAlgCat (#5052)

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

Dependencies 2 + 284

285 files ported (99.3%)
113079 lines ported (99.9%)
Show graph

The unported dependencies are