l3lab/ntp-mathlib huggingface dataset:
/-- The function `a ↦ (condCdf ρ a).measure` is measurable. -/
theorem measurable_measure_condCdf (ρ : Measure (α × ℝ)) :
    Measurable fun a => (condCdf ρ a).measure := by
  rw [Measure.measurable_measure]
  refine' fun s hs => ?_
  -- Porting note: supplied `C`
  refine' MeasurableSpace.induction_on_inter
    (C := fun s => Measurable fun b ↦ StieltjesFunction.measure (condCdf ρ b) s)
    (borel_eq_generateFrom_Iic ℝ) isPiSystem_Iic _ _ _ _ hs
  · simp only [measure_empty, measurable_const]
  · rintro S ⟨u, rfl⟩
    simp_rw [measure_condCdf_Iic ρ _ u]
    exact (measurable_condCdf ρ u).ennreal_ofReal
  · 

Proof state:
case refine'_3
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
s : Set ℝ
hs : MeasurableSet s
⊢ ∀ (t : Set ℝ),
    MeasurableSet t →
      (fun s => Measurable fun b => ↑↑(StieltjesFunction.measure (condCdf ρ b)) s) t →
        (fun s => Measurable fun b => ↑↑(StieltjesFunction.measure (condCdf ρ b)) s) tᶜ

Next tactic:
intro t ht ht_cd_meas
/-- The function `a ↦ (condCdf ρ a).measure` is measurable. -/
theorem measurable_measure_condCdf (ρ : Measure (α × ℝ)) :
    Measurable fun a => (condCdf ρ a).measure := by
  rw [Measure.measurable_measure]
  refine' fun s hs => ?_
  -- Porting note: supplied `C`
  refine' MeasurableSpace.induction_on_inter
    (C := fun s => Measurable fun b ↦ StieltjesFunction.measure (condCdf ρ b) s)
    (borel_eq_generateFrom_Iic ℝ) isPiSystem_Iic _ _ _ _ hs
  · simp only [measure_empty, measurable_const]
  · rintro S ⟨u, rfl⟩
    simp_rw [measure_condCdf_Iic ρ _ u]
    exact (measurable_condCdf ρ u).ennreal_ofReal
  · intro t ht ht_cd_meas
    

Proof state:
case refine'_3
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
s : Set ℝ
hs : MeasurableSet s
t : Set ℝ
ht : MeasurableSet t
ht_cd_meas : Measurable fun b => ↑↑(StieltjesFunction.measure (condCdf ρ b)) t
⊢ Measurable fun b => ↑↑(StieltjesFunction.measure (condCdf ρ b)) tᶜ

Next tactic:
have :
      (fun a => (condCdf ρ a).measure tᶜ) =
        (fun a => (condCdf ρ a).measure univ) - fun a => (condCdf ρ a).measure t := by
      ext1 a
      rw [measure_compl ht (measure_ne_top (condCdf ρ a).measure _), Pi.sub_apply]
/-- The function `a ↦ (condCdf ρ a).measure` is measurable. -/
theorem measurable_measure_condCdf (ρ : Measure (α × ℝ)) :
    Measurable fun a => (condCdf ρ a).measure := by
  rw [Measure.measurable_measure]
  refine' fun s hs => ?_
  -- Porting note: supplied `C`
  refine' MeasurableSpace.induction_on_inter
    (C := fun s => Measurable fun b ↦ StieltjesFunction.measure (condCdf ρ b) s)
    (borel_eq_generateFrom_Iic ℝ) isPiSystem_Iic _ _ _ _ hs
  · simp only [measure_empty, measurable_const]
  · rintro S ⟨u, rfl⟩
    simp_rw [measure_condCdf_Iic ρ _ u]
    exact (measurable_condCdf ρ u).ennreal_ofReal
  · intro t ht ht_cd_meas
    have :
      (fun a => (condCdf ρ a).measure tᶜ) =
        (fun a => (condCdf ρ a).measure univ) - fun a => (condCdf ρ a).measure t := by
      

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
s : Set ℝ
hs : MeasurableSet s
t : Set ℝ
ht : MeasurableSet t
ht_cd_meas : Measurable fun b => ↑↑(StieltjesFunction.measure (condCdf ρ b)) t
⊢ (fun a => ↑↑(StieltjesFunction.measure (condCdf ρ a)) tᶜ) =
    (fun a => ↑↑(StieltjesFunction.measure (condCdf ρ a)) univ) - fun a => ↑↑(StieltjesFunction.measure (condCdf ρ a)) t

Next tactic:
ext1 a
/-- The function `a ↦ (condCdf ρ a).measure` is measurable. -/
theorem measurable_measure_condCdf (ρ : Measure (α × ℝ)) :
    Measurable fun a => (condCdf ρ a).measure := by
  rw [Measure.measurable_measure]
  refine' fun s hs => ?_
  -- Porting note: supplied `C`
  refine' MeasurableSpace.induction_on_inter
    (C := fun s => Measurable fun b ↦ StieltjesFunction.measure (condCdf ρ b) s)
    (borel_eq_generateFrom_Iic ℝ) isPiSystem_Iic _ _ _ _ hs
  · simp only [measure_empty, measurable_const]
  · rintro S ⟨u, rfl⟩
    simp_rw [measure_condCdf_Iic ρ _ u]
    exact (measurable_condCdf ρ u).ennreal_ofReal
  · intro t ht ht_cd_meas
    have :
      (fun a => (condCdf ρ a).measure tᶜ) =
        (fun a => (condCdf ρ a).measure univ) - fun a => (condCdf ρ a).measure t := by
      ext1 a
      

Proof state:
case h
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
s : Set ℝ
hs : MeasurableSet s
t : Set ℝ
ht : MeasurableSet t
ht_cd_meas : Measurable fun b => ↑↑(StieltjesFunction.measure (condCdf ρ b)) t
a : α
⊢ ↑↑(StieltjesFunction.measure (condCdf ρ a)) tᶜ =
    ((fun a => ↑↑(StieltjesFunction.measure (condCdf ρ a)) univ) - fun a =>
        ↑↑(StieltjesFunction.measure (condCdf ρ a)) t)
      a

Next tactic:
rw [measure_compl ht (measure_ne_top (condCdf ρ a).measure _), Pi.sub_apply]
/-- The function `a ↦ (condCdf ρ a).measure` is measurable. -/
theorem measurable_measure_condCdf (ρ : Measure (α × ℝ)) :
    Measurable fun a => (condCdf ρ a).measure := by
  rw [Measure.measurable_measure]
  refine' fun s hs => ?_
  -- Porting note: supplied `C`
  refine' MeasurableSpace.induction_on_inter
    (C := fun s => Measurable fun b ↦ StieltjesFunction.measure (condCdf ρ b) s)
    (borel_eq_generateFrom_Iic ℝ) isPiSystem_Iic _ _ _ _ hs
  · simp only [measure_empty, measurable_const]
  · rintro S ⟨u, rfl⟩
    simp_rw [measure_condCdf_Iic ρ _ u]
    exact (measurable_condCdf ρ u).ennreal_ofReal
  · intro t ht ht_cd_meas
    have :
      (fun a => (condCdf ρ a).measure tᶜ) =
        (fun a => (condCdf ρ a).measure univ) - fun a => (condCdf ρ a).measure t := by
      ext1 a
      rw [measure_compl ht (measure_ne_top (condCdf ρ a).measure _), Pi.sub_apply]
    

Proof state:
case refine'_3
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
s : Set ℝ
hs : MeasurableSet s
t : Set ℝ
ht : MeasurableSet t
ht_cd_meas : Measurable fun b => ↑↑(StieltjesFunction.measure (condCdf ρ b)) t
this :
  (fun a => ↑↑(StieltjesFunction.measure (condCdf ρ a)) tᶜ) =
    (fun a => ↑↑(StieltjesFunction.measure (condCdf ρ a)) univ) - fun a => ↑↑(StieltjesFunction.measure (condCdf ρ a)) t
⊢ Measurable fun b => ↑↑(StieltjesFunction.measure (condCdf ρ b)) tᶜ

Next tactic:
simp_rw [this, measure_condCdf_univ ρ]
/-- The function `a ↦ (condCdf ρ a).measure` is measurable. -/
theorem measurable_measure_condCdf (ρ : Measure (α × ℝ)) :
    Measurable fun a => (condCdf ρ a).measure := by
  rw [Measure.measurable_measure]
  refine' fun s hs => ?_
  -- Porting note: supplied `C`
  refine' MeasurableSpace.induction_on_inter
    (C := fun s => Measurable fun b ↦ StieltjesFunction.measure (condCdf ρ b) s)
    (borel_eq_generateFrom_Iic ℝ) isPiSystem_Iic _ _ _ _ hs
  · simp only [measure_empty, measurable_const]
  · rintro S ⟨u, rfl⟩
    simp_rw [measure_condCdf_Iic ρ _ u]
    exact (measurable_condCdf ρ u).ennreal_ofReal
  · intro t ht ht_cd_meas
    have :
      (fun a => (condCdf ρ a).measure tᶜ) =
        (fun a => (condCdf ρ a).measure univ) - fun a => (condCdf ρ a).measure t := by
      ext1 a
      rw [measure_compl ht (measure_ne_top (condCdf ρ a).measure _), Pi.sub_apply]
    simp_rw [this, measure_condCdf_univ ρ]
    

Proof state:
case refine'_3
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
s : Set ℝ
hs : MeasurableSet s
t : Set ℝ
ht : MeasurableSet t
ht_cd_meas : Measurable fun b => ↑↑(StieltjesFunction.measure (condCdf ρ b)) t
this :
  (fun a => ↑↑(StieltjesFunction.measure (condCdf ρ a)) tᶜ) =
    (fun a => ↑↑(StieltjesFunction.measure (condCdf ρ a)) univ) - fun a => ↑↑(StieltjesFunction.measure (condCdf ρ a)) t
⊢ Measurable ((fun a => 1) - fun a => ↑↑(StieltjesFunction.measure (condCdf ρ a)) t)

Next tactic:
exact Measurable.sub measurable_const ht_cd_meas
/-- The function `a ↦ (condCdf ρ a).measure` is measurable. -/
theorem measurable_measure_condCdf (ρ : Measure (α × ℝ)) :
    Measurable fun a => (condCdf ρ a).measure := by
  rw [Measure.measurable_measure]
  refine' fun s hs => ?_
  -- Porting note: supplied `C`
  refine' MeasurableSpace.induction_on_inter
    (C := fun s => Measurable fun b ↦ StieltjesFunction.measure (condCdf ρ b) s)
    (borel_eq_generateFrom_Iic ℝ) isPiSystem_Iic _ _ _ _ hs
  · simp only [measure_empty, measurable_const]
  · rintro S ⟨u, rfl⟩
    simp_rw [measure_condCdf_Iic ρ _ u]
    exact (measurable_condCdf ρ u).ennreal_ofReal
  · intro t ht ht_cd_meas
    have :
      (fun a => (condCdf ρ a).measure tᶜ) =
        (fun a => (condCdf ρ a).measure univ) - fun a => (condCdf ρ a).measure t := by
      ext1 a
      rw [measure_compl ht (measure_ne_top (condCdf ρ a).measure _), Pi.sub_apply]
    simp_rw [this, measure_condCdf_univ ρ]
    exact Measurable.sub measurable_const ht_cd_meas
  · 

Proof state:
case refine'_4
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
s : Set ℝ
hs : MeasurableSet s
⊢ ∀ (f : ℕ → Set ℝ),
    Pairwise (Disjoint on f) →
      (∀ (i : ℕ), MeasurableSet (f i)) →
        (∀ (i : ℕ), (fun s => Measurable fun b => ↑↑(StieltjesFunction.measure (condCdf ρ b)) s) (f i)) →
          (fun s => Measurable fun b => ↑↑(StieltjesFunction.measure (condCdf ρ b)) s) (⋃ i, f i)

Next tactic:
intro f hf_disj hf_meas hf_cd_meas
/-- The function `a ↦ (condCdf ρ a).measure` is measurable. -/
theorem measurable_measure_condCdf (ρ : Measure (α × ℝ)) :
    Measurable fun a => (condCdf ρ a).measure := by
  rw [Measure.measurable_measure]
  refine' fun s hs => ?_
  -- Porting note: supplied `C`
  refine' MeasurableSpace.induction_on_inter
    (C := fun s => Measurable fun b ↦ StieltjesFunction.measure (condCdf ρ b) s)
    (borel_eq_generateFrom_Iic ℝ) isPiSystem_Iic _ _ _ _ hs
  · simp only [measure_empty, measurable_const]
  · rintro S ⟨u, rfl⟩
    simp_rw [measure_condCdf_Iic ρ _ u]
    exact (measurable_condCdf ρ u).ennreal_ofReal
  · intro t ht ht_cd_meas
    have :
      (fun a => (condCdf ρ a).measure tᶜ) =
        (fun a => (condCdf ρ a).measure univ) - fun a => (condCdf ρ a).measure t := by
      ext1 a
      rw [measure_compl ht (measure_ne_top (condCdf ρ a).measure _), Pi.sub_apply]
    simp_rw [this, measure_condCdf_univ ρ]
    exact Measurable.sub measurable_const ht_cd_meas
  · intro f hf_disj hf_meas hf_cd_meas
    

Proof state:
case refine'_4
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
s : Set ℝ
hs : MeasurableSet s
f : ℕ → Set ℝ
hf_disj : Pairwise (Disjoint on f)
hf_meas : ∀ (i : ℕ), MeasurableSet (f i)
hf_cd_meas : ∀ (i : ℕ), (fun s => Measurable fun b => ↑↑(StieltjesFunction.measure (condCdf ρ b)) s) (f i)
⊢ Measurable fun b => ↑↑(StieltjesFunction.measure (condCdf ρ b)) (⋃ i, f i)

Next tactic:
simp_rw [measure_iUnion hf_disj hf_meas]
/-- The function `a ↦ (condCdf ρ a).measure` is measurable. -/
theorem measurable_measure_condCdf (ρ : Measure (α × ℝ)) :
    Measurable fun a => (condCdf ρ a).measure := by
  rw [Measure.measurable_measure]
  refine' fun s hs => ?_
  -- Porting note: supplied `C`
  refine' MeasurableSpace.induction_on_inter
    (C := fun s => Measurable fun b ↦ StieltjesFunction.measure (condCdf ρ b) s)
    (borel_eq_generateFrom_Iic ℝ) isPiSystem_Iic _ _ _ _ hs
  · simp only [measure_empty, measurable_const]
  · rintro S ⟨u, rfl⟩
    simp_rw [measure_condCdf_Iic ρ _ u]
    exact (measurable_condCdf ρ u).ennreal_ofReal
  · intro t ht ht_cd_meas
    have :
      (fun a => (condCdf ρ a).measure tᶜ) =
        (fun a => (condCdf ρ a).measure univ) - fun a => (condCdf ρ a).measure t := by
      ext1 a
      rw [measure_compl ht (measure_ne_top (condCdf ρ a).measure _), Pi.sub_apply]
    simp_rw [this, measure_condCdf_univ ρ]
    exact Measurable.sub measurable_const ht_cd_meas
  · intro f hf_disj hf_meas hf_cd_meas
    simp_rw [measure_iUnion hf_disj hf_meas]
    

Proof state:
case refine'_4
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
ρ : Measure (α × ℝ)
s : Set ℝ
hs : MeasurableSet s
f : ℕ → Set ℝ
hf_disj : Pairwise (Disjoint on f)
hf_meas : ∀ (i : ℕ), MeasurableSet (f i)
hf_cd_meas : ∀ (i : ℕ), (fun s => Measurable fun b => ↑↑(StieltjesFunction.measure (condCdf ρ b)) s) (f i)
⊢ Measurable fun b => ∑' (i : ℕ), ↑↑(StieltjesFunction.measure (condCdf ρ b)) (f i)

Next tactic:
exact Measurable.ennreal_tsum hf_cd_meas
theorem interval_average_symm (f : ℝ → E) (a b : ℝ) : (⨍ x in a..b, f x) = ⨍ x in b..a, f x := by
  

Proof state:
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
f : ℝ → E
a b : ℝ
⊢ ⨍ (x : ℝ) in a..b, f x = ⨍ (x : ℝ) in b..a, f x

Next tactic:
rw [setAverage_eq, setAverage_eq, uIoc_comm]
theorem interval_average_eq (f : ℝ → E) (a b : ℝ) :
    (⨍ x in a..b, f x) = (b - a)⁻¹ • ∫ x in a..b, f x := by
  

Proof state:
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
f : ℝ → E
a b : ℝ
⊢ ⨍ (x : ℝ) in a..b, f x = (b - a)⁻¹ • ∫ (x : ℝ) in a..b, f x

Next tactic:
rcases le_or_lt a b with h | h
theorem interval_average_eq (f : ℝ → E) (a b : ℝ) :
    (⨍ x in a..b, f x) = (b - a)⁻¹ • ∫ x in a..b, f x := by
  rcases le_or_lt a b with h | h
  · 

Proof state:
case inl
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
f : ℝ → E
a b : ℝ
h : a ≤ b
⊢ ⨍ (x : ℝ) in a..b, f x = (b - a)⁻¹ • ∫ (x : ℝ) in a..b, f x

Next tactic:
rw [setAverage_eq, uIoc_of_le h, Real.volume_Ioc, intervalIntegral.integral_of_le h,
      ENNReal.toReal_ofReal (sub_nonneg.2 h)]
theorem interval_average_eq (f : ℝ → E) (a b : ℝ) :
    (⨍ x in a..b, f x) = (b - a)⁻¹ • ∫ x in a..b, f x := by
  rcases le_or_lt a b with h | h
  · rw [setAverage_eq, uIoc_of_le h, Real.volume_Ioc, intervalIntegral.integral_of_le h,
      ENNReal.toReal_ofReal (sub_nonneg.2 h)]
  · 

Proof state:
case inr
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
f : ℝ → E
a b : ℝ
h : b < a
⊢ ⨍ (x : ℝ) in a..b, f x = (b - a)⁻¹ • ∫ (x : ℝ) in a..b, f x

Next tactic:
rw [setAverage_eq, uIoc_of_lt h, Real.volume_Ioc, intervalIntegral.integral_of_ge h.le,
      ENNReal.toReal_ofReal (sub_nonneg.2 h.le), smul_neg, ← neg_smul, ← inv_neg, neg_sub]
theorem interval_average_eq_div (f : ℝ → ℝ) (a b : ℝ) :
    (⨍ x in a..b, f x) = (∫ x in a..b, f x) / (b - a) := by
  

Proof state:
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
f : ℝ → ℝ
a b : ℝ
⊢ ⨍ (x : ℝ) in a..b, f x = (∫ (x : ℝ) in a..b, f x) / (b - a)

Next tactic:
rw [interval_average_eq, smul_eq_mul, div_eq_inv_mul]
theorem image_le_kernel (w : f ≫ g = 0) : imageSubobject f ≤ kernelSubobject g :=
  imageSubobject_le_mk _ _ (kernel.lift _ _ w) (by 

Proof state:
ι : Type u_1
V : Type u
inst✝³ : Category.{v, u} V
inst✝² : HasZeroMorphisms V
A B C : V
f : A ⟶ B
inst✝¹ : HasImage f
g : B ⟶ C
inst✝ : HasKernel g
w : f ≫ g = 0
⊢ kernel.lift g f w ≫ kernel.ι g = f

Next tactic:
simp
instance (w : f ≫ g = 0) : Mono (imageToKernel f g w) := by
  

Proof state:
ι : Type u_1
V : Type u
inst✝³ : Category.{v, u} V
inst✝² : HasZeroMorphisms V
A B C : V
f : A ⟶ B
inst✝¹ : HasImage f
g : B ⟶ C
inst✝ : HasKernel g
w : f ≫ g = 0
⊢ Mono (imageToKernel f g w)

Next tactic:
dsimp only [imageToKernel]
instance (w : f ≫ g = 0) : Mono (imageToKernel f g w) := by
  dsimp only [imageToKernel]
  

Proof state:
ι : Type u_1
V : Type u
inst✝³ : Category.{v, u} V
inst✝² : HasZeroMorphisms V
A B C : V
f : A ⟶ B
inst✝¹ : HasImage f
g : B ⟶ C
inst✝ : HasKernel g
w : f ≫ g = 0
⊢ Mono (Subobject.ofLE (imageSubobject f) (kernelSubobject g) (_ : imageSubobject f ≤ kernelSubobject g))

Next tactic:
infer_instance
@[reassoc (attr := simp)]
theorem imageToKernel_arrow (w : f ≫ g = 0) :
    imageToKernel f g w ≫ (kernelSubobject g).arrow = (imageSubobject f).arrow := by
  

Proof state:
ι : Type u_1
V : Type u
inst✝³ : Category.{v, u} V
inst✝² : HasZeroMorphisms V
A B C : V
f : A ⟶ B
inst✝¹ : HasImage f
g : B ⟶ C
inst✝ : HasKernel g
w : f ≫ g = 0
⊢ imageToKernel f g w ≫ Subobject.arrow (kernelSubobject g) = Subobject.arrow (imageSubobject f)

Next tactic:
simp [imageToKernel]
@[simp]
lemma imageToKernel_arrow_apply [ConcreteCategory V] (w : f ≫ g = 0)
    (x : (forget V).obj (Subobject.underlying.obj (imageSubobject f))) :
    (kernelSubobject g).arrow (imageToKernel f g w x) =
      (imageSubobject f).arrow x := by
  

Proof state:
ι : Type u_1
V : Type u
inst✝⁴ : Category.{v, u} V
inst✝³ : HasZeroMorphisms V
A B C : V
f : A ⟶ B
inst✝² : HasImage f
g : B ⟶ C
inst✝¹ : HasKernel g
inst✝ : ConcreteCategory V
w : f ≫ g = 0
x : (forget V).obj (Subobject.underlying.obj (imageSubobject f))
⊢ (Subobject.arrow (kernelSubobject g)) ((imageToKernel f g w) x) = (Subobject.arrow (imageSubobject f)) x

Next tactic:
rw [← comp_apply, imageToKernel_arrow]
theorem factorThruImageSubobject_comp_imageToKernel (w : f ≫ g = 0) :
    factorThruImageSubobject f ≫ imageToKernel f g w = factorThruKernelSubobject g f w := by
  

Proof state:
ι : Type u_1
V : Type u
inst✝³ : Category.{v, u} V
inst✝² : HasZeroMorphisms V
A B C : V
f : A ⟶ B
inst✝¹ : HasImage f
g : B ⟶ C
inst✝ : HasKernel g
w : f ≫ g = 0
⊢ factorThruImageSubobject f ≫ imageToKernel f g w = factorThruKernelSubobject g f w

Next tactic:
ext
theorem factorThruImageSubobject_comp_imageToKernel (w : f ≫ g = 0) :
    factorThruImageSubobject f ≫ imageToKernel f g w = factorThruKernelSubobject g f w := by
  ext
  

Proof state:
case h
ι : Type u_1
V : Type u
inst✝³ : Category.{v, u} V
inst✝² : HasZeroMorphisms V
A B C : V
f : A ⟶ B
inst✝¹ : HasImage f
g : B ⟶ C
inst✝ : HasKernel g
w : f ≫ g = 0
⊢ (factorThruImageSubobject f ≫ imageToKernel f g w) ≫ Subobject.arrow (kernelSubobject g) =
    factorThruKernelSubobject g f w ≫ Subobject.arrow (kernelSubobject g)

Next tactic:
simp
@[simp]
theorem imageToKernel_zero_left [HasKernels V] [HasZeroObject V] {w} :
    imageToKernel (0 : A ⟶ B) g w = 0 := by
  

Proof state:
ι : Type u_1
V : Type u
inst✝³ : Category.{v, u} V
inst✝² : HasZeroMorphisms V
A B C : V
f : A ⟶ B
g : B ⟶ C
inst✝¹ : HasKernels V
inst✝ : HasZeroObject V
w : 0 ≫ g = 0
⊢ imageToKernel 0 g w = 0

Next tactic:
ext
@[simp]
theorem imageToKernel_zero_left [HasKernels V] [HasZeroObject V] {w} :
    imageToKernel (0 : A ⟶ B) g w = 0 := by
  ext
  

Proof state:
case h
ι : Type u_1
V : Type u
inst✝³ : Category.{v, u} V
inst✝² : HasZeroMorphisms V
A B C : V
f : A ⟶ B
g : B ⟶ C
inst✝¹ : HasKernels V
inst✝ : HasZeroObject V
w : 0 ≫ g = 0
⊢ imageToKernel 0 g w ≫ Subobject.arrow (kernelSubobject g) = 0 ≫ Subobject.arrow (kernelSubobject g)

Next tactic:
simp
theorem imageToKernel_zero_right [HasImages V] {w} :
    imageToKernel f (0 : B ⟶ C) w =
      (imageSubobject f).arrow ≫ inv (kernelSubobject (0 : B ⟶ C)).arrow := by
  

Proof state:
ι : Type u_1
V : Type u
inst✝² : Category.{v, u} V
inst✝¹ : HasZeroMorphisms V
A B C : V
f : A ⟶ B
g : B ⟶ C
inst✝ : HasImages V
w : f ≫ 0 = 0
⊢ imageToKernel f 0 w = Subobject.arrow (imageSubobject f) ≫ inv (Subobject.arrow (kernelSubobject 0))

Next tactic:
ext
theorem imageToKernel_zero_right [HasImages V] {w} :
    imageToKernel f (0 : B ⟶ C) w =
      (imageSubobject f).arrow ≫ inv (kernelSubobject (0 : B ⟶ C)).arrow := by
  ext
  

Proof state:
case h
ι : Type u_1
V : Type u
inst✝² : Category.{v, u} V
inst✝¹ : HasZeroMorphisms V
A B C : V
f : A ⟶ B
g : B ⟶ C
inst✝ : HasImages V
w : f ≫ 0 = 0
⊢ imageToKernel f 0 w ≫ Subobject.arrow (kernelSubobject 0) =
    (Subobject.arrow (imageSubobject f) ≫ inv (Subobject.arrow (kernelSubobject 0))) ≫
      Subobject.arrow (kernelSubobject 0)

Next tactic:
simp
theorem imageToKernel_comp_right {D : V} (h : C ⟶ D) (w : f ≫ g = 0) :
    imageToKernel f (g ≫ h) (by 

Proof state:
ι : Type u_1
V : Type u
inst✝³ : Category.{v, u} V
inst✝² : HasZeroMorphisms V
A B C : V
f : A ⟶ B
g : B ⟶ C
inst✝¹ : HasKernels V
inst✝ : HasImages V
D : V
h : C ⟶ D
w : f ≫ g = 0
⊢ f ≫ g ≫ h = 0

Next tactic:
simp [reassoc_of% w]
theorem imageToKernel_comp_right {D : V} (h : C ⟶ D) (w : f ≫ g = 0) :
    imageToKernel f (g ≫ h) (by simp [reassoc_of% w]) =
      imageToKernel f g w ≫ Subobject.ofLE _ _ (kernelSubobject_comp_le g h) := by
  

Proof state:
ι : Type u_1
V : Type u
inst✝³ : Category.{v, u} V
inst✝² : HasZeroMorphisms V
A B C : V
f : A ⟶ B
g : B ⟶ C
inst✝¹ : HasKernels V
inst✝ : HasImages V
D : V
h : C ⟶ D
w : f ≫ g = 0
⊢ imageToKernel f (g ≫ h) (_ : f ≫ g ≫ h = 0) =
    imageToKernel f g w ≫
      Subobject.ofLE (kernelSubobject g) (kernelSubobject (g ≫ h)) (_ : kernelSubobject g ≤ kernelSubobject (g ≫ h))

Next tactic:
ext
theorem imageToKernel_comp_right {D : V} (h : C ⟶ D) (w : f ≫ g = 0) :
    imageToKernel f (g ≫ h) (by simp [reassoc_of% w]) =
      imageToKernel f g w ≫ Subobject.ofLE _ _ (kernelSubobject_comp_le g h) := by
  ext
  

Proof state:
case h
ι : Type u_1
V : Type u
inst✝³ : Category.{v, u} V
inst✝² : HasZeroMorphisms V
A B C : V
f : A ⟶ B
g : B ⟶ C
inst✝¹ : HasKernels V
inst✝ : HasImages V
D : V
h : C ⟶ D
w : f ≫ g = 0
⊢ imageToKernel f (g ≫ h) (_ : f ≫ g ≫ h = 0) ≫ Subobject.arrow (kernelSubobject (g ≫ h)) =
    (imageToKernel f g w ≫
        Subobject.ofLE (kernelSubobject g) (kernelSubobject (g ≫ h))
          (_ : kernelSubobject g ≤ kernelSubobject (g ≫ h))) ≫
      Subobject.arrow (kernelSubobject (g ≫ h))

Next tactic:
simp
theorem imageToKernel_comp_left {Z : V} (h : Z ⟶ A) (w : f ≫ g = 0) :
    imageToKernel (h ≫ f) g (by 

Proof state:
ι : Type u_1
V : Type u
inst✝³ : Category.{v, u} V
inst✝² : HasZeroMorphisms V
A B C : V
f : A ⟶ B
g : B ⟶ C
inst✝¹ : HasKernels V
inst✝ : HasImages V
Z : V
h : Z ⟶ A
w : f ≫ g = 0
⊢ (h ≫ f) ≫ g = 0

Next tactic:
simp [w]
theorem imageToKernel_comp_left {Z : V} (h : Z ⟶ A) (w : f ≫ g = 0) :
    imageToKernel (h ≫ f) g (by simp [w]) =
      Subobject.ofLE _ _ (imageSubobject_comp_le h f) ≫ imageToKernel f g w := by
  

Proof state:
ι : Type u_1
V : Type u
inst✝³ : Category.{v, u} V
inst✝² : HasZeroMorphisms V
A B C : V
f : A ⟶ B
g : B ⟶ C
inst✝¹ : HasKernels V
inst✝ : HasImages V
Z : V
h : Z ⟶ A
w : f ≫ g = 0
⊢ imageToKernel (h ≫ f) g (_ : (h ≫ f) ≫ g = 0) =
    Subobject.ofLE (imageSubobject (h ≫ f)) (imageSubobject f) (_ : imageSubobject (h ≫ f) ≤ imageSubobject f) ≫
      imageToKernel f g w

Next tactic:
ext
theorem imageToKernel_comp_left {Z : V} (h : Z ⟶ A) (w : f ≫ g = 0) :
    imageToKernel (h ≫ f) g (by simp [w]) =
      Subobject.ofLE _ _ (imageSubobject_comp_le h f) ≫ imageToKernel f g w := by
  ext
  

Proof state:
case h
ι : Type u_1
V : Type u
inst✝³ : Category.{v, u} V
inst✝² : HasZeroMorphisms V
A B C : V
f : A ⟶ B
g : B ⟶ C
inst✝¹ : HasKernels V
inst✝ : HasImages V
Z : V
h : Z ⟶ A
w : f ≫ g = 0
⊢ imageToKernel (h ≫ f) g (_ : (h ≫ f) ≫ g = 0) ≫ Subobject.arrow (kernelSubobject g) =
    (Subobject.ofLE (imageSubobject (h ≫ f)) (imageSubobject f) (_ : imageSubobject (h ≫ f) ≤ imageSubobject f) ≫
        imageToKernel f g w) ≫
      Subobject.arrow (kernelSubobject g)

Next tactic:
simp
@[simp]
theorem imageToKernel_comp_mono {D : V} (h : C ⟶ D) [Mono h] (w) :
    imageToKernel f (g ≫ h) w =
      imageToKernel f g ((cancel_mono h).mp (by 

Proof state:
ι : Type u_1
V : Type u
inst✝⁴ : Category.{v, u} V
inst✝³ : HasZeroMorphisms V
A B C : V
f : A ⟶ B
g : B ⟶ C
inst✝² : HasKernels V
inst✝¹ : HasImages V
D : V
h : C ⟶ D
inst✝ : Mono h
w : f ≫ g ≫ h = 0
⊢ (f ≫ g) ≫ h = 0 ≫ h

Next tactic:
simpa using w
@[simp]
theorem imageToKernel_comp_mono {D : V} (h : C ⟶ D) [Mono h] (w) :
    imageToKernel f (g ≫ h) w =
      imageToKernel f g ((cancel_mono h).mp (by simpa using w : (f ≫ g) ≫ h = 0 ≫ h)) ≫
        (Subobject.isoOfEq _ _ (kernelSubobject_comp_mono g h)).inv := by
  

Proof state:
ι : Type u_1
V : Type u
inst✝⁴ : Category.{v, u} V
inst✝³ : HasZeroMorphisms V
A B C : V
f : A ⟶ B
g : B ⟶ C
inst✝² : HasKernels V
inst✝¹ : HasImages V
D : V
h : C ⟶ D
inst✝ : Mono h
w : f ≫ g ≫ h = 0
⊢ imageToKernel f (g ≫ h) w =
    imageToKernel f g (_ : f ≫ g = 0) ≫
      (Subobject.isoOfEq (kernelSubobject (g ≫ h)) (kernelSubobject g)
          (_ : kernelSubobject (g ≫ h) = kernelSubobject g)).inv

Next tactic:
ext