l3lab/ntp-mathlib huggingface dataset:
/-- Let `P` be a `LocalInvariantProp` for functions between spaces with the groupoids `G`, `G'`
and let `M`, `M'` be charted spaces modelled on the model spaces of those groupoids.  Then there is
an induced `LocalPredicate` on the functions from `M` to `M'`, given by `LiftProp P`. -/
def StructureGroupoid.LocalInvariantProp.localPredicate (hG : LocalInvariantProp G G' P) :
    TopCat.LocalPredicate fun _ : TopCat.of M => M' where
  pred {U : Opens (TopCat.of M)} := fun f : U → M' => ChartedSpace.LiftProp P f
  res := by
    intro U V i f h x
    have hUV : U ≤ V := CategoryTheory.leOfHom i
    show ChartedSpace.LiftPropAt P (f ∘ Set.inclusion hUV) x
    rw [← hG.liftPropAt_iff_comp_inclusion hUV]
    apply h
  locality := by
    intro V f h x
    

Proof state:
H : Type u_1
inst✝⁵ : TopologicalSpace H
H' : Type u_2
inst✝⁴ : TopologicalSpace H'
G : StructureGroupoid H
G' : StructureGroupoid H'
P : (H → H') → Set H → H → Prop
M : Type u
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
M' : Type u
inst✝¹ : TopologicalSpace M'
inst✝ : ChartedSpace H' M'
hG : LocalInvariantProp G G' P
V : Opens ↑(TopCat.of M)
f : ↥V → M'
h :
  ∀ (x : ↥V),
    ∃ V_1,
      ∃ (_ : ↑x ∈ V_1),
        ∃ i,
          TopCat.PrelocalPredicate.pred
            { pred := fun {U} f => ChartedSpace.LiftProp P f,
              res :=
                (_ :
                  ∀ {U V : Opens ↑(TopCat.of M)} (i : U ⟶ V) (f : ↥V → M'),
                    ChartedSpace.LiftProp P f → ∀ (x : ↥U), ChartedSpace.LiftPropAt P (f ∘ inclusion (_ : U ≤ V)) x) }
            fun x => f ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑V) }) x)
x : ↥V
⊢ ChartedSpace.LiftPropAt P f x

Next tactic:
obtain ⟨U, hxU, i, hU : ChartedSpace.LiftProp P (f ∘ i)⟩ := h x
/-- Let `P` be a `LocalInvariantProp` for functions between spaces with the groupoids `G`, `G'`
and let `M`, `M'` be charted spaces modelled on the model spaces of those groupoids.  Then there is
an induced `LocalPredicate` on the functions from `M` to `M'`, given by `LiftProp P`. -/
def StructureGroupoid.LocalInvariantProp.localPredicate (hG : LocalInvariantProp G G' P) :
    TopCat.LocalPredicate fun _ : TopCat.of M => M' where
  pred {U : Opens (TopCat.of M)} := fun f : U → M' => ChartedSpace.LiftProp P f
  res := by
    intro U V i f h x
    have hUV : U ≤ V := CategoryTheory.leOfHom i
    show ChartedSpace.LiftPropAt P (f ∘ Set.inclusion hUV) x
    rw [← hG.liftPropAt_iff_comp_inclusion hUV]
    apply h
  locality := by
    intro V f h x
    obtain ⟨U, hxU, i, hU : ChartedSpace.LiftProp P (f ∘ i)⟩ := h x
    

Proof state:
case intro.intro.intro
H : Type u_1
inst✝⁵ : TopologicalSpace H
H' : Type u_2
inst✝⁴ : TopologicalSpace H'
G : StructureGroupoid H
G' : StructureGroupoid H'
P : (H → H') → Set H → H → Prop
M : Type u
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
M' : Type u
inst✝¹ : TopologicalSpace M'
inst✝ : ChartedSpace H' M'
hG : LocalInvariantProp G G' P
V : Opens ↑(TopCat.of M)
f : ↥V → M'
h :
  ∀ (x : ↥V),
    ∃ V_1,
      ∃ (_ : ↑x ∈ V_1),
        ∃ i,
          TopCat.PrelocalPredicate.pred
            { pred := fun {U} f => ChartedSpace.LiftProp P f,
              res :=
                (_ :
                  ∀ {U V : Opens ↑(TopCat.of M)} (i : U ⟶ V) (f : ↥V → M'),
                    ChartedSpace.LiftProp P f → ∀ (x : ↥U), ChartedSpace.LiftPropAt P (f ∘ inclusion (_ : U ≤ V)) x) }
            fun x => f ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑V) }) x)
x : ↥V
U : Opens ↑(TopCat.of M)
hxU : ↑x ∈ U
i : U ⟶ V
hU : ChartedSpace.LiftProp P (f ∘ fun x => { val := ↑x, property := (_ : ↑x ∈ ↑V) })
⊢ ChartedSpace.LiftPropAt P f x

Next tactic:
let x' : U := ⟨x, hxU⟩
/-- Let `P` be a `LocalInvariantProp` for functions between spaces with the groupoids `G`, `G'`
and let `M`, `M'` be charted spaces modelled on the model spaces of those groupoids.  Then there is
an induced `LocalPredicate` on the functions from `M` to `M'`, given by `LiftProp P`. -/
def StructureGroupoid.LocalInvariantProp.localPredicate (hG : LocalInvariantProp G G' P) :
    TopCat.LocalPredicate fun _ : TopCat.of M => M' where
  pred {U : Opens (TopCat.of M)} := fun f : U → M' => ChartedSpace.LiftProp P f
  res := by
    intro U V i f h x
    have hUV : U ≤ V := CategoryTheory.leOfHom i
    show ChartedSpace.LiftPropAt P (f ∘ Set.inclusion hUV) x
    rw [← hG.liftPropAt_iff_comp_inclusion hUV]
    apply h
  locality := by
    intro V f h x
    obtain ⟨U, hxU, i, hU : ChartedSpace.LiftProp P (f ∘ i)⟩ := h x
    let x' : U := ⟨x, hxU⟩
    

Proof state:
case intro.intro.intro
H : Type u_1
inst✝⁵ : TopologicalSpace H
H' : Type u_2
inst✝⁴ : TopologicalSpace H'
G : StructureGroupoid H
G' : StructureGroupoid H'
P : (H → H') → Set H → H → Prop
M : Type u
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
M' : Type u
inst✝¹ : TopologicalSpace M'
inst✝ : ChartedSpace H' M'
hG : LocalInvariantProp G G' P
V : Opens ↑(TopCat.of M)
f : ↥V → M'
h :
  ∀ (x : ↥V),
    ∃ V_1,
      ∃ (_ : ↑x ∈ V_1),
        ∃ i,
          TopCat.PrelocalPredicate.pred
            { pred := fun {U} f => ChartedSpace.LiftProp P f,
              res :=
                (_ :
                  ∀ {U V : Opens ↑(TopCat.of M)} (i : U ⟶ V) (f : ↥V → M'),
                    ChartedSpace.LiftProp P f → ∀ (x : ↥U), ChartedSpace.LiftPropAt P (f ∘ inclusion (_ : U ≤ V)) x) }
            fun x => f ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑V) }) x)
x : ↥V
U : Opens ↑(TopCat.of M)
hxU : ↑x ∈ U
i : U ⟶ V
hU : ChartedSpace.LiftProp P (f ∘ fun x => { val := ↑x, property := (_ : ↑x ∈ ↑V) })
x' : ↥U := { val := ↑x, property := hxU }
⊢ ChartedSpace.LiftPropAt P f x

Next tactic:
have hUV : U ≤ V := CategoryTheory.leOfHom i
/-- Let `P` be a `LocalInvariantProp` for functions between spaces with the groupoids `G`, `G'`
and let `M`, `M'` be charted spaces modelled on the model spaces of those groupoids.  Then there is
an induced `LocalPredicate` on the functions from `M` to `M'`, given by `LiftProp P`. -/
def StructureGroupoid.LocalInvariantProp.localPredicate (hG : LocalInvariantProp G G' P) :
    TopCat.LocalPredicate fun _ : TopCat.of M => M' where
  pred {U : Opens (TopCat.of M)} := fun f : U → M' => ChartedSpace.LiftProp P f
  res := by
    intro U V i f h x
    have hUV : U ≤ V := CategoryTheory.leOfHom i
    show ChartedSpace.LiftPropAt P (f ∘ Set.inclusion hUV) x
    rw [← hG.liftPropAt_iff_comp_inclusion hUV]
    apply h
  locality := by
    intro V f h x
    obtain ⟨U, hxU, i, hU : ChartedSpace.LiftProp P (f ∘ i)⟩ := h x
    let x' : U := ⟨x, hxU⟩
    have hUV : U ≤ V := CategoryTheory.leOfHom i
    

Proof state:
case intro.intro.intro
H : Type u_1
inst✝⁵ : TopologicalSpace H
H' : Type u_2
inst✝⁴ : TopologicalSpace H'
G : StructureGroupoid H
G' : StructureGroupoid H'
P : (H → H') → Set H → H → Prop
M : Type u
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
M' : Type u
inst✝¹ : TopologicalSpace M'
inst✝ : ChartedSpace H' M'
hG : LocalInvariantProp G G' P
V : Opens ↑(TopCat.of M)
f : ↥V → M'
h :
  ∀ (x : ↥V),
    ∃ V_1,
      ∃ (_ : ↑x ∈ V_1),
        ∃ i,
          TopCat.PrelocalPredicate.pred
            { pred := fun {U} f => ChartedSpace.LiftProp P f,
              res :=
                (_ :
                  ∀ {U V : Opens ↑(TopCat.of M)} (i : U ⟶ V) (f : ↥V → M'),
                    ChartedSpace.LiftProp P f → ∀ (x : ↥U), ChartedSpace.LiftPropAt P (f ∘ inclusion (_ : U ≤ V)) x) }
            fun x => f ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑V) }) x)
x : ↥V
U : Opens ↑(TopCat.of M)
hxU : ↑x ∈ U
i : U ⟶ V
hU : ChartedSpace.LiftProp P (f ∘ fun x => { val := ↑x, property := (_ : ↑x ∈ ↑V) })
x' : ↥U := { val := ↑x, property := hxU }
hUV : U ≤ V
⊢ ChartedSpace.LiftPropAt P f x

Next tactic:
have : ChartedSpace.LiftPropAt P f (inclusion hUV x') := by
      rw [hG.liftPropAt_iff_comp_inclusion hUV]
      exact hU x'
/-- Let `P` be a `LocalInvariantProp` for functions between spaces with the groupoids `G`, `G'`
and let `M`, `M'` be charted spaces modelled on the model spaces of those groupoids.  Then there is
an induced `LocalPredicate` on the functions from `M` to `M'`, given by `LiftProp P`. -/
def StructureGroupoid.LocalInvariantProp.localPredicate (hG : LocalInvariantProp G G' P) :
    TopCat.LocalPredicate fun _ : TopCat.of M => M' where
  pred {U : Opens (TopCat.of M)} := fun f : U → M' => ChartedSpace.LiftProp P f
  res := by
    intro U V i f h x
    have hUV : U ≤ V := CategoryTheory.leOfHom i
    show ChartedSpace.LiftPropAt P (f ∘ Set.inclusion hUV) x
    rw [← hG.liftPropAt_iff_comp_inclusion hUV]
    apply h
  locality := by
    intro V f h x
    obtain ⟨U, hxU, i, hU : ChartedSpace.LiftProp P (f ∘ i)⟩ := h x
    let x' : U := ⟨x, hxU⟩
    have hUV : U ≤ V := CategoryTheory.leOfHom i
    have : ChartedSpace.LiftPropAt P f (inclusion hUV x') := by
      

Proof state:
H : Type u_1
inst✝⁵ : TopologicalSpace H
H' : Type u_2
inst✝⁴ : TopologicalSpace H'
G : StructureGroupoid H
G' : StructureGroupoid H'
P : (H → H') → Set H → H → Prop
M : Type u
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
M' : Type u
inst✝¹ : TopologicalSpace M'
inst✝ : ChartedSpace H' M'
hG : LocalInvariantProp G G' P
V : Opens ↑(TopCat.of M)
f : ↥V → M'
h :
  ∀ (x : ↥V),
    ∃ V_1,
      ∃ (_ : ↑x ∈ V_1),
        ∃ i,
          TopCat.PrelocalPredicate.pred
            { pred := fun {U} f => ChartedSpace.LiftProp P f,
              res :=
                (_ :
                  ∀ {U V : Opens ↑(TopCat.of M)} (i : U ⟶ V) (f : ↥V → M'),
                    ChartedSpace.LiftProp P f → ∀ (x : ↥U), ChartedSpace.LiftPropAt P (f ∘ inclusion (_ : U ≤ V)) x) }
            fun x => f ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑V) }) x)
x : ↥V
U : Opens ↑(TopCat.of M)
hxU : ↑x ∈ U
i : U ⟶ V
hU : ChartedSpace.LiftProp P (f ∘ fun x => { val := ↑x, property := (_ : ↑x ∈ ↑V) })
x' : ↥U := { val := ↑x, property := hxU }
hUV : U ≤ V
⊢ ChartedSpace.LiftPropAt P f (inclusion hUV x')

Next tactic:
rw [hG.liftPropAt_iff_comp_inclusion hUV]
/-- Let `P` be a `LocalInvariantProp` for functions between spaces with the groupoids `G`, `G'`
and let `M`, `M'` be charted spaces modelled on the model spaces of those groupoids.  Then there is
an induced `LocalPredicate` on the functions from `M` to `M'`, given by `LiftProp P`. -/
def StructureGroupoid.LocalInvariantProp.localPredicate (hG : LocalInvariantProp G G' P) :
    TopCat.LocalPredicate fun _ : TopCat.of M => M' where
  pred {U : Opens (TopCat.of M)} := fun f : U → M' => ChartedSpace.LiftProp P f
  res := by
    intro U V i f h x
    have hUV : U ≤ V := CategoryTheory.leOfHom i
    show ChartedSpace.LiftPropAt P (f ∘ Set.inclusion hUV) x
    rw [← hG.liftPropAt_iff_comp_inclusion hUV]
    apply h
  locality := by
    intro V f h x
    obtain ⟨U, hxU, i, hU : ChartedSpace.LiftProp P (f ∘ i)⟩ := h x
    let x' : U := ⟨x, hxU⟩
    have hUV : U ≤ V := CategoryTheory.leOfHom i
    have : ChartedSpace.LiftPropAt P f (inclusion hUV x') := by
      rw [hG.liftPropAt_iff_comp_inclusion hUV]
      

Proof state:
H : Type u_1
inst✝⁵ : TopologicalSpace H
H' : Type u_2
inst✝⁴ : TopologicalSpace H'
G : StructureGroupoid H
G' : StructureGroupoid H'
P : (H → H') → Set H → H → Prop
M : Type u
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
M' : Type u
inst✝¹ : TopologicalSpace M'
inst✝ : ChartedSpace H' M'
hG : LocalInvariantProp G G' P
V : Opens ↑(TopCat.of M)
f : ↥V → M'
h :
  ∀ (x : ↥V),
    ∃ V_1,
      ∃ (_ : ↑x ∈ V_1),
        ∃ i,
          TopCat.PrelocalPredicate.pred
            { pred := fun {U} f => ChartedSpace.LiftProp P f,
              res :=
                (_ :
                  ∀ {U V : Opens ↑(TopCat.of M)} (i : U ⟶ V) (f : ↥V → M'),
                    ChartedSpace.LiftProp P f → ∀ (x : ↥U), ChartedSpace.LiftPropAt P (f ∘ inclusion (_ : U ≤ V)) x) }
            fun x => f ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑V) }) x)
x : ↥V
U : Opens ↑(TopCat.of M)
hxU : ↑x ∈ U
i : U ⟶ V
hU : ChartedSpace.LiftProp P (f ∘ fun x => { val := ↑x, property := (_ : ↑x ∈ ↑V) })
x' : ↥U := { val := ↑x, property := hxU }
hUV : U ≤ V
⊢ ChartedSpace.LiftPropAt P (f ∘ inclusion hUV) x'

Next tactic:
exact hU x'
/-- Let `P` be a `LocalInvariantProp` for functions between spaces with the groupoids `G`, `G'`
and let `M`, `M'` be charted spaces modelled on the model spaces of those groupoids.  Then there is
an induced `LocalPredicate` on the functions from `M` to `M'`, given by `LiftProp P`. -/
def StructureGroupoid.LocalInvariantProp.localPredicate (hG : LocalInvariantProp G G' P) :
    TopCat.LocalPredicate fun _ : TopCat.of M => M' where
  pred {U : Opens (TopCat.of M)} := fun f : U → M' => ChartedSpace.LiftProp P f
  res := by
    intro U V i f h x
    have hUV : U ≤ V := CategoryTheory.leOfHom i
    show ChartedSpace.LiftPropAt P (f ∘ Set.inclusion hUV) x
    rw [← hG.liftPropAt_iff_comp_inclusion hUV]
    apply h
  locality := by
    intro V f h x
    obtain ⟨U, hxU, i, hU : ChartedSpace.LiftProp P (f ∘ i)⟩ := h x
    let x' : U := ⟨x, hxU⟩
    have hUV : U ≤ V := CategoryTheory.leOfHom i
    have : ChartedSpace.LiftPropAt P f (inclusion hUV x') := by
      rw [hG.liftPropAt_iff_comp_inclusion hUV]
      exact hU x'
    

Proof state:
case intro.intro.intro
H : Type u_1
inst✝⁵ : TopologicalSpace H
H' : Type u_2
inst✝⁴ : TopologicalSpace H'
G : StructureGroupoid H
G' : StructureGroupoid H'
P : (H → H') → Set H → H → Prop
M : Type u
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
M' : Type u
inst✝¹ : TopologicalSpace M'
inst✝ : ChartedSpace H' M'
hG : LocalInvariantProp G G' P
V : Opens ↑(TopCat.of M)
f : ↥V → M'
h :
  ∀ (x : ↥V),
    ∃ V_1,
      ∃ (_ : ↑x ∈ V_1),
        ∃ i,
          TopCat.PrelocalPredicate.pred
            { pred := fun {U} f => ChartedSpace.LiftProp P f,
              res :=
                (_ :
                  ∀ {U V : Opens ↑(TopCat.of M)} (i : U ⟶ V) (f : ↥V → M'),
                    ChartedSpace.LiftProp P f → ∀ (x : ↥U), ChartedSpace.LiftPropAt P (f ∘ inclusion (_ : U ≤ V)) x) }
            fun x => f ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑V) }) x)
x : ↥V
U : Opens ↑(TopCat.of M)
hxU : ↑x ∈ U
i : U ⟶ V
hU : ChartedSpace.LiftProp P (f ∘ fun x => { val := ↑x, property := (_ : ↑x ∈ ↑V) })
x' : ↥U := { val := ↑x, property := hxU }
hUV : U ≤ V
this : ChartedSpace.LiftPropAt P f (inclusion hUV x')
⊢ ChartedSpace.LiftPropAt P f x

Next tactic:
convert this
theorem aecover_restrict_of_ae_imp {s : Set α} {φ : ι → Set α} (hs : MeasurableSet s)
    (ae_eventually_mem : ∀ᵐ x ∂μ, x ∈ s → ∀ᶠ n in l, x ∈ φ n)
    (measurable : ∀ n, MeasurableSet <| φ n) : AECover (μ.restrict s) l φ where
  ae_eventually_mem := by 

Proof state:
α : Type u_1
ι : Type u_2
inst✝ : MeasurableSpace α
μ : Measure α
l : Filter ι
s : Set α
φ : ι → Set α
hs : MeasurableSet s
ae_eventually_mem : ∀ᵐ (x : α) ∂μ, x ∈ s → ∀ᶠ (n : ι) in l, x ∈ φ n
measurable : ∀ (n : ι), MeasurableSet (φ n)
⊢ ∀ᵐ (x : α) ∂Measure.restrict μ s, ∀ᶠ (i : ι) in l, x ∈ φ i

Next tactic:
rwa [ae_restrict_iff' hs]
theorem AECover.aemeasurable {β : Type*} [MeasurableSpace β] [l.IsCountablyGenerated] [l.NeBot]
    {f : α → β} {φ : ι → Set α} (hφ : AECover μ l φ)
    (hfm : ∀ i, AEMeasurable f (μ.restrict <| φ i)) : AEMeasurable f μ := by
  

Proof state:
α : Type u_1
ι : Type u_2
inst✝³ : MeasurableSpace α
μ : Measure α
l : Filter ι
β : Type u_3
inst✝² : MeasurableSpace β
inst✝¹ : IsCountablyGenerated l
inst✝ : NeBot l
f : α → β
φ : ι → Set α
hφ : AECover μ l φ
hfm : ∀ (i : ι), AEMeasurable f
⊢ AEMeasurable f

Next tactic:
obtain ⟨u, hu⟩ := l.exists_seq_tendsto
theorem AECover.aemeasurable {β : Type*} [MeasurableSpace β] [l.IsCountablyGenerated] [l.NeBot]
    {f : α → β} {φ : ι → Set α} (hφ : AECover μ l φ)
    (hfm : ∀ i, AEMeasurable f (μ.restrict <| φ i)) : AEMeasurable f μ := by
  obtain ⟨u, hu⟩ := l.exists_seq_tendsto
  

Proof state:
case intro
α : Type u_1
ι : Type u_2
inst✝³ : MeasurableSpace α
μ : Measure α
l : Filter ι
β : Type u_3
inst✝² : MeasurableSpace β
inst✝¹ : IsCountablyGenerated l
inst✝ : NeBot l
f : α → β
φ : ι → Set α
hφ : AECover μ l φ
hfm : ∀ (i : ι), AEMeasurable f
u : ℕ → ι
hu : Tendsto u atTop l
⊢ AEMeasurable f

Next tactic:
have := aemeasurable_iUnion_iff.mpr fun n : ℕ => hfm (u n)
theorem AECover.aemeasurable {β : Type*} [MeasurableSpace β] [l.IsCountablyGenerated] [l.NeBot]
    {f : α → β} {φ : ι → Set α} (hφ : AECover μ l φ)
    (hfm : ∀ i, AEMeasurable f (μ.restrict <| φ i)) : AEMeasurable f μ := by
  obtain ⟨u, hu⟩ := l.exists_seq_tendsto
  have := aemeasurable_iUnion_iff.mpr fun n : ℕ => hfm (u n)
  

Proof state:
case intro
α : Type u_1
ι : Type u_2
inst✝³ : MeasurableSpace α
μ : Measure α
l : Filter ι
β : Type u_3
inst✝² : MeasurableSpace β
inst✝¹ : IsCountablyGenerated l
inst✝ : NeBot l
f : α → β
φ : ι → Set α
hφ : AECover μ l φ
hfm : ∀ (i : ι), AEMeasurable f
u : ℕ → ι
hu : Tendsto u atTop l
this : AEMeasurable f
⊢ AEMeasurable f

Next tactic:
rwa [Measure.restrict_eq_self_of_ae_mem] at this
theorem AECover.aemeasurable {β : Type*} [MeasurableSpace β] [l.IsCountablyGenerated] [l.NeBot]
    {f : α → β} {φ : ι → Set α} (hφ : AECover μ l φ)
    (hfm : ∀ i, AEMeasurable f (μ.restrict <| φ i)) : AEMeasurable f μ := by
  obtain ⟨u, hu⟩ := l.exists_seq_tendsto
  have := aemeasurable_iUnion_iff.mpr fun n : ℕ => hfm (u n)
  rwa [Measure.restrict_eq_self_of_ae_mem] at this
  

Proof state:
case intro.hs
α : Type u_1
ι : Type u_2
inst✝³ : MeasurableSpace α
μ : Measure α
l : Filter ι
β : Type u_3
inst✝² : MeasurableSpace β
inst✝¹ : IsCountablyGenerated l
inst✝ : NeBot l
f : α → β
φ : ι → Set α
hφ : AECover μ l φ
hfm : ∀ (i : ι), AEMeasurable f
u : ℕ → ι
hu : Tendsto u atTop l
this : AEMeasurable f
⊢ ∀ᵐ (x : α) ∂μ, x ∈ ⋃ i, φ (u i)

Next tactic:
filter_upwards [hφ.ae_eventually_mem] with x hx using
    mem_iUnion.mpr (hu.eventually hx).exists
theorem AECover.aestronglyMeasurable {β : Type*} [TopologicalSpace β] [PseudoMetrizableSpace β]
    [l.IsCountablyGenerated] [l.NeBot] {f : α → β} {φ : ι → Set α} (hφ : AECover μ l φ)
    (hfm : ∀ i, AEStronglyMeasurable f (μ.restrict <| φ i)) : AEStronglyMeasurable f μ := by
  

Proof state:
α : Type u_1
ι : Type u_2
inst✝⁴ : MeasurableSpace α
μ : Measure α
l : Filter ι
β : Type u_3
inst✝³ : TopologicalSpace β
inst✝² : PseudoMetrizableSpace β
inst✝¹ : IsCountablyGenerated l
inst✝ : NeBot l
f : α → β
φ : ι → Set α
hφ : AECover μ l φ
hfm : ∀ (i : ι), AEStronglyMeasurable f (Measure.restrict μ (φ i))
⊢ AEStronglyMeasurable f μ

Next tactic:
obtain ⟨u, hu⟩ := l.exists_seq_tendsto
theorem AECover.aestronglyMeasurable {β : Type*} [TopologicalSpace β] [PseudoMetrizableSpace β]
    [l.IsCountablyGenerated] [l.NeBot] {f : α → β} {φ : ι → Set α} (hφ : AECover μ l φ)
    (hfm : ∀ i, AEStronglyMeasurable f (μ.restrict <| φ i)) : AEStronglyMeasurable f μ := by
  obtain ⟨u, hu⟩ := l.exists_seq_tendsto
  

Proof state:
case intro
α : Type u_1
ι : Type u_2
inst✝⁴ : MeasurableSpace α
μ : Measure α
l : Filter ι
β : Type u_3
inst✝³ : TopologicalSpace β
inst✝² : PseudoMetrizableSpace β
inst✝¹ : IsCountablyGenerated l
inst✝ : NeBot l
f : α → β
φ : ι → Set α
hφ : AECover μ l φ
hfm : ∀ (i : ι), AEStronglyMeasurable f (Measure.restrict μ (φ i))
u : ℕ → ι
hu : Tendsto u atTop l
⊢ AEStronglyMeasurable f μ

Next tactic:
have := aestronglyMeasurable_iUnion_iff.mpr fun n : ℕ => hfm (u n)
theorem AECover.aestronglyMeasurable {β : Type*} [TopologicalSpace β] [PseudoMetrizableSpace β]
    [l.IsCountablyGenerated] [l.NeBot] {f : α → β} {φ : ι → Set α} (hφ : AECover μ l φ)
    (hfm : ∀ i, AEStronglyMeasurable f (μ.restrict <| φ i)) : AEStronglyMeasurable f μ := by
  obtain ⟨u, hu⟩ := l.exists_seq_tendsto
  have := aestronglyMeasurable_iUnion_iff.mpr fun n : ℕ => hfm (u n)
  

Proof state:
case intro
α : Type u_1
ι : Type u_2
inst✝⁴ : MeasurableSpace α
μ : Measure α
l : Filter ι
β : Type u_3
inst✝³ : TopologicalSpace β
inst✝² : PseudoMetrizableSpace β
inst✝¹ : IsCountablyGenerated l
inst✝ : NeBot l
f : α → β
φ : ι → Set α
hφ : AECover μ l φ
hfm : ∀ (i : ι), AEStronglyMeasurable f (Measure.restrict μ (φ i))
u : ℕ → ι
hu : Tendsto u atTop l
this : AEStronglyMeasurable f (Measure.restrict μ (⋃ i, φ (u i)))
⊢ AEStronglyMeasurable f μ

Next tactic:
rwa [Measure.restrict_eq_self_of_ae_mem] at this
theorem AECover.aestronglyMeasurable {β : Type*} [TopologicalSpace β] [PseudoMetrizableSpace β]
    [l.IsCountablyGenerated] [l.NeBot] {f : α → β} {φ : ι → Set α} (hφ : AECover μ l φ)
    (hfm : ∀ i, AEStronglyMeasurable f (μ.restrict <| φ i)) : AEStronglyMeasurable f μ := by
  obtain ⟨u, hu⟩ := l.exists_seq_tendsto
  have := aestronglyMeasurable_iUnion_iff.mpr fun n : ℕ => hfm (u n)
  rwa [Measure.restrict_eq_self_of_ae_mem] at this
  

Proof state:
case intro.hs
α : Type u_1
ι : Type u_2
inst✝⁴ : MeasurableSpace α
μ : Measure α
l : Filter ι
β : Type u_3
inst✝³ : TopologicalSpace β
inst✝² : PseudoMetrizableSpace β
inst✝¹ : IsCountablyGenerated l
inst✝ : NeBot l
f : α → β
φ : ι → Set α
hφ : AECover μ l φ
hfm : ∀ (i : ι), AEStronglyMeasurable f (Measure.restrict μ (φ i))
u : ℕ → ι
hu : Tendsto u atTop l
this : AEStronglyMeasurable f (Measure.restrict μ (⋃ i, φ (u i)))
⊢ ∀ᵐ (x : α) ∂μ, x ∈ ⋃ i, φ (u i)

Next tactic:
filter_upwards [hφ.ae_eventually_mem] with x hx using mem_iUnion.mpr (hu.eventually hx).exists
theorem AECover.biInter_Ici_aecover [Preorder ι] {φ : ι → Set α}
    (hφ : AECover μ atTop φ) : AECover μ atTop fun n : ι => ⋂ (k) (_h : k ∈ Ici n), φ k where
  ae_eventually_mem := hφ.ae_eventually_mem.mono <| fun x h ↦ by
    

Proof state:
α : Type u_1
ι : Type u_2
inst✝² : Countable ι
inst✝¹ : MeasurableSpace α
μ : Measure α
inst✝ : Preorder ι
φ : ι → Set α
hφ : AECover μ atTop φ
x : α
h : ∀ᶠ (i : ι) in atTop, x ∈ φ i
⊢ ∀ᶠ (i : ι) in atTop, x ∈ ⋂ k ∈ Ici i, φ k

Next tactic:
simpa only [mem_iInter, mem_Ici, eventually_forall_ge_atTop]
theorem AECover.lintegral_tendsto_of_nat {φ : ℕ → Set α} (hφ : AECover μ atTop φ) {f : α → ℝ≥0∞}
    (hfm : AEMeasurable f μ) : Tendsto (∫⁻ x in φ ·, f x ∂μ) atTop (𝓝 <| ∫⁻ x, f x ∂μ) := by
  

Proof state:
α : Type u_1
ι : Type u_2
inst✝ : MeasurableSpace α
μ : Measure α
l : Filter ι
φ : ℕ → Set α
hφ : AECover μ atTop φ
f : α → ℝ≥0∞
hfm : AEMeasurable f
⊢ Tendsto (fun x => ∫⁻ (x : α) in φ x, f x ∂μ) atTop (𝓝 (∫⁻ (x : α), f x ∂μ))

Next tactic:
have lim₁ := lintegral_tendsto_of_monotone_of_nat hφ.biInter_Ici_aecover
    (fun i j hij => biInter_subset_biInter_left (Ici_subset_Ici.mpr hij)) hfm
theorem AECover.lintegral_tendsto_of_nat {φ : ℕ → Set α} (hφ : AECover μ atTop φ) {f : α → ℝ≥0∞}
    (hfm : AEMeasurable f μ) : Tendsto (∫⁻ x in φ ·, f x ∂μ) atTop (𝓝 <| ∫⁻ x, f x ∂μ) := by
  have lim₁ := lintegral_tendsto_of_monotone_of_nat hφ.biInter_Ici_aecover
    (fun i j hij => biInter_subset_biInter_left (Ici_subset_Ici.mpr hij)) hfm
  

Proof state:
α : Type u_1
ι : Type u_2
inst✝ : MeasurableSpace α
μ : Measure α
l : Filter ι
φ : ℕ → Set α
hφ : AECover μ atTop φ
f : α → ℝ≥0∞
hfm : AEMeasurable f
lim₁ : Tendsto (fun i => ∫⁻ (x : α) in ⋂ k ∈ Ici i, φ k, f x ∂μ) atTop (𝓝 (∫⁻ (x : α), f x ∂μ))
⊢ Tendsto (fun x => ∫⁻ (x : α) in φ x, f x ∂μ) atTop (𝓝 (∫⁻ (x : α), f x ∂μ))

Next tactic:
have lim₂ := lintegral_tendsto_of_monotone_of_nat hφ.biUnion_Iic_aecover
    (fun i j hij => biUnion_subset_biUnion_left (Iic_subset_Iic.mpr hij)) hfm
theorem AECover.lintegral_tendsto_of_nat {φ : ℕ → Set α} (hφ : AECover μ atTop φ) {f : α → ℝ≥0∞}
    (hfm : AEMeasurable f μ) : Tendsto (∫⁻ x in φ ·, f x ∂μ) atTop (𝓝 <| ∫⁻ x, f x ∂μ) := by
  have lim₁ := lintegral_tendsto_of_monotone_of_nat hφ.biInter_Ici_aecover
    (fun i j hij => biInter_subset_biInter_left (Ici_subset_Ici.mpr hij)) hfm
  have lim₂ := lintegral_tendsto_of_monotone_of_nat hφ.biUnion_Iic_aecover
    (fun i j hij => biUnion_subset_biUnion_left (Iic_subset_Iic.mpr hij)) hfm
  

Proof state:
α : Type u_1
ι : Type u_2
inst✝ : MeasurableSpace α
μ : Measure α
l : Filter ι
φ : ℕ → Set α
hφ : AECover μ atTop φ
f : α → ℝ≥0∞
hfm : AEMeasurable f
lim₁ : Tendsto (fun i => ∫⁻ (x : α) in ⋂ k ∈ Ici i, φ k, f x ∂μ) atTop (𝓝 (∫⁻ (x : α), f x ∂μ))
lim₂ : Tendsto (fun i => ∫⁻ (x : α) in ⋃ k ∈ Iic i, φ k, f x ∂μ) atTop (𝓝 (∫⁻ (x : α), f x ∂μ))
⊢ Tendsto (fun x => ∫⁻ (x : α) in φ x, f x ∂μ) atTop (𝓝 (∫⁻ (x : α), f x ∂μ))

Next tactic:
refine tendsto_of_tendsto_of_tendsto_of_le_of_le lim₁ lim₂ (fun n ↦ ?_) fun n ↦ ?_