l3lab/ntp-mathlib huggingface dataset:
theorem length_pointwise {f : α → β → γ} :
    ∀ {as : List α} {bs : List β}, (pointwise f as bs).length = max as.length bs.length
  | [], [] => rfl
  | [], _ :: bs => by
    simp only [pointwise, length, length_map, max_eq_right (Nat.zero_le (length bs + 1))]
  | _ :: as, [] => by
    

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝¹ : Inhabited α
inst✝ : Inhabited β
f : α → β → γ
head✝ : α
as : List α
⊢ length (pointwise f (head✝ :: as) []) = max (length (head✝ :: as)) (length [])

Next tactic:
simp only [pointwise, length, length_map, max_eq_left (Nat.zero_le (length as + 1))]
theorem length_pointwise {f : α → β → γ} :
    ∀ {as : List α} {bs : List β}, (pointwise f as bs).length = max as.length bs.length
  | [], [] => rfl
  | [], _ :: bs => by
    simp only [pointwise, length, length_map, max_eq_right (Nat.zero_le (length bs + 1))]
  | _ :: as, [] => by
    simp only [pointwise, length, length_map, max_eq_left (Nat.zero_le (length as + 1))]
  | _ :: as, _ :: bs => by
    

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝¹ : Inhabited α
inst✝ : Inhabited β
f : α → β → γ
head✝¹ : α
as : List α
head✝ : β
bs : List β
⊢ length (pointwise f (head✝¹ :: as) (head✝ :: bs)) = max (length (head✝¹ :: as)) (length (head✝ :: bs))

Next tactic:
simp only [pointwise, length, Nat.succ_max_succ, @length_pointwise _ as bs]
@[simp]
theorem get_add {α : Type u} [AddMonoid α] {k : ℕ} {xs ys : List α} :
    -- porting note : `@` and `⟨0⟩`s added b/c of instance troubles
    -- (similarly at other places below)
    @get α ⟨0⟩ k (add xs ys) = @get α ⟨0⟩ k xs + @get α ⟨0⟩ k ys := by
  

Proof state:
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
k : ℕ
xs ys : List α
⊢ get k (add xs ys) = get k xs + get k ys

Next tactic:
apply @get_pointwise _ _ _ ⟨0⟩ ⟨0⟩ ⟨0⟩
@[simp]
theorem get_add {α : Type u} [AddMonoid α] {k : ℕ} {xs ys : List α} :
    -- porting note : `@` and `⟨0⟩`s added b/c of instance troubles
    -- (similarly at other places below)
    @get α ⟨0⟩ k (add xs ys) = @get α ⟨0⟩ k xs + @get α ⟨0⟩ k ys := by
  apply @get_pointwise _ _ _ ⟨0⟩ ⟨0⟩ ⟨0⟩
  

Proof state:
case h1
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
k : ℕ
xs ys : List α
⊢ default + default = default

Next tactic:
apply zero_add
@[simp]
theorem nil_add {α : Type u} [AddMonoid α] (as : List α) : add [] as = as := by
  

Proof state:
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
as : List α
⊢ add [] as = as

Next tactic:
rw [add, @nil_pointwise α α α ⟨0⟩ ⟨0⟩]
@[simp]
theorem nil_add {α : Type u} [AddMonoid α] (as : List α) : add [] as = as := by
  rw [add, @nil_pointwise α α α ⟨0⟩ ⟨0⟩]
  

Proof state:
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
as : List α
⊢ map (fun x => default + x) as = as

Next tactic:
apply Eq.trans _ (map_id as)
@[simp]
theorem nil_add {α : Type u} [AddMonoid α] (as : List α) : add [] as = as := by
  rw [add, @nil_pointwise α α α ⟨0⟩ ⟨0⟩]
  apply Eq.trans _ (map_id as)
  

Proof state:
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
as : List α
⊢ map (fun x => default + x) as = map id as

Next tactic:
congr with x
@[simp]
theorem nil_add {α : Type u} [AddMonoid α] (as : List α) : add [] as = as := by
  rw [add, @nil_pointwise α α α ⟨0⟩ ⟨0⟩]
  apply Eq.trans _ (map_id as)
  congr with x
  

Proof state:
case e_f.h
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
as : List α
x : α
⊢ default + x = id x

Next tactic:
exact zero_add x
@[simp]
theorem add_nil {α : Type u} [AddMonoid α] (as : List α) : add as [] = as := by
  

Proof state:
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
as : List α
⊢ add as [] = as

Next tactic:
rw [add, @pointwise_nil α α α ⟨0⟩ ⟨0⟩]
@[simp]
theorem add_nil {α : Type u} [AddMonoid α] (as : List α) : add as [] = as := by
  rw [add, @pointwise_nil α α α ⟨0⟩ ⟨0⟩]
  

Proof state:
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
as : List α
⊢ map (fun a => a + default) as = as

Next tactic:
apply Eq.trans _ (map_id as)
@[simp]
theorem add_nil {α : Type u} [AddMonoid α] (as : List α) : add as [] = as := by
  rw [add, @pointwise_nil α α α ⟨0⟩ ⟨0⟩]
  apply Eq.trans _ (map_id as)
  

Proof state:
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
as : List α
⊢ map (fun a => a + default) as = map id as

Next tactic:
congr with x
@[simp]
theorem add_nil {α : Type u} [AddMonoid α] (as : List α) : add as [] = as := by
  rw [add, @pointwise_nil α α α ⟨0⟩ ⟨0⟩]
  apply Eq.trans _ (map_id as)
  congr with x
  

Proof state:
case e_f.h
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
as : List α
x : α
⊢ x + default = id x

Next tactic:
exact add_zero x
theorem map_add_map {α : Type u} [AddMonoid α] (f g : α → α) {as : List α} :
    add (as.map f) (as.map g) = as.map fun x ↦ f x + g x := by
  

Proof state:
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
f g : α → α
as : List α
⊢ add (map f as) (map g as) = map (fun x => f x + g x) as

Next tactic:
apply @eq_of_equiv _ (⟨0⟩ : Inhabited α)
theorem map_add_map {α : Type u} [AddMonoid α] (f g : α → α) {as : List α} :
    add (as.map f) (as.map g) = as.map fun x ↦ f x + g x := by
  apply @eq_of_equiv _ (⟨0⟩ : Inhabited α)
  · 

Proof state:
case a
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
f g : α → α
as : List α
⊢ length (add (map f as) (map g as)) = length (map (fun x => f x + g x) as)

Next tactic:
rw [length_map, length_add, max_eq_left, length_map]
theorem map_add_map {α : Type u} [AddMonoid α] (f g : α → α) {as : List α} :
    add (as.map f) (as.map g) = as.map fun x ↦ f x + g x := by
  apply @eq_of_equiv _ (⟨0⟩ : Inhabited α)
  · rw [length_map, length_add, max_eq_left, length_map]
    

Proof state:
case a
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
f g : α → α
as : List α
⊢ length (map g as) ≤ length (map f as)

Next tactic:
apply le_of_eq
theorem map_add_map {α : Type u} [AddMonoid α] (f g : α → α) {as : List α} :
    add (as.map f) (as.map g) = as.map fun x ↦ f x + g x := by
  apply @eq_of_equiv _ (⟨0⟩ : Inhabited α)
  · rw [length_map, length_add, max_eq_left, length_map]
    apply le_of_eq
    

Proof state:
case a.a
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
f g : α → α
as : List α
⊢ length (map g as) = length (map f as)

Next tactic:
rw [length_map, length_map]
theorem map_add_map {α : Type u} [AddMonoid α] (f g : α → α) {as : List α} :
    add (as.map f) (as.map g) = as.map fun x ↦ f x + g x := by
  apply @eq_of_equiv _ (⟨0⟩ : Inhabited α)
  · rw [length_map, length_add, max_eq_left, length_map]
    apply le_of_eq
    rw [length_map, length_map]
  

Proof state:
case a
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
f g : α → α
as : List α
⊢ Equiv (add (map f as) (map g as)) (map (fun x => f x + g x) as)

Next tactic:
intro m
theorem map_add_map {α : Type u} [AddMonoid α] (f g : α → α) {as : List α} :
    add (as.map f) (as.map g) = as.map fun x ↦ f x + g x := by
  apply @eq_of_equiv _ (⟨0⟩ : Inhabited α)
  · rw [length_map, length_add, max_eq_left, length_map]
    apply le_of_eq
    rw [length_map, length_map]
  intro m
  

Proof state:
case a
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
f g : α → α
as : List α
m : ℕ
⊢ get m (add (map f as) (map g as)) = get m (map (fun x => f x + g x) as)

Next tactic:
rw [get_add]
theorem map_add_map {α : Type u} [AddMonoid α] (f g : α → α) {as : List α} :
    add (as.map f) (as.map g) = as.map fun x ↦ f x + g x := by
  apply @eq_of_equiv _ (⟨0⟩ : Inhabited α)
  · rw [length_map, length_add, max_eq_left, length_map]
    apply le_of_eq
    rw [length_map, length_map]
  intro m
  rw [get_add]
  

Proof state:
case a
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
f g : α → α
as : List α
m : ℕ
⊢ get m (map f as) + get m (map g as) = get m (map (fun x => f x + g x) as)

Next tactic:
by_cases h : m < length as
theorem map_add_map {α : Type u} [AddMonoid α] (f g : α → α) {as : List α} :
    add (as.map f) (as.map g) = as.map fun x ↦ f x + g x := by
  apply @eq_of_equiv _ (⟨0⟩ : Inhabited α)
  · rw [length_map, length_add, max_eq_left, length_map]
    apply le_of_eq
    rw [length_map, length_map]
  intro m
  rw [get_add]
  by_cases h : m < length as
  · 

Proof state:
case pos
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
f g : α → α
as : List α
m : ℕ
h : m < length as
⊢ get m (map f as) + get m (map g as) = get m (map (fun x => f x + g x) as)

Next tactic:
repeat' rw [@get_map α α ⟨0⟩ ⟨0⟩ _ _ _ h]
theorem map_add_map {α : Type u} [AddMonoid α] (f g : α → α) {as : List α} :
    add (as.map f) (as.map g) = as.map fun x ↦ f x + g x := by
  apply @eq_of_equiv _ (⟨0⟩ : Inhabited α)
  · rw [length_map, length_add, max_eq_left, length_map]
    apply le_of_eq
    rw [length_map, length_map]
  intro m
  rw [get_add]
  by_cases h : m < length as
  · repeat' 

Proof state:
case pos
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
f g : α → α
as : List α
m : ℕ
h : m < length as
⊢ get m (map f as) + get m (map g as) = get m (map (fun x => f x + g x) as)

Next tactic:
rw [@get_map α α ⟨0⟩ ⟨0⟩ _ _ _ h]
theorem map_add_map {α : Type u} [AddMonoid α] (f g : α → α) {as : List α} :
    add (as.map f) (as.map g) = as.map fun x ↦ f x + g x := by
  apply @eq_of_equiv _ (⟨0⟩ : Inhabited α)
  · rw [length_map, length_add, max_eq_left, length_map]
    apply le_of_eq
    rw [length_map, length_map]
  intro m
  rw [get_add]
  by_cases h : m < length as
  · repeat' 

Proof state:
case pos
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
f g : α → α
as : List α
m : ℕ
h : m < length as
⊢ f (get m as) + get m (map g as) = get m (map (fun x => f x + g x) as)

Next tactic:
rw [@get_map α α ⟨0⟩ ⟨0⟩ _ _ _ h]
theorem map_add_map {α : Type u} [AddMonoid α] (f g : α → α) {as : List α} :
    add (as.map f) (as.map g) = as.map fun x ↦ f x + g x := by
  apply @eq_of_equiv _ (⟨0⟩ : Inhabited α)
  · rw [length_map, length_add, max_eq_left, length_map]
    apply le_of_eq
    rw [length_map, length_map]
  intro m
  rw [get_add]
  by_cases h : m < length as
  · repeat' 

Proof state:
case pos
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
f g : α → α
as : List α
m : ℕ
h : m < length as
⊢ f (get m as) + g (get m as) = get m (map (fun x => f x + g x) as)

Next tactic:
rw [@get_map α α ⟨0⟩ ⟨0⟩ _ _ _ h]
theorem map_add_map {α : Type u} [AddMonoid α] (f g : α → α) {as : List α} :
    add (as.map f) (as.map g) = as.map fun x ↦ f x + g x := by
  apply @eq_of_equiv _ (⟨0⟩ : Inhabited α)
  · rw [length_map, length_add, max_eq_left, length_map]
    apply le_of_eq
    rw [length_map, length_map]
  intro m
  rw [get_add]
  by_cases h : m < length as
  · repeat' rw [@get_map α α ⟨0⟩ ⟨0⟩ _ _ _ h]
  

Proof state:
case neg
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
f g : α → α
as : List α
m : ℕ
h : ¬m < length as
⊢ get m (map f as) + get m (map g as) = get m (map (fun x => f x + g x) as)

Next tactic:
rw [not_lt] at h
theorem map_add_map {α : Type u} [AddMonoid α] (f g : α → α) {as : List α} :
    add (as.map f) (as.map g) = as.map fun x ↦ f x + g x := by
  apply @eq_of_equiv _ (⟨0⟩ : Inhabited α)
  · rw [length_map, length_add, max_eq_left, length_map]
    apply le_of_eq
    rw [length_map, length_map]
  intro m
  rw [get_add]
  by_cases h : m < length as
  · repeat' rw [@get_map α α ⟨0⟩ ⟨0⟩ _ _ _ h]
  rw [not_lt] at h
  

Proof state:
case neg
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
f g : α → α
as : List α
m : ℕ
h : length as ≤ m
⊢ get m (map f as) + get m (map g as) = get m (map (fun x => f x + g x) as)

Next tactic:
repeat' rw [@get_eq_default_of_le _ ⟨0⟩ m] <;> try rw [length_map]; apply h
theorem map_add_map {α : Type u} [AddMonoid α] (f g : α → α) {as : List α} :
    add (as.map f) (as.map g) = as.map fun x ↦ f x + g x := by
  apply @eq_of_equiv _ (⟨0⟩ : Inhabited α)
  · rw [length_map, length_add, max_eq_left, length_map]
    apply le_of_eq
    rw [length_map, length_map]
  intro m
  rw [get_add]
  by_cases h : m < length as
  · repeat' rw [@get_map α α ⟨0⟩ ⟨0⟩ _ _ _ h]
  rw [not_lt] at h
  repeat' 

Proof state:
case neg
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
f g : α → α
as : List α
m : ℕ
h : length as ≤ m
⊢ get m (map f as) + get m (map g as) = get m (map (fun x => f x + g x) as)

Next tactic:
rw [@get_eq_default_of_le _ ⟨0⟩ m]
theorem map_add_map {α : Type u} [AddMonoid α] (f g : α → α) {as : List α} :
    add (as.map f) (as.map g) = as.map fun x ↦ f x + g x := by
  apply @eq_of_equiv _ (⟨0⟩ : Inhabited α)
  · rw [length_map, length_add, max_eq_left, length_map]
    apply le_of_eq
    rw [length_map, length_map]
  intro m
  rw [get_add]
  by_cases h : m < length as
  · repeat' rw [@get_map α α ⟨0⟩ ⟨0⟩ _ _ _ h]
  rw [not_lt] at h
  repeat' rw [@get_eq_default_of_le _ ⟨0⟩ m] <;> 

Proof state:
case neg
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
f g : α → α
as : List α
m : ℕ
h : length as ≤ m
⊢ default + get m (map g as) = get m (map (fun x => f x + g x) as)

Next tactic:
try rw [length_map]; apply h
theorem map_add_map {α : Type u} [AddMonoid α] (f g : α → α) {as : List α} :
    add (as.map f) (as.map g) = as.map fun x ↦ f x + g x := by
  apply @eq_of_equiv _ (⟨0⟩ : Inhabited α)
  · rw [length_map, length_add, max_eq_left, length_map]
    apply le_of_eq
    rw [length_map, length_map]
  intro m
  rw [get_add]
  by_cases h : m < length as
  · repeat' rw [@get_map α α ⟨0⟩ ⟨0⟩ _ _ _ h]
  rw [not_lt] at h
  repeat' rw [@get_eq_default_of_le _ ⟨0⟩ m] <;> try 

Proof state:
case neg
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
f g : α → α
as : List α
m : ℕ
h : length as ≤ m
⊢ default + get m (map g as) = get m (map (fun x => f x + g x) as)

Next tactic:
rw [length_map]
theorem map_add_map {α : Type u} [AddMonoid α] (f g : α → α) {as : List α} :
    add (as.map f) (as.map g) = as.map fun x ↦ f x + g x := by
  apply @eq_of_equiv _ (⟨0⟩ : Inhabited α)
  · rw [length_map, length_add, max_eq_left, length_map]
    apply le_of_eq
    rw [length_map, length_map]
  intro m
  rw [get_add]
  by_cases h : m < length as
  · repeat' rw [@get_map α α ⟨0⟩ ⟨0⟩ _ _ _ h]
  rw [not_lt] at h
  repeat' rw [@get_eq_default_of_le _ ⟨0⟩ m] <;> 

Proof state:
case neg.a
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
f g : α → α
as : List α
m : ℕ
h : length as ≤ m
⊢ length (map f as) ≤ m

Next tactic:
try rw [length_map]; apply h
theorem map_add_map {α : Type u} [AddMonoid α] (f g : α → α) {as : List α} :
    add (as.map f) (as.map g) = as.map fun x ↦ f x + g x := by
  apply @eq_of_equiv _ (⟨0⟩ : Inhabited α)
  · rw [length_map, length_add, max_eq_left, length_map]
    apply le_of_eq
    rw [length_map, length_map]
  intro m
  rw [get_add]
  by_cases h : m < length as
  · repeat' rw [@get_map α α ⟨0⟩ ⟨0⟩ _ _ _ h]
  rw [not_lt] at h
  repeat' rw [@get_eq_default_of_le _ ⟨0⟩ m] <;> try 

Proof state:
case neg.a
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
f g : α → α
as : List α
m : ℕ
h : length as ≤ m
⊢ length (map f as) ≤ m

Next tactic:
rw [length_map]
theorem map_add_map {α : Type u} [AddMonoid α] (f g : α → α) {as : List α} :
    add (as.map f) (as.map g) = as.map fun x ↦ f x + g x := by
  apply @eq_of_equiv _ (⟨0⟩ : Inhabited α)
  · rw [length_map, length_add, max_eq_left, length_map]
    apply le_of_eq
    rw [length_map, length_map]
  intro m
  rw [get_add]
  by_cases h : m < length as
  · repeat' rw [@get_map α α ⟨0⟩ ⟨0⟩ _ _ _ h]
  rw [not_lt] at h
  repeat' rw [@get_eq_default_of_le _ ⟨0⟩ m] <;> try rw [length_map]; 

Proof state:
case neg.a
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
f g : α → α
as : List α
m : ℕ
h : length as ≤ m
⊢ length as ≤ m

Next tactic:
apply h
theorem map_add_map {α : Type u} [AddMonoid α] (f g : α → α) {as : List α} :
    add (as.map f) (as.map g) = as.map fun x ↦ f x + g x := by
  apply @eq_of_equiv _ (⟨0⟩ : Inhabited α)
  · rw [length_map, length_add, max_eq_left, length_map]
    apply le_of_eq
    rw [length_map, length_map]
  intro m
  rw [get_add]
  by_cases h : m < length as
  · repeat' rw [@get_map α α ⟨0⟩ ⟨0⟩ _ _ _ h]
  rw [not_lt] at h
  repeat' 

Proof state:
case neg
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
f g : α → α
as : List α
m : ℕ
h : length as ≤ m
⊢ default + get m (map g as) = get m (map (fun x => f x + g x) as)

Next tactic:
rw [@get_eq_default_of_le _ ⟨0⟩ m]
theorem map_add_map {α : Type u} [AddMonoid α] (f g : α → α) {as : List α} :
    add (as.map f) (as.map g) = as.map fun x ↦ f x + g x := by
  apply @eq_of_equiv _ (⟨0⟩ : Inhabited α)
  · rw [length_map, length_add, max_eq_left, length_map]
    apply le_of_eq
    rw [length_map, length_map]
  intro m
  rw [get_add]
  by_cases h : m < length as
  · repeat' rw [@get_map α α ⟨0⟩ ⟨0⟩ _ _ _ h]
  rw [not_lt] at h
  repeat' rw [@get_eq_default_of_le _ ⟨0⟩ m] <;> 

Proof state:
case neg
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
f g : α → α
as : List α
m : ℕ
h : length as ≤ m
⊢ default + default = get m (map (fun x => f x + g x) as)

Next tactic:
try rw [length_map]; apply h
theorem map_add_map {α : Type u} [AddMonoid α] (f g : α → α) {as : List α} :
    add (as.map f) (as.map g) = as.map fun x ↦ f x + g x := by
  apply @eq_of_equiv _ (⟨0⟩ : Inhabited α)
  · rw [length_map, length_add, max_eq_left, length_map]
    apply le_of_eq
    rw [length_map, length_map]
  intro m
  rw [get_add]
  by_cases h : m < length as
  · repeat' rw [@get_map α α ⟨0⟩ ⟨0⟩ _ _ _ h]
  rw [not_lt] at h
  repeat' rw [@get_eq_default_of_le _ ⟨0⟩ m] <;> try 

Proof state:
case neg
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
f g : α → α
as : List α
m : ℕ
h : length as ≤ m
⊢ default + default = get m (map (fun x => f x + g x) as)

Next tactic:
rw [length_map]
theorem map_add_map {α : Type u} [AddMonoid α] (f g : α → α) {as : List α} :
    add (as.map f) (as.map g) = as.map fun x ↦ f x + g x := by
  apply @eq_of_equiv _ (⟨0⟩ : Inhabited α)
  · rw [length_map, length_add, max_eq_left, length_map]
    apply le_of_eq
    rw [length_map, length_map]
  intro m
  rw [get_add]
  by_cases h : m < length as
  · repeat' rw [@get_map α α ⟨0⟩ ⟨0⟩ _ _ _ h]
  rw [not_lt] at h
  repeat' rw [@get_eq_default_of_le _ ⟨0⟩ m] <;> 

Proof state:
case neg.a
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
f g : α → α
as : List α
m : ℕ
h : length as ≤ m
⊢ length (map g as) ≤ m

Next tactic:
try rw [length_map]; apply h
theorem map_add_map {α : Type u} [AddMonoid α] (f g : α → α) {as : List α} :
    add (as.map f) (as.map g) = as.map fun x ↦ f x + g x := by
  apply @eq_of_equiv _ (⟨0⟩ : Inhabited α)
  · rw [length_map, length_add, max_eq_left, length_map]
    apply le_of_eq
    rw [length_map, length_map]
  intro m
  rw [get_add]
  by_cases h : m < length as
  · repeat' rw [@get_map α α ⟨0⟩ ⟨0⟩ _ _ _ h]
  rw [not_lt] at h
  repeat' rw [@get_eq_default_of_le _ ⟨0⟩ m] <;> try 

Proof state:
case neg.a
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
f g : α → α
as : List α
m : ℕ
h : length as ≤ m
⊢ length (map g as) ≤ m

Next tactic:
rw [length_map]
theorem map_add_map {α : Type u} [AddMonoid α] (f g : α → α) {as : List α} :
    add (as.map f) (as.map g) = as.map fun x ↦ f x + g x := by
  apply @eq_of_equiv _ (⟨0⟩ : Inhabited α)
  · rw [length_map, length_add, max_eq_left, length_map]
    apply le_of_eq
    rw [length_map, length_map]
  intro m
  rw [get_add]
  by_cases h : m < length as
  · repeat' rw [@get_map α α ⟨0⟩ ⟨0⟩ _ _ _ h]
  rw [not_lt] at h
  repeat' 

Proof state:
case neg
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
f g : α → α
as : List α
m : ℕ
h : length as ≤ m
⊢ default + default = get m (map (fun x => f x + g x) as)

Next tactic:
rw [@get_eq_default_of_le _ ⟨0⟩ m]
theorem map_add_map {α : Type u} [AddMonoid α] (f g : α → α) {as : List α} :
    add (as.map f) (as.map g) = as.map fun x ↦ f x + g x := by
  apply @eq_of_equiv _ (⟨0⟩ : Inhabited α)
  · rw [length_map, length_add, max_eq_left, length_map]
    apply le_of_eq
    rw [length_map, length_map]
  intro m
  rw [get_add]
  by_cases h : m < length as
  · repeat' rw [@get_map α α ⟨0⟩ ⟨0⟩ _ _ _ h]
  rw [not_lt] at h
  repeat' rw [@get_eq_default_of_le _ ⟨0⟩ m] <;> 

Proof state:
case neg
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
f g : α → α
as : List α
m : ℕ
h : length as ≤ m
⊢ default + default = default

Next tactic:
try rw [length_map]; apply h
theorem map_add_map {α : Type u} [AddMonoid α] (f g : α → α) {as : List α} :
    add (as.map f) (as.map g) = as.map fun x ↦ f x + g x := by
  apply @eq_of_equiv _ (⟨0⟩ : Inhabited α)
  · rw [length_map, length_add, max_eq_left, length_map]
    apply le_of_eq
    rw [length_map, length_map]
  intro m
  rw [get_add]
  by_cases h : m < length as
  · repeat' rw [@get_map α α ⟨0⟩ ⟨0⟩ _ _ _ h]
  rw [not_lt] at h
  repeat' rw [@get_eq_default_of_le _ ⟨0⟩ m] <;> try 

Proof state:
case neg
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
f g : α → α
as : List α
m : ℕ
h : length as ≤ m
⊢ default + default = default

Next tactic:
rw [length_map]
theorem map_add_map {α : Type u} [AddMonoid α] (f g : α → α) {as : List α} :
    add (as.map f) (as.map g) = as.map fun x ↦ f x + g x := by
  apply @eq_of_equiv _ (⟨0⟩ : Inhabited α)
  · rw [length_map, length_add, max_eq_left, length_map]
    apply le_of_eq
    rw [length_map, length_map]
  intro m
  rw [get_add]
  by_cases h : m < length as
  · repeat' rw [@get_map α α ⟨0⟩ ⟨0⟩ _ _ _ h]
  rw [not_lt] at h
  repeat' rw [@get_eq_default_of_le _ ⟨0⟩ m] <;> 

Proof state:
case neg.a
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
f g : α → α
as : List α
m : ℕ
h : length as ≤ m
⊢ length (map (fun x => f x + g x) as) ≤ m

Next tactic:
try rw [length_map]; apply h
theorem map_add_map {α : Type u} [AddMonoid α] (f g : α → α) {as : List α} :
    add (as.map f) (as.map g) = as.map fun x ↦ f x + g x := by
  apply @eq_of_equiv _ (⟨0⟩ : Inhabited α)
  · rw [length_map, length_add, max_eq_left, length_map]
    apply le_of_eq
    rw [length_map, length_map]
  intro m
  rw [get_add]
  by_cases h : m < length as
  · repeat' rw [@get_map α α ⟨0⟩ ⟨0⟩ _ _ _ h]
  rw [not_lt] at h
  repeat' rw [@get_eq_default_of_le _ ⟨0⟩ m] <;> try 

Proof state:
case neg.a
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
f g : α → α
as : List α
m : ℕ
h : length as ≤ m
⊢ length (map (fun x => f x + g x) as) ≤ m

Next tactic:
rw [length_map]
theorem map_add_map {α : Type u} [AddMonoid α] (f g : α → α) {as : List α} :
    add (as.map f) (as.map g) = as.map fun x ↦ f x + g x := by
  apply @eq_of_equiv _ (⟨0⟩ : Inhabited α)
  · rw [length_map, length_add, max_eq_left, length_map]
    apply le_of_eq
    rw [length_map, length_map]
  intro m
  rw [get_add]
  by_cases h : m < length as
  · repeat' rw [@get_map α α ⟨0⟩ ⟨0⟩ _ _ _ h]
  rw [not_lt] at h
  repeat' 

Proof state:
case neg
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
f g : α → α
as : List α
m : ℕ
h : length as ≤ m
⊢ default + default = default

Next tactic:
rw [@get_eq_default_of_le _ ⟨0⟩ m]
theorem map_add_map {α : Type u} [AddMonoid α] (f g : α → α) {as : List α} :
    add (as.map f) (as.map g) = as.map fun x ↦ f x + g x := by
  apply @eq_of_equiv _ (⟨0⟩ : Inhabited α)
  · rw [length_map, length_add, max_eq_left, length_map]
    apply le_of_eq
    rw [length_map, length_map]
  intro m
  rw [get_add]
  by_cases h : m < length as
  · repeat' rw [@get_map α α ⟨0⟩ ⟨0⟩ _ _ _ h]
  rw [not_lt] at h
  repeat' rw [@get_eq_default_of_le _ ⟨0⟩ m] <;> try rw [length_map]; apply h
  

Proof state:
case neg
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddMonoid α
f g : α → α
as : List α
m : ℕ
h : length as ≤ m
⊢ default + default = default

Next tactic:
exact zero_add _
@[simp]
theorem get_sub {α : Type u} [AddGroup α] {k : ℕ} {xs ys : List α} :
    @get α ⟨0⟩ k (sub xs ys) = @get α ⟨0⟩ k xs - @get α ⟨0⟩ k ys := by
  

Proof state:
α✝ : Type u
β : Type v
γ : Type w
α : Type u
inst✝ : AddGroup α
k : ℕ
xs ys : List α
⊢ get k (sub xs ys) = get k xs - get k ys

Next tactic:
apply @get_pointwise _ _ _ ⟨0⟩ ⟨0⟩ ⟨0⟩