Theorem: MeasureTheory.SimpleFunc.lintegral_eq_of_subset
File: Mathlib/MeasureTheory/Function/SimpleFunc.lean

tactic: refine' Finset.sum_bij_ne_zero (fun r _ _ => r) _ _ _ _
state_before: α : Type u_1
β : Type ?u.852623
γ : Type ?u.852626
δ : Type ?u.852629
m : MeasurableSpace α
μ ν : Measure α
f : α →ₛ ℝ≥0∞
s : Finset ℝ≥0∞
hs : ∀ (x : α), ↑f x ≠ 0 → ↑↑μ (↑f ⁻¹' {↑f x}) ≠ 0 → ↑f x ∈ s
⊢ lintegral f μ = ∑ x in s, x * ↑↑μ (↑f ⁻¹' {x})

tactic: simpa only [forall_range_iff, mul_ne_zero_iff, and_imp]
state_before: case refine'_1
α : Type u_1
β : Type ?u.852623
γ : Type ?u.852626
δ : Type ?u.852629
m : MeasurableSpace α
μ ν : Measure α
f : α →ₛ ℝ≥0∞
s : Finset ℝ≥0∞
hs : ∀ (x : α), ↑f x ≠ 0 → ↑↑μ (↑f ⁻¹' {↑f x}) ≠ 0 → ↑f x ∈ s
⊢ ∀ (a : ℝ≥0∞) (h₁ : a ∈ SimpleFunc.range f) (h₂ : a * ↑↑μ (↑f ⁻¹' {a}) ≠ 0), (fun r x x => r) a h₁ h₂ ∈ s

tactic: intros
state_before: case refine'_2
α : Type u_1
β : Type ?u.852623
γ : Type ?u.852626
δ : Type ?u.852629
m : MeasurableSpace α
μ ν : Measure α
f : α →ₛ ℝ≥0∞
s : Finset ℝ≥0∞
hs : ∀ (x : α), ↑f x ≠ 0 → ↑↑μ (↑f ⁻¹' {↑f x}) ≠ 0 → ↑f x ∈ s
⊢ ∀ (a₁ a₂ : ℝ≥0∞) (h₁₁ : a₁ ∈ SimpleFunc.range f) (h₁₂ : a₁ * ↑↑μ (↑f ⁻¹' {a₁}) ≠ 0) (h₂₁ : a₂ ∈ SimpleFunc.range f)
    (h₂₂ : a₂ * ↑↑μ (↑f ⁻¹' {a₂}) ≠ 0), (fun r x x => r) a₁ h₁₁ h₁₂ = (fun r x x => r) a₂ h₂₁ h₂₂ → a₁ = a₂

tactic: assumption
state_before: case refine'_2
α : Type u_1
β : Type ?u.852623
γ : Type ?u.852626
δ : Type ?u.852629
m : MeasurableSpace α
μ ν : Measure α
f : α →ₛ ℝ≥0∞
s : Finset ℝ≥0∞
hs : ∀ (x : α), ↑f x ≠ 0 → ↑↑μ (↑f ⁻¹' {↑f x}) ≠ 0 → ↑f x ∈ s
a₁✝ a₂✝ : ℝ≥0∞
h₁₁✝ : a₁✝ ∈ SimpleFunc.range f
h₁₂✝ : a₁✝ * ↑↑μ (↑f ⁻¹' {a₁✝}) ≠ 0
h₂₁✝ : a₂✝ ∈ SimpleFunc.range f
h₂₂✝ : a₂✝ * ↑↑μ (↑f ⁻¹' {a₂✝}) ≠ 0
a✝ : (fun r x x => r) a₁✝ h₁₁✝ h₁₂✝ = (fun r x x => r) a₂✝ h₂₁✝ h₂₂✝
⊢ a₁✝ = a₂✝

tactic: intro b _ hb
state_before: case refine'_3
α : Type u_1
β : Type ?u.852623
γ : Type ?u.852626
δ : Type ?u.852629
m : MeasurableSpace α
μ ν : Measure α
f : α →ₛ ℝ≥0∞
s : Finset ℝ≥0∞
hs : ∀ (x : α), ↑f x ≠ 0 → ↑↑μ (↑f ⁻¹' {↑f x}) ≠ 0 → ↑f x ∈ s
⊢ ∀ (b : ℝ≥0∞), b ∈ s → b * ↑↑μ (↑f ⁻¹' {b}) ≠ 0 → ∃ a h₁ h₂, b = (fun r x x => r) a h₁ h₂

tactic: refine' ⟨b, _, hb, rfl⟩
state_before: case refine'_3
α : Type u_1
β : Type ?u.852623
γ : Type ?u.852626
δ : Type ?u.852629
m : MeasurableSpace α
μ ν : Measure α
f : α →ₛ ℝ≥0∞
s : Finset ℝ≥0∞
hs : ∀ (x : α), ↑f x ≠ 0 → ↑↑μ (↑f ⁻¹' {↑f x}) ≠ 0 → ↑f x ∈ s
b : ℝ≥0∞
a✝ : b ∈ s
hb : b * ↑↑μ (↑f ⁻¹' {b}) ≠ 0
⊢ ∃ a h₁ h₂, b = (fun r x x => r) a h₁ h₂

tactic: rw [mem_range, ← preimage_singleton_nonempty]
state_before: case refine'_3
α : Type u_1
β : Type ?u.852623
γ : Type ?u.852626
δ : Type ?u.852629
m : MeasurableSpace α
μ ν : Measure α
f : α →ₛ ℝ≥0∞
s : Finset ℝ≥0∞
hs : ∀ (x : α), ↑f x ≠ 0 → ↑↑μ (↑f ⁻¹' {↑f x}) ≠ 0 → ↑f x ∈ s
b : ℝ≥0∞
a✝ : b ∈ s
hb : b * ↑↑μ (↑f ⁻¹' {b}) ≠ 0
⊢ b ∈ SimpleFunc.range f

tactic: exact nonempty_of_measure_ne_zero (mul_ne_zero_iff.1 hb).2
state_before: case refine'_3
α : Type u_1
β : Type ?u.852623
γ : Type ?u.852626
δ : Type ?u.852629
m : MeasurableSpace α
μ ν : Measure α
f : α →ₛ ℝ≥0∞
s : Finset ℝ≥0∞
hs : ∀ (x : α), ↑f x ≠ 0 → ↑↑μ (↑f ⁻¹' {↑f x}) ≠ 0 → ↑f x ∈ s
b : ℝ≥0∞
a✝ : b ∈ s
hb : b * ↑↑μ (↑f ⁻¹' {b}) ≠ 0
⊢ Set.Nonempty (↑f ⁻¹' {b})

tactic: intros
state_before: case refine'_4
α : Type u_1
β : Type ?u.852623
γ : Type ?u.852626
δ : Type ?u.852629
m : MeasurableSpace α
μ ν : Measure α
f : α →ₛ ℝ≥0∞
s : Finset ℝ≥0∞
hs : ∀ (x : α), ↑f x ≠ 0 → ↑↑μ (↑f ⁻¹' {↑f x}) ≠ 0 → ↑f x ∈ s
⊢ ∀ (a : ℝ≥0∞) (h₁ : a ∈ SimpleFunc.range f) (h₂ : a * ↑↑μ (↑f ⁻¹' {a}) ≠ 0),
    a * ↑↑μ (↑f ⁻¹' {a}) = (fun r x x => r) a h₁ h₂ * ↑↑μ (↑f ⁻¹' {(fun r x x => r) a h₁ h₂})

tactic: rfl
state_before: case refine'_4
α : Type u_1
β : Type ?u.852623
γ : Type ?u.852626
δ : Type ?u.852629
m : MeasurableSpace α
μ ν : Measure α
f : α →ₛ ℝ≥0∞
s : Finset ℝ≥0∞
hs : ∀ (x : α), ↑f x ≠ 0 → ↑↑μ (↑f ⁻¹' {↑f x}) ≠ 0 → ↑f x ∈ s
a✝ : ℝ≥0∞
h₁✝ : a✝ ∈ SimpleFunc.range f
h₂✝ : a✝ * ↑↑μ (↑f ⁻¹' {a✝}) ≠ 0
⊢ a✝ * ↑↑μ (↑f ⁻¹' {a✝}) = (fun r x x => r) a✝ h₁✝ h₂✝ * ↑↑μ (↑f ⁻¹' {(fun r x x => r) a✝ h₁✝ h₂✝})