mathlib icon indicating copy to clipboard operation
mathlib copied to clipboard

refactor(data/finset/fin): Delete `finset.fin_range`

Open YaelDillies opened this issue 2 years ago • 11 comments

finset.fin_range n is just finset.univ, so we inline its definition in the fintype (fin n) instance to avoid people trying to use it.


Open in Gitpod

YaelDillies avatar Jul 19 '22 23:07 YaelDillies

I think list.fin_range should refer to finset.univ in the docstring.

eric-wieser avatar Jul 20 '22 06:07 eric-wieser

I think we will need to add a new case to tactic.norm_num.eval_finset to handle univ : finset (fin n). Let me know if you're having trouble with that.

Vierkantor avatar Jul 20 '22 10:07 Vierkantor

There already is a case to handle univ : finset α. Is that not enough?

YaelDillies avatar Jul 20 '22 10:07 YaelDillies

I don't think so, the case for univ just opens up the fintype instance and goes in recursion on the expression it finds in the fintype.elems field.

Vierkantor avatar Jul 20 '22 10:07 Vierkantor

Then I have no idea what to do! 😅

YaelDillies avatar Jul 20 '22 10:07 YaelDillies

I've pushed a commit that should work, but we'll have to wait for all the dependencies of the test to build to find out.

Vierkantor avatar Jul 20 '22 10:07 Vierkantor

Doesn't seem to have worked 😢

YaelDillies avatar Jul 21 '22 20:07 YaelDillies

Sorry, this dropped off my radar. Now it works! (for the one test file, on my machine...)

Vierkantor avatar Aug 03 '22 10:08 Vierkantor

It's quite hard to parse the norm_num diff here.

Could you spin out a PR that just reorders finset/mutliset/list to list/multiset/finset first, since I think that reorder is what's making the diff painful.

eric-wieser avatar Aug 03 '22 13:08 eric-wieser

Okay: #15840.

Vierkantor avatar Aug 03 '22 14:08 Vierkantor

@YaelDillies bump on this - it seems sensible enough to me but it needs a merge of master

b-mehta avatar Aug 13 '22 13:08 b-mehta

Thanks for splitting out the reorder, the norm_num diff is now much easier to follow!

eric-wieser avatar Aug 16 '22 10:08 eric-wieser

:v: YaelDillies can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

bors[bot] avatar Aug 16 '22 13:08 bors[bot]

bors merge

YaelDillies avatar Aug 16 '22 16:08 YaelDillies

Pull request successfully merged into master.

Build succeeded:

bors[bot] avatar Aug 16 '22 18:08 bors[bot]