@@ -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}).
@@ -210,17 +212,25 @@ Module Inductives.
210212 Definition R5f1_sprop (A:SProp) (r:R5 A) : A := let (f) := r in f.
211213 Fail Definition R5f1_prop (A:Prop) (r:R5 A) : A := let (f) := r in f.
212214
213- Record R6@{s; |} (A:Type@{s;Set}) := { R6f1 : A; R6f2 : nat }.
215+ (* This is now invalid since Type does not eliminate to arbitrary sorts by default *)
216+ Fail Record R6@{s; |} (A:Type@{s;Set}) := { R6f1 : A; R6f2 : nat }.
217+ Record R6@{s; |Type ->s} (A:Type@{s;Set}) := { R6f1 : A; R6f2 : nat }.
214218 Check fun (A:SProp) (x y : R6 A) =>
215219 eq_refl : Conversion.box _ x.(R6f1 _) = Conversion.box _ y.(R6f1 _).
216220 Fail Check fun (A:Prop ) (x y : R6 A) =>
217221 eq_refl : Conversion.box _ x.(R6f1 _) = Conversion.box _ y.(R6f1 _).
218222 Fail Check fun (A:SProp) (x y : R6 A) =>
219223 eq_refl : Conversion.box _ x.(R6f2 _) = Conversion.box _ y.(R6f2 _).
220224
221- #[projections(primitive=no)] Record R7@{s; |} (A:Type@{s;Set}) := { R7f1 : A; R7f2 : nat }.
225+ (* This is now invalid since Type does not eliminate to arbitrary sorts by default *)
226+ Fail #[projections(primitive=no)] Record R7@{s; |} (A:Type@{s;Set}) := { R7f1 : A; R7f2 : nat }.
227+ #[projections(primitive=no)] Record R7@{s; |Type -> s} (A:Type@{s;Set}) := { R7f1 : A; R7f2 : nat }.
222228 Check R7@{SProp;} : SProp -> Set.
223229 Check R7@{Type ;} : Set -> Set.
230+ #[universes(polymorphic=no)]
231+ Sort s7.
232+ Fail Check R7@{s7;} : 𝒰@{s7;0} -> Set.
233+ (* This expression would enforce a non-declared elimination constraint between Type and s7 *)
224234
225235 Inductive sigma@{s;u v|} (A:Type@{s;u}) (B:A -> Type@{s;v}) : Type@{s;max(u,v)}
226236 := pair : forall x : A, B x -> sigma A B.
@@ -283,7 +293,10 @@ Module Inductives.
283293
284294 Arguments exist3 {_ _}.
285295
286- Definition π1@{s s';u v|} {A:Type @{s;u}} {P:A -> Type @{s';v}} (p : sigma3@{_ _ Type ;_ _} A P) : A :=
296+ (* This is now invalid since Type does not eliminate to arbitrary sorts by default *)
297+ Fail Definition π1@{s s';u v|} {A:Type @{s;u}} {P:A -> Type @{s';v}} (p : sigma3@{_ _ Type ;_ _} A P) : A :=
287298 match p return A with exist3 a _ => a end .
288-
299+ Definition π1@{s s';u v|Type -> s} {A:Type @{s;u}} {P:A -> Type @{s';v}} (p : sigma3@{_ _ Type ;_ _} A P) : A :=
300+ match p return A with exist3 a _ => a end .
301+ (* s s' ; u v |= Type -> s *)
289302End Inductives.
0 commit comments