The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V05. Groups

Mathlib.Algebra.FreeMonoid.Count

20 declarations. Mathlib docs · Source

theorem FreeMonoid.countP'.congr_simp E1 #

∀ {α : Type u_1} (p p_1 : α → Prop),
  p = p_1 →
    ∀ {inst : DecidablePred p} [inst_1 : DecidablePred p_1] (l l_1 : FreeMonoid α),
      l = l_1 → FreeMonoid.countP' p l = FreeMonoid.countP' p_1 l_1

theorem FreeMonoid.countP.congr_simp E1 #

∀ {α : Type u_1} (p p_1 : α → Prop),
  p = p_1 → ∀ {inst : DecidablePred p} [inst_1 : DecidablePred p_1], FreeMonoid.countP p = FreeMonoid.countP p_1

def FreeMonoid.countP' E1 #

{α : Type u_1} → (p : α → Prop) → [DecidablePred p] → FreeMonoid α → ℕ

List.countP lifted to free monoids

def FreeAddMonoid.countP' E1 #

{α : Type u_1} → (p : α → Prop) → [DecidablePred p] → FreeAddMonoid α → ℕ

List.countP lifted to free additive monoids

theorem FreeMonoid.countP'_one E1 #

∀ {α : Type u_1} (p : α → Prop) [inst : DecidablePred p], FreeMonoid.countP' p 1 = 0

theorem FreeAddMonoid.countP'_zero E1 #

∀ {α : Type u_1} (p : α → Prop) [inst : DecidablePred p], FreeAddMonoid.countP' p 0 = 0

theorem FreeMonoid.countP'_mul E1 #

∀ {α : Type u_1} (p : α → Prop) [inst : DecidablePred p] (l₁ l₂ : FreeMonoid α),
  FreeMonoid.countP' p (l₁ * l₂) = FreeMonoid.countP' p l₁ + FreeMonoid.countP' p l₂

theorem FreeAddMonoid.countP'_add E1 #

∀ {α : Type u_1} (p : α → Prop) [inst : DecidablePred p] (l₁ l₂ : FreeAddMonoid α),
  FreeAddMonoid.countP' p (l₁ + l₂) = FreeAddMonoid.countP' p l₁ + FreeAddMonoid.countP' p l₂

def FreeMonoid.countP E1 #

{α : Type u_1} → (p : α → Prop) → [DecidablePred p] → FreeMonoid α →* Multiplicative ℕ

List.countP as a bundled multiplicative monoid homomorphism.

theorem FreeMonoid.countP_apply E0 #

∀ {α : Type u_1} (p : α → Prop) [inst : DecidablePred p] (l : FreeMonoid α),
  (FreeMonoid.countP p) l = Multiplicative.ofAdd (List.countP (fun b ↦ decide (p b)) l.toList)

theorem FreeMonoid.countP_of E1 #

∀ {α : Type u_1} (p : α → Prop) [inst : DecidablePred p] (x : α),
  (FreeMonoid.countP p) (FreeMonoid.of x) = if p x then Multiplicative.ofAdd 1 else Multiplicative.ofAdd 0

def FreeMonoid.count E1 #

{α : Type u_1} → [DecidableEq α] → α → FreeMonoid α →* Multiplicative ℕ

List.count as a bundled additive monoid homomorphism.

theorem FreeMonoid.count_apply E0 #

∀ {α : Type u_1} [inst : DecidableEq α] (x : α) (l : FreeMonoid α),
  (FreeMonoid.count x) l = Multiplicative.ofAdd (List.count x l.toList)

theorem FreeMonoid.count_of E1 #

∀ {α : Type u_1} [inst : DecidableEq α] (x y : α),
  (FreeMonoid.count x) (FreeMonoid.of y) = Pi.mulSingle x (Multiplicative.ofAdd 1) y

def FreeAddMonoid.countP E1 #

{α : Type u_1} → (p : α → Prop) → [DecidablePred p] → FreeAddMonoid α →+ ℕ

List.countP as a bundled additive monoid homomorphism.

theorem FreeAddMonoid.countP_apply E0 #

∀ {α : Type u_1} (p : α → Prop) [inst : DecidablePred p] (l : FreeAddMonoid α),
  (FreeAddMonoid.countP p) l = List.countP (fun b ↦ decide (p b)) l.toList

theorem FreeAddMonoid.countP_of E1 #

∀ {α : Type u_1} (p : α → Prop) [inst : DecidablePred p] (x : α),
  (FreeAddMonoid.countP p) (FreeAddMonoid.of x) = if p x then 1 else 0

def FreeAddMonoid.count E1 #

{α : Type u_1} → [DecidableEq α] → α → FreeAddMonoid α →+ ℕ

List.count as a bundled additive monoid homomorphism.

theorem FreeAddMonoid.count_of E1 #

∀ {α : Type u_1} [inst : DecidableEq α] (x y : α), (FreeAddMonoid.count x) (FreeAddMonoid.of y) = Pi.single x 1 y

theorem FreeAddMonoid.count_apply E0 #

∀ {α : Type u_1} [inst : DecidableEq α] (x : α) (l : FreeAddMonoid α), (FreeAddMonoid.count x) l = List.count x l.toList