l3lab/ntp-mathlib huggingface dataset:
/-- If `b` and `b'` are `ℚ`-bases of a number field `K` such that
`∀ i j, IsIntegral ℤ (b.toMatrix b' i j)` and `∀ i j, IsIntegral ℤ (b'.toMatrix b i j)` then
`discr ℚ b = discr ℚ b'`. -/
theorem Algebra.discr_eq_discr_of_toMatrix_coeff_isIntegral [NumberField K]
    {b : Basis ι ℚ K} {b' : Basis ι' ℚ K} (h : ∀ i j, IsIntegral ℤ (b.toMatrix b' i j))
    (h' : ∀ i j, IsIntegral ℤ (b'.toMatrix b i j)) : discr ℚ b = discr ℚ b' := by
  replace h' : ∀ i j, IsIntegral ℤ (b'.toMatrix (b.reindex (b.indexEquiv b')) i j)
  · intro i j
    convert h' i ((b.indexEquiv b').symm j)
-- Porting note: `simp; rfl` was `simpa`.
    simp; rfl
  classical
  rw [← (b.reindex (b.indexEquiv b')).toMatrix_map_vecMul b', discr_of_matrix_vecMul,
    ← one_mul (discr ℚ b), Basis.coe_reindex, discr_reindex]
  congr
  have hint : IsIntegral ℤ ((b.reindex (b.indexEquiv b')).toMatrix b').det :=
    IsIntegral.det fun i j => h _ _
  obtain ⟨r, hr⟩ := IsIntegrallyClosed.isIntegral_iff.1 hint
  have hunit : IsUnit r := by
    have : IsIntegral ℤ (b'.toMatrix (b.reindex (b.indexEquiv b'))).det :=
      IsIntegral.det fun i j => h' _ _
    obtain ⟨r', hr'⟩ := IsIntegrallyClosed.isIntegral_iff.1 this
    refine' isUnit_iff_exists_inv.2 ⟨r', _⟩
    suffices algebraMap ℤ ℚ (r * r') = 1 by
      rw [← RingHom.map_one (algebraMap ℤ ℚ)] at this
      exact (IsFractionRing.injective ℤ ℚ) this
    rw [RingHom.map_mul, hr, hr', ← Matrix.det_mul,
      Basis.toMatrix_mul_toMatrix_flip, Matrix.det_one]
  

Proof state:
case e_a.intro
ι : Type u_2
ι' : Type u_3
K : Type u_1
inst✝⁵ : Field K
inst✝⁴ : DecidableEq ι
inst✝³ : DecidableEq ι'
inst✝² : Fintype ι
inst✝¹ : Fintype ι'
inst✝ : NumberField K
b : Basis ι ℚ K
b' : Basis ι' ℚ K
h : ∀ (i : ι) (j : ι'), IsIntegral ℤ (Basis.toMatrix b (⇑b') i j)
h' : ∀ (i j : ι'), IsIntegral ℤ (Basis.toMatrix b' (⇑(Basis.reindex b (Basis.indexEquiv b b'))) i j)
hint : IsIntegral ℤ (Matrix.det (Basis.toMatrix (Basis.reindex b (Basis.indexEquiv b b')) ⇑b'))
r : ℤ
hr : (algebraMap ℤ ℚ) r = Matrix.det (Basis.toMatrix (Basis.reindex b (Basis.indexEquiv b b')) ⇑b')
hunit : IsUnit r
⊢ 1 = Matrix.det (Basis.toMatrix (Basis.reindex b (Basis.indexEquiv b b')) ⇑b') ^ 2

Next tactic:
rw [← RingHom.map_one (algebraMap ℤ ℚ), ← hr]
/-- If `b` and `b'` are `ℚ`-bases of a number field `K` such that
`∀ i j, IsIntegral ℤ (b.toMatrix b' i j)` and `∀ i j, IsIntegral ℤ (b'.toMatrix b i j)` then
`discr ℚ b = discr ℚ b'`. -/
theorem Algebra.discr_eq_discr_of_toMatrix_coeff_isIntegral [NumberField K]
    {b : Basis ι ℚ K} {b' : Basis ι' ℚ K} (h : ∀ i j, IsIntegral ℤ (b.toMatrix b' i j))
    (h' : ∀ i j, IsIntegral ℤ (b'.toMatrix b i j)) : discr ℚ b = discr ℚ b' := by
  replace h' : ∀ i j, IsIntegral ℤ (b'.toMatrix (b.reindex (b.indexEquiv b')) i j)
  · intro i j
    convert h' i ((b.indexEquiv b').symm j)
-- Porting note: `simp; rfl` was `simpa`.
    simp; rfl
  classical
  rw [← (b.reindex (b.indexEquiv b')).toMatrix_map_vecMul b', discr_of_matrix_vecMul,
    ← one_mul (discr ℚ b), Basis.coe_reindex, discr_reindex]
  congr
  have hint : IsIntegral ℤ ((b.reindex (b.indexEquiv b')).toMatrix b').det :=
    IsIntegral.det fun i j => h _ _
  obtain ⟨r, hr⟩ := IsIntegrallyClosed.isIntegral_iff.1 hint
  have hunit : IsUnit r := by
    have : IsIntegral ℤ (b'.toMatrix (b.reindex (b.indexEquiv b'))).det :=
      IsIntegral.det fun i j => h' _ _
    obtain ⟨r', hr'⟩ := IsIntegrallyClosed.isIntegral_iff.1 this
    refine' isUnit_iff_exists_inv.2 ⟨r', _⟩
    suffices algebraMap ℤ ℚ (r * r') = 1 by
      rw [← RingHom.map_one (algebraMap ℤ ℚ)] at this
      exact (IsFractionRing.injective ℤ ℚ) this
    rw [RingHom.map_mul, hr, hr', ← Matrix.det_mul,
      Basis.toMatrix_mul_toMatrix_flip, Matrix.det_one]
  rw [← RingHom.map_one (algebraMap ℤ ℚ), ← hr]
  

Proof state:
case e_a.intro
ι : Type u_2
ι' : Type u_3
K : Type u_1
inst✝⁵ : Field K
inst✝⁴ : DecidableEq ι
inst✝³ : DecidableEq ι'
inst✝² : Fintype ι
inst✝¹ : Fintype ι'
inst✝ : NumberField K
b : Basis ι ℚ K
b' : Basis ι' ℚ K
h : ∀ (i : ι) (j : ι'), IsIntegral ℤ (Basis.toMatrix b (⇑b') i j)
h' : ∀ (i j : ι'), IsIntegral ℤ (Basis.toMatrix b' (⇑(Basis.reindex b (Basis.indexEquiv b b'))) i j)
hint : IsIntegral ℤ (Matrix.det (Basis.toMatrix (Basis.reindex b (Basis.indexEquiv b b')) ⇑b'))
r : ℤ
hr : (algebraMap ℤ ℚ) r = Matrix.det (Basis.toMatrix (Basis.reindex b (Basis.indexEquiv b b')) ⇑b')
hunit : IsUnit r
⊢ (algebraMap ℤ ℚ) 1 = (algebraMap ℤ ℚ) r ^ 2

Next tactic:
cases' Int.isUnit_iff.1 hunit with hp hm
/-- If `b` and `b'` are `ℚ`-bases of a number field `K` such that
`∀ i j, IsIntegral ℤ (b.toMatrix b' i j)` and `∀ i j, IsIntegral ℤ (b'.toMatrix b i j)` then
`discr ℚ b = discr ℚ b'`. -/
theorem Algebra.discr_eq_discr_of_toMatrix_coeff_isIntegral [NumberField K]
    {b : Basis ι ℚ K} {b' : Basis ι' ℚ K} (h : ∀ i j, IsIntegral ℤ (b.toMatrix b' i j))
    (h' : ∀ i j, IsIntegral ℤ (b'.toMatrix b i j)) : discr ℚ b = discr ℚ b' := by
  replace h' : ∀ i j, IsIntegral ℤ (b'.toMatrix (b.reindex (b.indexEquiv b')) i j)
  · intro i j
    convert h' i ((b.indexEquiv b').symm j)
-- Porting note: `simp; rfl` was `simpa`.
    simp; rfl
  classical
  rw [← (b.reindex (b.indexEquiv b')).toMatrix_map_vecMul b', discr_of_matrix_vecMul,
    ← one_mul (discr ℚ b), Basis.coe_reindex, discr_reindex]
  congr
  have hint : IsIntegral ℤ ((b.reindex (b.indexEquiv b')).toMatrix b').det :=
    IsIntegral.det fun i j => h _ _
  obtain ⟨r, hr⟩ := IsIntegrallyClosed.isIntegral_iff.1 hint
  have hunit : IsUnit r := by
    have : IsIntegral ℤ (b'.toMatrix (b.reindex (b.indexEquiv b'))).det :=
      IsIntegral.det fun i j => h' _ _
    obtain ⟨r', hr'⟩ := IsIntegrallyClosed.isIntegral_iff.1 this
    refine' isUnit_iff_exists_inv.2 ⟨r', _⟩
    suffices algebraMap ℤ ℚ (r * r') = 1 by
      rw [← RingHom.map_one (algebraMap ℤ ℚ)] at this
      exact (IsFractionRing.injective ℤ ℚ) this
    rw [RingHom.map_mul, hr, hr', ← Matrix.det_mul,
      Basis.toMatrix_mul_toMatrix_flip, Matrix.det_one]
  rw [← RingHom.map_one (algebraMap ℤ ℚ), ← hr]
  cases' Int.isUnit_iff.1 hunit with hp hm
  · 

Proof state:
case e_a.intro.inl
ι : Type u_2
ι' : Type u_3
K : Type u_1
inst✝⁵ : Field K
inst✝⁴ : DecidableEq ι
inst✝³ : DecidableEq ι'
inst✝² : Fintype ι
inst✝¹ : Fintype ι'
inst✝ : NumberField K
b : Basis ι ℚ K
b' : Basis ι' ℚ K
h : ∀ (i : ι) (j : ι'), IsIntegral ℤ (Basis.toMatrix b (⇑b') i j)
h' : ∀ (i j : ι'), IsIntegral ℤ (Basis.toMatrix b' (⇑(Basis.reindex b (Basis.indexEquiv b b'))) i j)
hint : IsIntegral ℤ (Matrix.det (Basis.toMatrix (Basis.reindex b (Basis.indexEquiv b b')) ⇑b'))
r : ℤ
hr : (algebraMap ℤ ℚ) r = Matrix.det (Basis.toMatrix (Basis.reindex b (Basis.indexEquiv b b')) ⇑b')
hunit : IsUnit r
hp : r = 1
⊢ (algebraMap ℤ ℚ) 1 = (algebraMap ℤ ℚ) r ^ 2

Next tactic:
simp [hp]
/-- If `b` and `b'` are `ℚ`-bases of a number field `K` such that
`∀ i j, IsIntegral ℤ (b.toMatrix b' i j)` and `∀ i j, IsIntegral ℤ (b'.toMatrix b i j)` then
`discr ℚ b = discr ℚ b'`. -/
theorem Algebra.discr_eq_discr_of_toMatrix_coeff_isIntegral [NumberField K]
    {b : Basis ι ℚ K} {b' : Basis ι' ℚ K} (h : ∀ i j, IsIntegral ℤ (b.toMatrix b' i j))
    (h' : ∀ i j, IsIntegral ℤ (b'.toMatrix b i j)) : discr ℚ b = discr ℚ b' := by
  replace h' : ∀ i j, IsIntegral ℤ (b'.toMatrix (b.reindex (b.indexEquiv b')) i j)
  · intro i j
    convert h' i ((b.indexEquiv b').symm j)
-- Porting note: `simp; rfl` was `simpa`.
    simp; rfl
  classical
  rw [← (b.reindex (b.indexEquiv b')).toMatrix_map_vecMul b', discr_of_matrix_vecMul,
    ← one_mul (discr ℚ b), Basis.coe_reindex, discr_reindex]
  congr
  have hint : IsIntegral ℤ ((b.reindex (b.indexEquiv b')).toMatrix b').det :=
    IsIntegral.det fun i j => h _ _
  obtain ⟨r, hr⟩ := IsIntegrallyClosed.isIntegral_iff.1 hint
  have hunit : IsUnit r := by
    have : IsIntegral ℤ (b'.toMatrix (b.reindex (b.indexEquiv b'))).det :=
      IsIntegral.det fun i j => h' _ _
    obtain ⟨r', hr'⟩ := IsIntegrallyClosed.isIntegral_iff.1 this
    refine' isUnit_iff_exists_inv.2 ⟨r', _⟩
    suffices algebraMap ℤ ℚ (r * r') = 1 by
      rw [← RingHom.map_one (algebraMap ℤ ℚ)] at this
      exact (IsFractionRing.injective ℤ ℚ) this
    rw [RingHom.map_mul, hr, hr', ← Matrix.det_mul,
      Basis.toMatrix_mul_toMatrix_flip, Matrix.det_one]
  rw [← RingHom.map_one (algebraMap ℤ ℚ), ← hr]
  cases' Int.isUnit_iff.1 hunit with hp hm
  · simp [hp]
  · 

Proof state:
case e_a.intro.inr
ι : Type u_2
ι' : Type u_3
K : Type u_1
inst✝⁵ : Field K
inst✝⁴ : DecidableEq ι
inst✝³ : DecidableEq ι'
inst✝² : Fintype ι
inst✝¹ : Fintype ι'
inst✝ : NumberField K
b : Basis ι ℚ K
b' : Basis ι' ℚ K
h : ∀ (i : ι) (j : ι'), IsIntegral ℤ (Basis.toMatrix b (⇑b') i j)
h' : ∀ (i j : ι'), IsIntegral ℤ (Basis.toMatrix b' (⇑(Basis.reindex b (Basis.indexEquiv b b'))) i j)
hint : IsIntegral ℤ (Matrix.det (Basis.toMatrix (Basis.reindex b (Basis.indexEquiv b b')) ⇑b'))
r : ℤ
hr : (algebraMap ℤ ℚ) r = Matrix.det (Basis.toMatrix (Basis.reindex b (Basis.indexEquiv b b')) ⇑b')
hunit : IsUnit r
hm : r = -1
⊢ (algebraMap ℤ ℚ) 1 = (algebraMap ℤ ℚ) r ^ 2

Next tactic:
simp [hm]
theorem Filtration.adapted_natural [MetrizableSpace β] [mβ : MeasurableSpace β] [BorelSpace β]
    {u : ι → Ω → β} (hum : ∀ i, StronglyMeasurable[m] (u i)) :
    Adapted (Filtration.natural u hum) u := by
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝³ : TopologicalSpace β
inst✝² : Preorder ι
u✝ v : ι → Ω → β
f : Filtration ι m
inst✝¹ : MetrizableSpace β
mβ : MeasurableSpace β
inst✝ : BorelSpace β
u : ι → Ω → β
hum : ∀ (i : ι), StronglyMeasurable (u i)
⊢ Adapted (natural u hum) u

Next tactic:
intro i
theorem Filtration.adapted_natural [MetrizableSpace β] [mβ : MeasurableSpace β] [BorelSpace β]
    {u : ι → Ω → β} (hum : ∀ i, StronglyMeasurable[m] (u i)) :
    Adapted (Filtration.natural u hum) u := by
  intro i
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝³ : TopologicalSpace β
inst✝² : Preorder ι
u✝ v : ι → Ω → β
f : Filtration ι m
inst✝¹ : MetrizableSpace β
mβ : MeasurableSpace β
inst✝ : BorelSpace β
u : ι → Ω → β
hum : ∀ (i : ι), StronglyMeasurable (u i)
i : ι
⊢ StronglyMeasurable (u i)

Next tactic:
refine' StronglyMeasurable.mono _ (le_iSup₂_of_le i (le_refl i) le_rfl)
theorem Filtration.adapted_natural [MetrizableSpace β] [mβ : MeasurableSpace β] [BorelSpace β]
    {u : ι → Ω → β} (hum : ∀ i, StronglyMeasurable[m] (u i)) :
    Adapted (Filtration.natural u hum) u := by
  intro i
  refine' StronglyMeasurable.mono _ (le_iSup₂_of_le i (le_refl i) le_rfl)
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝³ : TopologicalSpace β
inst✝² : Preorder ι
u✝ v : ι → Ω → β
f : Filtration ι m
inst✝¹ : MetrizableSpace β
mβ : MeasurableSpace β
inst✝ : BorelSpace β
u : ι → Ω → β
hum : ∀ (i : ι), StronglyMeasurable (u i)
i : ι
⊢ StronglyMeasurable (u i)

Next tactic:
rw [stronglyMeasurable_iff_measurable_separable]
theorem Filtration.adapted_natural [MetrizableSpace β] [mβ : MeasurableSpace β] [BorelSpace β]
    {u : ι → Ω → β} (hum : ∀ i, StronglyMeasurable[m] (u i)) :
    Adapted (Filtration.natural u hum) u := by
  intro i
  refine' StronglyMeasurable.mono _ (le_iSup₂_of_le i (le_refl i) le_rfl)
  rw [stronglyMeasurable_iff_measurable_separable]
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝³ : TopologicalSpace β
inst✝² : Preorder ι
u✝ v : ι → Ω → β
f : Filtration ι m
inst✝¹ : MetrizableSpace β
mβ : MeasurableSpace β
inst✝ : BorelSpace β
u : ι → Ω → β
hum : ∀ (i : ι), StronglyMeasurable (u i)
i : ι
⊢ Measurable (u i) ∧ IsSeparable (Set.range (u i))

Next tactic:
exact ⟨measurable_iff_comap_le.2 le_rfl, (hum i).isSeparable_range⟩
protected theorem adapted (h : ProgMeasurable f u) : Adapted f u := by
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝² : TopologicalSpace β
inst✝¹ : Preorder ι
u v : ι → Ω → β
f : Filtration ι m
inst✝ : MeasurableSpace ι
h : ProgMeasurable f u
⊢ Adapted f u

Next tactic:
intro i
protected theorem adapted (h : ProgMeasurable f u) : Adapted f u := by
  intro i
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝² : TopologicalSpace β
inst✝¹ : Preorder ι
u v : ι → Ω → β
f : Filtration ι m
inst✝ : MeasurableSpace ι
h : ProgMeasurable f u
i : ι
⊢ StronglyMeasurable (u i)

Next tactic:
have : u i = (fun p : Set.Iic i × Ω => u p.1 p.2) ∘ fun x => (⟨i, Set.mem_Iic.mpr le_rfl⟩, x) :=
    rfl
protected theorem adapted (h : ProgMeasurable f u) : Adapted f u := by
  intro i
  have : u i = (fun p : Set.Iic i × Ω => u p.1 p.2) ∘ fun x => (⟨i, Set.mem_Iic.mpr le_rfl⟩, x) :=
    rfl
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝² : TopologicalSpace β
inst✝¹ : Preorder ι
u v : ι → Ω → β
f : Filtration ι m
inst✝ : MeasurableSpace ι
h : ProgMeasurable f u
i : ι
this : u i = (fun p => u (↑p.1) p.2) ∘ fun x => ({ val := i, property := (_ : i ∈ Set.Iic i) }, x)
⊢ StronglyMeasurable (u i)

Next tactic:
rw [this]
protected theorem adapted (h : ProgMeasurable f u) : Adapted f u := by
  intro i
  have : u i = (fun p : Set.Iic i × Ω => u p.1 p.2) ∘ fun x => (⟨i, Set.mem_Iic.mpr le_rfl⟩, x) :=
    rfl
  rw [this]
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝² : TopologicalSpace β
inst✝¹ : Preorder ι
u v : ι → Ω → β
f : Filtration ι m
inst✝ : MeasurableSpace ι
h : ProgMeasurable f u
i : ι
this : u i = (fun p => u (↑p.1) p.2) ∘ fun x => ({ val := i, property := (_ : i ∈ Set.Iic i) }, x)
⊢ StronglyMeasurable ((fun p => u (↑p.1) p.2) ∘ fun x => ({ val := i, property := (_ : i ∈ Set.Iic i) }, x))

Next tactic:
exact (h i).comp_measurable measurable_prod_mk_left
protected theorem comp {t : ι → Ω → ι} [TopologicalSpace ι] [BorelSpace ι] [MetrizableSpace ι]
    (h : ProgMeasurable f u) (ht : ProgMeasurable f t) (ht_le : ∀ i ω, t i ω ≤ i) :
    ProgMeasurable f fun i ω => u (t i ω) ω := by
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝⁵ : TopologicalSpace β
inst✝⁴ : Preorder ι
u v : ι → Ω → β
f : Filtration ι m
inst✝³ : MeasurableSpace ι
t : ι → Ω → ι
inst✝² : TopologicalSpace ι
inst✝¹ : BorelSpace ι
inst✝ : MetrizableSpace ι
h : ProgMeasurable f u
ht : ProgMeasurable f t
ht_le : ∀ (i : ι) (ω : Ω), t i ω ≤ i
⊢ ProgMeasurable f fun i ω => u (t i ω) ω

Next tactic:
intro i
protected theorem comp {t : ι → Ω → ι} [TopologicalSpace ι] [BorelSpace ι] [MetrizableSpace ι]
    (h : ProgMeasurable f u) (ht : ProgMeasurable f t) (ht_le : ∀ i ω, t i ω ≤ i) :
    ProgMeasurable f fun i ω => u (t i ω) ω := by
  intro i
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝⁵ : TopologicalSpace β
inst✝⁴ : Preorder ι
u v : ι → Ω → β
f : Filtration ι m
inst✝³ : MeasurableSpace ι
t : ι → Ω → ι
inst✝² : TopologicalSpace ι
inst✝¹ : BorelSpace ι
inst✝ : MetrizableSpace ι
h : ProgMeasurable f u
ht : ProgMeasurable f t
ht_le : ∀ (i : ι) (ω : Ω), t i ω ≤ i
i : ι
⊢ StronglyMeasurable fun p => (fun i ω => u (t i ω) ω) (↑p.1) p.2

Next tactic:
have : (fun p : ↥(Set.Iic i) × Ω => u (t (p.fst : ι) p.snd) p.snd) =
    (fun p : ↥(Set.Iic i) × Ω => u (p.fst : ι) p.snd) ∘ fun p : ↥(Set.Iic i) × Ω =>
      (⟨t (p.fst : ι) p.snd, Set.mem_Iic.mpr ((ht_le _ _).trans p.fst.prop)⟩, p.snd) := rfl
protected theorem comp {t : ι → Ω → ι} [TopologicalSpace ι] [BorelSpace ι] [MetrizableSpace ι]
    (h : ProgMeasurable f u) (ht : ProgMeasurable f t) (ht_le : ∀ i ω, t i ω ≤ i) :
    ProgMeasurable f fun i ω => u (t i ω) ω := by
  intro i
  have : (fun p : ↥(Set.Iic i) × Ω => u (t (p.fst : ι) p.snd) p.snd) =
    (fun p : ↥(Set.Iic i) × Ω => u (p.fst : ι) p.snd) ∘ fun p : ↥(Set.Iic i) × Ω =>
      (⟨t (p.fst : ι) p.snd, Set.mem_Iic.mpr ((ht_le _ _).trans p.fst.prop)⟩, p.snd) := rfl
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝⁵ : TopologicalSpace β
inst✝⁴ : Preorder ι
u v : ι → Ω → β
f : Filtration ι m
inst✝³ : MeasurableSpace ι
t : ι → Ω → ι
inst✝² : TopologicalSpace ι
inst✝¹ : BorelSpace ι
inst✝ : MetrizableSpace ι
h : ProgMeasurable f u
ht : ProgMeasurable f t
ht_le : ∀ (i : ι) (ω : Ω), t i ω ≤ i
i : ι
this :
  (fun p => u (t (↑p.1) p.2) p.2) =
    (fun p => u (↑p.1) p.2) ∘ fun p => ({ val := t (↑p.1) p.2, property := (_ : t (↑p.1) p.2 ∈ Set.Iic i) }, p.2)
⊢ StronglyMeasurable fun p => (fun i ω => u (t i ω) ω) (↑p.1) p.2

Next tactic:
rw [this]
protected theorem comp {t : ι → Ω → ι} [TopologicalSpace ι] [BorelSpace ι] [MetrizableSpace ι]
    (h : ProgMeasurable f u) (ht : ProgMeasurable f t) (ht_le : ∀ i ω, t i ω ≤ i) :
    ProgMeasurable f fun i ω => u (t i ω) ω := by
  intro i
  have : (fun p : ↥(Set.Iic i) × Ω => u (t (p.fst : ι) p.snd) p.snd) =
    (fun p : ↥(Set.Iic i) × Ω => u (p.fst : ι) p.snd) ∘ fun p : ↥(Set.Iic i) × Ω =>
      (⟨t (p.fst : ι) p.snd, Set.mem_Iic.mpr ((ht_le _ _).trans p.fst.prop)⟩, p.snd) := rfl
  rw [this]
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝⁵ : TopologicalSpace β
inst✝⁴ : Preorder ι
u v : ι → Ω → β
f : Filtration ι m
inst✝³ : MeasurableSpace ι
t : ι → Ω → ι
inst✝² : TopologicalSpace ι
inst✝¹ : BorelSpace ι
inst✝ : MetrizableSpace ι
h : ProgMeasurable f u
ht : ProgMeasurable f t
ht_le : ∀ (i : ι) (ω : Ω), t i ω ≤ i
i : ι
this :
  (fun p => u (t (↑p.1) p.2) p.2) =
    (fun p => u (↑p.1) p.2) ∘ fun p => ({ val := t (↑p.1) p.2, property := (_ : t (↑p.1) p.2 ∈ Set.Iic i) }, p.2)
⊢ StronglyMeasurable
    ((fun p => u (↑p.1) p.2) ∘ fun p => ({ val := t (↑p.1) p.2, property := (_ : t (↑p.1) p.2 ∈ Set.Iic i) }, p.2))

Next tactic:
exact (h i).comp_measurable ((ht i).measurable.subtype_mk.prod_mk measurable_snd)
@[to_additive]
protected theorem finset_prod {γ} [CommMonoid β] [ContinuousMul β] {U : γ → ι → Ω → β}
    {s : Finset γ} (h : ∀ c ∈ s, ProgMeasurable f (U c)) :
    ProgMeasurable f fun i a => ∏ c in s, U c i a := by
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝⁴ : TopologicalSpace β
inst✝³ : Preorder ι
u v : ι → Ω → β
f : Filtration ι m
inst✝² : MeasurableSpace ι
γ : Type u_4
inst✝¹ : CommMonoid β
inst✝ : ContinuousMul β
U : γ → ι → Ω → β
s : Finset γ
h : ∀ c ∈ s, ProgMeasurable f (U c)
⊢ ProgMeasurable f fun i a => ∏ c in s, U c i a

Next tactic:
convert ProgMeasurable.finset_prod' h using 1
@[to_additive]
protected theorem finset_prod {γ} [CommMonoid β] [ContinuousMul β] {U : γ → ι → Ω → β}
    {s : Finset γ} (h : ∀ c ∈ s, ProgMeasurable f (U c)) :
    ProgMeasurable f fun i a => ∏ c in s, U c i a := by
  convert ProgMeasurable.finset_prod' h using 1; 

Proof state:
case h.e'_9
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝⁴ : TopologicalSpace β
inst✝³ : Preorder ι
u v : ι → Ω → β
f : Filtration ι m
inst✝² : MeasurableSpace ι
γ : Type u_4
inst✝¹ : CommMonoid β
inst✝ : ContinuousMul β
U : γ → ι → Ω → β
s : Finset γ
h : ∀ c ∈ s, ProgMeasurable f (U c)
⊢ (fun i a => ∏ c in s, U c i a) = ∏ c in s, U c

Next tactic:
ext (i a)
@[to_additive]
protected theorem finset_prod {γ} [CommMonoid β] [ContinuousMul β] {U : γ → ι → Ω → β}
    {s : Finset γ} (h : ∀ c ∈ s, ProgMeasurable f (U c)) :
    ProgMeasurable f fun i a => ∏ c in s, U c i a := by
  convert ProgMeasurable.finset_prod' h using 1; ext (i a); 

Proof state:
case h.e'_9.h.h
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝⁴ : TopologicalSpace β
inst✝³ : Preorder ι
u v : ι → Ω → β
f : Filtration ι m
inst✝² : MeasurableSpace ι
γ : Type u_4
inst✝¹ : CommMonoid β
inst✝ : ContinuousMul β
U : γ → ι → Ω → β
s : Finset γ
h : ∀ c ∈ s, ProgMeasurable f (U c)
i : ι
a : Ω
⊢ ∏ c in s, U c i a = Finset.prod s (fun c => U c) i a

Next tactic:
simp only [Finset.prod_apply]
theorem progMeasurable_of_tendsto' {γ} [MeasurableSpace ι] [PseudoMetrizableSpace β]
    (fltr : Filter γ) [fltr.NeBot] [fltr.IsCountablyGenerated] {U : γ → ι → Ω → β}
    (h : ∀ l, ProgMeasurable f (U l)) (h_tendsto : Tendsto U fltr (𝓝 u)) : ProgMeasurable f u := by
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝⁵ : TopologicalSpace β
inst✝⁴ : Preorder ι
u v : ι → Ω → β
f : Filtration ι m
γ : Type u_4
inst✝³ : MeasurableSpace ι
inst✝² : PseudoMetrizableSpace β
fltr : Filter γ
inst✝¹ : NeBot fltr
inst✝ : IsCountablyGenerated fltr
U : γ → ι → Ω → β
h : ∀ (l : γ), ProgMeasurable f (U l)
h_tendsto : Tendsto U fltr (𝓝 u)
⊢ ProgMeasurable f u

Next tactic:
intro i
theorem progMeasurable_of_tendsto' {γ} [MeasurableSpace ι] [PseudoMetrizableSpace β]
    (fltr : Filter γ) [fltr.NeBot] [fltr.IsCountablyGenerated] {U : γ → ι → Ω → β}
    (h : ∀ l, ProgMeasurable f (U l)) (h_tendsto : Tendsto U fltr (𝓝 u)) : ProgMeasurable f u := by
  intro i
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝⁵ : TopologicalSpace β
inst✝⁴ : Preorder ι
u v : ι → Ω → β
f : Filtration ι m
γ : Type u_4
inst✝³ : MeasurableSpace ι
inst✝² : PseudoMetrizableSpace β
fltr : Filter γ
inst✝¹ : NeBot fltr
inst✝ : IsCountablyGenerated fltr
U : γ → ι → Ω → β
h : ∀ (l : γ), ProgMeasurable f (U l)
h_tendsto : Tendsto U fltr (𝓝 u)
i : ι
⊢ StronglyMeasurable fun p => u (↑p.1) p.2

Next tactic:
apply @stronglyMeasurable_of_tendsto (Set.Iic i × Ω) β γ
    (MeasurableSpace.prod _ (f i)) _ _ fltr _ _ _ _ fun l => h l i
theorem progMeasurable_of_tendsto' {γ} [MeasurableSpace ι] [PseudoMetrizableSpace β]
    (fltr : Filter γ) [fltr.NeBot] [fltr.IsCountablyGenerated] {U : γ → ι → Ω → β}
    (h : ∀ l, ProgMeasurable f (U l)) (h_tendsto : Tendsto U fltr (𝓝 u)) : ProgMeasurable f u := by
  intro i
  apply @stronglyMeasurable_of_tendsto (Set.Iic i × Ω) β γ
    (MeasurableSpace.prod _ (f i)) _ _ fltr _ _ _ _ fun l => h l i
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝⁵ : TopologicalSpace β
inst✝⁴ : Preorder ι
u v : ι → Ω → β
f : Filtration ι m
γ : Type u_4
inst✝³ : MeasurableSpace ι
inst✝² : PseudoMetrizableSpace β
fltr : Filter γ
inst✝¹ : NeBot fltr
inst✝ : IsCountablyGenerated fltr
U : γ → ι → Ω → β
h : ∀ (l : γ), ProgMeasurable f (U l)
h_tendsto : Tendsto U fltr (𝓝 u)
i : ι
⊢ Tendsto (fun l p => U l (↑p.1) p.2) fltr (𝓝 fun p => u (↑p.1) p.2)

Next tactic:
rw [tendsto_pi_nhds] at h_tendsto ⊢
theorem progMeasurable_of_tendsto' {γ} [MeasurableSpace ι] [PseudoMetrizableSpace β]
    (fltr : Filter γ) [fltr.NeBot] [fltr.IsCountablyGenerated] {U : γ → ι → Ω → β}
    (h : ∀ l, ProgMeasurable f (U l)) (h_tendsto : Tendsto U fltr (𝓝 u)) : ProgMeasurable f u := by
  intro i
  apply @stronglyMeasurable_of_tendsto (Set.Iic i × Ω) β γ
    (MeasurableSpace.prod _ (f i)) _ _ fltr _ _ _ _ fun l => h l i
  rw [tendsto_pi_nhds] at h_tendsto ⊢
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝⁵ : TopologicalSpace β
inst✝⁴ : Preorder ι
u v : ι → Ω → β
f : Filtration ι m
γ : Type u_4
inst✝³ : MeasurableSpace ι
inst✝² : PseudoMetrizableSpace β
fltr : Filter γ
inst✝¹ : NeBot fltr
inst✝ : IsCountablyGenerated fltr
U : γ → ι → Ω → β
h : ∀ (l : γ), ProgMeasurable f (U l)
h_tendsto : ∀ (x : ι), Tendsto (fun i => U i x) fltr (𝓝 (u x))
i : ι
⊢ ∀ (x : ↑(Set.Iic i) × Ω), Tendsto (fun i_1 => U i_1 (↑x.1) x.2) fltr (𝓝 (u (↑x.1) x.2))

Next tactic:
intro x
theorem progMeasurable_of_tendsto' {γ} [MeasurableSpace ι] [PseudoMetrizableSpace β]
    (fltr : Filter γ) [fltr.NeBot] [fltr.IsCountablyGenerated] {U : γ → ι → Ω → β}
    (h : ∀ l, ProgMeasurable f (U l)) (h_tendsto : Tendsto U fltr (𝓝 u)) : ProgMeasurable f u := by
  intro i
  apply @stronglyMeasurable_of_tendsto (Set.Iic i × Ω) β γ
    (MeasurableSpace.prod _ (f i)) _ _ fltr _ _ _ _ fun l => h l i
  rw [tendsto_pi_nhds] at h_tendsto ⊢
  intro x
  

Proof state:
Ω : Type u_1
β : Type u_2
ι : Type u_3
m : MeasurableSpace Ω
inst✝⁵ : TopologicalSpace β
inst✝⁴ : Preorder ι
u v : ι → Ω → β
f : Filtration ι m
γ : Type u_4
inst✝³ : MeasurableSpace ι
inst✝² : PseudoMetrizableSpace β
fltr : Filter γ
inst✝¹ : NeBot fltr
inst✝ : IsCountablyGenerated fltr
U : γ → ι → Ω → β
h : ∀ (l : γ), ProgMeasurable f (U l)
h_tendsto : ∀ (x : ι), Tendsto (fun i => U i x) fltr (𝓝 (u x))
i : ι
x : ↑(Set.Iic i) × Ω
⊢ Tendsto (fun i_1 => U i_1 (↑x.1) x.2) fltr (𝓝 (u (↑x.1) x.2))

Next tactic:
specialize h_tendsto x.fst