l3lab/ntp-mathlib huggingface dataset:
/-- The cardinality of the complex numbers, as a set. -/
-- @[simp] -- Porting note: simp can prove this
theorem mk_univ_complex : #(Set.univ : Set ℂ) = 𝔠 := by 

Proof state:
⊢ #↑Set.univ = 𝔠

Next tactic:
rw [mk_univ, mk_complex]
/-- The complex numbers are not countable. -/
theorem not_countable_complex : ¬(Set.univ : Set ℂ).Countable := by
  

Proof state:
⊢ ¬Set.Countable Set.univ

Next tactic:
rw [← le_aleph0_iff_set_countable, not_le, mk_univ_complex]
/-- The complex numbers are not countable. -/
theorem not_countable_complex : ¬(Set.univ : Set ℂ).Countable := by
  rw [← le_aleph0_iff_set_countable, not_le, mk_univ_complex]
  

Proof state:
⊢ ℵ₀ < 𝔠

Next tactic:
apply cantor
@[to_additive]
theorem MulSalemSpencer.image [MulHomClass F α β] (f : F) (hf : (s * s).InjOn f)
    (h : MulSalemSpencer s) : MulSalemSpencer (f '' s) := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
𝕜 : Type u_4
E : Type u_5
inst✝² : CommMonoid α
inst✝¹ : CommMonoid β
s : Set α
a : α
inst✝ : MulHomClass F α β
f : F
hf : InjOn (⇑f) (s * s)
h : MulSalemSpencer s
⊢ MulSalemSpencer (⇑f '' s)

Next tactic:
rintro _ _ _ ⟨a, ha, rfl⟩ ⟨b, hb, rfl⟩ ⟨c, hc, rfl⟩ habc
@[to_additive]
theorem MulSalemSpencer.image [MulHomClass F α β] (f : F) (hf : (s * s).InjOn f)
    (h : MulSalemSpencer s) : MulSalemSpencer (f '' s) := by
  rintro _ _ _ ⟨a, ha, rfl⟩ ⟨b, hb, rfl⟩ ⟨c, hc, rfl⟩ habc
  

Proof state:
case intro.intro.intro.intro.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
𝕜 : Type u_4
E : Type u_5
inst✝² : CommMonoid α
inst✝¹ : CommMonoid β
s : Set α
a✝ : α
inst✝ : MulHomClass F α β
f : F
hf : InjOn (⇑f) (s * s)
h : MulSalemSpencer s
a : α
ha : a ∈ s
b : α
hb : b ∈ s
c : α
hc : c ∈ s
habc : f a * f b = f c * f c
⊢ f a = f b

Next tactic:
rw [h ha hb hc (hf (mul_mem_mul ha hb) (mul_mem_mul hc hc) <| by rwa [map_mul, map_mul])]
@[to_additive]
theorem MulSalemSpencer.image [MulHomClass F α β] (f : F) (hf : (s * s).InjOn f)
    (h : MulSalemSpencer s) : MulSalemSpencer (f '' s) := by
  rintro _ _ _ ⟨a, ha, rfl⟩ ⟨b, hb, rfl⟩ ⟨c, hc, rfl⟩ habc
  rw [h ha hb hc (hf (mul_mem_mul ha hb) (mul_mem_mul hc hc) <| by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
𝕜 : Type u_4
E : Type u_5
inst✝² : CommMonoid α
inst✝¹ : CommMonoid β
s : Set α
a✝ : α
inst✝ : MulHomClass F α β
f : F
hf : InjOn (⇑f) (s * s)
h : MulSalemSpencer s
a : α
ha : a ∈ s
b : α
hb : b ∈ s
c : α
hc : c ∈ s
habc : f a * f b = f c * f c
⊢ f (a * b) = f (c * c)

Next tactic:
rwa [map_mul, map_mul]
@[to_additive]
theorem mulSalemSpencer_insert : MulSalemSpencer (insert a s) ↔ MulSalemSpencer s ∧
    (∀ ⦃b c⦄, b ∈ s → c ∈ s → a * b = c * c → a = b) ∧
    ∀ ⦃b c⦄, b ∈ s → c ∈ s → b * c = a * a → b = c := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
𝕜 : Type u_4
E : Type u_5
inst✝ : CancelCommMonoid α
s : Set α
a : α
⊢ MulSalemSpencer (insert a s) ↔
    MulSalemSpencer s ∧
      (∀ ⦃b c : α⦄, b ∈ s → c ∈ s → a * b = c * c → a = b) ∧ ∀ ⦃b c : α⦄, b ∈ s → c ∈ s → b * c = a * a → b = c

Next tactic:
refine' ⟨fun hs => ⟨hs.mono (subset_insert _ _),
    fun b c hb hc => hs (Or.inl rfl) (Or.inr hb) (Or.inr hc),
    fun b c hb hc => hs (Or.inr hb) (Or.inr hc) (Or.inl rfl)⟩, _⟩
@[to_additive]
theorem mulSalemSpencer_insert : MulSalemSpencer (insert a s) ↔ MulSalemSpencer s ∧
    (∀ ⦃b c⦄, b ∈ s → c ∈ s → a * b = c * c → a = b) ∧
    ∀ ⦃b c⦄, b ∈ s → c ∈ s → b * c = a * a → b = c := by
  refine' ⟨fun hs => ⟨hs.mono (subset_insert _ _),
    fun b c hb hc => hs (Or.inl rfl) (Or.inr hb) (Or.inr hc),
    fun b c hb hc => hs (Or.inr hb) (Or.inr hc) (Or.inl rfl)⟩, _⟩
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
𝕜 : Type u_4
E : Type u_5
inst✝ : CancelCommMonoid α
s : Set α
a : α
⊢ (MulSalemSpencer s ∧
      (∀ ⦃b c : α⦄, b ∈ s → c ∈ s → a * b = c * c → a = b) ∧ ∀ ⦃b c : α⦄, b ∈ s → c ∈ s → b * c = a * a → b = c) →
    MulSalemSpencer (insert a s)

Next tactic:
rintro ⟨hs, ha, ha'⟩ b c d hb hc hd h
@[to_additive]
theorem mulSalemSpencer_insert : MulSalemSpencer (insert a s) ↔ MulSalemSpencer s ∧
    (∀ ⦃b c⦄, b ∈ s → c ∈ s → a * b = c * c → a = b) ∧
    ∀ ⦃b c⦄, b ∈ s → c ∈ s → b * c = a * a → b = c := by
  refine' ⟨fun hs => ⟨hs.mono (subset_insert _ _),
    fun b c hb hc => hs (Or.inl rfl) (Or.inr hb) (Or.inr hc),
    fun b c hb hc => hs (Or.inr hb) (Or.inr hc) (Or.inl rfl)⟩, _⟩
  rintro ⟨hs, ha, ha'⟩ b c d hb hc hd h
  

Proof state:
case intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
𝕜 : Type u_4
E : Type u_5
inst✝ : CancelCommMonoid α
s : Set α
a : α
hs : MulSalemSpencer s
ha : ∀ ⦃b c : α⦄, b ∈ s → c ∈ s → a * b = c * c → a = b
ha' : ∀ ⦃b c : α⦄, b ∈ s → c ∈ s → b * c = a * a → b = c
b c d : α
hb : b ∈ insert a s
hc : c ∈ insert a s
hd : d ∈ insert a s
h : b * c = d * d
⊢ b = c

Next tactic:
rw [mem_insert_iff] at hb hc hd
@[to_additive]
theorem mulSalemSpencer_insert : MulSalemSpencer (insert a s) ↔ MulSalemSpencer s ∧
    (∀ ⦃b c⦄, b ∈ s → c ∈ s → a * b = c * c → a = b) ∧
    ∀ ⦃b c⦄, b ∈ s → c ∈ s → b * c = a * a → b = c := by
  refine' ⟨fun hs => ⟨hs.mono (subset_insert _ _),
    fun b c hb hc => hs (Or.inl rfl) (Or.inr hb) (Or.inr hc),
    fun b c hb hc => hs (Or.inr hb) (Or.inr hc) (Or.inl rfl)⟩, _⟩
  rintro ⟨hs, ha, ha'⟩ b c d hb hc hd h
  rw [mem_insert_iff] at hb hc hd
  

Proof state:
case intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
𝕜 : Type u_4
E : Type u_5
inst✝ : CancelCommMonoid α
s : Set α
a : α
hs : MulSalemSpencer s
ha : ∀ ⦃b c : α⦄, b ∈ s → c ∈ s → a * b = c * c → a = b
ha' : ∀ ⦃b c : α⦄, b ∈ s → c ∈ s → b * c = a * a → b = c
b c d : α
hb : b = a ∨ b ∈ s
hc : c = a ∨ c ∈ s
hd : d = a ∨ d ∈ s
h : b * c = d * d
⊢ b = c

Next tactic:
obtain rfl | hb := hb
@[to_additive]
theorem mulSalemSpencer_insert : MulSalemSpencer (insert a s) ↔ MulSalemSpencer s ∧
    (∀ ⦃b c⦄, b ∈ s → c ∈ s → a * b = c * c → a = b) ∧
    ∀ ⦃b c⦄, b ∈ s → c ∈ s → b * c = a * a → b = c := by
  refine' ⟨fun hs => ⟨hs.mono (subset_insert _ _),
    fun b c hb hc => hs (Or.inl rfl) (Or.inr hb) (Or.inr hc),
    fun b c hb hc => hs (Or.inr hb) (Or.inr hc) (Or.inl rfl)⟩, _⟩
  rintro ⟨hs, ha, ha'⟩ b c d hb hc hd h
  rw [mem_insert_iff] at hb hc hd
  obtain rfl | hb := hb <;> 

Proof state:
case intro.intro.inl
F : Type u_1
α : Type u_2
β : Type u_3
𝕜 : Type u_4
E : Type u_5
inst✝ : CancelCommMonoid α
s : Set α
hs : MulSalemSpencer s
b c d : α
h : b * c = d * d
ha : ∀ ⦃b_1 c : α⦄, b_1 ∈ s → c ∈ s → b * b_1 = c * c → b = b_1
ha' : ∀ ⦃b_1 c : α⦄, b_1 ∈ s → c ∈ s → b_1 * c = b * b → b_1 = c
hc : c = b ∨ c ∈ s
hd : d = b ∨ d ∈ s
⊢ b = c

Next tactic:
obtain rfl | hc := hc
@[to_additive]
theorem mulSalemSpencer_insert : MulSalemSpencer (insert a s) ↔ MulSalemSpencer s ∧
    (∀ ⦃b c⦄, b ∈ s → c ∈ s → a * b = c * c → a = b) ∧
    ∀ ⦃b c⦄, b ∈ s → c ∈ s → b * c = a * a → b = c := by
  refine' ⟨fun hs => ⟨hs.mono (subset_insert _ _),
    fun b c hb hc => hs (Or.inl rfl) (Or.inr hb) (Or.inr hc),
    fun b c hb hc => hs (Or.inr hb) (Or.inr hc) (Or.inl rfl)⟩, _⟩
  rintro ⟨hs, ha, ha'⟩ b c d hb hc hd h
  rw [mem_insert_iff] at hb hc hd
  obtain rfl | hb := hb <;> 

Proof state:
case intro.intro.inr
F : Type u_1
α : Type u_2
β : Type u_3
𝕜 : Type u_4
E : Type u_5
inst✝ : CancelCommMonoid α
s : Set α
a : α
hs : MulSalemSpencer s
ha : ∀ ⦃b c : α⦄, b ∈ s → c ∈ s → a * b = c * c → a = b
ha' : ∀ ⦃b c : α⦄, b ∈ s → c ∈ s → b * c = a * a → b = c
b c d : α
hc : c = a ∨ c ∈ s
hd : d = a ∨ d ∈ s
h : b * c = d * d
hb : b ∈ s
⊢ b = c

Next tactic:
obtain rfl | hc := hc
@[to_additive]
theorem mulSalemSpencer_insert : MulSalemSpencer (insert a s) ↔ MulSalemSpencer s ∧
    (∀ ⦃b c⦄, b ∈ s → c ∈ s → a * b = c * c → a = b) ∧
    ∀ ⦃b c⦄, b ∈ s → c ∈ s → b * c = a * a → b = c := by
  refine' ⟨fun hs => ⟨hs.mono (subset_insert _ _),
    fun b c hb hc => hs (Or.inl rfl) (Or.inr hb) (Or.inr hc),
    fun b c hb hc => hs (Or.inr hb) (Or.inr hc) (Or.inl rfl)⟩, _⟩
  rintro ⟨hs, ha, ha'⟩ b c d hb hc hd h
  rw [mem_insert_iff] at hb hc hd
  obtain rfl | hb := hb <;> obtain rfl | hc := hc
  · 

Proof state:
case intro.intro.inl.inl
F : Type u_1
α : Type u_2
β : Type u_3
𝕜 : Type u_4
E : Type u_5
inst✝ : CancelCommMonoid α
s : Set α
hs : MulSalemSpencer s
c d : α
h : c * c = d * d
ha : ∀ ⦃b c_1 : α⦄, b ∈ s → c_1 ∈ s → c * b = c_1 * c_1 → c = b
ha' : ∀ ⦃b c_1 : α⦄, b ∈ s → c_1 ∈ s → b * c_1 = c * c → b = c_1
hd : d = c ∨ d ∈ s
⊢ c = c

Next tactic:
rfl
@[to_additive]
theorem mulSalemSpencer_insert : MulSalemSpencer (insert a s) ↔ MulSalemSpencer s ∧
    (∀ ⦃b c⦄, b ∈ s → c ∈ s → a * b = c * c → a = b) ∧
    ∀ ⦃b c⦄, b ∈ s → c ∈ s → b * c = a * a → b = c := by
  refine' ⟨fun hs => ⟨hs.mono (subset_insert _ _),
    fun b c hb hc => hs (Or.inl rfl) (Or.inr hb) (Or.inr hc),
    fun b c hb hc => hs (Or.inr hb) (Or.inr hc) (Or.inl rfl)⟩, _⟩
  rintro ⟨hs, ha, ha'⟩ b c d hb hc hd h
  rw [mem_insert_iff] at hb hc hd
  obtain rfl | hb := hb <;> obtain rfl | hc := hc
  · rfl
  

Proof state:
case intro.intro.inl.inr
F : Type u_1
α : Type u_2
β : Type u_3
𝕜 : Type u_4
E : Type u_5
inst✝ : CancelCommMonoid α
s : Set α
hs : MulSalemSpencer s
b c d : α
h : b * c = d * d
ha : ∀ ⦃b_1 c : α⦄, b_1 ∈ s → c ∈ s → b * b_1 = c * c → b = b_1
ha' : ∀ ⦃b_1 c : α⦄, b_1 ∈ s → c ∈ s → b_1 * c = b * b → b_1 = c
hd : d = b ∨ d ∈ s
hc : c ∈ s
⊢ b = c
case intro.intro.inr.inl
F : Type u_1
α : Type u_2
β : Type u_3
𝕜 : Type u_4
E : Type u_5
inst✝ : CancelCommMonoid α
s : Set α
hs : MulSalemSpencer s
b c d : α
h : b * c = d * d
hb : b ∈ s
ha : ∀ ⦃b c_1 : α⦄, b ∈ s → c_1 ∈ s → c * b = c_1 * c_1 → c = b
ha' : ∀ ⦃b c_1 : α⦄, b ∈ s → c_1 ∈ s → b * c_1 = c * c → b = c_1
hd : d = c ∨ d ∈ s
⊢ b = c
case intro.intro.inr.inr
F : Type u_1
α : Type u_2
β : Type u_3
𝕜 : Type u_4
E : Type u_5
inst✝ : CancelCommMonoid α
s : Set α
a : α
hs : MulSalemSpencer s
ha : ∀ ⦃b c : α⦄, b ∈ s → c ∈ s → a * b = c * c → a = b
ha' : ∀ ⦃b c : α⦄, b ∈ s → c ∈ s → b * c = a * a → b = c
b c d : α
hd : d = a ∨ d ∈ s
h : b * c = d * d
hb : b ∈ s
hc : c ∈ s
⊢ b = c

Next tactic:
all_goals obtain rfl | hd := hd
@[to_additive]
theorem mulSalemSpencer_insert : MulSalemSpencer (insert a s) ↔ MulSalemSpencer s ∧
    (∀ ⦃b c⦄, b ∈ s → c ∈ s → a * b = c * c → a = b) ∧
    ∀ ⦃b c⦄, b ∈ s → c ∈ s → b * c = a * a → b = c := by
  refine' ⟨fun hs => ⟨hs.mono (subset_insert _ _),
    fun b c hb hc => hs (Or.inl rfl) (Or.inr hb) (Or.inr hc),
    fun b c hb hc => hs (Or.inr hb) (Or.inr hc) (Or.inl rfl)⟩, _⟩
  rintro ⟨hs, ha, ha'⟩ b c d hb hc hd h
  rw [mem_insert_iff] at hb hc hd
  obtain rfl | hb := hb <;> obtain rfl | hc := hc
  · rfl
  all_goals 

Proof state:
case intro.intro.inl.inr
F : Type u_1
α : Type u_2
β : Type u_3
𝕜 : Type u_4
E : Type u_5
inst✝ : CancelCommMonoid α
s : Set α
hs : MulSalemSpencer s
b c d : α
h : b * c = d * d
ha : ∀ ⦃b_1 c : α⦄, b_1 ∈ s → c ∈ s → b * b_1 = c * c → b = b_1
ha' : ∀ ⦃b_1 c : α⦄, b_1 ∈ s → c ∈ s → b_1 * c = b * b → b_1 = c
hd : d = b ∨ d ∈ s
hc : c ∈ s
⊢ b = c

Next tactic:
obtain rfl | hd := hd
@[to_additive]
theorem mulSalemSpencer_insert : MulSalemSpencer (insert a s) ↔ MulSalemSpencer s ∧
    (∀ ⦃b c⦄, b ∈ s → c ∈ s → a * b = c * c → a = b) ∧
    ∀ ⦃b c⦄, b ∈ s → c ∈ s → b * c = a * a → b = c := by
  refine' ⟨fun hs => ⟨hs.mono (subset_insert _ _),
    fun b c hb hc => hs (Or.inl rfl) (Or.inr hb) (Or.inr hc),
    fun b c hb hc => hs (Or.inr hb) (Or.inr hc) (Or.inl rfl)⟩, _⟩
  rintro ⟨hs, ha, ha'⟩ b c d hb hc hd h
  rw [mem_insert_iff] at hb hc hd
  obtain rfl | hb := hb <;> obtain rfl | hc := hc
  · rfl
  all_goals 

Proof state:
case intro.intro.inr.inl
F : Type u_1
α : Type u_2
β : Type u_3
𝕜 : Type u_4
E : Type u_5
inst✝ : CancelCommMonoid α
s : Set α
hs : MulSalemSpencer s
b c d : α
h : b * c = d * d
hb : b ∈ s
ha : ∀ ⦃b c_1 : α⦄, b ∈ s → c_1 ∈ s → c * b = c_1 * c_1 → c = b
ha' : ∀ ⦃b c_1 : α⦄, b ∈ s → c_1 ∈ s → b * c_1 = c * c → b = c_1
hd : d = c ∨ d ∈ s
⊢ b = c

Next tactic:
obtain rfl | hd := hd
@[to_additive]
theorem mulSalemSpencer_insert : MulSalemSpencer (insert a s) ↔ MulSalemSpencer s ∧
    (∀ ⦃b c⦄, b ∈ s → c ∈ s → a * b = c * c → a = b) ∧
    ∀ ⦃b c⦄, b ∈ s → c ∈ s → b * c = a * a → b = c := by
  refine' ⟨fun hs => ⟨hs.mono (subset_insert _ _),
    fun b c hb hc => hs (Or.inl rfl) (Or.inr hb) (Or.inr hc),
    fun b c hb hc => hs (Or.inr hb) (Or.inr hc) (Or.inl rfl)⟩, _⟩
  rintro ⟨hs, ha, ha'⟩ b c d hb hc hd h
  rw [mem_insert_iff] at hb hc hd
  obtain rfl | hb := hb <;> obtain rfl | hc := hc
  · rfl
  all_goals 

Proof state:
case intro.intro.inr.inr
F : Type u_1
α : Type u_2
β : Type u_3
𝕜 : Type u_4
E : Type u_5
inst✝ : CancelCommMonoid α
s : Set α
a : α
hs : MulSalemSpencer s
ha : ∀ ⦃b c : α⦄, b ∈ s → c ∈ s → a * b = c * c → a = b
ha' : ∀ ⦃b c : α⦄, b ∈ s → c ∈ s → b * c = a * a → b = c
b c d : α
hd : d = a ∨ d ∈ s
h : b * c = d * d
hb : b ∈ s
hc : c ∈ s
⊢ b = c

Next tactic:
obtain rfl | hd := hd
@[to_additive]
theorem mulSalemSpencer_insert : MulSalemSpencer (insert a s) ↔ MulSalemSpencer s ∧
    (∀ ⦃b c⦄, b ∈ s → c ∈ s → a * b = c * c → a = b) ∧
    ∀ ⦃b c⦄, b ∈ s → c ∈ s → b * c = a * a → b = c := by
  refine' ⟨fun hs => ⟨hs.mono (subset_insert _ _),
    fun b c hb hc => hs (Or.inl rfl) (Or.inr hb) (Or.inr hc),
    fun b c hb hc => hs (Or.inr hb) (Or.inr hc) (Or.inl rfl)⟩, _⟩
  rintro ⟨hs, ha, ha'⟩ b c d hb hc hd h
  rw [mem_insert_iff] at hb hc hd
  obtain rfl | hb := hb <;> obtain rfl | hc := hc
  · rfl
  all_goals obtain rfl | hd := hd
  · 

Proof state:
case intro.intro.inl.inr.inl
F : Type u_1
α : Type u_2
β : Type u_3
𝕜 : Type u_4
E : Type u_5
inst✝ : CancelCommMonoid α
s : Set α
hs : MulSalemSpencer s
c d : α
hc : c ∈ s
h : d * c = d * d
ha : ∀ ⦃b c : α⦄, b ∈ s → c ∈ s → d * b = c * c → d = b
ha' : ∀ ⦃b c : α⦄, b ∈ s → c ∈ s → b * c = d * d → b = c
⊢ d = c

Next tactic:
exact (mul_left_cancel h).symm
@[to_additive]
theorem mulSalemSpencer_insert : MulSalemSpencer (insert a s) ↔ MulSalemSpencer s ∧
    (∀ ⦃b c⦄, b ∈ s → c ∈ s → a * b = c * c → a = b) ∧
    ∀ ⦃b c⦄, b ∈ s → c ∈ s → b * c = a * a → b = c := by
  refine' ⟨fun hs => ⟨hs.mono (subset_insert _ _),
    fun b c hb hc => hs (Or.inl rfl) (Or.inr hb) (Or.inr hc),
    fun b c hb hc => hs (Or.inr hb) (Or.inr hc) (Or.inl rfl)⟩, _⟩
  rintro ⟨hs, ha, ha'⟩ b c d hb hc hd h
  rw [mem_insert_iff] at hb hc hd
  obtain rfl | hb := hb <;> obtain rfl | hc := hc
  · rfl
  all_goals obtain rfl | hd := hd
  · exact (mul_left_cancel h).symm
  · 

Proof state:
case intro.intro.inl.inr.inr
F : Type u_1
α : Type u_2
β : Type u_3
𝕜 : Type u_4
E : Type u_5
inst✝ : CancelCommMonoid α
s : Set α
hs : MulSalemSpencer s
b c d : α
h : b * c = d * d
ha : ∀ ⦃b_1 c : α⦄, b_1 ∈ s → c ∈ s → b * b_1 = c * c → b = b_1
ha' : ∀ ⦃b_1 c : α⦄, b_1 ∈ s → c ∈ s → b_1 * c = b * b → b_1 = c
hc : c ∈ s
hd : d ∈ s
⊢ b = c

Next tactic:
exact ha hc hd h
@[to_additive]
theorem mulSalemSpencer_insert : MulSalemSpencer (insert a s) ↔ MulSalemSpencer s ∧
    (∀ ⦃b c⦄, b ∈ s → c ∈ s → a * b = c * c → a = b) ∧
    ∀ ⦃b c⦄, b ∈ s → c ∈ s → b * c = a * a → b = c := by
  refine' ⟨fun hs => ⟨hs.mono (subset_insert _ _),
    fun b c hb hc => hs (Or.inl rfl) (Or.inr hb) (Or.inr hc),
    fun b c hb hc => hs (Or.inr hb) (Or.inr hc) (Or.inl rfl)⟩, _⟩
  rintro ⟨hs, ha, ha'⟩ b c d hb hc hd h
  rw [mem_insert_iff] at hb hc hd
  obtain rfl | hb := hb <;> obtain rfl | hc := hc
  · rfl
  all_goals obtain rfl | hd := hd
  · exact (mul_left_cancel h).symm
  · exact ha hc hd h
  · 

Proof state:
case intro.intro.inr.inl.inl
F : Type u_1
α : Type u_2
β : Type u_3
𝕜 : Type u_4
E : Type u_5
inst✝ : CancelCommMonoid α
s : Set α
hs : MulSalemSpencer s
b d : α
hb : b ∈ s
h : b * d = d * d
ha : ∀ ⦃b c : α⦄, b ∈ s → c ∈ s → d * b = c * c → d = b
ha' : ∀ ⦃b c : α⦄, b ∈ s → c ∈ s → b * c = d * d → b = c
⊢ b = d

Next tactic:
exact mul_right_cancel h
@[to_additive]
theorem mulSalemSpencer_insert : MulSalemSpencer (insert a s) ↔ MulSalemSpencer s ∧
    (∀ ⦃b c⦄, b ∈ s → c ∈ s → a * b = c * c → a = b) ∧
    ∀ ⦃b c⦄, b ∈ s → c ∈ s → b * c = a * a → b = c := by
  refine' ⟨fun hs => ⟨hs.mono (subset_insert _ _),
    fun b c hb hc => hs (Or.inl rfl) (Or.inr hb) (Or.inr hc),
    fun b c hb hc => hs (Or.inr hb) (Or.inr hc) (Or.inl rfl)⟩, _⟩
  rintro ⟨hs, ha, ha'⟩ b c d hb hc hd h
  rw [mem_insert_iff] at hb hc hd
  obtain rfl | hb := hb <;> obtain rfl | hc := hc
  · rfl
  all_goals obtain rfl | hd := hd
  · exact (mul_left_cancel h).symm
  · exact ha hc hd h
  · exact mul_right_cancel h
  · 

Proof state:
case intro.intro.inr.inl.inr
F : Type u_1
α : Type u_2
β : Type u_3
𝕜 : Type u_4
E : Type u_5
inst✝ : CancelCommMonoid α
s : Set α
hs : MulSalemSpencer s
b c d : α
h : b * c = d * d
hb : b ∈ s
ha : ∀ ⦃b c_1 : α⦄, b ∈ s → c_1 ∈ s → c * b = c_1 * c_1 → c = b
ha' : ∀ ⦃b c_1 : α⦄, b ∈ s → c_1 ∈ s → b * c_1 = c * c → b = c_1
hd : d ∈ s
⊢ b = c

Next tactic:
exact (ha hb hd <| (mul_comm _ _).trans h).symm
@[to_additive]
theorem mulSalemSpencer_insert : MulSalemSpencer (insert a s) ↔ MulSalemSpencer s ∧
    (∀ ⦃b c⦄, b ∈ s → c ∈ s → a * b = c * c → a = b) ∧
    ∀ ⦃b c⦄, b ∈ s → c ∈ s → b * c = a * a → b = c := by
  refine' ⟨fun hs => ⟨hs.mono (subset_insert _ _),
    fun b c hb hc => hs (Or.inl rfl) (Or.inr hb) (Or.inr hc),
    fun b c hb hc => hs (Or.inr hb) (Or.inr hc) (Or.inl rfl)⟩, _⟩
  rintro ⟨hs, ha, ha'⟩ b c d hb hc hd h
  rw [mem_insert_iff] at hb hc hd
  obtain rfl | hb := hb <;> obtain rfl | hc := hc
  · rfl
  all_goals obtain rfl | hd := hd
  · exact (mul_left_cancel h).symm
  · exact ha hc hd h
  · exact mul_right_cancel h
  · exact (ha hb hd <| (mul_comm _ _).trans h).symm
  · 

Proof state:
case intro.intro.inr.inr.inl
F : Type u_1
α : Type u_2
β : Type u_3
𝕜 : Type u_4
E : Type u_5
inst✝ : CancelCommMonoid α
s : Set α
hs : MulSalemSpencer s
b c d : α
h : b * c = d * d
hb : b ∈ s
hc : c ∈ s
ha : ∀ ⦃b c : α⦄, b ∈ s → c ∈ s → d * b = c * c → d = b
ha' : ∀ ⦃b c : α⦄, b ∈ s → c ∈ s → b * c = d * d → b = c
⊢ b = c

Next tactic:
exact ha' hb hc h
@[to_additive]
theorem mulSalemSpencer_insert : MulSalemSpencer (insert a s) ↔ MulSalemSpencer s ∧
    (∀ ⦃b c⦄, b ∈ s → c ∈ s → a * b = c * c → a = b) ∧
    ∀ ⦃b c⦄, b ∈ s → c ∈ s → b * c = a * a → b = c := by
  refine' ⟨fun hs => ⟨hs.mono (subset_insert _ _),
    fun b c hb hc => hs (Or.inl rfl) (Or.inr hb) (Or.inr hc),
    fun b c hb hc => hs (Or.inr hb) (Or.inr hc) (Or.inl rfl)⟩, _⟩
  rintro ⟨hs, ha, ha'⟩ b c d hb hc hd h
  rw [mem_insert_iff] at hb hc hd
  obtain rfl | hb := hb <;> obtain rfl | hc := hc
  · rfl
  all_goals obtain rfl | hd := hd
  · exact (mul_left_cancel h).symm
  · exact ha hc hd h
  · exact mul_right_cancel h
  · exact (ha hb hd <| (mul_comm _ _).trans h).symm
  · exact ha' hb hc h
  · 

Proof state:
case intro.intro.inr.inr.inr
F : Type u_1
α : Type u_2
β : Type u_3
𝕜 : Type u_4
E : Type u_5
inst✝ : CancelCommMonoid α
s : Set α
a : α
hs : MulSalemSpencer s
ha : ∀ ⦃b c : α⦄, b ∈ s → c ∈ s → a * b = c * c → a = b
ha' : ∀ ⦃b c : α⦄, b ∈ s → c ∈ s → b * c = a * a → b = c
b c d : α
h : b * c = d * d
hb : b ∈ s
hc : c ∈ s
hd : d ∈ s
⊢ b = c

Next tactic:
exact hs hb hc hd h
@[to_additive (attr := simp)]
theorem mulSalemSpencer_pair (a b : α) : MulSalemSpencer ({a, b} : Set α) := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
𝕜 : Type u_4
E : Type u_5
inst✝ : CancelCommMonoid α
s : Set α
a✝ a b : α
⊢ MulSalemSpencer {a, b}

Next tactic:
rw [mulSalemSpencer_insert]
@[to_additive (attr := simp)]
theorem mulSalemSpencer_pair (a b : α) : MulSalemSpencer ({a, b} : Set α) := by
  rw [mulSalemSpencer_insert]
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
𝕜 : Type u_4
E : Type u_5
inst✝ : CancelCommMonoid α
s : Set α
a✝ a b : α
⊢ MulSalemSpencer {b} ∧
    (∀ ⦃b_1 c : α⦄, b_1 ∈ {b} → c ∈ {b} → a * b_1 = c * c → a = b_1) ∧
      ∀ ⦃b_1 c : α⦄, b_1 ∈ {b} → c ∈ {b} → b_1 * c = a * a → b_1 = c

Next tactic:
refine' ⟨mulSalemSpencer_singleton _, _, _⟩
@[to_additive (attr := simp)]
theorem mulSalemSpencer_pair (a b : α) : MulSalemSpencer ({a, b} : Set α) := by
  rw [mulSalemSpencer_insert]
  refine' ⟨mulSalemSpencer_singleton _, _, _⟩
  · 

Proof state:
case refine'_1
F : Type u_1
α : Type u_2
β : Type u_3
𝕜 : Type u_4
E : Type u_5
inst✝ : CancelCommMonoid α
s : Set α
a✝ a b : α
⊢ ∀ ⦃b_1 c : α⦄, b_1 ∈ {b} → c ∈ {b} → a * b_1 = c * c → a = b_1

Next tactic:
rintro c d (rfl : c = b) (rfl : d = c)
@[to_additive (attr := simp)]
theorem mulSalemSpencer_pair (a b : α) : MulSalemSpencer ({a, b} : Set α) := by
  rw [mulSalemSpencer_insert]
  refine' ⟨mulSalemSpencer_singleton _, _, _⟩
  · rintro c d (rfl : c = b) (rfl : d = c)
    

Proof state:
case refine'_1
F : Type u_1
α : Type u_2
β : Type u_3
𝕜 : Type u_4
E : Type u_5
inst✝ : CancelCommMonoid α
s : Set α
a✝ a d : α
⊢ a * d = d * d → a = d

Next tactic:
exact mul_right_cancel
@[to_additive (attr := simp)]
theorem mulSalemSpencer_pair (a b : α) : MulSalemSpencer ({a, b} : Set α) := by
  rw [mulSalemSpencer_insert]
  refine' ⟨mulSalemSpencer_singleton _, _, _⟩
  · rintro c d (rfl : c = b) (rfl : d = c)
    exact mul_right_cancel
  · 

Proof state:
case refine'_2
F : Type u_1
α : Type u_2
β : Type u_3
𝕜 : Type u_4
E : Type u_5
inst✝ : CancelCommMonoid α
s : Set α
a✝ a b : α
⊢ ∀ ⦃b_1 c : α⦄, b_1 ∈ {b} → c ∈ {b} → b_1 * c = a * a → b_1 = c

Next tactic:
rintro c d (rfl : c = b) (rfl : d = c) _
@[to_additive (attr := simp)]
theorem mulSalemSpencer_pair (a b : α) : MulSalemSpencer ({a, b} : Set α) := by
  rw [mulSalemSpencer_insert]
  refine' ⟨mulSalemSpencer_singleton _, _, _⟩
  · rintro c d (rfl : c = b) (rfl : d = c)
    exact mul_right_cancel
  · rintro c d (rfl : c = b) (rfl : d = c) _
    

Proof state:
case refine'_2
F : Type u_1
α : Type u_2
β : Type u_3
𝕜 : Type u_4
E : Type u_5
inst✝ : CancelCommMonoid α
s : Set α
a✝¹ a d : α
a✝ : d * d = a * a
⊢ d = d

Next tactic:
rfl
@[to_additive]
theorem MulSalemSpencer.mul_left (hs : MulSalemSpencer s) : MulSalemSpencer ((a * ·) '' s) := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
𝕜 : Type u_4
E : Type u_5
inst✝ : CancelCommMonoid α
s : Set α
a : α
hs : MulSalemSpencer s
⊢ MulSalemSpencer ((fun x => a * x) '' s)

Next tactic:
rintro _ _ _ ⟨b, hb, rfl⟩ ⟨c, hc, rfl⟩ ⟨d, hd, rfl⟩ h
@[to_additive]
theorem MulSalemSpencer.mul_left (hs : MulSalemSpencer s) : MulSalemSpencer ((a * ·) '' s) := by
  rintro _ _ _ ⟨b, hb, rfl⟩ ⟨c, hc, rfl⟩ ⟨d, hd, rfl⟩ h
  

Proof state:
case intro.intro.intro.intro.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
𝕜 : Type u_4
E : Type u_5
inst✝ : CancelCommMonoid α
s : Set α
a : α
hs : MulSalemSpencer s
b : α
hb : b ∈ s
c : α
hc : c ∈ s
d : α
hd : d ∈ s
h : (fun x => a * x) b * (fun x => a * x) c = (fun x => a * x) d * (fun x => a * x) d
⊢ (fun x => a * x) b = (fun x => a * x) c

Next tactic:
rw [mul_mul_mul_comm, mul_mul_mul_comm a d] at h
@[to_additive]
theorem MulSalemSpencer.mul_left (hs : MulSalemSpencer s) : MulSalemSpencer ((a * ·) '' s) := by
  rintro _ _ _ ⟨b, hb, rfl⟩ ⟨c, hc, rfl⟩ ⟨d, hd, rfl⟩ h
  rw [mul_mul_mul_comm, mul_mul_mul_comm a d] at h
  

Proof state:
case intro.intro.intro.intro.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
𝕜 : Type u_4
E : Type u_5
inst✝ : CancelCommMonoid α
s : Set α
a : α
hs : MulSalemSpencer s
b : α
hb : b ∈ s
c : α
hc : c ∈ s
d : α
hd : d ∈ s
h : a * a * (b * c) = a * a * (d * d)
⊢ (fun x => a * x) b = (fun x => a * x) c

Next tactic:
rw [hs hb hc hd (mul_left_cancel h)]
@[to_additive]
theorem MulSalemSpencer.mul_right (hs : MulSalemSpencer s) : MulSalemSpencer ((· * a) '' s) := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
𝕜 : Type u_4
E : Type u_5
inst✝ : CancelCommMonoid α
s : Set α
a : α
hs : MulSalemSpencer s
⊢ MulSalemSpencer ((fun x => x * a) '' s)

Next tactic:
rintro _ _ _ ⟨b, hb, rfl⟩ ⟨c, hc, rfl⟩ ⟨d, hd, rfl⟩ h
@[to_additive]
theorem MulSalemSpencer.mul_right (hs : MulSalemSpencer s) : MulSalemSpencer ((· * a) '' s) := by
  rintro _ _ _ ⟨b, hb, rfl⟩ ⟨c, hc, rfl⟩ ⟨d, hd, rfl⟩ h
  

Proof state:
case intro.intro.intro.intro.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
𝕜 : Type u_4
E : Type u_5
inst✝ : CancelCommMonoid α
s : Set α
a : α
hs : MulSalemSpencer s
b : α
hb : b ∈ s
c : α
hc : c ∈ s
d : α
hd : d ∈ s
h : (fun x => x * a) b * (fun x => x * a) c = (fun x => x * a) d * (fun x => x * a) d
⊢ (fun x => x * a) b = (fun x => x * a) c

Next tactic:
rw [mul_mul_mul_comm, mul_mul_mul_comm d] at h