Zulip Chat Archive

Stream: general

Topic: Old-style Prop-valued structures


Oliver Nash (Oct 07 2022 at 13:17):

I want to set up some structures like this:

import data.nat.basic

set_option old_structure_cmd true

structure foo (n : ) : Prop := (zero_lt : 0 < n)

structure bar (n : ) extends foo n : Prop := (even : n % 2 = 0)

#print bar.to_foo -- We see it's a `def` rather than a `lemma`

Oliver Nash (Oct 07 2022 at 13:17):

The two important points are:

  • Using set_option old_structure_cmd true
  • These are Prop-valued structures

Oliver Nash (Oct 07 2022 at 13:18):

However (thanks to the linter) I discovered that the above code makes the projection bar.to_foo a def rather than a lemma.

Oliver Nash (Oct 07 2022 at 13:19):

I'm not sure what to do about this. Does it matter?

Anne Baanen (Oct 08 2022 at 10:26):

That's weird, but I expect no bad effects beyond linter warning and a little bit of useless code generation. The more dangerous direction would be a lemma that should be a def.


Last updated: Dec 20 2023 at 11:08 UTC