l3lab/ntp-mathlib huggingface dataset:
theorem w_map_wMk {α β : TypeVec n} (g : α ⟹ β) (a : P.A) (f' : P.drop.B a ⟹ α)
    (f : P.last.B a → P.W α) : g <$$> P.wMk a f' f = P.wMk a (g ⊚ f') fun i => g <$$> f i := by
  show _ = P.wMk a (g ⊚ f') (MvFunctor.map g ∘ f)
  have : MvFunctor.map g ∘ f = fun i => ⟨(f i).fst, g ⊚ (f i).snd⟩ := by
    ext i : 1
    dsimp [Function.comp_def]
    cases f i
    rfl
  rw [this]
  have : f = fun i => ⟨(f i).fst, (f i).snd⟩ := by
    

Proof state:
n : ℕ
P : MvPFunctor.{u} (n + 1)
α β : TypeVec.{u} n
g : α ⟹ β
a : P.A
f' : B (drop P) a ⟹ α
f : PFunctor.B (last P) a → W P α
this : MvFunctor.map g ∘ f = fun i => { fst := (f i).fst, snd := g ⊚ (f i).snd }
⊢ f = fun i => { fst := (f i).fst, snd := (f i).snd }

Next tactic:
ext1 x
theorem w_map_wMk {α β : TypeVec n} (g : α ⟹ β) (a : P.A) (f' : P.drop.B a ⟹ α)
    (f : P.last.B a → P.W α) : g <$$> P.wMk a f' f = P.wMk a (g ⊚ f') fun i => g <$$> f i := by
  show _ = P.wMk a (g ⊚ f') (MvFunctor.map g ∘ f)
  have : MvFunctor.map g ∘ f = fun i => ⟨(f i).fst, g ⊚ (f i).snd⟩ := by
    ext i : 1
    dsimp [Function.comp_def]
    cases f i
    rfl
  rw [this]
  have : f = fun i => ⟨(f i).fst, (f i).snd⟩ := by
    ext1 x
    

Proof state:
case h
n : ℕ
P : MvPFunctor.{u} (n + 1)
α β : TypeVec.{u} n
g : α ⟹ β
a : P.A
f' : B (drop P) a ⟹ α
f : PFunctor.B (last P) a → W P α
this : MvFunctor.map g ∘ f = fun i => { fst := (f i).fst, snd := g ⊚ (f i).snd }
x : PFunctor.B (last P) a
⊢ f x = { fst := (f x).fst, snd := (f x).snd }

Next tactic:
cases f x
theorem w_map_wMk {α β : TypeVec n} (g : α ⟹ β) (a : P.A) (f' : P.drop.B a ⟹ α)
    (f : P.last.B a → P.W α) : g <$$> P.wMk a f' f = P.wMk a (g ⊚ f') fun i => g <$$> f i := by
  show _ = P.wMk a (g ⊚ f') (MvFunctor.map g ∘ f)
  have : MvFunctor.map g ∘ f = fun i => ⟨(f i).fst, g ⊚ (f i).snd⟩ := by
    ext i : 1
    dsimp [Function.comp_def]
    cases f i
    rfl
  rw [this]
  have : f = fun i => ⟨(f i).fst, (f i).snd⟩ := by
    ext1 x
    cases f x
    

Proof state:
case h.mk
n : ℕ
P : MvPFunctor.{u} (n + 1)
α β : TypeVec.{u} n
g : α ⟹ β
a : P.A
f' : B (drop P) a ⟹ α
f : PFunctor.B (last P) a → W P α
this : MvFunctor.map g ∘ f = fun i => { fst := (f i).fst, snd := g ⊚ (f i).snd }
x : PFunctor.B (last P) a
fst✝ : (wp P).A
snd✝ : B (wp P) fst✝ ⟹ α
⊢ { fst := fst✝, snd := snd✝ } = { fst := { fst := fst✝, snd := snd✝ }.fst, snd := { fst := fst✝, snd := snd✝ }.snd }

Next tactic:
rfl
theorem w_map_wMk {α β : TypeVec n} (g : α ⟹ β) (a : P.A) (f' : P.drop.B a ⟹ α)
    (f : P.last.B a → P.W α) : g <$$> P.wMk a f' f = P.wMk a (g ⊚ f') fun i => g <$$> f i := by
  show _ = P.wMk a (g ⊚ f') (MvFunctor.map g ∘ f)
  have : MvFunctor.map g ∘ f = fun i => ⟨(f i).fst, g ⊚ (f i).snd⟩ := by
    ext i : 1
    dsimp [Function.comp_def]
    cases f i
    rfl
  rw [this]
  have : f = fun i => ⟨(f i).fst, (f i).snd⟩ := by
    ext1 x
    cases f x
    rfl
  

Proof state:
n : ℕ
P : MvPFunctor.{u} (n + 1)
α β : TypeVec.{u} n
g : α ⟹ β
a : P.A
f' : B (drop P) a ⟹ α
f : PFunctor.B (last P) a → W P α
this✝ : MvFunctor.map g ∘ f = fun i => { fst := (f i).fst, snd := g ⊚ (f i).snd }
this : f = fun i => { fst := (f i).fst, snd := (f i).snd }
⊢ g <$$> wMk P a f' f = wMk P a (g ⊚ f') fun i => { fst := (f i).fst, snd := g ⊚ (f i).snd }

Next tactic:
rw [this]
theorem w_map_wMk {α β : TypeVec n} (g : α ⟹ β) (a : P.A) (f' : P.drop.B a ⟹ α)
    (f : P.last.B a → P.W α) : g <$$> P.wMk a f' f = P.wMk a (g ⊚ f') fun i => g <$$> f i := by
  show _ = P.wMk a (g ⊚ f') (MvFunctor.map g ∘ f)
  have : MvFunctor.map g ∘ f = fun i => ⟨(f i).fst, g ⊚ (f i).snd⟩ := by
    ext i : 1
    dsimp [Function.comp_def]
    cases f i
    rfl
  rw [this]
  have : f = fun i => ⟨(f i).fst, (f i).snd⟩ := by
    ext1 x
    cases f x
    rfl
  rw [this]
  

Proof state:
n : ℕ
P : MvPFunctor.{u} (n + 1)
α β : TypeVec.{u} n
g : α ⟹ β
a : P.A
f' : B (drop P) a ⟹ α
f : PFunctor.B (last P) a → W P α
this✝ : MvFunctor.map g ∘ f = fun i => { fst := (f i).fst, snd := g ⊚ (f i).snd }
this : f = fun i => { fst := (f i).fst, snd := (f i).snd }
⊢ (g <$$> wMk P a f' fun i => { fst := (f i).fst, snd := (f i).snd }) =
    wMk P a (g ⊚ f') fun i =>
      { fst := ((fun i => { fst := (f i).fst, snd := (f i).snd }) i).fst,
        snd := g ⊚ ((fun i => { fst := (f i).fst, snd := (f i).snd }) i).snd }

Next tactic:
dsimp
theorem w_map_wMk {α β : TypeVec n} (g : α ⟹ β) (a : P.A) (f' : P.drop.B a ⟹ α)
    (f : P.last.B a → P.W α) : g <$$> P.wMk a f' f = P.wMk a (g ⊚ f') fun i => g <$$> f i := by
  show _ = P.wMk a (g ⊚ f') (MvFunctor.map g ∘ f)
  have : MvFunctor.map g ∘ f = fun i => ⟨(f i).fst, g ⊚ (f i).snd⟩ := by
    ext i : 1
    dsimp [Function.comp_def]
    cases f i
    rfl
  rw [this]
  have : f = fun i => ⟨(f i).fst, (f i).snd⟩ := by
    ext1 x
    cases f x
    rfl
  rw [this]
  dsimp
  

Proof state:
n : ℕ
P : MvPFunctor.{u} (n + 1)
α β : TypeVec.{u} n
g : α ⟹ β
a : P.A
f' : B (drop P) a ⟹ α
f : PFunctor.B (last P) a → W P α
this✝ : MvFunctor.map g ∘ f = fun i => { fst := (f i).fst, snd := g ⊚ (f i).snd }
this : f = fun i => { fst := (f i).fst, snd := (f i).snd }
⊢ (g <$$> wMk P a f' fun i => { fst := (f i).fst, snd := (f i).snd }) =
    wMk P a (g ⊚ f') fun i => { fst := (f i).fst, snd := g ⊚ (f i).snd }

Next tactic:
rw [wMk_eq, wMk_eq]
theorem w_map_wMk {α β : TypeVec n} (g : α ⟹ β) (a : P.A) (f' : P.drop.B a ⟹ α)
    (f : P.last.B a → P.W α) : g <$$> P.wMk a f' f = P.wMk a (g ⊚ f') fun i => g <$$> f i := by
  show _ = P.wMk a (g ⊚ f') (MvFunctor.map g ∘ f)
  have : MvFunctor.map g ∘ f = fun i => ⟨(f i).fst, g ⊚ (f i).snd⟩ := by
    ext i : 1
    dsimp [Function.comp_def]
    cases f i
    rfl
  rw [this]
  have : f = fun i => ⟨(f i).fst, (f i).snd⟩ := by
    ext1 x
    cases f x
    rfl
  rw [this]
  dsimp
  rw [wMk_eq, wMk_eq]
  

Proof state:
n : ℕ
P : MvPFunctor.{u} (n + 1)
α β : TypeVec.{u} n
g : α ⟹ β
a : P.A
f' : B (drop P) a ⟹ α
f : PFunctor.B (last P) a → W P α
this✝ : MvFunctor.map g ∘ f = fun i => { fst := (f i).fst, snd := g ⊚ (f i).snd }
this : f = fun i => { fst := (f i).fst, snd := (f i).snd }
⊢ g <$$> { fst := WType.mk a fun i => (f i).fst, snd := wPathCasesOn P f' fun i => (f i).snd } =
    { fst := WType.mk a fun i => (f i).fst, snd := wPathCasesOn P (g ⊚ f') fun i => g ⊚ (f i).snd }

Next tactic:
have h := MvPFunctor.map_eq P.wp g
theorem w_map_wMk {α β : TypeVec n} (g : α ⟹ β) (a : P.A) (f' : P.drop.B a ⟹ α)
    (f : P.last.B a → P.W α) : g <$$> P.wMk a f' f = P.wMk a (g ⊚ f') fun i => g <$$> f i := by
  show _ = P.wMk a (g ⊚ f') (MvFunctor.map g ∘ f)
  have : MvFunctor.map g ∘ f = fun i => ⟨(f i).fst, g ⊚ (f i).snd⟩ := by
    ext i : 1
    dsimp [Function.comp_def]
    cases f i
    rfl
  rw [this]
  have : f = fun i => ⟨(f i).fst, (f i).snd⟩ := by
    ext1 x
    cases f x
    rfl
  rw [this]
  dsimp
  rw [wMk_eq, wMk_eq]
  have h := MvPFunctor.map_eq P.wp g
  

Proof state:
n : ℕ
P : MvPFunctor.{u} (n + 1)
α β : TypeVec.{u} n
g : α ⟹ β
a : P.A
f' : B (drop P) a ⟹ α
f : PFunctor.B (last P) a → W P α
this✝ : MvFunctor.map g ∘ f = fun i => { fst := (f i).fst, snd := g ⊚ (f i).snd }
this : f = fun i => { fst := (f i).fst, snd := (f i).snd }
h : ∀ (a : (wp P).A) (f : B (wp P) a ⟹ α), g <$$> { fst := a, snd := f } = { fst := a, snd := g ⊚ f }
⊢ g <$$> { fst := WType.mk a fun i => (f i).fst, snd := wPathCasesOn P f' fun i => (f i).snd } =
    { fst := WType.mk a fun i => (f i).fst, snd := wPathCasesOn P (g ⊚ f') fun i => g ⊚ (f i).snd }

Next tactic:
rw [h, comp_wPathCasesOn]
theorem map_objAppend1 {α γ : TypeVec n} (g : α ⟹ γ) (a : P.A) (f' : P.drop.B a ⟹ α)
    (f : P.last.B a → P.W α) :
    appendFun g (P.wMap g) <$$> P.objAppend1 a f' f =
      P.objAppend1 a (g ⊚ f') fun x => P.wMap g (f x) :=
  by 

Proof state:
n : ℕ
P : MvPFunctor.{u} (n + 1)
α γ : TypeVec.{u} n
g : α ⟹ γ
a : P.A
f' : B (drop P) a ⟹ α
f : PFunctor.B (last P) a → W P α
⊢ (g ::: wMap P g) <$$> objAppend1 P a f' f = objAppend1 P a (g ⊚ f') fun x => wMap P g (f x)

Next tactic:
rw [objAppend1, objAppend1, map_eq, appendFun, ← splitFun_comp]
theorem map_objAppend1 {α γ : TypeVec n} (g : α ⟹ γ) (a : P.A) (f' : P.drop.B a ⟹ α)
    (f : P.last.B a → P.W α) :
    appendFun g (P.wMap g) <$$> P.objAppend1 a f' f =
      P.objAppend1 a (g ⊚ f') fun x => P.wMap g (f x) :=
  by rw [objAppend1, objAppend1, map_eq, appendFun, ← splitFun_comp]; 

Proof state:
n : ℕ
P : MvPFunctor.{u} (n + 1)
α γ : TypeVec.{u} n
g : α ⟹ γ
a : P.A
f' : B (drop P) a ⟹ α
f : PFunctor.B (last P) a → W P α
⊢ { fst := a, snd := splitFun (g ⊚ f') (wMap P g ∘ f) } = { fst := a, snd := splitFun (g ⊚ f') fun x => wMap P g (f x) }

Next tactic:
rfl
theorem wDest'_wMk {α : TypeVec n} (a : P.A) (f' : P.drop.B a ⟹ α) (f : P.last.B a → P.W α) :
    P.wDest' (P.wMk a f' f) = ⟨a, splitFun f' f⟩ := by 

Proof state:
n : ℕ
P : MvPFunctor.{u} (n + 1)
α : TypeVec.{u} n
a : P.A
f' : B (drop P) a ⟹ α
f : PFunctor.B (last P) a → W P α
⊢ wDest' P (wMk P a f' f) = { fst := a, snd := splitFun f' f }

Next tactic:
rw [wDest', wRec_eq]
theorem wDest'_wMk' {α : TypeVec n} (x : P (α.append1 (P.W α))) : P.wDest' (P.wMk' x) = x := by
  

Proof state:
n : ℕ
P : MvPFunctor.{u} (n + 1)
α : TypeVec.{u} n
x : ↑P (α ::: W P α)
⊢ wDest' P (wMk' P x) = x

Next tactic:
cases' x with a f
theorem wDest'_wMk' {α : TypeVec n} (x : P (α.append1 (P.W α))) : P.wDest' (P.wMk' x) = x := by
  cases' x with a f; 

Proof state:
case mk
n : ℕ
P : MvPFunctor.{u} (n + 1)
α : TypeVec.{u} n
a : P.A
f : B P a ⟹ α ::: W P α
⊢ wDest' P (wMk' P { fst := a, snd := f }) = { fst := a, snd := f }

Next tactic:
rw [wMk', wDest'_wMk, split_dropFun_lastFun]
theorem Icc_mem_vitaliFamily_at_right {x y : ℝ} (hxy : x < y) :
    Icc x y ∈ (vitaliFamily (volume : Measure ℝ) 1).setsAt x := by
  

Proof state:
x y : ℝ
hxy : x < y
⊢ Icc x y ∈ VitaliFamily.setsAt (vitaliFamily volume 1) x

Next tactic:
rw [Icc_eq_closedBall]
theorem Icc_mem_vitaliFamily_at_right {x y : ℝ} (hxy : x < y) :
    Icc x y ∈ (vitaliFamily (volume : Measure ℝ) 1).setsAt x := by
  rw [Icc_eq_closedBall]
  

Proof state:
x y : ℝ
hxy : x < y
⊢ Metric.closedBall ((x + y) / 2) ((y - x) / 2) ∈ VitaliFamily.setsAt (vitaliFamily volume 1) x

Next tactic:
refine' closedBall_mem_vitaliFamily_of_dist_le_mul _ _ (by linarith)
theorem Icc_mem_vitaliFamily_at_right {x y : ℝ} (hxy : x < y) :
    Icc x y ∈ (vitaliFamily (volume : Measure ℝ) 1).setsAt x := by
  rw [Icc_eq_closedBall]
  refine' closedBall_mem_vitaliFamily_of_dist_le_mul _ _ (by 

Proof state:
x y : ℝ
hxy : x < y
⊢ 0 < (y - x) / 2

Next tactic:
linarith
theorem Icc_mem_vitaliFamily_at_right {x y : ℝ} (hxy : x < y) :
    Icc x y ∈ (vitaliFamily (volume : Measure ℝ) 1).setsAt x := by
  rw [Icc_eq_closedBall]
  refine' closedBall_mem_vitaliFamily_of_dist_le_mul _ _ (by linarith)
  

Proof state:
x y : ℝ
hxy : x < y
⊢ dist x ((x + y) / 2) ≤ 1 * ((y - x) / 2)

Next tactic:
rw [dist_comm, Real.dist_eq, abs_of_nonneg]
theorem Icc_mem_vitaliFamily_at_right {x y : ℝ} (hxy : x < y) :
    Icc x y ∈ (vitaliFamily (volume : Measure ℝ) 1).setsAt x := by
  rw [Icc_eq_closedBall]
  refine' closedBall_mem_vitaliFamily_of_dist_le_mul _ _ (by linarith)
  rw [dist_comm, Real.dist_eq, abs_of_nonneg] <;> 

Proof state:
x y : ℝ
hxy : x < y
⊢ (x + y) / 2 - x ≤ 1 * ((y - x) / 2)

Next tactic:
linarith
theorem Icc_mem_vitaliFamily_at_right {x y : ℝ} (hxy : x < y) :
    Icc x y ∈ (vitaliFamily (volume : Measure ℝ) 1).setsAt x := by
  rw [Icc_eq_closedBall]
  refine' closedBall_mem_vitaliFamily_of_dist_le_mul _ _ (by linarith)
  rw [dist_comm, Real.dist_eq, abs_of_nonneg] <;> 

Proof state:
x y : ℝ
hxy : x < y
⊢ 0 ≤ (x + y) / 2 - x

Next tactic:
linarith
theorem tendsto_Icc_vitaliFamily_right (x : ℝ) :
    Tendsto (fun y => Icc x y) (𝓝[>] x) ((vitaliFamily (volume : Measure ℝ) 1).filterAt x) := by
  

Proof state:
x : ℝ
⊢ Tendsto (fun y => Icc x y) (𝓝[>] x) (VitaliFamily.filterAt (vitaliFamily volume 1) x)

Next tactic:
refine' (VitaliFamily.tendsto_filterAt_iff _).2 ⟨_, _⟩
theorem tendsto_Icc_vitaliFamily_right (x : ℝ) :
    Tendsto (fun y => Icc x y) (𝓝[>] x) ((vitaliFamily (volume : Measure ℝ) 1).filterAt x) := by
  refine' (VitaliFamily.tendsto_filterAt_iff _).2 ⟨_, _⟩
  · 

Proof state:
case refine'_1
x : ℝ
⊢ ∀ᶠ (i : ℝ) in 𝓝[>] x, Icc x i ∈ VitaliFamily.setsAt (vitaliFamily volume 1) x

Next tactic:
filter_upwards [self_mem_nhdsWithin] with y hy using Icc_mem_vitaliFamily_at_right hy
theorem tendsto_Icc_vitaliFamily_right (x : ℝ) :
    Tendsto (fun y => Icc x y) (𝓝[>] x) ((vitaliFamily (volume : Measure ℝ) 1).filterAt x) := by
  refine' (VitaliFamily.tendsto_filterAt_iff _).2 ⟨_, _⟩
  · filter_upwards [self_mem_nhdsWithin] with y hy using Icc_mem_vitaliFamily_at_right hy
  · 

Proof state:
case refine'_2
x : ℝ
⊢ ∀ ε > 0, ∀ᶠ (i : ℝ) in 𝓝[>] x, Icc x i ⊆ Metric.closedBall x ε

Next tactic:
intro ε εpos
theorem tendsto_Icc_vitaliFamily_right (x : ℝ) :
    Tendsto (fun y => Icc x y) (𝓝[>] x) ((vitaliFamily (volume : Measure ℝ) 1).filterAt x) := by
  refine' (VitaliFamily.tendsto_filterAt_iff _).2 ⟨_, _⟩
  · filter_upwards [self_mem_nhdsWithin] with y hy using Icc_mem_vitaliFamily_at_right hy
  · intro ε εpos
    

Proof state:
case refine'_2
x ε : ℝ
εpos : ε > 0
⊢ ∀ᶠ (i : ℝ) in 𝓝[>] x, Icc x i ⊆ Metric.closedBall x ε

Next tactic:
have : x ∈ Ico x (x + ε) := ⟨le_refl _, by linarith⟩
theorem tendsto_Icc_vitaliFamily_right (x : ℝ) :
    Tendsto (fun y => Icc x y) (𝓝[>] x) ((vitaliFamily (volume : Measure ℝ) 1).filterAt x) := by
  refine' (VitaliFamily.tendsto_filterAt_iff _).2 ⟨_, _⟩
  · filter_upwards [self_mem_nhdsWithin] with y hy using Icc_mem_vitaliFamily_at_right hy
  · intro ε εpos
    have : x ∈ Ico x (x + ε) := ⟨le_refl _, by 

Proof state:
x ε : ℝ
εpos : ε > 0
⊢ x < x + ε

Next tactic:
linarith
theorem tendsto_Icc_vitaliFamily_right (x : ℝ) :
    Tendsto (fun y => Icc x y) (𝓝[>] x) ((vitaliFamily (volume : Measure ℝ) 1).filterAt x) := by
  refine' (VitaliFamily.tendsto_filterAt_iff _).2 ⟨_, _⟩
  · filter_upwards [self_mem_nhdsWithin] with y hy using Icc_mem_vitaliFamily_at_right hy
  · intro ε εpos
    have : x ∈ Ico x (x + ε) := ⟨le_refl _, by linarith⟩
    

Proof state:
case refine'_2
x ε : ℝ
εpos : ε > 0
this : x ∈ Ico x (x + ε)
⊢ ∀ᶠ (i : ℝ) in 𝓝[>] x, Icc x i ⊆ Metric.closedBall x ε

Next tactic:
filter_upwards [Icc_mem_nhdsWithin_Ioi this] with y hy
theorem tendsto_Icc_vitaliFamily_right (x : ℝ) :
    Tendsto (fun y => Icc x y) (𝓝[>] x) ((vitaliFamily (volume : Measure ℝ) 1).filterAt x) := by
  refine' (VitaliFamily.tendsto_filterAt_iff _).2 ⟨_, _⟩
  · filter_upwards [self_mem_nhdsWithin] with y hy using Icc_mem_vitaliFamily_at_right hy
  · intro ε εpos
    have : x ∈ Ico x (x + ε) := ⟨le_refl _, by linarith⟩
    filter_upwards [Icc_mem_nhdsWithin_Ioi this] with y hy
    

Proof state:
case h
x ε : ℝ
εpos : ε > 0
this : x ∈ Ico x (x + ε)
y : ℝ
hy : y ∈ Icc x (x + ε)
⊢ Icc x y ⊆ Metric.closedBall x ε

Next tactic:
rw [closedBall_eq_Icc]
theorem tendsto_Icc_vitaliFamily_right (x : ℝ) :
    Tendsto (fun y => Icc x y) (𝓝[>] x) ((vitaliFamily (volume : Measure ℝ) 1).filterAt x) := by
  refine' (VitaliFamily.tendsto_filterAt_iff _).2 ⟨_, _⟩
  · filter_upwards [self_mem_nhdsWithin] with y hy using Icc_mem_vitaliFamily_at_right hy
  · intro ε εpos
    have : x ∈ Ico x (x + ε) := ⟨le_refl _, by linarith⟩
    filter_upwards [Icc_mem_nhdsWithin_Ioi this] with y hy
    rw [closedBall_eq_Icc]
    

Proof state:
case h
x ε : ℝ
εpos : ε > 0
this : x ∈ Ico x (x + ε)
y : ℝ
hy : y ∈ Icc x (x + ε)
⊢ Icc x y ⊆ Icc (x - ε) (x + ε)

Next tactic:
exact Icc_subset_Icc (by linarith) hy.2
theorem tendsto_Icc_vitaliFamily_right (x : ℝ) :
    Tendsto (fun y => Icc x y) (𝓝[>] x) ((vitaliFamily (volume : Measure ℝ) 1).filterAt x) := by
  refine' (VitaliFamily.tendsto_filterAt_iff _).2 ⟨_, _⟩
  · filter_upwards [self_mem_nhdsWithin] with y hy using Icc_mem_vitaliFamily_at_right hy
  · intro ε εpos
    have : x ∈ Ico x (x + ε) := ⟨le_refl _, by linarith⟩
    filter_upwards [Icc_mem_nhdsWithin_Ioi this] with y hy
    rw [closedBall_eq_Icc]
    exact Icc_subset_Icc (by 

Proof state:
x ε : ℝ
εpos : ε > 0
this : x ∈ Ico x (x + ε)
y : ℝ
hy : y ∈ Icc x (x + ε)
⊢ x - ε ≤ x

Next tactic:
linarith
theorem Icc_mem_vitaliFamily_at_left {x y : ℝ} (hxy : x < y) :
    Icc x y ∈ (vitaliFamily (volume : Measure ℝ) 1).setsAt y := by
  

Proof state:
x y : ℝ
hxy : x < y
⊢ Icc x y ∈ VitaliFamily.setsAt (vitaliFamily volume 1) y

Next tactic:
rw [Icc_eq_closedBall]
theorem Icc_mem_vitaliFamily_at_left {x y : ℝ} (hxy : x < y) :
    Icc x y ∈ (vitaliFamily (volume : Measure ℝ) 1).setsAt y := by
  rw [Icc_eq_closedBall]
  

Proof state:
x y : ℝ
hxy : x < y
⊢ Metric.closedBall ((x + y) / 2) ((y - x) / 2) ∈ VitaliFamily.setsAt (vitaliFamily volume 1) y

Next tactic:
refine' closedBall_mem_vitaliFamily_of_dist_le_mul _ _ (by linarith)
theorem Icc_mem_vitaliFamily_at_left {x y : ℝ} (hxy : x < y) :
    Icc x y ∈ (vitaliFamily (volume : Measure ℝ) 1).setsAt y := by
  rw [Icc_eq_closedBall]
  refine' closedBall_mem_vitaliFamily_of_dist_le_mul _ _ (by 

Proof state:
x y : ℝ
hxy : x < y
⊢ 0 < (y - x) / 2

Next tactic:
linarith
theorem Icc_mem_vitaliFamily_at_left {x y : ℝ} (hxy : x < y) :
    Icc x y ∈ (vitaliFamily (volume : Measure ℝ) 1).setsAt y := by
  rw [Icc_eq_closedBall]
  refine' closedBall_mem_vitaliFamily_of_dist_le_mul _ _ (by linarith)
  

Proof state:
x y : ℝ
hxy : x < y
⊢ dist y ((x + y) / 2) ≤ 1 * ((y - x) / 2)

Next tactic:
rw [Real.dist_eq, abs_of_nonneg]
theorem Icc_mem_vitaliFamily_at_left {x y : ℝ} (hxy : x < y) :
    Icc x y ∈ (vitaliFamily (volume : Measure ℝ) 1).setsAt y := by
  rw [Icc_eq_closedBall]
  refine' closedBall_mem_vitaliFamily_of_dist_le_mul _ _ (by linarith)
  rw [Real.dist_eq, abs_of_nonneg] <;> 

Proof state:
x y : ℝ
hxy : x < y
⊢ y - (x + y) / 2 ≤ 1 * ((y - x) / 2)

Next tactic:
linarith
theorem Icc_mem_vitaliFamily_at_left {x y : ℝ} (hxy : x < y) :
    Icc x y ∈ (vitaliFamily (volume : Measure ℝ) 1).setsAt y := by
  rw [Icc_eq_closedBall]
  refine' closedBall_mem_vitaliFamily_of_dist_le_mul _ _ (by linarith)
  rw [Real.dist_eq, abs_of_nonneg] <;> 

Proof state:
x y : ℝ
hxy : x < y
⊢ 0 ≤ y - (x + y) / 2

Next tactic:
linarith
theorem tendsto_Icc_vitaliFamily_left (x : ℝ) :
    Tendsto (fun y => Icc y x) (𝓝[<] x) ((vitaliFamily (volume : Measure ℝ) 1).filterAt x) := by
  

Proof state:
x : ℝ
⊢ Tendsto (fun y => Icc y x) (𝓝[<] x) (VitaliFamily.filterAt (vitaliFamily volume 1) x)

Next tactic:
refine' (VitaliFamily.tendsto_filterAt_iff _).2 ⟨_, _⟩
theorem tendsto_Icc_vitaliFamily_left (x : ℝ) :
    Tendsto (fun y => Icc y x) (𝓝[<] x) ((vitaliFamily (volume : Measure ℝ) 1).filterAt x) := by
  refine' (VitaliFamily.tendsto_filterAt_iff _).2 ⟨_, _⟩
  · 

Proof state:
case refine'_1
x : ℝ
⊢ ∀ᶠ (i : ℝ) in 𝓝[<] x, Icc i x ∈ VitaliFamily.setsAt (vitaliFamily volume 1) x

Next tactic:
filter_upwards [self_mem_nhdsWithin] with y hy using Icc_mem_vitaliFamily_at_left hy
theorem tendsto_Icc_vitaliFamily_left (x : ℝ) :
    Tendsto (fun y => Icc y x) (𝓝[<] x) ((vitaliFamily (volume : Measure ℝ) 1).filterAt x) := by
  refine' (VitaliFamily.tendsto_filterAt_iff _).2 ⟨_, _⟩
  · filter_upwards [self_mem_nhdsWithin] with y hy using Icc_mem_vitaliFamily_at_left hy
  · 

Proof state:
case refine'_2
x : ℝ
⊢ ∀ ε > 0, ∀ᶠ (i : ℝ) in 𝓝[<] x, Icc i x ⊆ Metric.closedBall x ε

Next tactic:
intro ε εpos
theorem tendsto_Icc_vitaliFamily_left (x : ℝ) :
    Tendsto (fun y => Icc y x) (𝓝[<] x) ((vitaliFamily (volume : Measure ℝ) 1).filterAt x) := by
  refine' (VitaliFamily.tendsto_filterAt_iff _).2 ⟨_, _⟩
  · filter_upwards [self_mem_nhdsWithin] with y hy using Icc_mem_vitaliFamily_at_left hy
  · intro ε εpos
    

Proof state:
case refine'_2
x ε : ℝ
εpos : ε > 0
⊢ ∀ᶠ (i : ℝ) in 𝓝[<] x, Icc i x ⊆ Metric.closedBall x ε

Next tactic:
have : x ∈ Ioc (x - ε) x := ⟨by linarith, le_refl _⟩
theorem tendsto_Icc_vitaliFamily_left (x : ℝ) :
    Tendsto (fun y => Icc y x) (𝓝[<] x) ((vitaliFamily (volume : Measure ℝ) 1).filterAt x) := by
  refine' (VitaliFamily.tendsto_filterAt_iff _).2 ⟨_, _⟩
  · filter_upwards [self_mem_nhdsWithin] with y hy using Icc_mem_vitaliFamily_at_left hy
  · intro ε εpos
    have : x ∈ Ioc (x - ε) x := ⟨by 

Proof state:
x ε : ℝ
εpos : ε > 0
⊢ x - ε < x

Next tactic:
linarith
theorem tendsto_Icc_vitaliFamily_left (x : ℝ) :
    Tendsto (fun y => Icc y x) (𝓝[<] x) ((vitaliFamily (volume : Measure ℝ) 1).filterAt x) := by
  refine' (VitaliFamily.tendsto_filterAt_iff _).2 ⟨_, _⟩
  · filter_upwards [self_mem_nhdsWithin] with y hy using Icc_mem_vitaliFamily_at_left hy
  · intro ε εpos
    have : x ∈ Ioc (x - ε) x := ⟨by linarith, le_refl _⟩
    

Proof state:
case refine'_2
x ε : ℝ
εpos : ε > 0
this : x ∈ Ioc (x - ε) x
⊢ ∀ᶠ (i : ℝ) in 𝓝[<] x, Icc i x ⊆ Metric.closedBall x ε

Next tactic:
filter_upwards [Icc_mem_nhdsWithin_Iio this] with y hy
theorem tendsto_Icc_vitaliFamily_left (x : ℝ) :
    Tendsto (fun y => Icc y x) (𝓝[<] x) ((vitaliFamily (volume : Measure ℝ) 1).filterAt x) := by
  refine' (VitaliFamily.tendsto_filterAt_iff _).2 ⟨_, _⟩
  · filter_upwards [self_mem_nhdsWithin] with y hy using Icc_mem_vitaliFamily_at_left hy
  · intro ε εpos
    have : x ∈ Ioc (x - ε) x := ⟨by linarith, le_refl _⟩
    filter_upwards [Icc_mem_nhdsWithin_Iio this] with y hy
    

Proof state:
case h
x ε : ℝ
εpos : ε > 0
this : x ∈ Ioc (x - ε) x
y : ℝ
hy : y ∈ Icc (x - ε) x
⊢ Icc y x ⊆ Metric.closedBall x ε

Next tactic:
rw [closedBall_eq_Icc]
theorem tendsto_Icc_vitaliFamily_left (x : ℝ) :
    Tendsto (fun y => Icc y x) (𝓝[<] x) ((vitaliFamily (volume : Measure ℝ) 1).filterAt x) := by
  refine' (VitaliFamily.tendsto_filterAt_iff _).2 ⟨_, _⟩
  · filter_upwards [self_mem_nhdsWithin] with y hy using Icc_mem_vitaliFamily_at_left hy
  · intro ε εpos
    have : x ∈ Ioc (x - ε) x := ⟨by linarith, le_refl _⟩
    filter_upwards [Icc_mem_nhdsWithin_Iio this] with y hy
    rw [closedBall_eq_Icc]
    

Proof state:
case h
x ε : ℝ
εpos : ε > 0
this : x ∈ Ioc (x - ε) x
y : ℝ
hy : y ∈ Icc (x - ε) x
⊢ Icc y x ⊆ Icc (x - ε) (x + ε)

Next tactic:
exact Icc_subset_Icc hy.1 (by linarith)
theorem tendsto_Icc_vitaliFamily_left (x : ℝ) :
    Tendsto (fun y => Icc y x) (𝓝[<] x) ((vitaliFamily (volume : Measure ℝ) 1).filterAt x) := by
  refine' (VitaliFamily.tendsto_filterAt_iff _).2 ⟨_, _⟩
  · filter_upwards [self_mem_nhdsWithin] with y hy using Icc_mem_vitaliFamily_at_left hy
  · intro ε εpos
    have : x ∈ Ioc (x - ε) x := ⟨by linarith, le_refl _⟩
    filter_upwards [Icc_mem_nhdsWithin_Iio this] with y hy
    rw [closedBall_eq_Icc]
    exact Icc_subset_Icc hy.1 (by 

Proof state:
x ε : ℝ
εpos : ε > 0
this : x ∈ Ioc (x - ε) x
y : ℝ
hy : y ∈ Icc (x - ε) x
⊢ x ≤ x + ε

Next tactic:
linarith
theorem integralClosure.mem_lifts_of_monic_of_dvd_map {f : R[X]} (hf : f.Monic) {g : K[X]}
    (hg : g.Monic) (hd : g ∣ f.map (algebraMap R K)) :
    g ∈ lifts (algebraMap (integralClosure R K) K) := by
  

Proof state:
R : Type u_1
inst✝² : CommRing R
K : Type u_2
inst✝¹ : Field K
inst✝ : Algebra R K
f : R[X]
hf : Monic f
g : K[X]
hg : Monic g
hd : g ∣ map (algebraMap R K) f
⊢ g ∈ lifts (algebraMap (↥(integralClosure R K)) K)

Next tactic:
have := mem_lift_of_splits_of_roots_mem_range (integralClosure R g.SplittingField)
    ((splits_id_iff_splits _).2 <| SplittingField.splits g) (hg.map _) fun a ha =>
      (SetLike.ext_iff.mp (integralClosure R g.SplittingField).range_algebraMap _).mpr <|
        roots_mem_integralClosure hf ?_
theorem integralClosure.mem_lifts_of_monic_of_dvd_map {f : R[X]} (hf : f.Monic) {g : K[X]}
    (hg : g.Monic) (hd : g ∣ f.map (algebraMap R K)) :
    g ∈ lifts (algebraMap (integralClosure R K) K) := by
  have := mem_lift_of_splits_of_roots_mem_range (integralClosure R g.SplittingField)
    ((splits_id_iff_splits _).2 <| SplittingField.splits g) (hg.map _) fun a ha =>
      (SetLike.ext_iff.mp (integralClosure R g.SplittingField).range_algebraMap _).mpr <|
        roots_mem_integralClosure hf ?_
  · 

Proof state:
case refine_2
R : Type u_1
inst✝² : CommRing R
K : Type u_2
inst✝¹ : Field K
inst✝ : Algebra R K
f : R[X]
hf : Monic f
g : K[X]
hg : Monic g
hd : g ∣ map (algebraMap R K) f
this :
  map (algebraMap K (SplittingField g)) g ∈
    lifts (algebraMap (↥(integralClosure R (SplittingField g))) (SplittingField g))
⊢ g ∈ lifts (algebraMap (↥(integralClosure R K)) K)

Next tactic:
rw [lifts_iff_coeff_lifts, ← RingHom.coe_range, Subalgebra.range_algebraMap] at this