File: Mathlib/Data/Finset/Density.lean

full_name: Finset.dens
code: /-- Density of a finset.

`dens s` is the number of elements of `s` divided by the size of the ambient type `α`. -/
def dens (s : Finset α) : ℚ≥0 
goal: ℚ≥0

full_name: Finset.dens_eq_card_div_card
code: lemma dens_eq_card_div_card (s : Finset α) : dens s = s.card / Fintype.card α 
goal: s.dens = ↑s.card / ↑(Fintype.card α)

full_name: Finset.dens_empty
code: @[simp] lemma dens_empty : dens (∅ : Finset α) = 0 
goal: ∅.dens = 0

full_name: Finset.dens_singleton
code: @[simp] lemma dens_singleton (a : α) : dens ({a} : Finset α) = (Fintype.card α : ℚ≥0)⁻¹ 
goal: {a}.dens = (↑(Fintype.card α))⁻¹

full_name: Finset.dens_cons
code: @[simp] lemma dens_cons (h : a ∉ s) : (s.cons a h).dens = dens s + (Fintype.card α : ℚ≥0)⁻¹ 
goal: (Finset.cons a s h).dens = s.dens + (↑(Fintype.card α))⁻¹

full_name: Finset.dens_disjUnion
code: @[simp] lemma dens_disjUnion (s t : Finset α) (h) : dens (s.disjUnion t h) = dens s + dens t 
goal: (s.disjUnion t h).dens = s.dens + t.dens

full_name: Finset.dens_eq_zero
code: @[simp] lemma dens_eq_zero : dens s = 0 ↔ s = ∅ 
goal: s.dens = 0 ↔ s = ∅

full_name: Finset.dens_ne_zero
code: lemma dens_ne_zero : dens s ≠ 0 ↔ s.Nonempty 
goal: s.dens ≠ 0 ↔ s.Nonempty

full_name: Finset.dens_pos
code: @[simp] lemma dens_pos : 0 < dens s ↔ s.Nonempty 
goal: 0 < s.dens ↔ s.Nonempty

full_name: Finset.dens_le_dens
code: lemma dens_le_dens (h : s ⊆ t) : dens s ≤ dens t 
goal: s.dens ≤ t.dens

full_name: Finset.dens_lt_dens
code: lemma dens_lt_dens (h : s ⊂ t) : dens s < dens t 
goal: s.dens < t.dens

full_name: Finset.dens_mono
code: @[mono] lemma dens_mono : Monotone (dens : Finset α → ℚ≥0) 
goal: Monotone Finset.dens

full_name: Finset.dens_strictMono
code: @[mono] lemma dens_strictMono : StrictMono (dens : Finset α → ℚ≥0) 
goal: StrictMono Finset.dens

full_name: Finset.dens_map_le
code: lemma dens_map_le [Fintype β] (f : α ↪ β) : dens (s.map f) ≤ dens s 
goal: (Finset.map f s).dens ≤ s.dens

full_name: Finset.dens_univ
code: @[simp] lemma dens_univ : dens (univ : Finset α) = 1 
goal: Finset.univ.dens = 1

full_name: Finset.dens_eq_one
code: @[simp] lemma dens_eq_one : dens s = 1 ↔ s = univ 
goal: s.dens = 1 ↔ s = Finset.univ

full_name: Finset.dens_ne_one
code: lemma dens_ne_one : dens s ≠ 1 ↔ s ≠ univ 
goal: s.dens ≠ 1 ↔ s ≠ Finset.univ

full_name: Finset.dens_union_add_dens_inter
code: lemma dens_union_add_dens_inter (s t : Finset α) :
    dens (s ∪ t) + dens (s ∩ t) = dens s + dens t 
goal: (s ∪ t).dens + (s ∩ t).dens = s.dens + t.dens

full_name: Finset.dens_inter_add_dens_union
code: lemma dens_inter_add_dens_union (s t : Finset α) :
    dens (s ∩ t) + dens (s ∪ t) = dens s + dens t 
goal: (s ∩ t).dens + (s ∪ t).dens = s.dens + t.dens

full_name: Finset.dens_union_of_disjoint
code: @[simp] lemma dens_union_of_disjoint (h : Disjoint s t) : dens (s ∪ t) = dens s + dens t 
goal: (s ∪ t).dens = s.dens + t.dens

full_name: Finset.dens_sdiff_add_dens_eq_dens
code: lemma dens_sdiff_add_dens_eq_dens (h : s ⊆ t) : dens (t \ s) + dens s = dens t 
goal: (t \ s).dens + s.dens = t.dens

full_name: Finset.dens_sdiff_add_dens
code: lemma dens_sdiff_add_dens (s t : Finset α) : dens (s \ t) + dens t = (s ∪ t).dens 
goal: (s \ t).dens + t.dens = (s ∪ t).dens

full_name: Finset.dens_sdiff_comm
code: lemma dens_sdiff_comm (h : card s = card t) : dens (s \ t) = dens (t \ s) 
goal: (s \ t).dens = (t \ s).dens

full_name: Finset.dens_sdiff_add_dens_inter
code: @[simp]
lemma dens_sdiff_add_dens_inter (s t : Finset α) : dens (s \ t) + dens (s ∩ t) = dens s 
goal: (s \ t).dens + (s ∩ t).dens = s.dens

full_name: Finset.dens_inter_add_dens_sdiff
code: @[simp]
lemma dens_inter_add_dens_sdiff (s t : Finset α) : dens (s ∩ t) + dens (s \ t) = dens s 
goal: (s ∩ t).dens + (s \ t).dens = s.dens

full_name: Finset.dens_filter_add_dens_filter_not_eq_dens
code: lemma dens_filter_add_dens_filter_not_eq_dens
    (p : α → Prop) [DecidablePred p] [∀ x, Decidable (¬p x)] :
    dens (s.filter p) + dens (s.filter fun a ↦ ¬ p a) = dens s 
goal: (Finset.filter p s).dens + (Finset.filter (fun a => ¬p a) s).dens = s.dens

full_name: Finset.dens_union_le
code: lemma dens_union_le (s t : Finset α) : dens (s ∪ t) ≤ dens s + dens t 
goal: (s ∪ t).dens ≤ s.dens + t.dens

full_name: Finset.dens_le_dens_sdiff_add_dens
code: lemma dens_le_dens_sdiff_add_dens : dens s ≤ dens (s \ t) + dens t 
goal: s.dens ≤ (s \ t).dens + t.dens

full_name: Finset.dens_sdiff
code: lemma dens_sdiff (h : s ⊆ t) : dens (t \ s) = dens t - dens s 
goal: (t \ s).dens = t.dens - s.dens

full_name: Finset.le_dens_sdiff
code: lemma le_dens_sdiff (s t : Finset α) : dens t - dens s ≤ dens (t \ s) 
goal: t.dens - s.dens ≤ (t \ s).dens