0

I am just getting started with Coq and am confused as to why this isn't allowed.

Inductive prod: Type :=
| pair (n1: nat n2: bool).

I get a "The reference n2 was not found in the current environment" complaint.

When I make both arguments nats, or both arguments bools, like this

Inductive prod: Type := | pair (n1 n2: bool).

it doesn't complain.

1 Answer 1

0

In between one set of parentheses you can only have arguments of one type.

Inductive prod : Type :=
| pair (x y : bool).

But you cannot indeed have several types, the syntax for it is to use several sets of brackets:

Inductive prod : Type :=
| pair (x : nat) (y : bool).
2
  • Ah, I see. Thank you!
    – push33n
    Commented Mar 11, 2020 at 14:49
  • If that answers your question, you tick it as accepted so people know you're not looking for more answers. Commented Mar 11, 2020 at 14:50

Not the answer you're looking for? Browse other questions tagged or ask your own question.