l3lab/ntp-mathlib huggingface dataset:
@[simp, norm_cast]

theorem castNum_shiftRight (m : Num) (n : Nat) : ↑(m >>> n) = (m : ℕ) >>> (n : ℕ)  := by
  cases' m with m <;> dsimp only [← shiftr_eq_shiftRight, shiftr];
  · 

Proof state:
case zero
α : Type u_1
n : ℕ
⊢ ↑0 = ↑zero >>> n

Next tactic:
symm
@[simp, norm_cast]

theorem castNum_shiftRight (m : Num) (n : Nat) : ↑(m >>> n) = (m : ℕ) >>> (n : ℕ)  := by
  cases' m with m <;> dsimp only [← shiftr_eq_shiftRight, shiftr];
  · symm
    

Proof state:
case zero
α : Type u_1
n : ℕ
⊢ ↑zero >>> n = ↑0

Next tactic:
apply Nat.zero_shiftRight
@[simp, norm_cast]

theorem castNum_shiftRight (m : Num) (n : Nat) : ↑(m >>> n) = (m : ℕ) >>> (n : ℕ)  := by
  cases' m with m <;> dsimp only [← shiftr_eq_shiftRight, shiftr];
  · symm
    apply Nat.zero_shiftRight
  

Proof state:
case pos
α : Type u_1
n : ℕ
m : PosNum
⊢ ↑(m >>> n) = ↑(pos m) >>> n

Next tactic:
induction' n with n IH generalizing m
@[simp, norm_cast]

theorem castNum_shiftRight (m : Num) (n : Nat) : ↑(m >>> n) = (m : ℕ) >>> (n : ℕ)  := by
  cases' m with m <;> dsimp only [← shiftr_eq_shiftRight, shiftr];
  · symm
    apply Nat.zero_shiftRight
  induction' n with n IH generalizing m
  · 

Proof state:
case pos.zero
α : Type u_1
m : PosNum
⊢ ↑(m >>> Nat.zero) = ↑(pos m) >>> Nat.zero

Next tactic:
cases m
@[simp, norm_cast]

theorem castNum_shiftRight (m : Num) (n : Nat) : ↑(m >>> n) = (m : ℕ) >>> (n : ℕ)  := by
  cases' m with m <;> dsimp only [← shiftr_eq_shiftRight, shiftr];
  · symm
    apply Nat.zero_shiftRight
  induction' n with n IH generalizing m
  · cases m <;> 

Proof state:
case pos.zero.one
α : Type u_1
⊢ ↑(one >>> Nat.zero) = ↑(pos one) >>> Nat.zero

Next tactic:
rfl
@[simp, norm_cast]

theorem castNum_shiftRight (m : Num) (n : Nat) : ↑(m >>> n) = (m : ℕ) >>> (n : ℕ)  := by
  cases' m with m <;> dsimp only [← shiftr_eq_shiftRight, shiftr];
  · symm
    apply Nat.zero_shiftRight
  induction' n with n IH generalizing m
  · cases m <;> 

Proof state:
case pos.zero.bit1
α : Type u_1
a✝ : PosNum
⊢ ↑(PosNum.bit1 a✝ >>> Nat.zero) = ↑(pos (PosNum.bit1 a✝)) >>> Nat.zero

Next tactic:
rfl
@[simp, norm_cast]

theorem castNum_shiftRight (m : Num) (n : Nat) : ↑(m >>> n) = (m : ℕ) >>> (n : ℕ)  := by
  cases' m with m <;> dsimp only [← shiftr_eq_shiftRight, shiftr];
  · symm
    apply Nat.zero_shiftRight
  induction' n with n IH generalizing m
  · cases m <;> 

Proof state:
case pos.zero.bit0
α : Type u_1
a✝ : PosNum
⊢ ↑(PosNum.bit0 a✝ >>> Nat.zero) = ↑(pos (PosNum.bit0 a✝)) >>> Nat.zero

Next tactic:
rfl
@[simp, norm_cast]

theorem castNum_shiftRight (m : Num) (n : Nat) : ↑(m >>> n) = (m : ℕ) >>> (n : ℕ)  := by
  cases' m with m <;> dsimp only [← shiftr_eq_shiftRight, shiftr];
  · symm
    apply Nat.zero_shiftRight
  induction' n with n IH generalizing m
  · cases m <;> rfl
  

Proof state:
case pos.succ
α : Type u_1
n : ℕ
IH : ∀ (m : PosNum), ↑(m >>> n) = ↑(pos m) >>> n
m : PosNum
⊢ ↑(m >>> Nat.succ n) = ↑(pos m) >>> Nat.succ n

Next tactic:
cases' m with m m
@[simp, norm_cast]

theorem castNum_shiftRight (m : Num) (n : Nat) : ↑(m >>> n) = (m : ℕ) >>> (n : ℕ)  := by
  cases' m with m <;> dsimp only [← shiftr_eq_shiftRight, shiftr];
  · symm
    apply Nat.zero_shiftRight
  induction' n with n IH generalizing m
  · cases m <;> rfl
  cases' m with m m <;> 

Proof state:
case pos.succ.one
α : Type u_1
n : ℕ
IH : ∀ (m : PosNum), ↑(m >>> n) = ↑(pos m) >>> n
⊢ ↑(one >>> Nat.succ n) = ↑(pos one) >>> Nat.succ n

Next tactic:
dsimp only [PosNum.shiftr, ← PosNum.shiftr_eq_shiftRight]
@[simp, norm_cast]

theorem castNum_shiftRight (m : Num) (n : Nat) : ↑(m >>> n) = (m : ℕ) >>> (n : ℕ)  := by
  cases' m with m <;> dsimp only [← shiftr_eq_shiftRight, shiftr];
  · symm
    apply Nat.zero_shiftRight
  induction' n with n IH generalizing m
  · cases m <;> rfl
  cases' m with m m <;> 

Proof state:
case pos.succ.bit1
α : Type u_1
n : ℕ
IH : ∀ (m : PosNum), ↑(m >>> n) = ↑(pos m) >>> n
m : PosNum
⊢ ↑(PosNum.bit1 m >>> Nat.succ n) = ↑(pos (PosNum.bit1 m)) >>> Nat.succ n

Next tactic:
dsimp only [PosNum.shiftr, ← PosNum.shiftr_eq_shiftRight]
@[simp, norm_cast]

theorem castNum_shiftRight (m : Num) (n : Nat) : ↑(m >>> n) = (m : ℕ) >>> (n : ℕ)  := by
  cases' m with m <;> dsimp only [← shiftr_eq_shiftRight, shiftr];
  · symm
    apply Nat.zero_shiftRight
  induction' n with n IH generalizing m
  · cases m <;> rfl
  cases' m with m m <;> 

Proof state:
case pos.succ.bit0
α : Type u_1
n : ℕ
IH : ∀ (m : PosNum), ↑(m >>> n) = ↑(pos m) >>> n
m : PosNum
⊢ ↑(PosNum.bit0 m >>> Nat.succ n) = ↑(pos (PosNum.bit0 m)) >>> Nat.succ n

Next tactic:
dsimp only [PosNum.shiftr, ← PosNum.shiftr_eq_shiftRight]
@[simp, norm_cast]

theorem castNum_shiftRight (m : Num) (n : Nat) : ↑(m >>> n) = (m : ℕ) >>> (n : ℕ)  := by
  cases' m with m <;> dsimp only [← shiftr_eq_shiftRight, shiftr];
  · symm
    apply Nat.zero_shiftRight
  induction' n with n IH generalizing m
  · cases m <;> rfl
  cases' m with m m <;> dsimp only [PosNum.shiftr, ← PosNum.shiftr_eq_shiftRight]
  · 

Proof state:
case pos.succ.one
α : Type u_1
n : ℕ
IH : ∀ (m : PosNum), ↑(m >>> n) = ↑(pos m) >>> n
⊢ ↑0 = ↑(pos one) >>> Nat.succ n

Next tactic:
rw [Nat.shiftRight_eq_div_pow]
@[simp, norm_cast]

theorem castNum_shiftRight (m : Num) (n : Nat) : ↑(m >>> n) = (m : ℕ) >>> (n : ℕ)  := by
  cases' m with m <;> dsimp only [← shiftr_eq_shiftRight, shiftr];
  · symm
    apply Nat.zero_shiftRight
  induction' n with n IH generalizing m
  · cases m <;> rfl
  cases' m with m m <;> dsimp only [PosNum.shiftr, ← PosNum.shiftr_eq_shiftRight]
  · rw [Nat.shiftRight_eq_div_pow]
    

Proof state:
case pos.succ.one
α : Type u_1
n : ℕ
IH : ∀ (m : PosNum), ↑(m >>> n) = ↑(pos m) >>> n
⊢ ↑0 = ↑(pos one) / 2 ^ Nat.succ n

Next tactic:
symm
@[simp, norm_cast]

theorem castNum_shiftRight (m : Num) (n : Nat) : ↑(m >>> n) = (m : ℕ) >>> (n : ℕ)  := by
  cases' m with m <;> dsimp only [← shiftr_eq_shiftRight, shiftr];
  · symm
    apply Nat.zero_shiftRight
  induction' n with n IH generalizing m
  · cases m <;> rfl
  cases' m with m m <;> dsimp only [PosNum.shiftr, ← PosNum.shiftr_eq_shiftRight]
  · rw [Nat.shiftRight_eq_div_pow]
    symm
    

Proof state:
case pos.succ.one
α : Type u_1
n : ℕ
IH : ∀ (m : PosNum), ↑(m >>> n) = ↑(pos m) >>> n
⊢ ↑(pos one) / 2 ^ Nat.succ n = ↑0

Next tactic:
apply Nat.div_eq_of_lt
@[simp, norm_cast]

theorem castNum_shiftRight (m : Num) (n : Nat) : ↑(m >>> n) = (m : ℕ) >>> (n : ℕ)  := by
  cases' m with m <;> dsimp only [← shiftr_eq_shiftRight, shiftr];
  · symm
    apply Nat.zero_shiftRight
  induction' n with n IH generalizing m
  · cases m <;> rfl
  cases' m with m m <;> dsimp only [PosNum.shiftr, ← PosNum.shiftr_eq_shiftRight]
  · rw [Nat.shiftRight_eq_div_pow]
    symm
    apply Nat.div_eq_of_lt
    

Proof state:
case pos.succ.one.h₀
α : Type u_1
n : ℕ
IH : ∀ (m : PosNum), ↑(m >>> n) = ↑(pos m) >>> n
⊢ ↑(pos one) < 2 ^ Nat.succ n

Next tactic:
simp
@[simp, norm_cast]

theorem castNum_shiftRight (m : Num) (n : Nat) : ↑(m >>> n) = (m : ℕ) >>> (n : ℕ)  := by
  cases' m with m <;> dsimp only [← shiftr_eq_shiftRight, shiftr];
  · symm
    apply Nat.zero_shiftRight
  induction' n with n IH generalizing m
  · cases m <;> rfl
  cases' m with m m <;> dsimp only [PosNum.shiftr, ← PosNum.shiftr_eq_shiftRight]
  · rw [Nat.shiftRight_eq_div_pow]
    symm
    apply Nat.div_eq_of_lt
    simp
  · 

Proof state:
case pos.succ.bit1
α : Type u_1
n : ℕ
IH : ∀ (m : PosNum), ↑(m >>> n) = ↑(pos m) >>> n
m : PosNum
⊢ ↑(PosNum.shiftr m n) = ↑(pos (PosNum.bit1 m)) >>> Nat.succ n

Next tactic:
trans
@[simp, norm_cast]

theorem castNum_shiftRight (m : Num) (n : Nat) : ↑(m >>> n) = (m : ℕ) >>> (n : ℕ)  := by
  cases' m with m <;> dsimp only [← shiftr_eq_shiftRight, shiftr];
  · symm
    apply Nat.zero_shiftRight
  induction' n with n IH generalizing m
  · cases m <;> rfl
  cases' m with m m <;> dsimp only [PosNum.shiftr, ← PosNum.shiftr_eq_shiftRight]
  · rw [Nat.shiftRight_eq_div_pow]
    symm
    apply Nat.div_eq_of_lt
    simp
  · trans
    

Proof state:
α : Type u_1
n : ℕ
IH : ∀ (m : PosNum), ↑(m >>> n) = ↑(pos m) >>> n
m : PosNum
⊢ ↑(PosNum.shiftr m n) = ?m.666993
α : Type u_1
n : ℕ
IH : ∀ (m : PosNum), ↑(m >>> n) = ↑(pos m) >>> n
m : PosNum
⊢ ?m.666993 = ↑(pos (PosNum.bit1 m)) >>> Nat.succ n
α : Type u_1 n : ℕ IH : ∀ (m : PosNum), ↑(m >>> n) = ↑(pos m) >>> n m : PosNum ⊢ ℕ

Next tactic:
apply IH
@[simp, norm_cast]

theorem castNum_shiftRight (m : Num) (n : Nat) : ↑(m >>> n) = (m : ℕ) >>> (n : ℕ)  := by
  cases' m with m <;> dsimp only [← shiftr_eq_shiftRight, shiftr];
  · symm
    apply Nat.zero_shiftRight
  induction' n with n IH generalizing m
  · cases m <;> rfl
  cases' m with m m <;> dsimp only [PosNum.shiftr, ← PosNum.shiftr_eq_shiftRight]
  · rw [Nat.shiftRight_eq_div_pow]
    symm
    apply Nat.div_eq_of_lt
    simp
  · trans
    apply IH
    

Proof state:
α : Type u_1
n : ℕ
IH : ∀ (m : PosNum), ↑(m >>> n) = ↑(pos m) >>> n
m : PosNum
⊢ ↑(pos m) >>> n = ↑(pos (PosNum.bit1 m)) >>> Nat.succ n

Next tactic:
change Nat.shiftRight m n = Nat.shiftRight (_root_.bit1 m) (n + 1)
@[simp, norm_cast]

theorem castNum_shiftRight (m : Num) (n : Nat) : ↑(m >>> n) = (m : ℕ) >>> (n : ℕ)  := by
  cases' m with m <;> dsimp only [← shiftr_eq_shiftRight, shiftr];
  · symm
    apply Nat.zero_shiftRight
  induction' n with n IH generalizing m
  · cases m <;> rfl
  cases' m with m m <;> dsimp only [PosNum.shiftr, ← PosNum.shiftr_eq_shiftRight]
  · rw [Nat.shiftRight_eq_div_pow]
    symm
    apply Nat.div_eq_of_lt
    simp
  · trans
    apply IH
    change Nat.shiftRight m n = Nat.shiftRight (_root_.bit1 m) (n + 1)
    

Proof state:
α : Type u_1
n : ℕ
IH : ∀ (m : PosNum), ↑(m >>> n) = ↑(pos m) >>> n
m : PosNum
⊢ Nat.shiftRight (↑m) n = Nat.shiftRight (_root_.bit1 ↑m) (n + 1)

Next tactic:
rw [add_comm n 1, @Nat.shiftRight_eq _ (1 + n), Nat.shiftRight_add]
@[simp, norm_cast]

theorem castNum_shiftRight (m : Num) (n : Nat) : ↑(m >>> n) = (m : ℕ) >>> (n : ℕ)  := by
  cases' m with m <;> dsimp only [← shiftr_eq_shiftRight, shiftr];
  · symm
    apply Nat.zero_shiftRight
  induction' n with n IH generalizing m
  · cases m <;> rfl
  cases' m with m m <;> dsimp only [PosNum.shiftr, ← PosNum.shiftr_eq_shiftRight]
  · rw [Nat.shiftRight_eq_div_pow]
    symm
    apply Nat.div_eq_of_lt
    simp
  · trans
    apply IH
    change Nat.shiftRight m n = Nat.shiftRight (_root_.bit1 m) (n + 1)
    rw [add_comm n 1, @Nat.shiftRight_eq _ (1 + n), Nat.shiftRight_add]
    

Proof state:
α : Type u_1
n : ℕ
IH : ∀ (m : PosNum), ↑(m >>> n) = ↑(pos m) >>> n
m : PosNum
⊢ Nat.shiftRight (↑m) n = _root_.bit1 ↑m >>> 1 >>> n

Next tactic:
apply congr_arg fun x => Nat.shiftRight x n
@[simp, norm_cast]

theorem castNum_shiftRight (m : Num) (n : Nat) : ↑(m >>> n) = (m : ℕ) >>> (n : ℕ)  := by
  cases' m with m <;> dsimp only [← shiftr_eq_shiftRight, shiftr];
  · symm
    apply Nat.zero_shiftRight
  induction' n with n IH generalizing m
  · cases m <;> rfl
  cases' m with m m <;> dsimp only [PosNum.shiftr, ← PosNum.shiftr_eq_shiftRight]
  · rw [Nat.shiftRight_eq_div_pow]
    symm
    apply Nat.div_eq_of_lt
    simp
  · trans
    apply IH
    change Nat.shiftRight m n = Nat.shiftRight (_root_.bit1 m) (n + 1)
    rw [add_comm n 1, @Nat.shiftRight_eq _ (1 + n), Nat.shiftRight_add]
    apply congr_arg fun x => Nat.shiftRight x n
    

Proof state:
α : Type u_1
n : ℕ
IH : ∀ (m : PosNum), ↑(m >>> n) = ↑(pos m) >>> n
m : PosNum
⊢ ↑m = _root_.bit1 ↑m >>> 1

Next tactic:
simp [Nat.shiftRight_succ, Nat.shiftRight_zero, ← Nat.div2_val]
@[simp, norm_cast]

theorem castNum_shiftRight (m : Num) (n : Nat) : ↑(m >>> n) = (m : ℕ) >>> (n : ℕ)  := by
  cases' m with m <;> dsimp only [← shiftr_eq_shiftRight, shiftr];
  · symm
    apply Nat.zero_shiftRight
  induction' n with n IH generalizing m
  · cases m <;> rfl
  cases' m with m m <;> dsimp only [PosNum.shiftr, ← PosNum.shiftr_eq_shiftRight]
  · rw [Nat.shiftRight_eq_div_pow]
    symm
    apply Nat.div_eq_of_lt
    simp
  · trans
    apply IH
    change Nat.shiftRight m n = Nat.shiftRight (_root_.bit1 m) (n + 1)
    rw [add_comm n 1, @Nat.shiftRight_eq _ (1 + n), Nat.shiftRight_add]
    apply congr_arg fun x => Nat.shiftRight x n
    simp [Nat.shiftRight_succ, Nat.shiftRight_zero, ← Nat.div2_val]
  · 

Proof state:
case pos.succ.bit0
α : Type u_1
n : ℕ
IH : ∀ (m : PosNum), ↑(m >>> n) = ↑(pos m) >>> n
m : PosNum
⊢ ↑(PosNum.shiftr m n) = ↑(pos (PosNum.bit0 m)) >>> Nat.succ n

Next tactic:
trans
@[simp, norm_cast]

theorem castNum_shiftRight (m : Num) (n : Nat) : ↑(m >>> n) = (m : ℕ) >>> (n : ℕ)  := by
  cases' m with m <;> dsimp only [← shiftr_eq_shiftRight, shiftr];
  · symm
    apply Nat.zero_shiftRight
  induction' n with n IH generalizing m
  · cases m <;> rfl
  cases' m with m m <;> dsimp only [PosNum.shiftr, ← PosNum.shiftr_eq_shiftRight]
  · rw [Nat.shiftRight_eq_div_pow]
    symm
    apply Nat.div_eq_of_lt
    simp
  · trans
    apply IH
    change Nat.shiftRight m n = Nat.shiftRight (_root_.bit1 m) (n + 1)
    rw [add_comm n 1, @Nat.shiftRight_eq _ (1 + n), Nat.shiftRight_add]
    apply congr_arg fun x => Nat.shiftRight x n
    simp [Nat.shiftRight_succ, Nat.shiftRight_zero, ← Nat.div2_val]
  · trans
    

Proof state:
α : Type u_1
n : ℕ
IH : ∀ (m : PosNum), ↑(m >>> n) = ↑(pos m) >>> n
m : PosNum
⊢ ↑(PosNum.shiftr m n) = ?m.669153
α : Type u_1
n : ℕ
IH : ∀ (m : PosNum), ↑(m >>> n) = ↑(pos m) >>> n
m : PosNum
⊢ ?m.669153 = ↑(pos (PosNum.bit0 m)) >>> Nat.succ n
α : Type u_1 n : ℕ IH : ∀ (m : PosNum), ↑(m >>> n) = ↑(pos m) >>> n m : PosNum ⊢ ℕ

Next tactic:
apply IH
@[simp, norm_cast]

theorem castNum_shiftRight (m : Num) (n : Nat) : ↑(m >>> n) = (m : ℕ) >>> (n : ℕ)  := by
  cases' m with m <;> dsimp only [← shiftr_eq_shiftRight, shiftr];
  · symm
    apply Nat.zero_shiftRight
  induction' n with n IH generalizing m
  · cases m <;> rfl
  cases' m with m m <;> dsimp only [PosNum.shiftr, ← PosNum.shiftr_eq_shiftRight]
  · rw [Nat.shiftRight_eq_div_pow]
    symm
    apply Nat.div_eq_of_lt
    simp
  · trans
    apply IH
    change Nat.shiftRight m n = Nat.shiftRight (_root_.bit1 m) (n + 1)
    rw [add_comm n 1, @Nat.shiftRight_eq _ (1 + n), Nat.shiftRight_add]
    apply congr_arg fun x => Nat.shiftRight x n
    simp [Nat.shiftRight_succ, Nat.shiftRight_zero, ← Nat.div2_val]
  · trans
    apply IH
    

Proof state:
α : Type u_1
n : ℕ
IH : ∀ (m : PosNum), ↑(m >>> n) = ↑(pos m) >>> n
m : PosNum
⊢ ↑(pos m) >>> n = ↑(pos (PosNum.bit0 m)) >>> Nat.succ n

Next tactic:
change Nat.shiftRight m n = Nat.shiftRight (_root_.bit0 m) (n + 1)
@[simp, norm_cast]

theorem castNum_shiftRight (m : Num) (n : Nat) : ↑(m >>> n) = (m : ℕ) >>> (n : ℕ)  := by
  cases' m with m <;> dsimp only [← shiftr_eq_shiftRight, shiftr];
  · symm
    apply Nat.zero_shiftRight
  induction' n with n IH generalizing m
  · cases m <;> rfl
  cases' m with m m <;> dsimp only [PosNum.shiftr, ← PosNum.shiftr_eq_shiftRight]
  · rw [Nat.shiftRight_eq_div_pow]
    symm
    apply Nat.div_eq_of_lt
    simp
  · trans
    apply IH
    change Nat.shiftRight m n = Nat.shiftRight (_root_.bit1 m) (n + 1)
    rw [add_comm n 1, @Nat.shiftRight_eq _ (1 + n), Nat.shiftRight_add]
    apply congr_arg fun x => Nat.shiftRight x n
    simp [Nat.shiftRight_succ, Nat.shiftRight_zero, ← Nat.div2_val]
  · trans
    apply IH
    change Nat.shiftRight m n = Nat.shiftRight (_root_.bit0 m) (n + 1)
    

Proof state:
α : Type u_1
n : ℕ
IH : ∀ (m : PosNum), ↑(m >>> n) = ↑(pos m) >>> n
m : PosNum
⊢ Nat.shiftRight (↑m) n = Nat.shiftRight (_root_.bit0 ↑m) (n + 1)

Next tactic:
rw [add_comm n 1,  @Nat.shiftRight_eq _ (1 + n), Nat.shiftRight_add]
@[simp, norm_cast]

theorem castNum_shiftRight (m : Num) (n : Nat) : ↑(m >>> n) = (m : ℕ) >>> (n : ℕ)  := by
  cases' m with m <;> dsimp only [← shiftr_eq_shiftRight, shiftr];
  · symm
    apply Nat.zero_shiftRight
  induction' n with n IH generalizing m
  · cases m <;> rfl
  cases' m with m m <;> dsimp only [PosNum.shiftr, ← PosNum.shiftr_eq_shiftRight]
  · rw [Nat.shiftRight_eq_div_pow]
    symm
    apply Nat.div_eq_of_lt
    simp
  · trans
    apply IH
    change Nat.shiftRight m n = Nat.shiftRight (_root_.bit1 m) (n + 1)
    rw [add_comm n 1, @Nat.shiftRight_eq _ (1 + n), Nat.shiftRight_add]
    apply congr_arg fun x => Nat.shiftRight x n
    simp [Nat.shiftRight_succ, Nat.shiftRight_zero, ← Nat.div2_val]
  · trans
    apply IH
    change Nat.shiftRight m n = Nat.shiftRight (_root_.bit0 m) (n + 1)
    rw [add_comm n 1,  @Nat.shiftRight_eq _ (1 + n), Nat.shiftRight_add]
    

Proof state:
α : Type u_1
n : ℕ
IH : ∀ (m : PosNum), ↑(m >>> n) = ↑(pos m) >>> n
m : PosNum
⊢ Nat.shiftRight (↑m) n = _root_.bit0 ↑m >>> 1 >>> n

Next tactic:
apply congr_arg fun x => Nat.shiftRight x n
@[simp, norm_cast]

theorem castNum_shiftRight (m : Num) (n : Nat) : ↑(m >>> n) = (m : ℕ) >>> (n : ℕ)  := by
  cases' m with m <;> dsimp only [← shiftr_eq_shiftRight, shiftr];
  · symm
    apply Nat.zero_shiftRight
  induction' n with n IH generalizing m
  · cases m <;> rfl
  cases' m with m m <;> dsimp only [PosNum.shiftr, ← PosNum.shiftr_eq_shiftRight]
  · rw [Nat.shiftRight_eq_div_pow]
    symm
    apply Nat.div_eq_of_lt
    simp
  · trans
    apply IH
    change Nat.shiftRight m n = Nat.shiftRight (_root_.bit1 m) (n + 1)
    rw [add_comm n 1, @Nat.shiftRight_eq _ (1 + n), Nat.shiftRight_add]
    apply congr_arg fun x => Nat.shiftRight x n
    simp [Nat.shiftRight_succ, Nat.shiftRight_zero, ← Nat.div2_val]
  · trans
    apply IH
    change Nat.shiftRight m n = Nat.shiftRight (_root_.bit0 m) (n + 1)
    rw [add_comm n 1,  @Nat.shiftRight_eq _ (1 + n), Nat.shiftRight_add]
    apply congr_arg fun x => Nat.shiftRight x n
    

Proof state:
α : Type u_1
n : ℕ
IH : ∀ (m : PosNum), ↑(m >>> n) = ↑(pos m) >>> n
m : PosNum
⊢ ↑m = _root_.bit0 ↑m >>> 1

Next tactic:
simp [Nat.shiftRight_succ, Nat.shiftRight_zero, ← Nat.div2_val]
@[simp]
theorem castNum_testBit (m n) : testBit m n = Nat.testBit m n := by
  -- Porting note: `unfold` → `dsimp only`
  

Proof state:
α : Type u_1
m : Num
n : ℕ
⊢ testBit m n = Nat.testBit (↑m) n

Next tactic:
cases m
@[simp]
theorem castNum_testBit (m n) : testBit m n = Nat.testBit m n := by
  -- Porting note: `unfold` → `dsimp only`
  cases m <;> 

Proof state:
case zero
α : Type u_1
n : ℕ
⊢ testBit zero n = Nat.testBit (↑zero) n

Next tactic:
dsimp only [testBit]
@[simp]
theorem castNum_testBit (m n) : testBit m n = Nat.testBit m n := by
  -- Porting note: `unfold` → `dsimp only`
  cases m <;> 

Proof state:
case pos
α : Type u_1
n : ℕ
a✝ : PosNum
⊢ testBit (pos a✝) n = Nat.testBit (↑(pos a✝)) n

Next tactic:
dsimp only [testBit]
@[simp]
theorem castNum_testBit (m n) : testBit m n = Nat.testBit m n := by
  -- Porting note: `unfold` → `dsimp only`
  cases m <;> dsimp only [testBit]
  

Proof state:
case zero
α : Type u_1
n : ℕ
⊢ false = Nat.testBit (↑zero) n
case pos α : Type u_1 n : ℕ a✝ : PosNum ⊢ PosNum.testBit a✝ n = Nat.testBit (↑(pos a✝)) n

Next tactic:
case zero =>
    rw [show (Num.zero : Nat) = 0 from rfl, Nat.zero_testBit]
@[simp]
theorem castNum_testBit (m n) : testBit m n = Nat.testBit m n := by
  -- Porting note: `unfold` → `dsimp only`
  cases m <;> dsimp only [testBit]
  

Proof state:
α : Type u_1
n : ℕ
⊢ false = Nat.testBit (↑zero) n

Next tactic:
case zero =>
    rw [show (Num.zero : Nat) = 0 from rfl, Nat.zero_testBit]
@[simp]
theorem castNum_testBit (m n) : testBit m n = Nat.testBit m n := by
  -- Porting note: `unfold` → `dsimp only`
  cases m <;> dsimp only [testBit]
  case zero =>
    

Proof state:
α : Type u_1
n : ℕ
⊢ false = Nat.testBit (↑zero) n

Next tactic:
rw [show (Num.zero : Nat) = 0 from rfl, Nat.zero_testBit]
@[simp]
theorem castNum_testBit (m n) : testBit m n = Nat.testBit m n := by
  -- Porting note: `unfold` → `dsimp only`
  cases m <;> dsimp only [testBit]
  case zero =>
    rw [show (Num.zero : Nat) = 0 from rfl, Nat.zero_testBit]
  

Proof state:
case pos
α : Type u_1
n : ℕ
a✝ : PosNum
⊢ PosNum.testBit a✝ n = Nat.testBit (↑(pos a✝)) n

Next tactic:
case pos m =>
    rw [cast_pos]
    induction' n with n IH generalizing m <;> cases' m with m m
        <;> dsimp only [PosNum.testBit, Nat.zero_eq]
    · rfl
    · rw [PosNum.cast_bit1, ← Nat.bit_true, Nat.testBit_zero]
    · rw [PosNum.cast_bit0, ← Nat.bit_false, Nat.testBit_zero]
    · rw [PosNum.cast_one', ← bit1_zero, ← Nat.bit_true, Nat.testBit_succ, Nat.zero_testBit]
    · rw [PosNum.cast_bit1, ← Nat.bit_true, Nat.testBit_succ, IH]
    · rw [PosNum.cast_bit0, ← Nat.bit_false, Nat.testBit_succ, IH]
@[simp]
theorem castNum_testBit (m n) : testBit m n = Nat.testBit m n := by
  -- Porting note: `unfold` → `dsimp only`
  cases m <;> dsimp only [testBit]
  case zero =>
    rw [show (Num.zero : Nat) = 0 from rfl, Nat.zero_testBit]
  

Proof state:
α : Type u_1
n : ℕ
m : PosNum
⊢ PosNum.testBit m n = Nat.testBit (↑(pos m)) n

Next tactic:
case pos m =>
    rw [cast_pos]
    induction' n with n IH generalizing m <;> cases' m with m m
        <;> dsimp only [PosNum.testBit, Nat.zero_eq]
    · rfl
    · rw [PosNum.cast_bit1, ← Nat.bit_true, Nat.testBit_zero]
    · rw [PosNum.cast_bit0, ← Nat.bit_false, Nat.testBit_zero]
    · rw [PosNum.cast_one', ← bit1_zero, ← Nat.bit_true, Nat.testBit_succ, Nat.zero_testBit]
    · rw [PosNum.cast_bit1, ← Nat.bit_true, Nat.testBit_succ, IH]
    · rw [PosNum.cast_bit0, ← Nat.bit_false, Nat.testBit_succ, IH]
@[simp]
theorem castNum_testBit (m n) : testBit m n = Nat.testBit m n := by
  -- Porting note: `unfold` → `dsimp only`
  cases m <;> dsimp only [testBit]
  case zero =>
    rw [show (Num.zero : Nat) = 0 from rfl, Nat.zero_testBit]
  case pos m =>
    

Proof state:
α : Type u_1
n : ℕ
m : PosNum
⊢ PosNum.testBit m n = Nat.testBit (↑(pos m)) n

Next tactic:
rw [cast_pos]
@[simp]
theorem castNum_testBit (m n) : testBit m n = Nat.testBit m n := by
  -- Porting note: `unfold` → `dsimp only`
  cases m <;> dsimp only [testBit]
  case zero =>
    rw [show (Num.zero : Nat) = 0 from rfl, Nat.zero_testBit]
  case pos m =>
    rw [cast_pos]
    

Proof state:
α : Type u_1
n : ℕ
m : PosNum
⊢ PosNum.testBit m n = Nat.testBit (↑m) n

Next tactic:
induction' n with n IH generalizing m
@[simp]
theorem castNum_testBit (m n) : testBit m n = Nat.testBit m n := by
  -- Porting note: `unfold` → `dsimp only`
  cases m <;> dsimp only [testBit]
  case zero =>
    rw [show (Num.zero : Nat) = 0 from rfl, Nat.zero_testBit]
  case pos m =>
    rw [cast_pos]
    induction' n with n IH generalizing m <;> 

Proof state:
case zero
α : Type u_1
m : PosNum
⊢ PosNum.testBit m Nat.zero = Nat.testBit (↑m) Nat.zero

Next tactic:
cases' m with m m
@[simp]
theorem castNum_testBit (m n) : testBit m n = Nat.testBit m n := by
  -- Porting note: `unfold` → `dsimp only`
  cases m <;> dsimp only [testBit]
  case zero =>
    rw [show (Num.zero : Nat) = 0 from rfl, Nat.zero_testBit]
  case pos m =>
    rw [cast_pos]
    induction' n with n IH generalizing m <;> 

Proof state:
case succ
α : Type u_1
n : ℕ
IH : ∀ (m : PosNum), PosNum.testBit m n = Nat.testBit (↑m) n
m : PosNum
⊢ PosNum.testBit m (Nat.succ n) = Nat.testBit (↑m) (Nat.succ n)

Next tactic:
cases' m with m m
@[simp]
theorem castNum_testBit (m n) : testBit m n = Nat.testBit m n := by
  -- Porting note: `unfold` → `dsimp only`
  cases m <;> dsimp only [testBit]
  case zero =>
    rw [show (Num.zero : Nat) = 0 from rfl, Nat.zero_testBit]
  case pos m =>
    rw [cast_pos]
    induction' n with n IH generalizing m <;> cases' m with m m
        <;> 

Proof state:
case zero.one
α : Type u_1
⊢ PosNum.testBit one Nat.zero = Nat.testBit (↑one) Nat.zero

Next tactic:
dsimp only [PosNum.testBit, Nat.zero_eq]
@[simp]
theorem castNum_testBit (m n) : testBit m n = Nat.testBit m n := by
  -- Porting note: `unfold` → `dsimp only`
  cases m <;> dsimp only [testBit]
  case zero =>
    rw [show (Num.zero : Nat) = 0 from rfl, Nat.zero_testBit]
  case pos m =>
    rw [cast_pos]
    induction' n with n IH generalizing m <;> cases' m with m m
        <;> 

Proof state:
case zero.bit1
α : Type u_1
m : PosNum
⊢ PosNum.testBit (PosNum.bit1 m) Nat.zero = Nat.testBit (↑(PosNum.bit1 m)) Nat.zero

Next tactic:
dsimp only [PosNum.testBit, Nat.zero_eq]