Theorem: Measurable.add_simpleFunc
File: Mathlib/MeasureTheory/Function/SimpleFunc.lean

tactic: induction' f using SimpleFunc.induction with c s hs f f' hff' hf hf'
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
E : Type u_5
x✝ : MeasurableSpace α
inst✝² : MeasurableSpace E
inst✝¹ : AddGroup E
inst✝ : MeasurableAdd E
g : α → E
hg : Measurable g
f : α →ₛ E
⊢ Measurable (g + ↑f)
state_after: case h_ind
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
E : Type u_5
x✝ : MeasurableSpace α
inst✝² : MeasurableSpace E
inst✝¹ : AddGroup E
inst✝ : MeasurableAdd E
g : α → E
hg : Measurable g
c : E
s : Set α
hs : MeasurableSet s
⊢ Measurable (g + ↑(piecewise s hs (const α c) (const α 0)))

case h_add
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
E : Type u_5
x✝ : MeasurableSpace α
inst✝² : MeasurableSpace E
inst✝¹ : AddGroup E
inst✝ : MeasurableAdd E
g : α → E
hg : Measurable g
f f' : α →ₛ E
hff' : Disjoint (support ↑f) (support ↑f')
hf : Measurable (g + ↑f)
hf' : Measurable (g + ↑f')
⊢ Measurable (g + ↑(f + f'))

tactic: simp only [SimpleFunc.const_zero, SimpleFunc.coe_piecewise, SimpleFunc.coe_const,
  SimpleFunc.coe_zero]
state_before: case h_ind
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
E : Type u_5
x✝ : MeasurableSpace α
inst✝² : MeasurableSpace E
inst✝¹ : AddGroup E
inst✝ : MeasurableAdd E
g : α → E
hg : Measurable g
c : E
s : Set α
hs : MeasurableSet s
⊢ Measurable (g + ↑(piecewise s hs (const α c) (const α 0)))
state_after: case h_ind
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
E : Type u_5
x✝ : MeasurableSpace α
inst✝² : MeasurableSpace E
inst✝¹ : AddGroup E
inst✝ : MeasurableAdd E
g : α → E
hg : Measurable g
c : E
s : Set α
hs : MeasurableSet s
⊢ Measurable (g + s.piecewise (Function.const α c) 0)

tactic: rw [← s.piecewise_same g, ← piecewise_add]
state_before: case h_ind
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
E : Type u_5
x✝ : MeasurableSpace α
inst✝² : MeasurableSpace E
inst✝¹ : AddGroup E
inst✝ : MeasurableAdd E
g : α → E
hg : Measurable g
c : E
s : Set α
hs : MeasurableSet s
⊢ Measurable (g + s.piecewise (Function.const α c) 0)
state_after: case h_ind
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
E : Type u_5
x✝ : MeasurableSpace α
inst✝² : MeasurableSpace E
inst✝¹ : AddGroup E
inst✝ : MeasurableAdd E
g : α → E
hg : Measurable g
c : E
s : Set α
hs : MeasurableSet s
⊢ Measurable (s.piecewise (g + Function.const α c) (g + 0))

tactic: exact Measurable.piecewise hs (hg.add_const _) (hg.add_const _)
state_before: case h_ind
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
E : Type u_5
x✝ : MeasurableSpace α
inst✝² : MeasurableSpace E
inst✝¹ : AddGroup E
inst✝ : MeasurableAdd E
g : α → E
hg : Measurable g
c : E
s : Set α
hs : MeasurableSet s
⊢ Measurable (s.piecewise (g + Function.const α c) (g + 0))
state_after: no goals

tactic: rw [this]
state_before: case h_add
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
E : Type u_5
x✝ : MeasurableSpace α
inst✝² : MeasurableSpace E
inst✝¹ : AddGroup E
inst✝ : MeasurableAdd E
g : α → E
hg : Measurable g
f f' : α →ₛ E
hff' : Disjoint (support ↑f) (support ↑f')
hf : Measurable (g + ↑f)
hf' : Measurable (g + ↑f')
this : g + ↑(f + f') = (support ↑f).piecewise (g + ↑f) (g + ↑f')
⊢ Measurable (g + ↑(f + f'))
state_after: case h_add
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
E : Type u_5
x✝ : MeasurableSpace α
inst✝² : MeasurableSpace E
inst✝¹ : AddGroup E
inst✝ : MeasurableAdd E
g : α → E
hg : Measurable g
f f' : α →ₛ E
hff' : Disjoint (support ↑f) (support ↑f')
hf : Measurable (g + ↑f)
hf' : Measurable (g + ↑f')
this : g + ↑(f + f') = (support ↑f).piecewise (g + ↑f) (g + ↑f')
⊢ Measurable ((support ↑f).piecewise (g + ↑f) (g + ↑f'))

tactic: exact Measurable.piecewise f.measurableSet_support hf hf'
state_before: case h_add
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
E : Type u_5
x✝ : MeasurableSpace α
inst✝² : MeasurableSpace E
inst✝¹ : AddGroup E
inst✝ : MeasurableAdd E
g : α → E
hg : Measurable g
f f' : α →ₛ E
hff' : Disjoint (support ↑f) (support ↑f')
hf : Measurable (g + ↑f)
hf' : Measurable (g + ↑f')
this : g + ↑(f + f') = (support ↑f).piecewise (g + ↑f) (g + ↑f')
⊢ Measurable ((support ↑f).piecewise (g + ↑f) (g + ↑f'))
state_after: no goals

tactic: ext x
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
E : Type u_5
x✝ : MeasurableSpace α
inst✝² : MeasurableSpace E
inst✝¹ : AddGroup E
inst✝ : MeasurableAdd E
g : α → E
hg : Measurable g
f f' : α →ₛ E
hff' : Disjoint (support ↑f) (support ↑f')
hf : Measurable (g + ↑f)
hf' : Measurable (g + ↑f')
⊢ g + ↑(f + f') = (support ↑f).piecewise (g + ↑f) (g + ↑f')
state_after: case h
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
E : Type u_5
x✝ : MeasurableSpace α
inst✝² : MeasurableSpace E
inst✝¹ : AddGroup E
inst✝ : MeasurableAdd E
g : α → E
hg : Measurable g
f f' : α →ₛ E
hff' : Disjoint (support ↑f) (support ↑f')
hf : Measurable (g + ↑f)
hf' : Measurable (g + ↑f')
x : α
⊢ (g + ↑(f + f')) x = (support ↑f).piecewise (g + ↑f) (g + ↑f') x

tactic: by_cases hx : x ∈ Function.support f
state_before: case h
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
E : Type u_5
x✝ : MeasurableSpace α
inst✝² : MeasurableSpace E
inst✝¹ : AddGroup E
inst✝ : MeasurableAdd E
g : α → E
hg : Measurable g
f f' : α →ₛ E
hff' : Disjoint (support ↑f) (support ↑f')
hf : Measurable (g + ↑f)
hf' : Measurable (g + ↑f')
x : α
⊢ (g + ↑(f + f')) x = (support ↑f).piecewise (g + ↑f) (g + ↑f') x
state_after: case pos
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
E : Type u_5
x✝ : MeasurableSpace α
inst✝² : MeasurableSpace E
inst✝¹ : AddGroup E
inst✝ : MeasurableAdd E
g : α → E
hg : Measurable g
f f' : α →ₛ E
hff' : Disjoint (support ↑f) (support ↑f')
hf : Measurable (g + ↑f)
hf' : Measurable (g + ↑f')
x : α
hx : x ∈ support ↑f
⊢ (g + ↑(f + f')) x = (support ↑f).piecewise (g + ↑f) (g + ↑f') x

case neg
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
E : Type u_5
x✝ : MeasurableSpace α
inst✝² : MeasurableSpace E
inst✝¹ : AddGroup E
inst✝ : MeasurableAdd E
g : α → E
hg : Measurable g
f f' : α →ₛ E
hff' : Disjoint (support ↑f) (support ↑f')
hf : Measurable (g + ↑f)
hf' : Measurable (g + ↑f')
x : α
hx : x ∉ support ↑f
⊢ (g + ↑(f + f')) x = (support ↑f).piecewise (g + ↑f) (g + ↑f') x

tactic: simpa only [SimpleFunc.coe_add, Pi.add_apply, Function.mem_support, ne_eq, not_not,
  Set.piecewise_eq_of_mem _ _ _ hx, _root_.add_right_inj, add_right_eq_self]
  using Set.disjoint_left.1 hff' hx
state_before: case pos
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
E : Type u_5
x✝ : MeasurableSpace α
inst✝² : MeasurableSpace E
inst✝¹ : AddGroup E
inst✝ : MeasurableAdd E
g : α → E
hg : Measurable g
f f' : α →ₛ E
hff' : Disjoint (support ↑f) (support ↑f')
hf : Measurable (g + ↑f)
hf' : Measurable (g + ↑f')
x : α
hx : x ∈ support ↑f
⊢ (g + ↑(f + f')) x = (support ↑f).piecewise (g + ↑f) (g + ↑f') x
state_after: no goals

tactic: simpa only [SimpleFunc.coe_add, Pi.add_apply, Function.mem_support, ne_eq, not_not,
  Set.piecewise_eq_of_not_mem _ _ _ hx, _root_.add_right_inj, add_left_eq_self] using hx
state_before: case neg
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
E : Type u_5
x✝ : MeasurableSpace α
inst✝² : MeasurableSpace E
inst✝¹ : AddGroup E
inst✝ : MeasurableAdd E
g : α → E
hg : Measurable g
f f' : α →ₛ E
hff' : Disjoint (support ↑f) (support ↑f')
hf : Measurable (g + ↑f)
hf' : Measurable (g + ↑f')
x : α
hx : x ∉ support ↑f
⊢ (g + ↑(f + f')) x = (support ↑f).piecewise (g + ↑f) (g + ↑f') x
state_after: no goals