Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: attribute [induction_eliminator] #12605

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open

Conversation

FR-vdash-bot
Copy link
Collaborator

@FR-vdash-bot FR-vdash-bot commented May 2, 2024

Add attribute [induction_eliminator] to
AdjoinRoot.induction_on
ENat.recTopCoe
ENNReal.recTopCoe
Finset.induction
Magma.AssocQuotient.induction_on
ManyOneDegree.ind_on
Module.Ray.ind (and add Orientation.ind for Orientation, an abbrev of it. I wish that we do not need to add it in the future.)
Multiset.induction
MvPolynomial.induction_on
OnePoint.rec
Opposite.rec'
Ordinal.limitRecOn
PartENat.casesOn
Polynomial.induction_on'
QuotientAddGroup.induction_on' (and add AddCircle.induction_on for AddCircle, an abbrev of it. I wish that we do not need to add it in the future.)
QuotientGroup.induction_on' (doesn't actually work)
Real.Angle.induction_on
SimplexCategory.rec
Trunc.induction_on


Open in Gitpod

@FR-vdash-bot FR-vdash-bot added the WIP Work in progress label May 2, 2024
@@ -119,13 +119,13 @@ theorem map_coe (f : α →ₙ* β) (a : α) : map f (a : WithOne α) = f a :=
@[to_additive (attr := simp)]
theorem map_id : map (MulHom.id α) = MonoidHom.id (WithOne α) := by
ext x
induction x using WithOne.cases_on <;> rfl
induction x <;> rfl
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have WithOne.recOneCoe and WithZero.recZeroCoe. Can we just remove WithOne.cases_on and WithZero.cases_on?

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label May 3, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label May 15, 2024
@urkud
Copy link
Member

urkud commented May 19, 2024

Does it make induction use these theorems by default? Should Finset default to cons_induction?

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label May 20, 2024
@eric-wieser
Copy link
Member

193 files is pretty large to review; can this be split? I've made #13096 for the really basic WithX cases.

@eric-wieser
Copy link
Member

Another good split would be all the Free constructions.

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label May 21, 2024
mathlib-bors bot pushed a commit that referenced this pull request May 22, 2024
This is a smaller version of #12605.

This allows `using` to be dropped from `induction`.
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label May 22, 2024
mathlib-bors bot pushed a commit that referenced this pull request Jun 25, 2024
…ects (#14135)

Namely, for

* `FreeMagma` / `FreeAddMagma`
* `FreeSemigroup` / `FreeAddSemigroup`
* `FreeMonoid` / `FreeAddMonoid`
* `FreeCommRing`
* `FreeAlgebra`

Split from #12605


Co-authored-by: negiizhao <[email protected]>
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jun 26, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jun 26, 2024
mathlib-bors bot pushed a commit that referenced this pull request Jun 26, 2024
…on`} with `induction` and `cases` (#14132)

Spit from #12605, which picked up some conflicts here.

Co-authored-by: negiizhao [[email protected]](mailto:[email protected])
kbuzzard pushed a commit that referenced this pull request Jun 26, 2024
kbuzzard pushed a commit that referenced this pull request Jun 26, 2024
…ects (#14135)

Namely, for

* `FreeMagma` / `FreeAddMagma`
* `FreeSemigroup` / `FreeAddSemigroup`
* `FreeMonoid` / `FreeAddMonoid`
* `FreeCommRing`
* `FreeAlgebra`

Split from #12605


Co-authored-by: negiizhao <[email protected]>
kbuzzard pushed a commit that referenced this pull request Jun 26, 2024
…on`} with `induction` and `cases` (#14132)

Spit from #12605, which picked up some conflicts here.

Co-authored-by: negiizhao [[email protected]](mailto:[email protected])
@eric-wieser
Copy link
Member

QuotientGroup.induction_on' (doesn't actually work)

leanprover/lean4#4577

mathlib-bors bot pushed a commit that referenced this pull request Jun 30, 2024
…le types (#14205)

Namely:

* `AList`
* `Cycle`
* `ConjAct`
* `Projectivization`
* `Lex`
* `NatOrdinal`
* `WithLawson`
* `WithLower`
* `WithUpper`
* `WithScott`
* `WithUpperSet`
* `WithLowerSet`
* `Speicalization` (which had an incorrectly-stated induction principle)

These are just for the cases which have docstrings of the form "Use as `induction .* using .*`".

Inspired by #12605.
mathlib-bors bot pushed a commit that referenced this pull request Jun 30, 2024
mathlib-bors bot pushed a commit that referenced this pull request Jun 30, 2024
Split from #12605

Also cleans up some proofs that used `revert` instead of `induction`.
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jun 30, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jun 30, 2024
@eric-wieser
Copy link
Member

193 files is pretty large to review

Now down to 140 files!

I think the Finset ones are possibly controversial; I'd much prefer cons_induction to be the default, but I suspect that stance is also controversial.

dagurtomas pushed a commit that referenced this pull request Jul 2, 2024
dagurtomas pushed a commit that referenced this pull request Jul 2, 2024
…ects (#14135)

Namely, for

* `FreeMagma` / `FreeAddMagma`
* `FreeSemigroup` / `FreeAddSemigroup`
* `FreeMonoid` / `FreeAddMonoid`
* `FreeCommRing`
* `FreeAlgebra`

Split from #12605


Co-authored-by: negiizhao <[email protected]>
dagurtomas pushed a commit that referenced this pull request Jul 2, 2024
…on`} with `induction` and `cases` (#14132)

Spit from #12605, which picked up some conflicts here.

Co-authored-by: negiizhao [[email protected]](mailto:[email protected])
dagurtomas pushed a commit that referenced this pull request Jul 2, 2024
…le types (#14205)

Namely:

* `AList`
* `Cycle`
* `ConjAct`
* `Projectivization`
* `Lex`
* `NatOrdinal`
* `WithLawson`
* `WithLower`
* `WithUpper`
* `WithScott`
* `WithUpperSet`
* `WithLowerSet`
* `Speicalization` (which had an incorrectly-stated induction principle)

These are just for the cases which have docstrings of the form "Use as `induction .* using .*`".

Inspired by #12605.
dagurtomas pushed a commit that referenced this pull request Jul 2, 2024
dagurtomas pushed a commit that referenced this pull request Jul 2, 2024
Split from #12605

Also cleans up some proofs that used `revert` instead of `induction`.
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jul 7, 2024
@YaelDillies
Copy link
Collaborator

What's the status here? I think this is a useful PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-author A reviewer has asked the author a question or requested changes merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants