Zulip Chat Archive

Stream: Is there code for X?

Topic: Cardinality of subgroup


Johan Commelin (Oct 20 2021 at 09:57):

What is the recommended way to talk about the card of a subgroup of a finite group?

Mario Carneiro (Oct 20 2021 at 09:58):

card S?

Johan Commelin (Oct 20 2021 at 09:58):

Which card is that?

Mario Carneiro (Oct 20 2021 at 09:58):

I guess fintype.card if you want a nat

Johan Commelin (Oct 20 2021 at 09:59):

Aah, with some coercions under the hood. Ok.

Johan Commelin (Oct 20 2021 at 10:01):

failed to synthesize type class instance for
α : Type u,
_inst_1 : group α,
_inst_3 : fintype α
fintype (subgroup.center α)

Johan Commelin (Oct 20 2021 at 10:01):

Lean is not yet convinced :sad:

Eric Wieser (Oct 20 2021 at 10:20):

decidable_eq α?

Johan Commelin (Oct 20 2021 at 10:21):

Doesn't help

Eric Wieser (Oct 20 2021 at 10:27):

I think you need to add a decidable_pred (∈ center G) instance

Eric Wieser (Oct 20 2021 at 10:27):

Which probably falls out by just unfolding

Eric Wieser (Oct 20 2021 at 10:28):

Or as decidable.forall if that exists

Eric Wieser (Oct 20 2021 at 10:28):

We already have such an instance for range, docs#monoid_hom.decidable_mem_range

Johan Commelin (Oct 20 2021 at 10:29):

We really need fincard.

Johan Commelin (Oct 20 2021 at 10:30):

Because this issue is not just restricted to subgroup.center of course.

Johan Commelin (Oct 20 2021 at 10:30):

So we'll need > 57 of such instances, for all the variants.

Eric Wieser (Oct 20 2021 at 10:31):

Well, we already have to write mem_center by hand

Eric Wieser (Oct 20 2021 at 10:31):

So we just need a decidable_mem_center next to every one of those

Eric Wieser (Oct 20 2021 at 10:32):

Perhaps derive or simps could handle this type of thing

Johan Commelin (Oct 20 2021 at 10:32):

But we also need it for centralizer and for normalizer and for subfoo.whatever.

Eric Wieser (Oct 20 2021 at 10:33):

Yeah, but we need mem_ lemmas for all of those too

Eric Wieser (Oct 20 2021 at 10:34):

So it's only a constant factor more boilerplate than we're already obliged to write

Eric Wieser (Oct 20 2021 at 10:34):

In theory simps could generate those mem lemmas quite easily, but I'm pretty sure we haven't tried configuring it to.

Kevin Buzzard (Oct 20 2021 at 11:02):

Johan Commelin said:

We really need fincard.

We have it, right? Does docs#nat.card work?

Johan Commelin (Oct 20 2021 at 11:06):

Ooh! I didn't realize that we had it. Great!

Eric Wieser (Oct 20 2021 at 12:24):

#9825

Johan Commelin (Oct 20 2021 at 12:37):

Thanks!

Johan Commelin (Oct 20 2021 at 12:37):

variables (G) [group G] [fintype G] {M : Type*} [monoid M]

-- move this
lemma is_conj_comm (g h : M) : is_conj g h  is_conj h g :=
is_conj.symm, is_conj.symm

-- move this
lemma mem_orbit_conj_act_iff {G : Type*} [group G] (g h : G) :
  g  orbit (conj_act G) h  is_conj g h :=
by { rw [is_conj_comm, is_conj_iff, mem_orbit_iff], exact iff.rfl }

-- move this
lemma orbit_rel_r (X : Type*) [mul_action G X] :
  (orbit_rel G X).r = λ x y, x  orbit G y := rfl

-- move this
lemma orbit_rel_r_apply {X : Type*} [mul_action G X] (x y : X) :
  @setoid.r _ (orbit_rel G X) x y  x  orbit G y := iff.rfl

lemma class_equation' [decidable_rel (is_conj : G  G  Prop)] :
   (x : conj_classes G), x.fincarrier.card = fintype.card G :=
begin
  let e : quotient (orbit_rel (conj_act G) G)  conj_classes G :=
  quotient.congr_right (λ g h, mem_orbit_conj_act_iff g h),
  letI : fintype (quotient (orbit_rel (conj_act G) G)) := by { classical, apply_instance },
  rw  e.sum_comp,
  classical,
  rw card_eq_sum_card_group_div_card_stabilizer (conj_act G) G,
  refine finset.sum_congr rfl _,
  rintro g -,
  rw [ card_orbit_mul_card_stabilizer_eq_card_group (conj_act G) (quotient.out' (quot.mk _ g)),
    nat.mul_div_cancel, fintype.card_of_finset, conj_classes.fincarrier],
  swap, { rw fintype.card_pos_iff, apply_instance },
  intro h,
  simp only [true_and, finset.mem_univ, finset.mem_filter, mem_orbit_conj_act_iff,
     conj_classes.mk_eq_mk_iff_is_conj],
  refine eq_iff_eq_cancel_left.2 (conj_classes.mk_eq_mk_iff_is_conj.2 _),
  show is_conj g _,
  rw [ mem_orbit_conj_act_iff,  orbit_rel_r_apply],
  apply quotient.exact',
  rw [quotient.out_eq'],
  refl
end

Eric Wieser (Oct 20 2021 at 12:42):

I wasn't aware of docs#conj_classes. What's fincarrier?

Johan Commelin (Oct 20 2021 at 12:45):

I just defined it. Sorry, I forgot to copy it.

Eric Wieser (Oct 20 2021 at 12:54):

I was wondering if it was similar to @Yaël Dillies's finpartition

Yaël Dillies (Oct 20 2021 at 12:55):

#9795 for reference

Johan Commelin (Oct 20 2021 at 13:02):

Oooh, I have no idea!

Yaël Dillies (Oct 20 2021 at 13:10):

finpartition is the finset bundled generalized version of setoid.partition.

Eric Wieser (Oct 20 2021 at 13:15):

docs#setoid.partition doesn't exist

Eric Wieser (Oct 20 2021 at 13:17):

I guess you meant docs#setoid.is_partition

Johan Commelin (Oct 20 2021 at 14:30):

I now have a sorry-free

lemma class_equation :
  nat.card (subgroup.center G) + ∑ᶠ x  noncenter G, nat.card (carrier x) = nat.card G :=

(G is a group)

Johan Commelin (Oct 20 2021 at 14:32):

#9828


Last updated: Dec 20 2023 at 11:08 UTC