l3lab/ntp-mathlib huggingface dataset:
theorem measurableSet_of_differentiableAt_of_isComplete_with_param
    (hf : Continuous f.uncurry) {K : Set (E →L[𝕜] F)} (hK : IsComplete K) :
    MeasurableSet {p : α × E | DifferentiableAt 𝕜 (f p.1) p.2 ∧ fderiv 𝕜 (f p.1) p.2 ∈ K} := by
  have : {p : α × E | DifferentiableAt 𝕜 (f p.1) p.2 ∧ fderiv 𝕜 (f p.1) p.2 ∈ K}
          = {p : α × E | p.2 ∈ D (f p.1) K} := by simp [← differentiable_set_eq_D K hK]
  rw [this]
  simp only [D, mem_iInter, mem_iUnion]
  simp only [setOf_forall, setOf_exists]
  refine MeasurableSet.iInter (fun _ ↦ ?_)
  refine MeasurableSet.iUnion (fun _ ↦ ?_)
  refine MeasurableSet.iInter (fun _ ↦ ?_)
  refine MeasurableSet.iInter (fun _ ↦ ?_)
  refine MeasurableSet.iInter (fun _ ↦ ?_)
  

Proof state:
𝕜 : Type u_1
inst✝¹⁰ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace 𝕜 E
inst✝⁷ : LocallyCompactSpace E
F : Type u_3
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace 𝕜 F
α : Type u_4
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : MeasurableSpace E
inst✝¹ : OpensMeasurableSpace α
inst✝ : OpensMeasurableSpace E
f : α → E → F
K✝ : Set (E →L[𝕜] F)
hf : Continuous (Function.uncurry f)
K : Set (E →L[𝕜] F)
hK : IsComplete K
this : {p | DifferentiableAt 𝕜 (f p.1) p.2 ∧ fderiv 𝕜 (f p.1) p.2 ∈ K} = {p | p.2 ∈ D (f p.1) K}
x✝⁴ x✝³ x✝² : ℕ
x✝¹ : x✝² ≥ x✝³
x✝ : ℕ
⊢ MeasurableSet (⋂ (_ : x✝ ≥ x✝³), {x | x.2 ∈ B (f x.1) K ((1 / 2) ^ x✝²) ((1 / 2) ^ x✝) ((1 / 2) ^ x✝⁴)})

Next tactic:
refine MeasurableSet.iInter (fun _ ↦ ?_)
theorem measurableSet_of_differentiableAt_of_isComplete_with_param
    (hf : Continuous f.uncurry) {K : Set (E →L[𝕜] F)} (hK : IsComplete K) :
    MeasurableSet {p : α × E | DifferentiableAt 𝕜 (f p.1) p.2 ∧ fderiv 𝕜 (f p.1) p.2 ∈ K} := by
  have : {p : α × E | DifferentiableAt 𝕜 (f p.1) p.2 ∧ fderiv 𝕜 (f p.1) p.2 ∈ K}
          = {p : α × E | p.2 ∈ D (f p.1) K} := by simp [← differentiable_set_eq_D K hK]
  rw [this]
  simp only [D, mem_iInter, mem_iUnion]
  simp only [setOf_forall, setOf_exists]
  refine MeasurableSet.iInter (fun _ ↦ ?_)
  refine MeasurableSet.iUnion (fun _ ↦ ?_)
  refine MeasurableSet.iInter (fun _ ↦ ?_)
  refine MeasurableSet.iInter (fun _ ↦ ?_)
  refine MeasurableSet.iInter (fun _ ↦ ?_)
  refine MeasurableSet.iInter (fun _ ↦ ?_)
  

Proof state:
𝕜 : Type u_1
inst✝¹⁰ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace 𝕜 E
inst✝⁷ : LocallyCompactSpace E
F : Type u_3
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace 𝕜 F
α : Type u_4
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : MeasurableSpace E
inst✝¹ : OpensMeasurableSpace α
inst✝ : OpensMeasurableSpace E
f : α → E → F
K✝ : Set (E →L[𝕜] F)
hf : Continuous (Function.uncurry f)
K : Set (E →L[𝕜] F)
hK : IsComplete K
this : {p | DifferentiableAt 𝕜 (f p.1) p.2 ∧ fderiv 𝕜 (f p.1) p.2 ∈ K} = {p | p.2 ∈ D (f p.1) K}
x✝⁵ x✝⁴ x✝³ : ℕ
x✝² : x✝³ ≥ x✝⁴
x✝¹ : ℕ
x✝ : x✝¹ ≥ x✝⁴
⊢ MeasurableSet {x | x.2 ∈ B (f x.1) K ((1 / 2) ^ x✝³) ((1 / 2) ^ x✝¹) ((1 / 2) ^ x✝⁵)}

Next tactic:
have : ProperSpace E := properSpace_of_locallyCompactSpace 𝕜
theorem measurableSet_of_differentiableAt_of_isComplete_with_param
    (hf : Continuous f.uncurry) {K : Set (E →L[𝕜] F)} (hK : IsComplete K) :
    MeasurableSet {p : α × E | DifferentiableAt 𝕜 (f p.1) p.2 ∧ fderiv 𝕜 (f p.1) p.2 ∈ K} := by
  have : {p : α × E | DifferentiableAt 𝕜 (f p.1) p.2 ∧ fderiv 𝕜 (f p.1) p.2 ∈ K}
          = {p : α × E | p.2 ∈ D (f p.1) K} := by simp [← differentiable_set_eq_D K hK]
  rw [this]
  simp only [D, mem_iInter, mem_iUnion]
  simp only [setOf_forall, setOf_exists]
  refine MeasurableSet.iInter (fun _ ↦ ?_)
  refine MeasurableSet.iUnion (fun _ ↦ ?_)
  refine MeasurableSet.iInter (fun _ ↦ ?_)
  refine MeasurableSet.iInter (fun _ ↦ ?_)
  refine MeasurableSet.iInter (fun _ ↦ ?_)
  refine MeasurableSet.iInter (fun _ ↦ ?_)
  have : ProperSpace E := properSpace_of_locallyCompactSpace 𝕜
  

Proof state:
𝕜 : Type u_1
inst✝¹⁰ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace 𝕜 E
inst✝⁷ : LocallyCompactSpace E
F : Type u_3
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace 𝕜 F
α : Type u_4
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : MeasurableSpace E
inst✝¹ : OpensMeasurableSpace α
inst✝ : OpensMeasurableSpace E
f : α → E → F
K✝ : Set (E →L[𝕜] F)
hf : Continuous (Function.uncurry f)
K : Set (E →L[𝕜] F)
hK : IsComplete K
this✝ : {p | DifferentiableAt 𝕜 (f p.1) p.2 ∧ fderiv 𝕜 (f p.1) p.2 ∈ K} = {p | p.2 ∈ D (f p.1) K}
x✝⁵ x✝⁴ x✝³ : ℕ
x✝² : x✝³ ≥ x✝⁴
x✝¹ : ℕ
x✝ : x✝¹ ≥ x✝⁴
this : ProperSpace E
⊢ MeasurableSet {x | x.2 ∈ B (f x.1) K ((1 / 2) ^ x✝³) ((1 / 2) ^ x✝¹) ((1 / 2) ^ x✝⁵)}

Next tactic:
exact (isOpen_B_with_param hf K).measurableSet
/-- The set of differentiability points of a continuous function depending on a parameter taking
values in a complete space is Borel-measurable. -/
theorem measurableSet_of_differentiableAt_with_param (hf : Continuous f.uncurry) :
    MeasurableSet {p : α × E | DifferentiableAt 𝕜 (f p.1) p.2} := by
  

Proof state:
𝕜 : Type u_1
inst✝¹¹ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝¹⁰ : NormedAddCommGroup E
inst✝⁹ : NormedSpace 𝕜 E
inst✝⁸ : LocallyCompactSpace E
F : Type u_3
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
α : Type u_4
inst✝⁵ : TopologicalSpace α
inst✝⁴ : MeasurableSpace α
inst✝³ : MeasurableSpace E
inst✝² : OpensMeasurableSpace α
inst✝¹ : OpensMeasurableSpace E
f : α → E → F
K : Set (E →L[𝕜] F)
inst✝ : CompleteSpace F
hf : Continuous (Function.uncurry f)
⊢ MeasurableSet {p | DifferentiableAt 𝕜 (f p.1) p.2}

Next tactic:
have : IsComplete (univ : Set (E →L[𝕜] F)) := complete_univ
/-- The set of differentiability points of a continuous function depending on a parameter taking
values in a complete space is Borel-measurable. -/
theorem measurableSet_of_differentiableAt_with_param (hf : Continuous f.uncurry) :
    MeasurableSet {p : α × E | DifferentiableAt 𝕜 (f p.1) p.2} := by
  have : IsComplete (univ : Set (E →L[𝕜] F)) := complete_univ
  

Proof state:
𝕜 : Type u_1
inst✝¹¹ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝¹⁰ : NormedAddCommGroup E
inst✝⁹ : NormedSpace 𝕜 E
inst✝⁸ : LocallyCompactSpace E
F : Type u_3
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
α : Type u_4
inst✝⁵ : TopologicalSpace α
inst✝⁴ : MeasurableSpace α
inst✝³ : MeasurableSpace E
inst✝² : OpensMeasurableSpace α
inst✝¹ : OpensMeasurableSpace E
f : α → E → F
K : Set (E →L[𝕜] F)
inst✝ : CompleteSpace F
hf : Continuous (Function.uncurry f)
this : IsComplete univ
⊢ MeasurableSet {p | DifferentiableAt 𝕜 (f p.1) p.2}

Next tactic:
convert measurableSet_of_differentiableAt_of_isComplete_with_param hf this
/-- The set of differentiability points of a continuous function depending on a parameter taking
values in a complete space is Borel-measurable. -/
theorem measurableSet_of_differentiableAt_with_param (hf : Continuous f.uncurry) :
    MeasurableSet {p : α × E | DifferentiableAt 𝕜 (f p.1) p.2} := by
  have : IsComplete (univ : Set (E →L[𝕜] F)) := complete_univ
  convert measurableSet_of_differentiableAt_of_isComplete_with_param hf this
  

Proof state:
case h.e'_3.h.e'_2.h.a
𝕜 : Type u_1
inst✝¹¹ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝¹⁰ : NormedAddCommGroup E
inst✝⁹ : NormedSpace 𝕜 E
inst✝⁸ : LocallyCompactSpace E
F : Type u_3
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
α : Type u_4
inst✝⁵ : TopologicalSpace α
inst✝⁴ : MeasurableSpace α
inst✝³ : MeasurableSpace E
inst✝² : OpensMeasurableSpace α
inst✝¹ : OpensMeasurableSpace E
f : α → E → F
K : Set (E →L[𝕜] F)
inst✝ : CompleteSpace F
hf : Continuous (Function.uncurry f)
this : IsComplete univ
x✝ : α × E
⊢ DifferentiableAt 𝕜 (f x✝.1) x✝.2 ↔ DifferentiableAt 𝕜 (f x✝.1) x✝.2 ∧ fderiv 𝕜 (f x✝.1) x✝.2 ∈ univ

Next tactic:
simp
theorem measurable_fderiv_with_param (hf : Continuous f.uncurry) :
    Measurable (fun (p : α × E) ↦ fderiv 𝕜 (f p.1) p.2) := by
  

Proof state:
𝕜 : Type u_1
inst✝¹¹ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝¹⁰ : NormedAddCommGroup E
inst✝⁹ : NormedSpace 𝕜 E
inst✝⁸ : LocallyCompactSpace E
F : Type u_3
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
α : Type u_4
inst✝⁵ : TopologicalSpace α
inst✝⁴ : MeasurableSpace α
inst✝³ : MeasurableSpace E
inst✝² : OpensMeasurableSpace α
inst✝¹ : OpensMeasurableSpace E
f : α → E → F
K : Set (E →L[𝕜] F)
inst✝ : CompleteSpace F
hf : Continuous (Function.uncurry f)
⊢ Measurable fun p => fderiv 𝕜 (f p.1) p.2

Next tactic:
refine measurable_of_isClosed (fun s hs ↦ ?_)
theorem measurable_fderiv_with_param (hf : Continuous f.uncurry) :
    Measurable (fun (p : α × E) ↦ fderiv 𝕜 (f p.1) p.2) := by
  refine measurable_of_isClosed (fun s hs ↦ ?_)
  

Proof state:
𝕜 : Type u_1
inst✝¹¹ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝¹⁰ : NormedAddCommGroup E
inst✝⁹ : NormedSpace 𝕜 E
inst✝⁸ : LocallyCompactSpace E
F : Type u_3
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
α : Type u_4
inst✝⁵ : TopologicalSpace α
inst✝⁴ : MeasurableSpace α
inst✝³ : MeasurableSpace E
inst✝² : OpensMeasurableSpace α
inst✝¹ : OpensMeasurableSpace E
f : α → E → F
K : Set (E →L[𝕜] F)
inst✝ : CompleteSpace F
hf : Continuous (Function.uncurry f)
s : Set (E →L[𝕜] F)
hs : IsClosed s
⊢ MeasurableSet ((fun p => fderiv 𝕜 (f p.1) p.2) ⁻¹' s)

Next tactic:
have :
    (fun (p : α × E) ↦ fderiv 𝕜 (f p.1) p.2) ⁻¹' s =
      {p | DifferentiableAt 𝕜 (f p.1) p.2 ∧ fderiv 𝕜 (f p.1) p.2 ∈ s } ∪
        { p | ¬DifferentiableAt 𝕜 (f p.1) p.2} ∩ { _p | (0 : E →L[𝕜] F) ∈ s} :=
    Set.ext (fun x ↦ mem_preimage.trans fderiv_mem_iff)
theorem measurable_fderiv_with_param (hf : Continuous f.uncurry) :
    Measurable (fun (p : α × E) ↦ fderiv 𝕜 (f p.1) p.2) := by
  refine measurable_of_isClosed (fun s hs ↦ ?_)
  have :
    (fun (p : α × E) ↦ fderiv 𝕜 (f p.1) p.2) ⁻¹' s =
      {p | DifferentiableAt 𝕜 (f p.1) p.2 ∧ fderiv 𝕜 (f p.1) p.2 ∈ s } ∪
        { p | ¬DifferentiableAt 𝕜 (f p.1) p.2} ∩ { _p | (0 : E →L[𝕜] F) ∈ s} :=
    Set.ext (fun x ↦ mem_preimage.trans fderiv_mem_iff)
  

Proof state:
𝕜 : Type u_1
inst✝¹¹ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝¹⁰ : NormedAddCommGroup E
inst✝⁹ : NormedSpace 𝕜 E
inst✝⁸ : LocallyCompactSpace E
F : Type u_3
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
α : Type u_4
inst✝⁵ : TopologicalSpace α
inst✝⁴ : MeasurableSpace α
inst✝³ : MeasurableSpace E
inst✝² : OpensMeasurableSpace α
inst✝¹ : OpensMeasurableSpace E
f : α → E → F
K : Set (E →L[𝕜] F)
inst✝ : CompleteSpace F
hf : Continuous (Function.uncurry f)
s : Set (E →L[𝕜] F)
hs : IsClosed s
this :
  (fun p => fderiv 𝕜 (f p.1) p.2) ⁻¹' s =
    {p | DifferentiableAt 𝕜 (f p.1) p.2 ∧ fderiv 𝕜 (f p.1) p.2 ∈ s} ∪
      {p | ¬DifferentiableAt 𝕜 (f p.1) p.2} ∩ {_p | 0 ∈ s}
⊢ MeasurableSet ((fun p => fderiv 𝕜 (f p.1) p.2) ⁻¹' s)

Next tactic:
rw [this]
theorem measurable_fderiv_with_param (hf : Continuous f.uncurry) :
    Measurable (fun (p : α × E) ↦ fderiv 𝕜 (f p.1) p.2) := by
  refine measurable_of_isClosed (fun s hs ↦ ?_)
  have :
    (fun (p : α × E) ↦ fderiv 𝕜 (f p.1) p.2) ⁻¹' s =
      {p | DifferentiableAt 𝕜 (f p.1) p.2 ∧ fderiv 𝕜 (f p.1) p.2 ∈ s } ∪
        { p | ¬DifferentiableAt 𝕜 (f p.1) p.2} ∩ { _p | (0 : E →L[𝕜] F) ∈ s} :=
    Set.ext (fun x ↦ mem_preimage.trans fderiv_mem_iff)
  rw [this]
  

Proof state:
𝕜 : Type u_1
inst✝¹¹ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝¹⁰ : NormedAddCommGroup E
inst✝⁹ : NormedSpace 𝕜 E
inst✝⁸ : LocallyCompactSpace E
F : Type u_3
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
α : Type u_4
inst✝⁵ : TopologicalSpace α
inst✝⁴ : MeasurableSpace α
inst✝³ : MeasurableSpace E
inst✝² : OpensMeasurableSpace α
inst✝¹ : OpensMeasurableSpace E
f : α → E → F
K : Set (E →L[𝕜] F)
inst✝ : CompleteSpace F
hf : Continuous (Function.uncurry f)
s : Set (E →L[𝕜] F)
hs : IsClosed s
this :
  (fun p => fderiv 𝕜 (f p.1) p.2) ⁻¹' s =
    {p | DifferentiableAt 𝕜 (f p.1) p.2 ∧ fderiv 𝕜 (f p.1) p.2 ∈ s} ∪
      {p | ¬DifferentiableAt 𝕜 (f p.1) p.2} ∩ {_p | 0 ∈ s}
⊢ MeasurableSet
    ({p | DifferentiableAt 𝕜 (f p.1) p.2 ∧ fderiv 𝕜 (f p.1) p.2 ∈ s} ∪
      {p | ¬DifferentiableAt 𝕜 (f p.1) p.2} ∩ {_p | 0 ∈ s})

Next tactic:
exact
    (measurableSet_of_differentiableAt_of_isComplete_with_param hf hs.isComplete).union
      ((measurableSet_of_differentiableAt_with_param _ hf).compl.inter (MeasurableSet.const _))
theorem measurable_deriv_with_param [LocallyCompactSpace 𝕜] [MeasurableSpace 𝕜]
    [OpensMeasurableSpace 𝕜] [MeasurableSpace F]
    [BorelSpace F] {f : α → 𝕜 → F} (hf : Continuous f.uncurry) :
    Measurable (fun (p : α × 𝕜) ↦ deriv (f p.1) p.2) := by
  

Proof state:
𝕜 : Type u_1
inst✝¹⁶ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝¹⁵ : NormedAddCommGroup E
inst✝¹⁴ : NormedSpace 𝕜 E
inst✝¹³ : LocallyCompactSpace E
F : Type u_3
inst✝¹² : NormedAddCommGroup F
inst✝¹¹ : NormedSpace 𝕜 F
α : Type u_4
inst✝¹⁰ : TopologicalSpace α
inst✝⁹ : MeasurableSpace α
inst✝⁸ : MeasurableSpace E
inst✝⁷ : OpensMeasurableSpace α
inst✝⁶ : OpensMeasurableSpace E
f✝ : α → E → F
K : Set (E →L[𝕜] F)
inst✝⁵ : CompleteSpace F
inst✝⁴ : LocallyCompactSpace 𝕜
inst✝³ : MeasurableSpace 𝕜
inst✝² : OpensMeasurableSpace 𝕜
inst✝¹ : MeasurableSpace F
inst✝ : BorelSpace F
f : α → 𝕜 → F
hf : Continuous (Function.uncurry f)
⊢ Measurable fun p => deriv (f p.1) p.2

Next tactic:
simpa only [fderiv_deriv] using measurable_fderiv_apply_const_with_param 𝕜 hf 1
theorem stronglyMeasurable_deriv_with_param [LocallyCompactSpace 𝕜] [MeasurableSpace 𝕜]
    [OpensMeasurableSpace 𝕜] [h : SecondCountableTopologyEither α F]
    {f : α → 𝕜 → F} (hf : Continuous f.uncurry) :
    StronglyMeasurable (fun (p : α × 𝕜) ↦ deriv (f p.1) p.2) := by
  

Proof state:
𝕜 : Type u_1
inst✝¹⁴ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝¹³ : NormedAddCommGroup E
inst✝¹² : NormedSpace 𝕜 E
inst✝¹¹ : LocallyCompactSpace E
F : Type u_3
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
α : Type u_4
inst✝⁸ : TopologicalSpace α
inst✝⁷ : MeasurableSpace α
inst✝⁶ : MeasurableSpace E
inst✝⁵ : OpensMeasurableSpace α
inst✝⁴ : OpensMeasurableSpace E
f✝ : α → E → F
K : Set (E →L[𝕜] F)
inst✝³ : CompleteSpace F
inst✝² : LocallyCompactSpace 𝕜
inst✝¹ : MeasurableSpace 𝕜
inst✝ : OpensMeasurableSpace 𝕜
h : SecondCountableTopologyEither α F
f : α → 𝕜 → F
hf : Continuous (Function.uncurry f)
⊢ StronglyMeasurable fun p => deriv (f p.1) p.2

Next tactic:
borelize F
theorem stronglyMeasurable_deriv_with_param [LocallyCompactSpace 𝕜] [MeasurableSpace 𝕜]
    [OpensMeasurableSpace 𝕜] [h : SecondCountableTopologyEither α F]
    {f : α → 𝕜 → F} (hf : Continuous f.uncurry) :
    StronglyMeasurable (fun (p : α × 𝕜) ↦ deriv (f p.1) p.2) := by
  borelize F
  

Proof state:
𝕜 : Type u_1
inst✝¹⁴ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝¹³ : NormedAddCommGroup E
inst✝¹² : NormedSpace 𝕜 E
inst✝¹¹ : LocallyCompactSpace E
F : Type u_3
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
α : Type u_4
inst✝⁸ : TopologicalSpace α
inst✝⁷ : MeasurableSpace α
inst✝⁶ : MeasurableSpace E
inst✝⁵ : OpensMeasurableSpace α
inst✝⁴ : OpensMeasurableSpace E
f✝ : α → E → F
K : Set (E →L[𝕜] F)
inst✝³ : CompleteSpace F
inst✝² : LocallyCompactSpace 𝕜
inst✝¹ : MeasurableSpace 𝕜
inst✝ : OpensMeasurableSpace 𝕜
h : SecondCountableTopologyEither α F
f : α → 𝕜 → F
hf : Continuous (Function.uncurry f)
this✝¹ : MeasurableSpace F := borel F
this✝ : BorelSpace F
⊢ StronglyMeasurable fun p => deriv (f p.1) p.2

Next tactic:
rcases h.out with hα|hF
theorem stronglyMeasurable_deriv_with_param [LocallyCompactSpace 𝕜] [MeasurableSpace 𝕜]
    [OpensMeasurableSpace 𝕜] [h : SecondCountableTopologyEither α F]
    {f : α → 𝕜 → F} (hf : Continuous f.uncurry) :
    StronglyMeasurable (fun (p : α × 𝕜) ↦ deriv (f p.1) p.2) := by
  borelize F
  rcases h.out with hα|hF
  · 

Proof state:
case inl
𝕜 : Type u_1
inst✝¹⁴ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝¹³ : NormedAddCommGroup E
inst✝¹² : NormedSpace 𝕜 E
inst✝¹¹ : LocallyCompactSpace E
F : Type u_3
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
α : Type u_4
inst✝⁸ : TopologicalSpace α
inst✝⁷ : MeasurableSpace α
inst✝⁶ : MeasurableSpace E
inst✝⁵ : OpensMeasurableSpace α
inst✝⁴ : OpensMeasurableSpace E
f✝ : α → E → F
K : Set (E →L[𝕜] F)
inst✝³ : CompleteSpace F
inst✝² : LocallyCompactSpace 𝕜
inst✝¹ : MeasurableSpace 𝕜
inst✝ : OpensMeasurableSpace 𝕜
h : SecondCountableTopologyEither α F
f : α → 𝕜 → F
hf : Continuous (Function.uncurry f)
this✝¹ : MeasurableSpace F := borel F
this✝ : BorelSpace F
hα : SecondCountableTopology α
⊢ StronglyMeasurable fun p => deriv (f p.1) p.2

Next tactic:
have : ProperSpace 𝕜 := properSpace_of_locallyCompactSpace 𝕜
theorem stronglyMeasurable_deriv_with_param [LocallyCompactSpace 𝕜] [MeasurableSpace 𝕜]
    [OpensMeasurableSpace 𝕜] [h : SecondCountableTopologyEither α F]
    {f : α → 𝕜 → F} (hf : Continuous f.uncurry) :
    StronglyMeasurable (fun (p : α × 𝕜) ↦ deriv (f p.1) p.2) := by
  borelize F
  rcases h.out with hα|hF
  · have : ProperSpace 𝕜 := properSpace_of_locallyCompactSpace 𝕜
    

Proof state:
case inl
𝕜 : Type u_1
inst✝¹⁴ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝¹³ : NormedAddCommGroup E
inst✝¹² : NormedSpace 𝕜 E
inst✝¹¹ : LocallyCompactSpace E
F : Type u_3
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
α : Type u_4
inst✝⁸ : TopologicalSpace α
inst✝⁷ : MeasurableSpace α
inst✝⁶ : MeasurableSpace E
inst✝⁵ : OpensMeasurableSpace α
inst✝⁴ : OpensMeasurableSpace E
f✝ : α → E → F
K : Set (E →L[𝕜] F)
inst✝³ : CompleteSpace F
inst✝² : LocallyCompactSpace 𝕜
inst✝¹ : MeasurableSpace 𝕜
inst✝ : OpensMeasurableSpace 𝕜
h : SecondCountableTopologyEither α F
f : α → 𝕜 → F
hf : Continuous (Function.uncurry f)
this✝¹ : MeasurableSpace F := borel F
this✝ : BorelSpace F
hα : SecondCountableTopology α
this : ProperSpace 𝕜
⊢ StronglyMeasurable fun p => deriv (f p.1) p.2

Next tactic:
apply stronglyMeasurable_iff_measurable_separable.2 ⟨measurable_deriv_with_param hf, ?_⟩
theorem stronglyMeasurable_deriv_with_param [LocallyCompactSpace 𝕜] [MeasurableSpace 𝕜]
    [OpensMeasurableSpace 𝕜] [h : SecondCountableTopologyEither α F]
    {f : α → 𝕜 → F} (hf : Continuous f.uncurry) :
    StronglyMeasurable (fun (p : α × 𝕜) ↦ deriv (f p.1) p.2) := by
  borelize F
  rcases h.out with hα|hF
  · have : ProperSpace 𝕜 := properSpace_of_locallyCompactSpace 𝕜
    apply stronglyMeasurable_iff_measurable_separable.2 ⟨measurable_deriv_with_param hf, ?_⟩
    

Proof state:
𝕜 : Type u_1
inst✝¹⁴ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝¹³ : NormedAddCommGroup E
inst✝¹² : NormedSpace 𝕜 E
inst✝¹¹ : LocallyCompactSpace E
F : Type u_3
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
α : Type u_4
inst✝⁸ : TopologicalSpace α
inst✝⁷ : MeasurableSpace α
inst✝⁶ : MeasurableSpace E
inst✝⁵ : OpensMeasurableSpace α
inst✝⁴ : OpensMeasurableSpace E
f✝ : α → E → F
K : Set (E →L[𝕜] F)
inst✝³ : CompleteSpace F
inst✝² : LocallyCompactSpace 𝕜
inst✝¹ : MeasurableSpace 𝕜
inst✝ : OpensMeasurableSpace 𝕜
h : SecondCountableTopologyEither α F
f : α → 𝕜 → F
hf : Continuous (Function.uncurry f)
this✝¹ : MeasurableSpace F := borel F
this✝ : BorelSpace F
hα : SecondCountableTopology α
this : ProperSpace 𝕜
⊢ IsSeparable (range fun p => deriv (f p.1) p.2)

Next tactic:
have : range (fun (p : α × 𝕜) ↦ deriv (f p.1) p.2)
        ⊆ closure (Submodule.span 𝕜 (range f.uncurry)) := by
      rintro - ⟨p, rfl⟩
      have A : deriv (f p.1) p.2 ∈ closure (Submodule.span 𝕜 (range (f p.1))) := by
        rw [← image_univ]
        apply range_deriv_subset_closure_span_image _ dense_univ (mem_range_self _)
      have B : range (f p.1) ⊆ range (f.uncurry) := by
        rintro - ⟨x, rfl⟩
        exact mem_range_self (p.1, x)
      exact closure_mono (Submodule.span_mono B) A
theorem stronglyMeasurable_deriv_with_param [LocallyCompactSpace 𝕜] [MeasurableSpace 𝕜]
    [OpensMeasurableSpace 𝕜] [h : SecondCountableTopologyEither α F]
    {f : α → 𝕜 → F} (hf : Continuous f.uncurry) :
    StronglyMeasurable (fun (p : α × 𝕜) ↦ deriv (f p.1) p.2) := by
  borelize F
  rcases h.out with hα|hF
  · have : ProperSpace 𝕜 := properSpace_of_locallyCompactSpace 𝕜
    apply stronglyMeasurable_iff_measurable_separable.2 ⟨measurable_deriv_with_param hf, ?_⟩
    have : range (fun (p : α × 𝕜) ↦ deriv (f p.1) p.2)
        ⊆ closure (Submodule.span 𝕜 (range f.uncurry)) := by
      

Proof state:
𝕜 : Type u_1
inst✝¹⁴ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝¹³ : NormedAddCommGroup E
inst✝¹² : NormedSpace 𝕜 E
inst✝¹¹ : LocallyCompactSpace E
F : Type u_3
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
α : Type u_4
inst✝⁸ : TopologicalSpace α
inst✝⁷ : MeasurableSpace α
inst✝⁶ : MeasurableSpace E
inst✝⁵ : OpensMeasurableSpace α
inst✝⁴ : OpensMeasurableSpace E
f✝ : α → E → F
K : Set (E →L[𝕜] F)
inst✝³ : CompleteSpace F
inst✝² : LocallyCompactSpace 𝕜
inst✝¹ : MeasurableSpace 𝕜
inst✝ : OpensMeasurableSpace 𝕜
h : SecondCountableTopologyEither α F
f : α → 𝕜 → F
hf : Continuous (Function.uncurry f)
this✝¹ : MeasurableSpace F := borel F
this✝ : BorelSpace F
hα : SecondCountableTopology α
this : ProperSpace 𝕜
⊢ (range fun p => deriv (f p.1) p.2) ⊆ closure ↑(Submodule.span 𝕜 (range (Function.uncurry f)))

Next tactic:
rintro - ⟨p, rfl⟩
theorem stronglyMeasurable_deriv_with_param [LocallyCompactSpace 𝕜] [MeasurableSpace 𝕜]
    [OpensMeasurableSpace 𝕜] [h : SecondCountableTopologyEither α F]
    {f : α → 𝕜 → F} (hf : Continuous f.uncurry) :
    StronglyMeasurable (fun (p : α × 𝕜) ↦ deriv (f p.1) p.2) := by
  borelize F
  rcases h.out with hα|hF
  · have : ProperSpace 𝕜 := properSpace_of_locallyCompactSpace 𝕜
    apply stronglyMeasurable_iff_measurable_separable.2 ⟨measurable_deriv_with_param hf, ?_⟩
    have : range (fun (p : α × 𝕜) ↦ deriv (f p.1) p.2)
        ⊆ closure (Submodule.span 𝕜 (range f.uncurry)) := by
      rintro - ⟨p, rfl⟩
      

Proof state:
case intro
𝕜 : Type u_1
inst✝¹⁴ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝¹³ : NormedAddCommGroup E
inst✝¹² : NormedSpace 𝕜 E
inst✝¹¹ : LocallyCompactSpace E
F : Type u_3
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
α : Type u_4
inst✝⁸ : TopologicalSpace α
inst✝⁷ : MeasurableSpace α
inst✝⁶ : MeasurableSpace E
inst✝⁵ : OpensMeasurableSpace α
inst✝⁴ : OpensMeasurableSpace E
f✝ : α → E → F
K : Set (E →L[𝕜] F)
inst✝³ : CompleteSpace F
inst✝² : LocallyCompactSpace 𝕜
inst✝¹ : MeasurableSpace 𝕜
inst✝ : OpensMeasurableSpace 𝕜
h : SecondCountableTopologyEither α F
f : α → 𝕜 → F
hf : Continuous (Function.uncurry f)
this✝¹ : MeasurableSpace F := borel F
this✝ : BorelSpace F
hα : SecondCountableTopology α
this : ProperSpace 𝕜
p : α × 𝕜
⊢ (fun p => deriv (f p.1) p.2) p ∈ closure ↑(Submodule.span 𝕜 (range (Function.uncurry f)))

Next tactic:
have A : deriv (f p.1) p.2 ∈ closure (Submodule.span 𝕜 (range (f p.1))) := by
        rw [← image_univ]
        apply range_deriv_subset_closure_span_image _ dense_univ (mem_range_self _)
theorem stronglyMeasurable_deriv_with_param [LocallyCompactSpace 𝕜] [MeasurableSpace 𝕜]
    [OpensMeasurableSpace 𝕜] [h : SecondCountableTopologyEither α F]
    {f : α → 𝕜 → F} (hf : Continuous f.uncurry) :
    StronglyMeasurable (fun (p : α × 𝕜) ↦ deriv (f p.1) p.2) := by
  borelize F
  rcases h.out with hα|hF
  · have : ProperSpace 𝕜 := properSpace_of_locallyCompactSpace 𝕜
    apply stronglyMeasurable_iff_measurable_separable.2 ⟨measurable_deriv_with_param hf, ?_⟩
    have : range (fun (p : α × 𝕜) ↦ deriv (f p.1) p.2)
        ⊆ closure (Submodule.span 𝕜 (range f.uncurry)) := by
      rintro - ⟨p, rfl⟩
      have A : deriv (f p.1) p.2 ∈ closure (Submodule.span 𝕜 (range (f p.1))) := by
        

Proof state:
𝕜 : Type u_1
inst✝¹⁴ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝¹³ : NormedAddCommGroup E
inst✝¹² : NormedSpace 𝕜 E
inst✝¹¹ : LocallyCompactSpace E
F : Type u_3
inst✝¹⁰ : NormedAddCommGroup F
inst✝⁹ : NormedSpace 𝕜 F
α : Type u_4
inst✝⁸ : TopologicalSpace α
inst✝⁷ : MeasurableSpace α
inst✝⁶ : MeasurableSpace E
inst✝⁵ : OpensMeasurableSpace α
inst✝⁴ : OpensMeasurableSpace E
f✝ : α → E → F
K : Set (E →L[𝕜] F)
inst✝³ : CompleteSpace F
inst✝² : LocallyCompactSpace 𝕜
inst✝¹ : MeasurableSpace 𝕜
inst✝ : OpensMeasurableSpace 𝕜
h : SecondCountableTopologyEither α F
f : α → 𝕜 → F
hf : Continuous (Function.uncurry f)
this✝¹ : MeasurableSpace F := borel F
this✝ : BorelSpace F
hα : SecondCountableTopology α
this : ProperSpace 𝕜
p : α × 𝕜
⊢ deriv (f p.1) p.2 ∈ closure ↑(Submodule.span 𝕜 (range (f p.1)))

Next tactic:
rw [← image_univ]