l3lab/ntp-mathlib huggingface dataset:
@[nolint unusedArguments]
protected theorem comp_traverse (f : β → F γ) (g : α → G β) (x : Vector α n) :
    Vector.traverse (Comp.mk ∘ Functor.map f ∘ g) x =
      Comp.mk (Vector.traverse f <$> Vector.traverse g x) := by
  induction' x using Vector.inductionOn with n x xs ih
  simp! [cast, *, functor_norm]
  · 

Proof state:
case h_nil
n : ℕ
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α β γ : Type u
f : β → F γ
g : α → G β
⊢ pure nil = Comp.mk (pure (pure nil))

Next tactic:
rfl
@[nolint unusedArguments]
protected theorem comp_traverse (f : β → F γ) (g : α → G β) (x : Vector α n) :
    Vector.traverse (Comp.mk ∘ Functor.map f ∘ g) x =
      Comp.mk (Vector.traverse f <$> Vector.traverse g x) := by
  induction' x using Vector.inductionOn with n x xs ih
  simp! [cast, *, functor_norm]
  · rfl
  · 

Proof state:
case h_cons
n✝ : ℕ
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α β γ : Type u
f : β → F γ
g : α → G β
n : ℕ
x : α
xs : Vector α n
ih : Vector.traverse (Comp.mk ∘ Functor.map f ∘ g) xs = Comp.mk (Vector.traverse f <$> Vector.traverse g xs)
⊢ Vector.traverse (Comp.mk ∘ Functor.map f ∘ g) (x ::ᵥ xs) =
    Comp.mk (Vector.traverse f <$> Vector.traverse g (x ::ᵥ xs))

Next tactic:
rw [Vector.traverse_def, ih]
@[nolint unusedArguments]
protected theorem comp_traverse (f : β → F γ) (g : α → G β) (x : Vector α n) :
    Vector.traverse (Comp.mk ∘ Functor.map f ∘ g) x =
      Comp.mk (Vector.traverse f <$> Vector.traverse g x) := by
  induction' x using Vector.inductionOn with n x xs ih
  simp! [cast, *, functor_norm]
  · rfl
  · rw [Vector.traverse_def, ih]
    

Proof state:
case h_cons
n✝ : ℕ
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α β γ : Type u
f : β → F γ
g : α → G β
n : ℕ
x : α
xs : Vector α n
ih : Vector.traverse (Comp.mk ∘ Functor.map f ∘ g) xs = Comp.mk (Vector.traverse f <$> Vector.traverse g xs)
⊢ (Seq.seq (cons <$> (Comp.mk ∘ Functor.map f ∘ g) x) fun x => Comp.mk (Vector.traverse f <$> Vector.traverse g xs)) =
    Comp.mk (Vector.traverse f <$> Vector.traverse g (x ::ᵥ xs))

Next tactic:
simp [functor_norm, (· ∘ ·)]
protected theorem traverse_eq_map_id {α β} (f : α → β) :
    ∀ x : Vector α n, x.traverse ((pure: _ → Id _) ∘ f) = (pure: _ → Id _) (map f x) := by
  

Proof state:
n : ℕ
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α✝ β✝ γ : Type u
α β : Type u_1
f : α → β
⊢ ∀ (x : Vector α n), Vector.traverse (pure ∘ f) x = pure (map f x)

Next tactic:
rintro ⟨x, rfl⟩
protected theorem traverse_eq_map_id {α β} (f : α → β) :
    ∀ x : Vector α n, x.traverse ((pure: _ → Id _) ∘ f) = (pure: _ → Id _) (map f x) := by
  rintro ⟨x, rfl⟩; 

Proof state:
case mk
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α✝ β✝ γ : Type u
α β : Type u_1
f : α → β
x : List α
⊢ Vector.traverse (pure ∘ f) { val := x, property := (_ : List.length x = List.length x) } =
    pure (map f { val := x, property := (_ : List.length x = List.length x) })

Next tactic:
simp!
protected theorem traverse_eq_map_id {α β} (f : α → β) :
    ∀ x : Vector α n, x.traverse ((pure: _ → Id _) ∘ f) = (pure: _ → Id _) (map f x) := by
  rintro ⟨x, rfl⟩; simp!; 

Proof state:
case mk
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α✝ β✝ γ : Type u
α β : Type u_1
f : α → β
x : List α
⊢ Vector.traverseAux (pure ∘ f) x =
    { val := List.map f x, property := (_ : List.length (List.map f x) = List.length x) }

Next tactic:
induction x
protected theorem traverse_eq_map_id {α β} (f : α → β) :
    ∀ x : Vector α n, x.traverse ((pure: _ → Id _) ∘ f) = (pure: _ → Id _) (map f x) := by
  rintro ⟨x, rfl⟩; simp!; induction x <;> 

Proof state:
case mk.nil
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α✝ β✝ γ : Type u
α β : Type u_1
f : α → β
⊢ Vector.traverseAux (pure ∘ f) [] =
    { val := List.map f [], property := (_ : List.length (List.map f []) = List.length []) }

Next tactic:
simp! [*, functor_norm]
protected theorem traverse_eq_map_id {α β} (f : α → β) :
    ∀ x : Vector α n, x.traverse ((pure: _ → Id _) ∘ f) = (pure: _ → Id _) (map f x) := by
  rintro ⟨x, rfl⟩; simp!; induction x <;> 

Proof state:
case mk.cons
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α✝ β✝ γ : Type u
α β : Type u_1
f : α → β
head✝ : α
tail✝ : List α
tail_ih✝ :
  Vector.traverseAux (pure ∘ f) tail✝ =
    { val := List.map f tail✝, property := (_ : List.length (List.map f tail✝) = List.length tail✝) }
⊢ Vector.traverseAux (pure ∘ f) (head✝ :: tail✝) =
    { val := List.map f (head✝ :: tail✝),
      property := (_ : List.length (List.map f (head✝ :: tail✝)) = List.length (head✝ :: tail✝)) }

Next tactic:
simp! [*, functor_norm]
protected theorem traverse_eq_map_id {α β} (f : α → β) :
    ∀ x : Vector α n, x.traverse ((pure: _ → Id _) ∘ f) = (pure: _ → Id _) (map f x) := by
  rintro ⟨x, rfl⟩; simp!; induction x <;> simp! [*, functor_norm] <;> 

Proof state:
case mk.nil
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α✝ β✝ γ : Type u
α β : Type u_1
f : α → β
⊢ nil = { val := [], property := (_ : (fun l => List.length l = List.length []) []) }

Next tactic:
rfl
protected theorem traverse_eq_map_id {α β} (f : α → β) :
    ∀ x : Vector α n, x.traverse ((pure: _ → Id _) ∘ f) = (pure: _ → Id _) (map f x) := by
  rintro ⟨x, rfl⟩; simp!; induction x <;> simp! [*, functor_norm] <;> 

Proof state:
case mk.cons
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α✝ β✝ γ : Type u
α β : Type u_1
f : α → β
head✝ : α
tail✝ : List α
tail_ih✝ :
  Vector.traverseAux (pure ∘ f) tail✝ =
    { val := List.map f tail✝, property := (_ : List.length (List.map f tail✝) = List.length tail✝) }
⊢ (Seq.seq (cons (f head✝)) fun x =>
      { val := List.map f tail✝, property := (_ : List.length (List.map f tail✝) = List.length tail✝) }) =
    { val := f head✝ :: List.map f tail✝,
      property := (_ : (fun l => List.length l = List.length (head✝ :: tail✝)) (f head✝ :: List.map f tail✝)) }

Next tactic:
rfl
protected theorem naturality {α β : Type u} (f : α → F β) (x : Vector α n) :
    η (x.traverse f) = x.traverse (@η _ ∘ f) := by
  

Proof state:
n : ℕ
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α✝ β✝ γ : Type u
η : ApplicativeTransformation F G
α β : Type u
f : α → F β
x : Vector α n
⊢ (fun {α} => ApplicativeTransformation.app η α) (Vector.traverse f x) =
    Vector.traverse ((fun {α} => ApplicativeTransformation.app η α) ∘ f) x

Next tactic:
induction' x using Vector.inductionOn with n x xs ih
protected theorem naturality {α β : Type u} (f : α → F β) (x : Vector α n) :
    η (x.traverse f) = x.traverse (@η _ ∘ f) := by
  induction' x using Vector.inductionOn with n x xs ih
  · 

Proof state:
case h_nil
n : ℕ
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α✝ β✝ γ : Type u
η : ApplicativeTransformation F G
α β : Type u
f : α → F β
⊢ (fun {α} => ApplicativeTransformation.app η α) (Vector.traverse f nil) =
    Vector.traverse ((fun {α} => ApplicativeTransformation.app η α) ∘ f) nil

Next tactic:
simp! [functor_norm, cast, η.preserves_pure]
protected theorem naturality {α β : Type u} (f : α → F β) (x : Vector α n) :
    η (x.traverse f) = x.traverse (@η _ ∘ f) := by
  induction' x using Vector.inductionOn with n x xs ih
  · simp! [functor_norm, cast, η.preserves_pure]
  · 

Proof state:
case h_cons
n✝ : ℕ
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α✝ β✝ γ : Type u
η : ApplicativeTransformation F G
α β : Type u
f : α → F β
n : ℕ
x : α
xs : Vector α n
ih :
  (fun {α} => ApplicativeTransformation.app η α) (Vector.traverse f xs) =
    Vector.traverse ((fun {α} => ApplicativeTransformation.app η α) ∘ f) xs
⊢ (fun {α} => ApplicativeTransformation.app η α) (Vector.traverse f (x ::ᵥ xs)) =
    Vector.traverse ((fun {α} => ApplicativeTransformation.app η α) ∘ f) (x ::ᵥ xs)

Next tactic:
rw [Vector.traverse_def, Vector.traverse_def, ← ih, η.preserves_seq, η.preserves_map]
protected theorem naturality {α β : Type u} (f : α → F β) (x : Vector α n) :
    η (x.traverse f) = x.traverse (@η _ ∘ f) := by
  induction' x using Vector.inductionOn with n x xs ih
  · simp! [functor_norm, cast, η.preserves_pure]
  · rw [Vector.traverse_def, Vector.traverse_def, ← ih, η.preserves_seq, η.preserves_map]
    

Proof state:
case h_cons
n✝ : ℕ
F G : Type u → Type u
inst✝³ : Applicative F
inst✝² : Applicative G
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α✝ β✝ γ : Type u
η : ApplicativeTransformation F G
α β : Type u
f : α → F β
n : ℕ
x : α
xs : Vector α n
ih :
  (fun {α} => ApplicativeTransformation.app η α) (Vector.traverse f xs) =
    Vector.traverse ((fun {α} => ApplicativeTransformation.app η α) ∘ f) xs
⊢ (Seq.seq (cons <$> (fun {α} => ApplicativeTransformation.app η α) (f x)) fun x =>
      (fun {α} => ApplicativeTransformation.app η α) (Vector.traverse f xs)) =
    Seq.seq (cons <$> ((fun {α} => ApplicativeTransformation.app η α) ∘ f) x) fun x =>
      (fun {α} => ApplicativeTransformation.app η α) (Vector.traverse f xs)

Next tactic:
rfl
instance : LawfulTraversable.{u} (flip Vector n) where
  id_traverse := @Vector.id_traverse n
  comp_traverse := Vector.comp_traverse
  traverse_eq_map_id := @Vector.traverse_eq_map_id n
  naturality := Vector.naturality
  id_map := by 

Proof state:
n : ℕ
⊢ ∀ {α : Type u} (x : flip Vector n α), id <$> x = x

Next tactic:
intro _ x
instance : LawfulTraversable.{u} (flip Vector n) where
  id_traverse := @Vector.id_traverse n
  comp_traverse := Vector.comp_traverse
  traverse_eq_map_id := @Vector.traverse_eq_map_id n
  naturality := Vector.naturality
  id_map := by intro _ x; 

Proof state:
n : ℕ
α✝ : Type u
x : flip Vector n α✝
⊢ id <$> x = x

Next tactic:
cases x
instance : LawfulTraversable.{u} (flip Vector n) where
  id_traverse := @Vector.id_traverse n
  comp_traverse := Vector.comp_traverse
  traverse_eq_map_id := @Vector.traverse_eq_map_id n
  naturality := Vector.naturality
  id_map := by intro _ x; cases x; 

Proof state:
case mk
n : ℕ
α✝ : Type u
val✝ : List α✝
property✝ : List.length val✝ = n
⊢ id <$> { val := val✝, property := property✝ } = { val := val✝, property := property✝ }

Next tactic:
simp! [(· <$> ·)]
instance : LawfulTraversable.{u} (flip Vector n) where
  id_traverse := @Vector.id_traverse n
  comp_traverse := Vector.comp_traverse
  traverse_eq_map_id := @Vector.traverse_eq_map_id n
  naturality := Vector.naturality
  id_map := by intro _ x; cases x; simp! [(· <$> ·)]
  comp_map := by 

Proof state:
n : ℕ
⊢ ∀ {α β γ : Type u} (g : α → β) (h : β → γ) (x : flip Vector n α), (h ∘ g) <$> x = h <$> g <$> x

Next tactic:
intro _ _ _ _ _ x
instance : LawfulTraversable.{u} (flip Vector n) where
  id_traverse := @Vector.id_traverse n
  comp_traverse := Vector.comp_traverse
  traverse_eq_map_id := @Vector.traverse_eq_map_id n
  naturality := Vector.naturality
  id_map := by intro _ x; cases x; simp! [(· <$> ·)]
  comp_map := by intro _ _ _ _ _ x; 

Proof state:
n : ℕ
α✝ β✝ γ✝ : Type u
g✝ : α✝ → β✝
h✝ : β✝ → γ✝
x : flip Vector n α✝
⊢ (h✝ ∘ g✝) <$> x = h✝ <$> g✝ <$> x

Next tactic:
cases x
instance : LawfulTraversable.{u} (flip Vector n) where
  id_traverse := @Vector.id_traverse n
  comp_traverse := Vector.comp_traverse
  traverse_eq_map_id := @Vector.traverse_eq_map_id n
  naturality := Vector.naturality
  id_map := by intro _ x; cases x; simp! [(· <$> ·)]
  comp_map := by intro _ _ _ _ _ x; cases x; 

Proof state:
case mk
n : ℕ
α✝ β✝ γ✝ : Type u
g✝ : α✝ → β✝
h✝ : β✝ → γ✝
val✝ : List α✝
property✝ : List.length val✝ = n
⊢ (h✝ ∘ g✝) <$> { val := val✝, property := property✝ } = h✝ <$> g✝ <$> { val := val✝, property := property✝ }

Next tactic:
simp! [(· <$> ·)]
@[simp]
theorem get_append_cons_zero : get (append (x ::ᵥ xs) ys) ⟨0, by 

Proof state:
α : Type ?u.85494
m n : ℕ
xs : Vector α n
ys : Vector α m
x : α
⊢ 0 < Nat.succ n + m

Next tactic:
simp
@[simp]
theorem append_nil : append xs nil = xs := by
  

Proof state:
α : Type u_1
m n : ℕ
xs : Vector α n
ys : Vector α m
⊢ append xs nil = xs

Next tactic:
cases xs
@[simp]
theorem append_nil : append xs nil = xs := by
  cases xs; 

Proof state:
case mk
α : Type u_1
m n : ℕ
ys : Vector α m
val✝ : List α
property✝ : List.length val✝ = n
⊢ append { val := val✝, property := property✝ } nil = { val := val✝, property := property✝ }

Next tactic:
simp [append]
@[simp]
theorem get_map₂ (v₁ : Vector α n) (v₂ : Vector β n) (f : α → β → γ) (i : Fin n) :
    get (map₂ f v₁ v₂) i = f (get v₁ i) (get v₂ i) := by
  

Proof state:
α : Type u_2
β : Type u_3
n : ℕ
xs : Vector α n
ys : Vector β n
γ : Type u_1
v₁ : Vector α n
v₂ : Vector β n
f : α → β → γ
i : Fin n
⊢ get (map₂ f v₁ v₂) i = f (get v₁ i) (get v₂ i)

Next tactic:
clear * - v₁ v₂
@[simp]
theorem get_map₂ (v₁ : Vector α n) (v₂ : Vector β n) (f : α → β → γ) (i : Fin n) :
    get (map₂ f v₁ v₂) i = f (get v₁ i) (get v₂ i) := by
  clear * - v₁ v₂
  

Proof state:
α : Type u_2
β : Type u_3
n : ℕ
γ : Type u_1
v₁ : Vector α n
v₂ : Vector β n
f : α → β → γ
i : Fin n
⊢ get (map₂ f v₁ v₂) i = f (get v₁ i) (get v₂ i)

Next tactic:
induction v₁, v₂ using inductionOn₂
@[simp]
theorem get_map₂ (v₁ : Vector α n) (v₂ : Vector β n) (f : α → β → γ) (i : Fin n) :
    get (map₂ f v₁ v₂) i = f (get v₁ i) (get v₂ i) := by
  clear * - v₁ v₂
  induction v₁, v₂ using inductionOn₂
  

Proof state:
case nil
α : Type u_2
β : Type u_3
n : ℕ
γ : Type u_1
f : α → β → γ
i : Fin 0
⊢ get (map₂ f nil nil) i = f (get nil i) (get nil i)
case cons
α : Type u_2
β : Type u_3
n : ℕ
γ : Type u_1
f : α → β → γ
n✝ : ℕ
a✝¹ : α
b✝ : β
x✝ : Vector α n✝
y✝ : Vector β n✝
a✝ : ∀ (i : Fin n✝), get (map₂ f x✝ y✝) i = f (get x✝ i) (get y✝ i)
i : Fin (Nat.succ n✝)
⊢ get (map₂ f (a✝¹ ::ᵥ x✝) (b✝ ::ᵥ y✝)) i = f (get (a✝¹ ::ᵥ x✝) i) (get (b✝ ::ᵥ y✝) i)

Next tactic:
case nil =>
    exact Fin.elim0 i
@[simp]
theorem get_map₂ (v₁ : Vector α n) (v₂ : Vector β n) (f : α → β → γ) (i : Fin n) :
    get (map₂ f v₁ v₂) i = f (get v₁ i) (get v₂ i) := by
  clear * - v₁ v₂
  induction v₁, v₂ using inductionOn₂
  

Proof state:
α : Type u_2
β : Type u_3
n : ℕ
γ : Type u_1
f : α → β → γ
i : Fin 0
⊢ get (map₂ f nil nil) i = f (get nil i) (get nil i)

Next tactic:
case nil =>
    exact Fin.elim0 i
@[simp]
theorem get_map₂ (v₁ : Vector α n) (v₂ : Vector β n) (f : α → β → γ) (i : Fin n) :
    get (map₂ f v₁ v₂) i = f (get v₁ i) (get v₂ i) := by
  clear * - v₁ v₂
  induction v₁, v₂ using inductionOn₂
  case nil =>
    

Proof state:
α : Type u_2
β : Type u_3
n : ℕ
γ : Type u_1
f : α → β → γ
i : Fin 0
⊢ get (map₂ f nil nil) i = f (get nil i) (get nil i)

Next tactic:
exact Fin.elim0 i
@[simp]
theorem get_map₂ (v₁ : Vector α n) (v₂ : Vector β n) (f : α → β → γ) (i : Fin n) :
    get (map₂ f v₁ v₂) i = f (get v₁ i) (get v₂ i) := by
  clear * - v₁ v₂
  induction v₁, v₂ using inductionOn₂
  case nil =>
    exact Fin.elim0 i
  

Proof state:
case cons
α : Type u_2
β : Type u_3
n : ℕ
γ : Type u_1
f : α → β → γ
n✝ : ℕ
a✝¹ : α
b✝ : β
x✝ : Vector α n✝
y✝ : Vector β n✝
a✝ : ∀ (i : Fin n✝), get (map₂ f x✝ y✝) i = f (get x✝ i) (get y✝ i)
i : Fin (Nat.succ n✝)
⊢ get (map₂ f (a✝¹ ::ᵥ x✝) (b✝ ::ᵥ y✝)) i = f (get (a✝¹ ::ᵥ x✝) i) (get (b✝ ::ᵥ y✝) i)

Next tactic:
case cons x xs y ys ih =>
    rw [map₂_cons]
    cases i using Fin.cases
    · simp only [get_zero, head_cons]
    · simp only [get_cons_succ, ih]
@[simp]
theorem get_map₂ (v₁ : Vector α n) (v₂ : Vector β n) (f : α → β → γ) (i : Fin n) :
    get (map₂ f v₁ v₂) i = f (get v₁ i) (get v₂ i) := by
  clear * - v₁ v₂
  induction v₁, v₂ using inductionOn₂
  case nil =>
    exact Fin.elim0 i
  

Proof state:
α : Type u_2
β : Type u_3
n : ℕ
γ : Type u_1
f : α → β → γ
n✝ : ℕ
x : α
xs : β
y : Vector α n✝
ys : Vector β n✝
ih : ∀ (i : Fin n✝), get (map₂ f y ys) i = f (get y i) (get ys i)
i : Fin (Nat.succ n✝)
⊢ get (map₂ f (x ::ᵥ y) (xs ::ᵥ ys)) i = f (get (x ::ᵥ y) i) (get (xs ::ᵥ ys) i)

Next tactic:
case cons x xs y ys ih =>
    rw [map₂_cons]
    cases i using Fin.cases
    · simp only [get_zero, head_cons]
    · simp only [get_cons_succ, ih]
@[simp]
theorem get_map₂ (v₁ : Vector α n) (v₂ : Vector β n) (f : α → β → γ) (i : Fin n) :
    get (map₂ f v₁ v₂) i = f (get v₁ i) (get v₂ i) := by
  clear * - v₁ v₂
  induction v₁, v₂ using inductionOn₂
  case nil =>
    exact Fin.elim0 i
  case cons x xs y ys ih =>
    

Proof state:
α : Type u_2
β : Type u_3
n : ℕ
γ : Type u_1
f : α → β → γ
n✝ : ℕ
x : α
xs : β
y : Vector α n✝
ys : Vector β n✝
ih : ∀ (i : Fin n✝), get (map₂ f y ys) i = f (get y i) (get ys i)
i : Fin (Nat.succ n✝)
⊢ get (map₂ f (x ::ᵥ y) (xs ::ᵥ ys)) i = f (get (x ::ᵥ y) i) (get (xs ::ᵥ ys) i)

Next tactic:
rw [map₂_cons]
@[simp]
theorem get_map₂ (v₁ : Vector α n) (v₂ : Vector β n) (f : α → β → γ) (i : Fin n) :
    get (map₂ f v₁ v₂) i = f (get v₁ i) (get v₂ i) := by
  clear * - v₁ v₂
  induction v₁, v₂ using inductionOn₂
  case nil =>
    exact Fin.elim0 i
  case cons x xs y ys ih =>
    rw [map₂_cons]
    

Proof state:
α : Type u_2
β : Type u_3
n : ℕ
γ : Type u_1
f : α → β → γ
n✝ : ℕ
x : α
xs : β
y : Vector α n✝
ys : Vector β n✝
ih : ∀ (i : Fin n✝), get (map₂ f y ys) i = f (get y i) (get ys i)
i : Fin (Nat.succ n✝)
⊢ get (f x xs ::ᵥ map₂ f y ys) i = f (get (x ::ᵥ y) i) (get (xs ::ᵥ ys) i)

Next tactic:
cases i using Fin.cases
@[simp]
theorem get_map₂ (v₁ : Vector α n) (v₂ : Vector β n) (f : α → β → γ) (i : Fin n) :
    get (map₂ f v₁ v₂) i = f (get v₁ i) (get v₂ i) := by
  clear * - v₁ v₂
  induction v₁, v₂ using inductionOn₂
  case nil =>
    exact Fin.elim0 i
  case cons x xs y ys ih =>
    rw [map₂_cons]
    cases i using Fin.cases
    · 

Proof state:
case zero
α : Type u_2
β : Type u_3
n : ℕ
γ : Type u_1
f : α → β → γ
n✝ : ℕ
x : α
xs : β
y : Vector α n✝
ys : Vector β n✝
ih : ∀ (i : Fin n✝), get (map₂ f y ys) i = f (get y i) (get ys i)
⊢ get (f x xs ::ᵥ map₂ f y ys) 0 = f (get (x ::ᵥ y) 0) (get (xs ::ᵥ ys) 0)

Next tactic:
simp only [get_zero, head_cons]
@[simp]
theorem get_map₂ (v₁ : Vector α n) (v₂ : Vector β n) (f : α → β → γ) (i : Fin n) :
    get (map₂ f v₁ v₂) i = f (get v₁ i) (get v₂ i) := by
  clear * - v₁ v₂
  induction v₁, v₂ using inductionOn₂
  case nil =>
    exact Fin.elim0 i
  case cons x xs y ys ih =>
    rw [map₂_cons]
    cases i using Fin.cases
    · simp only [get_zero, head_cons]
    · 

Proof state:
case succ
α : Type u_2
β : Type u_3
n : ℕ
γ : Type u_1
f : α → β → γ
n✝ : ℕ
x : α
xs : β
y : Vector α n✝
ys : Vector β n✝
ih : ∀ (i : Fin n✝), get (map₂ f y ys) i = f (get y i) (get ys i)
i✝ : Fin n✝
⊢ get (f x xs ::ᵥ map₂ f y ys) (Fin.succ i✝) = f (get (x ::ᵥ y) (Fin.succ i✝)) (get (xs ::ᵥ ys) (Fin.succ i✝))

Next tactic:
simp only [get_cons_succ, ih]
theorem nearestPtInd_succ (e : ℕ → α) (N : ℕ) (x : α) :
    nearestPtInd e (N + 1) x =
      if ∀ k ≤ N, edist (e (N + 1)) x < edist (e k) x then N + 1 else nearestPtInd e N x := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
E : Type u_4
F : Type u_5
𝕜 : Type u_6
inst✝² : MeasurableSpace α
inst✝¹ : PseudoEMetricSpace α
inst✝ : OpensMeasurableSpace α
e : ℕ → α
N : ℕ
x : α
⊢ ↑(nearestPtInd e (N + 1)) x = if ∀ k ≤ N, edist (e (N + 1)) x < edist (e k) x then N + 1 else ↑(nearestPtInd e N) x

Next tactic:
simp only [nearestPtInd, coe_piecewise, Set.piecewise]
theorem nearestPtInd_succ (e : ℕ → α) (N : ℕ) (x : α) :
    nearestPtInd e (N + 1) x =
      if ∀ k ≤ N, edist (e (N + 1)) x < edist (e k) x then N + 1 else nearestPtInd e N x := by
  simp only [nearestPtInd, coe_piecewise, Set.piecewise]
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
E : Type u_4
F : Type u_5
𝕜 : Type u_6
inst✝² : MeasurableSpace α
inst✝¹ : PseudoEMetricSpace α
inst✝ : OpensMeasurableSpace α
e : ℕ → α
N : ℕ
x : α
⊢ (if x ∈ ⋂ k, ⋂ (_ : k ≤ Nat.add N 0), {x | edist (e (Nat.add N 0 + 1)) x < edist (e k) x} then
      ↑(const α (Nat.add N 0 + 1)) x
    else ↑(nearestPtInd e (Nat.add N 0)) x) =
    if ∀ k ≤ N, edist (e (N + 1)) x < edist (e k) x then N + 1 else ↑(nearestPtInd e N) x

Next tactic:
congr
theorem nearestPtInd_succ (e : ℕ → α) (N : ℕ) (x : α) :
    nearestPtInd e (N + 1) x =
      if ∀ k ≤ N, edist (e (N + 1)) x < edist (e k) x then N + 1 else nearestPtInd e N x := by
  simp only [nearestPtInd, coe_piecewise, Set.piecewise]
  congr
  

Proof state:
case e_c
α : Type u_1
β : Type u_2
ι : Type u_3
E : Type u_4
F : Type u_5
𝕜 : Type u_6
inst✝² : MeasurableSpace α
inst✝¹ : PseudoEMetricSpace α
inst✝ : OpensMeasurableSpace α
e : ℕ → α
N : ℕ
x : α
⊢ (x ∈ ⋂ k, ⋂ (_ : k ≤ Nat.add N 0), {x | edist (e (Nat.add N 0 + 1)) x < edist (e k) x}) =
    ∀ k ≤ N, edist (e (N + 1)) x < edist (e k) x

Next tactic:
simp
theorem nearestPtInd_le (e : ℕ → α) (N : ℕ) (x : α) : nearestPtInd e N x ≤ N := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
E : Type u_4
F : Type u_5
𝕜 : Type u_6
inst✝² : MeasurableSpace α
inst✝¹ : PseudoEMetricSpace α
inst✝ : OpensMeasurableSpace α
e : ℕ → α
N : ℕ
x : α
⊢ ↑(nearestPtInd e N) x ≤ N

Next tactic:
induction' N with N ihN
theorem nearestPtInd_le (e : ℕ → α) (N : ℕ) (x : α) : nearestPtInd e N x ≤ N := by
  induction' N with N ihN; · 

Proof state:
case zero
α : Type u_1
β : Type u_2
ι : Type u_3
E : Type u_4
F : Type u_5
𝕜 : Type u_6
inst✝² : MeasurableSpace α
inst✝¹ : PseudoEMetricSpace α
inst✝ : OpensMeasurableSpace α
e : ℕ → α
x : α
⊢ ↑(nearestPtInd e Nat.zero) x ≤ Nat.zero

Next tactic:
simp
theorem nearestPtInd_le (e : ℕ → α) (N : ℕ) (x : α) : nearestPtInd e N x ≤ N := by
  induction' N with N ihN; · simp
  

Proof state:
case succ
α : Type u_1
β : Type u_2
ι : Type u_3
E : Type u_4
F : Type u_5
𝕜 : Type u_6
inst✝² : MeasurableSpace α
inst✝¹ : PseudoEMetricSpace α
inst✝ : OpensMeasurableSpace α
e : ℕ → α
x : α
N : ℕ
ihN : ↑(nearestPtInd e N) x ≤ N
⊢ ↑(nearestPtInd e (Nat.succ N)) x ≤ Nat.succ N

Next tactic:
simp only [nearestPtInd_succ]
theorem nearestPtInd_le (e : ℕ → α) (N : ℕ) (x : α) : nearestPtInd e N x ≤ N := by
  induction' N with N ihN; · simp
  simp only [nearestPtInd_succ]
  

Proof state:
case succ
α : Type u_1
β : Type u_2
ι : Type u_3
E : Type u_4
F : Type u_5
𝕜 : Type u_6
inst✝² : MeasurableSpace α
inst✝¹ : PseudoEMetricSpace α
inst✝ : OpensMeasurableSpace α
e : ℕ → α
x : α
N : ℕ
ihN : ↑(nearestPtInd e N) x ≤ N
⊢ (if ∀ k ≤ N, edist (e (N + 1)) x < edist (e k) x then N + 1 else ↑(nearestPtInd e N) x) ≤ Nat.succ N

Next tactic:
split_ifs
theorem nearestPtInd_le (e : ℕ → α) (N : ℕ) (x : α) : nearestPtInd e N x ≤ N := by
  induction' N with N ihN; · simp
  simp only [nearestPtInd_succ]
  split_ifs
  

Proof state:
case pos
α : Type u_1
β : Type u_2
ι : Type u_3
E : Type u_4
F : Type u_5
𝕜 : Type u_6
inst✝² : MeasurableSpace α
inst✝¹ : PseudoEMetricSpace α
inst✝ : OpensMeasurableSpace α
e : ℕ → α
x : α
N : ℕ
ihN : ↑(nearestPtInd e N) x ≤ N
h✝ : ∀ k ≤ N, edist (e (N + 1)) x < edist (e k) x
⊢ N + 1 ≤ Nat.succ N
case neg
α : Type u_1
β : Type u_2
ι : Type u_3
E : Type u_4
F : Type u_5
𝕜 : Type u_6
inst✝² : MeasurableSpace α
inst✝¹ : PseudoEMetricSpace α
inst✝ : OpensMeasurableSpace α
e : ℕ → α
x : α
N : ℕ
ihN : ↑(nearestPtInd e N) x ≤ N
h✝ : ¬∀ k ≤ N, edist (e (N + 1)) x < edist (e k) x
⊢ ↑(nearestPtInd e N) x ≤ Nat.succ N

Next tactic:
exacts [le_rfl, ihN.trans N.le_succ]
theorem edist_nearestPt_le (e : ℕ → α) (x : α) {k N : ℕ} (hk : k ≤ N) :
    edist (nearestPt e N x) x ≤ edist (e k) x := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
E : Type u_4
F : Type u_5
𝕜 : Type u_6
inst✝² : MeasurableSpace α
inst✝¹ : PseudoEMetricSpace α
inst✝ : OpensMeasurableSpace α
e : ℕ → α
x : α
k N : ℕ
hk : k ≤ N
⊢ edist (↑(nearestPt e N) x) x ≤ edist (e k) x

Next tactic:
induction' N with N ihN generalizing k