Debian Codegraph @

test-suite/bugs/bug_3559.v

raw
1 Unset Strict Universe Declaration.
2 (* File reduced by coq-bug-finder from original input, then from 8657 lines to
3 4731 lines, then from 4174 lines to 192 lines, then from 161 lines to 55 lines,
4 then from 51 lines to 37 lines, then from 43 lines to 30 lines *)
5 (* coqc version trunk (August 2014) compiled on Aug 31 2014 10:12:32 with OCaml
6 4.01.0
7 coqtop version cagnode17:/afs/csail.mit.edu/u/j/jgross/coq-trunk,trunk
8 (437b91a3ffd7327975a129b95b24d3f66ad7f3e4) *)
9 Require Import Corelib.Init.Notations.
10 Set Universe Polymorphism.
11 Generalizable All Variables.
12 Record prod A B := pair { fst : A ; snd : B }.
13 Arguments pair {_ _} _ _.
14 Reserved Notation "x -> y" (at level 99, right associativity, y at level 200).
15 Reserved Notation "x <-> y" (at level 95, no associativity).
16 Reserved Notation "x = y" (at level 70, no associativity).
17 Notation "A -> B" := (forall (_ : A), B) : type_scope.
18 Open Scope type_scope.
19
20 Definition iff A B := prod (A -> B) (B -> A).
21 Infix "<->" := iff : type_scope.
22 Inductive paths {A : Type@{i}} (a : A) : A -> Type@{i} := idpath : paths a a where "x = y" := (@paths _ x y) : type_scope.
23 Scheme Rewriting for paths.
24 Class Contr_internal (A : Type) := { center : A ; contr : (forall y : A, center
25 = y) }.
26 Inductive trunc_index : Type := minus_two | trunc_S (_ : trunc_index).
27 Fixpoint IsTrunc_internal (n : trunc_index) (A : Type@{i}) : Type@{i} :=
28 match n with
29 | minus_two => Contr_internal A
30 | trunc_S n' => forall (x y : A), IsTrunc_internal n' (x = y)
31 end.
32 Notation minus_one:=(trunc_S minus_two).
33 Class IsTrunc (n : trunc_index) (A : Type) : Type := Trunc_is_trunc :
34 IsTrunc_internal n A.
35 #[export] Instance istrunc_paths (A : Type) n `{H : IsTrunc (trunc_S n) A} (x y : A) :
36 IsTrunc n (x = y) := H x y.
37
38 Axiom cheat : forall {A}, A.
39
40 Lemma paths_lift (A : Type@{i}) (x y : A) (p : x = y) : paths@{j} x y.
41 Proof.
42 destruct p. apply idpath.
43 Defined.
44
45 Lemma paths_change (A : Type@{i}) (x y : A) : paths@{j} x y = paths@{i} x y.
46 Proof. (* require Univalence *)
47 apply cheat.
48 Defined.
49
50 Lemma IsTrunc_lift (n : trunc_index) :
51 forall (A : Type@{i}), IsTrunc_internal@{i} n A -> IsTrunc_internal@{j} n A.
52 Proof.
53 induction n; simpl; intros.
54 destruct X. exists center0. intros. apply (paths_lift _ _ _ (contr0 y)).
55
56 rewrite paths_change.
57 apply IHn, X.
58 Defined.
59
60 Notation IsHProp := (IsTrunc minus_one).
61 (* Record hProp := hp { hproptype :> Type ; isp : IsTrunc minus_one hproptype}. *)
62 (* Make the truncation proof polymorphic, i.e., available at any level greater or equal
63 to the carrier type level j *)
64 Record hProp := hp { hproptype :> Type@{j} ; isp : IsTrunc minus_one hproptype}.
65 Axiom path_iff_hprop_uncurried : forall `{IsHProp A, IsHProp B}, (A <-> B) -> A
66 = B.
67 Inductive V : Type@{U'} := | set {A : Type@{U}} (f : A -> V) : V.
68 Axiom is0trunc_V : IsTrunc (trunc_S (trunc_S minus_two)) V.
69 #[export] Existing Instance is0trunc_V.
70 Axiom bisimulation : V@{U' U} -> V@{U' U} -> hProp@{U'}.
71 Axiom bisimulation_refl : forall (v : V), bisimulation v v.
72 Axiom bisimulation_eq : forall (u v : V), bisimulation u v -> u = v.
73 Notation "u ~~ v" := (bisimulation u v) (at level 30).
74 Lemma bisimulation_equals_id : forall u v : V@{i j}, (u = v) = (u ~~ v).
75 Proof.
76 intros u v.
77 refine (@path_iff_hprop_uncurried _ _ _ _ _).
78 (* path_iff_hprop_uncurried : *)
79 (* forall A : Type@{Top.74}, *)
80 (* IsHProp A -> forall B : Type@{Top.74}, IsHProp B -> A <-> B -> A = B *)
81 (* (* Top.74 *)
82 (* Top.78 |= Top.74 < Top.78 *)
83 (* *) *)
84
85 Show Universes.
86 exact (isp _).
87 split; intros. destruct X. apply bisimulation_refl.
88 apply bisimulation_eq, X.
89 Defined.