Built with
doc-gen4 , running Lean4.
Bubbles (
) indicate interactive fragments: hover for details, tap to reveal contents.
Use
Ctrl+↑ Ctrl+↓ to navigate,
Ctrl+🖱️ to focus.
On Mac, use
Cmd instead of
Ctrl .
/-
Copyright (c) 2020 Zhouhang Zhou. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Zhouhang Zhou
! This file was ported from Lean 3 source module algebra.indicator_function
! leanprover-community/mathlib commit 2445c98ae4b87eabebdde552593519b9b6dc350c
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
import Mathlib.Algebra.Support
/-!
# Indicator function
- `indicator (s : Set α) (f : α → β) (a : α)` is `f a` if `a ∈ s` and is `0` otherwise.
- `mulIndicator (s : Set α) (f : α → β) (a : α)` is `f a` if `a ∈ s` and is `1` otherwise.
## 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 `λx, 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
-/
open BigOperators
open Function
variable { α β ι M N : Type _ : Type (?u.43677+1) Type _}
namespace Set
section One
variable [ One M ] [ One N ] { s t : Set α } { f g : α → M } { a : α }
/-- `indicator s f a` is `f a` if `a ∈ s`, `0` otherwise. -/
noncomputable def indicator : {M : Type ?u.94} → [inst : Zero M ] → Set α → (α → M ) → α → M indicator { M } [ Zero M ] ( s : Set α ) ( f : α → M ) : α → M
| x =>
haveI := Classical.decPred (· ∈ s )
if x ∈ s then f x else 0
#align set.indicator Set.indicator : {α : Type u_1} → {M : Type u_2} → [inst : Zero M ] → Set α → (α → M ) → α → M Set.indicator
/-- `mulIndicator s f a` is `f a` if `a ∈ s`, `1` otherwise. -/
@[ to_additive : {α : Type u_1} → {M : Type u_2} → [inst : Zero M ] → Set α → (α → M ) → α → M to_additive existing ]
noncomputable def mulIndicator : {α : Type u_1} → {M : Type u_2} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator ( s : Set α ) ( f : α → M ) : α → M
| x =>
haveI := Classical.decPred (· ∈ s )
if x ∈ s then f x else 1
#align set.mul_indicator Set.mulIndicator : {α : Type u_1} → {M : Type u_2} → [inst : One M ] → Set α → (α → M ) → α → M Set.mulIndicator
@[ to_additive ( attr := simp )]
theorem piecewise_eq_mulIndicator [ DecidablePred : {α : Sort ?u.478} → (α → Prop ) → Sort (max1?u.478) DecidablePred (· ∈ s )] : s . piecewise : {α : Type ?u.510} →
{β : α → Sort ?u.509 } →
(s : Set α ) → ((i : α ) → β i ) → ((i : α ) → β i ) → [inst : (j : α ) → Decidable (j ∈ s ) ] → (i : α ) → β i piecewise f 1 = s . mulIndicator : {α : Type ?u.620} → {M : Type ?u.619} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator f :=
funext : ∀ {α : Sort ?u.654} {β : α → Sort ?u.653 } {f g : (x : α ) → β x }, (∀ (x : α ), f x = g x ) → f = g funext fun _ => @ if_congr : ∀ {α : Sort ?u.670} {b c : Prop } [inst : Decidable b ] [inst_1 : Decidable c ] {x y u v : α },
(b ↔ c ) → x = u → y = v → (if b then x else y ) = if c then u else v if_congr _ _ _ _ ( id : {α : Sort ?u.675} → α → α id _ ) _ _ _ _ Iff.rfl : ∀ {a : Prop }, a ↔ a Iff.rfl rfl : ∀ {α : Sort ?u.905} {a : α }, a = a rfl rfl : ∀ {α : Sort ?u.908} {a : α }, a = a rfl
#align set.piecewise_eq_mul_indicator Set.piecewise_eq_mulIndicator
#align set.piecewise_eq_indicator Set.piecewise_eq_indicator
-- Porting note: needed unfold for mulIndicator
@[ to_additive ]
theorem mulIndicator_apply ( s : Set α ) ( f : α → M ) ( a : α ) [ Decidable ( a ∈ s )] :
mulIndicator : {α : Type ?u.1110} → {M : Type ?u.1109} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator s f a = if a ∈ s then f a else 1 := by
unfold mulIndicator : {α : Type u_1} → {M : Type u_2} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator(let x := a ;
if x ∈ s then f x else 1 ) = if a ∈ s then f a else 1
split_ifs with h (let x := a ;
if x ∈ s then f x else 1 ) = if a ∈ s then f a else 1 <;> (let x := a ;
if x ∈ s then f x else 1 ) = if a ∈ s then f a else 1 simp
#align set.mul_indicator_apply Set.mulIndicator_apply
#align set.indicator_apply Set.indicator_apply
@[ to_additive ( attr := simp )]
theorem mulIndicator_of_mem ( h : a ∈ s ) ( f : α → M ) : mulIndicator : {α : Type ?u.1867} → {M : Type ?u.1866} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator s f a = f a :=
letI := Classical.dec ( a ∈ s )
if_pos : ∀ {c : Prop } {h : Decidable c }, c → ∀ {α : Sort ?u.1915} {t e : α }, (if c then t else e ) = t if_pos h
#align set.mul_indicator_of_mem Set.mulIndicator_of_mem : ∀ {α : Type u_1} {M : Type u_2} [inst : One M ] {s : Set α } {a : α }, a ∈ s → ∀ (f : α → M ), mulIndicator s f a = f a Set.mulIndicator_of_mem
#align set.indicator_of_mem Set.indicator_of_mem : ∀ {α : Type u_1} {M : Type u_2} [inst : Zero M ] {s : Set α } {a : α }, a ∈ s → ∀ (f : α → M ), indicator s f a = f a Set.indicator_of_mem
@[ to_additive ( attr := simp )]
theorem mulIndicator_of_not_mem ( h : a ∉ s ) ( f : α → M ) : mulIndicator : {α : Type ?u.2084} → {M : Type ?u.2083} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator s f a = 1 :=
letI := Classical.dec ( a ∈ s )
if_neg : ∀ {c : Prop } {h : Decidable c }, ¬ c → ∀ {α : Sort ?u.2170} {t e : α }, (if c then t else e ) = e if_neg h
#align set.mul_indicator_of_not_mem Set.mulIndicator_of_not_mem
#align set.indicator_of_not_mem Set.indicator_of_not_mem : ∀ {α : Type u_1} {M : Type u_2} [inst : Zero M ] {s : Set α } {a : α }, ¬ a ∈ s → ∀ (f : α → M ), indicator s f a = 0 Set.indicator_of_not_mem
@[ to_additive ]
theorem mulIndicator_eq_one_or_self ( s : Set α ) ( f : α → M ) ( a : α ) :
mulIndicator : {α : Type ?u.2329} → {M : Type ?u.2328} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator s f a = 1 ∨ mulIndicator : {α : Type ?u.2395} → {M : Type ?u.2394} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator s f a = f a := by
by_cases h : a ∈ s
· exact Or.inr : ∀ {a b : Prop }, b → a ∨ b Or.inr ( mulIndicator_of_mem : ∀ {α : Type ?u.2453} {M : Type ?u.2454} [inst : One M ] {s : Set α } {a : α },
a ∈ s → ∀ (f : α → M ), mulIndicator s f a = f a mulIndicator_of_mem h f )
· exact Or.inl : ∀ {a b : Prop }, a → a ∨ b Or.inl ( mulIndicator_of_not_mem : ∀ {α : Type ?u.2490} {M : Type ?u.2491} [inst : One M ] {s : Set α } {a : α },
¬ a ∈ s → ∀ (f : α → M ), mulIndicator s f a = 1 mulIndicator_of_not_mem h f )
#align set.mul_indicator_eq_one_or_self Set.mulIndicator_eq_one_or_self
#align set.indicator_eq_zero_or_self Set.indicator_eq_zero_or_self
@[ to_additive ( attr := simp )]
theorem mulIndicator_apply_eq_self : s . mulIndicator : {α : Type ?u.2586} → {M : Type ?u.2585} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator f a = f a ↔ a ∉ s → f a = 1 :=
letI := Classical.dec ( a ∈ s )
ite_eq_left_iff : ∀ {α : Sort ?u.2695} {P : Prop } [inst : Decidable P ] {a b : α }, (if P then a else b ) = a ↔ ¬ P → b = a ite_eq_left_iff. trans : ∀ {a b c : Prop }, (a ↔ b ) → (b ↔ c ) → (a ↔ c ) trans ( by ¬ a ∈ s → 1 = f a ↔ ¬ a ∈ s → f a = 1 rw [ ¬ a ∈ s → 1 = f a ↔ ¬ a ∈ s → f a = 1 @ eq_comm : ∀ {α : Sort ?u.2930} {a b : α }, a = b ↔ b = a eq_comm _ ( f a ) ¬ a ∈ s → 1 = f a ↔ ¬ a ∈ s → 1 = f a ] )
#align set.mul_indicator_apply_eq_self Set.mulIndicator_apply_eq_self : ∀ {α : Type u_2} {M : Type u_1} [inst : One M ] {s : Set α } {f : α → M } {a : α },
mulIndicator s f a = f a ↔ ¬ a ∈ s → f a = 1 Set.mulIndicator_apply_eq_self
#align set.indicator_apply_eq_self Set.indicator_apply_eq_self : ∀ {α : Type u_2} {M : Type u_1} [inst : Zero M ] {s : Set α } {f : α → M } {a : α },
indicator s f a = f a ↔ ¬ a ∈ s → f a = 0 Set.indicator_apply_eq_self
@[ to_additive ( attr := simp )]
theorem mulIndicator_eq_self : s . mulIndicator : {α : Type ?u.3109} → {M : Type ?u.3108} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator f = f ↔ mulSupport : {α : Type ?u.3146} → {M : Type ?u.3145} → [inst : One M ] → (α → M ) → Set α mulSupport f ⊆ s := by
simp only [ funext_iff : ∀ {α : Sort ?u.3209} {β : α → Sort ?u.3208 } {f₁ f₂ : (x : α ) → β x }, f₁ = f₂ ↔ ∀ (a : α ), f₁ a = f₂ a funext_iff, subset_def : ∀ {α : Type ?u.3229} {s t : Set α }, (s ⊆ t ) = ∀ (x : α ), x ∈ s → x ∈ t subset_def, mem_mulSupport , mulIndicator_apply_eq_self : ∀ {α : Type ?u.3276} {M : Type ?u.3275} [inst : One M ] {s : Set α } {f : α → M } {a : α },
mulIndicator s f a = f a ↔ ¬ a ∈ s → f a = 1 mulIndicator_apply_eq_self, not_imp_comm : ∀ {a b : Prop }, ¬ a → b ↔ ¬ b → a not_imp_comm]
#align set.mul_indicator_eq_self Set.mulIndicator_eq_self
#align set.indicator_eq_self Set.indicator_eq_self
@[ to_additive ]
theorem mulIndicator_eq_self_of_superset ( h1 : s . mulIndicator : {α : Type ?u.3845} → {M : Type ?u.3844} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator f = f ) ( h2 : s ⊆ t ) :
t . mulIndicator : {α : Type ?u.3902} → {M : Type ?u.3901} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator f = f := by
rw [ mulIndicator_eq_self ] at h1 ⊢
exact Subset.trans : ∀ {α : Type ?u.4188} {a b c : Set α }, a ⊆ b → b ⊆ c → a ⊆ c Subset.trans h1 h2
#align set.mul_indicator_eq_self_of_superset Set.mulIndicator_eq_self_of_superset
#align set.indicator_eq_self_of_superset Set.indicator_eq_self_of_superset
@[ to_additive ( attr := simp )]
theorem mulIndicator_apply_eq_one : mulIndicator : {α : Type ?u.4296} → {M : Type ?u.4295} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator s f a = 1 ↔ a ∈ s → f a = 1 :=
letI := Classical.dec ( a ∈ s )
ite_eq_right_iff : ∀ {α : Sort ?u.4430} {P : Prop } [inst : Decidable P ] {a b : α }, (if P then a else b ) = b ↔ P → a = b ite_eq_right_iff
#align set.mul_indicator_apply_eq_one Set.mulIndicator_apply_eq_one : ∀ {α : Type u_2} {M : Type u_1} [inst : One M ] {s : Set α } {f : α → M } {a : α }, mulIndicator s f a = 1 ↔ a ∈ s → f a = 1 Set.mulIndicator_apply_eq_one
#align set.indicator_apply_eq_zero Set.indicator_apply_eq_zero : ∀ {α : Type u_2} {M : Type u_1} [inst : Zero M ] {s : Set α } {f : α → M } {a : α }, indicator s f a = 0 ↔ a ∈ s → f a = 0 Set.indicator_apply_eq_zero
@[ to_additive ( attr := simp )]
theorem mulIndicator_eq_one : ( mulIndicator : {α : Type ?u.4806} → {M : Type ?u.4805} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator s f = fun x => 1 ) ↔ Disjoint ( mulSupport : {α : Type ?u.4923} → {M : Type ?u.4922} → [inst : One M ] → (α → M ) → Set α mulSupport f ) s := by
simp only [ funext_iff : ∀ {α : Sort ?u.5311} {β : α → Sort ?u.5310 } {f₁ f₂ : (x : α ) → β x }, f₁ = f₂ ↔ ∀ (a : α ), f₁ a = f₂ a funext_iff, mulIndicator_apply_eq_one : ∀ {α : Type ?u.5332} {M : Type ?u.5331} [inst : One M ] {s : Set α } {f : α → M } {a : α },
mulIndicator s f a = 1 ↔ a ∈ s → f a = 1 mulIndicator_apply_eq_one, Set.disjoint_left : ∀ {α : Type ?u.5369} {s t : Set α }, Disjoint s t ↔ ∀ ⦃a : α ⦄, a ∈ s → ¬ a ∈ t Set.disjoint_left, mem_mulSupport ,
not_imp_not : ∀ {a b : Prop }, ¬ a → ¬ b ↔ b → a not_imp_not]
#align set.mul_indicator_eq_one Set.mulIndicator_eq_one
#align set.indicator_eq_zero Set.indicator_eq_zero
@[ to_additive ( attr := simp )]
theorem mulIndicator_eq_one' : mulIndicator : {α : Type ?u.5957} → {M : Type ?u.5956} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator s f = 1 ↔ Disjoint ( mulSupport : {α : Type ?u.6069} → {M : Type ?u.6068} → [inst : One M ] → (α → M ) → Set α mulSupport f ) s :=
mulIndicator_eq_one
#align set.mul_indicator_eq_one' Set.mulIndicator_eq_one'
#align set.indicator_eq_zero' Set.indicator_eq_zero'
@[ to_additive ]
theorem mulIndicator_apply_ne_one { a : α } : s . mulIndicator : {α : Type ?u.6662} → {M : Type ?u.6661} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator f a ≠ 1 ↔ a ∈ s ∩ mulSupport : {α : Type ?u.6766} → {M : Type ?u.6765} → [inst : One M ] → (α → M ) → Set α mulSupport f := by
simp only [ Ne.def : ∀ {α : Sort ?u.6838} (a b : α ), (a ≠ b ) = ¬ a = b Ne.def, mulIndicator_apply_eq_one : ∀ {α : Type ?u.6851} {M : Type ?u.6850} [inst : One M ] {s : Set α } {f : α → M } {a : α },
mulIndicator s f a = 1 ↔ a ∈ s → f a = 1 mulIndicator_apply_eq_one, not_imp : ∀ {a b : Prop }, ¬ (a → b ) ↔ a ∧ ¬ b not_imp, mem_inter_iff : ∀ {α : Type ?u.6898} (x : α ) (a b : Set α ), x ∈ a ∩ b ↔ x ∈ a ∧ x ∈ b mem_inter_iff, mem_mulSupport ]
#align set.mul_indicator_apply_ne_one Set.mulIndicator_apply_ne_one
#align set.indicator_apply_ne_zero Set.indicator_apply_ne_zero
@[ to_additive ( attr := simp )]
theorem mulSupport_mulIndicator :
Function.mulSupport : {α : Type ?u.7278} → {M : Type ?u.7277} → [inst : One M ] → (α → M ) → Set α Function.mulSupport ( s . mulIndicator : {α : Type ?u.7283} → {M : Type ?u.7282} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator f ) = s ∩ Function.mulSupport : {α : Type ?u.7356} → {M : Type ?u.7355} → [inst : One M ] → (α → M ) → Set α Function.mulSupport f :=
ext : ∀ {α : Type ?u.7407} {a b : Set α }, (∀ (x : α ), x ∈ a ↔ x ∈ b ) → a = b ext fun x => by simp [ Function.mem_mulSupport : ∀ {α : Type ?u.7424} {M : Type ?u.7425} [inst : One M ] {f : α → M } {x : α }, x ∈ mulSupport f ↔ f x ≠ 1 Function.mem_mulSupport, mulIndicator_apply_eq_one : ∀ {α : Type ?u.7458} {M : Type ?u.7457} [inst : One M ] {s : Set α } {f : α → M } {a : α },
mulIndicator s f a = 1 ↔ a ∈ s → f a = 1 mulIndicator_apply_eq_one]
#align set.mul_support_mul_indicator Set.mulSupport_mulIndicator
#align set.support_indicator Set.support_indicator
/-- If a multiplicative indicator function is not equal to `1` at a point, then that point is in the
set. -/
@[ to_additive
"If an additive indicator function is not equal to `0` at a point, then that point is
in the set."]
theorem mem_of_mulIndicator_ne_one ( h : mulIndicator : {α : Type ?u.8533} → {M : Type ?u.8532} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator s f a ≠ 1 ) : a ∈ s :=
not_imp_comm : ∀ {a b : Prop }, ¬ a → b ↔ ¬ b → a not_imp_comm. 1 : ∀ {a b : Prop }, (a ↔ b ) → a → b 1 ( fun hn => mulIndicator_of_not_mem : ∀ {α : Type ?u.8660} {M : Type ?u.8661} [inst : One M ] {s : Set α } {a : α },
¬ a ∈ s → ∀ (f : α → M ), mulIndicator s f a = 1 mulIndicator_of_not_mem hn f ) h
#align set.mem_of_mul_indicator_ne_one Set.mem_of_mulIndicator_ne_one : ∀ {α : Type u_2} {M : Type u_1} [inst : One M ] {s : Set α } {f : α → M } {a : α }, mulIndicator s f a ≠ 1 → a ∈ s Set.mem_of_mulIndicator_ne_one
#align set.mem_of_indicator_ne_zero Set.mem_of_indicator_ne_zero : ∀ {α : Type u_2} {M : Type u_1} [inst : Zero M ] {s : Set α } {f : α → M } {a : α }, indicator s f a ≠ 0 → a ∈ s Set.mem_of_indicator_ne_zero
@[ to_additive ]
theorem eqOn_mulIndicator : EqOn : {α : Type ?u.8788} → {β : Type ?u.8787} → (α → β ) → (α → β ) → Set α → Prop EqOn ( mulIndicator : {α : Type ?u.8792} → {M : Type ?u.8791} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator s f ) f s := fun _ hx => mulIndicator_of_mem : ∀ {α : Type ?u.8866} {M : Type ?u.8867} [inst : One M ] {s : Set α } {a : α },
a ∈ s → ∀ (f : α → M ), mulIndicator s f a = f a mulIndicator_of_mem hx f
#align set.eq_on_mul_indicator Set.eqOn_mulIndicator
#align set.eq_on_indicator Set.eqOn_indicator
@[ to_additive ]
theorem mulSupport_mulIndicator_subset : mulSupport : {α : Type ?u.8990} → {M : Type ?u.8989} → [inst : One M ] → (α → M ) → Set α mulSupport ( s . mulIndicator : {α : Type ?u.9029} → {M : Type ?u.9028} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator f ) ⊆ s := fun _ hx =>
hx . imp_symm : ∀ {a b : Prop }, (¬ a → b ) → ¬ b → a imp_symm fun h => mulIndicator_of_not_mem : ∀ {α : Type ?u.9120} {M : Type ?u.9121} [inst : One M ] {s : Set α } {a : α },
¬ a ∈ s → ∀ (f : α → M ), mulIndicator s f a = 1 mulIndicator_of_not_mem h f
#align set.mul_support_mul_indicator_subset Set.mulSupport_mulIndicator_subset
#align set.support_indicator_subset Set.support_indicator_subset
@[ to_additive ( attr := simp )]
theorem mulIndicator_mulSupport : mulIndicator : {α : Type ?u.9242} → {M : Type ?u.9241} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator ( mulSupport : {α : Type ?u.9247} → {M : Type ?u.9246} → [inst : One M ] → (α → M ) → Set α mulSupport f ) f = f :=
mulIndicator_eq_self . 2 : ∀ {a b : Prop }, (a ↔ b ) → b → a 2 Subset.rfl : ∀ {α : Type ?u.9372} {s : Set α }, s ⊆ s Subset.rfl
#align set.mul_indicator_mul_support Set.mulIndicator_mulSupport
#align set.indicator_support Set.indicator_support
@[ to_additive ( attr := simp )]
theorem mulIndicator_range_comp { ι : Sort _ } ( f : ι → α ) ( g : α → M ) :
mulIndicator : {α : Type ?u.9519} → {M : Type ?u.9518} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator ( range : {α : Type ?u.9559} → {ι : Sort ?u.9558} → (ι → α ) → Set α range f ) g ∘ f = g ∘ f :=
letI := Classical.decPred (· ∈ range : {α : Type ?u.9627} → {ι : Sort ?u.9626} → (ι → α ) → Set α range f )
piecewise_range_comp _ _ _
#align set.mul_indicator_range_comp Set.mulIndicator_range_comp
#align set.indicator_range_comp Set.indicator_range_comp
@[ to_additive ]
theorem mulIndicator_congr ( h : EqOn : {α : Type ?u.9899} → {β : Type ?u.9898} → (α → β ) → (α → β ) → Set α → Prop EqOn f g s ) : mulIndicator : {α : Type ?u.9914} → {M : Type ?u.9913} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator s f = mulIndicator : {α : Type ?u.9940} → {M : Type ?u.9939} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator s g :=
funext : ∀ {α : Sort ?u.9956} {β : α → Sort ?u.9955 } {f g : (x : α ) → β x }, (∀ (x : α ), f x = g x ) → f = g funext fun x => by
simp only [ mulIndicator : {α : Type ?u.9992} → {M : Type ?u.9991} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator] (if x ∈ s then f x else 1 ) = if x ∈ s then g x else 1
split_ifs with h_1
· exact h h_1
rfl
#align set.mul_indicator_congr Set.mulIndicator_congr
#align set.indicator_congr Set.indicator_congr
@[ to_additive ( attr := simp )]
theorem mulIndicator_univ ( f : α → M ) : mulIndicator : {α : Type ?u.10709} → {M : Type ?u.10708} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator ( univ : Set α ) f = f :=
mulIndicator_eq_self . 2 : ∀ {a b : Prop }, (a ↔ b ) → b → a 2 <| subset_univ : ∀ {α : Type ?u.10801} (s : Set α ), s ⊆ univ subset_univ _
#align set.mul_indicator_univ Set.mulIndicator_univ
#align set.indicator_univ Set.indicator_univ
@[ to_additive ( attr := simp )]
theorem mulIndicator_empty ( f : α → M ) : mulIndicator : {α : Type ?u.10928} → {M : Type ?u.10927} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator ( ∅ : Set α ) f = fun _ => 1 :=
mulIndicator_eq_one . 2 : ∀ {a b : Prop }, (a ↔ b ) → b → a 2 <| disjoint_empty _
#align set.mul_indicator_empty Set.mulIndicator_empty
#align set.indicator_empty Set.indicator_empty
@[ to_additive ]
theorem mulIndicator_empty' ( f : α → M ) : mulIndicator : {α : Type ?u.11291} → {M : Type ?u.11290} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator ( ∅ : Set α ) f = 1 :=
mulIndicator_empty f
#align set.mul_indicator_empty' Set.mulIndicator_empty'
#align set.indicator_empty' Set.indicator_empty'
variable ( M )
@[ to_additive ( attr := simp )]
theorem mulIndicator_one ( s : Set α ) : ( mulIndicator : {α : Type ?u.11585} → {M : Type ?u.11584} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator s fun _ => ( 1 : M )) = fun _ => ( 1 : M ) :=
mulIndicator_eq_one . 2 : ∀ {a b : Prop }, (a ↔ b ) → b → a 2 <| by simp only [ mulSupport_one , empty_disjoint ]
#align set.mul_indicator_one Set.mulIndicator_one
#align set.indicator_zero Set.indicator_zero
@[ to_additive ( attr := simp )]
theorem mulIndicator_one' { s : Set α } : s . mulIndicator : {α : Type ?u.12039} → {M : Type ?u.12038} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator ( 1 : α → M ) = 1 :=
mulIndicator_one M s
#align set.mul_indicator_one' Set.mulIndicator_one'
#align set.indicator_zero' Set.indicator_zero'
variable { M }
@[ to_additive ]
theorem mulIndicator_mulIndicator ( s t : Set α ) ( f : α → M ) :
mulIndicator : {α : Type ?u.12344} → {M : Type ?u.12343} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator s ( mulIndicator : {α : Type ?u.12352} → {M : Type ?u.12351} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator t f ) = mulIndicator : {α : Type ?u.12415} → {M : Type ?u.12414} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator ( s ∩ t ) f :=
funext : ∀ {α : Sort ?u.12451} {β : α → Sort ?u.12450 } {f g : (x : α ) → β x }, (∀ (x : α ), f x = g x ) → f = g funext fun x => by
simp only [ mulIndicator : {α : Type ?u.12487} → {M : Type ?u.12486} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator] (if x ∈ s then if x ∈ t then f x else 1 else 1 ) = if x ∈ s ∩ t then f x else 1
split_ifs α : Type u_1β : Type ?u.12298ι : Type ?u.12301M : Type u_2N : Type ?u.12307inst✝¹ : One M inst✝ : One N s✝, t✝ : Set α f✝, g : α → M a : α s, t : Set α f : α → M x : α h✝² : x ∈ s h✝¹ : x ∈ t h✝ : x ∈ s ∩ t inl.inl.inl inl.inl.inr inl.inr.inl inl.inr.inr inr.inl inr.inr
repeat' α : Type u_1β : Type ?u.12298ι : Type ?u.12301M : Type u_2N : Type ?u.12307inst✝¹ : One M inst✝ : One N s✝, t✝ : Set α f✝, g : α → M a : α s, t : Set α f : α → M x : α h✝² : x ∈ s h✝¹ : x ∈ t h✝ : x ∈ s ∩ t inl.inl.inl inl.inl.inr inl.inr.inl inl.inr.inr inr.inl inr.inr simp_all ( config := { contextual := true })
#align set.mul_indicator_mul_indicator Set.mulIndicator_mulIndicator
#align set.indicator_indicator Set.indicator_indicator
@[ to_additive ( attr := simp )]
theorem mulIndicator_inter_mulSupport ( s : Set α ) ( f : α → M ) :
mulIndicator : {α : Type ?u.15936} → {M : Type ?u.15935} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator ( s ∩ mulSupport : {α : Type ?u.15954} → {M : Type ?u.15953} → [inst : One M ] → (α → M ) → Set α mulSupport f ) f = mulIndicator : {α : Type ?u.16023} → {M : Type ?u.16022} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator s f := by
rw [ ← mulIndicator_mulIndicator , mulIndicator_mulSupport ]
#align set.mul_indicator_inter_mul_support Set.mulIndicator_inter_mulSupport
#align set.indicator_inter_support Set.indicator_inter_support
@[ to_additive ]
theorem comp_mulIndicator ( h : M → β ) ( f : α → M ) { s : Set α } { x : α } [ DecidablePred : {α : Sort ?u.16387} → (α → Prop ) → Sort (max1?u.16387) DecidablePred (· ∈ s )] :
h ( s . mulIndicator : {α : Type ?u.16419} → {M : Type ?u.16418} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator f x ) = s . piecewise : {α : Type ?u.16481} →
{β : α → Sort ?u.16480 } →
(s : Set α ) → ((i : α ) → β i ) → ((i : α ) → β i ) → [inst : (j : α ) → Decidable (j ∈ s ) ] → (i : α ) → β i piecewise ( h ∘ f ) ( const : {α : Sort ?u.16513} → (β : Sort ?u.16512) → α → β → α const α ( h 1 )) x := by
letI := Classical.decPred (· ∈ s )
convert s . apply_piecewise : ∀ {α : Type ?u.16612} {δ : α → Sort ?u.16613 } (s : Set α ) (f g : (i : α ) → δ i ) [inst : (j : α ) → Decidable (j ∈ s ) ]
{δ' : α → Sort ?u.16611 } (h : (i : α ) → δ i → δ' i ) {x : α },
h x (piecewise s f g x ) = piecewise s (fun x => h x (f x ) ) (fun x => h x (g x ) ) x apply_piecewise f ( const : {α : Sort ?u.16650} → (β : Sort ?u.16649) → α → β → α const α 1 ) ( fun _ => h ) (x := x ) using 2
#align set.comp_mul_indicator Set.comp_mulIndicator
#align set.comp_indicator Set.comp_indicator
@[ to_additive ]
theorem mulIndicator_comp_right { s : Set α } ( f : β → α ) { g : α → M } { x : β } :
mulIndicator : {α : Type ?u.20715} → {M : Type ?u.20714} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator ( f ⁻¹' s ) ( g ∘ f ) x = mulIndicator : {α : Type ?u.20765} → {M : Type ?u.20764} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator s g ( f x ) := by
simp only [ mulIndicator : {α : Type ?u.20794} → {M : Type ?u.20793} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator, Function.comp : {α : Sort ?u.20825} → {β : Sort ?u.20824} → {δ : Sort ?u.20823} → (β → δ ) → (α → β ) → α → δ Function.comp] (if x ∈ f ⁻¹' s then g (f x ) else 1 ) = if f x ∈ s then g (f x ) else 1
split_ifs with h h' h'' inl.inl inl.inr inr.inl inr.inr (if x ∈ f ⁻¹' s then g (f x ) else 1 ) = if f x ∈ s then g (f x ) else 1 <;> inl.inl inl.inr inr.inl inr.inr (if x ∈ f ⁻¹' s then g (f x ) else 1 ) = if f x ∈ s then g (f x ) else 1 first | rfl | contradiction
#align set.mul_indicator_comp_right Set.mulIndicator_comp_right
#align set.indicator_comp_right Set.indicator_comp_right
@[ to_additive ]
theorem mulIndicator_image { s : Set α } { f : β → M } { g : α → β } ( hg : Injective : {α : Sort ?u.22161} → {β : Sort ?u.22160} → (α → β ) → Prop Injective g ) { x : α } :
mulIndicator : {α : Type ?u.22173} → {M : Type ?u.22172} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator ( g '' s ) f ( g x ) = mulIndicator : {α : Type ?u.22209} → {M : Type ?u.22208} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator s ( f ∘ g ) x := by
rw [ ← mulIndicator_comp_right , preimage_image_eq _ hg ]
#align set.mul_indicator_image Set.mulIndicator_image
#align set.indicator_image Set.indicator_image
@[ to_additive ]
theorem mulIndicator_comp_of_one { g : M → N } ( hg : g 1 = 1 ) :
mulIndicator : {α : Type ?u.22568} → {M : Type ?u.22567} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator s ( g ∘ f ) = g ∘ mulIndicator : {α : Type ?u.22616} → {M : Type ?u.22615} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator s f := by
funext
simp only [ mulIndicator : {α : Type ?u.22741} → {M : Type ?u.22740} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator]
split_ifs <;> simp [*]
#align set.mul_indicator_comp_of_one Set.mulIndicator_comp_of_one
#align set.indicator_comp_of_zero Set.indicator_comp_of_zero
@[ to_additive ]
theorem comp_mulIndicator_const : ∀ (c : M ) (f : M → N ), f 1 = 1 → (fun x => f (mulIndicator s (fun x => c ) x ) ) = mulIndicator s fun x => f c comp_mulIndicator_const ( c : M ) ( f : M → N ) ( hf : f 1 = 1 ) :
( fun x => f ( s . mulIndicator : {α : Type ?u.23656} → {M : Type ?u.23655} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator ( fun _ => c ) x )) = s . mulIndicator : {α : Type ?u.23719} → {M : Type ?u.23718} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator fun _ => f c :=
( mulIndicator_comp_of_one hf ). symm : ∀ {α : Sort ?u.23816} {a b : α }, a = b → b = a symm
#align set.comp_mul_indicator_const Set.comp_mulIndicator_const
#align set.comp_indicator_const Set.comp_indicator_const : ∀ {α : Type u_3} {M : Type u_2} {N : Type u_1} [inst : Zero M ] [inst_1 : Zero N ] {s : Set α } (c : M ) (f : M → N ),
f 0 = 0 → (fun x => f (indicator s (fun x => c ) x ) ) = indicator s fun x => f c Set.comp_indicator_const
@[ to_additive ]
theorem mulIndicator_preimage ( s : Set α ) ( f : α → M ) ( B : Set M ) :
mulIndicator : {α : Type ?u.23970} → {M : Type ?u.23969} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator s f ⁻¹' B = s . ite ( f ⁻¹' B ) ( 1 ⁻¹' B ) :=
letI := Classical.decPred (· ∈ s )
piecewise_preimage s f 1 B
#align set.mul_indicator_preimage Set.mulIndicator_preimage
#align set.indicator_preimage Set.indicator_preimage
@[ to_additive ]
theorem mulIndicator_one_preimage ( s : Set M ) :
t . mulIndicator : {α : Type ?u.24480} → {M : Type ?u.24479} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator 1 ⁻¹' s ∈ ({ Set.univ : {α : Type ?u.24686} → Set α Set.univ, ∅ } : Set ( Set α )) := by
classical
rw [ mulIndicator_one' , preimage_one (if 1 ∈ s then univ else ∅ ) ∈ {univ , ∅ } ] (if 1 ∈ s then univ else ∅ ) ∈ {univ , ∅ }
split_ifs (if 1 ∈ s then univ else ∅ ) ∈ {univ , ∅ } <;> (if 1 ∈ s then univ else ∅ ) ∈ {univ , ∅ } simp
#align set.mul_indicator_one_preimage Set.mulIndicator_one_preimage
#align set.indicator_zero_preimage Set.indicator_zero_preimage
@[ to_additive ]
theorem mulIndicator_const_preimage_eq_union ( U : Set α ) ( s : Set M ) ( a : M ) [ Decidable ( a ∈ s )]
[ Decidable (( 1 : M ) ∈ s )] : ( U . mulIndicator : {α : Type ?u.27097} → {M : Type ?u.27096} → [inst : One M ] → Set α → (α → M ) → α → M mulIndicator fun _ => a ) ⁻¹' s =
( if a ∈ s then U else ∅ ) ∪ if ( 1 : M ) ∈ s then U ᶜ else ∅ := by
rw [