Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
chore(category_theory): remove [π’ž : category.{v₁} C] / include π’ž (#…
Browse files Browse the repository at this point in the history
…2556)

It is no longer necessary in Lean 3.9.0, thanks to
leanprover-community/lean@0106385
  • Loading branch information
rwbarton committed Apr 29, 2020
1 parent ba9fc4d commit cb3a017
Show file tree
Hide file tree
Showing 73 changed files with 164 additions and 372 deletions.
14 changes: 0 additions & 14 deletions docs/theories/category_theory.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,6 @@ a small category. If `C` is a small category and `D` is a large category
(i.e. `uβ‚‚ = vβ‚‚+1`), and `vβ‚‚ = v₁` then we have
`functor.category C D : category.{v₁+1}` so is again a large category.

Whenever you want to write code uniformly for small and large categories
(which you do by talking about categories whose universe levels `u` and `v`
are unrelated), you will find that Lean's `variable` mechanism doesn't always
work, and the following trick is often helpful:

````
variables {C : Type u₁} [π’ž : category.{v₁} C]
variables {D : Type uβ‚‚} [π’Ÿ : category.{vβ‚‚} D]
include π’ž π’Ÿ
````

Some care with using `section ... end` can be required to make sure these
included variables don't end up where they aren't wanted.

## Notation

### Categories
Expand Down
8 changes: 1 addition & 7 deletions src/category_theory/adjunction/basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ universes v₁ vβ‚‚ v₃ u₁ uβ‚‚ u₃ -- declare the `v`'s first; see `categor

local attribute [elab_simple] whisker_left whisker_right

variables {C : Type u₁} [π’ž : category.{v₁} C] {D : Type uβ‚‚} [π’Ÿ : category.{vβ‚‚} D]
include π’ž π’Ÿ
variables {C : Type u₁} [category.{v₁} C] {D : Type uβ‚‚} [category.{vβ‚‚} D]

/--
`F ⊣ G` represents the data of an adjunction between two functors
Expand Down Expand Up @@ -200,16 +199,11 @@ def mk_of_unit_counit (adj : core_unit_counit F G) : F ⊣ G :=
end },
.. adj }

section
omit π’Ÿ

def id : 𝟭 C ⊣ 𝟭 C :=
{ hom_equiv := Ξ» X Y, equiv.refl _,
unit := πŸ™ _,
counit := πŸ™ _ }

end

section
variables {E : Type u₃} [β„° : category.{v₃} E] (H : D β₯€ E) (I : E β₯€ D)

Expand Down
5 changes: 2 additions & 3 deletions src/category_theory/adjunction/fully_faithful.lean
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ universes v₁ vβ‚‚ u₁ uβ‚‚
open category
open opposite

variables {C : Type u₁} [π’ž : category.{v₁} C]
variables {D : Type uβ‚‚} [π’Ÿ : category.{vβ‚‚} D]
include π’ž π’Ÿ
variables {C : Type u₁} [category.{v₁} C]
variables {D : Type uβ‚‚} [category.{vβ‚‚} D]
variables {L : C β₯€ D} {R : D β₯€ C} (h : L ⊣ R)

-- Lemma 4.5.13 from [Riehl][riehl2017]
Expand Down
3 changes: 1 addition & 2 deletions src/category_theory/adjunction/limits.lean
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ open category_theory.limits

universes u₁ uβ‚‚ v

variables {C : Type u₁} [π’ž : category.{v} C] {D : Type uβ‚‚} [π’Ÿ : category.{v} D]
include π’ž π’Ÿ
variables {C : Type u₁} [category.{v} C] {D : Type uβ‚‚} [category.{v} D]

variables {F : C β₯€ D} {G : D β₯€ C} (adj : F ⊣ G)
include adj
Expand Down
3 changes: 1 addition & 2 deletions src/category_theory/category/default.lean
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ A `small_category` has objects and morphisms in the same universe level.
abbreviation small_category (C : Type u) : Type (u+1) := category.{u} C

section
variables {C : Type u} [π’ž : category.{v} C] {X Y Z : C}
include π’ž
variables {C : Type u} [category.{v} C] {X Y Z : C}

/-- postcompose an equation between morphisms by another morphism -/
lemma eq_whisker {f g : X ⟢ Y} (w : f = g) (h : Y ⟢ Z) : f ≫ h = g ≫ h :=
Expand Down
20 changes: 5 additions & 15 deletions src/category_theory/comma.lean
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,9 @@ comma, slice, coslice, over, under, arrow
namespace category_theory

universes v₁ vβ‚‚ v₃ u₁ uβ‚‚ u₃ -- declare the `v`'s first; see `category_theory.category` for an explanation
variables {A : Type u₁} [π’œ : category.{v₁} A]
variables {B : Type uβ‚‚} [ℬ : category.{vβ‚‚} B]
variables {T : Type u₃} [𝒯 : category.{v₃} T]
include π’œ ℬ 𝒯
variables {A : Type u₁} [category.{v₁} A]
variables {B : Type uβ‚‚} [category.{vβ‚‚} B]
variables {T : Type u₃} [category.{v₃} T]

/-- The objects of the comma category are triples of an object `left : A`, an object
`right : B` and a morphism `hom : L.obj left ⟢ R.obj right`. -/
Expand All @@ -63,18 +62,13 @@ structure comma (L : A β₯€ T) (R : B β₯€ T) : Type (max u₁ uβ‚‚ v₃) :=
(right : B . obviously)
(hom : L.obj left ⟢ R.obj right)

section
omit π’œ ℬ

-- Satisfying the inhabited linter
instance comma.inhabited [inhabited T] : inhabited (comma (𝟭 T) (𝟭 T)) :=
{ default :=
{ left := default T,
right := default T,
hom := πŸ™ (default T) } }

end

variables {L : A β₯€ T} {R : B β₯€ T}

/-- A morphism between two objects in the comma category is a commutative square connecting the
Expand Down Expand Up @@ -265,8 +259,6 @@ end

end comma

omit π’œ ℬ

/-- The over category has as objects arrows in `T` with codomain `X` and as morphisms commutative
triangles. -/
@[derive category]
Expand Down Expand Up @@ -378,8 +370,7 @@ rfl
end iterated_slice

section
variables {D : Type u₃} [π’Ÿ : category.{v₃} D]
include π’Ÿ
variables {D : Type u₃} [category.{v₃} D]

/-- A functor `F : T β₯€ D` induces a functor `over X β₯€ over (F.obj X)` in the obvious way. -/
def post (F : T β₯€ D) : over X β₯€ over (F.obj X) :=
Expand Down Expand Up @@ -455,8 +446,7 @@ variables {Y : T} {f : X ⟢ Y} {U V : under Y} {g : U ⟢ V}
end

section
variables {D : Type u₃} [π’Ÿ : category.{v₃} D]
include π’Ÿ
variables {D : Type u₃} [category.{v₃} D]

/-- A functor `F : T β₯€ D` induces a functor `under X β₯€ under (F.obj X)` in the obvious way. -/
def post {X : T} (F : T β₯€ D) : under X β₯€ under (F.obj X) :=
Expand Down
8 changes: 3 additions & 5 deletions src/category_theory/connected.lean
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,11 @@ component'.
This allows us to show that the functor X β¨― - preserves connected limits.
-/
class connected (J : Type vβ‚‚) [π’₯ : category.{v₁} J] extends inhabited J :=
class connected (J : Type vβ‚‚) [category.{v₁} J] extends inhabited J :=
(iso_constant : Ξ  {Ξ± : Type vβ‚‚} (F : J β₯€ discrete Ξ±), F β‰… (functor.const J).obj (F.obj default))
end connected

variables {J : Type vβ‚‚} [π’₯ : category.{v₁} J]
include π’₯
variables {J : Type vβ‚‚} [category.{v₁} J]

/--
If J is connected, any functor to a discrete category is constant on objects.
Expand Down Expand Up @@ -203,8 +202,7 @@ begin
{ exact (k a).1 }
end

variables {C : Type uβ‚‚} [π’ž : category.{vβ‚‚} C]
include π’ž
variables {C : Type uβ‚‚} [category.{vβ‚‚} C]

/--
For objects `X Y : C`, any natural transformation `α : const X ⟢ const Y` from a connected
Expand Down
8 changes: 3 additions & 5 deletions src/category_theory/const.lean
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ open category_theory

namespace category_theory.functor

variables (J : Type u₁) [π’₯ : category.{v₁} J]
variables {C : Type uβ‚‚} [π’ž : category.{vβ‚‚} C]
include π’₯ π’ž
variables (J : Type u₁) [category.{v₁} J]
variables {C : Type uβ‚‚} [category.{vβ‚‚} C]

def const : C β₯€ (J β₯€ C) :=
{ obj := Ξ» X,
Expand Down Expand Up @@ -54,8 +53,7 @@ end const


section
variables {D : Type u₃} [π’Ÿ : category.{v₃} D]
include π’Ÿ
variables {D : Type u₃} [category.{v₃} D]

/-- These are actually equal, of course, but not definitionally equal
(the equality requires F.map (πŸ™ _) = πŸ™ _). A natural isomorphism is
Expand Down
8 changes: 2 additions & 6 deletions src/category_theory/core.lean
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ universes v₁ vβ‚‚ u₁ uβ‚‚ -- declare the `v`'s first; see `category_theory.c
isomorphisms of C. -/
def core (C : Type u₁) := C

variables {C : Type u₁} [π’ž : category.{v₁} C]
include π’ž
variables {C : Type u₁} [category.{v₁} C]

instance core_category : groupoid.{v₁} (core C) :=
{ hom := Ξ» X Y : C, X β‰… Y,
Expand All @@ -34,8 +33,7 @@ def inclusion : core C β₯€ C :=
{ obj := id,
map := Ξ» X Y f, f.hom }

variables {G : Type uβ‚‚} [𝒒 : groupoid.{vβ‚‚} G]
include 𝒒
variables {G : Type uβ‚‚} [groupoid.{vβ‚‚} G]

/-- A functor from a groupoid to a category C factors through the core of C. -/
-- Note that this function is not functorial
Expand All @@ -47,8 +45,6 @@ def functor_to_core (F : G β₯€ C) : G β₯€ core C :=
def forget_functor_to_core : (G β₯€ core C) β₯€ (G β₯€ C) := (whiskering_right _ _ _).obj inclusion
end core

omit π’ž

/--
`of_equiv_functor m` lifts a type-level `equiv_functor`
to a categorical functor `core (Type u₁) β₯€ core (Type uβ‚‚)`.
Expand Down
7 changes: 3 additions & 4 deletions src/category_theory/currying.lean
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ namespace category_theory

universes v₁ vβ‚‚ v₃ u₁ uβ‚‚ u₃

variables {C : Type u₁} [π’ž : category.{v₁} C]
{D : Type uβ‚‚} [π’Ÿ : category.{vβ‚‚} D]
{E : Type u₃} [β„° : category.{v₃} E]
include π’ž π’Ÿ β„°
variables {C : Type u₁} [category.{v₁} C]
{D : Type uβ‚‚} [category.{vβ‚‚} D]
{E : Type u₃} [category.{v₃} E]

def uncurry : (C β₯€ (D β₯€ E)) β₯€ ((C Γ— D) β₯€ E) :=
{ obj := Ξ» F,
Expand Down
9 changes: 3 additions & 6 deletions src/category_theory/differential_object.lean
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ universes v u

namespace category_theory

variables (C : Type u) [π’ž : category.{v} C]
include π’ž
variables (C : Type u) [category.{v} C]

variables [has_zero_morphisms.{v} C] [has_shift.{v} C]

Expand Down Expand Up @@ -111,8 +110,7 @@ namespace category_theory

namespace differential_object

variables (C : Type u) [π’ž : category.{v} C]
include π’ž
variables (C : Type u) [category.{v} C]

variables [has_zero_object.{v} C] [has_zero_morphisms.{v} C] [has_shift.{v} C]

Expand All @@ -129,9 +127,8 @@ end differential_object

namespace differential_object

variables (C : Type (u+1)) [large_category C] [π’ž : concrete_category C]
variables (C : Type (u+1)) [large_category C] [concrete_category C]
[has_zero_morphisms.{u} C] [has_shift.{u} C]
include π’ž

instance concrete_category_of_differential_objects :
concrete_category (differential_object.{u} C) :=
Expand Down
6 changes: 1 addition & 5 deletions src/category_theory/discrete_category.lean
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ by { apply ulift.fintype }

end discrete

variables {C : Type uβ‚‚} [π’ž : category.{vβ‚‚} C]
include π’ž
variables {C : Type uβ‚‚} [category.{vβ‚‚} C]

namespace functor

Expand Down Expand Up @@ -80,8 +79,6 @@ end nat_iso
namespace discrete
variables {J : Type v₁}

omit π’ž

def lift {Ξ± : Type u₁} {Ξ² : Type uβ‚‚} (f : Ξ± β†’ Ξ²) : (discrete Ξ±) β₯€ (discrete Ξ²) :=
functor.of_function f

Expand All @@ -94,7 +91,6 @@ begin
refine nat_iso.of_components (Ξ» X, by simp [F]) _,
tidy
end
include π’ž


@[simp] lemma functor_map_id
Expand Down
6 changes: 2 additions & 4 deletions src/category_theory/endomorphism.lean
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ instance group {C : Type u} [groupoid.{v} C] (X : C) : group (End X) :=

end End

variables {C : Type u} [π’ž : category.{v} C] (X : C)
include π’ž
variables {C : Type u} [category.{v} C] (X : C)

def Aut (X : C) := X β‰… X

Expand Down Expand Up @@ -78,8 +77,7 @@ end Aut

namespace functor

variables {D : Type u'} [π’Ÿ : category.{v'} D] (f : C β₯€ D) (X)
include π’Ÿ
variables {D : Type u'} [category.{v'} D] (f : C β₯€ D) (X)

/-- `f.map` as a monoid hom between endomorphism monoids. -/
def map_End : End X β†’* End (f.obj X) :=
Expand Down
9 changes: 3 additions & 6 deletions src/category_theory/epi_mono.lean
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@ universes v₁ vβ‚‚ u₁ uβ‚‚

namespace category_theory

variables {C : Type u₁} [π’ž : category.{v₁} C]
include π’ž
variables {C : Type u₁} [category.{v₁} C]

section
variables {D : Type uβ‚‚} [π’Ÿ : category.{vβ‚‚} D]
include π’Ÿ
variables {D : Type uβ‚‚} [category.{vβ‚‚} D]

lemma left_adjoint_preserves_epi {F : C β₯€ D} {G : D β₯€ C} (adj : F ⊣ G)
{X Y : C} {f : X ⟢ Y} (hf : epi f) : epi (F.map f) :=
Expand Down Expand Up @@ -140,8 +138,7 @@ instance op_epi_of_mono {A B : C} (f : A ⟢ B) [mono f] : epi f.op :=
⟨λ Z g h eq, has_hom.hom.unop_inj ((cancel_mono f).1 (has_hom.hom.op_inj eq))⟩

section
variables {D : Type uβ‚‚} [π’Ÿ : category.{vβ‚‚} D]
include π’Ÿ
variables {D : Type uβ‚‚} [category.{vβ‚‚} D]

/-- Split monomorphisms are also absolute monomorphisms. -/
instance {X Y : C} (f : X ⟢ Y) [split_mono f] (F : C β₯€ D) : split_mono (F.map f) :=
Expand Down
6 changes: 2 additions & 4 deletions src/category_theory/eq_to_hom.lean
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ universes v v' u u' -- declare the `v`'s first; see `category_theory.category` f
namespace category_theory
open opposite

variables {C : Type u} [π’ž : category.{v} C]
include π’ž
variables {C : Type u} [category.{v} C]

def eq_to_hom {X Y : C} (p : X = Y) : X ⟢ Y := by rw p; exact πŸ™ _

Expand Down Expand Up @@ -39,8 +38,7 @@ begin
refl
end

variables {D : Type u'} [π’Ÿ : category.{v'} D]
include π’Ÿ
variables {D : Type u'} [category.{v'} D]

namespace functor

Expand Down
Loading

0 comments on commit cb3a017

Please sign in to comment.