Debian Codegraph @

test-suite/success/univers.v

raw
1 (* This requires cumulativity *)
2
3 Definition Type2 := Type.
4 Definition Type1 : Type2 := Type.
5
6 Lemma lem1 : (True -> Type1) -> Type2.
7 intro H.
8 apply H.
9 exact I.
10 Qed.
11
12 Lemma lem2 :
13 forall (A : Type) (P : A -> Type) (x : A),
14 (forall y : A, x = y -> P y) -> P x.
15 auto.
16 Qed.
17
18 Lemma lem3 : forall P : Prop, P.
19 intro P; pattern P.
20 apply lem2.
21 Abort.
22
23 (* Check managing of universe constraints in inversion (BZ#855) *)
24
25 Inductive dep_eq : forall X : Type, X -> X -> Prop :=
26 | intro_eq : forall (X : Type) (f : X), dep_eq X f f
27 | intro_feq :
28 forall (A : Type) (B : A -> Type),
29 let T := forall x : A, B x in
30 forall (f g : T) (x : A), dep_eq (B x) (f x) (g x) -> dep_eq T f g.
31
32 Require Import TestSuite.relationclasses.
33
34 Theorem dep_eq_trans : forall X : Type, transitive X (dep_eq X).
35 Proof.
36 unfold transitive.
37 intros X f g h H1 H2.
38 inversion H1.
39 Abort.
40
41
42 (* Submitted by Bas Spitters (BZ#935) *)
43
44 (* This is a problem with the status of the type in LetIn: is it a
45 user-provided one or an inferred one? At the current time, the
46 kernel type-check the type in LetIn, which means that it must be
47 considered as user-provided when calling the kernel. However, in
48 practice it is inferred so that a universe refresh is needed to set
49 its status as "user-provided".
50
51 Especially, universe refreshing was not done for "set/pose" *)
52
53 Lemma ind_unsec : forall Q : nat -> Type, True.
54 intro.
55 set (C := forall m, Q m -> Q m).
56 exact I.
57 Qed.
58
59 (* Submitted by Danko Ilik (bug report #1507); related to LetIn *)
60
61 Record U : Type := { A:=Type; a:A }.
62
63 (** Check assignment of sorts to inductives and records. *)
64
65 Parameter sh : list nat.
66
67 Definition is_box_in_shape (b :nat * nat) := True.
68 Definition myType := Type.
69
70 Module Ind.
71 Inductive box_in : myType :=
72 myBox (coord : nat * nat) (_ : is_box_in_shape coord) : box_in.
73 End Ind.
74
75 Module Rec.
76 Record box_in : myType :=
77 BoxIn { coord :> nat * nat; _ : is_box_in_shape coord }.
78 End Rec.