@@ -109,7 +109,9 @@ Module Inductives.
109109 Inductive foo2@{s; |} := Foo2 : Type@{s;Set} -> foo2.
110110 Check foo2_rect.
111111
112- Inductive foo3@{s; |} (A:Type@{s;Set}) := Foo3 : A -> foo3 A.
112+ (* This is now invalid since Type does not eliminate to arbitrary sorts by default *)
113+ Fail Inductive foo3@{s; |} (A:Type@{s;Set}) := Foo3 : A -> foo3 A.
114+ Inductive foo3@{s; |Type ->s} (A:Type@{s;Set}) := Foo3 : A -> foo3 A.
113115 Check foo3_rect.
114116
115117 Fail Inductive foo4@{s;u v|v < u} : Type@{v} := C (_:Type@{s;u}).
@@ -212,17 +214,25 @@ Module Inductives.
212214 Definition R5f1_sprop (A:SProp) (r:R5 A) : A := let (f) := r in f.
213215 Fail Definition R5f1_prop (A:Prop) (r:R5 A) : A := let (f) := r in f.
214216
215- Record R6@{s; |} (A:Type@{s;Set}) := { R6f1 : A; R6f2 : nat }.
217+ (* This is now invalid since Type does not eliminate to arbitrary sorts by default *)
218+ Fail Record R6@{s; |} (A:Type@{s;Set}) := { R6f1 : A; R6f2 : nat }.
219+ Record R6@{s; |Type ->s} (A:Type@{s;Set}) := { R6f1 : A; R6f2 : nat }.
216220 Check fun (A:SProp) (x y : R6 A) =>
217221 eq_refl : Conversion.box _ x.(R6f1 _) = Conversion.box _ y.(R6f1 _).
218222 Fail Check fun (A:Prop ) (x y : R6 A) =>
219223 eq_refl : Conversion.box _ x.(R6f1 _) = Conversion.box _ y.(R6f1 _).
220224 Fail Check fun (A:SProp) (x y : R6 A) =>
221225 eq_refl : Conversion.box _ x.(R6f2 _) = Conversion.box _ y.(R6f2 _).
222226
223- #[projections(primitive=no)] Record R7@{s; |} (A:Type@{s;Set}) := { R7f1 : A; R7f2 : nat }.
227+ (* This is now invalid since Type does not eliminate to arbitrary sorts by default *)
228+ Fail #[projections(primitive=no)] Record R7@{s; |} (A:Type@{s;Set}) := { R7f1 : A; R7f2 : nat }.
229+ #[projections(primitive=no)] Record R7@{s; |Type -> s} (A:Type@{s;Set}) := { R7f1 : A; R7f2 : nat }.
224230 Check R7@{SProp;} : SProp -> Set.
225231 Check R7@{Type ;} : Set -> Set.
232+ #[universes(polymorphic=no)]
233+ Sort s7.
234+ Fail Check R7@{s7;} : 𝒰@{s7;0} -> Set.
235+ (* This expression would enforce a non-declared elimination constraint between Type and s7 *)
226236
227237 Inductive sigma@{s;u v|} (A:Type@{s;u}) (B:A -> Type@{s;v}) : Type@{s;max(u,v)}
228238 := pair : forall x : A, B x -> sigma A B.
@@ -284,7 +294,10 @@ Module Inductives.
284294
285295 Arguments exist3 {_ _}.
286296
287- Definition π1@{s s';u v|} {A:Type @{s;u}} {P:A -> Type @{s';v}} (p : sigma3@{_ _ Type ;_ _} A P) : A :=
297+ (* This is now invalid since Type does not eliminate to arbitrary sorts by default *)
298+ Fail Definition π1@{s s';u v|} {A:Type @{s;u}} {P:A -> Type @{s';v}} (p : sigma3@{_ _ Type ;_ _} A P) : A :=
288299 match p return A with exist3 a _ => a end .
289-
300+ Definition π1@{s s';u v|Type -> s} {A:Type @{s;u}} {P:A -> Type @{s';v}} (p : sigma3@{_ _ Type ;_ _} A P) : A :=
301+ match p return A with exist3 a _ => a end .
302+ (* s s' ; u v |= Type -> s *)
290303End Inductives.
0 commit comments