Debian Codegraph @

src/Util/Sigma/Lift.v

raw
1 (** * Lift foralls out of sig proofs *)
2
3 Definition lift1_sig {A C} (P:A->C->Prop)
4 (op_sig : forall (a:A), {c | P a c})
5 : { op : A -> C | forall (a:A), P a (op a) }
6 := exist
7 (fun op => forall a, P a (op a))
8 (fun a => proj1_sig (op_sig a))
9 (fun a => proj2_sig (op_sig a)).
10
11 Definition lift2_sig {A B C} (P:A->B->C->Prop)
12 (op_sig : forall (a:A) (b:B), {c | P a b c})
13 : { op : A -> B -> C | forall (a:A) (b:B), P a b (op a b) }
14 := exist
15 (fun op => forall a b, P a b (op a b))
16 (fun a b => proj1_sig (op_sig a b))
17 (fun a b => proj2_sig (op_sig a b)).
18
19 Definition lift3_sig {A B C D} (P:A->B->C->D->Prop)
20 (op_sig : forall (a:A) (b:B) (c:C), {d | P a b c d})
21 : { op : A -> B -> C -> D | forall (a:A) (b:B) (c:C), P a b c (op a b c) }
22 := exist
23 (fun op => forall a b c, P a b c (op a b c))
24 (fun a b c => proj1_sig (op_sig a b c))
25 (fun a b c => proj2_sig (op_sig a b c)).
26
27 Definition lift4_sig {A B C D E} (P:A->B->C->D->E->Prop)
28 (op_sig : forall (a:A) (b:B) (c:C) (d:D), {e | P a b c d e})
29 : { op : A -> B -> C -> D -> E | forall (a:A) (b:B) (c:C) (d:D), P a b c d (op a b c d) }
30 := exist
31 (fun op => forall a b c d, P a b c d (op a b c d))
32 (fun a b c d => proj1_sig (op_sig a b c d))
33 (fun a b c d => proj2_sig (op_sig a b c d)).
34
35 Definition lift4_sig_sig {A B C D E} {E' : A -> B -> C -> D -> E -> Prop}
36 (P:forall (a:A) (b:B) (c:C) (d:D) (e:E), E' a b c d e -> Prop)
37 (op_sig : forall (a:A) (b:B) (c:C) (d:D), {e : {e : E | E' a b c d e } | P a b c d (proj1_sig e) (proj2_sig e) })
38 (opTP := fun op : A -> B -> C -> D -> E => forall a b c d, E' a b c d (op a b c d))
39 : { op : sig opTP
40 | forall (a:A) (b:B) (c:C) (d:D), P a b c d (proj1_sig op a b c d) (proj2_sig op a b c d) }
41 := exist
42 (fun op : sig opTP => forall a b c d, P a b c d (proj1_sig op a b c d) (proj2_sig op a b c d))
43 (exist opTP (fun a b c d => proj1_sig (proj1_sig (op_sig a b c d))) (fun a b c d => proj2_sig (proj1_sig (op_sig a b c d))))
44 (fun a b c d => proj2_sig (op_sig a b c d)).