Zulip Chat Archive

Stream: general

Topic: option.elim


Yaël Dillies (Apr 12 2022 at 20:20):

Should the arguments of docs#option.elim be swapped so that it behaves like docs#sum.elim? Mario in number_theory.dioph defined docs#option.cons, which is just option.elim with the arguments swapped.

Eric Wieser (Apr 12 2022 at 20:43):

What side do docs#and.elim and docs#or.elim fall on?

Yaël Dillies (Apr 12 2022 at 20:46):

Seem like they agree with option

Eric Wieser (Apr 12 2022 at 21:04):

docs#iff.elim goes the other way though

Eric Wieser (Apr 12 2022 at 21:06):

As does docs#nat.elim

Eric Wieser (Apr 12 2022 at 21:07):

My feeling is that the option.cons order is the right one, and the rule should be "elim is just non-dependent rec"

Eric Wieser (Apr 12 2022 at 21:08):

As opposed to the current meaning "as decided by a possibly biased coin toss, elim is the non-dependent version of either rec or rec_on"

Eric Wieser (Apr 12 2022 at 21:08):

What does lean 4 do?

Mario Carneiro (Apr 12 2022 at 22:44):

Eric Wieser said:

What does lean 4 do?

Same as lean 3: it's not autogenerated so when it is created manually it's a coin toss what you get

Eric Wieser (Apr 12 2022 at 22:48):

Does lean 4 still generate both rec and rec_on?

Mario Carneiro (Apr 12 2022 at 22:53):

yes, although they are a lot less useful since they aren't @[elab_as_elminator]

Mario Carneiro (Apr 12 2022 at 22:54):

you can't really use them directly anymore

Eric Wieser (Apr 12 2022 at 22:58):

Why even bother having both then?

Kyle Miller (Apr 12 2022 at 22:59):

Idle question: how feasible is it to have some syntax where you can do eliminator foo.rec a b c and have elaborate like elab_as_eliminator? (Maybe it could be like an expression version of the induction tactic?)

Kyle Miller (Apr 12 2022 at 23:04):

@Eric Wieser They seemed to be used at least by the induction tactic. (edit: oh, why both)

Eric Wieser (Apr 12 2022 at 23:05):

I'm surprised rec alone isn't enough and that rec_on is worth leaving around

Eric Wieser (Apr 12 2022 at 23:05):

Maybe there's a mutual case where only one exists, like in lean 3

Yaël Dillies (Apr 12 2022 at 23:12):

#13403 for moving option.cons. I didn't make the notation global.

Mario Carneiro (Apr 13 2022 at 03:22):

Yeah, I would be on board with a term mode syntax for @[elab_as_eliminator]. That can be implemented in user space too

Yaël Dillies (Jun 11 2022 at 08:52):

#14681


Last updated: Dec 20 2023 at 11:08 UTC