aboutsummaryrefslogtreecommitdiffhomepage
path: root/test-suite/success/cumulativity.v
diff options
context:
space:
mode:
authorGravatar William Lawvere <mundungus.corleone@gmail.com>2017-07-01 22:10:46 -0700
committerGravatar William Lawvere <mundungus.corleone@gmail.com>2017-07-01 22:10:46 -0700
commit80649ebaba75838bfd28ae78822cd2c078da4b23 (patch)
treeac29ab5edd3921dbee1c2256737347fd1542dc67 /test-suite/success/cumulativity.v
parentc2942e642ee6f83cc997f9a2510cdb7446a65cb4 (diff)
parent35e0f327405fb659c7ec5f9f7d26ea284aa45810 (diff)
Merge remote-tracking branch 'upstream/trunk' into trunk
Diffstat (limited to 'test-suite/success/cumulativity.v')
-rw-r--r--test-suite/success/cumulativity.v65
1 files changed, 65 insertions, 0 deletions
diff --git a/test-suite/success/cumulativity.v b/test-suite/success/cumulativity.v
new file mode 100644
index 000000000..ebf817cfc
--- /dev/null
+++ b/test-suite/success/cumulativity.v
@@ -0,0 +1,65 @@
+Set Universe Polymorphism.
+Set Inductive Cumulativity.
+Set Printing Universes.
+
+Inductive List (A: Type) := nil | cons : A -> List A -> List A.
+
+Section ListLift.
+ Universe i j.
+
+ Constraint i < j.
+
+ Definition LiftL {A} : List@{i} A -> List@{j} A := fun x => x.
+
+End ListLift.
+
+Lemma LiftL_Lem A (l : List A) : l = LiftL l.
+Proof. reflexivity. Qed.
+
+Section ListLower.
+ Universe i j.
+
+ Constraint i < j.
+
+ Definition LowerL {A : Type@{i}} : List@{j} A -> List@{i} A := fun x => x.
+
+End ListLower.
+
+Lemma LowerL_Lem@{i j} (A : Type@{j}) (l : List@{i} A) : l = LowerL l.
+Proof. reflexivity. Qed.
+
+Inductive Tp := tp : Type -> Tp.
+
+Section TpLift.
+ Universe i j.
+
+ Constraint i < j.
+
+ Definition LiftTp : Tp@{i} -> Tp@{j} := fun x => x.
+
+End TpLift.
+
+Lemma LiftC_Lem (t : Tp) : LiftTp t = t.
+Proof. reflexivity. Qed.
+
+Section TpLower.
+ Universe i j.
+
+ Constraint i < j.
+
+ Fail Definition LowerTp : Tp@{j} -> Tp@{i} := fun x => x.
+
+End TpLower.
+
+
+Section subtyping_test.
+ Universe i j.
+ Constraint i < j.
+
+ Inductive TP2 := tp2 : Type@{i} -> Type@{j} -> TP2.
+
+End subtyping_test.
+
+Record A : Type := { a :> Type; }.
+
+Record B (X : A) : Type := { b : X; }. \ No newline at end of file