Zulip Chat Archive

Stream: mathlib4

Topic: GroupTheory.OrderOfElement !4#2279


Johan Commelin (Feb 21 2023 at 13:26):

There is one error left in this file, about a fintype instance that can't be found.

Eric Rodriguez (Feb 21 2023 at 14:41):

the fintype instance in Lean3 is docs#subtype.fintype, as coercing to sets is afaik defeq to taking the subtype of things in the set_like. For some reason Lean4 doesn't like this - do we have to make a SetLike.fintype?

Eric Wieser (Feb 21 2023 at 14:48):

I think the coercion function implied by docs4#SetLike is too opaque for typeclass search to see through

Eric Wieser (Feb 21 2023 at 14:49):

I think we had something similar with docs4#Sym2 which was no longer picking up default quotient instances

Johan Commelin (Feb 21 2023 at 15:29):

So, what is the solution?

Eric Wieser (Feb 21 2023 at 15:36):

For Sym2 we just copied across the instance with a porting note

Eric Wieser (Feb 21 2023 at 15:36):

Maybe make a mathlib4 issue too, since this will probably reoccur, and it gives us something to reference in the comment

Johan Commelin (Feb 21 2023 at 15:38):

Ok, I will add

-- Porting note: TODO the following instance should follow from a more general principle
@[to_additive]
noncomputable instance [Fintype G] : Fintype (Submonoid.powers x) :=
  inferInstanceAs $ Fintype {y // y  Submonoid.powers x}

and create an issue.

Eric Wieser (Feb 21 2023 at 15:39):

Oh, I meant that you should add an instance in the same form as the instance it's finding there

Eric Wieser (Feb 21 2023 at 15:39):

What's the term it infers?

Johan Commelin (Feb 21 2023 at 15:49):

  (@Subtype.fintype G
    (fun y =>
      @Membership.mem G (@Submonoid G (@Monoid.toMulOneClass G (@LeftCancelMonoid.toMonoid G inst✝²)))
        (@SetLike.instMembership (@Submonoid G (@Monoid.toMulOneClass G (@LeftCancelMonoid.toMonoid G inst✝²))) G
          (@Submonoid.instSetLikeSubmonoid G (@Monoid.toMulOneClass G (@LeftCancelMonoid.toMonoid G inst✝²))))
        y (@Submonoid.powers G (@LeftCancelMonoid.toMonoid G inst✝²) x))
    (fun a => @decidablePowers G x inst✝² a) inst)

Eric Wieser (Feb 21 2023 at 15:52):

Can you repeat the statement of docs4#Subtype.fintype but for SetLike?

Eric Wieser (Feb 21 2023 at 15:52):

(or if that doesn't work, for Submonoid)


Last updated: Dec 20 2023 at 11:08 UTC