Debian Codegraph @

test-suite/bugs/bug_3922.v

raw
1 Unset Strict Universe Declaration.
2 Require Import TestSuite.admit.
3 Set Universe Polymorphism.
4 Notation Type0 := Set.
5
6 Definition Type1 := Eval hnf in let gt := (Set : Type@{i}) in Type@{i}.
7
8 Notation compose := (fun g f x => g (f x)).
9
10 Notation "g 'o' f" := (compose g f) (at level 40, left associativity) : function_scope.
11 Open Scope function_scope.
12
13 Definition pointwise_paths {A} {P:A->Type} (f g:forall x:A, P x)
14 := forall x:A, f x = g x.
15
16 Notation "f == g" := (pointwise_paths f g) (at level 70, no associativity) : type_scope.
17
18 Class Contr_internal (A : Type) := BuildContr {
19 center : A ;
20 contr : (forall y : A, center = y)
21 }.
22
23 Inductive trunc_index : Type :=
24 | minus_two : trunc_index
25 | trunc_S : trunc_index -> trunc_index.
26
27 Notation "n .+1" := (trunc_S n) (at level 2, left associativity, format "n .+1") : trunc_scope.
28 Local Open Scope trunc_scope.
29 Notation "-2" := minus_two (at level 0) : trunc_scope.
30 Notation "-1" := (-2.+1) (at level 0) : trunc_scope.
31
32 Fixpoint IsTrunc_internal (n : trunc_index) (A : Type) : Type :=
33 match n with
34 | -2 => Contr_internal A
35 | n'.+1 => forall (x y : A), IsTrunc_internal n' (x = y)
36 end.
37
38 Class IsTrunc (n : trunc_index) (A : Type) : Type :=
39 Trunc_is_trunc : IsTrunc_internal n A.
40
41 Notation Contr := (IsTrunc -2).
42 Notation IsHProp := (IsTrunc -1).
43
44 Monomorphic Axiom dummy_funext_type : Type0.
45 Monomorphic Class Funext := { dummy_funext_value : dummy_funext_type }.
46
47 Inductive Unit : Set :=
48 tt : Unit.
49
50 Record TruncType (n : trunc_index) := BuildTruncType {
51 trunctype_type : Type ;
52 istrunc_trunctype_type : IsTrunc n trunctype_type
53 }.
54
55 Arguments BuildTruncType _ _ {_}.
56
57 Coercion trunctype_type : TruncType >-> Sortclass.
58
59 Notation "n -Type" := (TruncType n) (at level 1) : type_scope.
60 Notation hProp := (-1)-Type.
61
62 Notation BuildhProp := (BuildTruncType -1).
63
64 Private Inductive Trunc (n : trunc_index) (A :Type) : Type :=
65 tr : A -> Trunc n A.
66 Arguments tr {n A} a.
67
68 Global Instance istrunc_truncation (n : trunc_index) (A : Type@{i})
69 : IsTrunc@{j} n (Trunc@{i} n A).
70 Admitted.
71
72 Definition Trunc_ind {n A}
73 (P : Trunc n A -> Type) {Pt : forall aa, IsTrunc n (P aa)}
74 : (forall a, P (tr a)) -> (forall aa, P aa)
75 := (fun f aa => match aa with tr a => fun _ => f a end Pt).
76 Definition merely (A : Type@{i}) : hProp := BuildhProp (Trunc -1 A).
77 Definition cconst_factors_contr `{Funext} {X Y : Type} (f : X -> Y)
78 (P : Type) `{Pc : X -> Contr P}
79 (g : X -> P) (h : P -> Y) (p : h o g == f)
80 : Unit.
81 Proof.
82 assert (merely X -> IsHProp P) by admit.
83 refine (let g' := Trunc_ind (fun _ => P) g : merely X -> P in _);
84 [ assumption.. | ].
85 pose (g'' := Trunc_ind (fun _ => P) g : merely X -> P).
86 Abort.