Theorem: ZNum.cast_bit1
File: Mathlib/Data/Num/Lemmas.lean

tactic: simp [ZNum.bit1, _root_.bit1, _root_.bit0]
state_before: α : Type u_1
inst✝ : AddGroupWithOne α
⊢ ↑(ZNum.bit1 0) = _root_.bit1 ↑0
state_after: no goals

tactic: rw [ZNum.bit1, cast_pos, cast_pos]
state_before: α : Type u_1
inst✝ : AddGroupWithOne α
p : PosNum
⊢ ↑(pos p).bit1 = _root_.bit1 ↑(pos p)
state_after: α : Type u_1
inst✝ : AddGroupWithOne α
p : PosNum
⊢ ↑p.bit1 = _root_.bit1 ↑p

tactic: rfl
state_before: α : Type u_1
inst✝ : AddGroupWithOne α
p : PosNum
⊢ ↑p.bit1 = _root_.bit1 ↑p
state_after: no goals

tactic: rw [ZNum.bit1, cast_neg, cast_neg]
state_before: α : Type u_1
inst✝ : AddGroupWithOne α
p : PosNum
⊢ ↑(neg p).bit1 = _root_.bit1 ↑(neg p)
state_after: α : Type u_1
inst✝ : AddGroupWithOne α
p : PosNum
⊢ -↑(Num.casesOn p.pred' 1 PosNum.bit1) = _root_.bit1 (-↑p)

tactic: cases' e : pred' p with a <;>
  have ep : p = _ := (succ'_pred' p).symm.trans (congr_arg Num.succ' e)
state_before: α : Type u_1
inst✝ : AddGroupWithOne α
p : PosNum
⊢ -↑(Num.casesOn p.pred' 1 PosNum.bit1) = _root_.bit1 (-↑p)
state_after: case zero
α : Type u_1
inst✝ : AddGroupWithOne α
p : PosNum
e : p.pred' = Num.zero
ep : p = Num.zero.succ'
⊢ -↑(Num.casesOn Num.zero 1 PosNum.bit1) = _root_.bit1 (-↑p)

case pos
α : Type u_1
inst✝ : AddGroupWithOne α
p a : PosNum
e : p.pred' = Num.pos a
ep : p = (Num.pos a).succ'
⊢ -↑(Num.casesOn (Num.pos a) 1 PosNum.bit1) = _root_.bit1 (-↑p)

tactic: conv at ep => change p = 1
state_before: case zero
α : Type u_1
inst✝ : AddGroupWithOne α
p : PosNum
e : p.pred' = Num.zero
ep : p = Num.zero.succ'
⊢ -↑(Num.casesOn Num.zero 1 PosNum.bit1) = _root_.bit1 (-↑p)
state_after: case zero
α : Type u_1
inst✝ : AddGroupWithOne α
p : PosNum
e : p.pred' = Num.zero
ep : p = 1
⊢ -↑(Num.casesOn Num.zero 1 PosNum.bit1) = _root_.bit1 (-↑p)

tactic: subst p
state_before: case zero
α : Type u_1
inst✝ : AddGroupWithOne α
p : PosNum
e : p.pred' = Num.zero
ep : p = 1
⊢ -↑(Num.casesOn Num.zero 1 PosNum.bit1) = _root_.bit1 (-↑p)
state_after: case zero
α : Type u_1
inst✝ : AddGroupWithOne α
e : pred' 1 = Num.zero
⊢ -↑(Num.casesOn Num.zero 1 PosNum.bit1) = _root_.bit1 (-↑1)

tactic: simp [_root_.bit1, _root_.bit0]
state_before: case zero
α : Type u_1
inst✝ : AddGroupWithOne α
e : pred' 1 = Num.zero
⊢ -↑(Num.casesOn Num.zero 1 PosNum.bit1) = _root_.bit1 (-↑1)
state_after: no goals

tactic: dsimp only [Num.succ'] at ep
state_before: case pos
α : Type u_1
inst✝ : AddGroupWithOne α
p a : PosNum
e : p.pred' = Num.pos a
ep : p = (Num.pos a).succ'
⊢ -↑(Num.casesOn (Num.pos a) 1 PosNum.bit1) = _root_.bit1 (-↑p)
state_after: case pos
α : Type u_1
inst✝ : AddGroupWithOne α
p a : PosNum
e : p.pred' = Num.pos a
ep : p = a.succ
⊢ -↑(Num.casesOn (Num.pos a) 1 PosNum.bit1) = _root_.bit1 (-↑p)

tactic: subst p
state_before: case pos
α : Type u_1
inst✝ : AddGroupWithOne α
p a : PosNum
e : p.pred' = Num.pos a
ep : p = a.succ
⊢ -↑(Num.casesOn (Num.pos a) 1 PosNum.bit1) = _root_.bit1 (-↑p)
state_after: case pos
α : Type u_1
inst✝ : AddGroupWithOne α
a : PosNum
e : a.succ.pred' = Num.pos a
⊢ -↑(Num.casesOn (Num.pos a) 1 PosNum.bit1) = _root_.bit1 (-↑a.succ)

tactic: have : (↑(-↑a : ℤ) : α) = -1 + ↑(-↑a + 1 : ℤ) := by simp [add_comm (- ↑a : ℤ) 1]
state_before: case pos
α : Type u_1
inst✝ : AddGroupWithOne α
a : PosNum
e : a.succ.pred' = Num.pos a
⊢ -↑(Num.casesOn (Num.pos a) 1 PosNum.bit1) = _root_.bit1 (-↑a.succ)
state_after: case pos
α : Type u_1
inst✝ : AddGroupWithOne α
a : PosNum
e : a.succ.pred' = Num.pos a
this : ↑(-↑a) = -1 + ↑(-↑a + 1)
⊢ -↑(Num.casesOn (Num.pos a) 1 PosNum.bit1) = _root_.bit1 (-↑a.succ)

tactic: simpa [_root_.bit1, _root_.bit0] using this
state_before: case pos
α : Type u_1
inst✝ : AddGroupWithOne α
a : PosNum
e : a.succ.pred' = Num.pos a
this : ↑(-↑a) = -1 + ↑(-↑a + 1)
⊢ -↑(Num.casesOn (Num.pos a) 1 PosNum.bit1) = _root_.bit1 (-↑a.succ)
state_after: no goals

tactic: simp [add_comm (- ↑a : ℤ) 1]
state_before: α : Type u_1
inst✝ : AddGroupWithOne α
a : PosNum
e : a.succ.pred' = Num.pos a
⊢ ↑(-↑a) = -1 + ↑(-↑a + 1)
state_after: no goals