@@ -6,6 +6,9 @@ Author: Simon Hudon
6
6
7
7
import order.omega_complete_partial_order
8
8
import order.category.Preorder
9
+ import category_theory.limits.shapes.products
10
+ import category_theory.limits.shapes.equalizers
11
+ import category_theory.limits.shapes.constructions.limits_of_products_and_equalizers
9
12
10
13
/-!
11
14
# Category of types with a omega complete partial order
@@ -26,7 +29,7 @@ open category_theory
26
29
universes u v
27
30
28
31
/-- The category of types with a omega complete partial order. -/
29
- def ωCPO := bundled omega_complete_partial_order
32
+ def ωCPO : Type (u+ 1 ) : = bundled omega_complete_partial_order
30
33
31
34
namespace ωCPO
32
35
@@ -47,4 +50,85 @@ instance : inhabited ωCPO := ⟨of punit⟩
47
50
48
51
instance (α : ωCPO) : omega_complete_partial_order α := α.str
49
52
53
+ section
54
+
55
+ open category_theory.limits
56
+
57
+ namespace has_products
58
+
59
+ /-- The pi-type gives a cone for a product. -/
60
+ def product {J : Type v} (f : J → ωCPO.{v}) : fan f :=
61
+ fan.mk (of (Π j, f j)) (λ j, continuous_hom.of_mono (pi.monotone_apply j : _) (λ c, rfl))
62
+
63
+ /-- The pi-type is a limit cone for the product. -/
64
+ def is_product (J : Type v) (f : J → ωCPO) : is_limit (product f) :=
65
+ { lift := λ s,
66
+ ⟨λ t j, s.π.app j t, λ x y h j, (s.π.app j).monotone h,
67
+ λ x, funext (λ j, (s.π.app j).continuous x)⟩,
68
+ uniq' := λ s m w,
69
+ begin
70
+ ext t j,
71
+ change m t j = s.π.app j t,
72
+ rw ← w j,
73
+ refl,
74
+ end }.
75
+
76
+ instance (J : Type v) (f : J → ωCPO.{v}) : has_product f :=
77
+ has_limit.mk ⟨_, is_product _ f⟩
78
+
79
+ end has_products
80
+
81
+ instance omega_complete_partial_order_equalizer
82
+ {α β : Type *} [omega_complete_partial_order α] [omega_complete_partial_order β]
83
+ (f g : α →𝒄 β) : omega_complete_partial_order {a : α // f a = g a} :=
84
+ omega_complete_partial_order.subtype _ $ λ c hc,
85
+ begin
86
+ rw [f.continuous, g.continuous],
87
+ congr' 1 ,
88
+ ext,
89
+ apply hc _ ⟨_, rfl⟩,
90
+ end
91
+
92
+ namespace has_equalizers
93
+
94
+ /-- The equalizer inclusion function as a `continuous_hom`. -/
95
+ def equalizer_ι {α β : Type *} [omega_complete_partial_order α] [omega_complete_partial_order β]
96
+ (f g : α →𝒄 β) :
97
+ {a : α // f a = g a} →𝒄 α :=
98
+ continuous_hom.of_mono (preorder_hom.subtype.val _) (λ c, rfl)
99
+
100
+ /-- A construction of the equalizer fork. -/
101
+ def equalizer {X Y : ωCPO.{v}} (f g : X ⟶ Y) :
102
+ fork f g :=
103
+ @fork.of_ι _ _ _ _ _ _ (ωCPO.of {a // f a = g a}) (equalizer_ι f g)
104
+ (continuous_hom.ext _ _ (λ x, x.2 ))
105
+
106
+ /-- The equalizer fork is a limit. -/
107
+ def is_equalizer {X Y : ωCPO.{v}} (f g : X ⟶ Y) : is_limit (equalizer f g) :=
108
+ fork.is_limit.mk' _ $ λ s,
109
+ ⟨{ to_fun := λ x, ⟨s.ι x, by apply continuous_hom.congr_fun s.condition⟩,
110
+ monotone' := λ x y h, s.ι.monotone h,
111
+ cont := λ x, subtype.ext (s.ι.continuous x) },
112
+ by { ext, refl },
113
+ λ m hm,
114
+ begin
115
+ ext,
116
+ apply continuous_hom.congr_fun hm,
117
+ end ⟩
118
+
119
+ end has_equalizers
120
+
121
+ instance : has_products ωCPO.{v} :=
122
+ λ J, { has_limit := λ F, has_limit_of_iso discrete.nat_iso_functor.symm }
123
+
124
+ instance {X Y : ωCPO.{v}} (f g : X ⟶ Y) : has_limit (parallel_pair f g) :=
125
+ has_limit.mk ⟨_, has_equalizers.is_equalizer f g⟩
126
+
127
+ instance : has_equalizers ωCPO.{v} := has_equalizers_of_has_limit_parallel_pair _
128
+
129
+ instance : has_limits ωCPO.{v} := limits_from_equalizers_and_products
130
+
131
+ end
132
+
133
+
50
134
end ωCPO
0 commit comments