Theorem: Num.shiftr_to_nat
File: Mathlib/Data/Num/Lemmas.lean

tactic: cases' m with m <;> dsimp only [shiftr]
state_before: α : Type ?u.624959
m : Num
n : ℕ
⊢ ↑(shiftr m n) = Nat.shiftr (↑m) n

tactic: induction' n with n IH generalizing m
state_before: case pos
α : Type ?u.624959
n : ℕ
m : PosNum
⊢ ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n

tactic: cases' m with m m <;> dsimp only [PosNum.shiftr]
state_before: case pos.succ
α : Type ?u.624959
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ ↑(PosNum.shiftr m (Nat.succ n)) = Nat.shiftr (↑(pos m)) (Nat.succ n)

tactic: symm
state_before: case zero
α : Type ?u.624959
n : ℕ
⊢ ↑0 = Nat.shiftr (↑zero) n

tactic: apply Nat.zero_shiftr
state_before: case zero
α : Type ?u.624959
n : ℕ
⊢ Nat.shiftr (↑zero) n = ↑0

tactic: cases m <;> rfl
state_before: case pos.zero
α : Type ?u.624959
m✝ m : PosNum
⊢ ↑(PosNum.shiftr m Nat.zero) = Nat.shiftr (↑(pos m)) Nat.zero

tactic: rw [Nat.shiftr_eq_div_pow]
state_before: case pos.succ.one
α : Type ?u.624959
m : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
⊢ ↑0 = Nat.shiftr (↑(pos one)) (Nat.succ n)

tactic: symm
state_before: case pos.succ.one
α : Type ?u.624959
m : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
⊢ ↑0 = ↑(pos one) / 2 ^ Nat.succ n

tactic: apply Nat.div_eq_of_lt
state_before: case pos.succ.one
α : Type ?u.624959
m : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
⊢ ↑(pos one) / 2 ^ Nat.succ n = ↑0

tactic: exact @Nat.pow_lt_pow_of_lt_right 2 (by decide) 0 (n + 1) (Nat.succ_pos _)
state_before: case pos.succ.one.h₀
α : Type ?u.624959
m : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
⊢ ↑(pos one) < 2 ^ Nat.succ n

tactic: decide
state_before: α : Type ?u.624959
m : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
⊢ 1 < 2

tactic: trans
state_before: case pos.succ.bit1
α : Type ?u.624959
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos (PosNum.bit1 m))) (Nat.succ n)

tactic: apply IH
state_before: α : Type ?u.624959
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ ↑(PosNum.shiftr m n) = ?m.628320

α : Type ?u.624959
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ ?m.628320 = Nat.shiftr (↑(pos (PosNum.bit1 m))) (Nat.succ n)

α : Type ?u.624959
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ ℕ

tactic: change Nat.shiftr m n = Nat.shiftr (_root_.bit1 m) (n + 1)
state_before: α : Type ?u.624959
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ Nat.shiftr (↑(pos m)) n = Nat.shiftr (↑(pos (PosNum.bit1 m))) (Nat.succ n)

tactic: rw [add_comm n 1, Nat.shiftr_add]
state_before: α : Type ?u.624959
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ Nat.shiftr (↑m) n = Nat.shiftr (_root_.bit1 ↑m) (n + 1)

tactic: apply congr_arg fun x => Nat.shiftr x n
state_before: α : Type ?u.624959
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ Nat.shiftr (↑m) n = Nat.shiftr (Nat.shiftr (_root_.bit1 ↑m) 1) n

tactic: repeat unfold Nat.shiftr
state_before: α : Type ?u.624959
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ ↑m = Nat.shiftr (_root_.bit1 ↑m) 1

tactic: change (m : ℕ) = Nat.div2 (Nat.bit true m)
state_before: α : Type ?u.624959
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ ↑m = Nat.div2 (_root_.bit1 ↑m)

tactic: rw [Nat.div2_bit]
state_before: α : Type ?u.624959
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ ↑m = Nat.div2 (Nat.bit true ↑m)

tactic: unfold Nat.shiftr
state_before: α : Type ?u.624959
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ ↑m = Nat.div2 (_root_.bit1 ↑m)

tactic: trans
state_before: case pos.succ.bit0
α : Type ?u.624959
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos (PosNum.bit0 m))) (Nat.succ n)

tactic: apply IH
state_before: α : Type ?u.624959
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ ↑(PosNum.shiftr m n) = ?m.631988

α : Type ?u.624959
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ ?m.631988 = Nat.shiftr (↑(pos (PosNum.bit0 m))) (Nat.succ n)

α : Type ?u.624959
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ ℕ

tactic: change Nat.shiftr m n = Nat.shiftr (_root_.bit0 m) (n + 1)
state_before: α : Type ?u.624959
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ Nat.shiftr (↑(pos m)) n = Nat.shiftr (↑(pos (PosNum.bit0 m))) (Nat.succ n)

tactic: rw [add_comm n 1, Nat.shiftr_add]
state_before: α : Type ?u.624959
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ Nat.shiftr (↑m) n = Nat.shiftr (_root_.bit0 ↑m) (n + 1)

tactic: apply congr_arg fun x => Nat.shiftr x n
state_before: α : Type ?u.624959
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ Nat.shiftr (↑m) n = Nat.shiftr (Nat.shiftr (_root_.bit0 ↑m) 1) n

tactic: repeat unfold Nat.shiftr
state_before: α : Type ?u.624959
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ ↑m = Nat.shiftr (_root_.bit0 ↑m) 1

tactic: change (m : ℕ) = Nat.div2 (Nat.bit false m)
state_before: α : Type ?u.624959
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ ↑m = Nat.div2 (_root_.bit0 ↑m)

tactic: rw [Nat.div2_bit]
state_before: α : Type ?u.624959
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ ↑m = Nat.div2 (Nat.bit false ↑m)

tactic: unfold Nat.shiftr
state_before: α : Type ?u.624959
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ ↑m = Nat.div2 (_root_.bit0 ↑m)