l3lab/ntp-mathlib huggingface dataset:
instance : SuccOrder (WithTop α) where
  succ a :=
    match a with
    | ⊤ => ⊤
    | Option.some a => ite (a = ⊤) ⊤ (some (succ a))
  le_succ a := by
    cases' a with a a
    · exact le_top
    change _ ≤ ite _ _ _
    split_ifs
    · exact le_top
    · exact some_le_some.2 (le_succ a)
  max_of_succ_le {a} ha := by
    cases a
    · exact isMax_top
    dsimp only at ha
    split_ifs at ha with ha'
    · exact (not_top_le_coe _ ha).elim
    · rw [some_eq_coe, coe_le_coe, succ_le_iff_eq_top] at ha
      exact (ha' ha).elim
  succ_le_of_lt {a b} h := by
    cases b
    · 

Proof state:
case none
α : Type u_1
β : Type u_2
inst✝³ : DecidableEq α
inst✝² : PartialOrder α
inst✝¹ : OrderTop α
inst✝ : SuccOrder α
a : WithTop α
h : a < none
⊢ (fun a =>
        match a with
        | none => ⊤
        | Option.some a => if a = ⊤ then ⊤ else ↑(succ a))
      a ≤
    none

Next tactic:
exact le_top
instance : SuccOrder (WithTop α) where
  succ a :=
    match a with
    | ⊤ => ⊤
    | Option.some a => ite (a = ⊤) ⊤ (some (succ a))
  le_succ a := by
    cases' a with a a
    · exact le_top
    change _ ≤ ite _ _ _
    split_ifs
    · exact le_top
    · exact some_le_some.2 (le_succ a)
  max_of_succ_le {a} ha := by
    cases a
    · exact isMax_top
    dsimp only at ha
    split_ifs at ha with ha'
    · exact (not_top_le_coe _ ha).elim
    · rw [some_eq_coe, coe_le_coe, succ_le_iff_eq_top] at ha
      exact (ha' ha).elim
  succ_le_of_lt {a b} h := by
    cases b
    · exact le_top
    

Proof state:
case some
α : Type u_1
β : Type u_2
inst✝³ : DecidableEq α
inst✝² : PartialOrder α
inst✝¹ : OrderTop α
inst✝ : SuccOrder α
a : WithTop α
val✝ : α
h : a < Option.some val✝
⊢ (fun a =>
        match a with
        | none => ⊤
        | Option.some a => if a = ⊤ then ⊤ else ↑(succ a))
      a ≤
    Option.some val✝

Next tactic:
cases a
instance : SuccOrder (WithTop α) where
  succ a :=
    match a with
    | ⊤ => ⊤
    | Option.some a => ite (a = ⊤) ⊤ (some (succ a))
  le_succ a := by
    cases' a with a a
    · exact le_top
    change _ ≤ ite _ _ _
    split_ifs
    · exact le_top
    · exact some_le_some.2 (le_succ a)
  max_of_succ_le {a} ha := by
    cases a
    · exact isMax_top
    dsimp only at ha
    split_ifs at ha with ha'
    · exact (not_top_le_coe _ ha).elim
    · rw [some_eq_coe, coe_le_coe, succ_le_iff_eq_top] at ha
      exact (ha' ha).elim
  succ_le_of_lt {a b} h := by
    cases b
    · exact le_top
    cases a
    · 

Proof state:
case some.none
α : Type u_1
β : Type u_2
inst✝³ : DecidableEq α
inst✝² : PartialOrder α
inst✝¹ : OrderTop α
inst✝ : SuccOrder α
val✝ : α
h : none < Option.some val✝
⊢ (fun a =>
        match a with
        | none => ⊤
        | Option.some a => if a = ⊤ then ⊤ else ↑(succ a))
      none ≤
    Option.some val✝

Next tactic:
exact (not_top_lt h).elim
instance : SuccOrder (WithTop α) where
  succ a :=
    match a with
    | ⊤ => ⊤
    | Option.some a => ite (a = ⊤) ⊤ (some (succ a))
  le_succ a := by
    cases' a with a a
    · exact le_top
    change _ ≤ ite _ _ _
    split_ifs
    · exact le_top
    · exact some_le_some.2 (le_succ a)
  max_of_succ_le {a} ha := by
    cases a
    · exact isMax_top
    dsimp only at ha
    split_ifs at ha with ha'
    · exact (not_top_le_coe _ ha).elim
    · rw [some_eq_coe, coe_le_coe, succ_le_iff_eq_top] at ha
      exact (ha' ha).elim
  succ_le_of_lt {a b} h := by
    cases b
    · exact le_top
    cases a
    · exact (not_top_lt h).elim
    

Proof state:
case some.some
α : Type u_1
β : Type u_2
inst✝³ : DecidableEq α
inst✝² : PartialOrder α
inst✝¹ : OrderTop α
inst✝ : SuccOrder α
val✝¹ val✝ : α
h : Option.some val✝ < Option.some val✝¹
⊢ (fun a =>
        match a with
        | none => ⊤
        | Option.some a => if a = ⊤ then ⊤ else ↑(succ a))
      (Option.some val✝) ≤
    Option.some val✝¹

Next tactic:
rw [some_lt_some] at h
instance : SuccOrder (WithTop α) where
  succ a :=
    match a with
    | ⊤ => ⊤
    | Option.some a => ite (a = ⊤) ⊤ (some (succ a))
  le_succ a := by
    cases' a with a a
    · exact le_top
    change _ ≤ ite _ _ _
    split_ifs
    · exact le_top
    · exact some_le_some.2 (le_succ a)
  max_of_succ_le {a} ha := by
    cases a
    · exact isMax_top
    dsimp only at ha
    split_ifs at ha with ha'
    · exact (not_top_le_coe _ ha).elim
    · rw [some_eq_coe, coe_le_coe, succ_le_iff_eq_top] at ha
      exact (ha' ha).elim
  succ_le_of_lt {a b} h := by
    cases b
    · exact le_top
    cases a
    · exact (not_top_lt h).elim
    rw [some_lt_some] at h
    

Proof state:
case some.some
α : Type u_1
β : Type u_2
inst✝³ : DecidableEq α
inst✝² : PartialOrder α
inst✝¹ : OrderTop α
inst✝ : SuccOrder α
val✝¹ val✝ : α
h : val✝ < val✝¹
⊢ (fun a =>
        match a with
        | none => ⊤
        | Option.some a => if a = ⊤ then ⊤ else ↑(succ a))
      (Option.some val✝) ≤
    Option.some val✝¹

Next tactic:
change ite _ _ _ ≤ _
instance : SuccOrder (WithTop α) where
  succ a :=
    match a with
    | ⊤ => ⊤
    | Option.some a => ite (a = ⊤) ⊤ (some (succ a))
  le_succ a := by
    cases' a with a a
    · exact le_top
    change _ ≤ ite _ _ _
    split_ifs
    · exact le_top
    · exact some_le_some.2 (le_succ a)
  max_of_succ_le {a} ha := by
    cases a
    · exact isMax_top
    dsimp only at ha
    split_ifs at ha with ha'
    · exact (not_top_le_coe _ ha).elim
    · rw [some_eq_coe, coe_le_coe, succ_le_iff_eq_top] at ha
      exact (ha' ha).elim
  succ_le_of_lt {a b} h := by
    cases b
    · exact le_top
    cases a
    · exact (not_top_lt h).elim
    rw [some_lt_some] at h
    change ite _ _ _ ≤ _
    

Proof state:
case some.some
α : Type u_1
β : Type u_2
inst✝³ : DecidableEq α
inst✝² : PartialOrder α
inst✝¹ : OrderTop α
inst✝ : SuccOrder α
val✝¹ val✝ : α
h : val✝ < val✝¹
⊢ (if val✝ = ⊤ then ⊤ else ↑(succ val✝)) ≤ Option.some val✝¹

Next tactic:
split_ifs with ha
instance : SuccOrder (WithTop α) where
  succ a :=
    match a with
    | ⊤ => ⊤
    | Option.some a => ite (a = ⊤) ⊤ (some (succ a))
  le_succ a := by
    cases' a with a a
    · exact le_top
    change _ ≤ ite _ _ _
    split_ifs
    · exact le_top
    · exact some_le_some.2 (le_succ a)
  max_of_succ_le {a} ha := by
    cases a
    · exact isMax_top
    dsimp only at ha
    split_ifs at ha with ha'
    · exact (not_top_le_coe _ ha).elim
    · rw [some_eq_coe, coe_le_coe, succ_le_iff_eq_top] at ha
      exact (ha' ha).elim
  succ_le_of_lt {a b} h := by
    cases b
    · exact le_top
    cases a
    · exact (not_top_lt h).elim
    rw [some_lt_some] at h
    change ite _ _ _ ≤ _
    split_ifs with ha
    · 

Proof state:
case pos
α : Type u_1
β : Type u_2
inst✝³ : DecidableEq α
inst✝² : PartialOrder α
inst✝¹ : OrderTop α
inst✝ : SuccOrder α
val✝¹ val✝ : α
h : val✝ < val✝¹
ha : val✝ = ⊤
⊢ ⊤ ≤ Option.some val✝¹

Next tactic:
rw [ha] at h
instance : SuccOrder (WithTop α) where
  succ a :=
    match a with
    | ⊤ => ⊤
    | Option.some a => ite (a = ⊤) ⊤ (some (succ a))
  le_succ a := by
    cases' a with a a
    · exact le_top
    change _ ≤ ite _ _ _
    split_ifs
    · exact le_top
    · exact some_le_some.2 (le_succ a)
  max_of_succ_le {a} ha := by
    cases a
    · exact isMax_top
    dsimp only at ha
    split_ifs at ha with ha'
    · exact (not_top_le_coe _ ha).elim
    · rw [some_eq_coe, coe_le_coe, succ_le_iff_eq_top] at ha
      exact (ha' ha).elim
  succ_le_of_lt {a b} h := by
    cases b
    · exact le_top
    cases a
    · exact (not_top_lt h).elim
    rw [some_lt_some] at h
    change ite _ _ _ ≤ _
    split_ifs with ha
    · rw [ha] at h
      

Proof state:
case pos
α : Type u_1
β : Type u_2
inst✝³ : DecidableEq α
inst✝² : PartialOrder α
inst✝¹ : OrderTop α
inst✝ : SuccOrder α
val✝¹ val✝ : α
h : ⊤ < val✝¹
ha : val✝ = ⊤
⊢ ⊤ ≤ Option.some val✝¹

Next tactic:
exact (not_top_lt h).elim
instance : SuccOrder (WithTop α) where
  succ a :=
    match a with
    | ⊤ => ⊤
    | Option.some a => ite (a = ⊤) ⊤ (some (succ a))
  le_succ a := by
    cases' a with a a
    · exact le_top
    change _ ≤ ite _ _ _
    split_ifs
    · exact le_top
    · exact some_le_some.2 (le_succ a)
  max_of_succ_le {a} ha := by
    cases a
    · exact isMax_top
    dsimp only at ha
    split_ifs at ha with ha'
    · exact (not_top_le_coe _ ha).elim
    · rw [some_eq_coe, coe_le_coe, succ_le_iff_eq_top] at ha
      exact (ha' ha).elim
  succ_le_of_lt {a b} h := by
    cases b
    · exact le_top
    cases a
    · exact (not_top_lt h).elim
    rw [some_lt_some] at h
    change ite _ _ _ ≤ _
    split_ifs with ha
    · rw [ha] at h
      exact (not_top_lt h).elim
    · 

Proof state:
case neg
α : Type u_1
β : Type u_2
inst✝³ : DecidableEq α
inst✝² : PartialOrder α
inst✝¹ : OrderTop α
inst✝ : SuccOrder α
val✝¹ val✝ : α
h : val✝ < val✝¹
ha : ¬val✝ = ⊤
⊢ ↑(succ val✝) ≤ Option.some val✝¹

Next tactic:
exact some_le_some.2 (succ_le_of_lt h)
instance : SuccOrder (WithTop α) where
  succ a :=
    match a with
    | ⊤ => ⊤
    | Option.some a => ite (a = ⊤) ⊤ (some (succ a))
  le_succ a := by
    cases' a with a a
    · exact le_top
    change _ ≤ ite _ _ _
    split_ifs
    · exact le_top
    · exact some_le_some.2 (le_succ a)
  max_of_succ_le {a} ha := by
    cases a
    · exact isMax_top
    dsimp only at ha
    split_ifs at ha with ha'
    · exact (not_top_le_coe _ ha).elim
    · rw [some_eq_coe, coe_le_coe, succ_le_iff_eq_top] at ha
      exact (ha' ha).elim
  succ_le_of_lt {a b} h := by
    cases b
    · exact le_top
    cases a
    · exact (not_top_lt h).elim
    rw [some_lt_some] at h
    change ite _ _ _ ≤ _
    split_ifs with ha
    · rw [ha] at h
      exact (not_top_lt h).elim
    · exact some_le_some.2 (succ_le_of_lt h)
  le_of_lt_succ {a b} h := by
    

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : DecidableEq α
inst✝² : PartialOrder α
inst✝¹ : OrderTop α
inst✝ : SuccOrder α
a b : WithTop α
h :
  a <
    (fun a =>
        match a with
        | none => ⊤
        | Option.some a => if a = ⊤ then ⊤ else ↑(succ a))
      b
⊢ a ≤ b

Next tactic:
cases a
instance : SuccOrder (WithTop α) where
  succ a :=
    match a with
    | ⊤ => ⊤
    | Option.some a => ite (a = ⊤) ⊤ (some (succ a))
  le_succ a := by
    cases' a with a a
    · exact le_top
    change _ ≤ ite _ _ _
    split_ifs
    · exact le_top
    · exact some_le_some.2 (le_succ a)
  max_of_succ_le {a} ha := by
    cases a
    · exact isMax_top
    dsimp only at ha
    split_ifs at ha with ha'
    · exact (not_top_le_coe _ ha).elim
    · rw [some_eq_coe, coe_le_coe, succ_le_iff_eq_top] at ha
      exact (ha' ha).elim
  succ_le_of_lt {a b} h := by
    cases b
    · exact le_top
    cases a
    · exact (not_top_lt h).elim
    rw [some_lt_some] at h
    change ite _ _ _ ≤ _
    split_ifs with ha
    · rw [ha] at h
      exact (not_top_lt h).elim
    · exact some_le_some.2 (succ_le_of_lt h)
  le_of_lt_succ {a b} h := by
    cases a
    · 

Proof state:
case none
α : Type u_1
β : Type u_2
inst✝³ : DecidableEq α
inst✝² : PartialOrder α
inst✝¹ : OrderTop α
inst✝ : SuccOrder α
b : WithTop α
h :
  none <
    (fun a =>
        match a with
        | none => ⊤
        | Option.some a => if a = ⊤ then ⊤ else ↑(succ a))
      b
⊢ none ≤ b

Next tactic:
exact (not_top_lt h).elim
instance : SuccOrder (WithTop α) where
  succ a :=
    match a with
    | ⊤ => ⊤
    | Option.some a => ite (a = ⊤) ⊤ (some (succ a))
  le_succ a := by
    cases' a with a a
    · exact le_top
    change _ ≤ ite _ _ _
    split_ifs
    · exact le_top
    · exact some_le_some.2 (le_succ a)
  max_of_succ_le {a} ha := by
    cases a
    · exact isMax_top
    dsimp only at ha
    split_ifs at ha with ha'
    · exact (not_top_le_coe _ ha).elim
    · rw [some_eq_coe, coe_le_coe, succ_le_iff_eq_top] at ha
      exact (ha' ha).elim
  succ_le_of_lt {a b} h := by
    cases b
    · exact le_top
    cases a
    · exact (not_top_lt h).elim
    rw [some_lt_some] at h
    change ite _ _ _ ≤ _
    split_ifs with ha
    · rw [ha] at h
      exact (not_top_lt h).elim
    · exact some_le_some.2 (succ_le_of_lt h)
  le_of_lt_succ {a b} h := by
    cases a
    · exact (not_top_lt h).elim
    

Proof state:
case some
α : Type u_1
β : Type u_2
inst✝³ : DecidableEq α
inst✝² : PartialOrder α
inst✝¹ : OrderTop α
inst✝ : SuccOrder α
b : WithTop α
val✝ : α
h :
  Option.some val✝ <
    (fun a =>
        match a with
        | none => ⊤
        | Option.some a => if a = ⊤ then ⊤ else ↑(succ a))
      b
⊢ Option.some val✝ ≤ b

Next tactic:
cases b
instance : SuccOrder (WithTop α) where
  succ a :=
    match a with
    | ⊤ => ⊤
    | Option.some a => ite (a = ⊤) ⊤ (some (succ a))
  le_succ a := by
    cases' a with a a
    · exact le_top
    change _ ≤ ite _ _ _
    split_ifs
    · exact le_top
    · exact some_le_some.2 (le_succ a)
  max_of_succ_le {a} ha := by
    cases a
    · exact isMax_top
    dsimp only at ha
    split_ifs at ha with ha'
    · exact (not_top_le_coe _ ha).elim
    · rw [some_eq_coe, coe_le_coe, succ_le_iff_eq_top] at ha
      exact (ha' ha).elim
  succ_le_of_lt {a b} h := by
    cases b
    · exact le_top
    cases a
    · exact (not_top_lt h).elim
    rw [some_lt_some] at h
    change ite _ _ _ ≤ _
    split_ifs with ha
    · rw [ha] at h
      exact (not_top_lt h).elim
    · exact some_le_some.2 (succ_le_of_lt h)
  le_of_lt_succ {a b} h := by
    cases a
    · exact (not_top_lt h).elim
    cases b
    · 

Proof state:
case some.none
α : Type u_1
β : Type u_2
inst✝³ : DecidableEq α
inst✝² : PartialOrder α
inst✝¹ : OrderTop α
inst✝ : SuccOrder α
val✝ : α
h :
  Option.some val✝ <
    (fun a =>
        match a with
        | none => ⊤
        | Option.some a => if a = ⊤ then ⊤ else ↑(succ a))
      none
⊢ Option.some val✝ ≤ none

Next tactic:
exact le_top
instance : SuccOrder (WithTop α) where
  succ a :=
    match a with
    | ⊤ => ⊤
    | Option.some a => ite (a = ⊤) ⊤ (some (succ a))
  le_succ a := by
    cases' a with a a
    · exact le_top
    change _ ≤ ite _ _ _
    split_ifs
    · exact le_top
    · exact some_le_some.2 (le_succ a)
  max_of_succ_le {a} ha := by
    cases a
    · exact isMax_top
    dsimp only at ha
    split_ifs at ha with ha'
    · exact (not_top_le_coe _ ha).elim
    · rw [some_eq_coe, coe_le_coe, succ_le_iff_eq_top] at ha
      exact (ha' ha).elim
  succ_le_of_lt {a b} h := by
    cases b
    · exact le_top
    cases a
    · exact (not_top_lt h).elim
    rw [some_lt_some] at h
    change ite _ _ _ ≤ _
    split_ifs with ha
    · rw [ha] at h
      exact (not_top_lt h).elim
    · exact some_le_some.2 (succ_le_of_lt h)
  le_of_lt_succ {a b} h := by
    cases a
    · exact (not_top_lt h).elim
    cases b
    · exact le_top
    

Proof state:
case some.some
α : Type u_1
β : Type u_2
inst✝³ : DecidableEq α
inst✝² : PartialOrder α
inst✝¹ : OrderTop α
inst✝ : SuccOrder α
val✝¹ val✝ : α
h :
  Option.some val✝¹ <
    (fun a =>
        match a with
        | none => ⊤
        | Option.some a => if a = ⊤ then ⊤ else ↑(succ a))
      (Option.some val✝)
⊢ Option.some val✝¹ ≤ Option.some val✝

Next tactic:
dsimp only at h
instance : SuccOrder (WithTop α) where
  succ a :=
    match a with
    | ⊤ => ⊤
    | Option.some a => ite (a = ⊤) ⊤ (some (succ a))
  le_succ a := by
    cases' a with a a
    · exact le_top
    change _ ≤ ite _ _ _
    split_ifs
    · exact le_top
    · exact some_le_some.2 (le_succ a)
  max_of_succ_le {a} ha := by
    cases a
    · exact isMax_top
    dsimp only at ha
    split_ifs at ha with ha'
    · exact (not_top_le_coe _ ha).elim
    · rw [some_eq_coe, coe_le_coe, succ_le_iff_eq_top] at ha
      exact (ha' ha).elim
  succ_le_of_lt {a b} h := by
    cases b
    · exact le_top
    cases a
    · exact (not_top_lt h).elim
    rw [some_lt_some] at h
    change ite _ _ _ ≤ _
    split_ifs with ha
    · rw [ha] at h
      exact (not_top_lt h).elim
    · exact some_le_some.2 (succ_le_of_lt h)
  le_of_lt_succ {a b} h := by
    cases a
    · exact (not_top_lt h).elim
    cases b
    · exact le_top
    dsimp only at h
    

Proof state:
case some.some
α : Type u_1
β : Type u_2
inst✝³ : DecidableEq α
inst✝² : PartialOrder α
inst✝¹ : OrderTop α
inst✝ : SuccOrder α
val✝¹ val✝ : α
h : Option.some val✝¹ < if val✝ = ⊤ then ⊤ else ↑(succ val✝)
⊢ Option.some val✝¹ ≤ Option.some val✝

Next tactic:
rw [some_le_some]
instance : SuccOrder (WithTop α) where
  succ a :=
    match a with
    | ⊤ => ⊤
    | Option.some a => ite (a = ⊤) ⊤ (some (succ a))
  le_succ a := by
    cases' a with a a
    · exact le_top
    change _ ≤ ite _ _ _
    split_ifs
    · exact le_top
    · exact some_le_some.2 (le_succ a)
  max_of_succ_le {a} ha := by
    cases a
    · exact isMax_top
    dsimp only at ha
    split_ifs at ha with ha'
    · exact (not_top_le_coe _ ha).elim
    · rw [some_eq_coe, coe_le_coe, succ_le_iff_eq_top] at ha
      exact (ha' ha).elim
  succ_le_of_lt {a b} h := by
    cases b
    · exact le_top
    cases a
    · exact (not_top_lt h).elim
    rw [some_lt_some] at h
    change ite _ _ _ ≤ _
    split_ifs with ha
    · rw [ha] at h
      exact (not_top_lt h).elim
    · exact some_le_some.2 (succ_le_of_lt h)
  le_of_lt_succ {a b} h := by
    cases a
    · exact (not_top_lt h).elim
    cases b
    · exact le_top
    dsimp only at h
    rw [some_le_some]
    

Proof state:
case some.some
α : Type u_1
β : Type u_2
inst✝³ : DecidableEq α
inst✝² : PartialOrder α
inst✝¹ : OrderTop α
inst✝ : SuccOrder α
val✝¹ val✝ : α
h : Option.some val✝¹ < if val✝ = ⊤ then ⊤ else ↑(succ val✝)
⊢ val✝¹ ≤ val✝

Next tactic:
split_ifs at h with hb
instance : SuccOrder (WithTop α) where
  succ a :=
    match a with
    | ⊤ => ⊤
    | Option.some a => ite (a = ⊤) ⊤ (some (succ a))
  le_succ a := by
    cases' a with a a
    · exact le_top
    change _ ≤ ite _ _ _
    split_ifs
    · exact le_top
    · exact some_le_some.2 (le_succ a)
  max_of_succ_le {a} ha := by
    cases a
    · exact isMax_top
    dsimp only at ha
    split_ifs at ha with ha'
    · exact (not_top_le_coe _ ha).elim
    · rw [some_eq_coe, coe_le_coe, succ_le_iff_eq_top] at ha
      exact (ha' ha).elim
  succ_le_of_lt {a b} h := by
    cases b
    · exact le_top
    cases a
    · exact (not_top_lt h).elim
    rw [some_lt_some] at h
    change ite _ _ _ ≤ _
    split_ifs with ha
    · rw [ha] at h
      exact (not_top_lt h).elim
    · exact some_le_some.2 (succ_le_of_lt h)
  le_of_lt_succ {a b} h := by
    cases a
    · exact (not_top_lt h).elim
    cases b
    · exact le_top
    dsimp only at h
    rw [some_le_some]
    split_ifs at h with hb
    · 

Proof state:
case pos
α : Type u_1
β : Type u_2
inst✝³ : DecidableEq α
inst✝² : PartialOrder α
inst✝¹ : OrderTop α
inst✝ : SuccOrder α
val✝¹ val✝ : α
hb : val✝ = ⊤
h : Option.some val✝¹ < ⊤
⊢ val✝¹ ≤ val✝

Next tactic:
rw [hb]
instance : SuccOrder (WithTop α) where
  succ a :=
    match a with
    | ⊤ => ⊤
    | Option.some a => ite (a = ⊤) ⊤ (some (succ a))
  le_succ a := by
    cases' a with a a
    · exact le_top
    change _ ≤ ite _ _ _
    split_ifs
    · exact le_top
    · exact some_le_some.2 (le_succ a)
  max_of_succ_le {a} ha := by
    cases a
    · exact isMax_top
    dsimp only at ha
    split_ifs at ha with ha'
    · exact (not_top_le_coe _ ha).elim
    · rw [some_eq_coe, coe_le_coe, succ_le_iff_eq_top] at ha
      exact (ha' ha).elim
  succ_le_of_lt {a b} h := by
    cases b
    · exact le_top
    cases a
    · exact (not_top_lt h).elim
    rw [some_lt_some] at h
    change ite _ _ _ ≤ _
    split_ifs with ha
    · rw [ha] at h
      exact (not_top_lt h).elim
    · exact some_le_some.2 (succ_le_of_lt h)
  le_of_lt_succ {a b} h := by
    cases a
    · exact (not_top_lt h).elim
    cases b
    · exact le_top
    dsimp only at h
    rw [some_le_some]
    split_ifs at h with hb
    · rw [hb]
      

Proof state:
case pos
α : Type u_1
β : Type u_2
inst✝³ : DecidableEq α
inst✝² : PartialOrder α
inst✝¹ : OrderTop α
inst✝ : SuccOrder α
val✝¹ val✝ : α
hb : val✝ = ⊤
h : Option.some val✝¹ < ⊤
⊢ val✝¹ ≤ ⊤

Next tactic:
exact le_top
instance : SuccOrder (WithTop α) where
  succ a :=
    match a with
    | ⊤ => ⊤
    | Option.some a => ite (a = ⊤) ⊤ (some (succ a))
  le_succ a := by
    cases' a with a a
    · exact le_top
    change _ ≤ ite _ _ _
    split_ifs
    · exact le_top
    · exact some_le_some.2 (le_succ a)
  max_of_succ_le {a} ha := by
    cases a
    · exact isMax_top
    dsimp only at ha
    split_ifs at ha with ha'
    · exact (not_top_le_coe _ ha).elim
    · rw [some_eq_coe, coe_le_coe, succ_le_iff_eq_top] at ha
      exact (ha' ha).elim
  succ_le_of_lt {a b} h := by
    cases b
    · exact le_top
    cases a
    · exact (not_top_lt h).elim
    rw [some_lt_some] at h
    change ite _ _ _ ≤ _
    split_ifs with ha
    · rw [ha] at h
      exact (not_top_lt h).elim
    · exact some_le_some.2 (succ_le_of_lt h)
  le_of_lt_succ {a b} h := by
    cases a
    · exact (not_top_lt h).elim
    cases b
    · exact le_top
    dsimp only at h
    rw [some_le_some]
    split_ifs at h with hb
    · rw [hb]
      exact le_top
    · 

Proof state:
case neg
α : Type u_1
β : Type u_2
inst✝³ : DecidableEq α
inst✝² : PartialOrder α
inst✝¹ : OrderTop α
inst✝ : SuccOrder α
val✝¹ val✝ : α
hb : ¬val✝ = ⊤
h : Option.some val✝¹ < ↑(succ val✝)
⊢ val✝¹ ≤ val✝

Next tactic:
exact le_of_lt_succ (some_lt_some.1 h)
instance : PredOrder (WithTop α) where
  pred a :=
    match a with
    | ⊤ => some ⊤
    | Option.some a => some (pred a)
  pred_le a :=
    match a with
    | ⊤ => le_top
    | Option.some a => some_le_some.2 (pred_le a)
  min_of_le_pred {a} ha := by
    

Proof state:
α : Type u_1
β : Type u_2
inst✝² : Preorder α
inst✝¹ : OrderTop α
inst✝ : PredOrder α
a : WithTop α
ha :
  a ≤
    (fun a =>
        match a with
        | none => ↑⊤
        | Option.some a => ↑(pred a))
      a
⊢ IsMin a

Next tactic:
cases a
instance : PredOrder (WithTop α) where
  pred a :=
    match a with
    | ⊤ => some ⊤
    | Option.some a => some (pred a)
  pred_le a :=
    match a with
    | ⊤ => le_top
    | Option.some a => some_le_some.2 (pred_le a)
  min_of_le_pred {a} ha := by
    cases a
    · 

Proof state:
case none
α : Type u_1
β : Type u_2
inst✝² : Preorder α
inst✝¹ : OrderTop α
inst✝ : PredOrder α
ha :
  none ≤
    (fun a =>
        match a with
        | none => ↑⊤
        | Option.some a => ↑(pred a))
      none
⊢ IsMin none

Next tactic:
exact ((coe_lt_top (⊤ : α)).not_le ha).elim
instance : PredOrder (WithTop α) where
  pred a :=
    match a with
    | ⊤ => some ⊤
    | Option.some a => some (pred a)
  pred_le a :=
    match a with
    | ⊤ => le_top
    | Option.some a => some_le_some.2 (pred_le a)
  min_of_le_pred {a} ha := by
    cases a
    · exact ((coe_lt_top (⊤ : α)).not_le ha).elim
    · 

Proof state:
case some
α : Type u_1
β : Type u_2
inst✝² : Preorder α
inst✝¹ : OrderTop α
inst✝ : PredOrder α
val✝ : α
ha :
  Option.some val✝ ≤
    (fun a =>
        match a with
        | none => ↑⊤
        | Option.some a => ↑(pred a))
      (Option.some val✝)
⊢ IsMin (Option.some val✝)

Next tactic:
exact (min_of_le_pred <| some_le_some.1 ha).withTop
instance : PredOrder (WithTop α) where
  pred a :=
    match a with
    | ⊤ => some ⊤
    | Option.some a => some (pred a)
  pred_le a :=
    match a with
    | ⊤ => le_top
    | Option.some a => some_le_some.2 (pred_le a)
  min_of_le_pred {a} ha := by
    cases a
    · exact ((coe_lt_top (⊤ : α)).not_le ha).elim
    · exact (min_of_le_pred <| some_le_some.1 ha).withTop
  le_pred_of_lt {a b} h := by
    

Proof state:
α : Type u_1
β : Type u_2
inst✝² : Preorder α
inst✝¹ : OrderTop α
inst✝ : PredOrder α
a b : WithTop α
h : a < b
⊢ a ≤
    (fun a =>
        match a with
        | none => ↑⊤
        | Option.some a => ↑(pred a))
      b

Next tactic:
cases a
instance : PredOrder (WithTop α) where
  pred a :=
    match a with
    | ⊤ => some ⊤
    | Option.some a => some (pred a)
  pred_le a :=
    match a with
    | ⊤ => le_top
    | Option.some a => some_le_some.2 (pred_le a)
  min_of_le_pred {a} ha := by
    cases a
    · exact ((coe_lt_top (⊤ : α)).not_le ha).elim
    · exact (min_of_le_pred <| some_le_some.1 ha).withTop
  le_pred_of_lt {a b} h := by
    cases a
    · 

Proof state:
case none
α : Type u_1
β : Type u_2
inst✝² : Preorder α
inst✝¹ : OrderTop α
inst✝ : PredOrder α
b : WithTop α
h : none < b
⊢ none ≤
    (fun a =>
        match a with
        | none => ↑⊤
        | Option.some a => ↑(pred a))
      b

Next tactic:
exact (le_top.not_lt h).elim