-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathseminar01.v
More file actions
45 lines (28 loc) · 911 Bytes
/
seminar01.v
File metadata and controls
45 lines (28 loc) · 911 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From mathcomp Require Import ssreflect.
(* implement functions with the given signatures *)
Definition prodA (A B C : Type) :
(A * B) * C -> A * (B * C)
:=
Definition sumA (A B C : Type) :
(A + B) + C -> A + (B + C)
:=
Definition prod_sumD (A B C : Type) :
A * (B + C) -> (A * B) + (A * C)
:=
Definition sum_prodD (A B C : Type) :
A + (B * C) -> (A + B) * (A + C)
:=
(* function composition *)
Definition comp A B C (f : B -> A) (g : C -> B) : C -> A
:=
(* Introduce a notation that lets us use composition like so: f \o g.
You might need to tweak the implicit status of some comp's arguments *)
(* Introduce empty type, call `void` *)
Definition void_terminal (A : Type) :
void -> A
:=
(* Introduce `unit` type (a type with exactly one canonical form) *)
Definition unit_initial (A : Type) :
A -> unit
:=
(* Think of some more type signatures involving void, unit, sum, prod *)