Zulip Chat Archive
Stream: new members
Topic: failed to define inductive datatype
Pedro Minicz (Jan 05 2022 at 19:47):
Why definitions term₂
and term₃
don't work? I don't understand the "nested occurrence [...]" error messages. Is there any work around I can do to fix them?
structure Language :=
(functions : ℕ → Type)
(relations : ℕ → Type)
variable (L : Language)
def Language.constants := L.functions 0
inductive term₁
| var (k : ℕ) : term₁
| func {l : ℕ} (f : L.functions l) (args : list term₁) : term₁
-- nested occurrence contains variables that are not parameters
inductive term₂
| var (k : ℕ) : term₂
| func {l : ℕ} (f : L.functions l) (args : vector term₂ l) : term₂
-- nested occurrence lives in universe '0' but must live in resultant universe '1'
inductive term₃
| var (k : ℕ) : term₃
| func {l : ℕ} (f : L.functions l) (args : list term₃) (h : args.length = l): term₃
Reid Barton (Jan 05 2022 at 20:15):
I suggest using args : fin l → term
.
Pedro Minicz (Jan 05 2022 at 21:12):
Thanks for the suggestion.
Pedro Minicz (Jan 05 2022 at 21:13):
I would love to hear an explanation of why definitions 2 and 3 don't work tho.
Alex J. Best (Jan 05 2022 at 21:16):
Pedro Minicz (Jan 05 2022 at 21:20):
Thanks Alex :smiley:
Last updated: Dec 20 2023 at 11:08 UTC