Theorem: PosNum.cmp_to_nat
File: Mathlib/Data/Num/Lemmas.lean

tactic: have := cmp_to_nat a b
state_before: α : Type ?u.145219
a b : PosNum
⊢ Ordering.casesOn (cmp (bit0 a) (bit0 b)) (↑(bit0 a) < ↑(bit0 b)) (bit0 a = bit0 b) (↑(bit0 b) < ↑(bit0 a))

tactic: revert this
state_before: α : Type ?u.145219
a b : PosNum
this : Ordering.casesOn (cmp a b) (↑a < ↑b) (a = b) (↑b < ↑a)
⊢ Ordering.casesOn (cmp (bit0 a) (bit0 b)) (↑(bit0 a) < ↑(bit0 b)) (bit0 a = bit0 b) (↑(bit0 b) < ↑(bit0 a))

tactic: cases cmp a b <;> dsimp <;> intro this
state_before: α : Type ?u.145219
a b : PosNum
⊢ Ordering.casesOn (cmp a b) (↑a < ↑b) (a = b) (↑b < ↑a) →
    Ordering.casesOn (cmp (bit0 a) (bit0 b)) (↑(bit0 a) < ↑(bit0 b)) (bit0 a = bit0 b) (↑(bit0 b) < ↑(bit0 a))

tactic: exact add_lt_add this this
state_before: case lt
α : Type ?u.145219
a b : PosNum
this : ↑a < ↑b
⊢ _root_.bit0 ↑a < _root_.bit0 ↑b

tactic: rw [this]
state_before: case eq
α : Type ?u.145219
a b : PosNum
this : a = b
⊢ bit0 a = bit0 b

tactic: exact add_lt_add this this
state_before: case gt
α : Type ?u.145219
a b : PosNum
this : ↑b < ↑a
⊢ _root_.bit0 ↑b < _root_.bit0 ↑a

tactic: dsimp [cmp]
state_before: α : Type ?u.145219
a b : PosNum
⊢ Ordering.casesOn (cmp (bit0 a) (bit1 b)) (↑(bit0 a) < ↑(bit1 b)) (bit0 a = bit1 b) (↑(bit1 b) < ↑(bit0 a))

tactic: have := cmp_to_nat a b
state_before: α : Type ?u.145219
a b : PosNum
⊢ Ordering.rec (_root_.bit0 ↑a < _root_.bit1 ↑b) (bit0 a = bit1 b) (_root_.bit1 ↑b < _root_.bit0 ↑a)
    (Ordering.rec Ordering.lt Ordering.lt Ordering.gt (cmp a b))

tactic: revert this
state_before: α : Type ?u.145219
a b : PosNum
this : Ordering.casesOn (cmp a b) (↑a < ↑b) (a = b) (↑b < ↑a)
⊢ Ordering.rec (_root_.bit0 ↑a < _root_.bit1 ↑b) (bit0 a = bit1 b) (_root_.bit1 ↑b < _root_.bit0 ↑a)
    (Ordering.rec Ordering.lt Ordering.lt Ordering.gt (cmp a b))

tactic: cases cmp a b <;> dsimp <;> intro this
state_before: α : Type ?u.145219
a b : PosNum
⊢ Ordering.casesOn (cmp a b) (↑a < ↑b) (a = b) (↑b < ↑a) →
    Ordering.rec (_root_.bit0 ↑a < _root_.bit1 ↑b) (bit0 a = bit1 b) (_root_.bit1 ↑b < _root_.bit0 ↑a)
      (Ordering.rec Ordering.lt Ordering.lt Ordering.gt (cmp a b))

tactic: exact Nat.le_succ_of_le (add_lt_add this this)
state_before: case lt
α : Type ?u.145219
a b : PosNum
this : ↑a < ↑b
⊢ _root_.bit0 ↑a < _root_.bit1 ↑b

tactic: rw [this]
state_before: case eq
α : Type ?u.145219
a b : PosNum
this : a = b
⊢ _root_.bit0 ↑a < _root_.bit1 ↑b

tactic: apply Nat.lt_succ_self
state_before: case eq
α : Type ?u.145219
a b : PosNum
this : a = b
⊢ _root_.bit0 ↑b < _root_.bit1 ↑b

tactic: exact cmp_to_nat_lemma this
state_before: case gt
α : Type ?u.145219
a b : PosNum
this : ↑b < ↑a
⊢ _root_.bit1 ↑b < _root_.bit0 ↑a

tactic: dsimp [cmp]
state_before: α : Type ?u.145219
a b : PosNum
⊢ Ordering.casesOn (cmp (bit1 a) (bit0 b)) (↑(bit1 a) < ↑(bit0 b)) (bit1 a = bit0 b) (↑(bit0 b) < ↑(bit1 a))

tactic: have := cmp_to_nat a b
state_before: α : Type ?u.145219
a b : PosNum
⊢ Ordering.rec (_root_.bit1 ↑a < _root_.bit0 ↑b) (bit1 a = bit0 b) (_root_.bit0 ↑b < _root_.bit1 ↑a)
    (Ordering.rec Ordering.lt Ordering.gt Ordering.gt (cmp a b))

tactic: revert this
state_before: α : Type ?u.145219
a b : PosNum
this : Ordering.casesOn (cmp a b) (↑a < ↑b) (a = b) (↑b < ↑a)
⊢ Ordering.rec (_root_.bit1 ↑a < _root_.bit0 ↑b) (bit1 a = bit0 b) (_root_.bit0 ↑b < _root_.bit1 ↑a)
    (Ordering.rec Ordering.lt Ordering.gt Ordering.gt (cmp a b))

tactic: cases cmp a b <;> dsimp <;> intro this
state_before: α : Type ?u.145219
a b : PosNum
⊢ Ordering.casesOn (cmp a b) (↑a < ↑b) (a = b) (↑b < ↑a) →
    Ordering.rec (_root_.bit1 ↑a < _root_.bit0 ↑b) (bit1 a = bit0 b) (_root_.bit0 ↑b < _root_.bit1 ↑a)
      (Ordering.rec Ordering.lt Ordering.gt Ordering.gt (cmp a b))

tactic: exact cmp_to_nat_lemma this
state_before: case lt
α : Type ?u.145219
a b : PosNum
this : ↑a < ↑b
⊢ _root_.bit1 ↑a < _root_.bit0 ↑b

tactic: rw [this]
state_before: case eq
α : Type ?u.145219
a b : PosNum
this : a = b
⊢ _root_.bit0 ↑b < _root_.bit1 ↑a

tactic: apply Nat.lt_succ_self
state_before: case eq
α : Type ?u.145219
a b : PosNum
this : a = b
⊢ _root_.bit0 ↑b < _root_.bit1 ↑b

tactic: exact Nat.le_succ_of_le (add_lt_add this this)
state_before: case gt
α : Type ?u.145219
a b : PosNum
this : ↑b < ↑a
⊢ _root_.bit0 ↑b < _root_.bit1 ↑a

tactic: have := cmp_to_nat a b
state_before: α : Type ?u.145219
a b : PosNum
⊢ Ordering.casesOn (cmp (bit1 a) (bit1 b)) (↑(bit1 a) < ↑(bit1 b)) (bit1 a = bit1 b) (↑(bit1 b) < ↑(bit1 a))

tactic: revert this
state_before: α : Type ?u.145219
a b : PosNum
this : Ordering.casesOn (cmp a b) (↑a < ↑b) (a = b) (↑b < ↑a)
⊢ Ordering.casesOn (cmp (bit1 a) (bit1 b)) (↑(bit1 a) < ↑(bit1 b)) (bit1 a = bit1 b) (↑(bit1 b) < ↑(bit1 a))

tactic: cases cmp a b <;> dsimp <;> intro this
state_before: α : Type ?u.145219
a b : PosNum
⊢ Ordering.casesOn (cmp a b) (↑a < ↑b) (a = b) (↑b < ↑a) →
    Ordering.casesOn (cmp (bit1 a) (bit1 b)) (↑(bit1 a) < ↑(bit1 b)) (bit1 a = bit1 b) (↑(bit1 b) < ↑(bit1 a))

tactic: exact Nat.succ_lt_succ (add_lt_add this this)
state_before: case lt
α : Type ?u.145219
a b : PosNum
this : ↑a < ↑b
⊢ _root_.bit1 ↑a < _root_.bit1 ↑b

tactic: rw [this]
state_before: case eq
α : Type ?u.145219
a b : PosNum
this : a = b
⊢ bit1 a = bit1 b

tactic: exact Nat.succ_lt_succ (add_lt_add this this)
state_before: case gt
α : Type ?u.145219
a b : PosNum
this : ↑b < ↑a
⊢ _root_.bit1 ↑b < _root_.bit1 ↑a