Debian Codegraph @

test-suite/bugs/bug_3352.v

raw
1 Unset Strict Universe Declaration.
2
3 (*
4 I'm not sure what the general rule should be; intuitively, I want [IsHProp (* Set *) Foo] to mean [IsHProp (* U >= Set *) Foo]. (I think this worked in HoTT/coq, too.) Morally, [IsHProp] has no universe level associated with it distinct from that of its argument, you should never get a universe inconsistency from unifying [IsHProp A] with [IsHProp A]. (The issue is tricker when IsHProp uses [A] elsewhere, as in:
5 *)
6
7 (* File reduced by coq-bug-finder from original input, then from 7725 lines to 78 lines, then from 51 lines to 13 lines *)
8 Set Universe Polymorphism.
9 Inductive Empty : Set := .
10 Record IsHProp (A : Type) := { foo : True }.
11 Definition hprop_Empty : IsHProp@{i} Empty := {| foo := I |}.
12 Goal let U := Type in let gt := Set : U in IsHProp (Empty : U).
13 simpl.
14 Set Printing Universes.
15 exact @hprop_Empty. (* Toplevel input, characters 21-32:
16 Error:
17 The term "hprop_Empty" has type "IsHProp (* Set *) Empty"
18 while it is expected to have type "IsHProp (* Top.17 *) Empty"
19 (Universe inconsistency: Cannot enforce Top.17 = Set because Set < Top.17)). *)
20 Defined.
21
22 Module B.
23 (* -*- coq-prog-args: ("-indices-matter") -*- *)
24 (* File reduced by coq-bug-finder from original input, then from 7725 lines to 78 lines, then from 51 lines to 13 lines *)
25 Set Universe Polymorphism.
26 Inductive paths {A} (a : A) : A -> Type := idpath : paths a a where "x = y" := (@paths _ x y) : type_scope.
27 Record Contr (A : Type) := { center : A }.
28 Monomorphic Record IsHProp (A : Type) := { foo : forall x y : A, Contr (x = y) }.
29 Definition hprop_Empty : IsHProp Empty := {| foo x y := match x : Empty with end |}.
30 Goal let U := Type in let gt := Set : U in IsHProp (Empty : U).
31 simpl.
32 Set Printing Universes.
33 exact hprop_Empty.
34 Defined.
35 End B.