Theorem: exists_idempotent_in_compact_subsemigroup
File: Mathlib/Topology/Algebra/Semigroup.lean

tactic: let M' := { m // m ∈ s }
state_before: M : Type u_1
inst✝² : Semigroup M
inst✝¹ : TopologicalSpace M
inst✝ : T2Space M
continuous_mul_left : ∀ (r : M), Continuous fun x => x * r
s : Set M
snemp : s.Nonempty
s_compact : IsCompact s
s_add : ∀ x ∈ s, ∀ y ∈ s, x * y ∈ s
⊢ ∃ m ∈ s, m * m = m
state_after: M : Type u_1
inst✝² : Semigroup M
inst✝¹ : TopologicalSpace M
inst✝ : T2Space M
continuous_mul_left : ∀ (r : M), Continuous fun x => x * r
s : Set M
snemp : s.Nonempty
s_compact : IsCompact s
s_add : ∀ x ∈ s, ∀ y ∈ s, x * y ∈ s
M' : Type u_1 := { m // m ∈ s }
⊢ ∃ m ∈ s, m * m = m

tactic: letI : Semigroup M' :=
  { mul := fun p q => ⟨p.1 * q.1, s_add _ p.2 _ q.2⟩
    mul_assoc := fun p q r => Subtype.eq (mul_assoc _ _ _) }
state_before: M : Type u_1
inst✝² : Semigroup M
inst✝¹ : TopologicalSpace M
inst✝ : T2Space M
continuous_mul_left : ∀ (r : M), Continuous fun x => x * r
s : Set M
snemp : s.Nonempty
s_compact : IsCompact s
s_add : ∀ x ∈ s, ∀ y ∈ s, x * y ∈ s
M' : Type u_1 := { m // m ∈ s }
⊢ ∃ m ∈ s, m * m = m
state_after: M : Type u_1
inst✝² : Semigroup M
inst✝¹ : TopologicalSpace M
inst✝ : T2Space M
continuous_mul_left : ∀ (r : M), Continuous fun x => x * r
s : Set M
snemp : s.Nonempty
s_compact : IsCompact s
s_add : ∀ x ∈ s, ∀ y ∈ s, x * y ∈ s
M' : Type u_1 := { m // m ∈ s }
this : Semigroup M' := Semigroup.mk ⋯
⊢ ∃ m ∈ s, m * m = m

tactic: haveI : CompactSpace M' := isCompact_iff_compactSpace.mp s_compact
state_before: M : Type u_1
inst✝² : Semigroup M
inst✝¹ : TopologicalSpace M
inst✝ : T2Space M
continuous_mul_left : ∀ (r : M), Continuous fun x => x * r
s : Set M
snemp : s.Nonempty
s_compact : IsCompact s
s_add : ∀ x ∈ s, ∀ y ∈ s, x * y ∈ s
M' : Type u_1 := { m // m ∈ s }
this : Semigroup M' := Semigroup.mk ⋯
⊢ ∃ m ∈ s, m * m = m
state_after: M : Type u_1
inst✝² : Semigroup M
inst✝¹ : TopologicalSpace M
inst✝ : T2Space M
continuous_mul_left : ∀ (r : M), Continuous fun x => x * r
s : Set M
snemp : s.Nonempty
s_compact : IsCompact s
s_add : ∀ x ∈ s, ∀ y ∈ s, x * y ∈ s
M' : Type u_1 := { m // m ∈ s }
this✝ : Semigroup M' := Semigroup.mk ⋯
this : CompactSpace M'
⊢ ∃ m ∈ s, m * m = m

tactic: haveI : Nonempty M' := nonempty_subtype.mpr snemp
state_before: M : Type u_1
inst✝² : Semigroup M
inst✝¹ : TopologicalSpace M
inst✝ : T2Space M
continuous_mul_left : ∀ (r : M), Continuous fun x => x * r
s : Set M
snemp : s.Nonempty
s_compact : IsCompact s
s_add : ∀ x ∈ s, ∀ y ∈ s, x * y ∈ s
M' : Type u_1 := { m // m ∈ s }
this✝ : Semigroup M' := Semigroup.mk ⋯
this : CompactSpace M'
⊢ ∃ m ∈ s, m * m = m
state_after: M : Type u_1
inst✝² : Semigroup M
inst✝¹ : TopologicalSpace M
inst✝ : T2Space M
continuous_mul_left : ∀ (r : M), Continuous fun x => x * r
s : Set M
snemp : s.Nonempty
s_compact : IsCompact s
s_add : ∀ x ∈ s, ∀ y ∈ s, x * y ∈ s
M' : Type u_1 := { m // m ∈ s }
this✝¹ : Semigroup M' := Semigroup.mk ⋯
this✝ : CompactSpace M'
this : Nonempty M'
⊢ ∃ m ∈ s, m * m = m

tactic: obtain ⟨⟨m, hm⟩, idem⟩ := exists_idempotent_of_compact_t2_of_continuous_mul_left this
state_before: M : Type u_1
inst✝² : Semigroup M
inst✝¹ : TopologicalSpace M
inst✝ : T2Space M
continuous_mul_left : ∀ (r : M), Continuous fun x => x * r
s : Set M
snemp : s.Nonempty
s_compact : IsCompact s
s_add : ∀ x ∈ s, ∀ y ∈ s, x * y ∈ s
M' : Type u_1 := { m // m ∈ s }
this✝² : Semigroup M' := Semigroup.mk ⋯
this✝¹ : CompactSpace M'
this✝ : Nonempty M'
this : ∀ (p : M'), Continuous fun x => x * p
⊢ ∃ m ∈ s, m * m = m
state_after: case intro.mk
M : Type u_1
inst✝² : Semigroup M
inst✝¹ : TopologicalSpace M
inst✝ : T2Space M
continuous_mul_left : ∀ (r : M), Continuous fun x => x * r
s : Set M
snemp : s.Nonempty
s_compact : IsCompact s
s_add : ∀ x ∈ s, ∀ y ∈ s, x * y ∈ s
M' : Type u_1 := { m // m ∈ s }
this✝² : Semigroup M' := Semigroup.mk ⋯
this✝¹ : CompactSpace M'
this✝ : Nonempty M'
this : ∀ (p : M'), Continuous fun x => x * p
m : M
hm : m ∈ s
idem : ⟨m, hm⟩ * ⟨m, hm⟩ = ⟨m, hm⟩
⊢ ∃ m ∈ s, m * m = m

tactic: exact ⟨m, hm, Subtype.ext_iff.mp idem⟩
state_before: case intro.mk
M : Type u_1
inst✝² : Semigroup M
inst✝¹ : TopologicalSpace M
inst✝ : T2Space M
continuous_mul_left : ∀ (r : M), Continuous fun x => x * r
s : Set M
snemp : s.Nonempty
s_compact : IsCompact s
s_add : ∀ x ∈ s, ∀ y ∈ s, x * y ∈ s
M' : Type u_1 := { m // m ∈ s }
this✝² : Semigroup M' := Semigroup.mk ⋯
this✝¹ : CompactSpace M'
this✝ : Nonempty M'
this : ∀ (p : M'), Continuous fun x => x * p
m : M
hm : m ∈ s
idem : ⟨m, hm⟩ * ⟨m, hm⟩ = ⟨m, hm⟩
⊢ ∃ m ∈ s, m * m = m
state_after: no goals