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

tactic: have : { a | r a (f a) } = ⋃ b ∈ range f, { a | r a b } ∩ f ⁻¹' {b} := by
  ext a
  suffices r a (f a) ↔ ∃ i, r a (f i) ∧ f a = f i by simpa
  exact ⟨fun h => ⟨a, ⟨h, rfl⟩⟩, fun ⟨a', ⟨h', e⟩⟩ => e.symm ▸ h'⟩
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝ : MeasurableSpace α
r : α → β → Prop
f : α →ₛ β
h : ∀ (b : β), MeasurableSet {a | r a b}
⊢ MeasurableSet {a | r a (↑f a)}
state_after: α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝ : MeasurableSpace α
r : α → β → Prop
f : α →ₛ β
h : ∀ (b : β), MeasurableSet {a | r a b}
this : {a | r a (↑f a)} = ⋃ b ∈ range ↑f, {a | r a b} ∩ ↑f ⁻¹' {b}
⊢ MeasurableSet {a | r a (↑f a)}

tactic: rw [this]
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝ : MeasurableSpace α
r : α → β → Prop
f : α →ₛ β
h : ∀ (b : β), MeasurableSet {a | r a b}
this : {a | r a (↑f a)} = ⋃ b ∈ range ↑f, {a | r a b} ∩ ↑f ⁻¹' {b}
⊢ MeasurableSet {a | r a (↑f a)}
state_after: α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝ : MeasurableSpace α
r : α → β → Prop
f : α →ₛ β
h : ∀ (b : β), MeasurableSet {a | r a b}
this : {a | r a (↑f a)} = ⋃ b ∈ range ↑f, {a | r a b} ∩ ↑f ⁻¹' {b}
⊢ MeasurableSet (⋃ b ∈ range ↑f, {a | r a b} ∩ ↑f ⁻¹' {b})

tactic: exact
  MeasurableSet.biUnion f.finite_range.countable fun b _ =>
    MeasurableSet.inter (h b) (f.measurableSet_fiber _)
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝ : MeasurableSpace α
r : α → β → Prop
f : α →ₛ β
h : ∀ (b : β), MeasurableSet {a | r a b}
this : {a | r a (↑f a)} = ⋃ b ∈ range ↑f, {a | r a b} ∩ ↑f ⁻¹' {b}
⊢ MeasurableSet (⋃ b ∈ range ↑f, {a | r a b} ∩ ↑f ⁻¹' {b})
state_after: no goals

tactic: ext a
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝ : MeasurableSpace α
r : α → β → Prop
f : α →ₛ β
h : ∀ (b : β), MeasurableSet {a | r a b}
⊢ {a | r a (↑f a)} = ⋃ b ∈ range ↑f, {a | r a b} ∩ ↑f ⁻¹' {b}
state_after: case h
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝ : MeasurableSpace α
r : α → β → Prop
f : α →ₛ β
h : ∀ (b : β), MeasurableSet {a | r a b}
a : α
⊢ a ∈ {a | r a (↑f a)} ↔ a ∈ ⋃ b ∈ range ↑f, {a | r a b} ∩ ↑f ⁻¹' {b}

tactic: suffices r a (f a) ↔ ∃ i, r a (f i) ∧ f a = f i by simpa
state_before: case h
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝ : MeasurableSpace α
r : α → β → Prop
f : α →ₛ β
h : ∀ (b : β), MeasurableSet {a | r a b}
a : α
⊢ a ∈ {a | r a (↑f a)} ↔ a ∈ ⋃ b ∈ range ↑f, {a | r a b} ∩ ↑f ⁻¹' {b}
state_after: case h
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝ : MeasurableSpace α
r : α → β → Prop
f : α →ₛ β
h : ∀ (b : β), MeasurableSet {a | r a b}
a : α
⊢ r a (↑f a) ↔ ∃ i, r a (↑f i) ∧ ↑f a = ↑f i

tactic: exact ⟨fun h => ⟨a, ⟨h, rfl⟩⟩, fun ⟨a', ⟨h', e⟩⟩ => e.symm ▸ h'⟩
state_before: case h
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝ : MeasurableSpace α
r : α → β → Prop
f : α →ₛ β
h : ∀ (b : β), MeasurableSet {a | r a b}
a : α
⊢ r a (↑f a) ↔ ∃ i, r a (↑f i) ∧ ↑f a = ↑f i
state_after: no goals

tactic: simpa
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝ : MeasurableSpace α
r : α → β → Prop
f : α →ₛ β
h : ∀ (b : β), MeasurableSet {a | r a b}
a : α
this : r a (↑f a) ↔ ∃ i, r a (↑f i) ∧ ↑f a = ↑f i
⊢ a ∈ {a | r a (↑f a)} ↔ a ∈ ⋃ b ∈ range ↑f, {a | r a b} ∩ ↑f ⁻¹' {b}
state_after: no goals