Mathlib.Algebra.Group.Indicator
54 declarations and 2 deprecated aliases. Mathlib docs · Source
Indicator function
In this file, we prove basic results about the indicator of a set.
Set.indicator (s : Set α) (f : α → β) (a : α)isf aifa ∈ sand is0otherwise.Set.mulIndicator (s : Set α) (f : α → β) (a : α)isf aifa ∈ sand is1otherwise.
Implementation notes
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
Relationship with Pi.mulSingle/Pi.single
theorem Set.mulIndicator_union_mul_inter_apply E0 #
∀ {α : Type u_1} {M : Type u_4} [inst : 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 E0 #
∀ {α : Type u_1} {M : Type u_4} [inst : 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.indicator_union_add_inter E1 #
∀ {α : Type u_1} {M : Type u_4} [inst : 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_mul_inter E1 #
∀ {α : Type u_1} {M : Type u_4} [inst : MulOneClass M] (f : α → M) (s t : Set α),
(s ∪ t).mulIndicator f * (s ∩ t).mulIndicator f = s.mulIndicator f * t.mulIndicator f
theorem Set.indicator_union_of_notMem_inter E1 #
∀ {α : Type u_1} {M : Type u_4} [inst : AddZeroClass M] {s t : Set α} {a : α},
a ∉ s ∩ t → ∀ (f : α → M), (s ∪ t).indicator f a = s.indicator f a + t.indicator f a
theorem Set.mulIndicator_union_of_notMem_inter E1 #
∀ {α : Type u_1} {M : Type u_4} [inst : MulOneClass M] {s t : Set α} {a : α},
a ∉ s ∩ t → ∀ (f : α → M), (s ∪ t).mulIndicator f a = s.mulIndicator f a * t.mulIndicator f a
theorem Set.indicator_union_of_disjoint E1 #
∀ {α : Type u_1} {M : Type u_4} [inst : AddZeroClass M] {s t : Set α},
Disjoint s t → ∀ (f : α → M), (s ∪ t).indicator f = fun a ↦ s.indicator f a + t.indicator f a
theorem Set.mulIndicator_union_of_disjoint E1 #
∀ {α : Type u_1} {M : Type u_4} [inst : MulOneClass M] {s t : Set α},
Disjoint s t → ∀ (f : α → M), (s ∪ t).mulIndicator f = fun a ↦ s.mulIndicator f a * t.mulIndicator f a
theorem Set.indicator_symmDiff E1 #
∀ {α : Type u_1} {M : Type u_4} [inst : AddZeroClass M] (s t : Set α) (f : α → M),
(symmDiff s t).indicator f = (s \ t).indicator f + (t \ s).indicator f
theorem Set.mulIndicator_symmDiff E1 #
∀ {α : Type u_1} {M : Type u_4} [inst : MulOneClass M] (s t : Set α) (f : α → M),
(symmDiff s t).mulIndicator f = (s \ t).mulIndicator f * (t \ s).mulIndicator f
theorem Set.mulIndicator_mul E1 #
∀ {α : Type u_1} {M : Type u_4} [inst : 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 E1 #
∀ {α : Type u_1} {M : Type u_4} [inst : 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' E1 #
∀ {α : Type u_1} {M : Type u_4} [inst : MulOneClass M] (s : Set α) (f g : α → M),
s.mulIndicator (f * g) = s.mulIndicator f * s.mulIndicator g
theorem Set.indicator_add' E1 #
∀ {α : Type u_1} {M : Type u_4} [inst : AddZeroClass M] (s : Set α) (f g : α → M),
s.indicator (f + g) = s.indicator f + s.indicator g
theorem Set.indicator_compl_add_self_apply E0 #
∀ {α : Type u_1} {M : Type u_4} [inst : AddZeroClass M] (s : Set α) (f : α → M) (a : α),
sᶜ.indicator f a + s.indicator f a = f a
theorem Set.mulIndicator_compl_mul_self_apply E0 #
∀ {α : Type u_1} {M : Type u_4} [inst : MulOneClass M] (s : Set α) (f : α → M) (a : α),
sᶜ.mulIndicator f a * s.mulIndicator f a = f a
theorem Set.indicator_compl_add_self E0 #
∀ {α : Type u_1} {M : Type u_4} [inst : AddZeroClass M] (s : Set α) (f : α → M), sᶜ.indicator f + s.indicator f = f
theorem Set.mulIndicator_compl_mul_self E0 #
∀ {α : Type u_1} {M : Type u_4} [inst : MulOneClass M] (s : Set α) (f : α → M), sᶜ.mulIndicator f * s.mulIndicator f = f
theorem Set.mulIndicator_self_mul_compl_apply E0 #
∀ {α : Type u_1} {M : Type u_4} [inst : MulOneClass M] (s : Set α) (f : α → M) (a : α),
s.mulIndicator f a * sᶜ.mulIndicator f a = f a
theorem Set.indicator_self_add_compl_apply E0 #
∀ {α : Type u_1} {M : Type u_4} [inst : AddZeroClass M] (s : Set α) (f : α → M) (a : α),
s.indicator f a + sᶜ.indicator f a = f a
theorem Set.indicator_self_add_compl E0 #
∀ {α : Type u_1} {M : Type u_4} [inst : AddZeroClass M] (s : Set α) (f : α → M), s.indicator f + sᶜ.indicator f = f
theorem Set.mulIndicator_self_mul_compl E0 #
∀ {α : Type u_1} {M : Type u_4} [inst : MulOneClass M] (s : Set α) (f : α → M), s.mulIndicator f * sᶜ.mulIndicator f = f
theorem Set.mulIndicator_mul_eq_left E1 #
∀ {α : Type u_1} {M : Type u_4} [inst : MulOneClass M] {f g : α → M},
Disjoint (Function.mulSupport f) (Function.mulSupport g) → (Function.mulSupport f).mulIndicator (f * g) = f
theorem Set.indicator_add_eq_left E1 #
∀ {α : Type u_1} {M : Type u_4} [inst : AddZeroClass M] {f g : α → M},
Disjoint (Function.support f) (Function.support g) → (Function.support f).indicator (f + g) = f
theorem Set.mulIndicator_mul_eq_right E1 #
∀ {α : Type u_1} {M : Type u_4} [inst : MulOneClass M] {f g : α → M},
Disjoint (Function.mulSupport f) (Function.mulSupport g) → (Function.mulSupport g).mulIndicator (f * g) = g
theorem Set.indicator_add_eq_right E1 #
∀ {α : Type u_1} {M : Type u_4} [inst : AddZeroClass M] {f g : α → M},
Disjoint (Function.support f) (Function.support g) → (Function.support g).indicator (f + g) = g
theorem Set.mulIndicator_mul_compl_eq_piecewise E1 #
∀ {α : Type u_1} {M : Type u_4} [inst : MulOneClass M] {s : Set α} [inst_1 : DecidablePred fun x ↦ x ∈ s] (f g : α → M),
s.mulIndicator f * sᶜ.mulIndicator g = s.piecewise f g
theorem Set.indicator_add_compl_eq_piecewise E1 #
∀ {α : Type u_1} {M : Type u_4} [inst : AddZeroClass M] {s : Set α} [inst_1 : DecidablePred fun x ↦ x ∈ s]
(f g : α → M), s.indicator f + sᶜ.indicator g = s.piecewise f g
def Set.mulIndicatorHom E1 #
{α : Type u_6} → (M : Type u_7) → [inst : MulOneClass M] → Set α → (α → M) →* α → M
Set.mulIndicator as a monoidHom.
def Set.indicatorHom E1 #
{α : Type u_6} → (M : Type u_7) → [inst : AddZeroClass M] → Set α → (α → M) →+ α → M
Set.indicator as an addMonoidHom.
theorem Set.indicator_neg' E1 #
∀ {α : Type u_1} {G : Type u_6} [inst : AddGroup G] (s : Set α) (f : α → G), s.indicator (-f) = -s.indicator f
theorem Set.mulIndicator_inv' E1 #
∀ {α : Type u_1} {G : Type u_6} [inst : Group G] (s : Set α) (f : α → G), s.mulIndicator f⁻¹ = (s.mulIndicator f)⁻¹
theorem Set.indicator_neg E1 #
∀ {α : Type u_1} {G : Type u_6} [inst : AddGroup G] (s : Set α) (f : α → G),
(s.indicator fun a ↦ -f a) = fun a ↦ -s.indicator f a
theorem Set.mulIndicator_inv E1 #
∀ {α : Type u_1} {G : Type u_6} [inst : Group G] (s : Set α) (f : α → G),
(s.mulIndicator fun a ↦ (f a)⁻¹) = fun a ↦ (s.mulIndicator f a)⁻¹
theorem Set.indicator_sub E1 #
∀ {α : Type u_1} {G : Type u_6} [inst : 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 E1 #
∀ {α : Type u_1} {G : Type u_6} [inst : 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' E1 #
∀ {α : Type u_1} {G : Type u_6} [inst : AddGroup G] (s : Set α) (f g : α → G),
s.indicator (f - g) = s.indicator f - s.indicator g
theorem Set.mulIndicator_div' E1 #
∀ {α : Type u_1} {G : Type u_6} [inst : Group G] (s : Set α) (f g : α → G),
s.mulIndicator (f / g) = s.mulIndicator f / s.mulIndicator g
theorem Set.indicator_compl' E1 #
∀ {α : Type u_1} {G : Type u_6} [inst : AddGroup G] (s : Set α) (f : α → G), sᶜ.indicator f = f + -s.indicator f
theorem Set.mulIndicator_compl E1 #
∀ {α : Type u_1} {G : Type u_6} [inst : Group G] (s : Set α) (f : α → G), sᶜ.mulIndicator f = f * (s.mulIndicator f)⁻¹
theorem Set.mulIndicator_compl' E1 #
∀ {α : Type u_1} {G : Type u_6} [inst : Group G] (s : Set α) (f : α → G), sᶜ.mulIndicator f = f / s.mulIndicator f
theorem Set.indicator_compl E1 #
∀ {α : Type u_1} {G : Type u_6} [inst : AddGroup G] (s : Set α) (f : α → G), sᶜ.indicator f = f - s.indicator f
theorem Set.mulIndicator_sdiff E1 #
∀ {α : Type u_1} {G : Type u_6} [inst : Group G] {s t : Set α},
s ⊆ t → ∀ (f : α → G), (t \ s).mulIndicator f = t.mulIndicator f * (s.mulIndicator f)⁻¹
theorem Set.indicator_sdiff' E1 #
∀ {α : Type u_1} {G : Type u_6} [inst : AddGroup G] {s t : Set α},
s ⊆ t → ∀ (f : α → G), (t \ s).indicator f = t.indicator f + -s.indicator f
theorem Set.indicator_sdiff E1 #
∀ {α : Type u_1} {G : Type u_6} [inst : AddGroup G] {s t : Set α},
s ⊆ t → ∀ (f : α → G), (t \ s).indicator f = t.indicator f - s.indicator f
theorem Set.mulIndicator_sdiff' E1 #
∀ {α : Type u_1} {G : Type u_6} [inst : Group G] {s t : Set α},
s ⊆ t → ∀ (f : α → G), (t \ s).mulIndicator f = t.mulIndicator f / s.mulIndicator f
theorem Set.apply_indicator_symmDiff E1 #
∀ {α : Type u_1} {β : Type u_2} {G : Type u_6} [inst : AddGroup G] {g : G → β},
(∀ (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 Set.apply_mulIndicator_symmDiff E1 #
∀ {α : Type u_1} {β : Type u_2} {G : Type u_6} [inst : Group G] {g : G → β},
(∀ (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.support_subset_subsingleton_of_disjoint_on_support E1 #
∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} [inst : Zero β] {s : γ → Set α} (f : α → β),
Pairwise (Function.onFun Disjoint fun j ↦ s j ∩ Function.support f) →
∀ (i : α) (j : γ), i ∈ s j → (Function.support fun d ↦ (s d).indicator f i) ⊆ {j}
theorem Set.mulSupport_subset_subsingleton_of_disjoint_on_mulSupport E1 #
∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} [inst : One β] {s : γ → Set α} (f : α → β),
Pairwise (Function.onFun Disjoint fun j ↦ s j ∩ Function.mulSupport f) →
∀ (i : α) (j : γ), i ∈ s j → (Function.mulSupport fun d ↦ (s d).mulIndicator f i) ⊆ {j}
theorem Set.mulIndicator_singleton E0 #
∀ {ι : Type u_6} [inst : DecidableEq ι] {M : Type u_7} [inst_1 : One M] (i : ι) (f : ι → M),
{i}.mulIndicator f = Pi.mulSingle i (f i)
On non-dependent functions, Set.mulIndicator on a singleton set equals Pi.mulSingle.
theorem Set.indicator_singleton E0 #
∀ {ι : Type u_6} [inst : DecidableEq ι] {M : Type u_7} [inst_1 : Zero M] (i : ι) (f : ι → M),
{i}.indicator f = Pi.single i (f i)
On non-dependent functions, Set.indicator on a singleton set equals Pi.single.
theorem map_indicator E0 #
∀ {α : Type u_1} {M : Type u_6} {N : Type u_7} {F : Type u_8} [inst : Zero M] [inst_1 : Zero N] [inst_2 : FunLike F M N]
[ZeroHomClass F M N] (f : F) (s : Set α) (g : α → M) (x : α), f (s.indicator g x) = s.indicator (⇑f ∘ g) x
theorem map_mulIndicator E0 #
∀ {α : Type u_1} {M : Type u_6} {N : Type u_7} {F : Type u_8} [inst : One M] [inst_1 : One N] [inst_2 : FunLike F M N]
[OneHomClass F M N] (f : F) (s : Set α) (g : α → M) (x : α), f (s.mulIndicator g x) = s.mulIndicator (⇑f ∘ g) x
Deprecated aliases
| Name | New name | Since |
|---|---|---|
Set.mulIndicator_diff | Set.mulIndicator_sdiff | 2026-06-03 |
Set.mulIndicator_diff' | Set.mulIndicator_sdiff' | 2026-06-03 |