-- Mathlib/MeasureTheory/Function/StronglyMeasurable/Basic.lean
theorem _root_.stronglyMeasurable_of_stronglyMeasurable_union_cover {m : MeasurableSpace α}
    [TopologicalSpace β] {f : α → β} (s t : Set α) (hs : MeasurableSet s) (ht : MeasurableSet t)
    (h : univ ⊆ s ∪ t) (hc : StronglyMeasurable fun a : s => f a)
    (hd : StronglyMeasurable fun a : t => f a) : StronglyMeasurable f

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
inst✝ : TopologicalSpace β
f : α → β
s t : Set α
hs : MeasurableSet s
ht : MeasurableSet t
h : univ ⊆ s ∪ t
hc : StronglyMeasurable fun a => f ↑a
hd : StronglyMeasurable fun a => f ↑a
⊢ StronglyMeasurable f

Tactic:
nontriviality β

Result:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
inst✝ : TopologicalSpace β
f : α → β
s t : Set α
hs : MeasurableSet s
ht : MeasurableSet t
h : univ ⊆ s ∪ t
hc : StronglyMeasurable fun a => f ↑a
hd : StronglyMeasurable fun a => f ↑a
a✝ : Nontrivial β
⊢ StronglyMeasurable f

Proof state:
case neg.intro.hb
α : Type u_1
β : Type u_2
m : MeasurableSpace α
inst✝ : TopologicalSpace β
f : α → β
s t : Set α
hs : MeasurableSet s
ht : MeasurableSet t
h : univ ⊆ s ∪ t
hc : StronglyMeasurable fun a => f ↑a
hd : StronglyMeasurable fun a => f ↑a
a✝ : Nontrivial β
inhabited_h : Inhabited β
x : { x // x ∈ t }
hxs : ↑x ∉ s
⊢ ¬∃ a, ↑a = ↑x

Tactic:
exact fun ⟨y, hy⟩ ↦ hxs <| hy ▸ y.2

Result:
no goals

Proof state:
case neg
α : Type u_1
β : Type u_2
m : MeasurableSpace α
inst✝ : TopologicalSpace β
f : α → β
s t : Set α
hs : MeasurableSet s
ht : MeasurableSet t
h : univ ⊆ s ∪ t
hc : StronglyMeasurable fun a => f ↑a
hd : StronglyMeasurable fun a => f ↑a
a✝ : Nontrivial β
inhabited_h : Inhabited β
x : α
hxs : x ∉ s
⊢ Function.extend Subtype.val (fun x => f ↑x) (Function.extend Subtype.val (fun x => f ↑x) fun x => default) x = f x

Tactic:
lift x to t using (h trivial).resolve_left hxs

Result:
case neg.intro
α : Type u_1
β : Type u_2
m : MeasurableSpace α
inst✝ : TopologicalSpace β
f : α → β
s t : Set α
hs : MeasurableSet s
ht : MeasurableSet t
h : univ ⊆ s ∪ t
hc : StronglyMeasurable fun a => f ↑a
hd : StronglyMeasurable fun a => f ↑a
a✝ : Nontrivial β
inhabited_h : Inhabited β
x : { x // x ∈ t }
hxs : ↑x ∉ s
⊢ Function.extend Subtype.val (fun x => f ↑x) (Function.extend Subtype.val (fun x => f ↑x) fun x => default) ↑x = f ↑x

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
inst✝ : TopologicalSpace β
f : α → β
s t : Set α
hs : MeasurableSet s
ht : MeasurableSet t
h : univ ⊆ s ∪ t
hc : StronglyMeasurable fun a => f ↑a
hd : StronglyMeasurable fun a => f ↑a
a✝ : Nontrivial β
inhabited_h : Inhabited β
⊢ Function.extend Subtype.val (fun x => f ↑x) (Function.extend Subtype.val (fun x => f ↑x) fun x => default) = f

Tactic:
ext x

Result:
case h
α : Type u_1
β : Type u_2
m : MeasurableSpace α
inst✝ : TopologicalSpace β
f : α → β
s t : Set α
hs : MeasurableSet s
ht : MeasurableSet t
h : univ ⊆ s ∪ t
hc : StronglyMeasurable fun a => f ↑a
hd : StronglyMeasurable fun a => f ↑a
a✝ : Nontrivial β
inhabited_h : Inhabited β
x : α
⊢ Function.extend Subtype.val (fun x => f ↑x) (Function.extend Subtype.val (fun x => f ↑x) fun x => default) x = f x

Proof state:
case h
α : Type u_1
β : Type u_2
m : MeasurableSpace α
inst✝ : TopologicalSpace β
f : α → β
s t : Set α
hs : MeasurableSet s
ht : MeasurableSet t
h : univ ⊆ s ∪ t
hc : StronglyMeasurable fun a => f ↑a
hd : StronglyMeasurable fun a => f ↑a
a✝ : Nontrivial β
inhabited_h : Inhabited β
x : α
⊢ Function.extend Subtype.val (fun x => f ↑x) (Function.extend Subtype.val (fun x => f ↑x) fun x => default) x = f x

Tactic:
by_cases hxs : x ∈ s

Result:
case pos
α : Type u_1
β : Type u_2
m : MeasurableSpace α
inst✝ : TopologicalSpace β
f : α → β
s t : Set α
hs : MeasurableSet s
ht : MeasurableSet t
h : univ ⊆ s ∪ t
hc : StronglyMeasurable fun a => f ↑a
hd : StronglyMeasurable fun a => f ↑a
a✝ : Nontrivial β
inhabited_h : Inhabited β
x : α
hxs : x ∈ s
⊢ Function.extend Subtype.val (fun x => f ↑x) (Function.extend Subtype.val (fun x => f ↑x) fun x => default) x = f x

case neg
α : Type u_1
β : Type u_2
m : MeasurableSpace α
inst✝ : TopologicalSpace β
f : α → β
s t : Set α
hs : MeasurableSet s
ht : MeasurableSet t
h : univ ⊆ s ∪ t
hc : StronglyMeasurable fun a => f ↑a
hd : StronglyMeasurable fun a => f ↑a
a✝ : Nontrivial β
inhabited_h : Inhabited β
x : α
hxs : x ∉ s
⊢ Function.extend Subtype.val (fun x => f ↑x) (Function.extend Subtype.val (fun x => f ↑x) fun x => default) x = f x

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
inst✝ : TopologicalSpace β
f : α → β
s t : Set α
hs : MeasurableSet s
ht : MeasurableSet t
h : univ ⊆ s ∪ t
hc : StronglyMeasurable fun a => f ↑a
hd : StronglyMeasurable fun a => f ↑a
a✝ : Nontrivial β
⊢ StronglyMeasurable f

Tactic:
inhabit β

Result:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
inst✝ : TopologicalSpace β
f : α → β
s t : Set α
hs : MeasurableSet s
ht : MeasurableSet t
h : univ ⊆ s ∪ t
hc : StronglyMeasurable fun a => f ↑a
hd : StronglyMeasurable fun a => f ↑a
a✝ : Nontrivial β
inhabited_h : Inhabited β
⊢ StronglyMeasurable f

Proof state:
case pos
α : Type u_1
β : Type u_2
m : MeasurableSpace α
inst✝ : TopologicalSpace β
f : α → β
s t : Set α
hs : MeasurableSet s
ht : MeasurableSet t
h : univ ⊆ s ∪ t
hc : StronglyMeasurable fun a => f ↑a
hd : StronglyMeasurable fun a => f ↑a
a✝ : Nontrivial β
inhabited_h : Inhabited β
x : α
hxs : x ∈ s
⊢ Function.extend Subtype.val (fun x => f ↑x) (Function.extend Subtype.val (fun x => f ↑x) fun x => default) x = f x

Tactic:
lift x to s using hxs

Result:
case pos.intro
α : Type u_1
β : Type u_2
m : MeasurableSpace α
inst✝ : TopologicalSpace β
f : α → β
s t : Set α
hs : MeasurableSet s
ht : MeasurableSet t
h : univ ⊆ s ∪ t
hc : StronglyMeasurable fun a => f ↑a
hd : StronglyMeasurable fun a => f ↑a
a✝ : Nontrivial β
inhabited_h : Inhabited β
x : { x // x ∈ s }
⊢ Function.extend Subtype.val (fun x => f ↑x) (Function.extend Subtype.val (fun x => f ↑x) fun x => default) ↑x = f ↑x

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
inst✝ : TopologicalSpace β
f : α → β
s t : Set α
hs : MeasurableSet s
ht : MeasurableSet t
h : univ ⊆ s ∪ t
hc : StronglyMeasurable fun a => f ↑a
hd : StronglyMeasurable fun a => f ↑a
a✝ : Nontrivial β
inhabited_h : Inhabited β
⊢ StronglyMeasurable f

Tactic:
suffices Function.extend Subtype.val (fun x : s ↦ f x)
    (Function.extend (↑) (fun x : t ↦ f x) fun _ ↦ default) = f from
  this ▸ (MeasurableEmbedding.subtype_coe hs).stronglyMeasurable_extend hc <|
    (MeasurableEmbedding.subtype_coe ht).stronglyMeasurable_extend hd stronglyMeasurable_const

Result:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
inst✝ : TopologicalSpace β
f : α → β
s t : Set α
hs : MeasurableSet s
ht : MeasurableSet t
h : univ ⊆ s ∪ t
hc : StronglyMeasurable fun a => f ↑a
hd : StronglyMeasurable fun a => f ↑a
a✝ : Nontrivial β
inhabited_h : Inhabited β
⊢ Function.extend Subtype.val (fun x => f ↑x) (Function.extend Subtype.val (fun x => f ↑x) fun x => default) = f

Proof state:
case neg.intro
α : Type u_1
β : Type u_2
m : MeasurableSpace α
inst✝ : TopologicalSpace β
f : α → β
s t : Set α
hs : MeasurableSet s
ht : MeasurableSet t
h : univ ⊆ s ∪ t
hc : StronglyMeasurable fun a => f ↑a
hd : StronglyMeasurable fun a => f ↑a
a✝ : Nontrivial β
inhabited_h : Inhabited β
x : { x // x ∈ t }
hxs : ↑x ∉ s
⊢ Function.extend Subtype.val (fun x => f ↑x) (Function.extend Subtype.val (fun x => f ↑x) fun x => default) ↑x = f ↑x

Tactic:
rw [extend_apply', Subtype.coe_injective.extend_apply]

Result:
case neg.intro.hb
α : Type u_1
β : Type u_2
m : MeasurableSpace α
inst✝ : TopologicalSpace β
f : α → β
s t : Set α
hs : MeasurableSet s
ht : MeasurableSet t
h : univ ⊆ s ∪ t
hc : StronglyMeasurable fun a => f ↑a
hd : StronglyMeasurable fun a => f ↑a
a✝ : Nontrivial β
inhabited_h : Inhabited β
x : { x // x ∈ t }
hxs : ↑x ∉ s
⊢ ¬∃ a, ↑a = ↑x