l3lab/ntp-mathlib huggingface dataset:
theorem Nonempty.smul_zero (hs : s.Nonempty) : s • (0 : Finset β) = 0 :=
  s.smul_zero_subset.antisymm <| by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝³ : Zero α
inst✝² : Zero β
inst✝¹ : SMulWithZero α β
inst✝ : DecidableEq β
s : Finset α
t : Finset β
hs : Finset.Nonempty s
⊢ 0 ⊆ s • 0

Next tactic:
simpa [mem_smul] using hs
theorem Nonempty.zero_smul (ht : t.Nonempty) : (0 : Finset α) • t = 0 :=
  t.zero_smul_subset.antisymm <| by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝³ : Zero α
inst✝² : Zero β
inst✝¹ : SMulWithZero α β
inst✝ : DecidableEq β
s : Finset α
t : Finset β
ht : Finset.Nonempty t
⊢ 0 ⊆ 0 • t

Next tactic:
simpa [mem_smul] using ht
/-- A nonempty set is scaled by zero to the singleton set containing 0. -/
theorem zero_smul_finset {s : Finset β} (h : s.Nonempty) : (0 : α) • s = (0 : Finset β) :=
  coe_injective <| by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝³ : Zero α
inst✝² : Zero β
inst✝¹ : SMulWithZero α β
inst✝ : DecidableEq β
s✝ : Finset α
t s : Finset β
h : Finset.Nonempty s
⊢ ↑(0 • s) = ↑0

Next tactic:
simpa using @Set.zero_smul_set α _ _ _ _ _ h
theorem zero_mem_smul_iff :
    (0 : β) ∈ s • t ↔ (0 : α) ∈ s ∧ t.Nonempty ∨ (0 : β) ∈ t ∧ s.Nonempty := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝⁴ : Zero α
inst✝³ : Zero β
inst✝² : SMulWithZero α β
inst✝¹ : DecidableEq β
s : Finset α
t : Finset β
inst✝ : NoZeroSMulDivisors α β
a : α
⊢ 0 ∈ s • t ↔ 0 ∈ s ∧ Finset.Nonempty t ∨ 0 ∈ t ∧ Finset.Nonempty s

Next tactic:
rw [← mem_coe, coe_smul, Set.zero_mem_smul_iff]
theorem zero_mem_smul_iff :
    (0 : β) ∈ s • t ↔ (0 : α) ∈ s ∧ t.Nonempty ∨ (0 : β) ∈ t ∧ s.Nonempty := by
  rw [← mem_coe, coe_smul, Set.zero_mem_smul_iff]
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝⁴ : Zero α
inst✝³ : Zero β
inst✝² : SMulWithZero α β
inst✝¹ : DecidableEq β
s : Finset α
t : Finset β
inst✝ : NoZeroSMulDivisors α β
a : α
⊢ 0 ∈ ↑s ∧ Set.Nonempty ↑t ∨ 0 ∈ ↑t ∧ Set.Nonempty ↑s ↔ 0 ∈ s ∧ Finset.Nonempty t ∨ 0 ∈ t ∧ Finset.Nonempty s

Next tactic:
rfl
theorem zero_mem_smul_finset_iff (ha : a ≠ 0) : (0 : β) ∈ a • t ↔ (0 : β) ∈ t := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝⁴ : Zero α
inst✝³ : Zero β
inst✝² : SMulWithZero α β
inst✝¹ : DecidableEq β
s : Finset α
t : Finset β
inst✝ : NoZeroSMulDivisors α β
a : α
ha : a ≠ 0
⊢ 0 ∈ a • t ↔ 0 ∈ t

Next tactic:
rw [← mem_coe, coe_smul_finset, Set.zero_mem_smul_set_iff ha, mem_coe]
@[simp]
theorem smul_finset_neg : a • -t = -(a • t) := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝³ : Monoid α
inst✝² : AddGroup β
inst✝¹ : DistribMulAction α β
inst✝ : DecidableEq β
a : α
s : Finset α
t : Finset β
⊢ a • -t = -(a • t)

Next tactic:
simp only [← image_smul, ← image_neg, Function.comp, image_image, smul_neg]
@[simp]
protected theorem smul_neg : s • -t = -(s • t) := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝³ : Monoid α
inst✝² : AddGroup β
inst✝¹ : DistribMulAction α β
inst✝ : DecidableEq β
a : α
s : Finset α
t : Finset β
⊢ s • -t = -(s • t)

Next tactic:
simp_rw [← image_neg]
@[simp]
protected theorem smul_neg : s • -t = -(s • t) := by
  simp_rw [← image_neg]
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝³ : Monoid α
inst✝² : AddGroup β
inst✝¹ : DistribMulAction α β
inst✝ : DecidableEq β
a : α
s : Finset α
t : Finset β
⊢ s • image (fun x => -x) t = image (fun x => -x) (s • t)

Next tactic:
exact image_image₂_right_comm smul_neg
@[simp]
theorem neg_smul_finset : -a • t = -(a • t) := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝³ : Ring α
inst✝² : AddCommGroup β
inst✝¹ : Module α β
inst✝ : DecidableEq β
s : Finset α
t : Finset β
a : α
⊢ -a • t = -(a • t)

Next tactic:
simp only [← image_smul, ← image_neg, image_image, neg_smul, Function.comp]
@[simp]
protected theorem neg_smul [DecidableEq α] : -s • t = -(s • t) := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝⁴ : Ring α
inst✝³ : AddCommGroup β
inst✝² : Module α β
inst✝¹ : DecidableEq β
s : Finset α
t : Finset β
a : α
inst✝ : DecidableEq α
⊢ -s • t = -(s • t)

Next tactic:
simp_rw [← image_neg]
@[simp]
protected theorem neg_smul [DecidableEq α] : -s • t = -(s • t) := by
  simp_rw [← image_neg]
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝⁴ : Ring α
inst✝³ : AddCommGroup β
inst✝² : Module α β
inst✝¹ : DecidableEq β
s : Finset α
t : Finset β
a : α
inst✝ : DecidableEq α
⊢ image (fun x => -x) s • t = image (fun x => -x) (s • t)

Next tactic:
exact image₂_image_left_comm neg_smul
@[to_additive]
lemma card_mul_le : Nat.card (s * t) ≤ Nat.card s * Nat.card t := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝¹ : Mul α
inst✝ : IsCancelMul α
s t : Set α
⊢ Nat.card ↑(s * t) ≤ Nat.card ↑s * Nat.card ↑t

Next tactic:
classical
  obtain h | h := (s * t).infinite_or_finite
  · simp [Set.Infinite.card_eq_zero h]
  obtain ⟨hs, ht⟩ | rfl | rfl := finite_mul.1 h
  · lift s to Finset α using hs
    lift t to Finset α using ht
    rw [← Finset.coe_mul]
    simpa [-Finset.coe_mul] using Finset.card_mul_le
  all_goals simp
@[to_additive]
lemma card_mul_le : Nat.card (s * t) ≤ Nat.card s * Nat.card t := by
  classical
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝¹ : Mul α
inst✝ : IsCancelMul α
s t : Set α
⊢ Nat.card ↑(s * t) ≤ Nat.card ↑s * Nat.card ↑t

Next tactic:
obtain h | h := (s * t).infinite_or_finite
@[to_additive]
lemma card_mul_le : Nat.card (s * t) ≤ Nat.card s * Nat.card t := by
  classical
  obtain h | h := (s * t).infinite_or_finite
  · 

Proof state:
case inl
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝¹ : Mul α
inst✝ : IsCancelMul α
s t : Set α
h : Set.Infinite (s * t)
⊢ Nat.card ↑(s * t) ≤ Nat.card ↑s * Nat.card ↑t

Next tactic:
simp [Set.Infinite.card_eq_zero h]
@[to_additive]
lemma card_mul_le : Nat.card (s * t) ≤ Nat.card s * Nat.card t := by
  classical
  obtain h | h := (s * t).infinite_or_finite
  · simp [Set.Infinite.card_eq_zero h]
  

Proof state:
case inr
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝¹ : Mul α
inst✝ : IsCancelMul α
s t : Set α
h : Set.Finite (s * t)
⊢ Nat.card ↑(s * t) ≤ Nat.card ↑s * Nat.card ↑t

Next tactic:
obtain ⟨hs, ht⟩ | rfl | rfl := finite_mul.1 h
@[to_additive]
lemma card_mul_le : Nat.card (s * t) ≤ Nat.card s * Nat.card t := by
  classical
  obtain h | h := (s * t).infinite_or_finite
  · simp [Set.Infinite.card_eq_zero h]
  obtain ⟨hs, ht⟩ | rfl | rfl := finite_mul.1 h
  · 

Proof state:
case inr.inl.intro
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝¹ : Mul α
inst✝ : IsCancelMul α
s t : Set α
h : Set.Finite (s * t)
hs : Set.Finite s
ht : Set.Finite t
⊢ Nat.card ↑(s * t) ≤ Nat.card ↑s * Nat.card ↑t

Next tactic:
lift s to Finset α using hs
@[to_additive]
lemma card_mul_le : Nat.card (s * t) ≤ Nat.card s * Nat.card t := by
  classical
  obtain h | h := (s * t).infinite_or_finite
  · simp [Set.Infinite.card_eq_zero h]
  obtain ⟨hs, ht⟩ | rfl | rfl := finite_mul.1 h
  · lift s to Finset α using hs
    

Proof state:
case inr.inl.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝¹ : Mul α
inst✝ : IsCancelMul α
t : Set α
ht : Set.Finite t
s : Finset α
h : Set.Finite (↑s * t)
⊢ Nat.card ↑(↑s * t) ≤ Nat.card ↑↑s * Nat.card ↑t

Next tactic:
lift t to Finset α using ht
@[to_additive]
lemma card_mul_le : Nat.card (s * t) ≤ Nat.card s * Nat.card t := by
  classical
  obtain h | h := (s * t).infinite_or_finite
  · simp [Set.Infinite.card_eq_zero h]
  obtain ⟨hs, ht⟩ | rfl | rfl := finite_mul.1 h
  · lift s to Finset α using hs
    lift t to Finset α using ht
    

Proof state:
case inr.inl.intro.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝¹ : Mul α
inst✝ : IsCancelMul α
s t : Finset α
h : Set.Finite (↑s * ↑t)
⊢ Nat.card ↑(↑s * ↑t) ≤ Nat.card ↑↑s * Nat.card ↑↑t

Next tactic:
rw [← Finset.coe_mul]
@[to_additive]
lemma card_mul_le : Nat.card (s * t) ≤ Nat.card s * Nat.card t := by
  classical
  obtain h | h := (s * t).infinite_or_finite
  · simp [Set.Infinite.card_eq_zero h]
  obtain ⟨hs, ht⟩ | rfl | rfl := finite_mul.1 h
  · lift s to Finset α using hs
    lift t to Finset α using ht
    rw [← Finset.coe_mul]
    

Proof state:
case inr.inl.intro.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝¹ : Mul α
inst✝ : IsCancelMul α
s t : Finset α
h : Set.Finite (↑s * ↑t)
⊢ Nat.card ↑↑(s * t) ≤ Nat.card ↑↑s * Nat.card ↑↑t

Next tactic:
simpa [-Finset.coe_mul] using Finset.card_mul_le
@[to_additive]
lemma card_mul_le : Nat.card (s * t) ≤ Nat.card s * Nat.card t := by
  classical
  obtain h | h := (s * t).infinite_or_finite
  · simp [Set.Infinite.card_eq_zero h]
  obtain ⟨hs, ht⟩ | rfl | rfl := finite_mul.1 h
  · lift s to Finset α using hs
    lift t to Finset α using ht
    rw [← Finset.coe_mul]
    simpa [-Finset.coe_mul] using Finset.card_mul_le
  

Proof state:
case inr.inr.inl
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝¹ : Mul α
inst✝ : IsCancelMul α
t : Set α
h : Set.Finite (∅ * t)
⊢ Nat.card ↑(∅ * t) ≤ Nat.card ↑∅ * Nat.card ↑t
case inr.inr.inr
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝¹ : Mul α
inst✝ : IsCancelMul α
s : Set α
h : Set.Finite (s * ∅)
⊢ Nat.card ↑(s * ∅) ≤ Nat.card ↑s * Nat.card ↑∅

Next tactic:
all_goals simp
@[to_additive]
lemma card_mul_le : Nat.card (s * t) ≤ Nat.card s * Nat.card t := by
  classical
  obtain h | h := (s * t).infinite_or_finite
  · simp [Set.Infinite.card_eq_zero h]
  obtain ⟨hs, ht⟩ | rfl | rfl := finite_mul.1 h
  · lift s to Finset α using hs
    lift t to Finset α using ht
    rw [← Finset.coe_mul]
    simpa [-Finset.coe_mul] using Finset.card_mul_le
  all_goals 

Proof state:
case inr.inr.inl
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝¹ : Mul α
inst✝ : IsCancelMul α
t : Set α
h : Set.Finite (∅ * t)
⊢ Nat.card ↑(∅ * t) ≤ Nat.card ↑∅ * Nat.card ↑t

Next tactic:
simp
@[to_additive]
lemma card_mul_le : Nat.card (s * t) ≤ Nat.card s * Nat.card t := by
  classical
  obtain h | h := (s * t).infinite_or_finite
  · simp [Set.Infinite.card_eq_zero h]
  obtain ⟨hs, ht⟩ | rfl | rfl := finite_mul.1 h
  · lift s to Finset α using hs
    lift t to Finset α using ht
    rw [← Finset.coe_mul]
    simpa [-Finset.coe_mul] using Finset.card_mul_le
  all_goals 

Proof state:
case inr.inr.inr
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝¹ : Mul α
inst✝ : IsCancelMul α
s : Set α
h : Set.Finite (s * ∅)
⊢ Nat.card ↑(s * ∅) ≤ Nat.card ↑s * Nat.card ↑∅

Next tactic:
simp
@[to_additive (attr := simp)]
lemma card_inv (s : Set α) : Nat.card ↥(s⁻¹) = Nat.card s := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝ : InvolutiveInv α
s✝ t s : Set α
⊢ Nat.card ↑s⁻¹ = Nat.card ↑s

Next tactic:
rw [← image_inv, Nat.card_image_of_injective inv_injective]
@[to_additive]
lemma card_div_le : Nat.card (s / t) ≤ Nat.card s * Nat.card t := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝ : Group α
s t : Set α
⊢ Nat.card ↑(s / t) ≤ Nat.card ↑s * Nat.card ↑t

Next tactic:
rw [div_eq_mul_inv, ← card_inv t]
@[to_additive]
lemma card_div_le : Nat.card (s / t) ≤ Nat.card s * Nat.card t := by
  rw [div_eq_mul_inv, ← card_inv t]; 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝ : Group α
s t : Set α
⊢ Nat.card ↑(s * t⁻¹) ≤ Nat.card ↑s * Nat.card ↑t⁻¹

Next tactic:
exact card_mul_le
/-- **Ruzsa's covering lemma**. -/
@[to_additive "**Ruzsa's covering lemma**"]
theorem exists_subset_mul_div (ht : t.Nonempty) :
    ∃ u : Finset α, u.card * t.card ≤ (s * t).card ∧ s ⊆ u * t / t := by
  

Proof state:
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CommGroup α
s t : Finset α
ht : Finset.Nonempty t
⊢ ∃ u, card u * card t ≤ card (s * t) ∧ s ⊆ u * t / t

Next tactic:
haveI : ∀ u, Decidable ((u : Set α).PairwiseDisjoint (· • t)) := fun u ↦ Classical.dec _
/-- **Ruzsa's covering lemma**. -/
@[to_additive "**Ruzsa's covering lemma**"]
theorem exists_subset_mul_div (ht : t.Nonempty) :
    ∃ u : Finset α, u.card * t.card ≤ (s * t).card ∧ s ⊆ u * t / t := by
  haveI : ∀ u, Decidable ((u : Set α).PairwiseDisjoint (· • t)) := fun u ↦ Classical.dec _
  

Proof state:
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CommGroup α
s t : Finset α
ht : Finset.Nonempty t
this : (u : Set α) → Decidable (Set.PairwiseDisjoint u fun x => x • t)
⊢ ∃ u, card u * card t ≤ card (s * t) ∧ s ⊆ u * t / t

Next tactic:
set C := s.powerset.filter fun u ↦ u.toSet.PairwiseDisjoint (· • t)
/-- **Ruzsa's covering lemma**. -/
@[to_additive "**Ruzsa's covering lemma**"]
theorem exists_subset_mul_div (ht : t.Nonempty) :
    ∃ u : Finset α, u.card * t.card ≤ (s * t).card ∧ s ⊆ u * t / t := by
  haveI : ∀ u, Decidable ((u : Set α).PairwiseDisjoint (· • t)) := fun u ↦ Classical.dec _
  set C := s.powerset.filter fun u ↦ u.toSet.PairwiseDisjoint (· • t)
  

Proof state:
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CommGroup α
s t : Finset α
ht : Finset.Nonempty t
this : (u : Set α) → Decidable (Set.PairwiseDisjoint u fun x => x • t)
C : Finset (Finset α) := filter (fun u => Set.PairwiseDisjoint ↑u fun x => x • t) (powerset s)
⊢ ∃ u, card u * card t ≤ card (s * t) ∧ s ⊆ u * t / t

Next tactic:
obtain ⟨u, hu, hCmax⟩ := C.exists_maximal (filter_nonempty_iff.2
    ⟨∅, empty_mem_powerset _, by rw [coe_empty]; exact Set.pairwiseDisjoint_empty⟩)
/-- **Ruzsa's covering lemma**. -/
@[to_additive "**Ruzsa's covering lemma**"]
theorem exists_subset_mul_div (ht : t.Nonempty) :
    ∃ u : Finset α, u.card * t.card ≤ (s * t).card ∧ s ⊆ u * t / t := by
  haveI : ∀ u, Decidable ((u : Set α).PairwiseDisjoint (· • t)) := fun u ↦ Classical.dec _
  set C := s.powerset.filter fun u ↦ u.toSet.PairwiseDisjoint (· • t)
  obtain ⟨u, hu, hCmax⟩ := C.exists_maximal (filter_nonempty_iff.2
    ⟨∅, empty_mem_powerset _, by 

Proof state:
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CommGroup α
s t : Finset α
ht : Finset.Nonempty t
this : (u : Set α) → Decidable (Set.PairwiseDisjoint u fun x => x • t)
C : Finset (Finset α) := filter (fun u => Set.PairwiseDisjoint ↑u fun x => x • t) (powerset s)
⊢ Set.PairwiseDisjoint ↑∅ fun x => x • t

Next tactic:
rw [coe_empty]
/-- **Ruzsa's covering lemma**. -/
@[to_additive "**Ruzsa's covering lemma**"]
theorem exists_subset_mul_div (ht : t.Nonempty) :
    ∃ u : Finset α, u.card * t.card ≤ (s * t).card ∧ s ⊆ u * t / t := by
  haveI : ∀ u, Decidable ((u : Set α).PairwiseDisjoint (· • t)) := fun u ↦ Classical.dec _
  set C := s.powerset.filter fun u ↦ u.toSet.PairwiseDisjoint (· • t)
  obtain ⟨u, hu, hCmax⟩ := C.exists_maximal (filter_nonempty_iff.2
    ⟨∅, empty_mem_powerset _, by rw [coe_empty]; 

Proof state:
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CommGroup α
s t : Finset α
ht : Finset.Nonempty t
this : (u : Set α) → Decidable (Set.PairwiseDisjoint u fun x => x • t)
C : Finset (Finset α) := filter (fun u => Set.PairwiseDisjoint ↑u fun x => x • t) (powerset s)
⊢ Set.PairwiseDisjoint ∅ fun x => x • t

Next tactic:
exact Set.pairwiseDisjoint_empty
/-- **Ruzsa's covering lemma**. -/
@[to_additive "**Ruzsa's covering lemma**"]
theorem exists_subset_mul_div (ht : t.Nonempty) :
    ∃ u : Finset α, u.card * t.card ≤ (s * t).card ∧ s ⊆ u * t / t := by
  haveI : ∀ u, Decidable ((u : Set α).PairwiseDisjoint (· • t)) := fun u ↦ Classical.dec _
  set C := s.powerset.filter fun u ↦ u.toSet.PairwiseDisjoint (· • t)
  obtain ⟨u, hu, hCmax⟩ := C.exists_maximal (filter_nonempty_iff.2
    ⟨∅, empty_mem_powerset _, by rw [coe_empty]; exact Set.pairwiseDisjoint_empty⟩)
  

Proof state:
case intro.intro
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CommGroup α
s t : Finset α
ht : Finset.Nonempty t
this : (u : Set α) → Decidable (Set.PairwiseDisjoint u fun x => x • t)
C : Finset (Finset α) := filter (fun u => Set.PairwiseDisjoint ↑u fun x => x • t) (powerset s)
u : Finset α
hu : u ∈ C
hCmax : ∀ x ∈ C, ¬u < x
⊢ ∃ u, card u * card t ≤ card (s * t) ∧ s ⊆ u * t / t

Next tactic:
rw [mem_filter, mem_powerset] at hu
/-- **Ruzsa's covering lemma**. -/
@[to_additive "**Ruzsa's covering lemma**"]
theorem exists_subset_mul_div (ht : t.Nonempty) :
    ∃ u : Finset α, u.card * t.card ≤ (s * t).card ∧ s ⊆ u * t / t := by
  haveI : ∀ u, Decidable ((u : Set α).PairwiseDisjoint (· • t)) := fun u ↦ Classical.dec _
  set C := s.powerset.filter fun u ↦ u.toSet.PairwiseDisjoint (· • t)
  obtain ⟨u, hu, hCmax⟩ := C.exists_maximal (filter_nonempty_iff.2
    ⟨∅, empty_mem_powerset _, by rw [coe_empty]; exact Set.pairwiseDisjoint_empty⟩)
  rw [mem_filter, mem_powerset] at hu
  

Proof state:
case intro.intro
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CommGroup α
s t : Finset α
ht : Finset.Nonempty t
this : (u : Set α) → Decidable (Set.PairwiseDisjoint u fun x => x • t)
C : Finset (Finset α) := filter (fun u => Set.PairwiseDisjoint ↑u fun x => x • t) (powerset s)
u : Finset α
hu : u ⊆ s ∧ Set.PairwiseDisjoint ↑u fun x => x • t
hCmax : ∀ x ∈ C, ¬u < x
⊢ ∃ u, card u * card t ≤ card (s * t) ∧ s ⊆ u * t / t

Next tactic:
refine' ⟨u,
    (card_mul_iff.2 <| pairwiseDisjoint_smul_iff.1 hu.2).ge.trans
      (card_le_of_subset <| mul_subset_mul_right hu.1),
    fun a ha ↦ _⟩
/-- **Ruzsa's covering lemma**. -/
@[to_additive "**Ruzsa's covering lemma**"]
theorem exists_subset_mul_div (ht : t.Nonempty) :
    ∃ u : Finset α, u.card * t.card ≤ (s * t).card ∧ s ⊆ u * t / t := by
  haveI : ∀ u, Decidable ((u : Set α).PairwiseDisjoint (· • t)) := fun u ↦ Classical.dec _
  set C := s.powerset.filter fun u ↦ u.toSet.PairwiseDisjoint (· • t)
  obtain ⟨u, hu, hCmax⟩ := C.exists_maximal (filter_nonempty_iff.2
    ⟨∅, empty_mem_powerset _, by rw [coe_empty]; exact Set.pairwiseDisjoint_empty⟩)
  rw [mem_filter, mem_powerset] at hu
  refine' ⟨u,
    (card_mul_iff.2 <| pairwiseDisjoint_smul_iff.1 hu.2).ge.trans
      (card_le_of_subset <| mul_subset_mul_right hu.1),
    fun a ha ↦ _⟩
  

Proof state:
case intro.intro
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CommGroup α
s t : Finset α
ht : Finset.Nonempty t
this : (u : Set α) → Decidable (Set.PairwiseDisjoint u fun x => x • t)
C : Finset (Finset α) := filter (fun u => Set.PairwiseDisjoint ↑u fun x => x • t) (powerset s)
u : Finset α
hu : u ⊆ s ∧ Set.PairwiseDisjoint ↑u fun x => x • t
hCmax : ∀ x ∈ C, ¬u < x
a : α
ha : a ∈ s
⊢ a ∈ u * t / t

Next tactic:
rw [mul_div_assoc]
/-- **Ruzsa's covering lemma**. -/
@[to_additive "**Ruzsa's covering lemma**"]
theorem exists_subset_mul_div (ht : t.Nonempty) :
    ∃ u : Finset α, u.card * t.card ≤ (s * t).card ∧ s ⊆ u * t / t := by
  haveI : ∀ u, Decidable ((u : Set α).PairwiseDisjoint (· • t)) := fun u ↦ Classical.dec _
  set C := s.powerset.filter fun u ↦ u.toSet.PairwiseDisjoint (· • t)
  obtain ⟨u, hu, hCmax⟩ := C.exists_maximal (filter_nonempty_iff.2
    ⟨∅, empty_mem_powerset _, by rw [coe_empty]; exact Set.pairwiseDisjoint_empty⟩)
  rw [mem_filter, mem_powerset] at hu
  refine' ⟨u,
    (card_mul_iff.2 <| pairwiseDisjoint_smul_iff.1 hu.2).ge.trans
      (card_le_of_subset <| mul_subset_mul_right hu.1),
    fun a ha ↦ _⟩
  rw [mul_div_assoc]
  

Proof state:
case intro.intro
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CommGroup α
s t : Finset α
ht : Finset.Nonempty t
this : (u : Set α) → Decidable (Set.PairwiseDisjoint u fun x => x • t)
C : Finset (Finset α) := filter (fun u => Set.PairwiseDisjoint ↑u fun x => x • t) (powerset s)
u : Finset α
hu : u ⊆ s ∧ Set.PairwiseDisjoint ↑u fun x => x • t
hCmax : ∀ x ∈ C, ¬u < x
a : α
ha : a ∈ s
⊢ a ∈ u * (t / t)

Next tactic:
by_cases hau : a ∈ u
/-- **Ruzsa's covering lemma**. -/
@[to_additive "**Ruzsa's covering lemma**"]
theorem exists_subset_mul_div (ht : t.Nonempty) :
    ∃ u : Finset α, u.card * t.card ≤ (s * t).card ∧ s ⊆ u * t / t := by
  haveI : ∀ u, Decidable ((u : Set α).PairwiseDisjoint (· • t)) := fun u ↦ Classical.dec _
  set C := s.powerset.filter fun u ↦ u.toSet.PairwiseDisjoint (· • t)
  obtain ⟨u, hu, hCmax⟩ := C.exists_maximal (filter_nonempty_iff.2
    ⟨∅, empty_mem_powerset _, by rw [coe_empty]; exact Set.pairwiseDisjoint_empty⟩)
  rw [mem_filter, mem_powerset] at hu
  refine' ⟨u,
    (card_mul_iff.2 <| pairwiseDisjoint_smul_iff.1 hu.2).ge.trans
      (card_le_of_subset <| mul_subset_mul_right hu.1),
    fun a ha ↦ _⟩
  rw [mul_div_assoc]
  by_cases hau : a ∈ u
  · 

Proof state:
case pos
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CommGroup α
s t : Finset α
ht : Finset.Nonempty t
this : (u : Set α) → Decidable (Set.PairwiseDisjoint u fun x => x • t)
C : Finset (Finset α) := filter (fun u => Set.PairwiseDisjoint ↑u fun x => x • t) (powerset s)
u : Finset α
hu : u ⊆ s ∧ Set.PairwiseDisjoint ↑u fun x => x • t
hCmax : ∀ x ∈ C, ¬u < x
a : α
ha : a ∈ s
hau : a ∈ u
⊢ a ∈ u * (t / t)

Next tactic:
exact subset_mul_left _ ht.one_mem_div hau
/-- **Ruzsa's covering lemma**. -/
@[to_additive "**Ruzsa's covering lemma**"]
theorem exists_subset_mul_div (ht : t.Nonempty) :
    ∃ u : Finset α, u.card * t.card ≤ (s * t).card ∧ s ⊆ u * t / t := by
  haveI : ∀ u, Decidable ((u : Set α).PairwiseDisjoint (· • t)) := fun u ↦ Classical.dec _
  set C := s.powerset.filter fun u ↦ u.toSet.PairwiseDisjoint (· • t)
  obtain ⟨u, hu, hCmax⟩ := C.exists_maximal (filter_nonempty_iff.2
    ⟨∅, empty_mem_powerset _, by rw [coe_empty]; exact Set.pairwiseDisjoint_empty⟩)
  rw [mem_filter, mem_powerset] at hu
  refine' ⟨u,
    (card_mul_iff.2 <| pairwiseDisjoint_smul_iff.1 hu.2).ge.trans
      (card_le_of_subset <| mul_subset_mul_right hu.1),
    fun a ha ↦ _⟩
  rw [mul_div_assoc]
  by_cases hau : a ∈ u
  · exact subset_mul_left _ ht.one_mem_div hau
  

Proof state:
case neg
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CommGroup α
s t : Finset α
ht : Finset.Nonempty t
this : (u : Set α) → Decidable (Set.PairwiseDisjoint u fun x => x • t)
C : Finset (Finset α) := filter (fun u => Set.PairwiseDisjoint ↑u fun x => x • t) (powerset s)
u : Finset α
hu : u ⊆ s ∧ Set.PairwiseDisjoint ↑u fun x => x • t
hCmax : ∀ x ∈ C, ¬u < x
a : α
ha : a ∈ s
hau : a ∉ u
⊢ a ∈ u * (t / t)

Next tactic:
by_cases H : ∀ b ∈ u, Disjoint (a • t) (b • t)
/-- **Ruzsa's covering lemma**. -/
@[to_additive "**Ruzsa's covering lemma**"]
theorem exists_subset_mul_div (ht : t.Nonempty) :
    ∃ u : Finset α, u.card * t.card ≤ (s * t).card ∧ s ⊆ u * t / t := by
  haveI : ∀ u, Decidable ((u : Set α).PairwiseDisjoint (· • t)) := fun u ↦ Classical.dec _
  set C := s.powerset.filter fun u ↦ u.toSet.PairwiseDisjoint (· • t)
  obtain ⟨u, hu, hCmax⟩ := C.exists_maximal (filter_nonempty_iff.2
    ⟨∅, empty_mem_powerset _, by rw [coe_empty]; exact Set.pairwiseDisjoint_empty⟩)
  rw [mem_filter, mem_powerset] at hu
  refine' ⟨u,
    (card_mul_iff.2 <| pairwiseDisjoint_smul_iff.1 hu.2).ge.trans
      (card_le_of_subset <| mul_subset_mul_right hu.1),
    fun a ha ↦ _⟩
  rw [mul_div_assoc]
  by_cases hau : a ∈ u
  · exact subset_mul_left _ ht.one_mem_div hau
  by_cases H : ∀ b ∈ u, Disjoint (a • t) (b • t)
  · 

Proof state:
case pos
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CommGroup α
s t : Finset α
ht : Finset.Nonempty t
this : (u : Set α) → Decidable (Set.PairwiseDisjoint u fun x => x • t)
C : Finset (Finset α) := filter (fun u => Set.PairwiseDisjoint ↑u fun x => x • t) (powerset s)
u : Finset α
hu : u ⊆ s ∧ Set.PairwiseDisjoint ↑u fun x => x • t
hCmax : ∀ x ∈ C, ¬u < x
a : α
ha : a ∈ s
hau : a ∉ u
H : ∀ b ∈ u, Disjoint (a • t) (b • t)
⊢ a ∈ u * (t / t)

Next tactic:
refine' (hCmax _ _ <| ssubset_insert hau).elim