Simple functions #
A function f
from a measurable space to any type is called simple, if every preimage f ⁻¹' {x}
is measurable, and the range is finite. In this file, we define simple functions and establish their
basic properties; and we construct a sequence of simple functions approximating an arbitrary Borel
measurable function f : α → ℝ≥0∞
.
The theorem Measurable.ennreal_induction
shows that in order to prove something for an arbitrary
measurable function into ℝ≥0∞
, it is sufficient to show that the property holds for (multiples of)
characteristic functions and is closed under addition and supremum of increasing sequences of
functions.
A function f
from a measurable space to any type is called simple,
if every preimage f ⁻¹' {x}
is measurable, and the range is finite. This structure bundles
a function with these properties.
- toFun : α → β
- measurableSet_fiber' : ∀ (x : β), MeasurableSet (self.toFun ⁻¹' {x})
- finite_range' : (Set.range self.toFun).Finite
Instances For
Equations
- MeasureTheory.SimpleFunc.instFunLike = { coe := MeasureTheory.SimpleFunc.toFun, coe_injective' := ⋯ }
Simple function defined on a finite type.
Equations
- MeasureTheory.SimpleFunc.ofFinite f = { toFun := f, measurableSet_fiber' := ⋯, finite_range' := ⋯ }
Instances For
Alias of MeasureTheory.SimpleFunc.ofFinite
.
Simple function defined on a finite type.
Instances For
Simple function defined on the empty type.
Equations
- MeasureTheory.SimpleFunc.ofIsEmpty = MeasureTheory.SimpleFunc.ofFinite fun (a : α) => isEmptyElim a
Instances For
Range of a simple function α →ₛ β
as a Finset β
.
Equations
- f.range = ⋯.toFinset
Instances For
Constant function as a SimpleFunc
.
Equations
- MeasureTheory.SimpleFunc.const α b = { toFun := fun (x : α) => b, measurableSet_fiber' := ⋯, finite_range' := ⋯ }
Instances For
Equations
- MeasureTheory.SimpleFunc.instInhabited = { default := MeasureTheory.SimpleFunc.const α default }
A simple function is measurable
If-then-else as a SimpleFunc
.
Equations
- MeasureTheory.SimpleFunc.piecewise s hs f g = { toFun := s.piecewise ⇑f ⇑g, measurableSet_fiber' := ⋯, finite_range' := ⋯ }
Instances For
If f : α →ₛ β
is a simple function and g : β → α →ₛ γ
is a family of simple functions,
then f.bind g
binds the first argument of g
to f
. In other words, f.bind g a = g (f a) a
.
Equations
- f.bind g = { toFun := fun (a : α) => (g (f a)) a, measurableSet_fiber' := ⋯, finite_range' := ⋯ }
Instances For
Given a function g : β → γ
and a simple function f : α →ₛ β
, f.map g
return the simple
function g ∘ f : α →ₛ γ
Equations
- MeasureTheory.SimpleFunc.map g f = f.bind (MeasureTheory.SimpleFunc.const α ∘ g)
Instances For
Composition of a SimpleFun
and a measurable function is a SimpleFunc
.
Instances For
Extend a SimpleFunc
along a measurable embedding: f₁.extend g hg f₂
is the function
F : β →ₛ γ
such that F ∘ g = f₁
and F y = f₂ y
whenever y ∉ range g
.
Equations
- f₁.extend g hg f₂ = { toFun := Function.extend g ⇑f₁ ⇑f₂, measurableSet_fiber' := ⋯, finite_range' := ⋯ }
Instances For
If f
is a simple function taking values in β → γ
and g
is another simple function
with the same domain and codomain β
, then f.seq g = f a (g a)
.
Equations
- f.seq g = f.bind fun (f : β → γ) => MeasureTheory.SimpleFunc.map f g
Instances For
Combine two simple functions f : α →ₛ β
and g : α →ₛ β
into fun a => (f a, g a)
.
Equations
- f.pair g = (MeasureTheory.SimpleFunc.map Prod.mk f).seq g
Instances For
Equations
- MeasureTheory.SimpleFunc.instOne = { one := MeasureTheory.SimpleFunc.const α 1 }
Equations
- MeasureTheory.SimpleFunc.instZero = { zero := MeasureTheory.SimpleFunc.const α 0 }
Equations
- MeasureTheory.SimpleFunc.instMul = { mul := fun (f g : MeasureTheory.SimpleFunc α β) => (MeasureTheory.SimpleFunc.map (fun (x1 x2 : β) => x1 * x2) f).seq g }
Equations
- MeasureTheory.SimpleFunc.instAdd = { add := fun (f g : MeasureTheory.SimpleFunc α β) => (MeasureTheory.SimpleFunc.map (fun (x1 x2 : β) => x1 + x2) f).seq g }
Equations
- MeasureTheory.SimpleFunc.instDiv = { div := fun (f g : MeasureTheory.SimpleFunc α β) => (MeasureTheory.SimpleFunc.map (fun (x1 x2 : β) => x1 / x2) f).seq g }
Equations
- MeasureTheory.SimpleFunc.instSub = { sub := fun (f g : MeasureTheory.SimpleFunc α β) => (MeasureTheory.SimpleFunc.map (fun (x1 x2 : β) => x1 - x2) f).seq g }
Equations
- MeasureTheory.SimpleFunc.instInv = { inv := fun (f : MeasureTheory.SimpleFunc α β) => MeasureTheory.SimpleFunc.map Inv.inv f }
Equations
- MeasureTheory.SimpleFunc.instNeg = { neg := fun (f : MeasureTheory.SimpleFunc α β) => MeasureTheory.SimpleFunc.map Neg.neg f }
Equations
- MeasureTheory.SimpleFunc.instSup = { sup := fun (f g : MeasureTheory.SimpleFunc α β) => (MeasureTheory.SimpleFunc.map (fun (x1 x2 : β) => x1 ⊔ x2) f).seq g }
Equations
- MeasureTheory.SimpleFunc.instInf = { inf := fun (f g : MeasureTheory.SimpleFunc α β) => (MeasureTheory.SimpleFunc.map (fun (x1 x2 : β) => x1 ⊓ x2) f).seq g }
Equations
- MeasureTheory.SimpleFunc.instLE = { le := fun (f g : MeasureTheory.SimpleFunc α β) => ∀ (a : α), f a ≤ g a }
Equations
- MeasureTheory.SimpleFunc.instSMul = { smul := fun (k : K) (f : MeasureTheory.SimpleFunc α β) => MeasureTheory.SimpleFunc.map (fun (x : β) => k • x) f }
Equations
- MeasureTheory.SimpleFunc.instVAdd = { vadd := fun (k : K) (f : MeasureTheory.SimpleFunc α β) => MeasureTheory.SimpleFunc.map (fun (x : β) => k +ᵥ x) f }
Equations
- MeasureTheory.SimpleFunc.hasNatSMul = inferInstance
Equations
- MeasureTheory.SimpleFunc.hasNatPow = { pow := fun (f : MeasureTheory.SimpleFunc α β) (n : ℕ) => MeasureTheory.SimpleFunc.map (fun (x : β) => x ^ n) f }
Equations
- MeasureTheory.SimpleFunc.hasIntPow = { pow := fun (f : MeasureTheory.SimpleFunc α β) (n : ℤ) => MeasureTheory.SimpleFunc.map (fun (x : β) => x ^ n) f }
Equations
- MeasureTheory.SimpleFunc.instAddMonoid = Function.Injective.addMonoid (fun (f : MeasureTheory.SimpleFunc α β) => let_fun this := ⇑f; this) ⋯ ⋯ ⋯ ⋯
Equations
- MeasureTheory.SimpleFunc.instAddCommMonoid = Function.Injective.addCommMonoid (fun (f : MeasureTheory.SimpleFunc α β) => let_fun this := ⇑f; this) ⋯ ⋯ ⋯ ⋯
Equations
- MeasureTheory.SimpleFunc.instAddGroup = Function.Injective.addGroup (fun (f : MeasureTheory.SimpleFunc α β) => let_fun this := ⇑f; this) ⋯ ⋯ ⋯ ⋯ ⋯ ⋯ ⋯
Equations
- MeasureTheory.SimpleFunc.instAddCommGroup = Function.Injective.addCommGroup (fun (f : MeasureTheory.SimpleFunc α β) => let_fun this := ⇑f; this) ⋯ ⋯ ⋯ ⋯ ⋯ ⋯ ⋯
Equations
- MeasureTheory.SimpleFunc.instMonoid = Function.Injective.monoid (fun (f : MeasureTheory.SimpleFunc α β) => let_fun this := ⇑f; this) ⋯ ⋯ ⋯ ⋯
Equations
- MeasureTheory.SimpleFunc.instCommMonoid = Function.Injective.commMonoid (fun (f : MeasureTheory.SimpleFunc α β) => let_fun this := ⇑f; this) ⋯ ⋯ ⋯ ⋯
Equations
- MeasureTheory.SimpleFunc.instGroup = Function.Injective.group (fun (f : MeasureTheory.SimpleFunc α β) => let_fun this := ⇑f; this) ⋯ ⋯ ⋯ ⋯ ⋯ ⋯ ⋯
Equations
- MeasureTheory.SimpleFunc.instCommGroup = Function.Injective.commGroup (fun (f : MeasureTheory.SimpleFunc α β) => let_fun this := ⇑f; this) ⋯ ⋯ ⋯ ⋯ ⋯ ⋯ ⋯
Equations
- One or more equations did not get rendered due to their size.
Equations
- MeasureTheory.SimpleFunc.instPreorder = Preorder.mk ⋯ ⋯ ⋯
Equations
- MeasureTheory.SimpleFunc.instPartialOrder = PartialOrder.mk ⋯
Equations
- MeasureTheory.SimpleFunc.instOrderBot = OrderBot.mk ⋯
Equations
- MeasureTheory.SimpleFunc.instOrderTop = OrderTop.mk ⋯
Equations
- MeasureTheory.SimpleFunc.instSemilatticeInf = SemilatticeInf.mk ⋯ ⋯ ⋯
Equations
- MeasureTheory.SimpleFunc.instSemilatticeSup = SemilatticeSup.mk ⋯ ⋯ ⋯
Equations
- MeasureTheory.SimpleFunc.instLattice = Lattice.mk ⋯ ⋯ ⋯
Equations
- MeasureTheory.SimpleFunc.instBoundedOrder = BoundedOrder.mk
Restrict a simple function f : α →ₛ β
to a set s
. If s
is measurable,
then f.restrict s a = if a ∈ s then f a else 0
, otherwise f.restrict s = const α 0
.
Equations
- f.restrict s = if hs : MeasurableSet s then MeasureTheory.SimpleFunc.piecewise s hs f 0 else 0
Instances For
Fix a sequence i : ℕ → β
. Given a function α → β
, its n
-th approximation
by simple functions is defined so that in case β = ℝ≥0∞
it sends each a
to the supremum
of the set {i k | k ≤ n ∧ i k ≤ f a}
, see approx_apply
and iSup_approx_apply
for details.
Equations
- MeasureTheory.SimpleFunc.approx i f n = (Finset.range n).sup fun (k : ℕ) => (MeasureTheory.SimpleFunc.const α (i k)).restrict {a : α | i k ≤ f a}
Instances For
A sequence of ℝ≥0∞
s such that its range is the set of non-negative rational numbers.
Equations
- MeasureTheory.SimpleFunc.ennrealRatEmbed n = ENNReal.ofReal ↑((Encodable.decode n).getD 0)
Instances For
Approximate a function α → ℝ≥0∞
by a sequence of simple functions.
Equations
- MeasureTheory.SimpleFunc.eapprox = MeasureTheory.SimpleFunc.approx MeasureTheory.SimpleFunc.ennrealRatEmbed
Instances For
Approximate a function α → ℝ≥0∞
by a series of simple functions taking their values
in ℝ≥0
.
Equations
- MeasureTheory.SimpleFunc.eapproxDiff f 0 = MeasureTheory.SimpleFunc.map ENNReal.toNNReal (MeasureTheory.SimpleFunc.eapprox f 0)
- MeasureTheory.SimpleFunc.eapproxDiff f n.succ = MeasureTheory.SimpleFunc.map ENNReal.toNNReal (MeasureTheory.SimpleFunc.eapprox f (n + 1) - MeasureTheory.SimpleFunc.eapprox f n)
Instances For
Integral of a simple function whose codomain is ℝ≥0∞
.
Instances For
Calculate the integral of (g ∘ f)
, where g : β → ℝ≥0∞
and f : α →ₛ β
.
Integral of a simple function α →ₛ ℝ≥0∞
as a bilinear map.
Equations
- MeasureTheory.SimpleFunc.lintegralₗ = { toFun := fun (f : MeasureTheory.SimpleFunc α ENNReal) => { toFun := f.lintegral, map_add' := ⋯, map_smul' := ⋯ }, map_add' := ⋯, map_smul' := ⋯ }
Instances For
SimpleFunc.lintegral
is monotone both in function and in measure.
SimpleFunc.lintegral
depends only on the measures of f ⁻¹' {y}
.
If two simple functions are equal a.e., then their lintegral
s are equal.
A SimpleFunc
has finite measure support if it is equal to 0
outside of a set of finite
measure.
Instances For
To prove something for an arbitrary simple function, it suffices to show that the property holds for (multiples of) characteristic functions and is closed under addition (of functions with disjoint support).
It is possible to make the hypotheses in h_add
a bit stronger, and such conditions can be added
once we need them (for example it is only necessary to consider the case where g
is a multiple
of a characteristic function, and that this multiple doesn't appear in the image of f
)
In a topological vector space, the addition of a measurable function and a simple function is measurable.
In a topological vector space, the addition of a simple function and a measurable function is measurable.
To prove something for an arbitrary measurable function into ℝ≥0∞
, it suffices to show
that the property holds for (multiples of) characteristic functions and is closed under addition
and supremum of increasing sequences of functions.
It is possible to make the hypotheses in the induction steps a bit stronger, and such conditions
can be added once we need them (for example in h_add
it is only necessary to consider the sum of
a simple function with a multiple of a characteristic function and that the intersection
of their images is a subset of {0}
.