Documentation

Mathlib.Algebra.Group.Indicator

Indicator function #

In this file, we prove basic results about the indicator of a set.

Implementation note #

In mathematics, an indicator function or a characteristic function is a function used to indicate membership of an element in a set s, having the value 1 for all elements of s and the value 0 otherwise. But since it is usually used to restrict a function to a certain set s, we let the indicator function take the value f x for some function f, instead of 1. If the usual indicator function is needed, just set f to be the constant function fun _ ↦ 1.

The indicator function is implemented non-computably, to avoid having to pass around Decidable arguments. This is in contrast with the design of Pi.single or Set.piecewise.

Tags #

indicator, characteristic

theorem Set.mulIndicator_union_mul_inter_apply {α : Type u_1} {M : Type u_3} [MulOneClass M] (f : αM) (s t : Set α) (a : α) :
(s t).mulIndicator f a * (s t).mulIndicator f a = s.mulIndicator f a * t.mulIndicator f a
theorem Set.indicator_union_add_inter_apply {α : Type u_1} {M : Type u_3} [AddZeroClass M] (f : αM) (s t : Set α) (a : α) :
(s t).indicator f a + (s t).indicator f a = s.indicator f a + t.indicator f a
theorem Set.mulIndicator_union_mul_inter {α : Type u_1} {M : Type u_3} [MulOneClass M] (f : αM) (s t : Set α) :
theorem Set.indicator_union_add_inter {α : Type u_1} {M : Type u_3} [AddZeroClass M] (f : αM) (s t : Set α) :
(s t).indicator f + (s t).indicator f = s.indicator f + t.indicator f
theorem Set.mulIndicator_union_of_notMem_inter {α : Type u_1} {M : Type u_3} [MulOneClass M] {s t : Set α} {a : α} (h : as t) (f : αM) :
theorem Set.indicator_union_of_notMem_inter {α : Type u_1} {M : Type u_3} [AddZeroClass M] {s t : Set α} {a : α} (h : as t) (f : αM) :
(s t).indicator f a = s.indicator f a + t.indicator f a
@[deprecated Set.indicator_union_of_notMem_inter (since := "2025-05-23")]
theorem Set.indicator_union_of_not_mem_inter {α : Type u_1} {M : Type u_3} [AddZeroClass M] {s t : Set α} {a : α} (h : as t) (f : αM) :
(s t).indicator f a = s.indicator f a + t.indicator f a

Alias of Set.indicator_union_of_notMem_inter.

@[deprecated Set.mulIndicator_union_of_notMem_inter (since := "2025-05-23")]
theorem Set.mulIndicator_union_of_not_mem_inter {α : Type u_1} {M : Type u_3} [MulOneClass M] {s t : Set α} {a : α} (h : as t) (f : αM) :

Alias of Set.mulIndicator_union_of_notMem_inter.

theorem Set.mulIndicator_union_of_disjoint {α : Type u_1} {M : Type u_3} [MulOneClass M] {s t : Set α} (h : Disjoint s t) (f : αM) :
(s t).mulIndicator f = fun (a : α) => s.mulIndicator f a * t.mulIndicator f a
theorem Set.indicator_union_of_disjoint {α : Type u_1} {M : Type u_3} [AddZeroClass M] {s t : Set α} (h : Disjoint s t) (f : αM) :
(s t).indicator f = fun (a : α) => s.indicator f a + t.indicator f a
theorem Set.mulIndicator_symmDiff {α : Type u_1} {M : Type u_3} [MulOneClass M] (s t : Set α) (f : αM) :
theorem Set.indicator_symmDiff {α : Type u_1} {M : Type u_3} [AddZeroClass M] (s t : Set α) (f : αM) :
(symmDiff s t).indicator f = (s \ t).indicator f + (t \ s).indicator f
theorem Set.mulIndicator_mul {α : Type u_1} {M : Type u_3} [MulOneClass M] (s : Set α) (f g : αM) :
(s.mulIndicator fun (a : α) => f a * g a) = fun (a : α) => s.mulIndicator f a * s.mulIndicator g a
theorem Set.indicator_add {α : Type u_1} {M : Type u_3} [AddZeroClass M] (s : Set α) (f g : αM) :
(s.indicator fun (a : α) => f a + g a) = fun (a : α) => s.indicator f a + s.indicator g a
theorem Set.mulIndicator_mul' {α : Type u_1} {M : Type u_3} [MulOneClass M] (s : Set α) (f g : αM) :
theorem Set.indicator_add' {α : Type u_1} {M : Type u_3} [AddZeroClass M] (s : Set α) (f g : αM) :
s.indicator (f + g) = s.indicator f + s.indicator g
@[simp]
theorem Set.mulIndicator_compl_mul_self_apply {α : Type u_1} {M : Type u_3} [MulOneClass M] (s : Set α) (f : αM) (a : α) :
@[simp]
theorem Set.indicator_compl_add_self_apply {α : Type u_1} {M : Type u_3} [AddZeroClass M] (s : Set α) (f : αM) (a : α) :
s.indicator f a + s.indicator f a = f a
@[simp]
theorem Set.mulIndicator_compl_mul_self {α : Type u_1} {M : Type u_3} [MulOneClass M] (s : Set α) (f : αM) :
@[simp]
theorem Set.indicator_compl_add_self {α : Type u_1} {M : Type u_3} [AddZeroClass M] (s : Set α) (f : αM) :
@[simp]
theorem Set.mulIndicator_self_mul_compl_apply {α : Type u_1} {M : Type u_3} [MulOneClass M] (s : Set α) (f : αM) (a : α) :
@[simp]
theorem Set.indicator_self_add_compl_apply {α : Type u_1} {M : Type u_3} [AddZeroClass M] (s : Set α) (f : αM) (a : α) :
s.indicator f a + s.indicator f a = f a
@[simp]
theorem Set.mulIndicator_self_mul_compl {α : Type u_1} {M : Type u_3} [MulOneClass M] (s : Set α) (f : αM) :
@[simp]
theorem Set.indicator_self_add_compl {α : Type u_1} {M : Type u_3} [AddZeroClass M] (s : Set α) (f : αM) :
theorem Set.indicator_add_eq_left {α : Type u_1} {M : Type u_3} [AddZeroClass M] {f g : αM} (h : Disjoint (Function.support f) (Function.support g)) :
theorem Set.indicator_add_eq_right {α : Type u_1} {M : Type u_3} [AddZeroClass M] {f g : αM} (h : Disjoint (Function.support f) (Function.support g)) :
theorem Set.mulIndicator_mul_compl_eq_piecewise {α : Type u_1} {M : Type u_3} [MulOneClass M] {s : Set α} [DecidablePred fun (x : α) => x s] (f g : αM) :
theorem Set.indicator_add_compl_eq_piecewise {α : Type u_1} {M : Type u_3} [AddZeroClass M] {s : Set α} [DecidablePred fun (x : α) => x s] (f g : αM) :
noncomputable def Set.mulIndicatorHom {α : Type u_5} (M : Type u_6) [MulOneClass M] (s : Set α) :
(αM) →* αM

Set.mulIndicator as a monoidHom.

Equations
Instances For
    noncomputable def Set.indicatorHom {α : Type u_5} (M : Type u_6) [AddZeroClass M] (s : Set α) :
    (αM) →+ αM

    Set.indicator as an addMonoidHom.

    Equations
    Instances For
      theorem Set.mulIndicator_inv' {α : Type u_1} {G : Type u_5} [Group G] (s : Set α) (f : αG) :
      theorem Set.indicator_neg' {α : Type u_1} {G : Type u_5} [AddGroup G] (s : Set α) (f : αG) :
      theorem Set.mulIndicator_inv {α : Type u_1} {G : Type u_5} [Group G] (s : Set α) (f : αG) :
      (s.mulIndicator fun (a : α) => (f a)⁻¹) = fun (a : α) => (s.mulIndicator f a)⁻¹
      theorem Set.indicator_neg {α : Type u_1} {G : Type u_5} [AddGroup G] (s : Set α) (f : αG) :
      (s.indicator fun (a : α) => -f a) = fun (a : α) => -s.indicator f a
      theorem Set.mulIndicator_div {α : Type u_1} {G : Type u_5} [Group G] (s : Set α) (f g : αG) :
      (s.mulIndicator fun (a : α) => f a / g a) = fun (a : α) => s.mulIndicator f a / s.mulIndicator g a
      theorem Set.indicator_sub {α : Type u_1} {G : Type u_5} [AddGroup G] (s : Set α) (f g : αG) :
      (s.indicator fun (a : α) => f a - g a) = fun (a : α) => s.indicator f a - s.indicator g a
      theorem Set.mulIndicator_div' {α : Type u_1} {G : Type u_5} [Group G] (s : Set α) (f g : αG) :
      theorem Set.indicator_sub' {α : Type u_1} {G : Type u_5} [AddGroup G] (s : Set α) (f g : αG) :
      s.indicator (f - g) = s.indicator f - s.indicator g
      theorem Set.mulIndicator_compl {α : Type u_1} {G : Type u_5} [Group G] (s : Set α) (f : αG) :
      theorem Set.indicator_compl' {α : Type u_1} {G : Type u_5} [AddGroup G] (s : Set α) (f : αG) :
      theorem Set.mulIndicator_compl' {α : Type u_1} {G : Type u_5} [Group G] (s : Set α) (f : αG) :
      theorem Set.indicator_compl {α : Type u_1} {G : Type u_5} [AddGroup G] (s : Set α) (f : αG) :
      theorem Set.mulIndicator_diff {α : Type u_1} {G : Type u_5} [Group G] {s t : Set α} (h : s t) (f : αG) :
      theorem Set.indicator_diff' {α : Type u_1} {G : Type u_5} [AddGroup G] {s t : Set α} (h : s t) (f : αG) :
      (t \ s).indicator f = t.indicator f + -s.indicator f
      theorem Set.mulIndicator_diff' {α : Type u_1} {G : Type u_5} [Group G] {s t : Set α} (h : s t) (f : αG) :
      theorem Set.indicator_diff {α : Type u_1} {G : Type u_5} [AddGroup G] {s t : Set α} (h : s t) (f : αG) :
      (t \ s).indicator f = t.indicator f - s.indicator f
      theorem Set.apply_mulIndicator_symmDiff {α : Type u_1} {β : Type u_2} {G : Type u_5} [Group G] {g : Gβ} (hg : ∀ (x : G), g x⁻¹ = g x) (s t : Set α) (f : αG) (x : α) :
      g ((symmDiff s t).mulIndicator f x) = g (s.mulIndicator f x / t.mulIndicator f x)
      theorem Set.apply_indicator_symmDiff {α : Type u_1} {β : Type u_2} {G : Type u_5} [AddGroup G] {g : Gβ} (hg : ∀ (x : G), g (-x) = g x) (s t : Set α) (f : αG) (x : α) :
      g ((symmDiff s t).indicator f x) = g (s.indicator f x - t.indicator f x)
      theorem MonoidHom.map_mulIndicator {α : Type u_1} {M : Type u_5} {N : Type u_6} [MulOneClass M] [MulOneClass N] (f : M →* N) (s : Set α) (g : αM) (x : α) :
      f (s.mulIndicator g x) = s.mulIndicator (f g) x
      theorem AddMonoidHom.map_indicator {α : Type u_1} {M : Type u_5} {N : Type u_6} [AddZeroClass M] [AddZeroClass N] (f : M →+ N) (s : Set α) (g : αM) (x : α) :
      f (s.indicator g x) = s.indicator (f g) x