Zulip Chat Archive

Stream: general

Topic: Accessing Nat type within inductive Typ


Cameron Crossman (Dec 13 2018 at 18:43):

I have the following inductive definition
inductive Typ
| Nat
| Fun : Typ → Typ → Typ

and I am trying to write a theorem and start by assuming some variable p is of type Typ.Nat, how do I go about doing so? I get

type expected at
Typ.Nat
term has type
Typ

error from assume p : Typ.Nat or something similar. Thanks!

Chris Hughes (Dec 13 2018 at 18:58):

Something like this might be what you want

inductive Typ
| Nat : nat  Typ
| Fun : Typ  Typ  Typ

Chris Hughes (Dec 13 2018 at 18:58):

Hang on.

Chris Hughes (Dec 13 2018 at 18:58):

Typ.Nat is not a Type, it's a constructor.

Cameron Crossman (Dec 13 2018 at 19:00):

Oh okay :+1:

Cameron Crossman (Dec 13 2018 at 19:00):

So I just construct of that type with variable p : Typ.Nat or something along those lines

Chris Hughes (Dec 13 2018 at 19:01):

Typ.nat : Typ

Reid Barton (Dec 13 2018 at 19:01):

Typ has nothing to do with actual types, despite the name

Chris Hughes (Dec 13 2018 at 19:01):

(deleted)

Reid Barton (Dec 13 2018 at 19:01):

Maybe you want to define an interpretation Typ -> Type

Cameron Crossman (Dec 13 2018 at 19:04):

thanks!


Last updated: Dec 20 2023 at 11:08 UTC