Zulip Chat Archive

Stream: mathlib4

Topic: removing unprimed closure induction principles


Eric Wieser (Jul 26 2023 at 21:16):

The other thing we might want to do is delete lemmas like docs#Submodule.span_induction, as only the primed versions work with the induction keyword

Jireh Loreaux (Jul 26 2023 at 21:20):

Why would we delete them? Those lemmas are surely useful.

Jireh Loreaux (Jul 26 2023 at 21:20):

In fact, I bet they are likely the version used more often.

Eric Wieser (Jul 26 2023 at 21:29):

Only because in Lean3 neither version worked with induction (and the primed ones came much later)

Eric Wieser (Jul 26 2023 at 21:31):

My claims are:

  • Now that we _can_ use induction x using foo, we should prefer it over refine foo x _ (fun _ _ _=> _) _ _ _
  • The primed versions are strictly more general (syntactically) than the unprimed ones
  • Only the primed versions work with induction, so with the spelling preference above there would never be a reason to use the unprimed ones

Jireh Loreaux (Jul 26 2023 at 21:35):

Except that if you have an unbundled x and a hypothesis hx : x ∈ ..., then you have to first lift x to ... using hx, right? Or does it just work as induction ⟨x, hx⟩ using foo (I suspect not)?

Eric Wieser (Jul 26 2023 at 21:45):

docs#Submodule.span_induction' doesn't take a subtype, but I think there are a few stray primed induction principles that do but shouldn't

Eric Wieser (Jul 26 2023 at 21:46):

I think you can just write induction hx using foo or maybe induction x, hx using foo

Eric Wieser (Jul 26 2023 at 21:46):

(I think whether you need x, depends on whether it was explicit in the induction principle)

Notification Bot (Jul 26 2023 at 21:47):

9 messages were moved here from #mathlib4 > Linter idea: h1 h2 hypotheses in induction by Eric Wieser.

Jireh Loreaux (Jul 26 2023 at 22:11):

oops, sorry! I didn't actually click on the docs link because I assumed I knew what it said! In that case I don't see any reason to preserve the unprimed versions.

Eric Wieser (Jul 26 2023 at 22:21):

Your comment was still helpful, it reminded me that there are some lemmas stated the way you expected

Jireh Loreaux (Jul 26 2023 at 22:36):

And yours was too, as I have a PR which adds the wrong version of some primed lemmas! :laughing:

Jireh Loreaux (Jul 28 2023 at 18:18):

@Eric Wieser do the correctly stated primed versions need @[elab_as_elim]?

Eric Wieser (Jul 28 2023 at 18:20):

Yes, but that's not sufficient to verify that they work unfortunately


Last updated: Dec 20 2023 at 11:08 UTC