l3lab/ntp-mathlib huggingface dataset:
theorem eventualRange_eq_iff {f : i ⟶ j} :
    F.eventualRange j = range (F.map f) ↔
      ∀ ⦃k⦄ (g : k ⟶ i), range (F.map f) ⊆ range (F.map <| g ≫ f) := by
  rw [subset_antisymm_iff, eventualRange, and_iff_right (iInter₂_subset _ _), subset_iInter₂_iff]
  refine' ⟨fun h k g => h _ _, fun h j' f' => _⟩
  obtain ⟨k, g, g', he⟩ := cospan f f'
  

Proof state:
case intro.intro.intro
J : Type u
inst✝¹ : Category.{u_1, u} J
F : J ⥤ Type v
i j k✝ : J
s : Set (F.obj i)
inst✝ : IsCofilteredOrEmpty J
f : i ⟶ j
h : ∀ ⦃k : J⦄ (g : k ⟶ i), range (F.map f) ⊆ range (F.map (g ≫ f))
j' : J
f' : j' ⟶ j
k : J
g : k ⟶ i
g' : k ⟶ j'
he : g ≫ f = g' ≫ f'
⊢ range (F.map f) ⊆ range (F.map f')

Next tactic:
refine' (h g).trans _
theorem eventualRange_eq_iff {f : i ⟶ j} :
    F.eventualRange j = range (F.map f) ↔
      ∀ ⦃k⦄ (g : k ⟶ i), range (F.map f) ⊆ range (F.map <| g ≫ f) := by
  rw [subset_antisymm_iff, eventualRange, and_iff_right (iInter₂_subset _ _), subset_iInter₂_iff]
  refine' ⟨fun h k g => h _ _, fun h j' f' => _⟩
  obtain ⟨k, g, g', he⟩ := cospan f f'
  refine' (h g).trans _
  

Proof state:
case intro.intro.intro
J : Type u
inst✝¹ : Category.{u_1, u} J
F : J ⥤ Type v
i j k✝ : J
s : Set (F.obj i)
inst✝ : IsCofilteredOrEmpty J
f : i ⟶ j
h : ∀ ⦃k : J⦄ (g : k ⟶ i), range (F.map f) ⊆ range (F.map (g ≫ f))
j' : J
f' : j' ⟶ j
k : J
g : k ⟶ i
g' : k ⟶ j'
he : g ≫ f = g' ≫ f'
⊢ range (F.map (g ≫ f)) ⊆ range (F.map f')

Next tactic:
rw [he, F.map_comp]
theorem eventualRange_eq_iff {f : i ⟶ j} :
    F.eventualRange j = range (F.map f) ↔
      ∀ ⦃k⦄ (g : k ⟶ i), range (F.map f) ⊆ range (F.map <| g ≫ f) := by
  rw [subset_antisymm_iff, eventualRange, and_iff_right (iInter₂_subset _ _), subset_iInter₂_iff]
  refine' ⟨fun h k g => h _ _, fun h j' f' => _⟩
  obtain ⟨k, g, g', he⟩ := cospan f f'
  refine' (h g).trans _
  rw [he, F.map_comp]
  

Proof state:
case intro.intro.intro
J : Type u
inst✝¹ : Category.{u_1, u} J
F : J ⥤ Type v
i j k✝ : J
s : Set (F.obj i)
inst✝ : IsCofilteredOrEmpty J
f : i ⟶ j
h : ∀ ⦃k : J⦄ (g : k ⟶ i), range (F.map f) ⊆ range (F.map (g ≫ f))
j' : J
f' : j' ⟶ j
k : J
g : k ⟶ i
g' : k ⟶ j'
he : g ≫ f = g' ≫ f'
⊢ range (F.map g' ≫ F.map f') ⊆ range (F.map f')

Next tactic:
apply range_comp_subset_range
theorem isMittagLeffler_iff_subset_range_comp : F.IsMittagLeffler ↔
    ∀ j : J, ∃ (i : _) (f : i ⟶ j), ∀ ⦃k⦄ (g : k ⟶ i), range (F.map f) ⊆ range (F.map <| g ≫ f) :=
  by 

Proof state:
J : Type u
inst✝¹ : Category.{u_1, u} J
F : J ⥤ Type v
i j k : J
s : Set (F.obj i)
inst✝ : IsCofilteredOrEmpty J
⊢ IsMittagLeffler F ↔ ∀ (j : J), ∃ i f, ∀ ⦃k : J⦄ (g : k ⟶ i), range (F.map f) ⊆ range (F.map (g ≫ f))

Next tactic:
simp_rw [isMittagLeffler_iff_eventualRange, eventualRange_eq_iff]
theorem IsMittagLeffler.toPreimages (h : F.IsMittagLeffler) : (F.toPreimages s).IsMittagLeffler :=
  (isMittagLeffler_iff_subset_range_comp _).2 fun j => by
    

Proof state:
J : Type u
inst✝¹ : Category.{u_1, u} J
F : J ⥤ Type v
i j✝ k : J
s : Set (F.obj i)
inst✝ : IsCofilteredOrEmpty J
h : IsMittagLeffler F
j : J
⊢ ∃ i_1 f,
    ∀ ⦃k : J⦄ (g : k ⟶ i_1), range ((Functor.toPreimages F s).map f) ⊆ range ((Functor.toPreimages F s).map (g ≫ f))

Next tactic:
obtain ⟨j₁, g₁, f₁, -⟩ := IsCofilteredOrEmpty.cone_objs i j
theorem IsMittagLeffler.toPreimages (h : F.IsMittagLeffler) : (F.toPreimages s).IsMittagLeffler :=
  (isMittagLeffler_iff_subset_range_comp _).2 fun j => by
    obtain ⟨j₁, g₁, f₁, -⟩ := IsCofilteredOrEmpty.cone_objs i j
    

Proof state:
case intro.intro.intro
J : Type u
inst✝¹ : Category.{u_1, u} J
F : J ⥤ Type v
i j✝ k : J
s : Set (F.obj i)
inst✝ : IsCofilteredOrEmpty J
h : IsMittagLeffler F
j j₁ : J
g₁ : j₁ ⟶ i
f₁ : j₁ ⟶ j
⊢ ∃ i_1 f,
    ∀ ⦃k : J⦄ (g : k ⟶ i_1), range ((Functor.toPreimages F s).map f) ⊆ range ((Functor.toPreimages F s).map (g ≫ f))

Next tactic:
obtain ⟨j₂, f₂, h₂⟩ := F.isMittagLeffler_iff_eventualRange.1 h j₁
theorem IsMittagLeffler.toPreimages (h : F.IsMittagLeffler) : (F.toPreimages s).IsMittagLeffler :=
  (isMittagLeffler_iff_subset_range_comp _).2 fun j => by
    obtain ⟨j₁, g₁, f₁, -⟩ := IsCofilteredOrEmpty.cone_objs i j
    obtain ⟨j₂, f₂, h₂⟩ := F.isMittagLeffler_iff_eventualRange.1 h j₁
    

Proof state:
case intro.intro.intro.intro.intro
J : Type u
inst✝¹ : Category.{u_1, u} J
F : J ⥤ Type v
i j✝ k : J
s : Set (F.obj i)
inst✝ : IsCofilteredOrEmpty J
h : IsMittagLeffler F
j j₁ : J
g₁ : j₁ ⟶ i
f₁ : j₁ ⟶ j
j₂ : J
f₂ : j₂ ⟶ j₁
h₂ : eventualRange F j₁ = range (F.map f₂)
⊢ ∃ i_1 f,
    ∀ ⦃k : J⦄ (g : k ⟶ i_1), range ((Functor.toPreimages F s).map f) ⊆ range ((Functor.toPreimages F s).map (g ≫ f))

Next tactic:
refine' ⟨j₂, f₂ ≫ f₁, fun j₃ f₃ => _⟩
theorem IsMittagLeffler.toPreimages (h : F.IsMittagLeffler) : (F.toPreimages s).IsMittagLeffler :=
  (isMittagLeffler_iff_subset_range_comp _).2 fun j => by
    obtain ⟨j₁, g₁, f₁, -⟩ := IsCofilteredOrEmpty.cone_objs i j
    obtain ⟨j₂, f₂, h₂⟩ := F.isMittagLeffler_iff_eventualRange.1 h j₁
    refine' ⟨j₂, f₂ ≫ f₁, fun j₃ f₃ => _⟩
    

Proof state:
case intro.intro.intro.intro.intro
J : Type u
inst✝¹ : Category.{u_1, u} J
F : J ⥤ Type v
i j✝ k : J
s : Set (F.obj i)
inst✝ : IsCofilteredOrEmpty J
h : IsMittagLeffler F
j j₁ : J
g₁ : j₁ ⟶ i
f₁ : j₁ ⟶ j
j₂ : J
f₂ : j₂ ⟶ j₁
h₂ : eventualRange F j₁ = range (F.map f₂)
j₃ : J
f₃ : j₃ ⟶ j₂
⊢ range ((Functor.toPreimages F s).map (f₂ ≫ f₁)) ⊆ range ((Functor.toPreimages F s).map (f₃ ≫ f₂ ≫ f₁))

Next tactic:
rintro _ ⟨⟨x, hx⟩, rfl⟩
theorem IsMittagLeffler.toPreimages (h : F.IsMittagLeffler) : (F.toPreimages s).IsMittagLeffler :=
  (isMittagLeffler_iff_subset_range_comp _).2 fun j => by
    obtain ⟨j₁, g₁, f₁, -⟩ := IsCofilteredOrEmpty.cone_objs i j
    obtain ⟨j₂, f₂, h₂⟩ := F.isMittagLeffler_iff_eventualRange.1 h j₁
    refine' ⟨j₂, f₂ ≫ f₁, fun j₃ f₃ => _⟩
    rintro _ ⟨⟨x, hx⟩, rfl⟩
    

Proof state:
case intro.intro.intro.intro.intro.intro.mk
J : Type u
inst✝¹ : Category.{u_1, u} J
F : J ⥤ Type v
i j✝ k : J
s : Set (F.obj i)
inst✝ : IsCofilteredOrEmpty J
h : IsMittagLeffler F
j j₁ : J
g₁ : j₁ ⟶ i
f₁ : j₁ ⟶ j
j₂ : J
f₂ : j₂ ⟶ j₁
h₂ : eventualRange F j₁ = range (F.map f₂)
j₃ : J
f₃ : j₃ ⟶ j₂
x : F.obj j₂
hx : x ∈ ⋂ f, F.map f ⁻¹' s
⊢ (Functor.toPreimages F s).map (f₂ ≫ f₁) { val := x, property := hx } ∈
    range ((Functor.toPreimages F s).map (f₃ ≫ f₂ ≫ f₁))

Next tactic:
have : F.map f₂ x ∈ F.eventualRange j₁ := by
      rw [h₂]
      exact ⟨_, rfl⟩
theorem IsMittagLeffler.toPreimages (h : F.IsMittagLeffler) : (F.toPreimages s).IsMittagLeffler :=
  (isMittagLeffler_iff_subset_range_comp _).2 fun j => by
    obtain ⟨j₁, g₁, f₁, -⟩ := IsCofilteredOrEmpty.cone_objs i j
    obtain ⟨j₂, f₂, h₂⟩ := F.isMittagLeffler_iff_eventualRange.1 h j₁
    refine' ⟨j₂, f₂ ≫ f₁, fun j₃ f₃ => _⟩
    rintro _ ⟨⟨x, hx⟩, rfl⟩
    have : F.map f₂ x ∈ F.eventualRange j₁ := by
      

Proof state:
J : Type u
inst✝¹ : Category.{u_1, u} J
F : J ⥤ Type v
i j✝ k : J
s : Set (F.obj i)
inst✝ : IsCofilteredOrEmpty J
h : IsMittagLeffler F
j j₁ : J
g₁ : j₁ ⟶ i
f₁ : j₁ ⟶ j
j₂ : J
f₂ : j₂ ⟶ j₁
h₂ : eventualRange F j₁ = range (F.map f₂)
j₃ : J
f₃ : j₃ ⟶ j₂
x : F.obj j₂
hx : x ∈ ⋂ f, F.map f ⁻¹' s
⊢ F.map f₂ x ∈ eventualRange F j₁

Next tactic:
rw [h₂]
theorem IsMittagLeffler.toPreimages (h : F.IsMittagLeffler) : (F.toPreimages s).IsMittagLeffler :=
  (isMittagLeffler_iff_subset_range_comp _).2 fun j => by
    obtain ⟨j₁, g₁, f₁, -⟩ := IsCofilteredOrEmpty.cone_objs i j
    obtain ⟨j₂, f₂, h₂⟩ := F.isMittagLeffler_iff_eventualRange.1 h j₁
    refine' ⟨j₂, f₂ ≫ f₁, fun j₃ f₃ => _⟩
    rintro _ ⟨⟨x, hx⟩, rfl⟩
    have : F.map f₂ x ∈ F.eventualRange j₁ := by
      rw [h₂]
      

Proof state:
J : Type u
inst✝¹ : Category.{u_1, u} J
F : J ⥤ Type v
i j✝ k : J
s : Set (F.obj i)
inst✝ : IsCofilteredOrEmpty J
h : IsMittagLeffler F
j j₁ : J
g₁ : j₁ ⟶ i
f₁ : j₁ ⟶ j
j₂ : J
f₂ : j₂ ⟶ j₁
h₂ : eventualRange F j₁ = range (F.map f₂)
j₃ : J
f₃ : j₃ ⟶ j₂
x : F.obj j₂
hx : x ∈ ⋂ f, F.map f ⁻¹' s
⊢ F.map f₂ x ∈ range (F.map f₂)

Next tactic:
exact ⟨_, rfl⟩
theorem IsMittagLeffler.toPreimages (h : F.IsMittagLeffler) : (F.toPreimages s).IsMittagLeffler :=
  (isMittagLeffler_iff_subset_range_comp _).2 fun j => by
    obtain ⟨j₁, g₁, f₁, -⟩ := IsCofilteredOrEmpty.cone_objs i j
    obtain ⟨j₂, f₂, h₂⟩ := F.isMittagLeffler_iff_eventualRange.1 h j₁
    refine' ⟨j₂, f₂ ≫ f₁, fun j₃ f₃ => _⟩
    rintro _ ⟨⟨x, hx⟩, rfl⟩
    have : F.map f₂ x ∈ F.eventualRange j₁ := by
      rw [h₂]
      exact ⟨_, rfl⟩
    

Proof state:
case intro.intro.intro.intro.intro.intro.mk
J : Type u
inst✝¹ : Category.{u_1, u} J
F : J ⥤ Type v
i j✝ k : J
s : Set (F.obj i)
inst✝ : IsCofilteredOrEmpty J
h : IsMittagLeffler F
j j₁ : J
g₁ : j₁ ⟶ i
f₁ : j₁ ⟶ j
j₂ : J
f₂ : j₂ ⟶ j₁
h₂ : eventualRange F j₁ = range (F.map f₂)
j₃ : J
f₃ : j₃ ⟶ j₂
x : F.obj j₂
hx : x ∈ ⋂ f, F.map f ⁻¹' s
this : F.map f₂ x ∈ eventualRange F j₁
⊢ (Functor.toPreimages F s).map (f₂ ≫ f₁) { val := x, property := hx } ∈
    range ((Functor.toPreimages F s).map (f₃ ≫ f₂ ≫ f₁))

Next tactic:
obtain ⟨y, hy, h₃⟩ := h.subset_image_eventualRange F (f₃ ≫ f₂) this
theorem IsMittagLeffler.toPreimages (h : F.IsMittagLeffler) : (F.toPreimages s).IsMittagLeffler :=
  (isMittagLeffler_iff_subset_range_comp _).2 fun j => by
    obtain ⟨j₁, g₁, f₁, -⟩ := IsCofilteredOrEmpty.cone_objs i j
    obtain ⟨j₂, f₂, h₂⟩ := F.isMittagLeffler_iff_eventualRange.1 h j₁
    refine' ⟨j₂, f₂ ≫ f₁, fun j₃ f₃ => _⟩
    rintro _ ⟨⟨x, hx⟩, rfl⟩
    have : F.map f₂ x ∈ F.eventualRange j₁ := by
      rw [h₂]
      exact ⟨_, rfl⟩
    obtain ⟨y, hy, h₃⟩ := h.subset_image_eventualRange F (f₃ ≫ f₂) this
    

Proof state:
case intro.intro.intro.intro.intro.intro.mk.intro.intro
J : Type u
inst✝¹ : Category.{u_1, u} J
F : J ⥤ Type v
i j✝ k : J
s : Set (F.obj i)
inst✝ : IsCofilteredOrEmpty J
h : IsMittagLeffler F
j j₁ : J
g₁ : j₁ ⟶ i
f₁ : j₁ ⟶ j
j₂ : J
f₂ : j₂ ⟶ j₁
h₂ : eventualRange F j₁ = range (F.map f₂)
j₃ : J
f₃ : j₃ ⟶ j₂
x : F.obj j₂
hx : x ∈ ⋂ f, F.map f ⁻¹' s
this : F.map f₂ x ∈ eventualRange F j₁
y : F.obj j₃
hy : y ∈ eventualRange F j₃
h₃ : F.map (f₃ ≫ f₂) y = F.map f₂ x
⊢ (Functor.toPreimages F s).map (f₂ ≫ f₁) { val := x, property := hx } ∈
    range ((Functor.toPreimages F s).map (f₃ ≫ f₂ ≫ f₁))

Next tactic:
refine' ⟨⟨y, mem_iInter.2 fun g₂ => _⟩, Subtype.ext _⟩
theorem IsMittagLeffler.toPreimages (h : F.IsMittagLeffler) : (F.toPreimages s).IsMittagLeffler :=
  (isMittagLeffler_iff_subset_range_comp _).2 fun j => by
    obtain ⟨j₁, g₁, f₁, -⟩ := IsCofilteredOrEmpty.cone_objs i j
    obtain ⟨j₂, f₂, h₂⟩ := F.isMittagLeffler_iff_eventualRange.1 h j₁
    refine' ⟨j₂, f₂ ≫ f₁, fun j₃ f₃ => _⟩
    rintro _ ⟨⟨x, hx⟩, rfl⟩
    have : F.map f₂ x ∈ F.eventualRange j₁ := by
      rw [h₂]
      exact ⟨_, rfl⟩
    obtain ⟨y, hy, h₃⟩ := h.subset_image_eventualRange F (f₃ ≫ f₂) this
    refine' ⟨⟨y, mem_iInter.2 fun g₂ => _⟩, Subtype.ext _⟩
    · 

Proof state:
case intro.intro.intro.intro.intro.intro.mk.intro.intro.refine'_1
J : Type u
inst✝¹ : Category.{u_1, u} J
F : J ⥤ Type v
i j✝ k : J
s : Set (F.obj i)
inst✝ : IsCofilteredOrEmpty J
h : IsMittagLeffler F
j j₁ : J
g₁ : j₁ ⟶ i
f₁ : j₁ ⟶ j
j₂ : J
f₂ : j₂ ⟶ j₁
h₂ : eventualRange F j₁ = range (F.map f₂)
j₃ : J
f₃ : j₃ ⟶ j₂
x : F.obj j₂
hx : x ∈ ⋂ f, F.map f ⁻¹' s
this : F.map f₂ x ∈ eventualRange F j₁
y : F.obj j₃
hy : y ∈ eventualRange F j₃
h₃ : F.map (f₃ ≫ f₂) y = F.map f₂ x
g₂ : j₃ ⟶ i
⊢ y ∈ F.map g₂ ⁻¹' s

Next tactic:
obtain ⟨j₄, f₄, h₄⟩ := IsCofilteredOrEmpty.cone_maps g₂ ((f₃ ≫ f₂) ≫ g₁)
theorem IsMittagLeffler.toPreimages (h : F.IsMittagLeffler) : (F.toPreimages s).IsMittagLeffler :=
  (isMittagLeffler_iff_subset_range_comp _).2 fun j => by
    obtain ⟨j₁, g₁, f₁, -⟩ := IsCofilteredOrEmpty.cone_objs i j
    obtain ⟨j₂, f₂, h₂⟩ := F.isMittagLeffler_iff_eventualRange.1 h j₁
    refine' ⟨j₂, f₂ ≫ f₁, fun j₃ f₃ => _⟩
    rintro _ ⟨⟨x, hx⟩, rfl⟩
    have : F.map f₂ x ∈ F.eventualRange j₁ := by
      rw [h₂]
      exact ⟨_, rfl⟩
    obtain ⟨y, hy, h₃⟩ := h.subset_image_eventualRange F (f₃ ≫ f₂) this
    refine' ⟨⟨y, mem_iInter.2 fun g₂ => _⟩, Subtype.ext _⟩
    · obtain ⟨j₄, f₄, h₄⟩ := IsCofilteredOrEmpty.cone_maps g₂ ((f₃ ≫ f₂) ≫ g₁)
      

Proof state:
case intro.intro.intro.intro.intro.intro.mk.intro.intro.refine'_1.intro.intro
J : Type u
inst✝¹ : Category.{u_1, u} J
F : J ⥤ Type v
i j✝ k : J
s : Set (F.obj i)
inst✝ : IsCofilteredOrEmpty J
h : IsMittagLeffler F
j j₁ : J
g₁ : j₁ ⟶ i
f₁ : j₁ ⟶ j
j₂ : J
f₂ : j₂ ⟶ j₁
h₂ : eventualRange F j₁ = range (F.map f₂)
j₃ : J
f₃ : j₃ ⟶ j₂
x : F.obj j₂
hx : x ∈ ⋂ f, F.map f ⁻¹' s
this : F.map f₂ x ∈ eventualRange F j₁
y : F.obj j₃
hy : y ∈ eventualRange F j₃
h₃ : F.map (f₃ ≫ f₂) y = F.map f₂ x
g₂ : j₃ ⟶ i
j₄ : J
f₄ : j₄ ⟶ j₃
h₄ : f₄ ≫ g₂ = f₄ ≫ (f₃ ≫ f₂) ≫ g₁
⊢ y ∈ F.map g₂ ⁻¹' s

Next tactic:
obtain ⟨y, rfl⟩ := F.mem_eventualRange_iff.1 hy f₄
theorem IsMittagLeffler.toPreimages (h : F.IsMittagLeffler) : (F.toPreimages s).IsMittagLeffler :=
  (isMittagLeffler_iff_subset_range_comp _).2 fun j => by
    obtain ⟨j₁, g₁, f₁, -⟩ := IsCofilteredOrEmpty.cone_objs i j
    obtain ⟨j₂, f₂, h₂⟩ := F.isMittagLeffler_iff_eventualRange.1 h j₁
    refine' ⟨j₂, f₂ ≫ f₁, fun j₃ f₃ => _⟩
    rintro _ ⟨⟨x, hx⟩, rfl⟩
    have : F.map f₂ x ∈ F.eventualRange j₁ := by
      rw [h₂]
      exact ⟨_, rfl⟩
    obtain ⟨y, hy, h₃⟩ := h.subset_image_eventualRange F (f₃ ≫ f₂) this
    refine' ⟨⟨y, mem_iInter.2 fun g₂ => _⟩, Subtype.ext _⟩
    · obtain ⟨j₄, f₄, h₄⟩ := IsCofilteredOrEmpty.cone_maps g₂ ((f₃ ≫ f₂) ≫ g₁)
      obtain ⟨y, rfl⟩ := F.mem_eventualRange_iff.1 hy f₄
      

Proof state:
case intro.intro.intro.intro.intro.intro.mk.intro.intro.refine'_1.intro.intro.intro
J : Type u
inst✝¹ : Category.{u_1, u} J
F : J ⥤ Type v
i j✝ k : J
s : Set (F.obj i)
inst✝ : IsCofilteredOrEmpty J
h : IsMittagLeffler F
j j₁ : J
g₁ : j₁ ⟶ i
f₁ : j₁ ⟶ j
j₂ : J
f₂ : j₂ ⟶ j₁
h₂ : eventualRange F j₁ = range (F.map f₂)
j₃ : J
f₃ : j₃ ⟶ j₂
x : F.obj j₂
hx : x ∈ ⋂ f, F.map f ⁻¹' s
this : F.map f₂ x ∈ eventualRange F j₁
g₂ : j₃ ⟶ i
j₄ : J
f₄ : j₄ ⟶ j₃
h₄ : f₄ ≫ g₂ = f₄ ≫ (f₃ ≫ f₂) ≫ g₁
y : F.obj j₄
hy : F.map f₄ y ∈ eventualRange F j₃
h₃ : F.map (f₃ ≫ f₂) (F.map f₄ y) = F.map f₂ x
⊢ F.map f₄ y ∈ F.map g₂ ⁻¹' s

Next tactic:
rw [← map_comp_apply] at h₃
theorem IsMittagLeffler.toPreimages (h : F.IsMittagLeffler) : (F.toPreimages s).IsMittagLeffler :=
  (isMittagLeffler_iff_subset_range_comp _).2 fun j => by
    obtain ⟨j₁, g₁, f₁, -⟩ := IsCofilteredOrEmpty.cone_objs i j
    obtain ⟨j₂, f₂, h₂⟩ := F.isMittagLeffler_iff_eventualRange.1 h j₁
    refine' ⟨j₂, f₂ ≫ f₁, fun j₃ f₃ => _⟩
    rintro _ ⟨⟨x, hx⟩, rfl⟩
    have : F.map f₂ x ∈ F.eventualRange j₁ := by
      rw [h₂]
      exact ⟨_, rfl⟩
    obtain ⟨y, hy, h₃⟩ := h.subset_image_eventualRange F (f₃ ≫ f₂) this
    refine' ⟨⟨y, mem_iInter.2 fun g₂ => _⟩, Subtype.ext _⟩
    · obtain ⟨j₄, f₄, h₄⟩ := IsCofilteredOrEmpty.cone_maps g₂ ((f₃ ≫ f₂) ≫ g₁)
      obtain ⟨y, rfl⟩ := F.mem_eventualRange_iff.1 hy f₄
      rw [← map_comp_apply] at h₃
      

Proof state:
case intro.intro.intro.intro.intro.intro.mk.intro.intro.refine'_1.intro.intro.intro
J : Type u
inst✝¹ : Category.{u_1, u} J
F : J ⥤ Type v
i j✝ k : J
s : Set (F.obj i)
inst✝ : IsCofilteredOrEmpty J
h : IsMittagLeffler F
j j₁ : J
g₁ : j₁ ⟶ i
f₁ : j₁ ⟶ j
j₂ : J
f₂ : j₂ ⟶ j₁
h₂ : eventualRange F j₁ = range (F.map f₂)
j₃ : J
f₃ : j₃ ⟶ j₂
x : F.obj j₂
hx : x ∈ ⋂ f, F.map f ⁻¹' s
this : F.map f₂ x ∈ eventualRange F j₁
g₂ : j₃ ⟶ i
j₄ : J
f₄ : j₄ ⟶ j₃
h₄ : f₄ ≫ g₂ = f₄ ≫ (f₃ ≫ f₂) ≫ g₁
y : F.obj j₄
hy : F.map f₄ y ∈ eventualRange F j₃
h₃ : F.map (f₄ ≫ f₃ ≫ f₂) y = F.map f₂ x
⊢ F.map f₄ y ∈ F.map g₂ ⁻¹' s

Next tactic:
rw [mem_preimage, ← map_comp_apply, h₄, ← Category.assoc, map_comp_apply, h₃,
        ← map_comp_apply]
theorem IsMittagLeffler.toPreimages (h : F.IsMittagLeffler) : (F.toPreimages s).IsMittagLeffler :=
  (isMittagLeffler_iff_subset_range_comp _).2 fun j => by
    obtain ⟨j₁, g₁, f₁, -⟩ := IsCofilteredOrEmpty.cone_objs i j
    obtain ⟨j₂, f₂, h₂⟩ := F.isMittagLeffler_iff_eventualRange.1 h j₁
    refine' ⟨j₂, f₂ ≫ f₁, fun j₃ f₃ => _⟩
    rintro _ ⟨⟨x, hx⟩, rfl⟩
    have : F.map f₂ x ∈ F.eventualRange j₁ := by
      rw [h₂]
      exact ⟨_, rfl⟩
    obtain ⟨y, hy, h₃⟩ := h.subset_image_eventualRange F (f₃ ≫ f₂) this
    refine' ⟨⟨y, mem_iInter.2 fun g₂ => _⟩, Subtype.ext _⟩
    · obtain ⟨j₄, f₄, h₄⟩ := IsCofilteredOrEmpty.cone_maps g₂ ((f₃ ≫ f₂) ≫ g₁)
      obtain ⟨y, rfl⟩ := F.mem_eventualRange_iff.1 hy f₄
      rw [← map_comp_apply] at h₃
      rw [mem_preimage, ← map_comp_apply, h₄, ← Category.assoc, map_comp_apply, h₃,
        ← map_comp_apply]
      

Proof state:
case intro.intro.intro.intro.intro.intro.mk.intro.intro.refine'_1.intro.intro.intro
J : Type u
inst✝¹ : Category.{u_1, u} J
F : J ⥤ Type v
i j✝ k : J
s : Set (F.obj i)
inst✝ : IsCofilteredOrEmpty J
h : IsMittagLeffler F
j j₁ : J
g₁ : j₁ ⟶ i
f₁ : j₁ ⟶ j
j₂ : J
f₂ : j₂ ⟶ j₁
h₂ : eventualRange F j₁ = range (F.map f₂)
j₃ : J
f₃ : j₃ ⟶ j₂
x : F.obj j₂
hx : x ∈ ⋂ f, F.map f ⁻¹' s
this : F.map f₂ x ∈ eventualRange F j₁
g₂ : j₃ ⟶ i
j₄ : J
f₄ : j₄ ⟶ j₃
h₄ : f₄ ≫ g₂ = f₄ ≫ (f₃ ≫ f₂) ≫ g₁
y : F.obj j₄
hy : F.map f₄ y ∈ eventualRange F j₃
h₃ : F.map (f₄ ≫ f₃ ≫ f₂) y = F.map f₂ x
⊢ F.map (f₂ ≫ g₁) x ∈ s

Next tactic:
apply mem_iInter.1 hx
theorem IsMittagLeffler.toPreimages (h : F.IsMittagLeffler) : (F.toPreimages s).IsMittagLeffler :=
  (isMittagLeffler_iff_subset_range_comp _).2 fun j => by
    obtain ⟨j₁, g₁, f₁, -⟩ := IsCofilteredOrEmpty.cone_objs i j
    obtain ⟨j₂, f₂, h₂⟩ := F.isMittagLeffler_iff_eventualRange.1 h j₁
    refine' ⟨j₂, f₂ ≫ f₁, fun j₃ f₃ => _⟩
    rintro _ ⟨⟨x, hx⟩, rfl⟩
    have : F.map f₂ x ∈ F.eventualRange j₁ := by
      rw [h₂]
      exact ⟨_, rfl⟩
    obtain ⟨y, hy, h₃⟩ := h.subset_image_eventualRange F (f₃ ≫ f₂) this
    refine' ⟨⟨y, mem_iInter.2 fun g₂ => _⟩, Subtype.ext _⟩
    · obtain ⟨j₄, f₄, h₄⟩ := IsCofilteredOrEmpty.cone_maps g₂ ((f₃ ≫ f₂) ≫ g₁)
      obtain ⟨y, rfl⟩ := F.mem_eventualRange_iff.1 hy f₄
      rw [← map_comp_apply] at h₃
      rw [mem_preimage, ← map_comp_apply, h₄, ← Category.assoc, map_comp_apply, h₃,
        ← map_comp_apply]
      apply mem_iInter.1 hx
    · 

Proof state:
case intro.intro.intro.intro.intro.intro.mk.intro.intro.refine'_2
J : Type u
inst✝¹ : Category.{u_1, u} J
F : J ⥤ Type v
i j✝ k : J
s : Set (F.obj i)
inst✝ : IsCofilteredOrEmpty J
h : IsMittagLeffler F
j j₁ : J
g₁ : j₁ ⟶ i
f₁ : j₁ ⟶ j
j₂ : J
f₂ : j₂ ⟶ j₁
h₂ : eventualRange F j₁ = range (F.map f₂)
j₃ : J
f₃ : j₃ ⟶ j₂
x : F.obj j₂
hx : x ∈ ⋂ f, F.map f ⁻¹' s
this : F.map f₂ x ∈ eventualRange F j₁
y : F.obj j₃
hy : y ∈ eventualRange F j₃
h₃ : F.map (f₃ ≫ f₂) y = F.map f₂ x
⊢ ↑((Functor.toPreimages F s).map (f₃ ≫ f₂ ≫ f₁) { val := y, property := (_ : y ∈ ⋂ i_1, F.map i_1 ⁻¹' s) }) =
    ↑((Functor.toPreimages F s).map (f₂ ≫ f₁) { val := x, property := hx })

Next tactic:
simp_rw [toPreimages_map, MapsTo.val_restrict_apply]
theorem IsMittagLeffler.toPreimages (h : F.IsMittagLeffler) : (F.toPreimages s).IsMittagLeffler :=
  (isMittagLeffler_iff_subset_range_comp _).2 fun j => by
    obtain ⟨j₁, g₁, f₁, -⟩ := IsCofilteredOrEmpty.cone_objs i j
    obtain ⟨j₂, f₂, h₂⟩ := F.isMittagLeffler_iff_eventualRange.1 h j₁
    refine' ⟨j₂, f₂ ≫ f₁, fun j₃ f₃ => _⟩
    rintro _ ⟨⟨x, hx⟩, rfl⟩
    have : F.map f₂ x ∈ F.eventualRange j₁ := by
      rw [h₂]
      exact ⟨_, rfl⟩
    obtain ⟨y, hy, h₃⟩ := h.subset_image_eventualRange F (f₃ ≫ f₂) this
    refine' ⟨⟨y, mem_iInter.2 fun g₂ => _⟩, Subtype.ext _⟩
    · obtain ⟨j₄, f₄, h₄⟩ := IsCofilteredOrEmpty.cone_maps g₂ ((f₃ ≫ f₂) ≫ g₁)
      obtain ⟨y, rfl⟩ := F.mem_eventualRange_iff.1 hy f₄
      rw [← map_comp_apply] at h₃
      rw [mem_preimage, ← map_comp_apply, h₄, ← Category.assoc, map_comp_apply, h₃,
        ← map_comp_apply]
      apply mem_iInter.1 hx
    · simp_rw [toPreimages_map, MapsTo.val_restrict_apply]
      

Proof state:
case intro.intro.intro.intro.intro.intro.mk.intro.intro.refine'_2
J : Type u
inst✝¹ : Category.{u_1, u} J
F : J ⥤ Type v
i j✝ k : J
s : Set (F.obj i)
inst✝ : IsCofilteredOrEmpty J
h : IsMittagLeffler F
j j₁ : J
g₁ : j₁ ⟶ i
f₁ : j₁ ⟶ j
j₂ : J
f₂ : j₂ ⟶ j₁
h₂ : eventualRange F j₁ = range (F.map f₂)
j₃ : J
f₃ : j₃ ⟶ j₂
x : F.obj j₂
hx : x ∈ ⋂ f, F.map f ⁻¹' s
this : F.map f₂ x ∈ eventualRange F j₁
y : F.obj j₃
hy : y ∈ eventualRange F j₃
h₃ : F.map (f₃ ≫ f₂) y = F.map f₂ x
⊢ F.map (f₃ ≫ f₂ ≫ f₁) y = F.map (f₂ ≫ f₁) x

Next tactic:
rw [← Category.assoc, map_comp_apply, h₃, map_comp_apply]
theorem isMittagLeffler_of_exists_finite_range
    (h : ∀ j : J, ∃ (i : _) (f : i ⟶ j), (range <| F.map f).Finite) : F.IsMittagLeffler := by
  

Proof state:
J : Type u
inst✝¹ : Category.{u_1, u} J
F : J ⥤ Type v
i j k : J
s : Set (F.obj i)
inst✝ : IsCofilteredOrEmpty J
h : ∀ (j : J), ∃ i f, Set.Finite (range (F.map f))
⊢ IsMittagLeffler F

Next tactic:
intro j
theorem isMittagLeffler_of_exists_finite_range
    (h : ∀ j : J, ∃ (i : _) (f : i ⟶ j), (range <| F.map f).Finite) : F.IsMittagLeffler := by
  intro j
  

Proof state:
J : Type u
inst✝¹ : Category.{u_1, u} J
F : J ⥤ Type v
i j✝ k : J
s : Set (F.obj i)
inst✝ : IsCofilteredOrEmpty J
h : ∀ (j : J), ∃ i f, Set.Finite (range (F.map f))
j : J
⊢ ∃ i f, ∀ ⦃k : J⦄ (g : k ⟶ j), range (F.map f) ⊆ range (F.map g)

Next tactic:
obtain ⟨i, hi, hf⟩ := h j
theorem isMittagLeffler_of_exists_finite_range
    (h : ∀ j : J, ∃ (i : _) (f : i ⟶ j), (range <| F.map f).Finite) : F.IsMittagLeffler := by
  intro j
  obtain ⟨i, hi, hf⟩ := h j
  

Proof state:
case intro.intro
J : Type u
inst✝¹ : Category.{u_1, u} J
F : J ⥤ Type v
i✝ j✝ k : J
s : Set (F.obj i✝)
inst✝ : IsCofilteredOrEmpty J
h : ∀ (j : J), ∃ i f, Set.Finite (range (F.map f))
j i : J
hi : i ⟶ j
hf : Set.Finite (range (F.map hi))
⊢ ∃ i f, ∀ ⦃k : J⦄ (g : k ⟶ j), range (F.map f) ⊆ range (F.map g)

Next tactic:
obtain ⟨m, ⟨i, f, hm⟩, hmin⟩ := Finset.wellFoundedLT.wf.has_min
    { s : Finset (F.obj j) | ∃ (i : _) (f : i ⟶ j), ↑s = range (F.map f) }
    ⟨_, i, hi, hf.coe_toFinset⟩
theorem isMittagLeffler_of_exists_finite_range
    (h : ∀ j : J, ∃ (i : _) (f : i ⟶ j), (range <| F.map f).Finite) : F.IsMittagLeffler := by
  intro j
  obtain ⟨i, hi, hf⟩ := h j
  obtain ⟨m, ⟨i, f, hm⟩, hmin⟩ := Finset.wellFoundedLT.wf.has_min
    { s : Finset (F.obj j) | ∃ (i : _) (f : i ⟶ j), ↑s = range (F.map f) }
    ⟨_, i, hi, hf.coe_toFinset⟩
  

Proof state:
case intro.intro.intro.intro.intro.intro
J : Type u
inst✝¹ : Category.{u_1, u} J
F : J ⥤ Type v
i✝¹ j✝ k : J
s : Set (F.obj i✝¹)
inst✝ : IsCofilteredOrEmpty J
h : ∀ (j : J), ∃ i f, Set.Finite (range (F.map f))
j i✝ : J
hi : i✝ ⟶ j
hf : Set.Finite (range (F.map hi))
m : Finset (F.obj j)
hmin : ∀ x ∈ {s | ∃ i f, ↑s = range (F.map f)}, ¬x < m
i : J
f : i ⟶ j
hm : ↑m = range (F.map f)
⊢ ∃ i f, ∀ ⦃k : J⦄ (g : k ⟶ j), range (F.map f) ⊆ range (F.map g)

Next tactic:
refine' ⟨i, f, fun k g =>
    (directedOn_range.mp <| F.ranges_directed j).is_bot_of_is_min ⟨⟨i, f⟩, rfl⟩ _ _ ⟨⟨k, g⟩, rfl⟩⟩
theorem isMittagLeffler_of_exists_finite_range
    (h : ∀ j : J, ∃ (i : _) (f : i ⟶ j), (range <| F.map f).Finite) : F.IsMittagLeffler := by
  intro j
  obtain ⟨i, hi, hf⟩ := h j
  obtain ⟨m, ⟨i, f, hm⟩, hmin⟩ := Finset.wellFoundedLT.wf.has_min
    { s : Finset (F.obj j) | ∃ (i : _) (f : i ⟶ j), ↑s = range (F.map f) }
    ⟨_, i, hi, hf.coe_toFinset⟩
  refine' ⟨i, f, fun k g =>
    (directedOn_range.mp <| F.ranges_directed j).is_bot_of_is_min ⟨⟨i, f⟩, rfl⟩ _ _ ⟨⟨k, g⟩, rfl⟩⟩
  

Proof state:
case intro.intro.intro.intro.intro.intro
J : Type u
inst✝¹ : Category.{u_1, u} J
F : J ⥤ Type v
i✝¹ j✝ k✝ : J
s : Set (F.obj i✝¹)
inst✝ : IsCofilteredOrEmpty J
h : ∀ (j : J), ∃ i f, Set.Finite (range (F.map f))
j i✝ : J
hi : i✝ ⟶ j
hf : Set.Finite (range (F.map hi))
m : Finset (F.obj j)
hmin : ∀ x ∈ {s | ∃ i f, ↑s = range (F.map f)}, ¬x < m
i : J
f : i ⟶ j
hm : ↑m = range (F.map f)
k : J
g : k ⟶ j
⊢ ∀ a ∈ range fun f => range (F.map f.snd),
    a ≤ (fun f => range (F.map f.snd)) { fst := i, snd := f } →
      (fun f => range (F.map f.snd)) { fst := i, snd := f } ≤ a

Next tactic:
rintro _ ⟨⟨k', g'⟩, rfl⟩ hl