l3lab/ntp-mathlib huggingface dataset:
instance contravariantClass_swap_add_lt [LT α] [ContravariantClass α α (swap (· + ·)) (· < ·)] :
    ContravariantClass (WithTop α) (WithTop α) (swap (· + ·)) (· < ·) :=
  ⟨fun a b c h => by
    cases a <;> cases b <;> 

Proof state:
case some.none
α : Type u
β : Type v
inst✝² : Add α
a b c✝ d : WithTop α
x y : α
inst✝¹ : LT α
inst✝ : ContravariantClass α α (swap fun x x_1 => x + x_1) fun x x_1 => x < x_1
c : WithTop α
val✝ : α
h : swap (fun x x_1 => x + x_1) (Option.some val✝) none < swap (fun x x_1 => x + x_1) (Option.some val✝) c
⊢ none < c

Next tactic:
try exact (not_none_lt _ h).elim
instance contravariantClass_swap_add_lt [LT α] [ContravariantClass α α (swap (· + ·)) (· < ·)] :
    ContravariantClass (WithTop α) (WithTop α) (swap (· + ·)) (· < ·) :=
  ⟨fun a b c h => by
    cases a <;> cases b <;> try 

Proof state:
case some.none
α : Type u
β : Type v
inst✝² : Add α
a b c✝ d : WithTop α
x y : α
inst✝¹ : LT α
inst✝ : ContravariantClass α α (swap fun x x_1 => x + x_1) fun x x_1 => x < x_1
c : WithTop α
val✝ : α
h : swap (fun x x_1 => x + x_1) (Option.some val✝) none < swap (fun x x_1 => x + x_1) (Option.some val✝) c
⊢ none < c

Next tactic:
exact (not_none_lt _ h).elim
instance contravariantClass_swap_add_lt [LT α] [ContravariantClass α α (swap (· + ·)) (· < ·)] :
    ContravariantClass (WithTop α) (WithTop α) (swap (· + ·)) (· < ·) :=
  ⟨fun a b c h => by
    cases a <;> cases b <;> 

Proof state:
case some.some
α : Type u
β : Type v
inst✝² : Add α
a b c✝ d : WithTop α
x y : α
inst✝¹ : LT α
inst✝ : ContravariantClass α α (swap fun x x_1 => x + x_1) fun x x_1 => x < x_1
c : WithTop α
val✝¹ val✝ : α
h :
  swap (fun x x_1 => x + x_1) (Option.some val✝¹) (Option.some val✝) < swap (fun x x_1 => x + x_1) (Option.some val✝¹) c
⊢ Option.some val✝ < c

Next tactic:
try exact (not_none_lt _ h).elim
instance contravariantClass_swap_add_lt [LT α] [ContravariantClass α α (swap (· + ·)) (· < ·)] :
    ContravariantClass (WithTop α) (WithTop α) (swap (· + ·)) (· < ·) :=
  ⟨fun a b c h => by
    cases a <;> cases b <;> try 

Proof state:
case some.some
α : Type u
β : Type v
inst✝² : Add α
a b c✝ d : WithTop α
x y : α
inst✝¹ : LT α
inst✝ : ContravariantClass α α (swap fun x x_1 => x + x_1) fun x x_1 => x < x_1
c : WithTop α
val✝¹ val✝ : α
h :
  swap (fun x x_1 => x + x_1) (Option.some val✝¹) (Option.some val✝) < swap (fun x x_1 => x + x_1) (Option.some val✝¹) c
⊢ Option.some val✝ < c

Next tactic:
exact (not_none_lt _ h).elim
instance contravariantClass_swap_add_lt [LT α] [ContravariantClass α α (swap (· + ·)) (· < ·)] :
    ContravariantClass (WithTop α) (WithTop α) (swap (· + ·)) (· < ·) :=
  ⟨fun a b c h => by
    cases a <;> cases b <;> try exact (not_none_lt _ h).elim
    

Proof state:
case some.some
α : Type u
β : Type v
inst✝² : Add α
a b c✝ d : WithTop α
x y : α
inst✝¹ : LT α
inst✝ : ContravariantClass α α (swap fun x x_1 => x + x_1) fun x x_1 => x < x_1
c : WithTop α
val✝¹ val✝ : α
h :
  swap (fun x x_1 => x + x_1) (Option.some val✝¹) (Option.some val✝) < swap (fun x x_1 => x + x_1) (Option.some val✝¹) c
⊢ Option.some val✝ < c

Next tactic:
cases c
instance contravariantClass_swap_add_lt [LT α] [ContravariantClass α α (swap (· + ·)) (· < ·)] :
    ContravariantClass (WithTop α) (WithTop α) (swap (· + ·)) (· < ·) :=
  ⟨fun a b c h => by
    cases a <;> cases b <;> try exact (not_none_lt _ h).elim
    cases c
    · 

Proof state:
case some.some.none
α : Type u
β : Type v
inst✝² : Add α
a b c d : WithTop α
x y : α
inst✝¹ : LT α
inst✝ : ContravariantClass α α (swap fun x x_1 => x + x_1) fun x x_1 => x < x_1
val✝¹ val✝ : α
h :
  swap (fun x x_1 => x + x_1) (Option.some val✝¹) (Option.some val✝) <
    swap (fun x x_1 => x + x_1) (Option.some val✝¹) none
⊢ Option.some val✝ < none

Next tactic:
exact coe_lt_top _
instance contravariantClass_swap_add_lt [LT α] [ContravariantClass α α (swap (· + ·)) (· < ·)] :
    ContravariantClass (WithTop α) (WithTop α) (swap (· + ·)) (· < ·) :=
  ⟨fun a b c h => by
    cases a <;> cases b <;> try exact (not_none_lt _ h).elim
    cases c
    · exact coe_lt_top _
    · 

Proof state:
case some.some.some
α : Type u
β : Type v
inst✝² : Add α
a b c d : WithTop α
x y : α
inst✝¹ : LT α
inst✝ : ContravariantClass α α (swap fun x x_1 => x + x_1) fun x x_1 => x < x_1
val✝² val✝¹ val✝ : α
h :
  swap (fun x x_1 => x + x_1) (Option.some val✝²) (Option.some val✝¹) <
    swap (fun x x_1 => x + x_1) (Option.some val✝²) (Option.some val✝)
⊢ Option.some val✝¹ < Option.some val✝

Next tactic:
exact coe_lt_coe.2 (lt_of_add_lt_add_right <| coe_lt_coe.1 h)
protected theorem le_of_add_le_add_left [LE α] [ContravariantClass α α (· + ·) (· ≤ ·)] (ha : a ≠ ⊤)
    (h : a + b ≤ a + c) : b ≤ c := by
  

Proof state:
α : Type u
β : Type v
inst✝² : Add α
a b c d : WithTop α
x y : α
inst✝¹ : LE α
inst✝ : ContravariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
ha : a ≠ ⊤
h : a + b ≤ a + c
⊢ b ≤ c

Next tactic:
lift a to α using ha
protected theorem le_of_add_le_add_left [LE α] [ContravariantClass α α (· + ·) (· ≤ ·)] (ha : a ≠ ⊤)
    (h : a + b ≤ a + c) : b ≤ c := by
  lift a to α using ha
  

Proof state:
case intro
α : Type u
β : Type v
inst✝² : Add α
b c d : WithTop α
x y : α
inst✝¹ : LE α
inst✝ : ContravariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
a : α
h : ↑a + b ≤ ↑a + c
⊢ b ≤ c

Next tactic:
induction c using WithTop.recTopCoe
protected theorem le_of_add_le_add_left [LE α] [ContravariantClass α α (· + ·) (· ≤ ·)] (ha : a ≠ ⊤)
    (h : a + b ≤ a + c) : b ≤ c := by
  lift a to α using ha
  induction c using WithTop.recTopCoe
  · 

Proof state:
case intro.top
α : Type u
β : Type v
inst✝² : Add α
b d : WithTop α
x y : α
inst✝¹ : LE α
inst✝ : ContravariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
a : α
h : ↑a + b ≤ ↑a + ⊤
⊢ b ≤ ⊤

Next tactic:
exact le_top
protected theorem le_of_add_le_add_left [LE α] [ContravariantClass α α (· + ·) (· ≤ ·)] (ha : a ≠ ⊤)
    (h : a + b ≤ a + c) : b ≤ c := by
  lift a to α using ha
  induction c using WithTop.recTopCoe
  · exact le_top
  · 

Proof state:
case intro.coe
α : Type u
β : Type v
inst✝² : Add α
b d : WithTop α
x y : α
inst✝¹ : LE α
inst✝ : ContravariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
a a✝ : α
h : ↑a + b ≤ ↑a + ↑a✝
⊢ b ≤ ↑a✝

Next tactic:
induction b using WithTop.recTopCoe
protected theorem le_of_add_le_add_left [LE α] [ContravariantClass α α (· + ·) (· ≤ ·)] (ha : a ≠ ⊤)
    (h : a + b ≤ a + c) : b ≤ c := by
  lift a to α using ha
  induction c using WithTop.recTopCoe
  · exact le_top
  · induction b using WithTop.recTopCoe
    · 

Proof state:
case intro.coe.top
α : Type u
β : Type v
inst✝² : Add α
d : WithTop α
x y : α
inst✝¹ : LE α
inst✝ : ContravariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
a a✝ : α
h : ↑a + ⊤ ≤ ↑a + ↑a✝
⊢ ⊤ ≤ ↑a✝

Next tactic:
exact (not_top_le_coe _ h).elim
protected theorem le_of_add_le_add_left [LE α] [ContravariantClass α α (· + ·) (· ≤ ·)] (ha : a ≠ ⊤)
    (h : a + b ≤ a + c) : b ≤ c := by
  lift a to α using ha
  induction c using WithTop.recTopCoe
  · exact le_top
  · induction b using WithTop.recTopCoe
    · exact (not_top_le_coe _ h).elim
    · 

Proof state:
case intro.coe.coe
α : Type u
β : Type v
inst✝² : Add α
d : WithTop α
x y : α
inst✝¹ : LE α
inst✝ : ContravariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
a a✝¹ a✝ : α
h : ↑a + ↑a✝ ≤ ↑a + ↑a✝¹
⊢ ↑a✝ ≤ ↑a✝¹

Next tactic:
simp only [← coe_add, coe_le_coe] at h ⊢
protected theorem le_of_add_le_add_left [LE α] [ContravariantClass α α (· + ·) (· ≤ ·)] (ha : a ≠ ⊤)
    (h : a + b ≤ a + c) : b ≤ c := by
  lift a to α using ha
  induction c using WithTop.recTopCoe
  · exact le_top
  · induction b using WithTop.recTopCoe
    · exact (not_top_le_coe _ h).elim
    · simp only [← coe_add, coe_le_coe] at h ⊢
      

Proof state:
case intro.coe.coe
α : Type u
β : Type v
inst✝² : Add α
d : WithTop α
x y : α
inst✝¹ : LE α
inst✝ : ContravariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
a a✝¹ a✝ : α
h : a + a✝ ≤ a + a✝¹
⊢ a✝ ≤ a✝¹

Next tactic:
exact le_of_add_le_add_left h
protected theorem le_of_add_le_add_right [LE α] [ContravariantClass α α (swap (· + ·)) (· ≤ ·)]
    (ha : a ≠ ⊤) (h : b + a ≤ c + a) : b ≤ c := by
  

Proof state:
α : Type u
β : Type v
inst✝² : Add α
a b c d : WithTop α
x y : α
inst✝¹ : LE α
inst✝ : ContravariantClass α α (swap fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
ha : a ≠ ⊤
h : b + a ≤ c + a
⊢ b ≤ c

Next tactic:
lift a to α using ha
protected theorem le_of_add_le_add_right [LE α] [ContravariantClass α α (swap (· + ·)) (· ≤ ·)]
    (ha : a ≠ ⊤) (h : b + a ≤ c + a) : b ≤ c := by
  lift a to α using ha
  

Proof state:
case intro
α : Type u
β : Type v
inst✝² : Add α
b c d : WithTop α
x y : α
inst✝¹ : LE α
inst✝ : ContravariantClass α α (swap fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
a : α
h : b + ↑a ≤ c + ↑a
⊢ b ≤ c

Next tactic:
cases c
protected theorem le_of_add_le_add_right [LE α] [ContravariantClass α α (swap (· + ·)) (· ≤ ·)]
    (ha : a ≠ ⊤) (h : b + a ≤ c + a) : b ≤ c := by
  lift a to α using ha
  cases c
  · 

Proof state:
case intro.none
α : Type u
β : Type v
inst✝² : Add α
b d : WithTop α
x y : α
inst✝¹ : LE α
inst✝ : ContravariantClass α α (swap fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
a : α
h : b + ↑a ≤ none + ↑a
⊢ b ≤ none

Next tactic:
exact le_top
protected theorem le_of_add_le_add_right [LE α] [ContravariantClass α α (swap (· + ·)) (· ≤ ·)]
    (ha : a ≠ ⊤) (h : b + a ≤ c + a) : b ≤ c := by
  lift a to α using ha
  cases c
  · exact le_top
  · 

Proof state:
case intro.some
α : Type u
β : Type v
inst✝² : Add α
b d : WithTop α
x y : α
inst✝¹ : LE α
inst✝ : ContravariantClass α α (swap fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
a val✝ : α
h : b + ↑a ≤ Option.some val✝ + ↑a
⊢ b ≤ Option.some val✝

Next tactic:
cases b
protected theorem le_of_add_le_add_right [LE α] [ContravariantClass α α (swap (· + ·)) (· ≤ ·)]
    (ha : a ≠ ⊤) (h : b + a ≤ c + a) : b ≤ c := by
  lift a to α using ha
  cases c
  · exact le_top
  · cases b
    · 

Proof state:
case intro.some.none
α : Type u
β : Type v
inst✝² : Add α
d : WithTop α
x y : α
inst✝¹ : LE α
inst✝ : ContravariantClass α α (swap fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
a val✝ : α
h : none + ↑a ≤ Option.some val✝ + ↑a
⊢ none ≤ Option.some val✝

Next tactic:
exact (not_top_le_coe _ h).elim
protected theorem le_of_add_le_add_right [LE α] [ContravariantClass α α (swap (· + ·)) (· ≤ ·)]
    (ha : a ≠ ⊤) (h : b + a ≤ c + a) : b ≤ c := by
  lift a to α using ha
  cases c
  · exact le_top
  · cases b
    · exact (not_top_le_coe _ h).elim
    · 

Proof state:
case intro.some.some
α : Type u
β : Type v
inst✝² : Add α
d : WithTop α
x y : α
inst✝¹ : LE α
inst✝ : ContravariantClass α α (swap fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
a val✝¹ val✝ : α
h : Option.some val✝ + ↑a ≤ Option.some val✝¹ + ↑a
⊢ Option.some val✝ ≤ Option.some val✝¹

Next tactic:
exact coe_le_coe.2 (le_of_add_le_add_right <| coe_le_coe.1 h)
protected theorem add_lt_add_left [LT α] [CovariantClass α α (· + ·) (· < ·)] (ha : a ≠ ⊤)
    (h : b < c) : a + b < a + c := by
  

Proof state:
α : Type u
β : Type v
inst✝² : Add α
a b c d : WithTop α
x y : α
inst✝¹ : LT α
inst✝ : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x < x_1
ha : a ≠ ⊤
h : b < c
⊢ a + b < a + c

Next tactic:
lift a to α using ha
protected theorem add_lt_add_left [LT α] [CovariantClass α α (· + ·) (· < ·)] (ha : a ≠ ⊤)
    (h : b < c) : a + b < a + c := by
  lift a to α using ha
  

Proof state:
case intro
α : Type u
β : Type v
inst✝² : Add α
b c d : WithTop α
x y : α
inst✝¹ : LT α
inst✝ : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x < x_1
h : b < c
a : α
⊢ ↑a + b < ↑a + c

Next tactic:
rcases lt_iff_exists_coe.1 h with ⟨b, rfl, h'⟩
protected theorem add_lt_add_left [LT α] [CovariantClass α α (· + ·) (· < ·)] (ha : a ≠ ⊤)
    (h : b < c) : a + b < a + c := by
  lift a to α using ha
  rcases lt_iff_exists_coe.1 h with ⟨b, rfl, h'⟩
  

Proof state:
case intro.intro.intro
α : Type u
β : Type v
inst✝² : Add α
c d : WithTop α
x y : α
inst✝¹ : LT α
inst✝ : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x < x_1
a b : α
h' h : ↑b < c
⊢ ↑a + ↑b < ↑a + c

Next tactic:
cases c
protected theorem add_lt_add_left [LT α] [CovariantClass α α (· + ·) (· < ·)] (ha : a ≠ ⊤)
    (h : b < c) : a + b < a + c := by
  lift a to α using ha
  rcases lt_iff_exists_coe.1 h with ⟨b, rfl, h'⟩
  cases c
  · 

Proof state:
case intro.intro.intro.none
α : Type u
β : Type v
inst✝² : Add α
d : WithTop α
x y : α
inst✝¹ : LT α
inst✝ : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x < x_1
a b : α
h' h : ↑b < none
⊢ ↑a + ↑b < ↑a + none

Next tactic:
exact coe_lt_top _
protected theorem add_lt_add_left [LT α] [CovariantClass α α (· + ·) (· < ·)] (ha : a ≠ ⊤)
    (h : b < c) : a + b < a + c := by
  lift a to α using ha
  rcases lt_iff_exists_coe.1 h with ⟨b, rfl, h'⟩
  cases c
  · exact coe_lt_top _
  · 

Proof state:
case intro.intro.intro.some
α : Type u
β : Type v
inst✝² : Add α
d : WithTop α
x y : α
inst✝¹ : LT α
inst✝ : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x < x_1
a b val✝ : α
h' h : ↑b < Option.some val✝
⊢ ↑a + ↑b < ↑a + Option.some val✝

Next tactic:
exact coe_lt_coe.2 (add_lt_add_left (coe_lt_coe.1 h) _)
protected theorem add_lt_add_right [LT α] [CovariantClass α α (swap (· + ·)) (· < ·)] (ha : a ≠ ⊤)
    (h : b < c) : b + a < c + a := by
  

Proof state:
α : Type u
β : Type v
inst✝² : Add α
a b c d : WithTop α
x y : α
inst✝¹ : LT α
inst✝ : CovariantClass α α (swap fun x x_1 => x + x_1) fun x x_1 => x < x_1
ha : a ≠ ⊤
h : b < c
⊢ b + a < c + a

Next tactic:
lift a to α using ha
protected theorem add_lt_add_right [LT α] [CovariantClass α α (swap (· + ·)) (· < ·)] (ha : a ≠ ⊤)
    (h : b < c) : b + a < c + a := by
  lift a to α using ha
  

Proof state:
case intro
α : Type u
β : Type v
inst✝² : Add α
b c d : WithTop α
x y : α
inst✝¹ : LT α
inst✝ : CovariantClass α α (swap fun x x_1 => x + x_1) fun x x_1 => x < x_1
h : b < c
a : α
⊢ b + ↑a < c + ↑a

Next tactic:
rcases lt_iff_exists_coe.1 h with ⟨b, rfl, h'⟩
protected theorem add_lt_add_right [LT α] [CovariantClass α α (swap (· + ·)) (· < ·)] (ha : a ≠ ⊤)
    (h : b < c) : b + a < c + a := by
  lift a to α using ha
  rcases lt_iff_exists_coe.1 h with ⟨b, rfl, h'⟩
  

Proof state:
case intro.intro.intro
α : Type u
β : Type v
inst✝² : Add α
c d : WithTop α
x y : α
inst✝¹ : LT α
inst✝ : CovariantClass α α (swap fun x x_1 => x + x_1) fun x x_1 => x < x_1
a b : α
h' h : ↑b < c
⊢ ↑b + ↑a < c + ↑a

Next tactic:
cases c
protected theorem add_lt_add_right [LT α] [CovariantClass α α (swap (· + ·)) (· < ·)] (ha : a ≠ ⊤)
    (h : b < c) : b + a < c + a := by
  lift a to α using ha
  rcases lt_iff_exists_coe.1 h with ⟨b, rfl, h'⟩
  cases c
  · 

Proof state:
case intro.intro.intro.none
α : Type u
β : Type v
inst✝² : Add α
d : WithTop α
x y : α
inst✝¹ : LT α
inst✝ : CovariantClass α α (swap fun x x_1 => x + x_1) fun x x_1 => x < x_1
a b : α
h' h : ↑b < none
⊢ ↑b + ↑a < none + ↑a

Next tactic:
exact coe_lt_top _
protected theorem add_lt_add_right [LT α] [CovariantClass α α (swap (· + ·)) (· < ·)] (ha : a ≠ ⊤)
    (h : b < c) : b + a < c + a := by
  lift a to α using ha
  rcases lt_iff_exists_coe.1 h with ⟨b, rfl, h'⟩
  cases c
  · exact coe_lt_top _
  · 

Proof state:
case intro.intro.intro.some
α : Type u
β : Type v
inst✝² : Add α
d : WithTop α
x y : α
inst✝¹ : LT α
inst✝ : CovariantClass α α (swap fun x x_1 => x + x_1) fun x x_1 => x < x_1
a b val✝ : α
h' h : ↑b < Option.some val✝
⊢ ↑b + ↑a < Option.some val✝ + ↑a

Next tactic:
exact coe_lt_coe.2 (add_lt_add_right (coe_lt_coe.1 h) _)
@[simp]
protected theorem map_add {F} [Add β] [AddHomClass F α β] (f : F) (a b : WithTop α) :
    (a + b).map f = a.map f + b.map f := by
  

Proof state:
α : Type u
β : Type v
inst✝² : Add α
a✝ b✝ c d : WithTop α
x y : α
F : Type u_1
inst✝¹ : Add β
inst✝ : AddHomClass F α β
f : F
a b : WithTop α
⊢ map (⇑f) (a + b) = map (⇑f) a + map (⇑f) b

Next tactic:
induction a using WithTop.recTopCoe
@[simp]
protected theorem map_add {F} [Add β] [AddHomClass F α β] (f : F) (a b : WithTop α) :
    (a + b).map f = a.map f + b.map f := by
  induction a using WithTop.recTopCoe
  · 

Proof state:
case top
α : Type u
β : Type v
inst✝² : Add α
a b✝ c d : WithTop α
x y : α
F : Type u_1
inst✝¹ : Add β
inst✝ : AddHomClass F α β
f : F
b : WithTop α
⊢ map (⇑f) (⊤ + b) = map ⇑f ⊤ + map (⇑f) b

Next tactic:
exact (top_add _).symm
@[simp]
protected theorem map_add {F} [Add β] [AddHomClass F α β] (f : F) (a b : WithTop α) :
    (a + b).map f = a.map f + b.map f := by
  induction a using WithTop.recTopCoe
  · exact (top_add _).symm
  · 

Proof state:
case coe
α : Type u
β : Type v
inst✝² : Add α
a b✝ c d : WithTop α
x y : α
F : Type u_1
inst✝¹ : Add β
inst✝ : AddHomClass F α β
f : F
b : WithTop α
a✝ : α
⊢ map (⇑f) (↑a✝ + b) = map ⇑f ↑a✝ + map (⇑f) b

Next tactic:
induction b using WithTop.recTopCoe
@[simp]
protected theorem map_add {F} [Add β] [AddHomClass F α β] (f : F) (a b : WithTop α) :
    (a + b).map f = a.map f + b.map f := by
  induction a using WithTop.recTopCoe
  · exact (top_add _).symm
  · induction b using WithTop.recTopCoe
    · 

Proof state:
case coe.top
α : Type u
β : Type v
inst✝² : Add α
a b c d : WithTop α
x y : α
F : Type u_1
inst✝¹ : Add β
inst✝ : AddHomClass F α β
f : F
a✝ : α
⊢ map (⇑f) (↑a✝ + ⊤) = map ⇑f ↑a✝ + map ⇑f ⊤

Next tactic:
exact (add_top _).symm
@[simp]
protected theorem map_add {F} [Add β] [AddHomClass F α β] (f : F) (a b : WithTop α) :
    (a + b).map f = a.map f + b.map f := by
  induction a using WithTop.recTopCoe
  · exact (top_add _).symm
  · induction b using WithTop.recTopCoe
    · exact (add_top _).symm
    · 

Proof state:
case coe.coe
α : Type u
β : Type v
inst✝² : Add α
a b c d : WithTop α
x y : α
F : Type u_1
inst✝¹ : Add β
inst✝ : AddHomClass F α β
f : F
a✝¹ a✝ : α
⊢ map (⇑f) (↑a✝¹ + ↑a✝) = map ⇑f ↑a✝¹ + map ⇑f ↑a✝

Next tactic:
rw [map_coe, map_coe, ← coe_add, ← coe_add, ← map_add]
@[simp]
protected theorem map_add {F} [Add β] [AddHomClass F α β] (f : F) (a b : WithTop α) :
    (a + b).map f = a.map f + b.map f := by
  induction a using WithTop.recTopCoe
  · exact (top_add _).symm
  · induction b using WithTop.recTopCoe
    · exact (add_top _).symm
    · rw [map_coe, map_coe, ← coe_add, ← coe_add, ← map_add]
      

Proof state:
case coe.coe
α : Type u
β : Type v
inst✝² : Add α
a b c d : WithTop α
x y : α
F : Type u_1
inst✝¹ : Add β
inst✝ : AddHomClass F α β
f : F
a✝¹ a✝ : α
⊢ map ⇑f ↑(a✝¹ + a✝) = ↑(f (a✝¹ + a✝))

Next tactic:
rfl
instance addMonoidWithOne [AddMonoidWithOne α] : AddMonoidWithOne (WithTop α) :=
  { WithTop.one, WithTop.addMonoid with
    natCast := fun n => ↑(n : α),
    natCast_zero := by
      

Proof state:
α : Type u
β : Type v
inst✝ : AddMonoidWithOne α
src✝¹ : One (WithTop α) := one
src✝ : AddMonoid (WithTop α) := addMonoid
⊢ NatCast.natCast 0 = 0

Next tactic:
simp only
instance addMonoidWithOne [AddMonoidWithOne α] : AddMonoidWithOne (WithTop α) :=
  { WithTop.one, WithTop.addMonoid with
    natCast := fun n => ↑(n : α),
    natCast_zero := by
      simp only -- Porting note: Had to add this...?
      

Proof state:
α : Type u
β : Type v
inst✝ : AddMonoidWithOne α
src✝¹ : One (WithTop α) := one
src✝ : AddMonoid (WithTop α) := addMonoid
⊢ ↑↑0 = 0

Next tactic:
rw [Nat.cast_zero, WithTop.coe_zero]
instance addMonoidWithOne [AddMonoidWithOne α] : AddMonoidWithOne (WithTop α) :=
  { WithTop.one, WithTop.addMonoid with
    natCast := fun n => ↑(n : α),
    natCast_zero := by
      simp only -- Porting note: Had to add this...?
      rw [Nat.cast_zero, WithTop.coe_zero],
    natCast_succ := fun n => by
      

Proof state:
α : Type u
β : Type v
inst✝ : AddMonoidWithOne α
src✝¹ : One (WithTop α) := one
src✝ : AddMonoid (WithTop α) := addMonoid
n : ℕ
⊢ NatCast.natCast (n + 1) = NatCast.natCast n + 1

Next tactic:
simp only
instance addMonoidWithOne [AddMonoidWithOne α] : AddMonoidWithOne (WithTop α) :=
  { WithTop.one, WithTop.addMonoid with
    natCast := fun n => ↑(n : α),
    natCast_zero := by
      simp only -- Porting note: Had to add this...?
      rw [Nat.cast_zero, WithTop.coe_zero],
    natCast_succ := fun n => by
      simp only -- Porting note: Had to add this...?
      

Proof state:
α : Type u
β : Type v
inst✝ : AddMonoidWithOne α
src✝¹ : One (WithTop α) := one
src✝ : AddMonoid (WithTop α) := addMonoid
n : ℕ
⊢ ↑↑(n + 1) = ↑↑n + 1

Next tactic:
rw [Nat.cast_add_one, WithTop.coe_add, WithTop.coe_one]
instance orderedAddCommMonoid [OrderedAddCommMonoid α] : OrderedAddCommMonoid (WithTop α) :=
  { WithTop.partialOrder, WithTop.addCommMonoid with
    add_le_add_left := by
      

Proof state:
α : Type u
β : Type v
inst✝ : OrderedAddCommMonoid α
src✝¹ : PartialOrder (WithTop α) := partialOrder
src✝ : AddCommMonoid (WithTop α) := addCommMonoid
⊢ ∀ (a b : WithTop α), a ≤ b → ∀ (c : WithTop α), c + a ≤ c + b

Next tactic:
rintro a b h (_ | c)
instance orderedAddCommMonoid [OrderedAddCommMonoid α] : OrderedAddCommMonoid (WithTop α) :=
  { WithTop.partialOrder, WithTop.addCommMonoid with
    add_le_add_left := by
      rintro a b h (_ | c); · 

Proof state:
case none
α : Type u
β : Type v
inst✝ : OrderedAddCommMonoid α
src✝¹ : PartialOrder (WithTop α) := partialOrder
src✝ : AddCommMonoid (WithTop α) := addCommMonoid
a b : WithTop α
h : a ≤ b
⊢ none + a ≤ none + b

Next tactic:
simp [none_eq_top]
instance orderedAddCommMonoid [OrderedAddCommMonoid α] : OrderedAddCommMonoid (WithTop α) :=
  { WithTop.partialOrder, WithTop.addCommMonoid with
    add_le_add_left := by
      rintro a b h (_ | c); · simp [none_eq_top]
      

Proof state:
case some
α : Type u
β : Type v
inst✝ : OrderedAddCommMonoid α
src✝¹ : PartialOrder (WithTop α) := partialOrder
src✝ : AddCommMonoid (WithTop α) := addCommMonoid
a b : WithTop α
h : a ≤ b
c : α
⊢ Option.some c + a ≤ Option.some c + b

Next tactic:
rcases b with (_ | b)
instance orderedAddCommMonoid [OrderedAddCommMonoid α] : OrderedAddCommMonoid (WithTop α) :=
  { WithTop.partialOrder, WithTop.addCommMonoid with
    add_le_add_left := by
      rintro a b h (_ | c); · simp [none_eq_top]
      rcases b with (_ | b); · 

Proof state:
case some.none
α : Type u
β : Type v
inst✝ : OrderedAddCommMonoid α
src✝¹ : PartialOrder (WithTop α) := partialOrder
src✝ : AddCommMonoid (WithTop α) := addCommMonoid
a : WithTop α
c : α
h : a ≤ none
⊢ Option.some c + a ≤ Option.some c + none

Next tactic:
simp [none_eq_top]
instance orderedAddCommMonoid [OrderedAddCommMonoid α] : OrderedAddCommMonoid (WithTop α) :=
  { WithTop.partialOrder, WithTop.addCommMonoid with
    add_le_add_left := by
      rintro a b h (_ | c); · simp [none_eq_top]
      rcases b with (_ | b); · simp [none_eq_top]
      

Proof state:
case some.some
α : Type u
β : Type v
inst✝ : OrderedAddCommMonoid α
src✝¹ : PartialOrder (WithTop α) := partialOrder
src✝ : AddCommMonoid (WithTop α) := addCommMonoid
a : WithTop α
c b : α
h : a ≤ Option.some b
⊢ Option.some c + a ≤ Option.some c + Option.some b

Next tactic:
rcases le_coe_iff.1 h with ⟨a, rfl, _⟩
instance orderedAddCommMonoid [OrderedAddCommMonoid α] : OrderedAddCommMonoid (WithTop α) :=
  { WithTop.partialOrder, WithTop.addCommMonoid with
    add_le_add_left := by
      rintro a b h (_ | c); · simp [none_eq_top]
      rcases b with (_ | b); · simp [none_eq_top]
      rcases le_coe_iff.1 h with ⟨a, rfl, _⟩
      

Proof state:
case some.some.intro.intro
α : Type u
β : Type v
inst✝ : OrderedAddCommMonoid α
src✝¹ : PartialOrder (WithTop α) := partialOrder
src✝ : AddCommMonoid (WithTop α) := addCommMonoid
c b a : α
right✝ : a ≤ b
h : ↑a ≤ Option.some b
⊢ Option.some c + ↑a ≤ Option.some c + Option.some b

Next tactic:
simp only [some_eq_coe, ← coe_add, coe_le_coe] at h ⊢
instance orderedAddCommMonoid [OrderedAddCommMonoid α] : OrderedAddCommMonoid (WithTop α) :=
  { WithTop.partialOrder, WithTop.addCommMonoid with
    add_le_add_left := by
      rintro a b h (_ | c); · simp [none_eq_top]
      rcases b with (_ | b); · simp [none_eq_top]
      rcases le_coe_iff.1 h with ⟨a, rfl, _⟩
      simp only [some_eq_coe, ← coe_add, coe_le_coe] at h ⊢
      

Proof state:
case some.some.intro.intro
α : Type u
β : Type v
inst✝ : OrderedAddCommMonoid α
src✝¹ : PartialOrder (WithTop α) := partialOrder
src✝ : AddCommMonoid (WithTop α) := addCommMonoid
c b a : α
right✝ h : a ≤ b
⊢ c + a ≤ c + b

Next tactic:
exact add_le_add_left h c