Debian Codegraph @

test-suite/bugs/HoTT_coq_120.v

raw
1 Require Import TestSuite.admit.
2 (* File reduced by coq-bug-finder from original input, then from 8249 lines to 907 lines, then from 843 lines to 357 lines, then from 351 lines to 260 lines, then from 208 lines to 162 lines, then from 167 lines to 154 lines *)
3 Set Universe Polymorphism.
4 Generalizable All Variables.
5 Reserved Notation "g 'o' f" (at level 40, left associativity).
6 Inductive paths {A : Type} (a : A) : A -> Type :=
7 idpath : paths a a.
8 Arguments idpath {A a} , [A] a.
9 Notation "x = y" := (@paths _ x y) : type_scope.
10
11 Class IsEquiv {A B : Type} (f : A -> B) := {}.
12
13 Class Contr_internal (A : Type) := BuildContr {
14 center : A ;
15 contr : (forall y : A, center = y)
16 }.
17
18 Inductive trunc_index : Type :=
19 | minus_two : trunc_index
20 | trunc_S : trunc_index -> trunc_index.
21
22 Fixpoint nat_to_trunc_index (n : nat) : trunc_index
23 := match n with
24 | 0 => trunc_S (trunc_S minus_two)
25 | S n' => trunc_S (nat_to_trunc_index n')
26 end.
27
28 Coercion nat_to_trunc_index : nat >-> trunc_index.
29
30 Fixpoint IsTrunc_internal (n : trunc_index) (A : Type) : Type :=
31 match n with
32 | minus_two => Contr_internal A
33 | trunc_S n' => forall (x y : A), IsTrunc_internal n' (x = y)
34 end.
35
36 Notation minus_one:=(trunc_S minus_two).
37
38 Class IsTrunc (n : trunc_index) (A : Type) : Type := Trunc_is_trunc : IsTrunc_internal n A.
39
40 Notation Contr := (IsTrunc minus_two).
41 Notation IsHProp := (IsTrunc minus_one).
42 Notation IsHSet := (IsTrunc 0).
43
44 Class Funext := {}.
45 Inductive Unit : Set := tt.
46
47 #[export] Instance contr_unit : Contr Unit | 0 := let x := {|
48 center := tt;
49 contr := fun t : Unit => match t with tt => idpath end
50 |} in x.
51 #[export] Instance trunc_succ `{IsTrunc n A} : IsTrunc (trunc_S n) A | 1000.
52 admit.
53 Defined.
54 Record hProp := hp { hproptype :> Type ; isp : IsHProp hproptype}.
55 Definition Unit_hp:hProp:=(hp Unit _).
56 Record hSet := BuildhSet {setT:> Type; iss :> IsHSet setT}.
57 Canonical Structure default_HSet:= fun T P => (@BuildhSet T P).
58 Definition ismono {X Y} (f : X -> Y)
59 := forall Z : hSet,
60 forall g h : Z -> X, (fun x => f (g x)) = (fun x => f (h x)) -> g = h.
61
62 Delimit Scope morphism_scope with morphism.
63 Delimit Scope category_scope with category.
64 Delimit Scope object_scope with object.
65 Record PreCategory :=
66 Build_PreCategory {
67 object :> Type;
68 morphism : object -> object -> Type;
69 compose : forall s d d', morphism d d' -> morphism s d -> morphism s d'
70 }.
71 Arguments compose [!C s d d'] m1 m2 : rename.
72
73 Infix "o" := compose : morphism_scope.
74 Local Open Scope morphism_scope.
75
76 Class IsEpimorphism {C} {x y} (m : morphism C x y) :=
77 is_epimorphism : forall z (m1 m2 : morphism C y z),
78 m1 o m = m2 o m
79 -> m1 = m2.
80
81 Class IsMonomorphism {C} {x y} (m : morphism C x y) :=
82 is_monomorphism : forall z (m1 m2 : morphism C z x),
83 m o m1 = m o m2
84 -> m1 = m2.
85 Class Univalence := {}.
86 Global Instance isset_hProp `{Funext} : IsHSet hProp | 0. Admitted.
87
88 Definition set_cat : PreCategory
89 := @Build_PreCategory hSet
90 (fun x y => forall _ : x, y)%core
91 (fun _ _ _ f g x => f (g x))%core.
92 Inductive minus1Trunc (A :Type) : Type := min1 : A -> minus1Trunc A.
93 #[export] Instance minus1Trunc_is_prop {A : Type} : IsHProp (minus1Trunc A) | 0. Admitted.
94 Definition hexists {X} (P:X->Type):Type:= minus1Trunc (sigT P).
95 Definition isepi {X Y} `(f:X->Y) := forall Z: hSet,
96 forall g h: Y -> Z, (fun x => g (f x)) = (fun x => h (f x)) -> g = h.
97 Definition issurj {X Y} (f:X->Y) := forall y:Y , hexists (fun x => (f x) = y).
98 Lemma isepi_issurj `{fs:Funext} `{ua:Univalence} `{fs' : Funext} {X Y} (f:X->Y): isepi f -> issurj f.
99 Proof.
100 intros epif y.
101 set (g :=fun _:Y => Unit_hp).
102 set (h:=(fun y:Y => (hp (hexists (fun _ : Unit => {x:X & y = (f x)})) _ ))).
103 clear fs'.
104 hnf in epif.
105 specialize (epif (BuildhSet hProp _) g h).
106 admit.
107 Defined.
108 Definition isequiv_isepi_ismono `{Univalence, fs0 : Funext} (X Y : hSet) (f : X -> Y) (epif : isepi f) (monof : ismono f)
109 : IsEquiv f.
110 Proof.
111 pose proof (@isepi_issurj _ _ _ _ _ f epif) as surjf.
112 admit.
113 Defined.
114 Section fully_faithful_helpers.
115 Context `{fs0 : Funext}.
116 Variables x y : hSet.
117 Variable m : x -> y.
118
119 Fail Let isequiv_isepi_ismono_helper ua :=
120 (@isequiv_isepi_ismono ua fs0 x y m : isepi m -> ismono m -> IsEquiv m).
121
122 Goal True.
123 Fail set (isequiv_isepimorphism_ismonomorphism
124 := fun `{Univalence}
125 (Hepi : IsEpimorphism (m : morphism set_cat x y))
126 (Hmono : IsMonomorphism (m : morphism set_cat x y))
127 => (@isequiv_isepi_ismono_helper _ Hepi Hmono : @IsEquiv _ _ m)).
128 admit.
129 Undo.
130 Fail set (isequiv_isepimorphism_ismonomorphism
131 := fun `{Univalence}
132 (Hepi : IsEpimorphism (m : morphism set_cat x y))
133 (Hmono : IsMonomorphism (m : morphism set_cat x y))
134 => ((let _ := @isequiv_isepimorphism_ismonomorphism _ Hepi Hmono in @isequiv_isepi_ismono _ fs0 x y m Hepi Hmono)
135 : @IsEquiv _ _ m)).
136 Set Printing Universes.
137 admit. (* Error: Universe inconsistency (cannot enforce Top.235 <= Set because Set
138 < Top.235). *)
139 Abort.
140 End fully_faithful_helpers.