Debian Codegraph @

test-suite/bugs/bug_3317.v

raw
1 Set Implicit Arguments.
2 Module A.
3 Set Universe Polymorphism.
4 Set Primitive Projections.
5 Set Asymmetric Patterns.
6 Inductive paths {A} (x : A) : A -> Type := idpath : paths x x
7 where "x = y" := (@paths _ x y) : type_scope.
8 Record sigT {A : Type} (P : A -> Type) := existT { projT1 : A; projT2 : P projT1 }.
9 Arguments existT {A} _ _ _.
10 Definition transport {A : Type} (P : A -> Type) {x y : A} (p : x = y) (u : P x) : P y :=
11 match p with idpath => u end.
12 Notation "x .1" := (projT1 x).
13 Notation "x .2" := (projT2 x).
14 Notation "( x ; y )" := (existT _ x y).
15 Set Printing All.
16 Definition path_sigma_uncurried {A : Type} (P : A -> Type) (u v : sigT P)
17 (pq : sigT (fun p : u.1 = v.1 => transport _ p u.2 = v.2))
18 : u = v
19 := match pq with
20 | existT p q =>
21 match u, v return (forall p0 : (u.1 = v.1), (transport P p0 u.2 = v.2) -> (u=v)) with
22 | (x;y), (x';y') => fun p1 (q1 : transport P p1 (existT P x y).2 = (existT P x' y').2) =>
23 match p1 in (_ = x'') return (forall y'', (transport _ p1 y = y'') -> (x;y)=(x'';y'')) with
24 | idpath => fun y' (q2 : transport _ (@idpath _ _) y = y') =>
25 match q2 in (_ = y'') return (x;y) = (x;y'') with
26 | idpath => @idpath _ _
27 end
28 end y' q1
29 end p q
30 end.
31 (* Toplevel input, characters 341-357:
32 Error:
33 In environment
34 A : Type
35 P : forall _ : A, Type
36 u : @sigT A P
37 v : @sigT A P
38 pq :
39 @sigT (@paths A (projT1 u) (projT1 v))
40 (fun p : @paths A (projT1 u) (projT1 v) =>
41 @paths (P (projT1 v)) (@transport A P (projT1 u) (projT1 v) p (projT2 u))
42 (projT2 v))
43 p : @paths A (projT1 u) (projT1 v)
44 q :
45 @paths (P (projT1 v)) (@transport A P (projT1 u) (projT1 v) p (projT2 u))
46 (projT2 v)
47 x : A
48 y : P x
49 x' : A
50 y' : P x'
51 p1 : @paths A (projT1 (@existT A P x y)) (projT1 (@existT A P x' y'))
52 The term "projT2 (@existT A P x y)" has type "P (projT1 (@existT A P x y))"
53 while it is expected to have type "P (projT1 (@existT A P x y))".
54 *)
55 End A.
56
57 Module B.
58 Set Universe Polymorphism.
59 Set Primitive Projections.
60 Set Asymmetric Patterns.
61 Inductive paths {A} (x : A) : A -> Type := idpath : paths x x
62 where "x = y" := (@paths _ x y) : type_scope.
63 Record sigT {A : Type} (P : A -> Type) := existT { projT1 : A; projT2 : P projT1 }.
64 Arguments existT {A} _ _ _.
65 Definition transport {A : Type} (P : A -> Type) {x y : A} (p : x = y) (u : P x) : P y :=
66 match p with idpath => u end.
67 Notation "x .1" := (projT1 x).
68 Notation "x .2" := (projT2 x).
69 Notation "( x ; y )" := (existT _ x y).
70 Set Printing All.
71
72 Definition path_sigma_uncurried {A : Type} (P : A -> Type) (u v : sigT P)
73 (pq : sigT (fun p : u.1 = v.1 => transport _ p u.2 = v.2))
74 : u = v.
75 Proof.
76 destruct u as [x y].
77 destruct v. (* Toplevel input, characters 0-11:
78 Error: Illegal application:
79 The term "transport" of type
80 "forall (A : Type) (P : forall _ : A, Type) (x y : A)
81 (_ : @paths A x y) (_ : P x), P y"
82 cannot be applied to the terms
83 "A" : "Type"
84 "P" : "forall _ : A, Type"
85 "projT1 (@existT A P x y)" : "A"
86 "projT1 v" : "A"
87 "p" : "@paths A (projT1 (@existT A P x y)) (projT1 v)"
88 "projT2 (@existT A P x y)" : "P (projT1 (@existT A P x y))"
89 The 5th term has type "@paths A (projT1 (@existT A P x y)) (projT1 v)"
90 which should be coercible to
91 "@paths A (projT1 (@existT A P x y)) (projT1 v)".
92 *)
93 Abort.
94 End B.