1

I'm developing a library for googology in Coq. I ran into a problem.

Set Universe Polymorphism.
Set Polymorphic Inductive Cumulativity.

Inductive Sum@{i j} (A : Type@{i}) (B : Type@{j}) : Type@{max(i,j)}
  := left : A -> Sum A B | right : B -> Sum A B.

Definition Foo@{i j k l} (A : Type@{i}) (B : Type@{j}) (C : Type@{k}) : Type@{l}
  := Sum@{i _} A (Sum@{j k} B C).

I expected _ to be filled with max(j,k). However, I got an error:

Universes {***} are unbounded.

Is there a way to express these constraints well?

Adrian Mole
  • 49,934
  • 160
  • 51
  • 83
Hexirp
  • 410
  • 2
  • 11
  • 1
    Code on Github is not acceptable, and neither is *See the line 282-323*. All relevant code must be here, in the post itself, so that it remains available to future users of this site. Please provide it here in your question in the form of a [mcve]. If you can't do so, then your question isn't appropriate for this site. See the [help] for more information. – Ken White Apr 11 '20 at 02:00
  • I could not organize my thoughts. Added one that minimized the problem. – Hexirp Apr 11 '20 at 02:09
  • I thought that example was enough. I have improved. – Hexirp Apr 11 '20 at 02:27
  • I correct that: "I have improved" -> "I will have improved" – Hexirp Apr 11 '20 at 11:31
  • 1
    @Hexirp Note that the `max` universes cannot be used in general contexts; only in the universe level of inductive types. That is why `Sum` is accepted, but `Foo` isn't when you put the `max` annotation. – Arthur Azevedo De Amorim Apr 11 '20 at 19:25
  • Thank @ArthurAzevedoDeAmorim! – Hexirp Apr 12 '20 at 00:53

1 Answers1

0

I feel it makes sense to add ij that satisfies i <= ij and j <= ij. I should have thought more.

Hexirp
  • 410
  • 2
  • 11