Debian Codegraph @

test-suite/bugs/HoTT_coq_112.v

raw
1 Require Import TestSuite.admit.
2 (* File reduced by coq-bug-finder from 4464 lines to 4137 lines, then from 3683 lines to 118 lines, then from 124 lines to 75 lines. *)
3 Set Universe Polymorphism.
4 Definition admit {T} : T.
5 Admitted.
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 :> A" := (@paths A x y) : type_scope.
10 Notation "x = y" := (x = y :>_) : type_scope.
11
12 Definition transport {A : Type} (P : A -> Type) {x y : A} (p : x = y) (u : P x) : P y :=
13 match p with idpath => u end.
14
15 Definition ap {A B:Type} (f:A -> B) {x y:A} (p:x = y) : f x = f y
16 := match p with idpath => idpath end.
17
18 Definition apD10 {A} {B:A->Type} {f g : forall x, B x} (h:f=g)
19 : forall x, f x = g x
20 := fun x => match h with idpath => idpath end.
21
22 Class IsEquiv {A B : Type} (f : A -> B) := BuildIsEquiv {
23 equiv_inv : B -> A ;
24 eisretr : forall x, f (equiv_inv x) = x
25 }.
26
27 Arguments eisretr {A B} f {_} _.
28
29 Record Equiv A B := BuildEquiv {
30 equiv_fun :> A -> B ;
31 equiv_isequiv :> IsEquiv equiv_fun
32 }.
33
34 Notation "A <~> B" := (Equiv A B) (at level 85) : equiv_scope.
35 Notation "f ^-1" := (@equiv_inv _ _ f _) (at level 3) : equiv_scope.
36 Local Open Scope equiv_scope.
37
38 #[export] Instance isequiv_path {A B : Type} (p : A = B)
39 : IsEquiv (transport (fun X:Type => X) p) | 0
40 := admit.
41 Definition equiv_path (A B : Type) (p : A = B) : A <~> B
42 := BuildEquiv _ _ (transport (fun X:Type => X) p) _.
43
44 Class Univalence := {
45 isequiv_equiv_path :: forall (A B : Type), IsEquiv (equiv_path A B)
46 }.
47
48 Section Univalence.
49 Context `{Univalence}.
50
51 Definition path_universe_uncurried {A B : Type} (f : A <~> B) : A = B
52 := (equiv_path A B)^-1 f.
53
54 Definition path_universe {A B : Type} (f : A -> B) {feq : IsEquiv f} : (A = B)
55 := path_universe_uncurried (BuildEquiv _ _ f feq).
56
57 Set Printing Universes.
58 Definition transport_path_universe {A B : Type} (f : A -> B) {feq : IsEquiv f} (z : A)
59 : transport (fun X:Type => X) (path_universe f) z = f z
60 := apD10 (ap (equiv_fun A B) (eisretr (equiv_path A B) (BuildEquiv _ _ f feq))) z.
61 (* Toplevel input, characters 0-231:
62 Error: Illegal application:
63 The term "isequiv_equiv_path (* Top.1003 Top.1003 Top.1001 Top.997 *)"
64 of type
65 "Univalence (* Top.1003 Top.1003 Top.1001 Top.997 *) ->
66 forall (A : Type (* Top.1003 *)) (B : Type (* Top.997 *)),
67 IsEquiv (* Top.1003 Top.1001 *)
68 (equiv_path (* Top.997 Top.1003 Top.1001 Top.1003 *) A B)"
69 cannot be applied to the terms
70 "H" : "Univalence (* Top.934 Top.935 Top.936 Top.937 *)"
71 "A" : "Type (* Top.996 *)"
72 "B" : "Type (* Top.997 *)"
73 The 1st term has type "Univalence (* Top.934 Top.935 Top.936 Top.937 *)"
74 which should be coercible to
75 "Univalence (* Top.1003 Top.1003 Top.1001 Top.997 *)".
76 *)
77 End Univalence.