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

feat: Make PNat.recOn induction eliminator #20617

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

Conversation

EtienneC30
Copy link
Collaborator

@EtienneC30 EtienneC30 commented Jan 9, 2025

@EtienneC30 EtienneC30 added awaiting-CI t-data Data (lists, quotients, numbers, etc) labels Jan 9, 2025
Copy link

github-actions bot commented Jan 9, 2025

PR summary e823c5c32c

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

No declarations were harmed in the making of this PR! 🐙

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for script/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@riccardobrasca
Copy link
Member

Can you have a quick look at where this is used in the library and replace it with the induction tactic? I guess it's not very common so it shouldn't be too much work.

@EtienneC30
Copy link
Collaborator Author

EtienneC30 commented Jan 9, 2025

There is
refine (find_eq_iff _).2 ⟨PNat.find_spec h₂, fun n => PNat.recOn n ?_ ?_⟩
in Data.PNat.Find, should I change it too? It seems reasonable to me.

@riccardobrasca
Copy link
Member

There is
refine (find_eq_iff _).2 ⟨PNat.find_spec h₂, fun n => PNat.recOn n ?_ ?_⟩
in Data.PNat.Find, should I change it too? It seems reasonable to me.

Yes, that's exactly what I mean.

@riccardobrasca
Copy link
Member

There is
refine (find_eq_iff _).2 ⟨PNat.find_spec h₂, fun n => PNat.recOn n ?_ ?_⟩
in Data.PNat.Find, should I change it too? It seems reasonable to me.

Yes, that's exactly what I mean.

Well, only if it's not difficult to do it, don't spend too much time with it.

@EtienneC30
Copy link
Collaborator Author

Done!

@riccardobrasca
Copy link
Member

There is a building error :)

Anyway I won't have time to have a look in the next few days, but it seems an improvements to me.

@edegeltje
Copy link
Collaborator

the build error is caused by these lines, where induction n using PNat.recOn is used with the old case names.

@mattrobball
Copy link
Collaborator

bors merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR has been sent to bors. t-data Data (lists, quotients, numbers, etc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants