Zulip Chat Archive

Stream: lean4

Topic: syntax for dependently typed structures with default values


Mark Wilhelm (Apr 21 2022 at 22:10):

If I do something like this --

structure Something (i: Nat) where
  n1: Nat := 1
  n2: Nat := 1 + i

constant s : Something 10 := {}

...I see an error on s -- "(kernel) kernel type checker does not support meta variables". Is there a way to get this to work?

Henrik Böving (Apr 21 2022 at 22:19):

The elaborator does seem to at least partially understand what to do here since it ends up with:

[Elab.definition.body] foo : Something 10 :=
{ n1 := 1, n2 := ?m.938 + 1 }

so maybe that's something that Elab.struct just isn't doing yet? In this special case it at least seems feasible to me to infer the value for this meta variable

Leonardo de Moura (Apr 22 2022 at 00:41):

Pushed a fix for this issue https://github.com/leanprover/lean4/commit/66c82dadc96e021965d953f1b7a1edc372561005

Mark Wilhelm (Apr 24 2022 at 17:41):

Thank you for the fix


Last updated: Dec 20 2023 at 11:08 UTC