Debian Codegraph @

test-suite/bugs/bug_16975.v

raw
1
2 Notation "'∏' x .. y , P" := (forall x, .. (forall y, P) ..)
3 (at level 200, x binder, y binder, right associativity) : type_scope.
4
5 Notation "'λ' x .. y , t" := (fun x => .. (fun y => t) ..)
6 (at level 200, x binder, y binder, right associativity).
7
8 Reserved Notation "X ≃ Y" (at level 80, no associativity).
9
10
11 Reserved Notation "g ∘ f" (at level 40, left associativity).
12
13
14 Set Primitive Projections.
15
16 Record total2 { T: Type } ( P: T -> Type ) := tpair { pr1 : T; pr2 : P pr1 }.
17
18 Arguments tpair {_} _ _ _.
19 Arguments pr1 {_ _} _.
20 Arguments pr2 {_ _} _.
21
22 Notation "'∑' x .. y , P" := (total2 (λ x, .. (total2 (λ y, P)) ..))
23 (at level 200, x binder, y binder, right associativity) : type_scope.
24
25
26
27 Definition funcomp {X Y : Type} {Z:Y->Type} (f : X -> Y) (g : ∏ y:Y, Z y) := λ x, g (f x).
28
29 Declare Scope functions.
30
31 Open Scope functions.
32
33 Notation "g ∘ f" := (funcomp f g) : functions.
34
35 Definition isweq {X Y : Type} (f : X -> Y) : Type.
36 Admitted.
37
38 Definition weq (X Y : Type) : Type.
39 exact (∑ f:X->Y, isweq f).
40 Defined.
41
42 Notation "X ≃ Y" := (weq X%type Y%type) : type_scope.
43
44 Definition pr1weq {X Y : Type} := pr1 : X ≃ Y -> (X -> Y).
45 Coercion pr1weq : weq >-> Funclass.
46 Definition make_weq {X Y : Type} (f : X -> Y) (is: isweq f) : X ≃ Y.
47 exact (tpair (λ f : X -> Y, isweq f) f is).
48 Defined.
49
50 Theorem twooutof3c {X Y Z : Type} (f : X -> Y) (g : Y -> Z)
51 (isf : isweq f) (isg : isweq g) : isweq (g ∘ f).
52 Admitted.
53 Definition weqcomp {X Y Z : Type} (w1 : X ≃ Y) (w2 : Y ≃ Z) : X ≃ Z.
54 exact (make_weq (λ (x : X), w2 (w1 x)) (twooutof3c w1 w2 (pr2 w1) (pr2 w2))).
55 Defined.
56
57
58 Delimit Scope weq_scope with weq.
59
60 Definition weqcomp_to_funcomp {X Y Z : Type} {f : X ≃ Y} {g : Y ≃ Z} :
61 pr1weq (weqcomp f g) = pr1weq g ∘ pr1weq f.
62 Admitted.
63
64 Definition stn ( n : nat ) : Type.
65 Admitted.
66
67 Definition sequenceToFunction {X} (x:∑ n, stn n -> X) : stn (pr1 x) -> X.
68 Admitted.
69
70 Lemma foo
71 M
72 (I : Type)
73 (m : I -> M)
74 (n : nat)
75 (x x' : stn n ≃ I)
76 (K:stn n -> M) L Z
77 :
78 @eq (forall _ : stn n, M) Z
79 (@sequenceToFunction M
80 (@tpair nat (fun x0 : nat => forall _ : stn x0, M) n
81 (fun z : stn n => K (@pr1weq I (stn n) L (@pr1weq (stn n) I x z)))))
82 .
83 Proof.
84 Fail rewrite weqcomp_to_funcomp.
85 Abort.