Theorem: Subgroup.rank_closure_finset_le_card
File: Mathlib/GroupTheory/Finiteness.lean

tactic: let t : Finset (closure (s : Set G)) := s.preimage Subtype.val (Subtype.coe_injective.injOn _)
state_before: M : Type ?u.114803
N : Type ?u.114806
inst✝³ : Monoid M
inst✝² : AddMonoid N
G : Type u_1
H : Type ?u.114818
inst✝¹ : Group G
inst✝ : AddGroup H
s : Finset G
⊢ Group.rank { x // x ∈ closure ↑s } ≤ Finset.card s

tactic: have ht : closure (t : Set (closure (s : Set G))) = ⊤ := by
  rw [Finset.coe_preimage]
  exact closure_preimage_eq_top (s : Set G)
state_before: M : Type ?u.114803
N : Type ?u.114806
inst✝³ : Monoid M
inst✝² : AddMonoid N
G : Type u_1
H : Type ?u.114818
inst✝¹ : Group G
inst✝ : AddGroup H
s : Finset G
t : Finset { x // x ∈ closure ↑s } := Finset.preimage s Subtype.val (_ : Set.InjOn (fun a => ↑a) (Subtype.val ⁻¹' ↑s))
⊢ Group.rank { x // x ∈ closure ↑s } ≤ Finset.card s

tactic: apply (Group.rank_le (closure (s : Set G)) ht).trans
state_before: M : Type ?u.114803
N : Type ?u.114806
inst✝³ : Monoid M
inst✝² : AddMonoid N
G : Type u_1
H : Type ?u.114818
inst✝¹ : Group G
inst✝ : AddGroup H
s : Finset G
t : Finset { x // x ∈ closure ↑s } := Finset.preimage s Subtype.val (_ : Set.InjOn (fun a => ↑a) (Subtype.val ⁻¹' ↑s))
ht : closure ↑t = ⊤
⊢ Group.rank { x // x ∈ closure ↑s } ≤ Finset.card s

tactic: suffices H : Set.InjOn Subtype.val (t : Set (closure (s : Set G)))
state_before: M : Type ?u.114803
N : Type ?u.114806
inst✝³ : Monoid M
inst✝² : AddMonoid N
G : Type u_1
H : Type ?u.114818
inst✝¹ : Group G
inst✝ : AddGroup H
s : Finset G
t : Finset { x // x ∈ closure ↑s } := Finset.preimage s Subtype.val (_ : Set.InjOn (fun a => ↑a) (Subtype.val ⁻¹' ↑s))
ht : closure ↑t = ⊤
⊢ Finset.card t ≤ Finset.card s

tactic: rw [← Finset.card_image_of_injOn H, Finset.image_preimage]
state_before: M : Type ?u.114803
N : Type ?u.114806
inst✝³ : Monoid M
inst✝² : AddMonoid N
G : Type u_1
H✝ : Type ?u.114818
inst✝¹ : Group G
inst✝ : AddGroup H✝
s : Finset G
t : Finset { x // x ∈ closure ↑s } := Finset.preimage s Subtype.val (_ : Set.InjOn (fun a => ↑a) (Subtype.val ⁻¹' ↑s))
ht : closure ↑t = ⊤
H : Set.InjOn Subtype.val ↑t
⊢ Finset.card t ≤ Finset.card s

case H
M : Type ?u.114803
N : Type ?u.114806
inst✝³ : Monoid M
inst✝² : AddMonoid N
G : Type u_1
H : Type ?u.114818
inst✝¹ : Group G
inst✝ : AddGroup H
s : Finset G
t : Finset { x // x ∈ closure ↑s } := Finset.preimage s Subtype.val (_ : Set.InjOn (fun a => ↑a) (Subtype.val ⁻¹' ↑s))
ht : closure ↑t = ⊤
⊢ Set.InjOn Subtype.val ↑t

tactic: rw [Finset.coe_preimage]
state_before: M : Type ?u.114803
N : Type ?u.114806
inst✝³ : Monoid M
inst✝² : AddMonoid N
G : Type u_1
H : Type ?u.114818
inst✝¹ : Group G
inst✝ : AddGroup H
s : Finset G
t : Finset { x // x ∈ closure ↑s } := Finset.preimage s Subtype.val (_ : Set.InjOn (fun a => ↑a) (Subtype.val ⁻¹' ↑s))
⊢ closure ↑t = ⊤

tactic: exact closure_preimage_eq_top (s : Set G)
state_before: M : Type ?u.114803
N : Type ?u.114806
inst✝³ : Monoid M
inst✝² : AddMonoid N
G : Type u_1
H : Type ?u.114818
inst✝¹ : Group G
inst✝ : AddGroup H
s : Finset G
t : Finset { x // x ∈ closure ↑s } := Finset.preimage s Subtype.val (_ : Set.InjOn (fun a => ↑a) (Subtype.val ⁻¹' ↑s))
⊢ closure (Subtype.val ⁻¹' ↑s) = ⊤

tactic: apply Finset.card_filter_le
state_before: M : Type ?u.114803
N : Type ?u.114806
inst✝³ : Monoid M
inst✝² : AddMonoid N
G : Type u_1
H✝ : Type ?u.114818
inst✝¹ : Group G
inst✝ : AddGroup H✝
s : Finset G
t : Finset { x // x ∈ closure ↑s } := Finset.preimage s Subtype.val (_ : Set.InjOn (fun a => ↑a) (Subtype.val ⁻¹' ↑s))
ht : closure ↑t = ⊤
H : Set.InjOn Subtype.val ↑t
⊢ Finset.card (Finset.filter (fun x => x ∈ Set.range Subtype.val) s) ≤ Finset.card s

tactic: apply Subtype.coe_injective.injOn
state_before: case H
M : Type ?u.114803
N : Type ?u.114806
inst✝³ : Monoid M
inst✝² : AddMonoid N
G : Type u_1
H : Type ?u.114818
inst✝¹ : Group G
inst✝ : AddGroup H
s : Finset G
t : Finset { x // x ∈ closure ↑s } := Finset.preimage s Subtype.val (_ : Set.InjOn (fun a => ↑a) (Subtype.val ⁻¹' ↑s))
ht : closure ↑t = ⊤
⊢ Set.InjOn Subtype.val ↑t