Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(category_theory/limit): special shapes of limits
(This is just rebasing what remains of the old limits PR, onto what has been merged into mathlib. No endorsement of the content is implied. :-)
- Loading branch information
Scott Morrison
committed
Dec 5, 2018
1 parent
5856459
commit 146b8ab
Showing
21 changed files
with
1,904 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
-- Copyright (c) 2017 Scott Morrison. All rights reserved. | ||
-- Released under Apache 2.0 license as described in the file LICENSE. | ||
-- Authors: Stephen Morgan, Scott Morrison | ||
|
||
import data.ulift | ||
import category_theory.natural_transformation | ||
import category_theory.isomorphism | ||
import category_theory.functor_category | ||
|
||
namespace category_theory | ||
|
||
universes u₁ v₁ u₂ v₂ | ||
|
||
def discrete (α : Type u₁) := α | ||
|
||
@[extensionality] lemma plift.ext {P : Prop} (a b : plift P) : a = b := | ||
begin | ||
cases a, cases b, refl | ||
end | ||
|
||
instance plift_subsingleton (P : Prop) : subsingleton (plift P) := | ||
subsingleton.intro (λ a b, begin cases a, cases b, refl end) | ||
|
||
instance discrete_category (α : Type u₁) : small_category (discrete α) := | ||
{ hom := λ X Y, ulift (plift (X = Y)), | ||
id := by obviously, | ||
comp := by obviously } | ||
|
||
-- TODO this needs to wait for equivalences to arrive | ||
-- example : equivalence.{u₁ u₁ u₁ u₁} punit (discrete punit) := by obviously | ||
|
||
def discrete.lift {α : Type u₁} {β : Type u₂} (f : α → β) : (discrete α) ⥤ (discrete β) := | ||
{ obj := f, | ||
map := λ X Y g, begin cases g, cases g, cases g, exact 𝟙 (f X) end } | ||
|
||
variables (J : Type v₂) [small_category J] | ||
|
||
variables (C : Type u₂) [𝒞 : category.{u₂ v₂} C] | ||
include 𝒞 | ||
|
||
@[simp] def discrete.forget : discrete J ⥤ J := | ||
{ obj := λ X, X, | ||
map := λ X Y f, eq_to_hom f.down.down } | ||
|
||
@[simp] lemma discrete.functor_map_id | ||
(F : discrete J ⥤ C) (j : discrete J) (f : j ⟶ j) : F.map f = 𝟙 (F.obj j) := | ||
begin | ||
have h : f = 𝟙 j, cases f, cases f, ext, | ||
rw h, | ||
simp, | ||
end | ||
|
||
variables {C} | ||
|
||
namespace functor | ||
|
||
@[simp] def of_function {I : Type u₁} (F : I → C) : (discrete I) ⥤ C := | ||
{ obj := F, | ||
map := λ X Y f, begin cases f, cases f, cases f, exact 𝟙 (F X) end } | ||
|
||
end functor | ||
|
||
namespace nat_trans | ||
|
||
@[simp] def of_function {I : Type u₁} {F G : I → C} (f : Π i : I, F i ⟶ G i) : | ||
(functor.of_function F) ⟹ (functor.of_function G) := | ||
{ app := λ i, f i, | ||
naturality' := λ X Y g, | ||
begin | ||
cases g, cases g, cases g, | ||
dsimp [functor.of_function], | ||
simp, | ||
end } | ||
|
||
end nat_trans | ||
|
||
end category_theory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import algebra.pi_instances | ||
import category_theory.examples.rings | ||
import category_theory.limits | ||
|
||
universes u v w | ||
|
||
namespace category_theory.examples | ||
|
||
open category_theory | ||
open category_theory.limits | ||
|
||
def CommRing.pi {β : Type u} (f : β → CommRing.{u}) : CommRing := | ||
{ α := Π b : β, (f b), str := by apply_instance } | ||
|
||
def CommRing.pi_π {β : Type u} (f : β → CommRing) (b : β): CommRing.pi f ⟶ f b := | ||
{ val := λ g, g b, property := by tidy } | ||
|
||
@[simp] def CommRing.hom_pi | ||
{α : Type u} {β : α → CommRing} {γ : CommRing} | ||
(f : Π a : α, γ ⟶ β a) : γ ⟶ CommRing.pi β := | ||
{ val := λ x b, f b x, | ||
property := begin convert pi.is_ring_hom_pi (λ a, (f a).val) end } | ||
|
||
local attribute [extensionality] subtype.eq | ||
|
||
instance CommRing_has_products : has_products.{v+1 v} CommRing := | ||
{ fan := λ β f, { X := CommRing.pi f, | ||
π := { app := CommRing.pi_π f } }, | ||
is_product := λ β f, { lift := λ s, CommRing.hom_pi (λ j, s.π.app j), | ||
uniq' := begin tidy, rw ←w, tidy, end } }. | ||
|
||
end category_theory.examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import category_theory.examples.topological_spaces | ||
import category_theory.limits.products | ||
import analysis.topology.continuity | ||
|
||
universes u v w | ||
|
||
open category_theory.limits | ||
open category_theory.examples | ||
|
||
def Top.pi {β : Type u} (f : β → Top.{u}) : Top := | ||
{ α := Π b : β, (f b), str := by apply_instance } | ||
|
||
def Top.pi_π {β : Type u} (f : β → Top) (b : β): Top.pi f ⟶ f b := | ||
{ val := λ g, g b, property := continuous_apply _ } | ||
|
||
@[simp] def Top.hom_pi | ||
{α : Type u} {β : α → Top} {γ : Top} | ||
(f : Π a : α, γ ⟶ β a) : γ ⟶ Top.pi β := | ||
{ val := λ x b, f b x, | ||
property := continuous_pi (λ a, (f a).property) } | ||
|
||
local attribute [extensionality] subtype.eq | ||
|
||
instance : has_products.{u+1 u} Top := | ||
{ fan := λ β f, | ||
{ X := Top.pi f, | ||
π := { app := Top.pi_π f } }, | ||
is_product := λ β f, | ||
{ lift := λ s, Top.hom_pi (λ j, s.π.app j), | ||
uniq' := λ s m w, begin tidy, rw ←w, tidy, end } }. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.