Skip to content

Commit c46fc47

Browse files
committed
prove that terminal objects are isomorphic
1 parent 7787d8d commit c46fc47

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/Limits/TerminalObject.lidr

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
2222
> module Limits.TerminalObject
2323
>
2424
> import Basic.Category
25+
> import Basic.Isomorphism
2526
>
2627
> %access public export
2728
> %default total
@@ -30,4 +31,20 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
3031
> constructor MkTerminalObject
3132
> carrier : obj cat
3233
> exists : (a : obj cat) -> mor cat a carrier
33-
> unique : (a : obj cat) -> (f : mor cat a carrier) -> f = exists a
34+
> unique : (a : obj cat) -> (f, g : mor cat a carrier) -> f = g
35+
>
36+
> composeTerminalMorphisms :
37+
> (cat : Category)
38+
> -> (a, b : TerminalObject cat)
39+
> -> mor cat (carrier a) (carrier a)
40+
> composeTerminalMorphisms cat a b =
41+
> compose cat (carrier a) (carrier b) (carrier a) (exists b (carrier a)) (exists a (carrier b))
42+
>
43+
> terminalObjectsAreIsomorphic :
44+
> (cat : Category)
45+
> -> (a, b : TerminalObject cat)
46+
> -> Isomorphism cat (carrier a) (carrier b) (exists b (carrier a))
47+
> terminalObjectsAreIsomorphic cat a b = MkIsomorphism
48+
> (exists a (carrier b))
49+
> (unique a (carrier a) (composeTerminalMorphisms cat a b) (identity cat (carrier a)))
50+
> (unique b (carrier b) (composeTerminalMorphisms cat b a) (identity cat (carrier b)))

0 commit comments

Comments
 (0)