l3lab/ntp-mathlib huggingface dataset:
/-- A version of *Fubini theorem* for continuous functions with compact support: one may swap
the order of integration with respect to locally finite measures. One does not assume that the
measures are σ-finite, contrary to the usual Fubini theorem. -/
lemma integral_integral_swap_of_hasCompactSupport
    {f : X → Y → E} (hf : Continuous f.uncurry) (h'f : HasCompactSupport f.uncurry)
    {μ : Measure X} {ν : Measure Y} [IsFiniteMeasureOnCompacts μ] [IsFiniteMeasureOnCompacts ν] :
    ∫ x, (∫ y, f x y ∂ν) ∂μ = ∫ y, (∫ x, f x y ∂μ) ∂ν := by
  let U := Prod.fst '' (tsupport f.uncurry)
  have : Fact (μ U < ∞) := ⟨(IsCompact.image h'f continuous_fst).measure_lt_top⟩
  let V := Prod.snd '' (tsupport f.uncurry)
  have : Fact (ν V < ∞) := ⟨(IsCompact.image h'f continuous_snd).measure_lt_top⟩
  calc
  ∫ x, (∫ y, f x y ∂ν) ∂μ = ∫ x, (∫ y in V, f x y ∂ν) ∂μ := by
    congr 1 with x
    apply (set_integral_eq_integral_of_forall_compl_eq_zero (fun y hy ↦ ?_)).symm
    contrapose! hy
    have : (x, y) ∈ Function.support f.uncurry := hy
    exact mem_image_of_mem _ (subset_tsupport _ this)
  _ = ∫ x in U, (∫ y in V, f x y ∂ν) ∂μ := by
    apply (set_integral_eq_integral_of_forall_compl_eq_zero (fun x hx ↦ ?_)).symm
    have : ∀ y, f x y = 0 := by
      intro y
      contrapose! hx
      have : (x, y) ∈ Function.support f.uncurry := hx
      exact mem_image_of_mem _ (subset_tsupport _ this)
    simp [this]
  _ = ∫ y in V, (∫ x in U, f x y ∂μ) ∂ν := by
    apply integral_integral_swap
    apply (integrableOn_iff_integrable_of_support_subset (subset_tsupport f.uncurry)).mp
    refine ⟨(h'f.stronglyMeasurable_of_prod hf).aestronglyMeasurable, ?_⟩
    obtain ⟨C, hC⟩ : ∃ C, ∀ p, ‖f.uncurry p‖ ≤ C := hf.bounded_above_of_compact_support h'f
    exact hasFiniteIntegral_of_bounded (C := C) (eventually_of_forall hC)
  _ = ∫ y, (∫ x in U, f x y ∂μ) ∂ν := by
    apply set_integral_eq_integral_of_forall_compl_eq_zero (fun y hy ↦ ?_)
    have : ∀ x, f x y = 0 := by
      intro x
      contrapose! hy
      have : (x, y) ∈ Function.support f.uncurry := hy
      

Proof state:
α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ : Type u_5
E : Type u_6
inst✝¹⁸ : MeasurableSpace α
inst✝¹⁷ : MeasurableSpace α'
inst✝¹⁶ : MeasurableSpace β
inst✝¹⁵ : MeasurableSpace β'
inst✝¹⁴ : MeasurableSpace γ
μ✝ μ' : Measure α
ν✝ ν' : Measure β
τ : Measure γ
inst✝¹³ : NormedAddCommGroup E
inst✝¹² : SigmaFinite ν✝
inst✝¹¹ : NormedSpace ℝ E
inst✝¹⁰ : SigmaFinite μ✝
E' : Type u_7
inst✝⁹ : NormedAddCommGroup E'
inst✝⁸ : NormedSpace ℝ E'
X : Type u_8
Y : Type u_9
inst✝⁷ : TopologicalSpace X
inst✝⁶ : TopologicalSpace Y
inst✝⁵ : MeasurableSpace X
inst✝⁴ : MeasurableSpace Y
inst✝³ : OpensMeasurableSpace X
inst✝² : OpensMeasurableSpace Y
f : X → Y → E
hf : Continuous (uncurry f)
h'f : HasCompactSupport (uncurry f)
μ : Measure X
ν : Measure Y
inst✝¹ : IsFiniteMeasureOnCompacts μ
inst✝ : IsFiniteMeasureOnCompacts ν
U : Set X := Prod.fst '' tsupport (uncurry f)
this✝¹ : Fact (↑↑μ U < ⊤)
V : Set Y := Prod.snd '' tsupport (uncurry f)
this✝ : Fact (↑↑ν V < ⊤)
y : Y
x : X
hy : f x y ≠ 0
this : (x, y) ∈ support (uncurry f)
⊢ y ∈ V

Next tactic:
exact mem_image_of_mem _ (subset_tsupport _ this)
theorem small_fullSubcategory_filteredClosure :
    Small.{max v w} (FullSubcategory (FilteredClosure f)) := by
  

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : IsFilteredOrEmpty C
α : Type w
f : α → C
⊢ Small.{max v w, u} (FullSubcategory (FilteredClosure f))

Next tactic:
refine' small_of_injective_of_exists (FilteredClosureSmall.abstractFilteredClosureRealization f)
    FullSubcategory.ext _
theorem small_fullSubcategory_filteredClosure :
    Small.{max v w} (FullSubcategory (FilteredClosure f)) := by
  refine' small_of_injective_of_exists (FilteredClosureSmall.abstractFilteredClosureRealization f)
    FullSubcategory.ext _
  

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : IsFilteredOrEmpty C
α : Type w
f : α → C
⊢ ∀ (b : FullSubcategory (FilteredClosure f)),
    ∃ a, CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f a = b.obj

Next tactic:
rintro ⟨j, h⟩
theorem small_fullSubcategory_filteredClosure :
    Small.{max v w} (FullSubcategory (FilteredClosure f)) := by
  refine' small_of_injective_of_exists (FilteredClosureSmall.abstractFilteredClosureRealization f)
    FullSubcategory.ext _
  rintro ⟨j, h⟩
  

Proof state:
case mk
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : IsFilteredOrEmpty C
α : Type w
f : α → C
j : C
h : FilteredClosure f j
⊢ ∃ a,
    CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f a =
      { obj := j, property := h }.obj

Next tactic:
induction h with
  | base x => exact ⟨⟨0, ⟨x⟩⟩, rfl⟩
  | max hj₁ hj₂ ih ih' =>
    rcases ih with ⟨⟨n, x⟩, rfl⟩
    rcases ih' with ⟨⟨m, y⟩, rfl⟩
    refine' ⟨⟨(Max.max n m).succ, FilteredClosureSmall.InductiveStep.max _ _ x y⟩, rfl⟩
    all_goals apply Nat.lt_succ_of_le
    exacts [Nat.le_max_left _ _, Nat.le_max_right _ _]
  | coeq hj₁ hj₂ g g' ih ih' =>
    rcases ih with ⟨⟨n, x⟩, rfl⟩
    rcases ih' with ⟨⟨m, y⟩, rfl⟩
    refine' ⟨⟨(Max.max n m).succ, FilteredClosureSmall.InductiveStep.coeq _ _ x y g g'⟩, rfl⟩
    all_goals apply Nat.lt_succ_of_le
    exacts [Nat.le_max_left _ _, Nat.le_max_right _ _]
theorem small_fullSubcategory_filteredClosure :
    Small.{max v w} (FullSubcategory (FilteredClosure f)) := by
  refine' small_of_injective_of_exists (FilteredClosureSmall.abstractFilteredClosureRealization f)
    FullSubcategory.ext _
  rintro ⟨j, h⟩
  induction h with
  

Proof state:
case mk.base
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : IsFilteredOrEmpty C
α : Type w
f : α → C
j : C
x : α
⊢ ∃ a,
    CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f a =
      { obj := f x, property := (_ : FilteredClosure f (f x)) }.obj

Next tactic:
| base x => exact ⟨⟨0, ⟨x⟩⟩, rfl⟩
theorem small_fullSubcategory_filteredClosure :
    Small.{max v w} (FullSubcategory (FilteredClosure f)) := by
  refine' small_of_injective_of_exists (FilteredClosureSmall.abstractFilteredClosureRealization f)
    FullSubcategory.ext _
  rintro ⟨j, h⟩
  induction h with
  | base x => 

Proof state:
case mk.base
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : IsFilteredOrEmpty C
α : Type w
f : α → C
j : C
x : α
⊢ ∃ a,
    CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f a =
      { obj := f x, property := (_ : FilteredClosure f (f x)) }.obj

Next tactic:
exact ⟨⟨0, ⟨x⟩⟩, rfl⟩
theorem small_fullSubcategory_filteredClosure :
    Small.{max v w} (FullSubcategory (FilteredClosure f)) := by
  refine' small_of_injective_of_exists (FilteredClosureSmall.abstractFilteredClosureRealization f)
    FullSubcategory.ext _
  rintro ⟨j, h⟩
  induction h with
  | base x => exact ⟨⟨0, ⟨x⟩⟩, rfl⟩
  

Proof state:
case mk.max
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : IsFilteredOrEmpty C
α : Type w
f : α → C
j j✝ j'✝ : C
hj₁ : FilteredClosure f j✝
hj₂ : FilteredClosure f j'✝
ih :
  ∃ a,
    CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f a =
      { obj := j✝, property := hj₁ }.obj
ih' :
  ∃ a,
    CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f a =
      { obj := j'✝, property := hj₂ }.obj
⊢ ∃ a,
    CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f a =
      { obj := max j✝ j'✝, property := (_ : FilteredClosure f (max j✝ j'✝)) }.obj

Next tactic:
| max hj₁ hj₂ ih ih' =>
    rcases ih with ⟨⟨n, x⟩, rfl⟩
    rcases ih' with ⟨⟨m, y⟩, rfl⟩
    refine' ⟨⟨(Max.max n m).succ, FilteredClosureSmall.InductiveStep.max _ _ x y⟩, rfl⟩
    all_goals apply Nat.lt_succ_of_le
    exacts [Nat.le_max_left _ _, Nat.le_max_right _ _]
theorem small_fullSubcategory_filteredClosure :
    Small.{max v w} (FullSubcategory (FilteredClosure f)) := by
  refine' small_of_injective_of_exists (FilteredClosureSmall.abstractFilteredClosureRealization f)
    FullSubcategory.ext _
  rintro ⟨j, h⟩
  induction h with
  | base x => exact ⟨⟨0, ⟨x⟩⟩, rfl⟩
  | max hj₁ hj₂ ih ih' =>
    

Proof state:
case mk.max
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : IsFilteredOrEmpty C
α : Type w
f : α → C
j j✝ j'✝ : C
hj₁ : FilteredClosure f j✝
hj₂ : FilteredClosure f j'✝
ih :
  ∃ a,
    CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f a =
      { obj := j✝, property := hj₁ }.obj
ih' :
  ∃ a,
    CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f a =
      { obj := j'✝, property := hj₂ }.obj
⊢ ∃ a,
    CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f a =
      { obj := max j✝ j'✝, property := (_ : FilteredClosure f (max j✝ j'✝)) }.obj

Next tactic:
rcases ih with ⟨⟨n, x⟩, rfl⟩
theorem small_fullSubcategory_filteredClosure :
    Small.{max v w} (FullSubcategory (FilteredClosure f)) := by
  refine' small_of_injective_of_exists (FilteredClosureSmall.abstractFilteredClosureRealization f)
    FullSubcategory.ext _
  rintro ⟨j, h⟩
  induction h with
  | base x => exact ⟨⟨0, ⟨x⟩⟩, rfl⟩
  | max hj₁ hj₂ ih ih' =>
    rcases ih with ⟨⟨n, x⟩, rfl⟩
    

Proof state:
case mk.max.intro.mk
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : IsFilteredOrEmpty C
α : Type w
f : α → C
j j'✝ : C
hj₂ : FilteredClosure f j'✝
ih' :
  ∃ a,
    CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f a =
      { obj := j'✝, property := hj₂ }.obj
n : ℕ
x : (CategoryTheory.IsFiltered.FilteredClosureSmall.bundledAbstractFilteredClosure f n).fst
hj₁ :
  FilteredClosure f
    (CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f { fst := n, snd := x })
⊢ ∃ a,
    CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f a =
      {
          obj :=
            max
              (CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f
                { fst := n, snd := x })
              j'✝,
          property :=
            (_ :
              FilteredClosure f
                (max
                  (CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f
                    { fst := n, snd := x })
                  j'✝)) }.obj

Next tactic:
rcases ih' with ⟨⟨m, y⟩, rfl⟩
theorem small_fullSubcategory_filteredClosure :
    Small.{max v w} (FullSubcategory (FilteredClosure f)) := by
  refine' small_of_injective_of_exists (FilteredClosureSmall.abstractFilteredClosureRealization f)
    FullSubcategory.ext _
  rintro ⟨j, h⟩
  induction h with
  | base x => exact ⟨⟨0, ⟨x⟩⟩, rfl⟩
  | max hj₁ hj₂ ih ih' =>
    rcases ih with ⟨⟨n, x⟩, rfl⟩
    rcases ih' with ⟨⟨m, y⟩, rfl⟩
    

Proof state:
case mk.max.intro.mk.intro.mk
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : IsFilteredOrEmpty C
α : Type w
f : α → C
j : C
n : ℕ
x : (CategoryTheory.IsFiltered.FilteredClosureSmall.bundledAbstractFilteredClosure f n).fst
hj₁ :
  FilteredClosure f
    (CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f { fst := n, snd := x })
m : ℕ
y : (CategoryTheory.IsFiltered.FilteredClosureSmall.bundledAbstractFilteredClosure f m).fst
hj₂ :
  FilteredClosure f
    (CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f { fst := m, snd := y })
⊢ ∃ a,
    CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f a =
      {
          obj :=
            max
              (CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f
                { fst := n, snd := x })
              (CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f
                { fst := m, snd := y }),
          property :=
            (_ :
              FilteredClosure f
                (max
                  (CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f
                    { fst := n, snd := x })
                  (CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f
                    { fst := m, snd := y }))) }.obj

Next tactic:
refine' ⟨⟨(Max.max n m).succ, FilteredClosureSmall.InductiveStep.max _ _ x y⟩, rfl⟩
theorem small_fullSubcategory_filteredClosure :
    Small.{max v w} (FullSubcategory (FilteredClosure f)) := by
  refine' small_of_injective_of_exists (FilteredClosureSmall.abstractFilteredClosureRealization f)
    FullSubcategory.ext _
  rintro ⟨j, h⟩
  induction h with
  | base x => exact ⟨⟨0, ⟨x⟩⟩, rfl⟩
  | max hj₁ hj₂ ih ih' =>
    rcases ih with ⟨⟨n, x⟩, rfl⟩
    rcases ih' with ⟨⟨m, y⟩, rfl⟩
    refine' ⟨⟨(Max.max n m).succ, FilteredClosureSmall.InductiveStep.max _ _ x y⟩, rfl⟩
    

Proof state:
case mk.max.intro.mk.intro.mk.refine'_1
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : IsFilteredOrEmpty C
α : Type w
f : α → C
j : C
n : ℕ
x : (CategoryTheory.IsFiltered.FilteredClosureSmall.bundledAbstractFilteredClosure f n).fst
hj₁ :
  FilteredClosure f
    (CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f { fst := n, snd := x })
m : ℕ
y : (CategoryTheory.IsFiltered.FilteredClosureSmall.bundledAbstractFilteredClosure f m).fst
hj₂ :
  FilteredClosure f
    (CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f { fst := m, snd := y })
⊢ n < Max.max n m + 1
case mk.max.intro.mk.intro.mk.refine'_2
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : IsFilteredOrEmpty C
α : Type w
f : α → C
j : C
n : ℕ
x : (CategoryTheory.IsFiltered.FilteredClosureSmall.bundledAbstractFilteredClosure f n).fst
hj₁ :
  FilteredClosure f
    (CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f { fst := n, snd := x })
m : ℕ
y : (CategoryTheory.IsFiltered.FilteredClosureSmall.bundledAbstractFilteredClosure f m).fst
hj₂ :
  FilteredClosure f
    (CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f { fst := m, snd := y })
⊢ m < Max.max n m + 1

Next tactic:
all_goals apply Nat.lt_succ_of_le
theorem small_fullSubcategory_filteredClosure :
    Small.{max v w} (FullSubcategory (FilteredClosure f)) := by
  refine' small_of_injective_of_exists (FilteredClosureSmall.abstractFilteredClosureRealization f)
    FullSubcategory.ext _
  rintro ⟨j, h⟩
  induction h with
  | base x => exact ⟨⟨0, ⟨x⟩⟩, rfl⟩
  | max hj₁ hj₂ ih ih' =>
    rcases ih with ⟨⟨n, x⟩, rfl⟩
    rcases ih' with ⟨⟨m, y⟩, rfl⟩
    refine' ⟨⟨(Max.max n m).succ, FilteredClosureSmall.InductiveStep.max _ _ x y⟩, rfl⟩
    all_goals 

Proof state:
case mk.max.intro.mk.intro.mk.refine'_1
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : IsFilteredOrEmpty C
α : Type w
f : α → C
j : C
n : ℕ
x : (CategoryTheory.IsFiltered.FilteredClosureSmall.bundledAbstractFilteredClosure f n).fst
hj₁ :
  FilteredClosure f
    (CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f { fst := n, snd := x })
m : ℕ
y : (CategoryTheory.IsFiltered.FilteredClosureSmall.bundledAbstractFilteredClosure f m).fst
hj₂ :
  FilteredClosure f
    (CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f { fst := m, snd := y })
⊢ n < Max.max n m + 1

Next tactic:
apply Nat.lt_succ_of_le
theorem small_fullSubcategory_filteredClosure :
    Small.{max v w} (FullSubcategory (FilteredClosure f)) := by
  refine' small_of_injective_of_exists (FilteredClosureSmall.abstractFilteredClosureRealization f)
    FullSubcategory.ext _
  rintro ⟨j, h⟩
  induction h with
  | base x => exact ⟨⟨0, ⟨x⟩⟩, rfl⟩
  | max hj₁ hj₂ ih ih' =>
    rcases ih with ⟨⟨n, x⟩, rfl⟩
    rcases ih' with ⟨⟨m, y⟩, rfl⟩
    refine' ⟨⟨(Max.max n m).succ, FilteredClosureSmall.InductiveStep.max _ _ x y⟩, rfl⟩
    all_goals 

Proof state:
case mk.max.intro.mk.intro.mk.refine'_2
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : IsFilteredOrEmpty C
α : Type w
f : α → C
j : C
n : ℕ
x : (CategoryTheory.IsFiltered.FilteredClosureSmall.bundledAbstractFilteredClosure f n).fst
hj₁ :
  FilteredClosure f
    (CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f { fst := n, snd := x })
m : ℕ
y : (CategoryTheory.IsFiltered.FilteredClosureSmall.bundledAbstractFilteredClosure f m).fst
hj₂ :
  FilteredClosure f
    (CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f { fst := m, snd := y })
⊢ m < Max.max n m + 1

Next tactic:
apply Nat.lt_succ_of_le
theorem small_fullSubcategory_filteredClosure :
    Small.{max v w} (FullSubcategory (FilteredClosure f)) := by
  refine' small_of_injective_of_exists (FilteredClosureSmall.abstractFilteredClosureRealization f)
    FullSubcategory.ext _
  rintro ⟨j, h⟩
  induction h with
  | base x => exact ⟨⟨0, ⟨x⟩⟩, rfl⟩
  | max hj₁ hj₂ ih ih' =>
    rcases ih with ⟨⟨n, x⟩, rfl⟩
    rcases ih' with ⟨⟨m, y⟩, rfl⟩
    refine' ⟨⟨(Max.max n m).succ, FilteredClosureSmall.InductiveStep.max _ _ x y⟩, rfl⟩
    all_goals apply Nat.lt_succ_of_le
    

Proof state:
case mk.max.intro.mk.intro.mk.refine'_1.a
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : IsFilteredOrEmpty C
α : Type w
f : α → C
j : C
n : ℕ
x : (CategoryTheory.IsFiltered.FilteredClosureSmall.bundledAbstractFilteredClosure f n).fst
hj₁ :
  FilteredClosure f
    (CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f { fst := n, snd := x })
m : ℕ
y : (CategoryTheory.IsFiltered.FilteredClosureSmall.bundledAbstractFilteredClosure f m).fst
hj₂ :
  FilteredClosure f
    (CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f { fst := m, snd := y })
⊢ n ≤ Max.max n m
case mk.max.intro.mk.intro.mk.refine'_2.a
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : IsFilteredOrEmpty C
α : Type w
f : α → C
j : C
n : ℕ
x : (CategoryTheory.IsFiltered.FilteredClosureSmall.bundledAbstractFilteredClosure f n).fst
hj₁ :
  FilteredClosure f
    (CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f { fst := n, snd := x })
m : ℕ
y : (CategoryTheory.IsFiltered.FilteredClosureSmall.bundledAbstractFilteredClosure f m).fst
hj₂ :
  FilteredClosure f
    (CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f { fst := m, snd := y })
⊢ m ≤ Max.max n m

Next tactic:
exacts [Nat.le_max_left _ _, Nat.le_max_right _ _]
theorem small_fullSubcategory_filteredClosure :
    Small.{max v w} (FullSubcategory (FilteredClosure f)) := by
  refine' small_of_injective_of_exists (FilteredClosureSmall.abstractFilteredClosureRealization f)
    FullSubcategory.ext _
  rintro ⟨j, h⟩
  induction h with
  | base x => exact ⟨⟨0, ⟨x⟩⟩, rfl⟩
  | max hj₁ hj₂ ih ih' =>
    rcases ih with ⟨⟨n, x⟩, rfl⟩
    rcases ih' with ⟨⟨m, y⟩, rfl⟩
    refine' ⟨⟨(Max.max n m).succ, FilteredClosureSmall.InductiveStep.max _ _ x y⟩, rfl⟩
    all_goals apply Nat.lt_succ_of_le
    exacts [Nat.le_max_left _ _, Nat.le_max_right _ _]
  

Proof state:
case mk.coeq
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : IsFilteredOrEmpty C
α : Type w
f : α → C
j j✝ j'✝ : C
hj₁ : FilteredClosure f j✝
hj₂ : FilteredClosure f j'✝
g g' : j✝ ⟶ j'✝
ih :
  ∃ a,
    CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f a =
      { obj := j✝, property := hj₁ }.obj
ih' :
  ∃ a,
    CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f a =
      { obj := j'✝, property := hj₂ }.obj
⊢ ∃ a,
    CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f a =
      { obj := coeq g g', property := (_ : FilteredClosure f (coeq g g')) }.obj

Next tactic:
| coeq hj₁ hj₂ g g' ih ih' =>
    rcases ih with ⟨⟨n, x⟩, rfl⟩
    rcases ih' with ⟨⟨m, y⟩, rfl⟩
    refine' ⟨⟨(Max.max n m).succ, FilteredClosureSmall.InductiveStep.coeq _ _ x y g g'⟩, rfl⟩
    all_goals apply Nat.lt_succ_of_le
    exacts [Nat.le_max_left _ _, Nat.le_max_right _ _]
theorem small_fullSubcategory_filteredClosure :
    Small.{max v w} (FullSubcategory (FilteredClosure f)) := by
  refine' small_of_injective_of_exists (FilteredClosureSmall.abstractFilteredClosureRealization f)
    FullSubcategory.ext _
  rintro ⟨j, h⟩
  induction h with
  | base x => exact ⟨⟨0, ⟨x⟩⟩, rfl⟩
  | max hj₁ hj₂ ih ih' =>
    rcases ih with ⟨⟨n, x⟩, rfl⟩
    rcases ih' with ⟨⟨m, y⟩, rfl⟩
    refine' ⟨⟨(Max.max n m).succ, FilteredClosureSmall.InductiveStep.max _ _ x y⟩, rfl⟩
    all_goals apply Nat.lt_succ_of_le
    exacts [Nat.le_max_left _ _, Nat.le_max_right _ _]
  | coeq hj₁ hj₂ g g' ih ih' =>
    

Proof state:
case mk.coeq
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : IsFilteredOrEmpty C
α : Type w
f : α → C
j j✝ j'✝ : C
hj₁ : FilteredClosure f j✝
hj₂ : FilteredClosure f j'✝
g g' : j✝ ⟶ j'✝
ih :
  ∃ a,
    CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f a =
      { obj := j✝, property := hj₁ }.obj
ih' :
  ∃ a,
    CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f a =
      { obj := j'✝, property := hj₂ }.obj
⊢ ∃ a,
    CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f a =
      { obj := coeq g g', property := (_ : FilteredClosure f (coeq g g')) }.obj

Next tactic:
rcases ih with ⟨⟨n, x⟩, rfl⟩
theorem small_fullSubcategory_filteredClosure :
    Small.{max v w} (FullSubcategory (FilteredClosure f)) := by
  refine' small_of_injective_of_exists (FilteredClosureSmall.abstractFilteredClosureRealization f)
    FullSubcategory.ext _
  rintro ⟨j, h⟩
  induction h with
  | base x => exact ⟨⟨0, ⟨x⟩⟩, rfl⟩
  | max hj₁ hj₂ ih ih' =>
    rcases ih with ⟨⟨n, x⟩, rfl⟩
    rcases ih' with ⟨⟨m, y⟩, rfl⟩
    refine' ⟨⟨(Max.max n m).succ, FilteredClosureSmall.InductiveStep.max _ _ x y⟩, rfl⟩
    all_goals apply Nat.lt_succ_of_le
    exacts [Nat.le_max_left _ _, Nat.le_max_right _ _]
  | coeq hj₁ hj₂ g g' ih ih' =>
    rcases ih with ⟨⟨n, x⟩, rfl⟩
    

Proof state:
case mk.coeq.intro.mk
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : IsFilteredOrEmpty C
α : Type w
f : α → C
j j'✝ : C
hj₂ : FilteredClosure f j'✝
ih' :
  ∃ a,
    CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f a =
      { obj := j'✝, property := hj₂ }.obj
n : ℕ
x : (CategoryTheory.IsFiltered.FilteredClosureSmall.bundledAbstractFilteredClosure f n).fst
hj₁ :
  FilteredClosure f
    (CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f { fst := n, snd := x })
g g' : CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f { fst := n, snd := x } ⟶ j'✝
⊢ ∃ a,
    CategoryTheory.IsFiltered.FilteredClosureSmall.abstractFilteredClosureRealization f a =
      { obj := coeq g g', property := (_ : FilteredClosure f (coeq g g')) }.obj

Next tactic:
rcases ih' with ⟨⟨m, y⟩, rfl⟩