Zulip Chat Archive

Stream: general

Topic: example attributes


Yaël Dillies (Aug 27 2022 at 10:02):

Can examples be tagged with attributes?

Kevin Buzzard (Aug 27 2022 at 10:05):

#xy?

Yaël Dillies (Aug 27 2022 at 10:06):

The context is that I am writing many proofs about Heyting algebras and I derive those proofs from intuitionistic proofs about props, thanks to the correspondance between intuitionistic logic and Heyting algebras. I am then leaving the examples behind as a source for a future tactic that would automatically use that metatheorem to write the proofs.

Yaël Dillies (Aug 27 2022 at 10:07):

So in particular I don't want someone to golf my proofs using classical logic because that would break the point! So I would like to tag examples with @[intuit], where intuit would be an attribute checking that you only use propext and quot.sound as axioms.

Yaël Dillies (Aug 27 2022 at 10:10):

I could also make those examples lemmas, but they are of little use in the propositional world.

Kevin Buzzard (Aug 27 2022 at 10:11):

Removing the tag would then golf it even more ;-)

Yaël Dillies (Aug 27 2022 at 10:12):

Yes but hopefully that will reduce the probability of someone doing so!

Yaël Dillies (Aug 27 2022 at 10:21):

And of course I will write a library note explaining the role of those examples.

Kevin Buzzard (Aug 27 2022 at 10:23):

Are examples called weird auto-generated names internally? I suppose you could just give them silly private names

Reid Barton (Aug 27 2022 at 10:50):

Are examples even added to the environment?

Kevin Buzzard (Aug 27 2022 at 11:18):

import tactic

example :  := (⟨2, rfl :  x, x = 2).some
/-
missing 'noncomputable' modifier, definition '_example' depends on 'Exists.some'
-/

Kevin Buzzard (Aug 27 2022 at 11:18):

doesn't seem to survive long though, if it ever even existed

Eric Rodriguez (Aug 27 2022 at 11:31):

They get some awful auto-generated name iirc

Alex J. Best (Aug 27 2022 at 19:13):

Examples aren't added to the environment I believe. Maybe you can just add a comment telling people not to golf them?

Yaël Dillies (Aug 27 2022 at 19:17):

I don't care about lasting attributes. I only want "immediate action" attributes.

Reid Barton (Aug 27 2022 at 19:55):

How about just not using example?

Yaël Dillies (Aug 27 2022 at 20:57):

As I said, that would result in pretty useless lemmas about Prop (because assumptions would be uncurried and quite unnatural), and I would need to come up with names.

Reid Barton (Aug 27 2022 at 21:22):

I don't understand what you want to do but example seems needlessly obscure

Kevin Buzzard (Aug 28 2022 at 08:09):

Just make them private and call them example1, example2, ...


Last updated: Dec 20 2023 at 11:08 UTC