[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
n : PosNum
⊢ ↑↑n = ↑n
[PROOFSTEP]
rw [← to_nat_to_int, Int.cast_ofNat, cast_to_nat]
[GOAL]
α : Type u_1
p : PosNum
⊢ ↑p + 1 + ↑p + 1 = ↑p + ↑p + 1 + 1
[PROOFSTEP]
simp [add_left_comm]
[GOAL]
α : Type u_1
n : PosNum
⊢ 1 + n = succ n
[PROOFSTEP]
cases n
[GOAL]
case one
α : Type u_1
⊢ 1 + one = succ one
[PROOFSTEP]
rfl
[GOAL]
case bit1
α : Type u_1
a✝ : PosNum
⊢ 1 + bit1 a✝ = succ (bit1 a✝)
[PROOFSTEP]
rfl
[GOAL]
case bit0
α : Type u_1
a✝ : PosNum
⊢ 1 + bit0 a✝ = succ (bit0 a✝)
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
n : PosNum
⊢ n + 1 = succ n
[PROOFSTEP]
cases n
[GOAL]
case one
α : Type u_1
⊢ one + 1 = succ one
[PROOFSTEP]
rfl
[GOAL]
case bit1
α : Type u_1
a✝ : PosNum
⊢ bit1 a✝ + 1 = succ (bit1 a✝)
[PROOFSTEP]
rfl
[GOAL]
case bit0
α : Type u_1
a✝ : PosNum
⊢ bit0 a✝ + 1 = succ (bit0 a✝)
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
b : PosNum
⊢ ↑(1 + b) = ↑1 + ↑b
[PROOFSTEP]
rw [one_add b, succ_to_nat, add_comm]
[GOAL]
α : Type u_1
b : PosNum
⊢ 1 + ↑b = ↑1 + ↑b
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
a : PosNum
⊢ ↑(a + 1) = ↑a + ↑1
[PROOFSTEP]
rw [add_one a, succ_to_nat]
[GOAL]
α : Type u_1
a : PosNum
⊢ ↑a + 1 = ↑a + ↑1
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
a b : PosNum
⊢ ↑a + ↑b + (↑a + ↑b) + 1 = ↑a + ↑a + (↑b + ↑b + 1)
[PROOFSTEP]
simp [add_left_comm]
[GOAL]
α : Type u_1
a b : PosNum
⊢ ↑a + ↑b + (↑a + ↑b) + 1 = ↑a + ↑a + 1 + (↑b + ↑b)
[PROOFSTEP]
simp [add_comm, add_left_comm]
[GOAL]
α : Type u_1
a b : PosNum
⊢ ↑(succ (a + b)) + ↑(succ (a + b)) = ↑a + ↑a + 1 + (↑b + ↑b + 1)
[PROOFSTEP]
rw [succ_to_nat, add_to_nat a b]
[GOAL]
α : Type u_1
a b : PosNum
⊢ ↑a + ↑b + 1 + (↑a + ↑b + 1) = ↑a + ↑a + 1 + (↑b + ↑b + 1)
[PROOFSTEP]
simp [add_left_comm]
[GOAL]
α : Type u_1
b : PosNum
⊢ 1 + succ b = succ (1 + b)
[PROOFSTEP]
simp [one_add]
[GOAL]
α : Type u_1
p : PosNum
⊢ bit0 (succ (_root_.bit0 p)) = bit0 (bit1 p)
[PROOFSTEP]
rw [bit0_of_bit0 p]
[GOAL]
α : Type u_1
p : PosNum
⊢ bit0 (succ (bit0 p)) = bit0 (bit1 p)
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
n : PosNum
⊢ _root_.bit0 n + 1 = bit1 n
[PROOFSTEP]
rw [add_one, bit0_of_bit0]
[GOAL]
α : Type u_1
n : PosNum
⊢ succ (bit0 n) = bit1 n
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
m p : PosNum
⊢ ↑(m * p) + ↑(m * p) = ↑m * (↑p + ↑p)
[PROOFSTEP]
rw [mul_to_nat m p, left_distrib]
[GOAL]
α : Type u_1
m p : PosNum
⊢ ↑(m * p) + ↑(m * p) + ↑m = ↑m * (↑p + ↑p) + ↑m
[PROOFSTEP]
rw [mul_to_nat m p, left_distrib]
[GOAL]
α : Type u_1
m n : PosNum
⊢ ↑m < ↑n → ↑m + ↑m + 1 + 1 ≤ ↑n + ↑n
[PROOFSTEP]
intro h
[GOAL]
α : Type u_1
m n : PosNum
h : ↑m < ↑n
⊢ ↑m + ↑m + 1 + 1 ≤ ↑n + ↑n
[PROOFSTEP]
rw [Nat.add_right_comm m m 1, add_assoc]
[GOAL]
α : Type u_1
m n : PosNum
h : ↑m < ↑n
⊢ ↑m + 1 + (↑m + 1) ≤ ↑n + ↑n
[PROOFSTEP]
exact add_le_add h h
[GOAL]
α : Type u_1
m : PosNum
⊢ ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
[PROOFSTEP]
induction' m with m IH m IH
[GOAL]
case one
α : Type u_1
⊢ ∀ (n : PosNum), Ordering.swap (cmp one n) = cmp n one
[PROOFSTEP]
intro n
[GOAL]
case bit1
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
⊢ ∀ (n : PosNum), Ordering.swap (cmp (bit1 m) n) = cmp n (bit1 m)
[PROOFSTEP]
intro n
[GOAL]
case bit0
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
⊢ ∀ (n : PosNum), Ordering.swap (cmp (bit0 m) n) = cmp n (bit0 m)
[PROOFSTEP]
intro n
[GOAL]
case one
α : Type u_1
n : PosNum
⊢ Ordering.swap (cmp one n) = cmp n one
[PROOFSTEP]
cases' n with n n
[GOAL]
case bit1
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
n : PosNum
⊢ Ordering.swap (cmp (bit1 m) n) = cmp n (bit1 m)
[PROOFSTEP]
cases' n with n n
[GOAL]
case bit0
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
n : PosNum
⊢ Ordering.swap (cmp (bit0 m) n) = cmp n (bit0 m)
[PROOFSTEP]
cases' n with n n
[GOAL]
case one.one
α : Type u_1
⊢ Ordering.swap (cmp one one) = cmp one one
[PROOFSTEP]
unfold cmp
[GOAL]
case one.bit1
α : Type u_1
n : PosNum
⊢ Ordering.swap (cmp one (bit1 n)) = cmp (bit1 n) one
[PROOFSTEP]
unfold cmp
[GOAL]
case one.bit0
α : Type u_1
n : PosNum
⊢ Ordering.swap (cmp one (bit0 n)) = cmp (bit0 n) one
[PROOFSTEP]
unfold cmp
[GOAL]
case bit1.one
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
⊢ Ordering.swap (cmp (bit1 m) one) = cmp one (bit1 m)
[PROOFSTEP]
unfold cmp
[GOAL]
case bit1.bit1
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
n : PosNum
⊢ Ordering.swap (cmp (bit1 m) (bit1 n)) = cmp (bit1 n) (bit1 m)
[PROOFSTEP]
unfold cmp
[GOAL]
case bit1.bit0
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
n : PosNum
⊢ Ordering.swap (cmp (bit1 m) (bit0 n)) = cmp (bit0 n) (bit1 m)
[PROOFSTEP]
unfold cmp
[GOAL]
case bit0.one
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
⊢ Ordering.swap (cmp (bit0 m) one) = cmp one (bit0 m)
[PROOFSTEP]
unfold cmp
[GOAL]
case bit0.bit1
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
n : PosNum
⊢ Ordering.swap (cmp (bit0 m) (bit1 n)) = cmp (bit1 n) (bit0 m)
[PROOFSTEP]
unfold cmp
[GOAL]
case bit0.bit0
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
n : PosNum
⊢ Ordering.swap (cmp (bit0 m) (bit0 n)) = cmp (bit0 n) (bit0 m)
[PROOFSTEP]
unfold cmp
[GOAL]
case one.one
α : Type u_1
⊢ Ordering.swap Ordering.eq = Ordering.eq
[PROOFSTEP]
try {rfl
}
[GOAL]
case one.one
α : Type u_1
⊢ Ordering.swap Ordering.eq = Ordering.eq
[PROOFSTEP]
{rfl
}
[GOAL]
case one.one
α : Type u_1
⊢ Ordering.swap Ordering.eq = Ordering.eq
[PROOFSTEP]
rfl
[GOAL]
case one.bit1
α : Type u_1
n : PosNum
⊢ Ordering.swap Ordering.lt = Ordering.gt
[PROOFSTEP]
try {rfl
}
[GOAL]
case one.bit1
α : Type u_1
n : PosNum
⊢ Ordering.swap Ordering.lt = Ordering.gt
[PROOFSTEP]
{rfl
}
[GOAL]
case one.bit1
α : Type u_1
n : PosNum
⊢ Ordering.swap Ordering.lt = Ordering.gt
[PROOFSTEP]
rfl
[GOAL]
case one.bit0
α : Type u_1
n : PosNum
⊢ Ordering.swap Ordering.lt = Ordering.gt
[PROOFSTEP]
try {rfl
}
[GOAL]
case one.bit0
α : Type u_1
n : PosNum
⊢ Ordering.swap Ordering.lt = Ordering.gt
[PROOFSTEP]
{rfl
}
[GOAL]
case one.bit0
α : Type u_1
n : PosNum
⊢ Ordering.swap Ordering.lt = Ordering.gt
[PROOFSTEP]
rfl
[GOAL]
case bit1.one
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
⊢ Ordering.swap Ordering.gt = Ordering.lt
[PROOFSTEP]
try {rfl
}
[GOAL]
case bit1.one
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
⊢ Ordering.swap Ordering.gt = Ordering.lt
[PROOFSTEP]
{rfl
}
[GOAL]
case bit1.one
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
⊢ Ordering.swap Ordering.gt = Ordering.lt
[PROOFSTEP]
rfl
[GOAL]
case bit1.bit1
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
n : PosNum
⊢ Ordering.swap (cmp m n) = cmp n m
[PROOFSTEP]
try {rfl
}
[GOAL]
case bit1.bit1
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
n : PosNum
⊢ Ordering.swap (cmp m n) = cmp n m
[PROOFSTEP]
{rfl
}
[GOAL]
case bit1.bit1
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
n : PosNum
⊢ Ordering.swap (cmp m n) = cmp n m
[PROOFSTEP]
rfl
[GOAL]
case bit1.bit0
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
n : PosNum
⊢ Ordering.swap (Ordering.casesOn (cmp m n) Ordering.lt Ordering.gt Ordering.gt) =
    Ordering.casesOn (cmp n m) Ordering.lt Ordering.lt Ordering.gt
[PROOFSTEP]
try {rfl
}
[GOAL]
case bit1.bit0
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
n : PosNum
⊢ Ordering.swap (Ordering.casesOn (cmp m n) Ordering.lt Ordering.gt Ordering.gt) =
    Ordering.casesOn (cmp n m) Ordering.lt Ordering.lt Ordering.gt
[PROOFSTEP]
{rfl
}
[GOAL]
case bit1.bit0
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
n : PosNum
⊢ Ordering.swap (Ordering.casesOn (cmp m n) Ordering.lt Ordering.gt Ordering.gt) =
    Ordering.casesOn (cmp n m) Ordering.lt Ordering.lt Ordering.gt
[PROOFSTEP]
rfl
[GOAL]
case bit0.one
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
⊢ Ordering.swap Ordering.gt = Ordering.lt
[PROOFSTEP]
try {rfl
}
[GOAL]
case bit0.one
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
⊢ Ordering.swap Ordering.gt = Ordering.lt
[PROOFSTEP]
{rfl
}
[GOAL]
case bit0.one
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
⊢ Ordering.swap Ordering.gt = Ordering.lt
[PROOFSTEP]
rfl
[GOAL]
case bit0.bit1
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
n : PosNum
⊢ Ordering.swap (Ordering.casesOn (cmp m n) Ordering.lt Ordering.lt Ordering.gt) =
    Ordering.casesOn (cmp n m) Ordering.lt Ordering.gt Ordering.gt
[PROOFSTEP]
try {rfl
}
[GOAL]
case bit0.bit1
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
n : PosNum
⊢ Ordering.swap (Ordering.casesOn (cmp m n) Ordering.lt Ordering.lt Ordering.gt) =
    Ordering.casesOn (cmp n m) Ordering.lt Ordering.gt Ordering.gt
[PROOFSTEP]
{rfl
}
[GOAL]
case bit0.bit1
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
n : PosNum
⊢ Ordering.swap (Ordering.casesOn (cmp m n) Ordering.lt Ordering.lt Ordering.gt) =
    Ordering.casesOn (cmp n m) Ordering.lt Ordering.gt Ordering.gt
[PROOFSTEP]
rfl
[GOAL]
case bit0.bit0
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
n : PosNum
⊢ Ordering.swap (cmp m n) = cmp n m
[PROOFSTEP]
try {rfl
}
[GOAL]
case bit0.bit0
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
n : PosNum
⊢ Ordering.swap (cmp m n) = cmp n m
[PROOFSTEP]
{rfl
}
[GOAL]
case bit0.bit0
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
n : PosNum
⊢ Ordering.swap (cmp m n) = cmp n m
[PROOFSTEP]
rfl
[GOAL]
case bit1.bit1
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
n : PosNum
⊢ Ordering.swap (cmp m n) = cmp n m
[PROOFSTEP]
rw [← IH]
[GOAL]
case bit1.bit0
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
n : PosNum
⊢ Ordering.swap (Ordering.casesOn (cmp m n) Ordering.lt Ordering.gt Ordering.gt) =
    Ordering.casesOn (cmp n m) Ordering.lt Ordering.lt Ordering.gt
[PROOFSTEP]
rw [← IH]
[GOAL]
case bit0.bit1
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
n : PosNum
⊢ Ordering.swap (Ordering.casesOn (cmp m n) Ordering.lt Ordering.lt Ordering.gt) =
    Ordering.casesOn (cmp n m) Ordering.lt Ordering.gt Ordering.gt
[PROOFSTEP]
rw [← IH]
[GOAL]
case bit0.bit0
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
n : PosNum
⊢ Ordering.swap (cmp m n) = cmp n m
[PROOFSTEP]
rw [← IH]
[GOAL]
case bit1.bit0
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
n : PosNum
⊢ Ordering.swap (Ordering.casesOn (cmp m n) Ordering.lt Ordering.gt Ordering.gt) =
    Ordering.casesOn (Ordering.swap (cmp m n)) Ordering.lt Ordering.lt Ordering.gt
[PROOFSTEP]
cases cmp m n
[GOAL]
case bit0.bit1
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
n : PosNum
⊢ Ordering.swap (Ordering.casesOn (cmp m n) Ordering.lt Ordering.lt Ordering.gt) =
    Ordering.casesOn (Ordering.swap (cmp m n)) Ordering.lt Ordering.gt Ordering.gt
[PROOFSTEP]
cases cmp m n
[GOAL]
case bit1.bit0.lt
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
n : PosNum
⊢ Ordering.swap (Ordering.casesOn Ordering.lt Ordering.lt Ordering.gt Ordering.gt) =
    Ordering.casesOn (Ordering.swap Ordering.lt) Ordering.lt Ordering.lt Ordering.gt
[PROOFSTEP]
rfl
[GOAL]
case bit1.bit0.eq
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
n : PosNum
⊢ Ordering.swap (Ordering.casesOn Ordering.eq Ordering.lt Ordering.gt Ordering.gt) =
    Ordering.casesOn (Ordering.swap Ordering.eq) Ordering.lt Ordering.lt Ordering.gt
[PROOFSTEP]
rfl
[GOAL]
case bit1.bit0.gt
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
n : PosNum
⊢ Ordering.swap (Ordering.casesOn Ordering.gt Ordering.lt Ordering.gt Ordering.gt) =
    Ordering.casesOn (Ordering.swap Ordering.gt) Ordering.lt Ordering.lt Ordering.gt
[PROOFSTEP]
rfl
[GOAL]
case bit0.bit1.lt
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
n : PosNum
⊢ Ordering.swap (Ordering.casesOn Ordering.lt Ordering.lt Ordering.lt Ordering.gt) =
    Ordering.casesOn (Ordering.swap Ordering.lt) Ordering.lt Ordering.gt Ordering.gt
[PROOFSTEP]
rfl
[GOAL]
case bit0.bit1.eq
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
n : PosNum
⊢ Ordering.swap (Ordering.casesOn Ordering.eq Ordering.lt Ordering.lt Ordering.gt) =
    Ordering.casesOn (Ordering.swap Ordering.eq) Ordering.lt Ordering.gt Ordering.gt
[PROOFSTEP]
rfl
[GOAL]
case bit0.bit1.gt
α : Type u_1
m : PosNum
IH : ∀ (n : PosNum), Ordering.swap (cmp m n) = cmp n m
n : PosNum
⊢ Ordering.swap (Ordering.casesOn Ordering.gt Ordering.lt Ordering.lt Ordering.gt) =
    Ordering.casesOn (Ordering.swap Ordering.gt) Ordering.lt Ordering.gt Ordering.gt
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
a b : PosNum
⊢ Ordering.casesOn (cmp (bit0 a) (bit0 b)) (↑(bit0 a) < ↑(bit0 b)) (bit0 a = bit0 b) (↑(bit0 b) < ↑(bit0 a))
[PROOFSTEP]
have := cmp_to_nat a b
[GOAL]
α : Type u_1
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))
[PROOFSTEP]
revert this
[GOAL]
α : Type u_1
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))
[PROOFSTEP]
cases cmp a b
[GOAL]
case lt
α : Type u_1
a b : PosNum
⊢ Ordering.casesOn Ordering.lt (↑a < ↑b) (a = b) (↑b < ↑a) →
    Ordering.casesOn Ordering.lt (↑(bit0 a) < ↑(bit0 b)) (bit0 a = bit0 b) (↑(bit0 b) < ↑(bit0 a))
[PROOFSTEP]
dsimp
[GOAL]
case eq
α : Type u_1
a b : PosNum
⊢ Ordering.casesOn Ordering.eq (↑a < ↑b) (a = b) (↑b < ↑a) →
    Ordering.casesOn Ordering.eq (↑(bit0 a) < ↑(bit0 b)) (bit0 a = bit0 b) (↑(bit0 b) < ↑(bit0 a))
[PROOFSTEP]
dsimp
[GOAL]
case gt
α : Type u_1
a b : PosNum
⊢ Ordering.casesOn Ordering.gt (↑a < ↑b) (a = b) (↑b < ↑a) →
    Ordering.casesOn Ordering.gt (↑(bit0 a) < ↑(bit0 b)) (bit0 a = bit0 b) (↑(bit0 b) < ↑(bit0 a))
[PROOFSTEP]
dsimp
[GOAL]
case lt
α : Type u_1
a b : PosNum
⊢ ↑a < ↑b → _root_.bit0 ↑a < _root_.bit0 ↑b
[PROOFSTEP]
intro this
[GOAL]
case eq
α : Type u_1
a b : PosNum
⊢ a = b → bit0 a = bit0 b
[PROOFSTEP]
intro this
[GOAL]
case gt
α : Type u_1
a b : PosNum
⊢ ↑b < ↑a → _root_.bit0 ↑b < _root_.bit0 ↑a
[PROOFSTEP]
intro this
[GOAL]
case lt
α : Type u_1
a b : PosNum
this : ↑a < ↑b
⊢ _root_.bit0 ↑a < _root_.bit0 ↑b
[PROOFSTEP]
exact add_lt_add this this
[GOAL]
case eq
α : Type u_1
a b : PosNum
this : a = b
⊢ bit0 a = bit0 b
[PROOFSTEP]
rw [this]
[GOAL]
case gt
α : Type u_1
a b : PosNum
this : ↑b < ↑a
⊢ _root_.bit0 ↑b < _root_.bit0 ↑a
[PROOFSTEP]
exact add_lt_add this this
[GOAL]
α : Type u_1
a b : PosNum
⊢ Ordering.casesOn (cmp (bit0 a) (bit1 b)) (↑(bit0 a) < ↑(bit1 b)) (bit0 a = bit1 b) (↑(bit1 b) < ↑(bit0 a))
[PROOFSTEP]
dsimp [cmp]
[GOAL]
α : Type u_1
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))
[PROOFSTEP]
have := cmp_to_nat a b
[GOAL]
α : Type u_1
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))
[PROOFSTEP]
revert this
[GOAL]
α : Type u_1
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))
[PROOFSTEP]
cases cmp a b
[GOAL]
case lt
α : Type u_1
a b : PosNum
⊢ Ordering.casesOn Ordering.lt (↑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 Ordering.lt)
[PROOFSTEP]
dsimp
[GOAL]
case eq
α : Type u_1
a b : PosNum
⊢ Ordering.casesOn Ordering.eq (↑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 Ordering.eq)
[PROOFSTEP]
dsimp
[GOAL]
case gt
α : Type u_1
a b : PosNum
⊢ Ordering.casesOn Ordering.gt (↑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 Ordering.gt)
[PROOFSTEP]
dsimp
[GOAL]
case lt
α : Type u_1
a b : PosNum
⊢ ↑a < ↑b → _root_.bit0 ↑a < _root_.bit1 ↑b
[PROOFSTEP]
intro this
[GOAL]
case eq
α : Type u_1
a b : PosNum
⊢ a = b → _root_.bit0 ↑a < _root_.bit1 ↑b
[PROOFSTEP]
intro this
[GOAL]
case gt
α : Type u_1
a b : PosNum
⊢ ↑b < ↑a → _root_.bit1 ↑b < _root_.bit0 ↑a
[PROOFSTEP]
intro this
[GOAL]
case lt
α : Type u_1
a b : PosNum
this : ↑a < ↑b
⊢ _root_.bit0 ↑a < _root_.bit1 ↑b
[PROOFSTEP]
exact Nat.le_succ_of_le (add_lt_add this this)
[GOAL]
case eq
α : Type u_1
a b : PosNum
this : a = b
⊢ _root_.bit0 ↑a < _root_.bit1 ↑b
[PROOFSTEP]
rw [this]
[GOAL]
case eq
α : Type u_1
a b : PosNum
this : a = b
⊢ _root_.bit0 ↑b < _root_.bit1 ↑b
[PROOFSTEP]
apply Nat.lt_succ_self
[GOAL]
case gt
α : Type u_1
a b : PosNum
this : ↑b < ↑a
⊢ _root_.bit1 ↑b < _root_.bit0 ↑a
[PROOFSTEP]
exact cmp_to_nat_lemma this
[GOAL]
α : Type u_1
a b : PosNum
⊢ Ordering.casesOn (cmp (bit1 a) (bit0 b)) (↑(bit1 a) < ↑(bit0 b)) (bit1 a = bit0 b) (↑(bit0 b) < ↑(bit1 a))
[PROOFSTEP]
dsimp [cmp]
[GOAL]
α : Type u_1
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))
[PROOFSTEP]
have := cmp_to_nat a b
[GOAL]
α : Type u_1
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))
[PROOFSTEP]
revert this
[GOAL]
α : Type u_1
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))
[PROOFSTEP]
cases cmp a b
[GOAL]
case lt
α : Type u_1
a b : PosNum
⊢ Ordering.casesOn Ordering.lt (↑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 Ordering.lt)
[PROOFSTEP]
dsimp
[GOAL]
case eq
α : Type u_1
a b : PosNum
⊢ Ordering.casesOn Ordering.eq (↑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 Ordering.eq)
[PROOFSTEP]
dsimp
[GOAL]
case gt
α : Type u_1
a b : PosNum
⊢ Ordering.casesOn Ordering.gt (↑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 Ordering.gt)
[PROOFSTEP]
dsimp
[GOAL]
case lt
α : Type u_1
a b : PosNum
⊢ ↑a < ↑b → _root_.bit1 ↑a < _root_.bit0 ↑b
[PROOFSTEP]
intro this
[GOAL]
case eq
α : Type u_1
a b : PosNum
⊢ a = b → _root_.bit0 ↑b < _root_.bit1 ↑a
[PROOFSTEP]
intro this
[GOAL]
case gt
α : Type u_1
a b : PosNum
⊢ ↑b < ↑a → _root_.bit0 ↑b < _root_.bit1 ↑a
[PROOFSTEP]
intro this
[GOAL]
case lt
α : Type u_1
a b : PosNum
this : ↑a < ↑b
⊢ _root_.bit1 ↑a < _root_.bit0 ↑b
[PROOFSTEP]
exact cmp_to_nat_lemma this
[GOAL]
case eq
α : Type u_1
a b : PosNum
this : a = b
⊢ _root_.bit0 ↑b < _root_.bit1 ↑a
[PROOFSTEP]
rw [this]
[GOAL]
case eq
α : Type u_1
a b : PosNum
this : a = b
⊢ _root_.bit0 ↑b < _root_.bit1 ↑b
[PROOFSTEP]
apply Nat.lt_succ_self
[GOAL]
case gt
α : Type u_1
a b : PosNum
this : ↑b < ↑a
⊢ _root_.bit0 ↑b < _root_.bit1 ↑a
[PROOFSTEP]
exact Nat.le_succ_of_le (add_lt_add this this)
[GOAL]
α : Type u_1
a b : PosNum
⊢ Ordering.casesOn (cmp (bit1 a) (bit1 b)) (↑(bit1 a) < ↑(bit1 b)) (bit1 a = bit1 b) (↑(bit1 b) < ↑(bit1 a))
[PROOFSTEP]
have := cmp_to_nat a b
[GOAL]
α : Type u_1
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))
[PROOFSTEP]
revert this
[GOAL]
α : Type u_1
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))
[PROOFSTEP]
cases cmp a b
[GOAL]
case lt
α : Type u_1
a b : PosNum
⊢ Ordering.casesOn Ordering.lt (↑a < ↑b) (a = b) (↑b < ↑a) →
    Ordering.casesOn Ordering.lt (↑(bit1 a) < ↑(bit1 b)) (bit1 a = bit1 b) (↑(bit1 b) < ↑(bit1 a))
[PROOFSTEP]
dsimp
[GOAL]
case eq
α : Type u_1
a b : PosNum
⊢ Ordering.casesOn Ordering.eq (↑a < ↑b) (a = b) (↑b < ↑a) →
    Ordering.casesOn Ordering.eq (↑(bit1 a) < ↑(bit1 b)) (bit1 a = bit1 b) (↑(bit1 b) < ↑(bit1 a))
[PROOFSTEP]
dsimp
[GOAL]
case gt
α : Type u_1
a b : PosNum
⊢ Ordering.casesOn Ordering.gt (↑a < ↑b) (a = b) (↑b < ↑a) →
    Ordering.casesOn Ordering.gt (↑(bit1 a) < ↑(bit1 b)) (bit1 a = bit1 b) (↑(bit1 b) < ↑(bit1 a))
[PROOFSTEP]
dsimp
[GOAL]
case lt
α : Type u_1
a b : PosNum
⊢ ↑a < ↑b → _root_.bit1 ↑a < _root_.bit1 ↑b
[PROOFSTEP]
intro this
[GOAL]
case eq
α : Type u_1
a b : PosNum
⊢ a = b → bit1 a = bit1 b
[PROOFSTEP]
intro this
[GOAL]
case gt
α : Type u_1
a b : PosNum
⊢ ↑b < ↑a → _root_.bit1 ↑b < _root_.bit1 ↑a
[PROOFSTEP]
intro this
[GOAL]
case lt
α : Type u_1
a b : PosNum
this : ↑a < ↑b
⊢ _root_.bit1 ↑a < _root_.bit1 ↑b
[PROOFSTEP]
exact Nat.succ_lt_succ (add_lt_add this this)
[GOAL]
case eq
α : Type u_1
a b : PosNum
this : a = b
⊢ bit1 a = bit1 b
[PROOFSTEP]
rw [this]
[GOAL]
case gt
α : Type u_1
a b : PosNum
this : ↑b < ↑a
⊢ _root_.bit1 ↑b < _root_.bit1 ↑a
[PROOFSTEP]
exact Nat.succ_lt_succ (add_lt_add this this)
[GOAL]
α : Type u_1
m n : PosNum
h : Ordering.casesOn Ordering.lt (↑m < ↑n) (m = n) (↑n < ↑m)
⊢ ↑m < ↑n ↔ Ordering.lt = Ordering.lt
[PROOFSTEP]
simp at h 
[GOAL]
α : Type u_1
m n : PosNum
h : ↑m < ↑n
⊢ ↑m < ↑n ↔ Ordering.lt = Ordering.lt
[PROOFSTEP]
simp [h]
[GOAL]
α : Type u_1
m n : PosNum
h : Ordering.casesOn Ordering.eq (↑m < ↑n) (m = n) (↑n < ↑m)
⊢ ↑m < ↑n ↔ Ordering.eq = Ordering.lt
[PROOFSTEP]
simp at h 
[GOAL]
α : Type u_1
m n : PosNum
h : m = n
⊢ ↑m < ↑n ↔ Ordering.eq = Ordering.lt
[PROOFSTEP]
simp [h, lt_irrefl]
[GOAL]
α : Type u_1
m n : PosNum
h : Ordering.casesOn Ordering.gt (↑m < ↑n) (m = n) (↑n < ↑m)
⊢ ↑m < ↑n ↔ Ordering.gt = Ordering.lt
[PROOFSTEP]
simp [not_lt_of_gt h]
[GOAL]
α : Type u_1
m n : PosNum
⊢ ↑m ≤ ↑n ↔ m ≤ n
[PROOFSTEP]
rw [← not_lt]
[GOAL]
α : Type u_1
m n : PosNum
⊢ ¬↑n < ↑m ↔ m ≤ n
[PROOFSTEP]
exact not_congr lt_to_nat
[GOAL]
α : Type u_1
n : Num
⊢ n + 0 = n
[PROOFSTEP]
cases n
[GOAL]
case zero
α : Type u_1
⊢ zero + 0 = zero
[PROOFSTEP]
rfl
[GOAL]
case pos
α : Type u_1
a✝ : PosNum
⊢ pos a✝ + 0 = pos a✝
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
n : Num
⊢ 0 + n = n
[PROOFSTEP]
cases n
[GOAL]
case zero
α : Type u_1
⊢ 0 + zero = zero
[PROOFSTEP]
rfl
[GOAL]
case pos
α : Type u_1
a✝ : PosNum
⊢ 0 + pos a✝ = pos a✝
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
p : PosNum
⊢ pos p + 1 = succ (pos p)
[PROOFSTEP]
cases p
[GOAL]
case one
α : Type u_1
⊢ pos one + 1 = succ (pos one)
[PROOFSTEP]
rfl
[GOAL]
case bit1
α : Type u_1
a✝ : PosNum
⊢ pos (PosNum.bit1 a✝) + 1 = succ (pos (PosNum.bit1 a✝))
[PROOFSTEP]
rfl
[GOAL]
case bit0
α : Type u_1
a✝ : PosNum
⊢ pos (PosNum.bit0 a✝) + 1 = succ (pos (PosNum.bit0 a✝))
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
n : Num
⊢ 0 + succ n = succ (0 + n)
[PROOFSTEP]
simp [zero_add]
[GOAL]
α : Type u_1
p : PosNum
⊢ pos (p + 1) = succ (pos p + 0)
[PROOFSTEP]
rw [PosNum.add_one, add_zero]
[GOAL]
α : Type u_1
p : PosNum
⊢ pos (PosNum.succ p) = succ (pos p)
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
⊢ ofNat' 0 = 0
[PROOFSTEP]
simp [Num.ofNat']
[GOAL]
α : Type u_1
⊢ ofNat' 1 = 1
[PROOFSTEP]
erw [ofNat'_bit true 0, cond, ofNat'_zero]
[GOAL]
α : Type u_1
⊢ (match (motive := Bool → Num → Num) true with
      | true => Num.bit1
      | false => Num.bit0)
      0 =
    1
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
⊢ ofNat' (0 + 1) = ofNat' 0 + 1
[PROOFSTEP]
simp
[GOAL]
α : Type u_1
b : Bool
n : ℕ
ih : ofNat' (n + 1) = ofNat' n + 1
⊢ ofNat' (Nat.bit b n + 1) = ofNat' (Nat.bit b n) + 1
[PROOFSTEP]
cases b
[GOAL]
case false
α : Type u_1
n : ℕ
ih : ofNat' (n + 1) = ofNat' n + 1
⊢ ofNat' (Nat.bit false n + 1) = ofNat' (Nat.bit false n) + 1
[PROOFSTEP]
erw [ofNat'_bit true n, ofNat'_bit]
[GOAL]
case false
α : Type u_1
n : ℕ
ih : ofNat' (n + 1) = ofNat' n + 1
⊢ cond true Num.bit1 Num.bit0 (ofNat' n) = cond false Num.bit1 Num.bit0 (ofNat' n) + 1
[PROOFSTEP]
simp only [← bit1_of_bit1, ← bit0_of_bit0, cond, _root_.bit1]
  -- Porting note: `cc` was not ported yet so `exact Nat.add_left_comm n 1 1` is used.
[GOAL]
case true
α : Type u_1
n : ℕ
ih : ofNat' (n + 1) = ofNat' n + 1
⊢ ofNat' (Nat.bit true n + 1) = ofNat' (Nat.bit true n) + 1
[PROOFSTEP]
erw [show n.bit true + 1 = (n + 1).bit false by simp [Nat.bit, _root_.bit1, _root_.bit0]; exact Nat.add_left_comm n 1 1,
  ofNat'_bit, ofNat'_bit, ih]
[GOAL]
α : Type u_1
n : ℕ
ih : ofNat' (n + 1) = ofNat' n + 1
⊢ Nat.bit true n + 1 = Nat.bit false (n + 1)
[PROOFSTEP]
simp [Nat.bit, _root_.bit1, _root_.bit0]
[GOAL]
α : Type u_1
n : ℕ
ih : ofNat' (n + 1) = ofNat' n + 1
⊢ n + (1 + 1) = 1 + (n + 1)
[PROOFSTEP]
exact Nat.add_left_comm n 1 1
[GOAL]
case true
α : Type u_1
n : ℕ
ih : ofNat' (n + 1) = ofNat' n + 1
⊢ cond false Num.bit1 Num.bit0 (ofNat' n + 1) = cond true Num.bit1 Num.bit0 (ofNat' n) + 1
[PROOFSTEP]
simp only [cond, add_one, bit1_succ]
[GOAL]
α : Type u_1
m n : ℕ
⊢ ofNat' (m + n) = ofNat' m + ofNat' n
[PROOFSTEP]
have : ∀ {n}, ofNat' n.succ = ofNat' n + 1 := ofNat'_succ
[GOAL]
α : Type u_1
m n : ℕ
this : ∀ {n : ℕ}, ofNat' (Nat.succ n) = ofNat' n + 1
⊢ ofNat' (m + n) = ofNat' m + ofNat' n
[PROOFSTEP]
induction n
[GOAL]
case zero
α : Type u_1
m : ℕ
this : ∀ {n : ℕ}, ofNat' (Nat.succ n) = ofNat' n + 1
⊢ ofNat' (m + Nat.zero) = ofNat' m + ofNat' Nat.zero
[PROOFSTEP]
simp [Nat.add_zero, this, add_zero, Nat.add_succ, add_one, add_succ, *]
[GOAL]
case succ
α : Type u_1
m : ℕ
this : ∀ {n : ℕ}, ofNat' (Nat.succ n) = ofNat' n + 1
n✝ : ℕ
n_ih✝ : ofNat' (m + n✝) = ofNat' m + ofNat' n✝
⊢ ofNat' (m + Nat.succ n✝) = ofNat' m + ofNat' (Nat.succ n✝)
[PROOFSTEP]
simp [Nat.add_zero, this, add_zero, Nat.add_succ, add_one, add_succ, *]
[GOAL]
α : Type u_1
a b : PosNum
⊢ Ordering.casesOn (cmp (pos a) (pos b)) (↑(pos a) < ↑(pos b)) (pos a = pos b) (↑(pos b) < ↑(pos a))
[PROOFSTEP]
have := PosNum.cmp_to_nat a b
[GOAL]
α : Type u_1
a b : PosNum
this : Ordering.casesOn (PosNum.cmp a b) (↑a < ↑b) (a = b) (↑b < ↑a)
⊢ Ordering.casesOn (cmp (pos a) (pos b)) (↑(pos a) < ↑(pos b)) (pos a = pos b) (↑(pos b) < ↑(pos a))
[PROOFSTEP]
revert this
[GOAL]
α : Type u_1
a b : PosNum
⊢ Ordering.casesOn (PosNum.cmp a b) (↑a < ↑b) (a = b) (↑b < ↑a) →
    Ordering.casesOn (cmp (pos a) (pos b)) (↑(pos a) < ↑(pos b)) (pos a = pos b) (↑(pos b) < ↑(pos a))
[PROOFSTEP]
dsimp [cmp]
[GOAL]
α : Type u_1
a b : PosNum
⊢ Ordering.rec (↑a < ↑b) (a = b) (↑b < ↑a) (PosNum.cmp a b) →
    Ordering.rec (↑a < ↑b) (pos a = pos b) (↑b < ↑a) (PosNum.cmp a b)
[PROOFSTEP]
cases PosNum.cmp a b
[GOAL]
case lt
α : Type u_1
a b : PosNum
⊢ Ordering.rec (↑a < ↑b) (a = b) (↑b < ↑a) Ordering.lt → Ordering.rec (↑a < ↑b) (pos a = pos b) (↑b < ↑a) Ordering.lt
case eq
α : Type u_1
a b : PosNum
⊢ Ordering.rec (↑a < ↑b) (a = b) (↑b < ↑a) Ordering.eq → Ordering.rec (↑a < ↑b) (pos a = pos b) (↑b < ↑a) Ordering.eq
case gt
α : Type u_1
a b : PosNum
⊢ Ordering.rec (↑a < ↑b) (a = b) (↑b < ↑a) Ordering.gt → Ordering.rec (↑a < ↑b) (pos a = pos b) (↑b < ↑a) Ordering.gt
[PROOFSTEP]
exacts [id, congr_arg pos, id]
[GOAL]
α : Type u_1
m n : Num
h : Ordering.casesOn Ordering.lt (↑m < ↑n) (m = n) (↑n < ↑m)
⊢ ↑m < ↑n ↔ Ordering.lt = Ordering.lt
[PROOFSTEP]
simp at h 
[GOAL]
α : Type u_1
m n : Num
h : ↑m < ↑n
⊢ ↑m < ↑n ↔ Ordering.lt = Ordering.lt
[PROOFSTEP]
simp [h]
[GOAL]
α : Type u_1
m n : Num
h : Ordering.casesOn Ordering.eq (↑m < ↑n) (m = n) (↑n < ↑m)
⊢ ↑m < ↑n ↔ Ordering.eq = Ordering.lt
[PROOFSTEP]
simp at h 
[GOAL]
α : Type u_1
m n : Num
h : m = n
⊢ ↑m < ↑n ↔ Ordering.eq = Ordering.lt
[PROOFSTEP]
simp [h, lt_irrefl]
[GOAL]
α : Type u_1
m n : Num
h : Ordering.casesOn Ordering.gt (↑m < ↑n) (m = n) (↑n < ↑m)
⊢ ↑m < ↑n ↔ Ordering.gt = Ordering.lt
[PROOFSTEP]
simp [not_lt_of_gt h]
[GOAL]
α : Type u_1
m n : Num
⊢ ↑m ≤ ↑n ↔ m ≤ n
[PROOFSTEP]
rw [← not_lt]
[GOAL]
α : Type u_1
m n : Num
⊢ ¬↑n < ↑m ↔ m ≤ n
[PROOFSTEP]
exact not_congr lt_to_nat
[GOAL]
⊢ Num.ofNat' ↑1 = Num.pos 1
[PROOFSTEP]
erw [@Num.ofNat'_bit true 0, Num.ofNat'_zero]
[GOAL]
⊢ cond true Num.bit1 Num.bit0 0 = Num.pos 1
[PROOFSTEP]
rfl
[GOAL]
p : PosNum
⊢ Num.ofNat' ↑(bit0 p) = Num.pos (bit0 p)
[PROOFSTEP]
erw [@Num.ofNat'_bit false, of_to_nat' p]
[GOAL]
p : PosNum
⊢ cond false Num.bit1 Num.bit0 (Num.pos p) = Num.pos (bit0 p)
[PROOFSTEP]
rfl
[GOAL]
p : PosNum
⊢ Num.ofNat' ↑(bit1 p) = Num.pos (bit1 p)
[PROOFSTEP]
erw [@Num.ofNat'_bit true, of_to_nat' p]
[GOAL]
p : PosNum
⊢ cond true Num.bit1 Num.bit0 (Num.pos p) = Num.pos (bit1 p)
[PROOFSTEP]
rfl
[GOAL]
⊢ ∀ (a b c : Num), a + b + c = a + (b + c)
[PROOFSTEP]
transfer
[GOAL]
⊢ CommSemiring Num
[PROOFSTEP]
refine'
  { Num.addMonoid, Num.addMonoidWithOne with
    mul := (· * ·)
    one := 1
    add := (· + ·)
    zero := 0
    npow := @npowRec Num ⟨1⟩ ⟨(· * ·)⟩, .. }
[GOAL]
case refine'_1
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a b : Num), a + b = b + a
[PROOFSTEP]
try {intros; rfl
}
[GOAL]
case refine'_1
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a b : Num), a + b = b + a
[PROOFSTEP]
{intros; rfl
}
[GOAL]
case refine'_1
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a b : Num), a + b = b + a
[PROOFSTEP]
intros
[GOAL]
case refine'_1
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
a✝ b✝ : Num
⊢ a✝ + b✝ = b✝ + a✝
[PROOFSTEP]
rfl
[GOAL]
case refine'_2
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a b c : Num), a * (b + c) = a * b + a * c
[PROOFSTEP]
try {intros; rfl
}
[GOAL]
case refine'_2
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a b c : Num), a * (b + c) = a * b + a * c
[PROOFSTEP]
{intros; rfl
}
[GOAL]
case refine'_2
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a b c : Num), a * (b + c) = a * b + a * c
[PROOFSTEP]
intros
[GOAL]
case refine'_2
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
a✝ b✝ c✝ : Num
⊢ a✝ * (b✝ + c✝) = a✝ * b✝ + a✝ * c✝
[PROOFSTEP]
rfl
[GOAL]
case refine'_3
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a b c : Num), (a + b) * c = a * c + b * c
[PROOFSTEP]
try {intros; rfl
}
[GOAL]
case refine'_3
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a b c : Num), (a + b) * c = a * c + b * c
[PROOFSTEP]
{intros; rfl
}
[GOAL]
case refine'_3
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a b c : Num), (a + b) * c = a * c + b * c
[PROOFSTEP]
intros
[GOAL]
case refine'_3
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
a✝ b✝ c✝ : Num
⊢ (a✝ + b✝) * c✝ = a✝ * c✝ + b✝ * c✝
[PROOFSTEP]
rfl
[GOAL]
case refine'_4
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a : Num), 0 * a = 0
[PROOFSTEP]
try {intros; rfl
}
[GOAL]
case refine'_4
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a : Num), 0 * a = 0
[PROOFSTEP]
{intros; rfl
}
[GOAL]
case refine'_4
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a : Num), 0 * a = 0
[PROOFSTEP]
intros
[GOAL]
case refine'_4
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
a✝ : Num
⊢ 0 * a✝ = 0
[PROOFSTEP]
rfl
[GOAL]
case refine'_5
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a : Num), a * 0 = 0
[PROOFSTEP]
try {intros; rfl
}
[GOAL]
case refine'_5
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a : Num), a * 0 = 0
[PROOFSTEP]
{intros; rfl
}
[GOAL]
case refine'_5
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a : Num), a * 0 = 0
[PROOFSTEP]
intros
[GOAL]
case refine'_5
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
a✝ : Num
⊢ a✝ * 0 = 0
[PROOFSTEP]
rfl
[GOAL]
case refine'_6
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a b c : Num), a * b * c = a * (b * c)
[PROOFSTEP]
try {intros; rfl
}
[GOAL]
case refine'_6
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a b c : Num), a * b * c = a * (b * c)
[PROOFSTEP]
{intros; rfl
}
[GOAL]
case refine'_6
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a b c : Num), a * b * c = a * (b * c)
[PROOFSTEP]
intros
[GOAL]
case refine'_6
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
a✝ b✝ c✝ : Num
⊢ a✝ * b✝ * c✝ = a✝ * (b✝ * c✝)
[PROOFSTEP]
rfl
[GOAL]
case refine'_7
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a : Num), 1 * a = a
[PROOFSTEP]
try {intros; rfl
}
[GOAL]
case refine'_7
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a : Num), 1 * a = a
[PROOFSTEP]
{intros; rfl
}
[GOAL]
case refine'_7
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a : Num), 1 * a = a
[PROOFSTEP]
intros
[GOAL]
case refine'_7
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
a✝ : Num
⊢ 1 * a✝ = a✝
[PROOFSTEP]
rfl
[GOAL]
case refine'_8
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a : Num), a * 1 = a
[PROOFSTEP]
try {intros; rfl
}
[GOAL]
case refine'_8
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a : Num), a * 1 = a
[PROOFSTEP]
{intros; rfl
}
[GOAL]
case refine'_8
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a : Num), a * 1 = a
[PROOFSTEP]
intros
[GOAL]
case refine'_8
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
a✝ : Num
⊢ a✝ * 1 = a✝
[PROOFSTEP]
rfl
[GOAL]
case refine'_9
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (x : Num), npowRec 0 x = 1
[PROOFSTEP]
try {intros; rfl
}
[GOAL]
case refine'_9
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (x : Num), npowRec 0 x = 1
[PROOFSTEP]
{intros; rfl
}
[GOAL]
case refine'_9
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (x : Num), npowRec 0 x = 1
[PROOFSTEP]
intros
[GOAL]
case refine'_9
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
x✝ : Num
⊢ npowRec 0 x✝ = 1
[PROOFSTEP]
rfl
[GOAL]
case refine'_10
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (n : ℕ) (x : Num), npowRec (n + 1) x = x * npowRec n x
[PROOFSTEP]
try {intros; rfl
}
[GOAL]
case refine'_10
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (n : ℕ) (x : Num), npowRec (n + 1) x = x * npowRec n x
[PROOFSTEP]
{intros; rfl
}
[GOAL]
case refine'_10
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (n : ℕ) (x : Num), npowRec (n + 1) x = x * npowRec n x
[PROOFSTEP]
intros
[GOAL]
case refine'_10
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
n✝ : ℕ
x✝ : Num
⊢ npowRec (n✝ + 1) x✝ = x✝ * npowRec n✝ x✝
[PROOFSTEP]
rfl
[GOAL]
case refine'_11
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a b : Num), a * b = b * a
[PROOFSTEP]
try {intros; rfl
}
[GOAL]
case refine'_11
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a b : Num), a * b = b * a
[PROOFSTEP]
{intros; rfl
}
[GOAL]
case refine'_11
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a b : Num), a * b = b * a
[PROOFSTEP]
intros
[GOAL]
case refine'_11
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
a✝ b✝ : Num
⊢ a✝ * b✝ = b✝ * a✝
[PROOFSTEP]
rfl
[GOAL]
case refine'_1
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a b : Num), a + b = b + a
[PROOFSTEP]
transfer
[GOAL]
case refine'_2
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a b c : Num), a * (b + c) = a * b + a * c
[PROOFSTEP]
transfer
[GOAL]
case refine'_3
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a b c : Num), (a + b) * c = a * c + b * c
[PROOFSTEP]
transfer
[GOAL]
case refine'_4
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a : Num), 0 * a = 0
[PROOFSTEP]
transfer
[GOAL]
case refine'_5
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a : Num), a * 0 = 0
[PROOFSTEP]
transfer
[GOAL]
case refine'_6
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a b c : Num), a * b * c = a * (b * c)
[PROOFSTEP]
transfer
[GOAL]
case refine'_7
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a : Num), 1 * a = a
[PROOFSTEP]
transfer
[GOAL]
case refine'_8
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a : Num), a * 1 = a
[PROOFSTEP]
transfer
[GOAL]
case refine'_11
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
⊢ ∀ (a b : Num), a * b = b * a
[PROOFSTEP]
transfer
[GOAL]
case refine'_1
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
a✝ b✝ : Num
⊢ ↑a✝ + ↑b✝ = ↑b✝ + ↑a✝
[PROOFSTEP]
simp [add_comm, mul_add, add_mul, mul_assoc, mul_comm, mul_left_comm]
[GOAL]
case refine'_2
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
a✝ b✝ c✝ : Num
⊢ ↑a✝ * (↑b✝ + ↑c✝) = ↑a✝ * ↑b✝ + ↑a✝ * ↑c✝
[PROOFSTEP]
simp [add_comm, mul_add, add_mul, mul_assoc, mul_comm, mul_left_comm]
[GOAL]
case refine'_3
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
a✝ b✝ c✝ : Num
⊢ (↑a✝ + ↑b✝) * ↑c✝ = ↑a✝ * ↑c✝ + ↑b✝ * ↑c✝
[PROOFSTEP]
simp [add_comm, mul_add, add_mul, mul_assoc, mul_comm, mul_left_comm]
[GOAL]
case refine'_6
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
a✝ b✝ c✝ : Num
⊢ ↑a✝ * ↑b✝ * ↑c✝ = ↑a✝ * (↑b✝ * ↑c✝)
[PROOFSTEP]
simp [add_comm, mul_add, add_mul, mul_assoc, mul_comm, mul_left_comm]
[GOAL]
case refine'_11
src✝¹ : AddMonoid Num := addMonoid
src✝ : AddMonoidWithOne Num := addMonoidWithOne
a✝ b✝ : Num
⊢ ↑a✝ * ↑b✝ = ↑b✝ * ↑a✝
[PROOFSTEP]
simp [add_comm, mul_add, add_mul, mul_assoc, mul_comm, mul_left_comm]
[GOAL]
src✝ : CommSemiring Num := commSemiring
⊢ ∀ (a : Num), a ≤ a
[PROOFSTEP]
transfer
[GOAL]
src✝ : CommSemiring Num := commSemiring
⊢ ∀ (a b c : Num), a ≤ b → b ≤ c → a ≤ c
[PROOFSTEP]
intro a b c
[GOAL]
src✝ : CommSemiring Num := commSemiring
a b c : Num
⊢ a ≤ b → b ≤ c → a ≤ c
[PROOFSTEP]
transfer_rw
[GOAL]
src✝ : CommSemiring Num := commSemiring
a b c : Num
⊢ ↑a ≤ ↑b → ↑b ≤ ↑c → ↑a ≤ ↑c
[PROOFSTEP]
apply le_trans
[GOAL]
src✝ : CommSemiring Num := commSemiring
⊢ ∀ (a b : Num), a < b ↔ a ≤ b ∧ ¬b ≤ a
[PROOFSTEP]
intro a b
[GOAL]
src✝ : CommSemiring Num := commSemiring
a b : Num
⊢ a < b ↔ a ≤ b ∧ ¬b ≤ a
[PROOFSTEP]
transfer_rw
[GOAL]
src✝ : CommSemiring Num := commSemiring
a b : Num
⊢ ↑a < ↑b ↔ ↑a ≤ ↑b ∧ ¬↑b ≤ ↑a
[PROOFSTEP]
apply lt_iff_le_not_le
[GOAL]
src✝ : CommSemiring Num := commSemiring
⊢ ∀ (a b : Num), a ≤ b → b ≤ a → a = b
[PROOFSTEP]
intro a b
[GOAL]
src✝ : CommSemiring Num := commSemiring
a b : Num
⊢ a ≤ b → b ≤ a → a = b
[PROOFSTEP]
transfer_rw
[GOAL]
src✝ : CommSemiring Num := commSemiring
a b : Num
⊢ ↑a ≤ ↑b → ↑b ≤ ↑a → ↑a = ↑b
[PROOFSTEP]
apply le_antisymm
[GOAL]
src✝ : CommSemiring Num := commSemiring
⊢ ∀ (a b : Num), a ≤ b → ∀ (c : Num), c + a ≤ c + b
[PROOFSTEP]
intro a b h c
[GOAL]
src✝ : CommSemiring Num := commSemiring
a b : Num
h : a ≤ b
c : Num
⊢ c + a ≤ c + b
[PROOFSTEP]
revert h
[GOAL]
src✝ : CommSemiring Num := commSemiring
a b c : Num
⊢ a ≤ b → c + a ≤ c + b
[PROOFSTEP]
transfer_rw
[GOAL]
src✝ : CommSemiring Num := commSemiring
a b c : Num
⊢ ↑a ≤ ↑b → ↑c + ↑a ≤ ↑c + ↑b
[PROOFSTEP]
exact fun h => add_le_add_left h c
[GOAL]
src✝ : CommSemiring Num := commSemiring
⊢ ∀ (a b c : Num), a + b ≤ a + c → b ≤ c
[PROOFSTEP]
intro a b c
[GOAL]
src✝ : CommSemiring Num := commSemiring
a b c : Num
⊢ a + b ≤ a + c → b ≤ c
[PROOFSTEP]
transfer_rw
[GOAL]
src✝ : CommSemiring Num := commSemiring
a b c : Num
⊢ ↑a + ↑b ≤ ↑a + ↑c → ↑b ≤ ↑c
[PROOFSTEP]
apply le_of_add_le_add_left
[GOAL]
src✝¹ : CommSemiring Num := commSemiring
src✝ : OrderedCancelAddCommMonoid Num := orderedCancelAddCommMonoid
⊢ 0 ≠ 1
[PROOFSTEP]
decide
[GOAL]
src✝¹ : CommSemiring Num := commSemiring
src✝ : OrderedCancelAddCommMonoid Num := orderedCancelAddCommMonoid
⊢ 0 ≤ 1
[PROOFSTEP]
decide
[GOAL]
src✝¹ : CommSemiring Num := commSemiring
src✝ : OrderedCancelAddCommMonoid Num := orderedCancelAddCommMonoid
⊢ ∀ (a b c : Num), a < b → 0 < c → c * a < c * b
[PROOFSTEP]
intro a b c
[GOAL]
src✝¹ : CommSemiring Num := commSemiring
src✝ : OrderedCancelAddCommMonoid Num := orderedCancelAddCommMonoid
a b c : Num
⊢ a < b → 0 < c → c * a < c * b
[PROOFSTEP]
transfer_rw
[GOAL]
src✝¹ : CommSemiring Num := commSemiring
src✝ : OrderedCancelAddCommMonoid Num := orderedCancelAddCommMonoid
a b c : Num
⊢ ↑a < ↑b → 0 < ↑c → ↑c * ↑a < ↑c * ↑b
[PROOFSTEP]
apply mul_lt_mul_of_pos_left
[GOAL]
src✝¹ : CommSemiring Num := commSemiring
src✝ : OrderedCancelAddCommMonoid Num := orderedCancelAddCommMonoid
⊢ ∀ (a b c : Num), a < b → 0 < c → a * c < b * c
[PROOFSTEP]
intro a b c
[GOAL]
src✝¹ : CommSemiring Num := commSemiring
src✝ : OrderedCancelAddCommMonoid Num := orderedCancelAddCommMonoid
a b c : Num
⊢ a < b → 0 < c → a * c < b * c
[PROOFSTEP]
transfer_rw
[GOAL]
src✝¹ : CommSemiring Num := commSemiring
src✝ : OrderedCancelAddCommMonoid Num := orderedCancelAddCommMonoid
a b c : Num
⊢ ↑a < ↑b → 0 < ↑c → ↑a * ↑c < ↑b * ↑c
[PROOFSTEP]
apply mul_lt_mul_of_pos_right
[GOAL]
src✝¹ : CommSemiring Num := commSemiring
src✝ : OrderedCancelAddCommMonoid Num := orderedCancelAddCommMonoid
⊢ ∀ (a b : Num), a ≤ b ∨ b ≤ a
[PROOFSTEP]
intro a b
[GOAL]
src✝¹ : CommSemiring Num := commSemiring
src✝ : OrderedCancelAddCommMonoid Num := orderedCancelAddCommMonoid
a b : Num
⊢ a ≤ b ∨ b ≤ a
[PROOFSTEP]
transfer_rw
[GOAL]
src✝¹ : CommSemiring Num := commSemiring
src✝ : OrderedCancelAddCommMonoid Num := orderedCancelAddCommMonoid
a b : Num
⊢ ↑a ≤ ↑b ∨ ↑b ≤ ↑a
[PROOFSTEP]
apply le_total
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
n : Num
⊢ ↑↑n = ↑n
[PROOFSTEP]
rw [← to_nat_to_int, Int.cast_ofNat, cast_to_nat]
[GOAL]
⊢ ↑↑0 = 0
[PROOFSTEP]
rw [Nat.cast_zero, cast_zero]
[GOAL]
n : ℕ
⊢ ↑↑(n + 1) = n + 1
[PROOFSTEP]
rw [Nat.cast_succ, add_one, succ_to_nat, to_of_nat n]
[GOAL]
α : Type u_1
inst✝ : AddMonoidWithOne α
n : ℕ
⊢ ↑↑n = ↑n
[PROOFSTEP]
rw [← cast_to_nat, to_of_nat]
[GOAL]
m n : Num
x✝ : ↑m ∣ ↑n
k : ℕ
e : ↑n = ↑m * k
⊢ n = m * ↑k
[PROOFSTEP]
rw [← of_to_nat n, e]
[GOAL]
m n : Num
x✝ : ↑m ∣ ↑n
k : ℕ
e : ↑n = ↑m * k
⊢ ↑(↑m * k) = m * ↑k
[PROOFSTEP]
simp
[GOAL]
m n : Num
x✝ : m ∣ n
k : Num
e : n = m * k
⊢ ↑n = ↑m * ↑k
[PROOFSTEP]
simp [e, mul_to_nat]
[GOAL]
α : Type u_1
m n : PosNum
h : ↑m = ↑n
⊢ pos m = pos n
[PROOFSTEP]
rw [← PosNum.of_to_nat, ← PosNum.of_to_nat, h]
[GOAL]
α : Type u_1
n : PosNum
⊢ Nat.succ ↑(pred' n) = ↑n
[PROOFSTEP]
rw [pred'_to_nat n, Nat.succ_pred_eq_of_pos (to_nat_pos n)]
[GOAL]
α : Type u_1
n : PosNum
this : Nat.succ ↑(pred' n) = ↑n
h : ↑1 = ↑n
⊢ ↑(Num.casesOn 0 1 bit1) = Nat.pred (_root_.bit0 ↑n)
[PROOFSTEP]
rw [← to_nat_inj.1 h]
[GOAL]
α : Type u_1
n : PosNum
this : Nat.succ ↑(pred' n) = ↑n
h : ↑1 = ↑n
⊢ ↑(Num.casesOn 0 1 bit1) = Nat.pred (_root_.bit0 ↑1)
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
n : PosNum
this : Nat.succ ↑(pred' n) = ↑n
p : PosNum
h : Nat.succ ↑p = ↑n
⊢ ↑(Num.casesOn (pos p) 1 bit1) = Nat.pred (_root_.bit0 ↑n)
[PROOFSTEP]
rw [← h]
[GOAL]
α : Type u_1
n : PosNum
this : Nat.succ ↑(pred' n) = ↑n
p : PosNum
h : Nat.succ ↑p = ↑n
⊢ ↑(Num.casesOn (pos p) 1 bit1) = Nat.pred (_root_.bit0 (Nat.succ ↑p))
[PROOFSTEP]
exact (Nat.succ_add p p).symm
[GOAL]
α : Type u_1
n : Num
⊢ ↑(pred' (succ' n)) = ↑n
[PROOFSTEP]
rw [pred'_to_nat, succ'_to_nat, Nat.add_one, Nat.pred_succ]
[GOAL]
α : Type u_1
n : PosNum
⊢ ↑(succ' (pred' n)) = ↑n
[PROOFSTEP]
rw [succ'_to_nat, pred'_to_nat, Nat.add_one, Nat.succ_pred_eq_of_pos (to_nat_pos _)]
[GOAL]
α : Type u_1
n : PosNum
⊢ ↑(size (bit0 n)) = Nat.size ↑(bit0 n)
[PROOFSTEP]
rw [size, succ_to_nat, size_to_nat n, cast_bit0, Nat.size_bit0 <| ne_of_gt <| to_nat_pos n]
[GOAL]
α : Type u_1
n : PosNum
⊢ ↑(size (bit1 n)) = Nat.size ↑(bit1 n)
[PROOFSTEP]
rw [size, succ_to_nat, size_to_nat n, cast_bit1, Nat.size_bit1]
[GOAL]
α : Type u_1
n : PosNum
⊢ ↑(size (bit0 n)) = natSize (bit0 n)
[PROOFSTEP]
rw [size, succ_to_nat, natSize, size_eq_natSize n]
[GOAL]
α : Type u_1
n : PosNum
⊢ ↑(size (bit1 n)) = natSize (bit1 n)
[PROOFSTEP]
rw [size, succ_to_nat, natSize, size_eq_natSize n]
[GOAL]
α : Type u_1
n : PosNum
⊢ natSize n = Nat.size ↑n
[PROOFSTEP]
rw [← size_eq_natSize, size_to_nat]
[GOAL]
α : Type u_1
n : PosNum
⊢ 0 < natSize n
[PROOFSTEP]
cases n
[GOAL]
case one
α : Type u_1
⊢ 0 < natSize one
[PROOFSTEP]
apply Nat.succ_pos
[GOAL]
case bit1
α : Type u_1
a✝ : PosNum
⊢ 0 < natSize (bit1 a✝)
[PROOFSTEP]
apply Nat.succ_pos
[GOAL]
case bit0
α : Type u_1
a✝ : PosNum
⊢ 0 < natSize (bit0 a✝)
[PROOFSTEP]
apply Nat.succ_pos
[GOAL]
α : Type u_1
⊢ AddCommSemigroup PosNum
[PROOFSTEP]
refine' { add := (· + ·) .. }
[GOAL]
case refine'_1
α : Type u_1
⊢ ∀ (a b c : PosNum), a + b + c = a + (b + c)
[PROOFSTEP]
transfer
[GOAL]
case refine'_1
α : Type u_1
⊢ ∀ (a b c : PosNum), a + b + c = a + (b + c)
[PROOFSTEP]
transfer
[GOAL]
case refine'_2
α : Type u_1
⊢ ∀ (a b : PosNum), a + b = b + a
[PROOFSTEP]
transfer
[GOAL]
case refine'_2
α : Type u_1
⊢ ∀ (a b : PosNum), a + b = b + a
[PROOFSTEP]
transfer
[GOAL]
α : Type u_1
⊢ CommMonoid PosNum
[PROOFSTEP]
refine'
  { mul := (· * ·)
    one := (1 : PosNum)
    npow := @npowRec PosNum ⟨1⟩ ⟨(· * ·)⟩, .. }
[GOAL]
case refine'_1
α : Type u_1
⊢ ∀ (a b c : PosNum), a * b * c = a * (b * c)
[PROOFSTEP]
try {intros; rfl
}
[GOAL]
case refine'_1
α : Type u_1
⊢ ∀ (a b c : PosNum), a * b * c = a * (b * c)
[PROOFSTEP]
{intros; rfl
}
[GOAL]
case refine'_1
α : Type u_1
⊢ ∀ (a b c : PosNum), a * b * c = a * (b * c)
[PROOFSTEP]
intros
[GOAL]
case refine'_1
α : Type u_1
a✝ b✝ c✝ : PosNum
⊢ a✝ * b✝ * c✝ = a✝ * (b✝ * c✝)
[PROOFSTEP]
rfl
[GOAL]
case refine'_2
α : Type u_1
⊢ ∀ (a : PosNum), 1 * a = a
[PROOFSTEP]
try {intros; rfl
}
[GOAL]
case refine'_2
α : Type u_1
⊢ ∀ (a : PosNum), 1 * a = a
[PROOFSTEP]
{intros; rfl
}
[GOAL]
case refine'_2
α : Type u_1
⊢ ∀ (a : PosNum), 1 * a = a
[PROOFSTEP]
intros
[GOAL]
case refine'_2
α : Type u_1
a✝ : PosNum
⊢ 1 * a✝ = a✝
[PROOFSTEP]
rfl
[GOAL]
case refine'_3
α : Type u_1
⊢ ∀ (a : PosNum), a * 1 = a
[PROOFSTEP]
try {intros; rfl
}
[GOAL]
case refine'_3
α : Type u_1
⊢ ∀ (a : PosNum), a * 1 = a
[PROOFSTEP]
{intros; rfl
}
[GOAL]
case refine'_3
α : Type u_1
⊢ ∀ (a : PosNum), a * 1 = a
[PROOFSTEP]
intros
[GOAL]
case refine'_3
α : Type u_1
a✝ : PosNum
⊢ a✝ * 1 = a✝
[PROOFSTEP]
rfl
[GOAL]
case refine'_4
α : Type u_1
⊢ ∀ (x : PosNum), npowRec 0 x = 1
[PROOFSTEP]
try {intros; rfl
}
[GOAL]
case refine'_4
α : Type u_1
⊢ ∀ (x : PosNum), npowRec 0 x = 1
[PROOFSTEP]
{intros; rfl
}
[GOAL]
case refine'_4
α : Type u_1
⊢ ∀ (x : PosNum), npowRec 0 x = 1
[PROOFSTEP]
intros
[GOAL]
case refine'_4
α : Type u_1
x✝ : PosNum
⊢ npowRec 0 x✝ = 1
[PROOFSTEP]
rfl
[GOAL]
case refine'_5
α : Type u_1
⊢ ∀ (n : ℕ) (x : PosNum), npowRec (n + 1) x = x * npowRec n x
[PROOFSTEP]
try {intros; rfl
}
[GOAL]
case refine'_5
α : Type u_1
⊢ ∀ (n : ℕ) (x : PosNum), npowRec (n + 1) x = x * npowRec n x
[PROOFSTEP]
{intros; rfl
}
[GOAL]
case refine'_5
α : Type u_1
⊢ ∀ (n : ℕ) (x : PosNum), npowRec (n + 1) x = x * npowRec n x
[PROOFSTEP]
intros
[GOAL]
case refine'_5
α : Type u_1
n✝ : ℕ
x✝ : PosNum
⊢ npowRec (n✝ + 1) x✝ = x✝ * npowRec n✝ x✝
[PROOFSTEP]
rfl
[GOAL]
case refine'_6
α : Type u_1
⊢ ∀ (a b : PosNum), a * b = b * a
[PROOFSTEP]
try {intros; rfl
}
[GOAL]
case refine'_6
α : Type u_1
⊢ ∀ (a b : PosNum), a * b = b * a
[PROOFSTEP]
{intros; rfl
}
[GOAL]
case refine'_6
α : Type u_1
⊢ ∀ (a b : PosNum), a * b = b * a
[PROOFSTEP]
intros
[GOAL]
case refine'_6
α : Type u_1
a✝ b✝ : PosNum
⊢ a✝ * b✝ = b✝ * a✝
[PROOFSTEP]
rfl
[GOAL]
case refine'_1
α : Type u_1
⊢ ∀ (a b c : PosNum), a * b * c = a * (b * c)
[PROOFSTEP]
transfer
[GOAL]
case refine'_1
α : Type u_1
⊢ ∀ (a b c : PosNum), a * b * c = a * (b * c)
[PROOFSTEP]
transfer
[GOAL]
case refine'_2
α : Type u_1
⊢ ∀ (a : PosNum), 1 * a = a
[PROOFSTEP]
transfer
[GOAL]
case refine'_2
α : Type u_1
⊢ ∀ (a : PosNum), 1 * a = a
[PROOFSTEP]
transfer
[GOAL]
case refine'_6
α : Type u_1
⊢ ∀ (a b : PosNum), a * b = b * a
[PROOFSTEP]
transfer
[GOAL]
case refine'_6
α : Type u_1
⊢ ∀ (a b : PosNum), a * b = b * a
[PROOFSTEP]
transfer
[GOAL]
α : Type u_1
⊢ Distrib PosNum
[PROOFSTEP]
refine'
  { add := (· + ·)
    mul := (· * ·) .. }
[GOAL]
case refine'_1
α : Type u_1
⊢ ∀ (a b c : PosNum), a * (b + c) = a * b + a * c
[PROOFSTEP]
transfer
[GOAL]
case refine'_1
α : Type u_1
⊢ ∀ (a b c : PosNum), a * (b + c) = a * b + a * c
[PROOFSTEP]
transfer
[GOAL]
case refine'_1
α : Type u_1
a✝ b✝ c✝ : PosNum
⊢ ↑a✝ * (↑b✝ + ↑c✝) = ↑a✝ * ↑b✝ + ↑a✝ * ↑c✝
[PROOFSTEP]
simp [mul_add, mul_comm]
[GOAL]
case refine'_2
α : Type u_1
⊢ ∀ (a b c : PosNum), (a + b) * c = a * c + b * c
[PROOFSTEP]
transfer
[GOAL]
case refine'_2
α : Type u_1
⊢ ∀ (a b c : PosNum), (a + b) * c = a * c + b * c
[PROOFSTEP]
transfer
[GOAL]
case refine'_2
α : Type u_1
a✝ b✝ c✝ : PosNum
⊢ ↑c✝ * (↑a✝ + ↑b✝) = ↑a✝ * ↑c✝ + ↑b✝ * ↑c✝
[PROOFSTEP]
simp [mul_add, mul_comm]
[GOAL]
α : Type u_1
⊢ ∀ (a : PosNum), a ≤ a
[PROOFSTEP]
transfer
[GOAL]
α : Type u_1
⊢ ∀ (a : PosNum), a ≤ a
[PROOFSTEP]
transfer
[GOAL]
α : Type u_1
⊢ ∀ (a b c : PosNum), a ≤ b → b ≤ c → a ≤ c
[PROOFSTEP]
intro a b c
[GOAL]
α : Type u_1
a b c : PosNum
⊢ a ≤ b → b ≤ c → a ≤ c
[PROOFSTEP]
transfer_rw
[GOAL]
α : Type u_1
a b c : PosNum
⊢ a ≤ b → b ≤ c → a ≤ c
[PROOFSTEP]
transfer_rw
[GOAL]
α : Type u_1
a b c : PosNum
⊢ ↑a ≤ ↑b → ↑b ≤ ↑c → ↑a ≤ ↑c
[PROOFSTEP]
apply le_trans
[GOAL]
α : Type u_1
⊢ ∀ (a b : PosNum), a < b ↔ a ≤ b ∧ ¬b ≤ a
[PROOFSTEP]
intro a b
[GOAL]
α : Type u_1
a b : PosNum
⊢ a < b ↔ a ≤ b ∧ ¬b ≤ a
[PROOFSTEP]
transfer_rw
[GOAL]
α : Type u_1
a b : PosNum
⊢ a < b ↔ a ≤ b ∧ ¬b ≤ a
[PROOFSTEP]
transfer_rw
[GOAL]
α : Type u_1
a b : PosNum
⊢ ↑a < ↑b ↔ ↑a ≤ ↑b ∧ ¬↑b ≤ ↑a
[PROOFSTEP]
apply lt_iff_le_not_le
[GOAL]
α : Type u_1
⊢ ∀ (a b : PosNum), a ≤ b → b ≤ a → a = b
[PROOFSTEP]
intro a b
[GOAL]
α : Type u_1
a b : PosNum
⊢ a ≤ b → b ≤ a → a = b
[PROOFSTEP]
transfer_rw
[GOAL]
α : Type u_1
a b : PosNum
⊢ a ≤ b → b ≤ a → a = b
[PROOFSTEP]
transfer_rw
[GOAL]
α : Type u_1
a b : PosNum
⊢ ↑a ≤ ↑b → ↑b ≤ ↑a → ↑a = ↑b
[PROOFSTEP]
apply le_antisymm
[GOAL]
α : Type u_1
⊢ ∀ (a b : PosNum), a ≤ b ∨ b ≤ a
[PROOFSTEP]
intro a b
[GOAL]
α : Type u_1
a b : PosNum
⊢ a ≤ b ∨ b ≤ a
[PROOFSTEP]
transfer_rw
[GOAL]
α : Type u_1
a b : PosNum
⊢ a ≤ b ∨ b ≤ a
[PROOFSTEP]
transfer_rw
[GOAL]
α : Type u_1
a b : PosNum
⊢ ↑a ≤ ↑b ∨ ↑b ≤ ↑a
[PROOFSTEP]
apply le_total
[GOAL]
α : Type u_1
⊢ DecidableRel fun x x_1 => x ≤ x_1
[PROOFSTEP]
infer_instance
[GOAL]
α : Type u_1
⊢ DecidableEq PosNum
[PROOFSTEP]
infer_instance
[GOAL]
α : Type u_1
⊢ DecidableRel fun x x_1 => x < x_1
[PROOFSTEP]
infer_instance
[GOAL]
α : Type u_1
n : PosNum
⊢ ↑n = pos n
[PROOFSTEP]
rw [← cast_to_nat, ← of_to_nat n]
[GOAL]
α : Type u_1
b : Bool
n : PosNum
⊢ ↑(bit b n) = Nat.bit b ↑n
[PROOFSTEP]
cases b
[GOAL]
case false
α : Type u_1
n : PosNum
⊢ ↑(bit false n) = Nat.bit false ↑n
[PROOFSTEP]
rfl
[GOAL]
case true
α : Type u_1
n : PosNum
⊢ ↑(bit true n) = Nat.bit true ↑n
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
inst✝ : AddMonoidWithOne α
m n : PosNum
⊢ ↑(m + n) = ↑m + ↑n
[PROOFSTEP]
rw [← cast_to_nat, add_to_nat, Nat.cast_add, cast_to_nat, cast_to_nat]
[GOAL]
α : Type u_1
inst✝ : AddMonoidWithOne α
n : PosNum
⊢ ↑(succ n) = ↑n + 1
[PROOFSTEP]
rw [← add_one, cast_add, cast_one]
[GOAL]
α : Type u_1
inst✝¹ : AddMonoidWithOne α
inst✝ : CharZero α
m n : PosNum
⊢ ↑m = ↑n ↔ m = n
[PROOFSTEP]
rw [← cast_to_nat m, ← cast_to_nat n, Nat.cast_inj, to_nat_inj]
[GOAL]
α : Type u_1
inst✝ : LinearOrderedSemiring α
n : PosNum
⊢ 1 ≤ ↑n
[PROOFSTEP]
rw [← cast_to_nat, ← Nat.cast_one, Nat.cast_le (α := α)]
[GOAL]
α : Type u_1
inst✝ : LinearOrderedSemiring α
n : PosNum
⊢ 1 ≤ ↑n
[PROOFSTEP]
apply to_nat_pos
[GOAL]
α : Type u_1
inst✝ : Semiring α
m n : PosNum
⊢ ↑(m * n) = ↑m * ↑n
[PROOFSTEP]
rw [← cast_to_nat, mul_to_nat, Nat.cast_mul, cast_to_nat, cast_to_nat]
[GOAL]
α : Type u_1
m n : PosNum
⊢ cmp m n = Ordering.eq ↔ m = n
[PROOFSTEP]
have := cmp_to_nat m n
[GOAL]
α : Type u_1
m n : PosNum
this : Ordering.casesOn (cmp m n) (↑m < ↑n) (m = n) (↑n < ↑m)
⊢ cmp m n = Ordering.eq ↔ m = n
[PROOFSTEP]
revert this
[GOAL]
α : Type u_1
m n : PosNum
⊢ Ordering.casesOn (cmp m n) (↑m < ↑n) (m = n) (↑n < ↑m) → (cmp m n = Ordering.eq ↔ m = n)
[PROOFSTEP]
cases cmp m n
[GOAL]
case lt
α : Type u_1
m n : PosNum
⊢ Ordering.casesOn Ordering.lt (↑m < ↑n) (m = n) (↑n < ↑m) → (Ordering.lt = Ordering.eq ↔ m = n)
[PROOFSTEP]
intro this
[GOAL]
case eq
α : Type u_1
m n : PosNum
⊢ Ordering.casesOn Ordering.eq (↑m < ↑n) (m = n) (↑n < ↑m) → (Ordering.eq = Ordering.eq ↔ m = n)
[PROOFSTEP]
intro this
[GOAL]
case gt
α : Type u_1
m n : PosNum
⊢ Ordering.casesOn Ordering.gt (↑m < ↑n) (m = n) (↑n < ↑m) → (Ordering.gt = Ordering.eq ↔ m = n)
[PROOFSTEP]
intro this
[GOAL]
case lt
α : Type u_1
m n : PosNum
this : Ordering.casesOn Ordering.lt (↑m < ↑n) (m = n) (↑n < ↑m)
⊢ Ordering.lt = Ordering.eq ↔ m = n
[PROOFSTEP]
simp at this ⊢
[GOAL]
case eq
α : Type u_1
m n : PosNum
this : Ordering.casesOn Ordering.eq (↑m < ↑n) (m = n) (↑n < ↑m)
⊢ Ordering.eq = Ordering.eq ↔ m = n
[PROOFSTEP]
simp at this ⊢
[GOAL]
case gt
α : Type u_1
m n : PosNum
this : Ordering.casesOn Ordering.gt (↑m < ↑n) (m = n) (↑n < ↑m)
⊢ Ordering.gt = Ordering.eq ↔ m = n
[PROOFSTEP]
simp at this ⊢
[GOAL]
case lt
α : Type u_1
m n : PosNum
this : ↑m < ↑n
⊢ ¬m = n
[PROOFSTEP]
try {exact this
}
[GOAL]
case lt
α : Type u_1
m n : PosNum
this : ↑m < ↑n
⊢ ¬m = n
[PROOFSTEP]
{exact this
}
[GOAL]
case lt
α : Type u_1
m n : PosNum
this : ↑m < ↑n
⊢ ¬m = n
[PROOFSTEP]
exact this
[GOAL]
case eq
α : Type u_1
m n : PosNum
this : m = n
⊢ m = n
[PROOFSTEP]
try {exact this
}
[GOAL]
case eq
α : Type u_1
m n : PosNum
this : m = n
⊢ m = n
[PROOFSTEP]
{exact this
}
[GOAL]
case eq
α : Type u_1
m n : PosNum
this : m = n
⊢ m = n
[PROOFSTEP]
exact this
[GOAL]
case gt
α : Type u_1
m n : PosNum
this : ↑n < ↑m
⊢ ¬m = n
[PROOFSTEP]
try {exact this
}
[GOAL]
case gt
α : Type u_1
m n : PosNum
this : ↑n < ↑m
⊢ ¬m = n
[PROOFSTEP]
{exact this
}
[GOAL]
case gt
α : Type u_1
m n : PosNum
this : ↑n < ↑m
⊢ ¬m = n
[PROOFSTEP]
exact this
[GOAL]
case lt
α : Type u_1
m n : PosNum
this : ↑m < ↑n
⊢ ¬m = n
[PROOFSTEP]
simp [show m ≠ n from fun e => by rw [e] at this ; exact lt_irrefl _ this]
[GOAL]
α : Type u_1
m n : PosNum
this : ↑m < ↑n
e : m = n
⊢ False
[PROOFSTEP]
rw [e] at this 
[GOAL]
α : Type u_1
m n : PosNum
this : ↑n < ↑n
e : m = n
⊢ False
[PROOFSTEP]
exact lt_irrefl _ this
[GOAL]
case gt
α : Type u_1
m n : PosNum
this : ↑n < ↑m
⊢ ¬m = n
[PROOFSTEP]
simp [show m ≠ n from fun e => by rw [e] at this ; exact lt_irrefl _ this]
[GOAL]
α : Type u_1
m n : PosNum
this : ↑n < ↑m
e : m = n
⊢ False
[PROOFSTEP]
rw [e] at this 
[GOAL]
α : Type u_1
m n : PosNum
this : ↑n < ↑n
e : m = n
⊢ False
[PROOFSTEP]
exact lt_irrefl _ this
[GOAL]
α : Type u_1
inst✝ : LinearOrderedSemiring α
m n : PosNum
⊢ ↑m < ↑n ↔ m < n
[PROOFSTEP]
rw [← cast_to_nat m, ← cast_to_nat n, Nat.cast_lt (α := α), lt_to_nat]
[GOAL]
α : Type u_1
inst✝ : LinearOrderedSemiring α
m n : PosNum
⊢ ↑m ≤ ↑n ↔ m ≤ n
[PROOFSTEP]
rw [← not_lt]
[GOAL]
α : Type u_1
inst✝ : LinearOrderedSemiring α
m n : PosNum
⊢ ¬↑n < ↑m ↔ m ≤ n
[PROOFSTEP]
exact not_congr cast_lt
[GOAL]
α : Type u_1
b : Bool
n : Num
⊢ ↑(bit b n) = Nat.bit b ↑n
[PROOFSTEP]
cases b
[GOAL]
case false
α : Type u_1
n : Num
⊢ ↑(bit false n) = Nat.bit false ↑n
[PROOFSTEP]
cases n
[GOAL]
case true
α : Type u_1
n : Num
⊢ ↑(bit true n) = Nat.bit true ↑n
[PROOFSTEP]
cases n
[GOAL]
case false.zero
α : Type u_1
⊢ ↑(bit false zero) = Nat.bit false ↑zero
[PROOFSTEP]
rfl
[GOAL]
case false.pos
α : Type u_1
a✝ : PosNum
⊢ ↑(bit false (pos a✝)) = Nat.bit false ↑(pos a✝)
[PROOFSTEP]
rfl
[GOAL]
case true.zero
α : Type u_1
⊢ ↑(bit true zero) = Nat.bit true ↑zero
[PROOFSTEP]
rfl
[GOAL]
case true.pos
α : Type u_1
a✝ : PosNum
⊢ ↑(bit true (pos a✝)) = Nat.bit true ↑(pos a✝)
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
inst✝ : AddMonoidWithOne α
n : Num
⊢ ↑(succ' n) = ↑n + 1
[PROOFSTEP]
rw [← PosNum.cast_to_nat, succ'_to_nat, Nat.cast_add_one, cast_to_nat]
[GOAL]
α : Type u_1
inst✝ : Semiring α
m n : Num
⊢ ↑(m + n) = ↑m + ↑n
[PROOFSTEP]
rw [← cast_to_nat, add_to_nat, Nat.cast_add, cast_to_nat, cast_to_nat]
[GOAL]
α : Type u_1
inst✝ : Semiring α
n : Num
⊢ ↑(Num.bit0 n) = _root_.bit0 ↑n
[PROOFSTEP]
rw [← bit0_of_bit0, _root_.bit0, cast_add]
[GOAL]
α : Type u_1
inst✝ : Semiring α
n : Num
⊢ ↑n + ↑n = _root_.bit0 ↑n
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
inst✝ : Semiring α
n : Num
⊢ ↑(Num.bit1 n) = _root_.bit1 ↑n
[PROOFSTEP]
rw [← bit1_of_bit1, _root_.bit1, bit0_of_bit0, cast_add, cast_bit0]
[GOAL]
α : Type u_1
inst✝ : Semiring α
n : Num
⊢ _root_.bit0 ↑n + ↑1 = _root_.bit1 ↑n
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
n : Num
⊢ natSize n = Nat.size ↑n
[PROOFSTEP]
rw [← size_eq_natSize, size_to_nat]
[GOAL]
α : Type u_1
⊢ ofNat' 0 = ↑0
[PROOFSTEP]
simp
[GOAL]
α : Type u_1
b : Bool
n : ℕ
IH : ofNat' n = ↑n
⊢ ofNat' (Nat.bit b n) = ↑(Nat.bit b n)
[PROOFSTEP]
rw [ofNat'] at IH ⊢
[GOAL]
α : Type u_1
b : Bool
n : ℕ
IH : Nat.binaryRec 0 (fun b x => bif b then Num.bit1 else Num.bit0) n = ↑n
⊢ Nat.binaryRec 0 (fun b x => bif b then Num.bit1 else Num.bit0) (Nat.bit b n) = ↑(Nat.bit b n)
[PROOFSTEP]
rw [Nat.binaryRec_eq, IH]
  -- Porting note: `Nat.cast_bit0` & `Nat.cast_bit1` are not `simp` theorems anymore.
[GOAL]
α : Type u_1
b : Bool
n : ℕ
IH : Nat.binaryRec 0 (fun b x => bif b then Num.bit1 else Num.bit0) n = ↑n
⊢ cond b Num.bit1 Num.bit0 ↑n = ↑(Nat.bit b n)
[PROOFSTEP]
cases b
[GOAL]
case false
α : Type u_1
n : ℕ
IH : Nat.binaryRec 0 (fun b x => bif b then Num.bit1 else Num.bit0) n = ↑n
⊢ cond false Num.bit1 Num.bit0 ↑n = ↑(Nat.bit false n)
[PROOFSTEP]
simp [Nat.bit, bit0_of_bit0, bit1_of_bit1, Nat.cast_bit0, Nat.cast_bit1]
[GOAL]
case true
α : Type u_1
n : ℕ
IH : Nat.binaryRec 0 (fun b x => bif b then Num.bit1 else Num.bit0) n = ↑n
⊢ cond true Num.bit1 Num.bit0 ↑n = ↑(Nat.bit true n)
[PROOFSTEP]
simp [Nat.bit, bit0_of_bit0, bit1_of_bit1, Nat.cast_bit0, Nat.cast_bit1]
[GOAL]
case h
α : Type u_1
b : Bool
n : ℕ
IH : Nat.binaryRec 0 (fun b x => bif b then Num.bit1 else Num.bit0) n = ↑n
⊢ cond false Num.bit1 Num.bit0 0 = 0
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
n : Num
⊢ -toZNum n = toZNumNeg n
[PROOFSTEP]
cases n
[GOAL]
case zero
α : Type u_1
⊢ -toZNum zero = toZNumNeg zero
[PROOFSTEP]
rfl
[GOAL]
case pos
α : Type u_1
a✝ : PosNum
⊢ -toZNum (pos a✝) = toZNumNeg (pos a✝)
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
n : Num
⊢ -toZNumNeg n = toZNum n
[PROOFSTEP]
cases n
[GOAL]
case zero
α : Type u_1
⊢ -toZNumNeg zero = toZNum zero
[PROOFSTEP]
rfl
[GOAL]
case pos
α : Type u_1
a✝ : PosNum
⊢ -toZNumNeg (pos a✝) = toZNum (pos a✝)
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
m n : Num
h : toZNum m = toZNum n
⊢ m = n
[PROOFSTEP]
cases m
[GOAL]
case zero
α : Type u_1
n : Num
h : toZNum zero = toZNum n
⊢ zero = n
[PROOFSTEP]
cases n
[GOAL]
case pos
α : Type u_1
n : Num
a✝ : PosNum
h : toZNum (pos a✝) = toZNum n
⊢ pos a✝ = n
[PROOFSTEP]
cases n
[GOAL]
case zero.zero
α : Type u_1
h : toZNum zero = toZNum zero
⊢ zero = zero
[PROOFSTEP]
cases h
[GOAL]
case zero.pos
α : Type u_1
a✝ : PosNum
h : toZNum zero = toZNum (pos a✝)
⊢ zero = pos a✝
[PROOFSTEP]
cases h
[GOAL]
case pos.zero
α : Type u_1
a✝ : PosNum
h : toZNum (pos a✝) = toZNum zero
⊢ pos a✝ = zero
[PROOFSTEP]
cases h
[GOAL]
case pos.pos
α : Type u_1
a✝¹ a✝ : PosNum
h : toZNum (pos a✝¹) = toZNum (pos a✝)
⊢ pos a✝¹ = pos a✝
[PROOFSTEP]
cases h
[GOAL]
case zero.zero.refl
α : Type u_1
⊢ zero = zero
[PROOFSTEP]
rfl
[GOAL]
case pos.pos.refl
α : Type u_1
a✝ : PosNum
⊢ pos a✝ = pos a✝
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
m n : Num
⊢ toZNum (m + n) = toZNum m + toZNum n
[PROOFSTEP]
cases m
[GOAL]
case zero
α : Type u_1
n : Num
⊢ toZNum (zero + n) = toZNum zero + toZNum n
[PROOFSTEP]
cases n
[GOAL]
case pos
α : Type u_1
n : Num
a✝ : PosNum
⊢ toZNum (pos a✝ + n) = toZNum (pos a✝) + toZNum n
[PROOFSTEP]
cases n
[GOAL]
case zero.zero
α : Type u_1
⊢ toZNum (zero + zero) = toZNum zero + toZNum zero
[PROOFSTEP]
rfl
[GOAL]
case zero.pos
α : Type u_1
a✝ : PosNum
⊢ toZNum (zero + pos a✝) = toZNum zero + toZNum (pos a✝)
[PROOFSTEP]
rfl
[GOAL]
case pos.zero
α : Type u_1
a✝ : PosNum
⊢ toZNum (pos a✝ + zero) = toZNum (pos a✝) + toZNum zero
[PROOFSTEP]
rfl
[GOAL]
case pos.pos
α : Type u_1
a✝¹ a✝ : PosNum
⊢ toZNum (pos a✝¹ + pos a✝) = toZNum (pos a✝¹) + toZNum (pos a✝)
[PROOFSTEP]
rfl
[GOAL]
n : PosNum
h : 1 < n
⊢ ↑(pred n) = Nat.pred ↑n
[PROOFSTEP]
unfold pred
[GOAL]
n : PosNum
h : 1 < n
⊢ ↑(Num.casesOn (pred' n) 1 id) = Nat.pred ↑n
[PROOFSTEP]
cases e : pred' n
[GOAL]
case zero
n : PosNum
h : 1 < n
e : pred' n = zero
⊢ ↑(Num.casesOn zero 1 id) = Nat.pred ↑n
[PROOFSTEP]
have : (1 : ℕ) ≤ Nat.pred n := Nat.pred_le_pred ((@cast_lt ℕ _ _ _).2 h)
[GOAL]
case zero
n : PosNum
h : 1 < n
e : pred' n = zero
this : 1 ≤ Nat.pred ↑n
⊢ ↑(Num.casesOn zero 1 id) = Nat.pred ↑n
[PROOFSTEP]
rw [← pred'_to_nat, e] at this 
[GOAL]
case zero
n : PosNum
h : 1 < n
e : pred' n = zero
this : 1 ≤ ↑zero
⊢ ↑(Num.casesOn zero 1 id) = Nat.pred ↑n
[PROOFSTEP]
exact absurd this (by decide)
[GOAL]
n : PosNum
h : 1 < n
e : pred' n = zero
this : 1 ≤ ↑zero
⊢ ¬1 ≤ ↑zero
[PROOFSTEP]
decide
[GOAL]
case pos
n : PosNum
h : 1 < n
a✝ : PosNum
e : pred' n = pos a✝
⊢ ↑(Num.casesOn (pos a✝) 1 id) = Nat.pred ↑n
[PROOFSTEP]
rw [← pred'_to_nat, e]
[GOAL]
case pos
n : PosNum
h : 1 < n
a✝ : PosNum
e : pred' n = pos a✝
⊢ ↑(Num.casesOn (pos a✝) 1 id) = ↑(pos a✝)
[PROOFSTEP]
rfl
[GOAL]
a : PosNum
⊢ sub' a 1 = toZNum (pred' a)
[PROOFSTEP]
cases a
[GOAL]
case one
⊢ sub' one 1 = toZNum (pred' one)
[PROOFSTEP]
rfl
[GOAL]
case bit1
a✝ : PosNum
⊢ sub' (bit1 a✝) 1 = toZNum (pred' (bit1 a✝))
[PROOFSTEP]
rfl
[GOAL]
case bit0
a✝ : PosNum
⊢ sub' (bit0 a✝) 1 = toZNum (pred' (bit0 a✝))
[PROOFSTEP]
rfl
[GOAL]
a : PosNum
⊢ sub' 1 a = toZNumNeg (pred' a)
[PROOFSTEP]
cases a
[GOAL]
case one
⊢ sub' 1 one = toZNumNeg (pred' one)
[PROOFSTEP]
rfl
[GOAL]
case bit1
a✝ : PosNum
⊢ sub' 1 (bit1 a✝) = toZNumNeg (pred' (bit1 a✝))
[PROOFSTEP]
rfl
[GOAL]
case bit0
a✝ : PosNum
⊢ sub' 1 (bit0 a✝) = toZNumNeg (pred' (bit0 a✝))
[PROOFSTEP]
rfl
[GOAL]
m n : PosNum
⊢ cmp n m = Ordering.lt ↔ cmp m n = Ordering.gt
[PROOFSTEP]
rw [← cmp_swap]
[GOAL]
m n : PosNum
⊢ Ordering.swap (cmp m n) = Ordering.lt ↔ cmp m n = Ordering.gt
[PROOFSTEP]
cases cmp m n
[GOAL]
case lt
m n : PosNum
⊢ Ordering.swap Ordering.lt = Ordering.lt ↔ Ordering.lt = Ordering.gt
[PROOFSTEP]
exact by decide
[GOAL]
m n : PosNum
⊢ Ordering.swap Ordering.lt = Ordering.lt ↔ Ordering.lt = Ordering.gt
[PROOFSTEP]
decide
[GOAL]
case eq
m n : PosNum
⊢ Ordering.swap Ordering.eq = Ordering.lt ↔ Ordering.eq = Ordering.gt
[PROOFSTEP]
exact by decide
[GOAL]
m n : PosNum
⊢ Ordering.swap Ordering.eq = Ordering.lt ↔ Ordering.eq = Ordering.gt
[PROOFSTEP]
decide
[GOAL]
case gt
m n : PosNum
⊢ Ordering.swap Ordering.gt = Ordering.lt ↔ Ordering.gt = Ordering.gt
[PROOFSTEP]
exact by decide
[GOAL]
m n : PosNum
⊢ Ordering.swap Ordering.gt = Ordering.lt ↔ Ordering.gt = Ordering.gt
[PROOFSTEP]
decide
[GOAL]
α : Type u_1
p : PosNum
⊢ ↑(pred (pos p)) = Nat.pred ↑(pos p)
[PROOFSTEP]
rw [pred, PosNum.pred'_to_nat]
[GOAL]
α : Type u_1
p : PosNum
⊢ Nat.pred ↑p = Nat.pred ↑(pos p)
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
p : PosNum
⊢ castNum <$> ppred (pos p) = Nat.ppred ↑(pos p)
[PROOFSTEP]
rw [ppred, Option.map_some, Nat.ppred_eq_some.2]
[GOAL]
α : Type u_1
p : PosNum
⊢ Nat.succ ↑(pred' p) = ↑(pos p)
[PROOFSTEP]
rw [PosNum.pred'_to_nat, Nat.succ_pred_eq_of_pos (PosNum.to_nat_pos _)]
[GOAL]
α : Type u_1
p : PosNum
⊢ ↑p = ↑(pos p)
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
m n : Num
⊢ Ordering.swap (cmp m n) = cmp n m
[PROOFSTEP]
cases m
[GOAL]
case zero
α : Type u_1
n : Num
⊢ Ordering.swap (cmp zero n) = cmp n zero
[PROOFSTEP]
cases n
[GOAL]
case pos
α : Type u_1
n : Num
a✝ : PosNum
⊢ Ordering.swap (cmp (pos a✝) n) = cmp n (pos a✝)
[PROOFSTEP]
cases n
[GOAL]
case zero.zero
α : Type u_1
⊢ Ordering.swap (cmp zero zero) = cmp zero zero
[PROOFSTEP]
try {unfold cmp
}
[GOAL]
case zero.zero
α : Type u_1
⊢ Ordering.swap (cmp zero zero) = cmp zero zero
[PROOFSTEP]
{unfold cmp
}
[GOAL]
case zero.zero
α : Type u_1
⊢ Ordering.swap (cmp zero zero) = cmp zero zero
[PROOFSTEP]
unfold cmp
[GOAL]
case zero.pos
α : Type u_1
a✝ : PosNum
⊢ Ordering.swap (cmp zero (pos a✝)) = cmp (pos a✝) zero
[PROOFSTEP]
try {unfold cmp
}
[GOAL]
case zero.pos
α : Type u_1
a✝ : PosNum
⊢ Ordering.swap (cmp zero (pos a✝)) = cmp (pos a✝) zero
[PROOFSTEP]
{unfold cmp
}
[GOAL]
case zero.pos
α : Type u_1
a✝ : PosNum
⊢ Ordering.swap (cmp zero (pos a✝)) = cmp (pos a✝) zero
[PROOFSTEP]
unfold cmp
[GOAL]
case pos.zero
α : Type u_1
a✝ : PosNum
⊢ Ordering.swap (cmp (pos a✝) zero) = cmp zero (pos a✝)
[PROOFSTEP]
try {unfold cmp
}
[GOAL]
case pos.zero
α : Type u_1
a✝ : PosNum
⊢ Ordering.swap (cmp (pos a✝) zero) = cmp zero (pos a✝)
[PROOFSTEP]
{unfold cmp
}
[GOAL]
case pos.zero
α : Type u_1
a✝ : PosNum
⊢ Ordering.swap (cmp (pos a✝) zero) = cmp zero (pos a✝)
[PROOFSTEP]
unfold cmp
[GOAL]
case pos.pos
α : Type u_1
a✝¹ a✝ : PosNum
⊢ Ordering.swap (cmp (pos a✝¹) (pos a✝)) = cmp (pos a✝) (pos a✝¹)
[PROOFSTEP]
try {unfold cmp
}
[GOAL]
case pos.pos
α : Type u_1
a✝¹ a✝ : PosNum
⊢ Ordering.swap (cmp (pos a✝¹) (pos a✝)) = cmp (pos a✝) (pos a✝¹)
[PROOFSTEP]
{unfold cmp
}
[GOAL]
case pos.pos
α : Type u_1
a✝¹ a✝ : PosNum
⊢ Ordering.swap (cmp (pos a✝¹) (pos a✝)) = cmp (pos a✝) (pos a✝¹)
[PROOFSTEP]
unfold cmp
[GOAL]
case zero.zero
α : Type u_1
⊢ Ordering.swap (cmp zero zero) = cmp zero zero
[PROOFSTEP]
try {rfl
}
[GOAL]
case zero.zero
α : Type u_1
⊢ Ordering.swap (cmp zero zero) = cmp zero zero
[PROOFSTEP]
{rfl
}
[GOAL]
case zero.zero
α : Type u_1
⊢ Ordering.swap (cmp zero zero) = cmp zero zero
[PROOFSTEP]
rfl
[GOAL]
case zero.pos
α : Type u_1
a✝ : PosNum
⊢ Ordering.swap (cmp zero (pos a✝)) = cmp (pos a✝) zero
[PROOFSTEP]
try {rfl
}
[GOAL]
case zero.pos
α : Type u_1
a✝ : PosNum
⊢ Ordering.swap (cmp zero (pos a✝)) = cmp (pos a✝) zero
[PROOFSTEP]
{rfl
}
[GOAL]
case zero.pos
α : Type u_1
a✝ : PosNum
⊢ Ordering.swap (cmp zero (pos a✝)) = cmp (pos a✝) zero
[PROOFSTEP]
rfl
[GOAL]
case pos.zero
α : Type u_1
a✝ : PosNum
⊢ Ordering.swap (cmp (pos a✝) zero) = cmp zero (pos a✝)
[PROOFSTEP]
try {rfl
}
[GOAL]
case pos.zero
α : Type u_1
a✝ : PosNum
⊢ Ordering.swap (cmp (pos a✝) zero) = cmp zero (pos a✝)
[PROOFSTEP]
{rfl
}
[GOAL]
case pos.zero
α : Type u_1
a✝ : PosNum
⊢ Ordering.swap (cmp (pos a✝) zero) = cmp zero (pos a✝)
[PROOFSTEP]
rfl
[GOAL]
case pos.pos
α : Type u_1
a✝¹ a✝ : PosNum
⊢ Ordering.swap (cmp (pos a✝¹) (pos a✝)) = cmp (pos a✝) (pos a✝¹)
[PROOFSTEP]
try {rfl
}
[GOAL]
case pos.pos
α : Type u_1
a✝¹ a✝ : PosNum
⊢ Ordering.swap (cmp (pos a✝¹) (pos a✝)) = cmp (pos a✝) (pos a✝¹)
[PROOFSTEP]
{rfl
}
[GOAL]
case pos.pos
α : Type u_1
a✝¹ a✝ : PosNum
⊢ Ordering.swap (cmp (pos a✝¹) (pos a✝)) = cmp (pos a✝) (pos a✝¹)
[PROOFSTEP]
rfl
[GOAL]
case pos.pos
α : Type u_1
a✝¹ a✝ : PosNum
⊢ Ordering.swap (cmp (pos a✝¹) (pos a✝)) = cmp (pos a✝) (pos a✝¹)
[PROOFSTEP]
apply PosNum.cmp_swap
[GOAL]
α : Type u_1
m n : Num
⊢ cmp m n = Ordering.eq ↔ m = n
[PROOFSTEP]
have := cmp_to_nat m n
[GOAL]
α : Type u_1
m n : Num
this : Ordering.casesOn (cmp m n) (↑m < ↑n) (m = n) (↑n < ↑m)
⊢ cmp m n = Ordering.eq ↔ m = n
[PROOFSTEP]
revert this
[GOAL]
α : Type u_1
m n : Num
⊢ Ordering.casesOn (cmp m n) (↑m < ↑n) (m = n) (↑n < ↑m) → (cmp m n = Ordering.eq ↔ m = n)
[PROOFSTEP]
cases cmp m n
[GOAL]
case lt
α : Type u_1
m n : Num
⊢ Ordering.casesOn Ordering.lt (↑m < ↑n) (m = n) (↑n < ↑m) → (Ordering.lt = Ordering.eq ↔ m = n)
[PROOFSTEP]
intro this
[GOAL]
case eq
α : Type u_1
m n : Num
⊢ Ordering.casesOn Ordering.eq (↑m < ↑n) (m = n) (↑n < ↑m) → (Ordering.eq = Ordering.eq ↔ m = n)
[PROOFSTEP]
intro this
[GOAL]
case gt
α : Type u_1
m n : Num
⊢ Ordering.casesOn Ordering.gt (↑m < ↑n) (m = n) (↑n < ↑m) → (Ordering.gt = Ordering.eq ↔ m = n)
[PROOFSTEP]
intro this
[GOAL]
case lt
α : Type u_1
m n : Num
this : Ordering.casesOn Ordering.lt (↑m < ↑n) (m = n) (↑n < ↑m)
⊢ Ordering.lt = Ordering.eq ↔ m = n
[PROOFSTEP]
simp at this ⊢
[GOAL]
case eq
α : Type u_1
m n : Num
this : Ordering.casesOn Ordering.eq (↑m < ↑n) (m = n) (↑n < ↑m)
⊢ Ordering.eq = Ordering.eq ↔ m = n
[PROOFSTEP]
simp at this ⊢
[GOAL]
case gt
α : Type u_1
m n : Num
this : Ordering.casesOn Ordering.gt (↑m < ↑n) (m = n) (↑n < ↑m)
⊢ Ordering.gt = Ordering.eq ↔ m = n
[PROOFSTEP]
simp at this ⊢
[GOAL]
case lt
α : Type u_1
m n : Num
this : ↑m < ↑n
⊢ ¬m = n
[PROOFSTEP]
try {exact this
}
[GOAL]
case lt
α : Type u_1
m n : Num
this : ↑m < ↑n
⊢ ¬m = n
[PROOFSTEP]
{exact this
}
[GOAL]
case lt
α : Type u_1
m n : Num
this : ↑m < ↑n
⊢ ¬m = n
[PROOFSTEP]
exact this
[GOAL]
case eq
α : Type u_1
m n : Num
this : m = n
⊢ m = n
[PROOFSTEP]
try {exact this
}
[GOAL]
case eq
α : Type u_1
m n : Num
this : m = n
⊢ m = n
[PROOFSTEP]
{exact this
}
[GOAL]
case eq
α : Type u_1
m n : Num
this : m = n
⊢ m = n
[PROOFSTEP]
exact this
[GOAL]
case gt
α : Type u_1
m n : Num
this : ↑n < ↑m
⊢ ¬m = n
[PROOFSTEP]
try {exact this
}
[GOAL]
case gt
α : Type u_1
m n : Num
this : ↑n < ↑m
⊢ ¬m = n
[PROOFSTEP]
{exact this
}
[GOAL]
case gt
α : Type u_1
m n : Num
this : ↑n < ↑m
⊢ ¬m = n
[PROOFSTEP]
exact this
[GOAL]
case lt
α : Type u_1
m n : Num
this : ↑m < ↑n
⊢ ¬m = n
[PROOFSTEP]
simp [show m ≠ n from fun e => by rw [e] at this ; exact lt_irrefl _ this]
[GOAL]
α : Type u_1
m n : Num
this : ↑m < ↑n
e : m = n
⊢ False
[PROOFSTEP]
rw [e] at this 
[GOAL]
α : Type u_1
m n : Num
this : ↑n < ↑n
e : m = n
⊢ False
[PROOFSTEP]
exact lt_irrefl _ this
[GOAL]
case gt
α : Type u_1
m n : Num
this : ↑n < ↑m
⊢ ¬m = n
[PROOFSTEP]
simp [show m ≠ n from fun e => by rw [e] at this ; exact lt_irrefl _ this]
[GOAL]
α : Type u_1
m n : Num
this : ↑n < ↑m
e : m = n
⊢ False
[PROOFSTEP]
rw [e] at this 
[GOAL]
α : Type u_1
m n : Num
this : ↑n < ↑n
e : m = n
⊢ False
[PROOFSTEP]
exact lt_irrefl _ this
[GOAL]
α : Type u_1
inst✝ : LinearOrderedSemiring α
m n : Num
⊢ ↑m < ↑n ↔ m < n
[PROOFSTEP]
rw [← cast_to_nat m, ← cast_to_nat n, Nat.cast_lt (α := α), lt_to_nat]
[GOAL]
α : Type u_1
inst✝ : LinearOrderedSemiring α
m n : Num
⊢ ↑m ≤ ↑n ↔ m ≤ n
[PROOFSTEP]
rw [← not_lt]
[GOAL]
α : Type u_1
inst✝ : LinearOrderedSemiring α
m n : Num
⊢ ¬↑n < ↑m ↔ m ≤ n
[PROOFSTEP]
exact not_congr cast_lt
[GOAL]
α : Type u_1
inst✝ : LinearOrderedSemiring α
m n : Num
⊢ ↑m = ↑n ↔ m = n
[PROOFSTEP]
rw [← cast_to_nat m, ← cast_to_nat n, Nat.cast_inj, to_nat_inj]
[GOAL]
α : Type u_1
m n : Num
⊢ cmp n m = Ordering.lt ↔ cmp m n = Ordering.gt
[PROOFSTEP]
rw [← cmp_swap]
[GOAL]
α : Type u_1
m n : Num
⊢ Ordering.swap (cmp m n) = Ordering.lt ↔ cmp m n = Ordering.gt
[PROOFSTEP]
cases cmp m n
[GOAL]
case lt
α : Type u_1
m n : Num
⊢ Ordering.swap Ordering.lt = Ordering.lt ↔ Ordering.lt = Ordering.gt
[PROOFSTEP]
exact by decide
[GOAL]
α : Type u_1
m n : Num
⊢ Ordering.swap Ordering.lt = Ordering.lt ↔ Ordering.lt = Ordering.gt
[PROOFSTEP]
decide
[GOAL]
case eq
α : Type u_1
m n : Num
⊢ Ordering.swap Ordering.eq = Ordering.lt ↔ Ordering.eq = Ordering.gt
[PROOFSTEP]
exact by decide
[GOAL]
α : Type u_1
m n : Num
⊢ Ordering.swap Ordering.eq = Ordering.lt ↔ Ordering.eq = Ordering.gt
[PROOFSTEP]
decide
[GOAL]
case gt
α : Type u_1
m n : Num
⊢ Ordering.swap Ordering.gt = Ordering.lt ↔ Ordering.gt = Ordering.gt
[PROOFSTEP]
exact by decide
[GOAL]
α : Type u_1
m n : Num
⊢ Ordering.swap Ordering.gt = Ordering.lt ↔ Ordering.gt = Ordering.gt
[PROOFSTEP]
decide
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
⊢ ∀ (m n : Num), ↑(f m n) = Nat.bitwise' g ↑m ↑n
[PROOFSTEP]
intros m n
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
m n : Num
⊢ ↑(f m n) = Nat.bitwise' g ↑m ↑n
[PROOFSTEP]
cases' m with m
[GOAL]
case zero
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : Num
⊢ ↑(f zero n) = Nat.bitwise' g ↑zero ↑n
[PROOFSTEP]
cases' n with n
[GOAL]
case pos
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : Num
m : PosNum
⊢ ↑(f (pos m) n) = Nat.bitwise' g ↑(pos m) ↑n
[PROOFSTEP]
cases' n with n
[GOAL]
case zero.zero
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
⊢ ↑(f zero zero) = Nat.bitwise' g ↑zero ↑zero
[PROOFSTEP]
try simp only [show zero = 0 from rfl, show ((0 : Num) : ℕ) = 0 from rfl]
[GOAL]
case zero.zero
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
⊢ ↑(f zero zero) = Nat.bitwise' g ↑zero ↑zero
[PROOFSTEP]
simp only [show zero = 0 from rfl, show ((0 : Num) : ℕ) = 0 from rfl]
[GOAL]
case zero.pos
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
⊢ ↑(f zero (pos n)) = Nat.bitwise' g ↑zero ↑(pos n)
[PROOFSTEP]
try simp only [show zero = 0 from rfl, show ((0 : Num) : ℕ) = 0 from rfl]
[GOAL]
case zero.pos
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
⊢ ↑(f zero (pos n)) = Nat.bitwise' g ↑zero ↑(pos n)
[PROOFSTEP]
simp only [show zero = 0 from rfl, show ((0 : Num) : ℕ) = 0 from rfl]
[GOAL]
case pos.zero
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
m : PosNum
⊢ ↑(f (pos m) zero) = Nat.bitwise' g ↑(pos m) ↑zero
[PROOFSTEP]
try simp only [show zero = 0 from rfl, show ((0 : Num) : ℕ) = 0 from rfl]
[GOAL]
case pos.zero
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
m : PosNum
⊢ ↑(f (pos m) zero) = Nat.bitwise' g ↑(pos m) ↑zero
[PROOFSTEP]
simp only [show zero = 0 from rfl, show ((0 : Num) : ℕ) = 0 from rfl]
[GOAL]
case pos.pos
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
m n : PosNum
⊢ ↑(f (pos m) (pos n)) = Nat.bitwise' g ↑(pos m) ↑(pos n)
[PROOFSTEP]
try simp only [show zero = 0 from rfl, show ((0 : Num) : ℕ) = 0 from rfl]
[GOAL]
case pos.pos
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
m n : PosNum
⊢ ↑(f (pos m) (pos n)) = Nat.bitwise' g ↑(pos m) ↑(pos n)
[PROOFSTEP]
simp only [show zero = 0 from rfl, show ((0 : Num) : ℕ) = 0 from rfl]
[GOAL]
case zero.zero
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
⊢ ↑(f 0 0) = Nat.bitwise' g 0 0
[PROOFSTEP]
rw [f00, Nat.bitwise'_zero]
[GOAL]
case zero.zero
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
⊢ ↑0 = 0
[PROOFSTEP]
rfl
[GOAL]
case zero.pos
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
⊢ ↑(f 0 (pos n)) = Nat.bitwise' g 0 ↑(pos n)
[PROOFSTEP]
unfold Nat.bitwise'
[GOAL]
case zero.pos
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
⊢ ↑(f 0 (pos n)) =
    Nat.binaryRec (fun n => bif g false true then n else 0)
      (fun a m Ia => Nat.binaryRec (bif g true false then Nat.bit a m else 0) fun b n x => Nat.bit (g a b) (Ia n)) 0
      ↑(pos n)
[PROOFSTEP]
rw [f0n, Nat.binaryRec_zero]
[GOAL]
case zero.pos
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
⊢ ↑(bif g false true then pos n else 0) = bif g false true then ↑(pos n) else 0
[PROOFSTEP]
cases g false true
[GOAL]
case zero.pos.false
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
⊢ ↑(bif false then pos n else 0) = bif false then ↑(pos n) else 0
[PROOFSTEP]
rfl
[GOAL]
case zero.pos.true
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
⊢ ↑(bif true then pos n else 0) = bif true then ↑(pos n) else 0
[PROOFSTEP]
rfl
[GOAL]
case pos.zero
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
m : PosNum
⊢ ↑(f (pos m) 0) = Nat.bitwise' g (↑(pos m)) 0
[PROOFSTEP]
unfold Nat.bitwise'
[GOAL]
case pos.zero
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
m : PosNum
⊢ ↑(f (pos m) 0) =
    Nat.binaryRec (fun n => bif g false true then n else 0)
      (fun a m Ia => Nat.binaryRec (bif g true false then Nat.bit a m else 0) fun b n x => Nat.bit (g a b) (Ia n))
      (↑(pos m)) 0
[PROOFSTEP]
generalize h : (pos m : ℕ) = m'
[GOAL]
case pos.zero
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
m : PosNum
m' : ℕ
h : ↑(pos m) = m'
⊢ ↑(f (pos m) 0) =
    Nat.binaryRec (fun n => bif g false true then n else 0)
      (fun a m Ia => Nat.binaryRec (bif g true false then Nat.bit a m else 0) fun b n x => Nat.bit (g a b) (Ia n)) m' 0
[PROOFSTEP]
revert h
[GOAL]
case pos.zero
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
m : PosNum
m' : ℕ
⊢ ↑(pos m) = m' →
    ↑(f (pos m) 0) =
      Nat.binaryRec (fun n => bif g false true then n else 0)
        (fun a m Ia => Nat.binaryRec (bif g true false then Nat.bit a m else 0) fun b n x => Nat.bit (g a b) (Ia n)) m'
        0
[PROOFSTEP]
apply Nat.bitCasesOn m' _
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
m : PosNum
m' : ℕ
⊢ ∀ (b : Bool) (n : ℕ),
    ↑(pos m) = Nat.bit b n →
      ↑(f (pos m) 0) =
        Nat.binaryRec (fun n => bif g false true then n else 0)
          (fun a m Ia => Nat.binaryRec (bif g true false then Nat.bit a m else 0) fun b n x => Nat.bit (g a b) (Ia n))
          (Nat.bit b n) 0
[PROOFSTEP]
intro b m' h
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
m : PosNum
m'✝ : ℕ
b : Bool
m' : ℕ
h : ↑(pos m) = Nat.bit b m'
⊢ ↑(f (pos m) 0) =
    Nat.binaryRec (fun n => bif g false true then n else 0)
      (fun a m Ia => Nat.binaryRec (bif g true false then Nat.bit a m else 0) fun b n x => Nat.bit (g a b) (Ia n))
      (Nat.bit b m') 0
[PROOFSTEP]
rw [fn0, Nat.binaryRec_eq, Nat.binaryRec_zero, ← h]
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
m : PosNum
m'✝ : ℕ
b : Bool
m' : ℕ
h : ↑(pos m) = Nat.bit b m'
⊢ ↑(bif g true false then pos m else 0) = bif g true false then ↑(pos m) else 0
[PROOFSTEP]
cases g true false
[GOAL]
case false
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
m : PosNum
m'✝ : ℕ
b : Bool
m' : ℕ
h : ↑(pos m) = Nat.bit b m'
⊢ ↑(bif false then pos m else 0) = bif false then ↑(pos m) else 0
[PROOFSTEP]
rfl
[GOAL]
case true
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
m : PosNum
m'✝ : ℕ
b : Bool
m' : ℕ
h : ↑(pos m) = Nat.bit b m'
⊢ ↑(bif true then pos m else 0) = bif true then ↑(pos m) else 0
[PROOFSTEP]
rfl
[GOAL]
case h
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
m : PosNum
m'✝ : ℕ
b : Bool
m' : ℕ
h : ↑(pos m) = Nat.bit b m'
⊢ (Nat.binaryRec (bif g true false then Nat.bit false 0 else 0) fun b n x =>
      Nat.bit (g false b) (bif g false true then n else 0)) =
    fun n => bif g false true then n else 0
[PROOFSTEP]
apply Nat.bitwise'_bit_aux gff
[GOAL]
case pos.pos
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
m n : PosNum
⊢ ↑(f (pos m) (pos n)) = Nat.bitwise' g ↑(pos m) ↑(pos n)
[PROOFSTEP]
rw [fnn]
[GOAL]
case pos.pos
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
m n : PosNum
⊢ ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
[PROOFSTEP]
have : ∀ (b) (n : PosNum), (cond b (↑n) 0 : ℕ) = ↑(cond b (pos n) 0 : Num) := by intros b _; cases b <;> rfl
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
m n : PosNum
⊢ ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
[PROOFSTEP]
intros b _
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
m n : PosNum
b : Bool
n✝ : PosNum
⊢ (bif b then ↑n✝ else 0) = ↑(bif b then pos n✝ else 0)
[PROOFSTEP]
cases b
[GOAL]
case false
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
m n n✝ : PosNum
⊢ (bif false then ↑n✝ else 0) = ↑(bif false then pos n✝ else 0)
[PROOFSTEP]
rfl
[GOAL]
case true
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
m n n✝ : PosNum
⊢ (bif true then ↑n✝ else 0) = ↑(bif true then pos n✝ else 0)
[PROOFSTEP]
rfl
[GOAL]
case pos.pos
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
m n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
⊢ ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
[PROOFSTEP]
induction' m with m IH m IH generalizing n
[GOAL]
case pos.pos.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
⊢ ↑(p one n) = Nat.bitwise' g ↑(pos one) ↑(pos n)
[PROOFSTEP]
cases' n with n n
[GOAL]
case pos.pos.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit1 m) n) = Nat.bitwise' g ↑(pos (PosNum.bit1 m)) ↑(pos n)
[PROOFSTEP]
cases' n with n n
[GOAL]
case pos.pos.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit0 m) n) = Nat.bitwise' g ↑(pos (PosNum.bit0 m)) ↑(pos n)
[PROOFSTEP]
cases' n with n n
[GOAL]
case pos.pos.one.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
⊢ ↑(p one one) = Nat.bitwise' g ↑(pos one) ↑(pos one)
case pos.pos.one.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
⊢ ↑(p one (PosNum.bit1 n)) = Nat.bitwise' g ↑(pos one) ↑(pos (PosNum.bit1 n))
case pos.pos.one.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
⊢ ↑(p one (PosNum.bit0 n)) = Nat.bitwise' g ↑(pos one) ↑(pos (PosNum.bit0 n))
case pos.pos.bit1.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ ↑(p (PosNum.bit1 m) one) = Nat.bitwise' g ↑(pos (PosNum.bit1 m)) ↑(pos one)
case pos.pos.bit1.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit1 m) (PosNum.bit1 n)) = Nat.bitwise' g ↑(pos (PosNum.bit1 m)) ↑(pos (PosNum.bit1 n))
case pos.pos.bit1.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit1 m) (PosNum.bit0 n)) = Nat.bitwise' g ↑(pos (PosNum.bit1 m)) ↑(pos (PosNum.bit0 n))
case pos.pos.bit0.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ ↑(p (PosNum.bit0 m) one) = Nat.bitwise' g ↑(pos (PosNum.bit0 m)) ↑(pos one)
case pos.pos.bit0.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit0 m) (PosNum.bit1 n)) = Nat.bitwise' g ↑(pos (PosNum.bit0 m)) ↑(pos (PosNum.bit1 n))
case pos.pos.bit0.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit0 m) (PosNum.bit0 n)) = Nat.bitwise' g ↑(pos (PosNum.bit0 m)) ↑(pos (PosNum.bit0 n))
[PROOFSTEP]
any_goals
  simp only [show one = 1 from rfl, show pos 1 = 1 from rfl, show PosNum.bit0 = PosNum.bit false from rfl,
    show PosNum.bit1 = PosNum.bit true from rfl, show ((1 : Num) : ℕ) = Nat.bit true 0 from rfl]
[GOAL]
case pos.pos.one.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
⊢ ↑(p one one) = Nat.bitwise' g ↑(pos one) ↑(pos one)
[PROOFSTEP]
simp only [show one = 1 from rfl, show pos 1 = 1 from rfl, show PosNum.bit0 = PosNum.bit false from rfl,
  show PosNum.bit1 = PosNum.bit true from rfl, show ((1 : Num) : ℕ) = Nat.bit true 0 from rfl]
[GOAL]
case pos.pos.one.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
⊢ ↑(p one (PosNum.bit1 n)) = Nat.bitwise' g ↑(pos one) ↑(pos (PosNum.bit1 n))
[PROOFSTEP]
simp only [show one = 1 from rfl, show pos 1 = 1 from rfl, show PosNum.bit0 = PosNum.bit false from rfl,
  show PosNum.bit1 = PosNum.bit true from rfl, show ((1 : Num) : ℕ) = Nat.bit true 0 from rfl]
[GOAL]
case pos.pos.one.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
⊢ ↑(p one (PosNum.bit0 n)) = Nat.bitwise' g ↑(pos one) ↑(pos (PosNum.bit0 n))
[PROOFSTEP]
simp only [show one = 1 from rfl, show pos 1 = 1 from rfl, show PosNum.bit0 = PosNum.bit false from rfl,
  show PosNum.bit1 = PosNum.bit true from rfl, show ((1 : Num) : ℕ) = Nat.bit true 0 from rfl]
[GOAL]
case pos.pos.bit1.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ ↑(p (PosNum.bit1 m) one) = Nat.bitwise' g ↑(pos (PosNum.bit1 m)) ↑(pos one)
[PROOFSTEP]
simp only [show one = 1 from rfl, show pos 1 = 1 from rfl, show PosNum.bit0 = PosNum.bit false from rfl,
  show PosNum.bit1 = PosNum.bit true from rfl, show ((1 : Num) : ℕ) = Nat.bit true 0 from rfl]
[GOAL]
case pos.pos.bit1.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit1 m) (PosNum.bit1 n)) = Nat.bitwise' g ↑(pos (PosNum.bit1 m)) ↑(pos (PosNum.bit1 n))
[PROOFSTEP]
simp only [show one = 1 from rfl, show pos 1 = 1 from rfl, show PosNum.bit0 = PosNum.bit false from rfl,
  show PosNum.bit1 = PosNum.bit true from rfl, show ((1 : Num) : ℕ) = Nat.bit true 0 from rfl]
[GOAL]
case pos.pos.bit1.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit1 m) (PosNum.bit0 n)) = Nat.bitwise' g ↑(pos (PosNum.bit1 m)) ↑(pos (PosNum.bit0 n))
[PROOFSTEP]
simp only [show one = 1 from rfl, show pos 1 = 1 from rfl, show PosNum.bit0 = PosNum.bit false from rfl,
  show PosNum.bit1 = PosNum.bit true from rfl, show ((1 : Num) : ℕ) = Nat.bit true 0 from rfl]
[GOAL]
case pos.pos.bit0.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ ↑(p (PosNum.bit0 m) one) = Nat.bitwise' g ↑(pos (PosNum.bit0 m)) ↑(pos one)
[PROOFSTEP]
simp only [show one = 1 from rfl, show pos 1 = 1 from rfl, show PosNum.bit0 = PosNum.bit false from rfl,
  show PosNum.bit1 = PosNum.bit true from rfl, show ((1 : Num) : ℕ) = Nat.bit true 0 from rfl]
[GOAL]
case pos.pos.bit0.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit0 m) (PosNum.bit1 n)) = Nat.bitwise' g ↑(pos (PosNum.bit0 m)) ↑(pos (PosNum.bit1 n))
[PROOFSTEP]
simp only [show one = 1 from rfl, show pos 1 = 1 from rfl, show PosNum.bit0 = PosNum.bit false from rfl,
  show PosNum.bit1 = PosNum.bit true from rfl, show ((1 : Num) : ℕ) = Nat.bit true 0 from rfl]
[GOAL]
case pos.pos.bit0.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit0 m) (PosNum.bit0 n)) = Nat.bitwise' g ↑(pos (PosNum.bit0 m)) ↑(pos (PosNum.bit0 n))
[PROOFSTEP]
simp only [show one = 1 from rfl, show pos 1 = 1 from rfl, show PosNum.bit0 = PosNum.bit false from rfl,
  show PosNum.bit1 = PosNum.bit true from rfl, show ((1 : Num) : ℕ) = Nat.bit true 0 from rfl]
[GOAL]
case pos.pos.one.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
⊢ ↑(p 1 1) = Nat.bitwise' g (Nat.bit true 0) (Nat.bit true 0)
case pos.pos.one.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
⊢ ↑(p 1 (PosNum.bit true n)) = Nat.bitwise' g (Nat.bit true 0) ↑(pos (PosNum.bit true n))
case pos.pos.one.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
⊢ ↑(p 1 (PosNum.bit false n)) = Nat.bitwise' g (Nat.bit true 0) ↑(pos (PosNum.bit false n))
case pos.pos.bit1.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ ↑(p (PosNum.bit true m) 1) = Nat.bitwise' g (↑(pos (PosNum.bit true m))) (Nat.bit true 0)
case pos.pos.bit1.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit true m) (PosNum.bit true n)) = Nat.bitwise' g ↑(pos (PosNum.bit true m)) ↑(pos (PosNum.bit true n))
case pos.pos.bit1.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit true m) (PosNum.bit false n)) = Nat.bitwise' g ↑(pos (PosNum.bit true m)) ↑(pos (PosNum.bit false n))
case pos.pos.bit0.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ ↑(p (PosNum.bit false m) 1) = Nat.bitwise' g (↑(pos (PosNum.bit false m))) (Nat.bit true 0)
case pos.pos.bit0.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit false m) (PosNum.bit true n)) = Nat.bitwise' g ↑(pos (PosNum.bit false m)) ↑(pos (PosNum.bit true n))
case pos.pos.bit0.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit false m) (PosNum.bit false n)) =
    Nat.bitwise' g ↑(pos (PosNum.bit false m)) ↑(pos (PosNum.bit false n))
[PROOFSTEP]
all_goals
  repeat' rw [show ∀ b n, (pos (PosNum.bit b n) : ℕ) = Nat.bit b ↑n by intros b _; cases b <;> rfl]
  rw [Nat.bitwise'_bit]
[GOAL]
case pos.pos.one.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
⊢ ↑(p 1 1) = Nat.bitwise' g (Nat.bit true 0) (Nat.bit true 0)
[PROOFSTEP]
repeat' rw [show ∀ b n, (pos (PosNum.bit b n) : ℕ) = Nat.bit b ↑n by intros b _; cases b <;> rfl]
[GOAL]
case pos.pos.one.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
⊢ ↑(p 1 1) = Nat.bitwise' g (Nat.bit true 0) (Nat.bit true 0)
[PROOFSTEP]
rw [show ∀ b n, (pos (PosNum.bit b n) : ℕ) = Nat.bit b ↑n by intros b _; cases b <;> rfl]
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
⊢ ∀ (b : Bool) (n : PosNum), ↑(pos (PosNum.bit b n)) = Nat.bit b ↑n
[PROOFSTEP]
intros b _
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
b : Bool
n✝ : PosNum
⊢ ↑(pos (PosNum.bit b n✝)) = Nat.bit b ↑n✝
[PROOFSTEP]
cases b
[GOAL]
case false
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n✝ : PosNum
⊢ ↑(pos (PosNum.bit false n✝)) = Nat.bit false ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case true
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n✝ : PosNum
⊢ ↑(pos (PosNum.bit true n✝)) = Nat.bit true ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case pos.pos.one.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
⊢ ↑(p 1 1) = Nat.bitwise' g (Nat.bit true 0) (Nat.bit true 0)
[PROOFSTEP]
rw [Nat.bitwise'_bit]
[GOAL]
case pos.pos.one.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
⊢ ↑(p 1 (PosNum.bit true n)) = Nat.bitwise' g (Nat.bit true 0) ↑(pos (PosNum.bit true n))
[PROOFSTEP]
repeat' rw [show ∀ b n, (pos (PosNum.bit b n) : ℕ) = Nat.bit b ↑n by intros b _; cases b <;> rfl]
[GOAL]
case pos.pos.one.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
⊢ ↑(p 1 (PosNum.bit true n)) = Nat.bitwise' g (Nat.bit true 0) ↑(pos (PosNum.bit true n))
[PROOFSTEP]
rw [show ∀ b n, (pos (PosNum.bit b n) : ℕ) = Nat.bit b ↑n by intros b _; cases b <;> rfl]
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
⊢ ∀ (b : Bool) (n : PosNum), ↑(pos (PosNum.bit b n)) = Nat.bit b ↑n
[PROOFSTEP]
intros b _
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
b : Bool
n✝ : PosNum
⊢ ↑(pos (PosNum.bit b n✝)) = Nat.bit b ↑n✝
[PROOFSTEP]
cases b
[GOAL]
case false
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n n✝ : PosNum
⊢ ↑(pos (PosNum.bit false n✝)) = Nat.bit false ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case true
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n n✝ : PosNum
⊢ ↑(pos (PosNum.bit true n✝)) = Nat.bit true ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case pos.pos.one.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
⊢ ↑(p 1 (PosNum.bit true n)) = Nat.bitwise' g (Nat.bit true 0) (Nat.bit true ↑n)
[PROOFSTEP]
rw [show ∀ b n, (pos (PosNum.bit b n) : ℕ) = Nat.bit b ↑n by intros b _; cases b <;> rfl]
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
⊢ ∀ (b : Bool) (n : PosNum), ↑(pos (PosNum.bit b n)) = Nat.bit b ↑n
[PROOFSTEP]
intros b _
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
b : Bool
n✝ : PosNum
⊢ ↑(pos (PosNum.bit b n✝)) = Nat.bit b ↑n✝
[PROOFSTEP]
cases b
[GOAL]
case false
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n n✝ : PosNum
⊢ ↑(pos (PosNum.bit false n✝)) = Nat.bit false ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case true
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n n✝ : PosNum
⊢ ↑(pos (PosNum.bit true n✝)) = Nat.bit true ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case pos.pos.one.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
⊢ ↑(p 1 (PosNum.bit true n)) = Nat.bitwise' g (Nat.bit true 0) (Nat.bit true ↑n)
[PROOFSTEP]
rw [Nat.bitwise'_bit]
[GOAL]
case pos.pos.one.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
⊢ ↑(p 1 (PosNum.bit false n)) = Nat.bitwise' g (Nat.bit true 0) ↑(pos (PosNum.bit false n))
[PROOFSTEP]
repeat' rw [show ∀ b n, (pos (PosNum.bit b n) : ℕ) = Nat.bit b ↑n by intros b _; cases b <;> rfl]
[GOAL]
case pos.pos.one.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
⊢ ↑(p 1 (PosNum.bit false n)) = Nat.bitwise' g (Nat.bit true 0) ↑(pos (PosNum.bit false n))
[PROOFSTEP]
rw [show ∀ b n, (pos (PosNum.bit b n) : ℕ) = Nat.bit b ↑n by intros b _; cases b <;> rfl]
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
⊢ ∀ (b : Bool) (n : PosNum), ↑(pos (PosNum.bit b n)) = Nat.bit b ↑n
[PROOFSTEP]
intros b _
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
b : Bool
n✝ : PosNum
⊢ ↑(pos (PosNum.bit b n✝)) = Nat.bit b ↑n✝
[PROOFSTEP]
cases b
[GOAL]
case false
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n n✝ : PosNum
⊢ ↑(pos (PosNum.bit false n✝)) = Nat.bit false ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case true
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n n✝ : PosNum
⊢ ↑(pos (PosNum.bit true n✝)) = Nat.bit true ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case pos.pos.one.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
⊢ ↑(p 1 (PosNum.bit false n)) = Nat.bitwise' g (Nat.bit true 0) (Nat.bit false ↑n)
[PROOFSTEP]
rw [show ∀ b n, (pos (PosNum.bit b n) : ℕ) = Nat.bit b ↑n by intros b _; cases b <;> rfl]
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
⊢ ∀ (b : Bool) (n : PosNum), ↑(pos (PosNum.bit b n)) = Nat.bit b ↑n
[PROOFSTEP]
intros b _
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
b : Bool
n✝ : PosNum
⊢ ↑(pos (PosNum.bit b n✝)) = Nat.bit b ↑n✝
[PROOFSTEP]
cases b
[GOAL]
case false
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n n✝ : PosNum
⊢ ↑(pos (PosNum.bit false n✝)) = Nat.bit false ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case true
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n n✝ : PosNum
⊢ ↑(pos (PosNum.bit true n✝)) = Nat.bit true ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case pos.pos.one.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
⊢ ↑(p 1 (PosNum.bit false n)) = Nat.bitwise' g (Nat.bit true 0) (Nat.bit false ↑n)
[PROOFSTEP]
rw [Nat.bitwise'_bit]
[GOAL]
case pos.pos.bit1.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ ↑(p (PosNum.bit true m) 1) = Nat.bitwise' g (↑(pos (PosNum.bit true m))) (Nat.bit true 0)
[PROOFSTEP]
repeat' rw [show ∀ b n, (pos (PosNum.bit b n) : ℕ) = Nat.bit b ↑n by intros b _; cases b <;> rfl]
[GOAL]
case pos.pos.bit1.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ ↑(p (PosNum.bit true m) 1) = Nat.bitwise' g (↑(pos (PosNum.bit true m))) (Nat.bit true 0)
[PROOFSTEP]
rw [show ∀ b n, (pos (PosNum.bit b n) : ℕ) = Nat.bit b ↑n by intros b _; cases b <;> rfl]
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ ∀ (b : Bool) (n : PosNum), ↑(pos (PosNum.bit b n)) = Nat.bit b ↑n
[PROOFSTEP]
intros b _
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
b : Bool
n✝ : PosNum
⊢ ↑(pos (PosNum.bit b n✝)) = Nat.bit b ↑n✝
[PROOFSTEP]
cases b
[GOAL]
case false
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n✝ : PosNum
⊢ ↑(pos (PosNum.bit false n✝)) = Nat.bit false ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case true
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n✝ : PosNum
⊢ ↑(pos (PosNum.bit true n✝)) = Nat.bit true ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case pos.pos.bit1.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ ↑(p (PosNum.bit true m) 1) = Nat.bitwise' g (Nat.bit true ↑m) (Nat.bit true 0)
[PROOFSTEP]
rw [show ∀ b n, (pos (PosNum.bit b n) : ℕ) = Nat.bit b ↑n by intros b _; cases b <;> rfl]
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ ∀ (b : Bool) (n : PosNum), ↑(pos (PosNum.bit b n)) = Nat.bit b ↑n
[PROOFSTEP]
intros b _
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
b : Bool
n✝ : PosNum
⊢ ↑(pos (PosNum.bit b n✝)) = Nat.bit b ↑n✝
[PROOFSTEP]
cases b
[GOAL]
case false
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n✝ : PosNum
⊢ ↑(pos (PosNum.bit false n✝)) = Nat.bit false ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case true
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n✝ : PosNum
⊢ ↑(pos (PosNum.bit true n✝)) = Nat.bit true ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case pos.pos.bit1.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ ↑(p (PosNum.bit true m) 1) = Nat.bitwise' g (Nat.bit true ↑m) (Nat.bit true 0)
[PROOFSTEP]
rw [Nat.bitwise'_bit]
[GOAL]
case pos.pos.bit1.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit true m) (PosNum.bit true n)) = Nat.bitwise' g ↑(pos (PosNum.bit true m)) ↑(pos (PosNum.bit true n))
[PROOFSTEP]
repeat' rw [show ∀ b n, (pos (PosNum.bit b n) : ℕ) = Nat.bit b ↑n by intros b _; cases b <;> rfl]
[GOAL]
case pos.pos.bit1.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit true m) (PosNum.bit true n)) = Nat.bitwise' g ↑(pos (PosNum.bit true m)) ↑(pos (PosNum.bit true n))
[PROOFSTEP]
rw [show ∀ b n, (pos (PosNum.bit b n) : ℕ) = Nat.bit b ↑n by intros b _; cases b <;> rfl]
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ∀ (b : Bool) (n : PosNum), ↑(pos (PosNum.bit b n)) = Nat.bit b ↑n
[PROOFSTEP]
intros b _
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
b : Bool
n✝ : PosNum
⊢ ↑(pos (PosNum.bit b n✝)) = Nat.bit b ↑n✝
[PROOFSTEP]
cases b
[GOAL]
case false
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n n✝ : PosNum
⊢ ↑(pos (PosNum.bit false n✝)) = Nat.bit false ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case true
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n n✝ : PosNum
⊢ ↑(pos (PosNum.bit true n✝)) = Nat.bit true ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case pos.pos.bit1.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit true m) (PosNum.bit true n)) = Nat.bitwise' g (Nat.bit true ↑m) ↑(pos (PosNum.bit true n))
[PROOFSTEP]
rw [show ∀ b n, (pos (PosNum.bit b n) : ℕ) = Nat.bit b ↑n by intros b _; cases b <;> rfl]
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ∀ (b : Bool) (n : PosNum), ↑(pos (PosNum.bit b n)) = Nat.bit b ↑n
[PROOFSTEP]
intros b _
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
b : Bool
n✝ : PosNum
⊢ ↑(pos (PosNum.bit b n✝)) = Nat.bit b ↑n✝
[PROOFSTEP]
cases b
[GOAL]
case false
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n n✝ : PosNum
⊢ ↑(pos (PosNum.bit false n✝)) = Nat.bit false ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case true
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n n✝ : PosNum
⊢ ↑(pos (PosNum.bit true n✝)) = Nat.bit true ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case pos.pos.bit1.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit true m) (PosNum.bit true n)) = Nat.bitwise' g (Nat.bit true ↑m) (Nat.bit true ↑n)
[PROOFSTEP]
rw [show ∀ b n, (pos (PosNum.bit b n) : ℕ) = Nat.bit b ↑n by intros b _; cases b <;> rfl]
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ∀ (b : Bool) (n : PosNum), ↑(pos (PosNum.bit b n)) = Nat.bit b ↑n
[PROOFSTEP]
intros b _
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
b : Bool
n✝ : PosNum
⊢ ↑(pos (PosNum.bit b n✝)) = Nat.bit b ↑n✝
[PROOFSTEP]
cases b
[GOAL]
case false
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n n✝ : PosNum
⊢ ↑(pos (PosNum.bit false n✝)) = Nat.bit false ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case true
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n n✝ : PosNum
⊢ ↑(pos (PosNum.bit true n✝)) = Nat.bit true ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case pos.pos.bit1.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit true m) (PosNum.bit true n)) = Nat.bitwise' g (Nat.bit true ↑m) (Nat.bit true ↑n)
[PROOFSTEP]
rw [Nat.bitwise'_bit]
[GOAL]
case pos.pos.bit1.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit true m) (PosNum.bit false n)) = Nat.bitwise' g ↑(pos (PosNum.bit true m)) ↑(pos (PosNum.bit false n))
[PROOFSTEP]
repeat' rw [show ∀ b n, (pos (PosNum.bit b n) : ℕ) = Nat.bit b ↑n by intros b _; cases b <;> rfl]
[GOAL]
case pos.pos.bit1.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit true m) (PosNum.bit false n)) = Nat.bitwise' g ↑(pos (PosNum.bit true m)) ↑(pos (PosNum.bit false n))
[PROOFSTEP]
rw [show ∀ b n, (pos (PosNum.bit b n) : ℕ) = Nat.bit b ↑n by intros b _; cases b <;> rfl]
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ∀ (b : Bool) (n : PosNum), ↑(pos (PosNum.bit b n)) = Nat.bit b ↑n
[PROOFSTEP]
intros b _
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
b : Bool
n✝ : PosNum
⊢ ↑(pos (PosNum.bit b n✝)) = Nat.bit b ↑n✝
[PROOFSTEP]
cases b
[GOAL]
case false
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n n✝ : PosNum
⊢ ↑(pos (PosNum.bit false n✝)) = Nat.bit false ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case true
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n n✝ : PosNum
⊢ ↑(pos (PosNum.bit true n✝)) = Nat.bit true ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case pos.pos.bit1.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit true m) (PosNum.bit false n)) = Nat.bitwise' g (Nat.bit true ↑m) ↑(pos (PosNum.bit false n))
[PROOFSTEP]
rw [show ∀ b n, (pos (PosNum.bit b n) : ℕ) = Nat.bit b ↑n by intros b _; cases b <;> rfl]
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ∀ (b : Bool) (n : PosNum), ↑(pos (PosNum.bit b n)) = Nat.bit b ↑n
[PROOFSTEP]
intros b _
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
b : Bool
n✝ : PosNum
⊢ ↑(pos (PosNum.bit b n✝)) = Nat.bit b ↑n✝
[PROOFSTEP]
cases b
[GOAL]
case false
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n n✝ : PosNum
⊢ ↑(pos (PosNum.bit false n✝)) = Nat.bit false ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case true
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n n✝ : PosNum
⊢ ↑(pos (PosNum.bit true n✝)) = Nat.bit true ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case pos.pos.bit1.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit true m) (PosNum.bit false n)) = Nat.bitwise' g (Nat.bit true ↑m) (Nat.bit false ↑n)
[PROOFSTEP]
rw [show ∀ b n, (pos (PosNum.bit b n) : ℕ) = Nat.bit b ↑n by intros b _; cases b <;> rfl]
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ∀ (b : Bool) (n : PosNum), ↑(pos (PosNum.bit b n)) = Nat.bit b ↑n
[PROOFSTEP]
intros b _
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
b : Bool
n✝ : PosNum
⊢ ↑(pos (PosNum.bit b n✝)) = Nat.bit b ↑n✝
[PROOFSTEP]
cases b
[GOAL]
case false
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n n✝ : PosNum
⊢ ↑(pos (PosNum.bit false n✝)) = Nat.bit false ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case true
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n n✝ : PosNum
⊢ ↑(pos (PosNum.bit true n✝)) = Nat.bit true ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case pos.pos.bit1.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit true m) (PosNum.bit false n)) = Nat.bitwise' g (Nat.bit true ↑m) (Nat.bit false ↑n)
[PROOFSTEP]
rw [Nat.bitwise'_bit]
[GOAL]
case pos.pos.bit0.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ ↑(p (PosNum.bit false m) 1) = Nat.bitwise' g (↑(pos (PosNum.bit false m))) (Nat.bit true 0)
[PROOFSTEP]
repeat' rw [show ∀ b n, (pos (PosNum.bit b n) : ℕ) = Nat.bit b ↑n by intros b _; cases b <;> rfl]
[GOAL]
case pos.pos.bit0.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ ↑(p (PosNum.bit false m) 1) = Nat.bitwise' g (↑(pos (PosNum.bit false m))) (Nat.bit true 0)
[PROOFSTEP]
rw [show ∀ b n, (pos (PosNum.bit b n) : ℕ) = Nat.bit b ↑n by intros b _; cases b <;> rfl]
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ ∀ (b : Bool) (n : PosNum), ↑(pos (PosNum.bit b n)) = Nat.bit b ↑n
[PROOFSTEP]
intros b _
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
b : Bool
n✝ : PosNum
⊢ ↑(pos (PosNum.bit b n✝)) = Nat.bit b ↑n✝
[PROOFSTEP]
cases b
[GOAL]
case false
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n✝ : PosNum
⊢ ↑(pos (PosNum.bit false n✝)) = Nat.bit false ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case true
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n✝ : PosNum
⊢ ↑(pos (PosNum.bit true n✝)) = Nat.bit true ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case pos.pos.bit0.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ ↑(p (PosNum.bit false m) 1) = Nat.bitwise' g (Nat.bit false ↑m) (Nat.bit true 0)
[PROOFSTEP]
rw [show ∀ b n, (pos (PosNum.bit b n) : ℕ) = Nat.bit b ↑n by intros b _; cases b <;> rfl]
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ ∀ (b : Bool) (n : PosNum), ↑(pos (PosNum.bit b n)) = Nat.bit b ↑n
[PROOFSTEP]
intros b _
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
b : Bool
n✝ : PosNum
⊢ ↑(pos (PosNum.bit b n✝)) = Nat.bit b ↑n✝
[PROOFSTEP]
cases b
[GOAL]
case false
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n✝ : PosNum
⊢ ↑(pos (PosNum.bit false n✝)) = Nat.bit false ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case true
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n✝ : PosNum
⊢ ↑(pos (PosNum.bit true n✝)) = Nat.bit true ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case pos.pos.bit0.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ ↑(p (PosNum.bit false m) 1) = Nat.bitwise' g (Nat.bit false ↑m) (Nat.bit true 0)
[PROOFSTEP]
rw [Nat.bitwise'_bit]
[GOAL]
case pos.pos.bit0.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit false m) (PosNum.bit true n)) = Nat.bitwise' g ↑(pos (PosNum.bit false m)) ↑(pos (PosNum.bit true n))
[PROOFSTEP]
repeat' rw [show ∀ b n, (pos (PosNum.bit b n) : ℕ) = Nat.bit b ↑n by intros b _; cases b <;> rfl]
[GOAL]
case pos.pos.bit0.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit false m) (PosNum.bit true n)) = Nat.bitwise' g ↑(pos (PosNum.bit false m)) ↑(pos (PosNum.bit true n))
[PROOFSTEP]
rw [show ∀ b n, (pos (PosNum.bit b n) : ℕ) = Nat.bit b ↑n by intros b _; cases b <;> rfl]
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ∀ (b : Bool) (n : PosNum), ↑(pos (PosNum.bit b n)) = Nat.bit b ↑n
[PROOFSTEP]
intros b _
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
b : Bool
n✝ : PosNum
⊢ ↑(pos (PosNum.bit b n✝)) = Nat.bit b ↑n✝
[PROOFSTEP]
cases b
[GOAL]
case false
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n n✝ : PosNum
⊢ ↑(pos (PosNum.bit false n✝)) = Nat.bit false ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case true
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n n✝ : PosNum
⊢ ↑(pos (PosNum.bit true n✝)) = Nat.bit true ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case pos.pos.bit0.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit false m) (PosNum.bit true n)) = Nat.bitwise' g (Nat.bit false ↑m) ↑(pos (PosNum.bit true n))
[PROOFSTEP]
rw [show ∀ b n, (pos (PosNum.bit b n) : ℕ) = Nat.bit b ↑n by intros b _; cases b <;> rfl]
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ∀ (b : Bool) (n : PosNum), ↑(pos (PosNum.bit b n)) = Nat.bit b ↑n
[PROOFSTEP]
intros b _
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
b : Bool
n✝ : PosNum
⊢ ↑(pos (PosNum.bit b n✝)) = Nat.bit b ↑n✝
[PROOFSTEP]
cases b
[GOAL]
case false
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n n✝ : PosNum
⊢ ↑(pos (PosNum.bit false n✝)) = Nat.bit false ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case true
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n n✝ : PosNum
⊢ ↑(pos (PosNum.bit true n✝)) = Nat.bit true ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case pos.pos.bit0.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit false m) (PosNum.bit true n)) = Nat.bitwise' g (Nat.bit false ↑m) (Nat.bit true ↑n)
[PROOFSTEP]
rw [show ∀ b n, (pos (PosNum.bit b n) : ℕ) = Nat.bit b ↑n by intros b _; cases b <;> rfl]
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ∀ (b : Bool) (n : PosNum), ↑(pos (PosNum.bit b n)) = Nat.bit b ↑n
[PROOFSTEP]
intros b _
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
b : Bool
n✝ : PosNum
⊢ ↑(pos (PosNum.bit b n✝)) = Nat.bit b ↑n✝
[PROOFSTEP]
cases b
[GOAL]
case false
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n n✝ : PosNum
⊢ ↑(pos (PosNum.bit false n✝)) = Nat.bit false ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case true
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n n✝ : PosNum
⊢ ↑(pos (PosNum.bit true n✝)) = Nat.bit true ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case pos.pos.bit0.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit false m) (PosNum.bit true n)) = Nat.bitwise' g (Nat.bit false ↑m) (Nat.bit true ↑n)
[PROOFSTEP]
rw [Nat.bitwise'_bit]
[GOAL]
case pos.pos.bit0.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit false m) (PosNum.bit false n)) =
    Nat.bitwise' g ↑(pos (PosNum.bit false m)) ↑(pos (PosNum.bit false n))
[PROOFSTEP]
repeat' rw [show ∀ b n, (pos (PosNum.bit b n) : ℕ) = Nat.bit b ↑n by intros b _; cases b <;> rfl]
[GOAL]
case pos.pos.bit0.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit false m) (PosNum.bit false n)) =
    Nat.bitwise' g ↑(pos (PosNum.bit false m)) ↑(pos (PosNum.bit false n))
[PROOFSTEP]
rw [show ∀ b n, (pos (PosNum.bit b n) : ℕ) = Nat.bit b ↑n by intros b _; cases b <;> rfl]
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ∀ (b : Bool) (n : PosNum), ↑(pos (PosNum.bit b n)) = Nat.bit b ↑n
[PROOFSTEP]
intros b _
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
b : Bool
n✝ : PosNum
⊢ ↑(pos (PosNum.bit b n✝)) = Nat.bit b ↑n✝
[PROOFSTEP]
cases b
[GOAL]
case false
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n n✝ : PosNum
⊢ ↑(pos (PosNum.bit false n✝)) = Nat.bit false ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case true
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n n✝ : PosNum
⊢ ↑(pos (PosNum.bit true n✝)) = Nat.bit true ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case pos.pos.bit0.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit false m) (PosNum.bit false n)) = Nat.bitwise' g (Nat.bit false ↑m) ↑(pos (PosNum.bit false n))
[PROOFSTEP]
rw [show ∀ b n, (pos (PosNum.bit b n) : ℕ) = Nat.bit b ↑n by intros b _; cases b <;> rfl]
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ∀ (b : Bool) (n : PosNum), ↑(pos (PosNum.bit b n)) = Nat.bit b ↑n
[PROOFSTEP]
intros b _
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
b : Bool
n✝ : PosNum
⊢ ↑(pos (PosNum.bit b n✝)) = Nat.bit b ↑n✝
[PROOFSTEP]
cases b
[GOAL]
case false
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n n✝ : PosNum
⊢ ↑(pos (PosNum.bit false n✝)) = Nat.bit false ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case true
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n n✝ : PosNum
⊢ ↑(pos (PosNum.bit true n✝)) = Nat.bit true ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case pos.pos.bit0.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit false m) (PosNum.bit false n)) = Nat.bitwise' g (Nat.bit false ↑m) (Nat.bit false ↑n)
[PROOFSTEP]
rw [show ∀ b n, (pos (PosNum.bit b n) : ℕ) = Nat.bit b ↑n by intros b _; cases b <;> rfl]
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ∀ (b : Bool) (n : PosNum), ↑(pos (PosNum.bit b n)) = Nat.bit b ↑n
[PROOFSTEP]
intros b _
[GOAL]
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
b : Bool
n✝ : PosNum
⊢ ↑(pos (PosNum.bit b n✝)) = Nat.bit b ↑n✝
[PROOFSTEP]
cases b
[GOAL]
case false
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n n✝ : PosNum
⊢ ↑(pos (PosNum.bit false n✝)) = Nat.bit false ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case true
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝¹ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n n✝ : PosNum
⊢ ↑(pos (PosNum.bit true n✝)) = Nat.bit true ↑n✝
[PROOFSTEP]
rfl
[GOAL]
case pos.pos.bit0.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit false m) (PosNum.bit false n)) = Nat.bitwise' g (Nat.bit false ↑m) (Nat.bit false ↑n)
[PROOFSTEP]
rw [Nat.bitwise'_bit]
[GOAL]
case pos.pos.one.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
⊢ ↑(p 1 1) = Nat.bit (g true true) (Nat.bitwise' g 0 0)
case pos.pos.one.one.h
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
⊢ g false false = false
case pos.pos.one.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
⊢ ↑(p 1 (PosNum.bit true n)) = Nat.bit (g true true) (Nat.bitwise' g 0 ↑n)
case pos.pos.one.bit1.h
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
⊢ g false false = false
case pos.pos.one.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
⊢ ↑(p 1 (PosNum.bit false n)) = Nat.bit (g true false) (Nat.bitwise' g 0 ↑n)
case pos.pos.one.bit0.h
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
⊢ g false false = false
case pos.pos.bit1.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ ↑(p (PosNum.bit true m) 1) = Nat.bit (g true true) (Nat.bitwise' g (↑m) 0)
case pos.pos.bit1.one.h
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ g false false = false
case pos.pos.bit1.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit true m) (PosNum.bit true n)) = Nat.bit (g true true) (Nat.bitwise' g ↑m ↑n)
case pos.pos.bit1.bit1.h
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ g false false = false
case pos.pos.bit1.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit true m) (PosNum.bit false n)) = Nat.bit (g true false) (Nat.bitwise' g ↑m ↑n)
case pos.pos.bit1.bit0.h
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ g false false = false
case pos.pos.bit0.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ ↑(p (PosNum.bit false m) 1) = Nat.bit (g false true) (Nat.bitwise' g (↑m) 0)
case pos.pos.bit0.one.h
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ g false false = false
case pos.pos.bit0.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit false m) (PosNum.bit true n)) = Nat.bit (g false true) (Nat.bitwise' g ↑m ↑n)
case pos.pos.bit0.bit1.h
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ g false false = false
case pos.pos.bit0.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit false m) (PosNum.bit false n)) = Nat.bit (g false false) (Nat.bitwise' g ↑m ↑n)
case pos.pos.bit0.bit0.h
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ g false false = false
[PROOFSTEP]
any_goals assumption
[GOAL]
case pos.pos.one.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
⊢ ↑(p 1 1) = Nat.bit (g true true) (Nat.bitwise' g 0 0)
[PROOFSTEP]
assumption
[GOAL]
case pos.pos.one.one.h
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
⊢ g false false = false
[PROOFSTEP]
assumption
[GOAL]
case pos.pos.one.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
⊢ ↑(p 1 (PosNum.bit true n)) = Nat.bit (g true true) (Nat.bitwise' g 0 ↑n)
[PROOFSTEP]
assumption
[GOAL]
case pos.pos.one.bit1.h
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
⊢ g false false = false
[PROOFSTEP]
assumption
[GOAL]
case pos.pos.one.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
⊢ ↑(p 1 (PosNum.bit false n)) = Nat.bit (g true false) (Nat.bitwise' g 0 ↑n)
[PROOFSTEP]
assumption
[GOAL]
case pos.pos.one.bit0.h
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
⊢ g false false = false
[PROOFSTEP]
assumption
[GOAL]
case pos.pos.bit1.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ ↑(p (PosNum.bit true m) 1) = Nat.bit (g true true) (Nat.bitwise' g (↑m) 0)
[PROOFSTEP]
assumption
[GOAL]
case pos.pos.bit1.one.h
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ g false false = false
[PROOFSTEP]
assumption
[GOAL]
case pos.pos.bit1.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit true m) (PosNum.bit true n)) = Nat.bit (g true true) (Nat.bitwise' g ↑m ↑n)
[PROOFSTEP]
assumption
[GOAL]
case pos.pos.bit1.bit1.h
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ g false false = false
[PROOFSTEP]
assumption
[GOAL]
case pos.pos.bit1.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit true m) (PosNum.bit false n)) = Nat.bit (g true false) (Nat.bitwise' g ↑m ↑n)
[PROOFSTEP]
assumption
[GOAL]
case pos.pos.bit1.bit0.h
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ g false false = false
[PROOFSTEP]
assumption
[GOAL]
case pos.pos.bit0.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ ↑(p (PosNum.bit false m) 1) = Nat.bit (g false true) (Nat.bitwise' g (↑m) 0)
[PROOFSTEP]
assumption
[GOAL]
case pos.pos.bit0.one.h
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ g false false = false
[PROOFSTEP]
assumption
[GOAL]
case pos.pos.bit0.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit false m) (PosNum.bit true n)) = Nat.bit (g false true) (Nat.bitwise' g ↑m ↑n)
[PROOFSTEP]
assumption
[GOAL]
case pos.pos.bit0.bit1.h
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ g false false = false
[PROOFSTEP]
assumption
[GOAL]
case pos.pos.bit0.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit false m) (PosNum.bit false n)) = Nat.bit (g false false) (Nat.bitwise' g ↑m ↑n)
[PROOFSTEP]
assumption
[GOAL]
case pos.pos.bit0.bit0.h
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ g false false = false
[PROOFSTEP]
assumption
[GOAL]
case pos.pos.one.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
⊢ ↑(p 1 1) = Nat.bit (g true true) (Nat.bitwise' g 0 0)
case pos.pos.one.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
⊢ ↑(p 1 (PosNum.bit true n)) = Nat.bit (g true true) (Nat.bitwise' g 0 ↑n)
case pos.pos.one.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
⊢ ↑(p 1 (PosNum.bit false n)) = Nat.bit (g true false) (Nat.bitwise' g 0 ↑n)
case pos.pos.bit1.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ ↑(p (PosNum.bit true m) 1) = Nat.bit (g true true) (Nat.bitwise' g (↑m) 0)
case pos.pos.bit1.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit true m) (PosNum.bit true n)) = Nat.bit (g true true) (Nat.bitwise' g ↑m ↑n)
case pos.pos.bit1.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit true m) (PosNum.bit false n)) = Nat.bit (g true false) (Nat.bitwise' g ↑m ↑n)
case pos.pos.bit0.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ ↑(p (PosNum.bit false m) 1) = Nat.bit (g false true) (Nat.bitwise' g (↑m) 0)
case pos.pos.bit0.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit false m) (PosNum.bit true n)) = Nat.bit (g false true) (Nat.bitwise' g ↑m ↑n)
case pos.pos.bit0.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit false m) (PosNum.bit false n)) = Nat.bit (g false false) (Nat.bitwise' g ↑m ↑n)
[PROOFSTEP]
any_goals rw [Nat.bitwise'_zero, p11]; cases g true true <;> rfl
[GOAL]
case pos.pos.one.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
⊢ ↑(p 1 1) = Nat.bit (g true true) (Nat.bitwise' g 0 0)
[PROOFSTEP]
rw [Nat.bitwise'_zero, p11]
[GOAL]
case pos.pos.one.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
⊢ ↑(bif g true true then 1 else 0) = Nat.bit (g true true) 0
[PROOFSTEP]
cases g true true
[GOAL]
case pos.pos.one.one.false
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
⊢ ↑(bif false then 1 else 0) = Nat.bit false 0
[PROOFSTEP]
rfl
[GOAL]
case pos.pos.one.one.true
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
⊢ ↑(bif true then 1 else 0) = Nat.bit true 0
[PROOFSTEP]
rfl
[GOAL]
case pos.pos.one.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
⊢ ↑(p 1 (PosNum.bit true n)) = Nat.bit (g true true) (Nat.bitwise' g 0 ↑n)
[PROOFSTEP]
rw [Nat.bitwise'_zero, p11]
[GOAL]
case pos.pos.one.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
⊢ ↑(p 1 (PosNum.bit false n)) = Nat.bit (g true false) (Nat.bitwise' g 0 ↑n)
[PROOFSTEP]
rw [Nat.bitwise'_zero, p11]
[GOAL]
case pos.pos.bit1.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ ↑(p (PosNum.bit true m) 1) = Nat.bit (g true true) (Nat.bitwise' g (↑m) 0)
[PROOFSTEP]
rw [Nat.bitwise'_zero, p11]
[GOAL]
case pos.pos.bit1.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit true m) (PosNum.bit true n)) = Nat.bit (g true true) (Nat.bitwise' g ↑m ↑n)
[PROOFSTEP]
rw [Nat.bitwise'_zero, p11]
[GOAL]
case pos.pos.bit1.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit true m) (PosNum.bit false n)) = Nat.bit (g true false) (Nat.bitwise' g ↑m ↑n)
[PROOFSTEP]
rw [Nat.bitwise'_zero, p11]
[GOAL]
case pos.pos.bit0.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ ↑(p (PosNum.bit false m) 1) = Nat.bit (g false true) (Nat.bitwise' g (↑m) 0)
[PROOFSTEP]
rw [Nat.bitwise'_zero, p11]
[GOAL]
case pos.pos.bit0.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit false m) (PosNum.bit true n)) = Nat.bit (g false true) (Nat.bitwise' g ↑m ↑n)
[PROOFSTEP]
rw [Nat.bitwise'_zero, p11]
[GOAL]
case pos.pos.bit0.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit false m) (PosNum.bit false n)) = Nat.bit (g false false) (Nat.bitwise' g ↑m ↑n)
[PROOFSTEP]
rw [Nat.bitwise'_zero, p11]
[GOAL]
case pos.pos.one.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
⊢ ↑(p 1 (PosNum.bit true n)) = Nat.bit (g true true) (Nat.bitwise' g 0 ↑n)
case pos.pos.one.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
⊢ ↑(p 1 (PosNum.bit false n)) = Nat.bit (g true false) (Nat.bitwise' g 0 ↑n)
case pos.pos.bit1.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ ↑(p (PosNum.bit true m) 1) = Nat.bit (g true true) (Nat.bitwise' g (↑m) 0)
case pos.pos.bit1.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit true m) (PosNum.bit true n)) = Nat.bit (g true true) (Nat.bitwise' g ↑m ↑n)
case pos.pos.bit1.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit true m) (PosNum.bit false n)) = Nat.bit (g true false) (Nat.bitwise' g ↑m ↑n)
case pos.pos.bit0.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ ↑(p (PosNum.bit false m) 1) = Nat.bit (g false true) (Nat.bitwise' g (↑m) 0)
case pos.pos.bit0.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit false m) (PosNum.bit true n)) = Nat.bit (g false true) (Nat.bitwise' g ↑m ↑n)
case pos.pos.bit0.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit false m) (PosNum.bit false n)) = Nat.bit (g false false) (Nat.bitwise' g ↑m ↑n)
[PROOFSTEP]
any_goals rw [Nat.bitwise'_zero_left, this, ← bit_to_nat, p1b]
[GOAL]
case pos.pos.one.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
⊢ ↑(p 1 (PosNum.bit true n)) = Nat.bit (g true true) (Nat.bitwise' g 0 ↑n)
[PROOFSTEP]
rw [Nat.bitwise'_zero_left, this, ← bit_to_nat, p1b]
[GOAL]
case pos.pos.one.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
n : PosNum
⊢ ↑(p 1 (PosNum.bit false n)) = Nat.bit (g true false) (Nat.bitwise' g 0 ↑n)
[PROOFSTEP]
rw [Nat.bitwise'_zero_left, this, ← bit_to_nat, p1b]
[GOAL]
case pos.pos.bit1.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ ↑(p (PosNum.bit true m) 1) = Nat.bit (g true true) (Nat.bitwise' g (↑m) 0)
[PROOFSTEP]
rw [Nat.bitwise'_zero_left, this, ← bit_to_nat, p1b]
[GOAL]
case pos.pos.bit1.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit true m) (PosNum.bit true n)) = Nat.bit (g true true) (Nat.bitwise' g ↑m ↑n)
[PROOFSTEP]
rw [Nat.bitwise'_zero_left, this, ← bit_to_nat, p1b]
[GOAL]
case pos.pos.bit1.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit true m) (PosNum.bit false n)) = Nat.bit (g true false) (Nat.bitwise' g ↑m ↑n)
[PROOFSTEP]
rw [Nat.bitwise'_zero_left, this, ← bit_to_nat, p1b]
[GOAL]
case pos.pos.bit0.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ ↑(p (PosNum.bit false m) 1) = Nat.bit (g false true) (Nat.bitwise' g (↑m) 0)
[PROOFSTEP]
rw [Nat.bitwise'_zero_left, this, ← bit_to_nat, p1b]
[GOAL]
case pos.pos.bit0.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit false m) (PosNum.bit true n)) = Nat.bit (g false true) (Nat.bitwise' g ↑m ↑n)
[PROOFSTEP]
rw [Nat.bitwise'_zero_left, this, ← bit_to_nat, p1b]
[GOAL]
case pos.pos.bit0.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit false m) (PosNum.bit false n)) = Nat.bit (g false false) (Nat.bitwise' g ↑m ↑n)
[PROOFSTEP]
rw [Nat.bitwise'_zero_left, this, ← bit_to_nat, p1b]
[GOAL]
case pos.pos.bit1.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ ↑(p (PosNum.bit true m) 1) = Nat.bit (g true true) (Nat.bitwise' g (↑m) 0)
case pos.pos.bit1.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit true m) (PosNum.bit true n)) = Nat.bit (g true true) (Nat.bitwise' g ↑m ↑n)
case pos.pos.bit1.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit true m) (PosNum.bit false n)) = Nat.bit (g true false) (Nat.bitwise' g ↑m ↑n)
case pos.pos.bit0.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ ↑(p (PosNum.bit false m) 1) = Nat.bit (g false true) (Nat.bitwise' g (↑m) 0)
case pos.pos.bit0.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit false m) (PosNum.bit true n)) = Nat.bit (g false true) (Nat.bitwise' g ↑m ↑n)
case pos.pos.bit0.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit false m) (PosNum.bit false n)) = Nat.bit (g false false) (Nat.bitwise' g ↑m ↑n)
[PROOFSTEP]
any_goals rw [Nat.bitwise'_zero_right _ gff, this, ← bit_to_nat, pb1]
[GOAL]
case pos.pos.bit1.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ ↑(p (PosNum.bit true m) 1) = Nat.bit (g true true) (Nat.bitwise' g (↑m) 0)
[PROOFSTEP]
rw [Nat.bitwise'_zero_right _ gff, this, ← bit_to_nat, pb1]
[GOAL]
case pos.pos.bit1.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit true m) (PosNum.bit true n)) = Nat.bit (g true true) (Nat.bitwise' g ↑m ↑n)
[PROOFSTEP]
rw [Nat.bitwise'_zero_right _ gff, this, ← bit_to_nat, pb1]
[GOAL]
case pos.pos.bit1.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit true m) (PosNum.bit false n)) = Nat.bit (g true false) (Nat.bitwise' g ↑m ↑n)
[PROOFSTEP]
rw [Nat.bitwise'_zero_right _ gff, this, ← bit_to_nat, pb1]
[GOAL]
case pos.pos.bit0.one
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
⊢ ↑(p (PosNum.bit false m) 1) = Nat.bit (g false true) (Nat.bitwise' g (↑m) 0)
[PROOFSTEP]
rw [Nat.bitwise'_zero_right _ gff, this, ← bit_to_nat, pb1]
[GOAL]
case pos.pos.bit0.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit false m) (PosNum.bit true n)) = Nat.bit (g false true) (Nat.bitwise' g ↑m ↑n)
[PROOFSTEP]
rw [Nat.bitwise'_zero_right _ gff, this, ← bit_to_nat, pb1]
[GOAL]
case pos.pos.bit0.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit false m) (PosNum.bit false n)) = Nat.bit (g false false) (Nat.bitwise' g ↑m ↑n)
[PROOFSTEP]
rw [Nat.bitwise'_zero_right _ gff, this, ← bit_to_nat, pb1]
[GOAL]
case pos.pos.bit1.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit true m) (PosNum.bit true n)) = Nat.bit (g true true) (Nat.bitwise' g ↑m ↑n)
case pos.pos.bit1.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit true m) (PosNum.bit false n)) = Nat.bit (g true false) (Nat.bitwise' g ↑m ↑n)
case pos.pos.bit0.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit false m) (PosNum.bit true n)) = Nat.bit (g false true) (Nat.bitwise' g ↑m ↑n)
case pos.pos.bit0.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit false m) (PosNum.bit false n)) = Nat.bit (g false false) (Nat.bitwise' g ↑m ↑n)
[PROOFSTEP]
all_goals
  rw [← show ∀ n : PosNum, ↑(p m n) = Nat.bitwise' g ↑m ↑n from IH]
  rw [← bit_to_nat, pbb]
[GOAL]
case pos.pos.bit1.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit true m) (PosNum.bit true n)) = Nat.bit (g true true) (Nat.bitwise' g ↑m ↑n)
[PROOFSTEP]
rw [← show ∀ n : PosNum, ↑(p m n) = Nat.bitwise' g ↑m ↑n from IH]
[GOAL]
case pos.pos.bit1.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit true m) (PosNum.bit true n)) = Nat.bit (g true true) ↑(p m n)
[PROOFSTEP]
rw [← bit_to_nat, pbb]
[GOAL]
case pos.pos.bit1.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit true m) (PosNum.bit false n)) = Nat.bit (g true false) (Nat.bitwise' g ↑m ↑n)
[PROOFSTEP]
rw [← show ∀ n : PosNum, ↑(p m n) = Nat.bitwise' g ↑m ↑n from IH]
[GOAL]
case pos.pos.bit1.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit true m) (PosNum.bit false n)) = Nat.bit (g true false) ↑(p m n)
[PROOFSTEP]
rw [← bit_to_nat, pbb]
[GOAL]
case pos.pos.bit0.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit false m) (PosNum.bit true n)) = Nat.bit (g false true) (Nat.bitwise' g ↑m ↑n)
[PROOFSTEP]
rw [← show ∀ n : PosNum, ↑(p m n) = Nat.bitwise' g ↑m ↑n from IH]
[GOAL]
case pos.pos.bit0.bit1
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit false m) (PosNum.bit true n)) = Nat.bit (g false true) ↑(p m n)
[PROOFSTEP]
rw [← bit_to_nat, pbb]
[GOAL]
case pos.pos.bit0.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit false m) (PosNum.bit false n)) = Nat.bit (g false false) (Nat.bitwise' g ↑m ↑n)
[PROOFSTEP]
rw [← show ∀ n : PosNum, ↑(p m n) = Nat.bitwise' g ↑m ↑n from IH]
[GOAL]
case pos.pos.bit0.bit0
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
n✝ : PosNum
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
m : PosNum
IH : ∀ (n : PosNum), ↑(p m n) = Nat.bitwise' g ↑(pos m) ↑(pos n)
n : PosNum
⊢ ↑(p (PosNum.bit false m) (PosNum.bit false n)) = Nat.bit (g false false) ↑(p m n)
[PROOFSTEP]
rw [← bit_to_nat, pbb]
[GOAL]
α : Type u_1
⊢ ∀ (m n : Num), ↑(lor m n) = Nat.lor' ↑m ↑n
[PROOFSTEP]
apply bitwise'_to_nat fun x y => pos (PosNum.lor x y)
[GOAL]
case gff
α : Type u_1
⊢ (false || false) = false
[PROOFSTEP]
intros
[GOAL]
case f00
α : Type u_1
⊢ lor 0 0 = 0
[PROOFSTEP]
intros
[GOAL]
case f0n
α : Type u_1
⊢ ∀ (n : PosNum), lor 0 (pos n) = bif false || true then pos n else 0
[PROOFSTEP]
intros
[GOAL]
case fn0
α : Type u_1
⊢ ∀ (n : PosNum), lor (pos n) 0 = bif true || false then pos n else 0
[PROOFSTEP]
intros
[GOAL]
case fnn
α : Type u_1
⊢ ∀ (m n : PosNum), lor (pos m) (pos n) = pos (PosNum.lor m n)
[PROOFSTEP]
intros
[GOAL]
case p11
α : Type u_1
⊢ pos (PosNum.lor 1 1) = bif true || true then 1 else 0
[PROOFSTEP]
intros
[GOAL]
case p1b
α : Type u_1
⊢ ∀ (b : Bool) (n : PosNum), pos (PosNum.lor 1 (PosNum.bit b n)) = bit (true || b) (bif false || true then pos n else 0)
[PROOFSTEP]
intros
[GOAL]
case pb1
α : Type u_1
⊢ ∀ (a : Bool) (m : PosNum), pos (PosNum.lor (PosNum.bit a m) 1) = bit (a || true) (bif true || false then pos m else 0)
[PROOFSTEP]
intros
[GOAL]
case pbb
α : Type u_1
⊢ ∀ (a b : Bool) (m n : PosNum),
    pos (PosNum.lor (PosNum.bit a m) (PosNum.bit b n)) = bit (a || b) (pos (PosNum.lor m n))
[PROOFSTEP]
intros
[GOAL]
case gff
α : Type u_1
⊢ (false || false) = false
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case gff
α : Type u_1
⊢ (false || false) = false
[PROOFSTEP]
cases_type* Bool
[GOAL]
case f00
α : Type u_1
⊢ lor 0 0 = 0
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case f00
α : Type u_1
⊢ lor 0 0 = 0
[PROOFSTEP]
cases_type* Bool
[GOAL]
case f0n
α : Type u_1
n✝ : PosNum
⊢ lor 0 (pos n✝) = bif false || true then pos n✝ else 0
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case f0n
α : Type u_1
n✝ : PosNum
⊢ lor 0 (pos n✝) = bif false || true then pos n✝ else 0
[PROOFSTEP]
cases_type* Bool
[GOAL]
case fn0
α : Type u_1
n✝ : PosNum
⊢ lor (pos n✝) 0 = bif true || false then pos n✝ else 0
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case fn0
α : Type u_1
n✝ : PosNum
⊢ lor (pos n✝) 0 = bif true || false then pos n✝ else 0
[PROOFSTEP]
cases_type* Bool
[GOAL]
case fnn
α : Type u_1
m✝ n✝ : PosNum
⊢ lor (pos m✝) (pos n✝) = pos (PosNum.lor m✝ n✝)
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case fnn
α : Type u_1
m✝ n✝ : PosNum
⊢ lor (pos m✝) (pos n✝) = pos (PosNum.lor m✝ n✝)
[PROOFSTEP]
cases_type* Bool
[GOAL]
case p11
α : Type u_1
⊢ pos (PosNum.lor 1 1) = bif true || true then 1 else 0
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case p11
α : Type u_1
⊢ pos (PosNum.lor 1 1) = bif true || true then 1 else 0
[PROOFSTEP]
cases_type* Bool
[GOAL]
case p1b
α : Type u_1
b✝ : Bool
n✝ : PosNum
⊢ pos (PosNum.lor 1 (PosNum.bit b✝ n✝)) = bit (true || b✝) (bif false || true then pos n✝ else 0)
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case p1b
α : Type u_1
b✝ : Bool
n✝ : PosNum
⊢ pos (PosNum.lor 1 (PosNum.bit b✝ n✝)) = bit (true || b✝) (bif false || true then pos n✝ else 0)
[PROOFSTEP]
cases_type* Bool
[GOAL]
case pb1
α : Type u_1
a✝ : Bool
m✝ : PosNum
⊢ pos (PosNum.lor (PosNum.bit a✝ m✝) 1) = bit (a✝ || true) (bif true || false then pos m✝ else 0)
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case pb1
α : Type u_1
a✝ : Bool
m✝ : PosNum
⊢ pos (PosNum.lor (PosNum.bit a✝ m✝) 1) = bit (a✝ || true) (bif true || false then pos m✝ else 0)
[PROOFSTEP]
cases_type* Bool
[GOAL]
case pbb
α : Type u_1
a✝ b✝ : Bool
m✝ n✝ : PosNum
⊢ pos (PosNum.lor (PosNum.bit a✝ m✝) (PosNum.bit b✝ n✝)) = bit (a✝ || b✝) (pos (PosNum.lor m✝ n✝))
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case pbb
α : Type u_1
a✝ b✝ : Bool
m✝ n✝ : PosNum
⊢ pos (PosNum.lor (PosNum.bit a✝ m✝) (PosNum.bit b✝ n✝)) = bit (a✝ || b✝) (pos (PosNum.lor m✝ n✝))
[PROOFSTEP]
cases_type* Bool
[GOAL]
case gff
α : Type u_1
⊢ (false || false) = false
[PROOFSTEP]
rfl
[GOAL]
case f00
α : Type u_1
⊢ lor 0 0 = 0
[PROOFSTEP]
rfl
[GOAL]
case f0n
α : Type u_1
n✝ : PosNum
⊢ lor 0 (pos n✝) = bif false || true then pos n✝ else 0
[PROOFSTEP]
rfl
[GOAL]
case fn0
α : Type u_1
n✝ : PosNum
⊢ lor (pos n✝) 0 = bif true || false then pos n✝ else 0
[PROOFSTEP]
rfl
[GOAL]
case fnn
α : Type u_1
m✝ n✝ : PosNum
⊢ lor (pos m✝) (pos n✝) = pos (PosNum.lor m✝ n✝)
[PROOFSTEP]
rfl
[GOAL]
case p11
α : Type u_1
⊢ pos (PosNum.lor 1 1) = bif true || true then 1 else 0
[PROOFSTEP]
rfl
[GOAL]
case p1b.false
α : Type u_1
n✝ : PosNum
⊢ pos (PosNum.lor 1 (PosNum.bit false n✝)) = bit (true || false) (bif false || true then pos n✝ else 0)
[PROOFSTEP]
rfl
[GOAL]
case p1b.true
α : Type u_1
n✝ : PosNum
⊢ pos (PosNum.lor 1 (PosNum.bit true n✝)) = bit (true || true) (bif false || true then pos n✝ else 0)
[PROOFSTEP]
rfl
[GOAL]
case pb1.false
α : Type u_1
m✝ : PosNum
⊢ pos (PosNum.lor (PosNum.bit false m✝) 1) = bit (false || true) (bif true || false then pos m✝ else 0)
[PROOFSTEP]
rfl
[GOAL]
case pb1.true
α : Type u_1
m✝ : PosNum
⊢ pos (PosNum.lor (PosNum.bit true m✝) 1) = bit (true || true) (bif true || false then pos m✝ else 0)
[PROOFSTEP]
rfl
[GOAL]
case pbb.false.false
α : Type u_1
m✝ n✝ : PosNum
⊢ pos (PosNum.lor (PosNum.bit false m✝) (PosNum.bit false n✝)) = bit (false || false) (pos (PosNum.lor m✝ n✝))
[PROOFSTEP]
rfl
[GOAL]
case pbb.false.true
α : Type u_1
m✝ n✝ : PosNum
⊢ pos (PosNum.lor (PosNum.bit false m✝) (PosNum.bit true n✝)) = bit (false || true) (pos (PosNum.lor m✝ n✝))
[PROOFSTEP]
rfl
[GOAL]
case pbb.true.false
α : Type u_1
m✝ n✝ : PosNum
⊢ pos (PosNum.lor (PosNum.bit true m✝) (PosNum.bit false n✝)) = bit (true || false) (pos (PosNum.lor m✝ n✝))
[PROOFSTEP]
rfl
[GOAL]
case pbb.true.true
α : Type u_1
m✝ n✝ : PosNum
⊢ pos (PosNum.lor (PosNum.bit true m✝) (PosNum.bit true n✝)) = bit (true || true) (pos (PosNum.lor m✝ n✝))
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
⊢ ∀ (m n : Num), ↑(land m n) = Nat.land' ↑m ↑n
[PROOFSTEP]
apply bitwise'_to_nat PosNum.land
[GOAL]
case gff
α : Type u_1
⊢ (false && false) = false
[PROOFSTEP]
intros
[GOAL]
case f00
α : Type u_1
⊢ land 0 0 = 0
[PROOFSTEP]
intros
[GOAL]
case f0n
α : Type u_1
⊢ ∀ (n : PosNum), land 0 (pos n) = bif false && true then pos n else 0
[PROOFSTEP]
intros
[GOAL]
case fn0
α : Type u_1
⊢ ∀ (n : PosNum), land (pos n) 0 = bif true && false then pos n else 0
[PROOFSTEP]
intros
[GOAL]
case fnn
α : Type u_1
⊢ ∀ (m n : PosNum), land (pos m) (pos n) = PosNum.land m n
[PROOFSTEP]
intros
[GOAL]
case p11
α : Type u_1
⊢ PosNum.land 1 1 = bif true && true then 1 else 0
[PROOFSTEP]
intros
[GOAL]
case p1b
α : Type u_1
⊢ ∀ (b : Bool) (n : PosNum), PosNum.land 1 (PosNum.bit b n) = bit (true && b) (bif false && true then pos n else 0)
[PROOFSTEP]
intros
[GOAL]
case pb1
α : Type u_1
⊢ ∀ (a : Bool) (m : PosNum), PosNum.land (PosNum.bit a m) 1 = bit (a && true) (bif true && false then pos m else 0)
[PROOFSTEP]
intros
[GOAL]
case pbb
α : Type u_1
⊢ ∀ (a b : Bool) (m n : PosNum), PosNum.land (PosNum.bit a m) (PosNum.bit b n) = bit (a && b) (PosNum.land m n)
[PROOFSTEP]
intros
[GOAL]
case gff
α : Type u_1
⊢ (false && false) = false
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case gff
α : Type u_1
⊢ (false && false) = false
[PROOFSTEP]
cases_type* Bool
[GOAL]
case f00
α : Type u_1
⊢ land 0 0 = 0
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case f00
α : Type u_1
⊢ land 0 0 = 0
[PROOFSTEP]
cases_type* Bool
[GOAL]
case f0n
α : Type u_1
n✝ : PosNum
⊢ land 0 (pos n✝) = bif false && true then pos n✝ else 0
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case f0n
α : Type u_1
n✝ : PosNum
⊢ land 0 (pos n✝) = bif false && true then pos n✝ else 0
[PROOFSTEP]
cases_type* Bool
[GOAL]
case fn0
α : Type u_1
n✝ : PosNum
⊢ land (pos n✝) 0 = bif true && false then pos n✝ else 0
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case fn0
α : Type u_1
n✝ : PosNum
⊢ land (pos n✝) 0 = bif true && false then pos n✝ else 0
[PROOFSTEP]
cases_type* Bool
[GOAL]
case fnn
α : Type u_1
m✝ n✝ : PosNum
⊢ land (pos m✝) (pos n✝) = PosNum.land m✝ n✝
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case fnn
α : Type u_1
m✝ n✝ : PosNum
⊢ land (pos m✝) (pos n✝) = PosNum.land m✝ n✝
[PROOFSTEP]
cases_type* Bool
[GOAL]
case p11
α : Type u_1
⊢ PosNum.land 1 1 = bif true && true then 1 else 0
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case p11
α : Type u_1
⊢ PosNum.land 1 1 = bif true && true then 1 else 0
[PROOFSTEP]
cases_type* Bool
[GOAL]
case p1b
α : Type u_1
b✝ : Bool
n✝ : PosNum
⊢ PosNum.land 1 (PosNum.bit b✝ n✝) = bit (true && b✝) (bif false && true then pos n✝ else 0)
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case p1b
α : Type u_1
b✝ : Bool
n✝ : PosNum
⊢ PosNum.land 1 (PosNum.bit b✝ n✝) = bit (true && b✝) (bif false && true then pos n✝ else 0)
[PROOFSTEP]
cases_type* Bool
[GOAL]
case pb1
α : Type u_1
a✝ : Bool
m✝ : PosNum
⊢ PosNum.land (PosNum.bit a✝ m✝) 1 = bit (a✝ && true) (bif true && false then pos m✝ else 0)
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case pb1
α : Type u_1
a✝ : Bool
m✝ : PosNum
⊢ PosNum.land (PosNum.bit a✝ m✝) 1 = bit (a✝ && true) (bif true && false then pos m✝ else 0)
[PROOFSTEP]
cases_type* Bool
[GOAL]
case pbb
α : Type u_1
a✝ b✝ : Bool
m✝ n✝ : PosNum
⊢ PosNum.land (PosNum.bit a✝ m✝) (PosNum.bit b✝ n✝) = bit (a✝ && b✝) (PosNum.land m✝ n✝)
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case pbb
α : Type u_1
a✝ b✝ : Bool
m✝ n✝ : PosNum
⊢ PosNum.land (PosNum.bit a✝ m✝) (PosNum.bit b✝ n✝) = bit (a✝ && b✝) (PosNum.land m✝ n✝)
[PROOFSTEP]
cases_type* Bool
[GOAL]
case gff
α : Type u_1
⊢ (false && false) = false
[PROOFSTEP]
rfl
[GOAL]
case f00
α : Type u_1
⊢ land 0 0 = 0
[PROOFSTEP]
rfl
[GOAL]
case f0n
α : Type u_1
n✝ : PosNum
⊢ land 0 (pos n✝) = bif false && true then pos n✝ else 0
[PROOFSTEP]
rfl
[GOAL]
case fn0
α : Type u_1
n✝ : PosNum
⊢ land (pos n✝) 0 = bif true && false then pos n✝ else 0
[PROOFSTEP]
rfl
[GOAL]
case fnn
α : Type u_1
m✝ n✝ : PosNum
⊢ land (pos m✝) (pos n✝) = PosNum.land m✝ n✝
[PROOFSTEP]
rfl
[GOAL]
case p11
α : Type u_1
⊢ PosNum.land 1 1 = bif true && true then 1 else 0
[PROOFSTEP]
rfl
[GOAL]
case p1b.false
α : Type u_1
n✝ : PosNum
⊢ PosNum.land 1 (PosNum.bit false n✝) = bit (true && false) (bif false && true then pos n✝ else 0)
[PROOFSTEP]
rfl
[GOAL]
case p1b.true
α : Type u_1
n✝ : PosNum
⊢ PosNum.land 1 (PosNum.bit true n✝) = bit (true && true) (bif false && true then pos n✝ else 0)
[PROOFSTEP]
rfl
[GOAL]
case pb1.false
α : Type u_1
m✝ : PosNum
⊢ PosNum.land (PosNum.bit false m✝) 1 = bit (false && true) (bif true && false then pos m✝ else 0)
[PROOFSTEP]
rfl
[GOAL]
case pb1.true
α : Type u_1
m✝ : PosNum
⊢ PosNum.land (PosNum.bit true m✝) 1 = bit (true && true) (bif true && false then pos m✝ else 0)
[PROOFSTEP]
rfl
[GOAL]
case pbb.false.false
α : Type u_1
m✝ n✝ : PosNum
⊢ PosNum.land (PosNum.bit false m✝) (PosNum.bit false n✝) = bit (false && false) (PosNum.land m✝ n✝)
[PROOFSTEP]
rfl
[GOAL]
case pbb.false.true
α : Type u_1
m✝ n✝ : PosNum
⊢ PosNum.land (PosNum.bit false m✝) (PosNum.bit true n✝) = bit (false && true) (PosNum.land m✝ n✝)
[PROOFSTEP]
rfl
[GOAL]
case pbb.true.false
α : Type u_1
m✝ n✝ : PosNum
⊢ PosNum.land (PosNum.bit true m✝) (PosNum.bit false n✝) = bit (true && false) (PosNum.land m✝ n✝)
[PROOFSTEP]
rfl
[GOAL]
case pbb.true.true
α : Type u_1
m✝ n✝ : PosNum
⊢ PosNum.land (PosNum.bit true m✝) (PosNum.bit true n✝) = bit (true && true) (PosNum.land m✝ n✝)
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
⊢ ∀ (m n : Num), ↑(ldiff m n) = Nat.ldiff' ↑m ↑n
[PROOFSTEP]
apply bitwise'_to_nat PosNum.ldiff
[GOAL]
case gff
α : Type u_1
⊢ (false && !false) = false
[PROOFSTEP]
intros
[GOAL]
case f00
α : Type u_1
⊢ ldiff 0 0 = 0
[PROOFSTEP]
intros
[GOAL]
case f0n
α : Type u_1
⊢ ∀ (n : PosNum), ldiff 0 (pos n) = bif false && !true then pos n else 0
[PROOFSTEP]
intros
[GOAL]
case fn0
α : Type u_1
⊢ ∀ (n : PosNum), ldiff (pos n) 0 = bif true && !false then pos n else 0
[PROOFSTEP]
intros
[GOAL]
case fnn
α : Type u_1
⊢ ∀ (m n : PosNum), ldiff (pos m) (pos n) = PosNum.ldiff m n
[PROOFSTEP]
intros
[GOAL]
case p11
α : Type u_1
⊢ PosNum.ldiff 1 1 = bif true && !true then 1 else 0
[PROOFSTEP]
intros
[GOAL]
case p1b
α : Type u_1
⊢ ∀ (b : Bool) (n : PosNum), PosNum.ldiff 1 (PosNum.bit b n) = bit (true && !b) (bif false && !true then pos n else 0)
[PROOFSTEP]
intros
[GOAL]
case pb1
α : Type u_1
⊢ ∀ (a : Bool) (m : PosNum), PosNum.ldiff (PosNum.bit a m) 1 = bit (a && !true) (bif true && !false then pos m else 0)
[PROOFSTEP]
intros
[GOAL]
case pbb
α : Type u_1
⊢ ∀ (a b : Bool) (m n : PosNum), PosNum.ldiff (PosNum.bit a m) (PosNum.bit b n) = bit (a && !b) (PosNum.ldiff m n)
[PROOFSTEP]
intros
[GOAL]
case gff
α : Type u_1
⊢ (false && !false) = false
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case gff
α : Type u_1
⊢ (false && !false) = false
[PROOFSTEP]
cases_type* Bool
[GOAL]
case f00
α : Type u_1
⊢ ldiff 0 0 = 0
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case f00
α : Type u_1
⊢ ldiff 0 0 = 0
[PROOFSTEP]
cases_type* Bool
[GOAL]
case f0n
α : Type u_1
n✝ : PosNum
⊢ ldiff 0 (pos n✝) = bif false && !true then pos n✝ else 0
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case f0n
α : Type u_1
n✝ : PosNum
⊢ ldiff 0 (pos n✝) = bif false && !true then pos n✝ else 0
[PROOFSTEP]
cases_type* Bool
[GOAL]
case fn0
α : Type u_1
n✝ : PosNum
⊢ ldiff (pos n✝) 0 = bif true && !false then pos n✝ else 0
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case fn0
α : Type u_1
n✝ : PosNum
⊢ ldiff (pos n✝) 0 = bif true && !false then pos n✝ else 0
[PROOFSTEP]
cases_type* Bool
[GOAL]
case fnn
α : Type u_1
m✝ n✝ : PosNum
⊢ ldiff (pos m✝) (pos n✝) = PosNum.ldiff m✝ n✝
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case fnn
α : Type u_1
m✝ n✝ : PosNum
⊢ ldiff (pos m✝) (pos n✝) = PosNum.ldiff m✝ n✝
[PROOFSTEP]
cases_type* Bool
[GOAL]
case p11
α : Type u_1
⊢ PosNum.ldiff 1 1 = bif true && !true then 1 else 0
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case p11
α : Type u_1
⊢ PosNum.ldiff 1 1 = bif true && !true then 1 else 0
[PROOFSTEP]
cases_type* Bool
[GOAL]
case p1b
α : Type u_1
b✝ : Bool
n✝ : PosNum
⊢ PosNum.ldiff 1 (PosNum.bit b✝ n✝) = bit (true && !b✝) (bif false && !true then pos n✝ else 0)
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case p1b
α : Type u_1
b✝ : Bool
n✝ : PosNum
⊢ PosNum.ldiff 1 (PosNum.bit b✝ n✝) = bit (true && !b✝) (bif false && !true then pos n✝ else 0)
[PROOFSTEP]
cases_type* Bool
[GOAL]
case pb1
α : Type u_1
a✝ : Bool
m✝ : PosNum
⊢ PosNum.ldiff (PosNum.bit a✝ m✝) 1 = bit (a✝ && !true) (bif true && !false then pos m✝ else 0)
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case pb1
α : Type u_1
a✝ : Bool
m✝ : PosNum
⊢ PosNum.ldiff (PosNum.bit a✝ m✝) 1 = bit (a✝ && !true) (bif true && !false then pos m✝ else 0)
[PROOFSTEP]
cases_type* Bool
[GOAL]
case pbb
α : Type u_1
a✝ b✝ : Bool
m✝ n✝ : PosNum
⊢ PosNum.ldiff (PosNum.bit a✝ m✝) (PosNum.bit b✝ n✝) = bit (a✝ && !b✝) (PosNum.ldiff m✝ n✝)
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case pbb
α : Type u_1
a✝ b✝ : Bool
m✝ n✝ : PosNum
⊢ PosNum.ldiff (PosNum.bit a✝ m✝) (PosNum.bit b✝ n✝) = bit (a✝ && !b✝) (PosNum.ldiff m✝ n✝)
[PROOFSTEP]
cases_type* Bool
[GOAL]
case gff
α : Type u_1
⊢ (false && !false) = false
[PROOFSTEP]
rfl
[GOAL]
case f00
α : Type u_1
⊢ ldiff 0 0 = 0
[PROOFSTEP]
rfl
[GOAL]
case f0n
α : Type u_1
n✝ : PosNum
⊢ ldiff 0 (pos n✝) = bif false && !true then pos n✝ else 0
[PROOFSTEP]
rfl
[GOAL]
case fn0
α : Type u_1
n✝ : PosNum
⊢ ldiff (pos n✝) 0 = bif true && !false then pos n✝ else 0
[PROOFSTEP]
rfl
[GOAL]
case fnn
α : Type u_1
m✝ n✝ : PosNum
⊢ ldiff (pos m✝) (pos n✝) = PosNum.ldiff m✝ n✝
[PROOFSTEP]
rfl
[GOAL]
case p11
α : Type u_1
⊢ PosNum.ldiff 1 1 = bif true && !true then 1 else 0
[PROOFSTEP]
rfl
[GOAL]
case p1b.false
α : Type u_1
n✝ : PosNum
⊢ PosNum.ldiff 1 (PosNum.bit false n✝) = bit (true && !false) (bif false && !true then pos n✝ else 0)
[PROOFSTEP]
rfl
[GOAL]
case p1b.true
α : Type u_1
n✝ : PosNum
⊢ PosNum.ldiff 1 (PosNum.bit true n✝) = bit (true && !true) (bif false && !true then pos n✝ else 0)
[PROOFSTEP]
rfl
[GOAL]
case pb1.false
α : Type u_1
m✝ : PosNum
⊢ PosNum.ldiff (PosNum.bit false m✝) 1 = bit (false && !true) (bif true && !false then pos m✝ else 0)
[PROOFSTEP]
rfl
[GOAL]
case pb1.true
α : Type u_1
m✝ : PosNum
⊢ PosNum.ldiff (PosNum.bit true m✝) 1 = bit (true && !true) (bif true && !false then pos m✝ else 0)
[PROOFSTEP]
rfl
[GOAL]
case pbb.false.false
α : Type u_1
m✝ n✝ : PosNum
⊢ PosNum.ldiff (PosNum.bit false m✝) (PosNum.bit false n✝) = bit (false && !false) (PosNum.ldiff m✝ n✝)
[PROOFSTEP]
rfl
[GOAL]
case pbb.false.true
α : Type u_1
m✝ n✝ : PosNum
⊢ PosNum.ldiff (PosNum.bit false m✝) (PosNum.bit true n✝) = bit (false && !true) (PosNum.ldiff m✝ n✝)
[PROOFSTEP]
rfl
[GOAL]
case pbb.true.false
α : Type u_1
m✝ n✝ : PosNum
⊢ PosNum.ldiff (PosNum.bit true m✝) (PosNum.bit false n✝) = bit (true && !false) (PosNum.ldiff m✝ n✝)
[PROOFSTEP]
rfl
[GOAL]
case pbb.true.true
α : Type u_1
m✝ n✝ : PosNum
⊢ PosNum.ldiff (PosNum.bit true m✝) (PosNum.bit true n✝) = bit (true && !true) (PosNum.ldiff m✝ n✝)
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
⊢ ∀ (m n : Num), ↑(lxor m n) = Nat.lxor' ↑m ↑n
[PROOFSTEP]
apply bitwise'_to_nat PosNum.lxor
[GOAL]
case gff
α : Type u_1
⊢ xor false false = false
[PROOFSTEP]
intros
[GOAL]
case f00
α : Type u_1
⊢ lxor 0 0 = 0
[PROOFSTEP]
intros
[GOAL]
case f0n
α : Type u_1
⊢ ∀ (n : PosNum), lxor 0 (pos n) = bif xor false true then pos n else 0
[PROOFSTEP]
intros
[GOAL]
case fn0
α : Type u_1
⊢ ∀ (n : PosNum), lxor (pos n) 0 = bif xor true false then pos n else 0
[PROOFSTEP]
intros
[GOAL]
case fnn
α : Type u_1
⊢ ∀ (m n : PosNum), lxor (pos m) (pos n) = PosNum.lxor m n
[PROOFSTEP]
intros
[GOAL]
case p11
α : Type u_1
⊢ PosNum.lxor 1 1 = bif xor true true then 1 else 0
[PROOFSTEP]
intros
[GOAL]
case p1b
α : Type u_1
⊢ ∀ (b : Bool) (n : PosNum), PosNum.lxor 1 (PosNum.bit b n) = bit (xor true b) (bif xor false true then pos n else 0)
[PROOFSTEP]
intros
[GOAL]
case pb1
α : Type u_1
⊢ ∀ (a : Bool) (m : PosNum), PosNum.lxor (PosNum.bit a m) 1 = bit (xor a true) (bif xor true false then pos m else 0)
[PROOFSTEP]
intros
[GOAL]
case pbb
α : Type u_1
⊢ ∀ (a b : Bool) (m n : PosNum), PosNum.lxor (PosNum.bit a m) (PosNum.bit b n) = bit (xor a b) (PosNum.lxor m n)
[PROOFSTEP]
intros
[GOAL]
case gff
α : Type u_1
⊢ xor false false = false
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case gff
α : Type u_1
⊢ xor false false = false
[PROOFSTEP]
cases_type* Bool
[GOAL]
case f00
α : Type u_1
⊢ lxor 0 0 = 0
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case f00
α : Type u_1
⊢ lxor 0 0 = 0
[PROOFSTEP]
cases_type* Bool
[GOAL]
case f0n
α : Type u_1
n✝ : PosNum
⊢ lxor 0 (pos n✝) = bif xor false true then pos n✝ else 0
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case f0n
α : Type u_1
n✝ : PosNum
⊢ lxor 0 (pos n✝) = bif xor false true then pos n✝ else 0
[PROOFSTEP]
cases_type* Bool
[GOAL]
case fn0
α : Type u_1
n✝ : PosNum
⊢ lxor (pos n✝) 0 = bif xor true false then pos n✝ else 0
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case fn0
α : Type u_1
n✝ : PosNum
⊢ lxor (pos n✝) 0 = bif xor true false then pos n✝ else 0
[PROOFSTEP]
cases_type* Bool
[GOAL]
case fnn
α : Type u_1
m✝ n✝ : PosNum
⊢ lxor (pos m✝) (pos n✝) = PosNum.lxor m✝ n✝
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case fnn
α : Type u_1
m✝ n✝ : PosNum
⊢ lxor (pos m✝) (pos n✝) = PosNum.lxor m✝ n✝
[PROOFSTEP]
cases_type* Bool
[GOAL]
case p11
α : Type u_1
⊢ PosNum.lxor 1 1 = bif xor true true then 1 else 0
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case p11
α : Type u_1
⊢ PosNum.lxor 1 1 = bif xor true true then 1 else 0
[PROOFSTEP]
cases_type* Bool
[GOAL]
case p1b
α : Type u_1
b✝ : Bool
n✝ : PosNum
⊢ PosNum.lxor 1 (PosNum.bit b✝ n✝) = bit (xor true b✝) (bif xor false true then pos n✝ else 0)
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case p1b
α : Type u_1
b✝ : Bool
n✝ : PosNum
⊢ PosNum.lxor 1 (PosNum.bit b✝ n✝) = bit (xor true b✝) (bif xor false true then pos n✝ else 0)
[PROOFSTEP]
cases_type* Bool
[GOAL]
case pb1
α : Type u_1
a✝ : Bool
m✝ : PosNum
⊢ PosNum.lxor (PosNum.bit a✝ m✝) 1 = bit (xor a✝ true) (bif xor true false then pos m✝ else 0)
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case pb1
α : Type u_1
a✝ : Bool
m✝ : PosNum
⊢ PosNum.lxor (PosNum.bit a✝ m✝) 1 = bit (xor a✝ true) (bif xor true false then pos m✝ else 0)
[PROOFSTEP]
cases_type* Bool
[GOAL]
case pbb
α : Type u_1
a✝ b✝ : Bool
m✝ n✝ : PosNum
⊢ PosNum.lxor (PosNum.bit a✝ m✝) (PosNum.bit b✝ n✝) = bit (xor a✝ b✝) (PosNum.lxor m✝ n✝)
[PROOFSTEP]
try cases_type* Bool
[GOAL]
case pbb
α : Type u_1
a✝ b✝ : Bool
m✝ n✝ : PosNum
⊢ PosNum.lxor (PosNum.bit a✝ m✝) (PosNum.bit b✝ n✝) = bit (xor a✝ b✝) (PosNum.lxor m✝ n✝)
[PROOFSTEP]
cases_type* Bool
[GOAL]
case gff
α : Type u_1
⊢ xor false false = false
[PROOFSTEP]
rfl
[GOAL]
case f00
α : Type u_1
⊢ lxor 0 0 = 0
[PROOFSTEP]
rfl
[GOAL]
case f0n
α : Type u_1
n✝ : PosNum
⊢ lxor 0 (pos n✝) = bif xor false true then pos n✝ else 0
[PROOFSTEP]
rfl
[GOAL]
case fn0
α : Type u_1
n✝ : PosNum
⊢ lxor (pos n✝) 0 = bif xor true false then pos n✝ else 0
[PROOFSTEP]
rfl
[GOAL]
case fnn
α : Type u_1
m✝ n✝ : PosNum
⊢ lxor (pos m✝) (pos n✝) = PosNum.lxor m✝ n✝
[PROOFSTEP]
rfl
[GOAL]
case p11
α : Type u_1
⊢ PosNum.lxor 1 1 = bif xor true true then 1 else 0
[PROOFSTEP]
rfl
[GOAL]
case p1b.false
α : Type u_1
n✝ : PosNum
⊢ PosNum.lxor 1 (PosNum.bit false n✝) = bit (xor true false) (bif xor false true then pos n✝ else 0)
[PROOFSTEP]
rfl
[GOAL]
case p1b.true
α : Type u_1
n✝ : PosNum
⊢ PosNum.lxor 1 (PosNum.bit true n✝) = bit (xor true true) (bif xor false true then pos n✝ else 0)
[PROOFSTEP]
rfl
[GOAL]
case pb1.false
α : Type u_1
m✝ : PosNum
⊢ PosNum.lxor (PosNum.bit false m✝) 1 = bit (xor false true) (bif xor true false then pos m✝ else 0)
[PROOFSTEP]
rfl
[GOAL]
case pb1.true
α : Type u_1
m✝ : PosNum
⊢ PosNum.lxor (PosNum.bit true m✝) 1 = bit (xor true true) (bif xor true false then pos m✝ else 0)
[PROOFSTEP]
rfl
[GOAL]
case pbb.false.false
α : Type u_1
m✝ n✝ : PosNum
⊢ PosNum.lxor (PosNum.bit false m✝) (PosNum.bit false n✝) = bit (xor false false) (PosNum.lxor m✝ n✝)
[PROOFSTEP]
rfl
[GOAL]
case pbb.false.true
α : Type u_1
m✝ n✝ : PosNum
⊢ PosNum.lxor (PosNum.bit false m✝) (PosNum.bit true n✝) = bit (xor false true) (PosNum.lxor m✝ n✝)
[PROOFSTEP]
rfl
[GOAL]
case pbb.true.false
α : Type u_1
m✝ n✝ : PosNum
⊢ PosNum.lxor (PosNum.bit true m✝) (PosNum.bit false n✝) = bit (xor true false) (PosNum.lxor m✝ n✝)
[PROOFSTEP]
rfl
[GOAL]
case pbb.true.true
α : Type u_1
m✝ n✝ : PosNum
⊢ PosNum.lxor (PosNum.bit true m✝) (PosNum.bit true n✝) = bit (xor true true) (PosNum.lxor m✝ n✝)
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
m : Num
n : ℕ
⊢ ↑(shiftl m n) = Nat.shiftl (↑m) n
[PROOFSTEP]
cases m
[GOAL]
case zero
α : Type u_1
n : ℕ
⊢ ↑(shiftl zero n) = Nat.shiftl (↑zero) n
[PROOFSTEP]
dsimp only [shiftl]
[GOAL]
case pos
α : Type u_1
n : ℕ
a✝ : PosNum
⊢ ↑(shiftl (pos a✝) n) = Nat.shiftl (↑(pos a✝)) n
[PROOFSTEP]
dsimp only [shiftl]
[GOAL]
case zero
α : Type u_1
n : ℕ
⊢ ↑0 = Nat.shiftl (↑zero) n
[PROOFSTEP]
symm
[GOAL]
case zero
α : Type u_1
n : ℕ
⊢ Nat.shiftl (↑zero) n = ↑0
[PROOFSTEP]
apply Nat.zero_shiftl
[GOAL]
case pos
α : Type u_1
n : ℕ
a✝ : PosNum
⊢ ↑(pos (PosNum.shiftl a✝ n)) = Nat.shiftl (↑(pos a✝)) n
[PROOFSTEP]
simp only [cast_pos]
[GOAL]
case pos
α : Type u_1
n : ℕ
a✝ : PosNum
⊢ ↑(PosNum.shiftl a✝ n) = Nat.shiftl (↑a✝) n
[PROOFSTEP]
induction' n with n IH
[GOAL]
case pos.zero
α : Type u_1
a✝ : PosNum
⊢ ↑(PosNum.shiftl a✝ Nat.zero) = Nat.shiftl (↑a✝) Nat.zero
[PROOFSTEP]
rfl
[GOAL]
case pos.succ
α : Type u_1
a✝ : PosNum
n : ℕ
IH : ↑(PosNum.shiftl a✝ n) = Nat.shiftl (↑a✝) n
⊢ ↑(PosNum.shiftl a✝ (Nat.succ n)) = Nat.shiftl (↑a✝) (Nat.succ n)
[PROOFSTEP]
simp [PosNum.shiftl_succ_eq_bit0_shiftl, Nat.shiftl_succ, IH]
[GOAL]
α : Type u_1
m : Num
n : ℕ
⊢ ↑(shiftr m n) = Nat.shiftr (↑m) n
[PROOFSTEP]
cases' m with m
[GOAL]
case zero
α : Type u_1
n : ℕ
⊢ ↑(shiftr zero n) = Nat.shiftr (↑zero) n
[PROOFSTEP]
dsimp only [shiftr]
[GOAL]
case pos
α : Type u_1
n : ℕ
m : PosNum
⊢ ↑(shiftr (pos m) n) = Nat.shiftr (↑(pos m)) n
[PROOFSTEP]
dsimp only [shiftr]
[GOAL]
case zero
α : Type u_1
n : ℕ
⊢ ↑0 = Nat.shiftr (↑zero) n
[PROOFSTEP]
symm
[GOAL]
case zero
α : Type u_1
n : ℕ
⊢ Nat.shiftr (↑zero) n = ↑0
[PROOFSTEP]
apply Nat.zero_shiftr
[GOAL]
case pos
α : Type u_1
n : ℕ
m : PosNum
⊢ ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
[PROOFSTEP]
induction' n with n IH generalizing m
[GOAL]
case pos.zero
α : Type u_1
m✝ m : PosNum
⊢ ↑(PosNum.shiftr m Nat.zero) = Nat.shiftr (↑(pos m)) Nat.zero
[PROOFSTEP]
cases m
[GOAL]
case pos.zero.one
α : Type u_1
m : PosNum
⊢ ↑(PosNum.shiftr one Nat.zero) = Nat.shiftr (↑(pos one)) Nat.zero
[PROOFSTEP]
rfl
[GOAL]
case pos.zero.bit1
α : Type u_1
m a✝ : PosNum
⊢ ↑(PosNum.shiftr (PosNum.bit1 a✝) Nat.zero) = Nat.shiftr (↑(pos (PosNum.bit1 a✝))) Nat.zero
[PROOFSTEP]
rfl
[GOAL]
case pos.zero.bit0
α : Type u_1
m a✝ : PosNum
⊢ ↑(PosNum.shiftr (PosNum.bit0 a✝) Nat.zero) = Nat.shiftr (↑(pos (PosNum.bit0 a✝))) Nat.zero
[PROOFSTEP]
rfl
[GOAL]
case pos.succ
α : Type u_1
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)
[PROOFSTEP]
cases' m with m m
[GOAL]
case pos.succ.one
α : Type u_1
m : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
⊢ ↑(PosNum.shiftr one (Nat.succ n)) = Nat.shiftr (↑(pos one)) (Nat.succ n)
[PROOFSTEP]
dsimp only [PosNum.shiftr]
[GOAL]
case pos.succ.bit1
α : Type u_1
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ ↑(PosNum.shiftr (PosNum.bit1 m) (Nat.succ n)) = Nat.shiftr (↑(pos (PosNum.bit1 m))) (Nat.succ n)
[PROOFSTEP]
dsimp only [PosNum.shiftr]
[GOAL]
case pos.succ.bit0
α : Type u_1
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ ↑(PosNum.shiftr (PosNum.bit0 m) (Nat.succ n)) = Nat.shiftr (↑(pos (PosNum.bit0 m))) (Nat.succ n)
[PROOFSTEP]
dsimp only [PosNum.shiftr]
[GOAL]
case pos.succ.one
α : Type u_1
m : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
⊢ ↑0 = Nat.shiftr (↑(pos one)) (Nat.succ n)
[PROOFSTEP]
rw [Nat.shiftr_eq_div_pow]
[GOAL]
case pos.succ.one
α : Type u_1
m : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
⊢ ↑0 = ↑(pos one) / 2 ^ Nat.succ n
[PROOFSTEP]
symm
[GOAL]
case pos.succ.one
α : Type u_1
m : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
⊢ ↑(pos one) / 2 ^ Nat.succ n = ↑0
[PROOFSTEP]
apply Nat.div_eq_of_lt
[GOAL]
case pos.succ.one.h₀
α : Type u_1
m : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
⊢ ↑(pos one) < 2 ^ Nat.succ n
[PROOFSTEP]
exact @Nat.pow_lt_pow_of_lt_right 2 (by decide) 0 (n + 1) (Nat.succ_pos _)
[GOAL]
α : Type u_1
m : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
⊢ 1 < 2
[PROOFSTEP]
decide
[GOAL]
case pos.succ.bit1
α : Type u_1
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)
[PROOFSTEP]
trans
[GOAL]
α : Type u_1
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ ↑(PosNum.shiftr m n) = ?m.648288
α : Type u_1
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ ?m.648288 = Nat.shiftr (↑(pos (PosNum.bit1 m))) (Nat.succ n)
α : Type u_1 m✝ : PosNum n : ℕ IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n m : PosNum ⊢ ℕ
[PROOFSTEP]
apply IH
[GOAL]
α : Type u_1
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)
[PROOFSTEP]
change Nat.shiftr m n = Nat.shiftr (_root_.bit1 m) (n + 1)
[GOAL]
α : Type u_1
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)
[PROOFSTEP]
rw [add_comm n 1, Nat.shiftr_add]
[GOAL]
α : Type u_1
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
[PROOFSTEP]
apply congr_arg fun x => Nat.shiftr x n
[GOAL]
α : Type u_1
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ ↑m = Nat.shiftr (_root_.bit1 ↑m) 1
[PROOFSTEP]
repeat unfold Nat.shiftr
[GOAL]
α : Type u_1
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ ↑m = Nat.shiftr (_root_.bit1 ↑m) 1
[PROOFSTEP]
unfold Nat.shiftr
[GOAL]
α : Type u_1
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ ↑m = Nat.div2 (Nat.shiftr (_root_.bit1 ↑m) 0)
[PROOFSTEP]
unfold Nat.shiftr
[GOAL]
α : Type u_1
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ ↑m = Nat.div2 (_root_.bit1 ↑m)
[PROOFSTEP]
unfold Nat.shiftr
[GOAL]
α : Type u_1
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ ↑m = Nat.div2 (_root_.bit1 ↑m)
[PROOFSTEP]
change (m : ℕ) = Nat.div2 (Nat.bit true m)
[GOAL]
α : Type u_1
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ ↑m = Nat.div2 (Nat.bit true ↑m)
[PROOFSTEP]
rw [Nat.div2_bit]
[GOAL]
case pos.succ.bit0
α : Type u_1
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)
[PROOFSTEP]
trans
[GOAL]
α : Type u_1
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ ↑(PosNum.shiftr m n) = ?m.652080
α : Type u_1
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ ?m.652080 = Nat.shiftr (↑(pos (PosNum.bit0 m))) (Nat.succ n)
α : Type u_1 m✝ : PosNum n : ℕ IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n m : PosNum ⊢ ℕ
[PROOFSTEP]
apply IH
[GOAL]
α : Type u_1
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)
[PROOFSTEP]
change Nat.shiftr m n = Nat.shiftr (_root_.bit0 m) (n + 1)
[GOAL]
α : Type u_1
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)
[PROOFSTEP]
rw [add_comm n 1, Nat.shiftr_add]
[GOAL]
α : Type u_1
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
[PROOFSTEP]
apply congr_arg fun x => Nat.shiftr x n
[GOAL]
α : Type u_1
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ ↑m = Nat.shiftr (_root_.bit0 ↑m) 1
[PROOFSTEP]
repeat unfold Nat.shiftr
[GOAL]
α : Type u_1
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ ↑m = Nat.shiftr (_root_.bit0 ↑m) 1
[PROOFSTEP]
unfold Nat.shiftr
[GOAL]
α : Type u_1
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ ↑m = Nat.div2 (Nat.shiftr (_root_.bit0 ↑m) 0)
[PROOFSTEP]
unfold Nat.shiftr
[GOAL]
α : Type u_1
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ ↑m = Nat.div2 (_root_.bit0 ↑m)
[PROOFSTEP]
unfold Nat.shiftr
[GOAL]
α : Type u_1
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ ↑m = Nat.div2 (_root_.bit0 ↑m)
[PROOFSTEP]
change (m : ℕ) = Nat.div2 (Nat.bit false m)
[GOAL]
α : Type u_1
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), ↑(PosNum.shiftr m n) = Nat.shiftr (↑(pos m)) n
m : PosNum
⊢ ↑m = Nat.div2 (Nat.bit false ↑m)
[PROOFSTEP]
rw [Nat.div2_bit]
[GOAL]
α : Type u_1
m : Num
n : ℕ
⊢ testBit m n = Nat.testBit (↑m) n
[PROOFSTEP]
cases m
[GOAL]
case zero
α : Type u_1
n : ℕ
⊢ testBit zero n = Nat.testBit (↑zero) n
[PROOFSTEP]
dsimp only [testBit, Nat.testBit]
[GOAL]
case pos
α : Type u_1
n : ℕ
a✝ : PosNum
⊢ testBit (pos a✝) n = Nat.testBit (↑(pos a✝)) n
[PROOFSTEP]
dsimp only [testBit, Nat.testBit]
[GOAL]
case zero
α : Type u_1
n : ℕ
⊢ false = Nat.bodd (Nat.shiftr (↑zero) n)
case pos α : Type u_1 n : ℕ a✝ : PosNum ⊢ PosNum.testBit a✝ n = Nat.bodd (Nat.shiftr (↑(pos a✝)) n)
[PROOFSTEP]
case zero =>
  change false = Nat.bodd (Nat.shiftr 0 n)
  rw [Nat.zero_shiftr]
  rfl
[GOAL]
α : Type u_1
n : ℕ
⊢ false = Nat.bodd (Nat.shiftr (↑zero) n)
[PROOFSTEP]
case zero =>
  change false = Nat.bodd (Nat.shiftr 0 n)
  rw [Nat.zero_shiftr]
  rfl
[GOAL]
α : Type u_1
n : ℕ
⊢ false = Nat.bodd (Nat.shiftr (↑zero) n)
[PROOFSTEP]
change false = Nat.bodd (Nat.shiftr 0 n)
[GOAL]
α : Type u_1
n : ℕ
⊢ false = Nat.bodd (Nat.shiftr 0 n)
[PROOFSTEP]
rw [Nat.zero_shiftr]
[GOAL]
α : Type u_1
n : ℕ
⊢ false = Nat.bodd 0
[PROOFSTEP]
rfl
[GOAL]
case pos
α : Type u_1
n : ℕ
a✝ : PosNum
⊢ PosNum.testBit a✝ n = Nat.bodd (Nat.shiftr (↑(pos a✝)) n)
[PROOFSTEP]
case pos m =>
  induction' n with n IH generalizing m <;> cases' m with m m <;> dsimp only [PosNum.testBit]
  · rfl
  · exact (Nat.bodd_bit _ _).symm
  · exact (Nat.bodd_bit _ _).symm
  · change false = Nat.bodd (Nat.shiftr 1 (n + 1))
    rw [add_comm, Nat.shiftr_add]
    change false = Nat.bodd (Nat.shiftr 0 n)
    rw [Nat.zero_shiftr]; rfl
  · change PosNum.testBit m n = Nat.bodd (Nat.shiftr (Nat.bit true m) (n + 1))
    rw [add_comm, Nat.shiftr_add]
    dsimp only [Nat.shiftr]
    rw [Nat.div2_bit]
    apply IH
  · change PosNum.testBit m n = Nat.bodd (Nat.shiftr (Nat.bit false m) (n + 1))
    rw [add_comm, Nat.shiftr_add]
    dsimp only [Nat.shiftr]
    rw [Nat.div2_bit]
    apply IH
[GOAL]
α : Type u_1
n : ℕ
m : PosNum
⊢ PosNum.testBit m n = Nat.bodd (Nat.shiftr (↑(pos m)) n)
[PROOFSTEP]
case pos m =>
  induction' n with n IH generalizing m <;> cases' m with m m <;> dsimp only [PosNum.testBit]
  · rfl
  · exact (Nat.bodd_bit _ _).symm
  · exact (Nat.bodd_bit _ _).symm
  · change false = Nat.bodd (Nat.shiftr 1 (n + 1))
    rw [add_comm, Nat.shiftr_add]
    change false = Nat.bodd (Nat.shiftr 0 n)
    rw [Nat.zero_shiftr]; rfl
  · change PosNum.testBit m n = Nat.bodd (Nat.shiftr (Nat.bit true m) (n + 1))
    rw [add_comm, Nat.shiftr_add]
    dsimp only [Nat.shiftr]
    rw [Nat.div2_bit]
    apply IH
  · change PosNum.testBit m n = Nat.bodd (Nat.shiftr (Nat.bit false m) (n + 1))
    rw [add_comm, Nat.shiftr_add]
    dsimp only [Nat.shiftr]
    rw [Nat.div2_bit]
    apply IH
[GOAL]
α : Type u_1
n : ℕ
m : PosNum
⊢ PosNum.testBit m n = Nat.bodd (Nat.shiftr (↑(pos m)) n)
[PROOFSTEP]
induction' n with n IH generalizing m
[GOAL]
case zero
α : Type u_1
m✝ m : PosNum
⊢ PosNum.testBit m Nat.zero = Nat.bodd (Nat.shiftr (↑(pos m)) Nat.zero)
[PROOFSTEP]
cases' m with m m
[GOAL]
case succ
α : Type u_1
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), PosNum.testBit m n = Nat.bodd (Nat.shiftr (↑(pos m)) n)
m : PosNum
⊢ PosNum.testBit m (Nat.succ n) = Nat.bodd (Nat.shiftr (↑(pos m)) (Nat.succ n))
[PROOFSTEP]
cases' m with m m
[GOAL]
case zero.one
α : Type u_1
m : PosNum
⊢ PosNum.testBit one Nat.zero = Nat.bodd (Nat.shiftr (↑(pos one)) Nat.zero)
[PROOFSTEP]
dsimp only [PosNum.testBit]
[GOAL]
case zero.bit1
α : Type u_1
m✝ m : PosNum
⊢ PosNum.testBit (PosNum.bit1 m) Nat.zero = Nat.bodd (Nat.shiftr (↑(pos (PosNum.bit1 m))) Nat.zero)
[PROOFSTEP]
dsimp only [PosNum.testBit]
[GOAL]
case zero.bit0
α : Type u_1
m✝ m : PosNum
⊢ PosNum.testBit (PosNum.bit0 m) Nat.zero = Nat.bodd (Nat.shiftr (↑(pos (PosNum.bit0 m))) Nat.zero)
[PROOFSTEP]
dsimp only [PosNum.testBit]
[GOAL]
case succ.one
α : Type u_1
m : PosNum
n : ℕ
IH : ∀ (m : PosNum), PosNum.testBit m n = Nat.bodd (Nat.shiftr (↑(pos m)) n)
⊢ PosNum.testBit one (Nat.succ n) = Nat.bodd (Nat.shiftr (↑(pos one)) (Nat.succ n))
[PROOFSTEP]
dsimp only [PosNum.testBit]
[GOAL]
case succ.bit1
α : Type u_1
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), PosNum.testBit m n = Nat.bodd (Nat.shiftr (↑(pos m)) n)
m : PosNum
⊢ PosNum.testBit (PosNum.bit1 m) (Nat.succ n) = Nat.bodd (Nat.shiftr (↑(pos (PosNum.bit1 m))) (Nat.succ n))
[PROOFSTEP]
dsimp only [PosNum.testBit]
[GOAL]
case succ.bit0
α : Type u_1
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), PosNum.testBit m n = Nat.bodd (Nat.shiftr (↑(pos m)) n)
m : PosNum
⊢ PosNum.testBit (PosNum.bit0 m) (Nat.succ n) = Nat.bodd (Nat.shiftr (↑(pos (PosNum.bit0 m))) (Nat.succ n))
[PROOFSTEP]
dsimp only [PosNum.testBit]
[GOAL]
case zero.one
α : Type u_1
m : PosNum
⊢ true = Nat.bodd (Nat.shiftr (↑(pos one)) Nat.zero)
[PROOFSTEP]
rfl
[GOAL]
case zero.bit1
α : Type u_1
m✝ m : PosNum
⊢ true = Nat.bodd (Nat.shiftr (↑(pos (PosNum.bit1 m))) Nat.zero)
[PROOFSTEP]
exact (Nat.bodd_bit _ _).symm
[GOAL]
case zero.bit0
α : Type u_1
m✝ m : PosNum
⊢ false = Nat.bodd (Nat.shiftr (↑(pos (PosNum.bit0 m))) Nat.zero)
[PROOFSTEP]
exact (Nat.bodd_bit _ _).symm
[GOAL]
case succ.one
α : Type u_1
m : PosNum
n : ℕ
IH : ∀ (m : PosNum), PosNum.testBit m n = Nat.bodd (Nat.shiftr (↑(pos m)) n)
⊢ false = Nat.bodd (Nat.shiftr (↑(pos one)) (Nat.succ n))
[PROOFSTEP]
change false = Nat.bodd (Nat.shiftr 1 (n + 1))
[GOAL]
case succ.one
α : Type u_1
m : PosNum
n : ℕ
IH : ∀ (m : PosNum), PosNum.testBit m n = Nat.bodd (Nat.shiftr (↑(pos m)) n)
⊢ false = Nat.bodd (Nat.shiftr 1 (n + 1))
[PROOFSTEP]
rw [add_comm, Nat.shiftr_add]
[GOAL]
case succ.one
α : Type u_1
m : PosNum
n : ℕ
IH : ∀ (m : PosNum), PosNum.testBit m n = Nat.bodd (Nat.shiftr (↑(pos m)) n)
⊢ false = Nat.bodd (Nat.shiftr (Nat.shiftr 1 1) n)
[PROOFSTEP]
change false = Nat.bodd (Nat.shiftr 0 n)
[GOAL]
case succ.one
α : Type u_1
m : PosNum
n : ℕ
IH : ∀ (m : PosNum), PosNum.testBit m n = Nat.bodd (Nat.shiftr (↑(pos m)) n)
⊢ false = Nat.bodd (Nat.shiftr 0 n)
[PROOFSTEP]
rw [Nat.zero_shiftr]
[GOAL]
case succ.one
α : Type u_1
m : PosNum
n : ℕ
IH : ∀ (m : PosNum), PosNum.testBit m n = Nat.bodd (Nat.shiftr (↑(pos m)) n)
⊢ false = Nat.bodd 0
[PROOFSTEP]
rfl
[GOAL]
case succ.bit1
α : Type u_1
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), PosNum.testBit m n = Nat.bodd (Nat.shiftr (↑(pos m)) n)
m : PosNum
⊢ PosNum.testBit m n = Nat.bodd (Nat.shiftr (↑(pos (PosNum.bit1 m))) (Nat.succ n))
[PROOFSTEP]
change PosNum.testBit m n = Nat.bodd (Nat.shiftr (Nat.bit true m) (n + 1))
[GOAL]
case succ.bit1
α : Type u_1
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), PosNum.testBit m n = Nat.bodd (Nat.shiftr (↑(pos m)) n)
m : PosNum
⊢ PosNum.testBit m n = Nat.bodd (Nat.shiftr (Nat.bit true ↑m) (n + 1))
[PROOFSTEP]
rw [add_comm, Nat.shiftr_add]
[GOAL]
case succ.bit1
α : Type u_1
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), PosNum.testBit m n = Nat.bodd (Nat.shiftr (↑(pos m)) n)
m : PosNum
⊢ PosNum.testBit m n = Nat.bodd (Nat.shiftr (Nat.shiftr (Nat.bit true ↑m) 1) n)
[PROOFSTEP]
dsimp only [Nat.shiftr]
[GOAL]
case succ.bit1
α : Type u_1
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), PosNum.testBit m n = Nat.bodd (Nat.shiftr (↑(pos m)) n)
m : PosNum
⊢ PosNum.testBit m n = Nat.bodd (Nat.shiftr (Nat.div2 (Nat.bit true ↑m)) n)
[PROOFSTEP]
rw [Nat.div2_bit]
[GOAL]
case succ.bit1
α : Type u_1
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), PosNum.testBit m n = Nat.bodd (Nat.shiftr (↑(pos m)) n)
m : PosNum
⊢ PosNum.testBit m n = Nat.bodd (Nat.shiftr (↑m) n)
[PROOFSTEP]
apply IH
[GOAL]
case succ.bit0
α : Type u_1
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), PosNum.testBit m n = Nat.bodd (Nat.shiftr (↑(pos m)) n)
m : PosNum
⊢ PosNum.testBit m n = Nat.bodd (Nat.shiftr (↑(pos (PosNum.bit0 m))) (Nat.succ n))
[PROOFSTEP]
change PosNum.testBit m n = Nat.bodd (Nat.shiftr (Nat.bit false m) (n + 1))
[GOAL]
case succ.bit0
α : Type u_1
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), PosNum.testBit m n = Nat.bodd (Nat.shiftr (↑(pos m)) n)
m : PosNum
⊢ PosNum.testBit m n = Nat.bodd (Nat.shiftr (Nat.bit false ↑m) (n + 1))
[PROOFSTEP]
rw [add_comm, Nat.shiftr_add]
[GOAL]
case succ.bit0
α : Type u_1
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), PosNum.testBit m n = Nat.bodd (Nat.shiftr (↑(pos m)) n)
m : PosNum
⊢ PosNum.testBit m n = Nat.bodd (Nat.shiftr (Nat.shiftr (Nat.bit false ↑m) 1) n)
[PROOFSTEP]
dsimp only [Nat.shiftr]
[GOAL]
case succ.bit0
α : Type u_1
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), PosNum.testBit m n = Nat.bodd (Nat.shiftr (↑(pos m)) n)
m : PosNum
⊢ PosNum.testBit m n = Nat.bodd (Nat.shiftr (Nat.div2 (Nat.bit false ↑m)) n)
[PROOFSTEP]
rw [Nat.div2_bit]
[GOAL]
case succ.bit0
α : Type u_1
m✝ : PosNum
n : ℕ
IH : ∀ (m : PosNum), PosNum.testBit m n = Nat.bodd (Nat.shiftr (↑(pos m)) n)
m : PosNum
⊢ PosNum.testBit m n = Nat.bodd (Nat.shiftr (↑m) n)
[PROOFSTEP]
apply IH
[GOAL]
α : Type u_1
n : ZNum
⊢ - -n = n
[PROOFSTEP]
cases n
[GOAL]
case zero
α : Type u_1
⊢ - -zero = zero
[PROOFSTEP]
rfl
[GOAL]
case pos
α : Type u_1
a✝ : PosNum
⊢ - -pos a✝ = pos a✝
[PROOFSTEP]
rfl
[GOAL]
case neg
α : Type u_1
a✝ : PosNum
⊢ - -neg a✝ = neg a✝
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
n : ZNum
⊢ -ZNum.bit1 n = ZNum.bitm1 (-n)
[PROOFSTEP]
cases n
[GOAL]
case zero
α : Type u_1
⊢ -ZNum.bit1 zero = ZNum.bitm1 (-zero)
[PROOFSTEP]
rfl
[GOAL]
case pos
α : Type u_1
a✝ : PosNum
⊢ -ZNum.bit1 (pos a✝) = ZNum.bitm1 (-pos a✝)
[PROOFSTEP]
rfl
[GOAL]
case neg
α : Type u_1
a✝ : PosNum
⊢ -ZNum.bit1 (neg a✝) = ZNum.bitm1 (-neg a✝)
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
n : ZNum
⊢ -ZNum.bitm1 n = ZNum.bit1 (-n)
[PROOFSTEP]
cases n
[GOAL]
case zero
α : Type u_1
⊢ -ZNum.bitm1 zero = ZNum.bit1 (-zero)
[PROOFSTEP]
rfl
[GOAL]
case pos
α : Type u_1
a✝ : PosNum
⊢ -ZNum.bitm1 (pos a✝) = ZNum.bit1 (-pos a✝)
[PROOFSTEP]
rfl
[GOAL]
case neg
α : Type u_1
a✝ : PosNum
⊢ -ZNum.bitm1 (neg a✝) = ZNum.bit1 (-neg a✝)
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
n : ZNum
⊢ -succ n = pred (-n)
[PROOFSTEP]
cases n
[GOAL]
case zero
α : Type u_1
⊢ -succ zero = pred (-zero)
[PROOFSTEP]
try {rfl
}
[GOAL]
case zero
α : Type u_1
⊢ -succ zero = pred (-zero)
[PROOFSTEP]
{rfl
}
[GOAL]
case zero
α : Type u_1
⊢ -succ zero = pred (-zero)
[PROOFSTEP]
rfl
[GOAL]
case pos
α : Type u_1
a✝ : PosNum
⊢ -succ (pos a✝) = pred (-pos a✝)
[PROOFSTEP]
try {rfl
}
[GOAL]
case pos
α : Type u_1
a✝ : PosNum
⊢ -succ (pos a✝) = pred (-pos a✝)
[PROOFSTEP]
{rfl
}
[GOAL]
case pos
α : Type u_1
a✝ : PosNum
⊢ -succ (pos a✝) = pred (-pos a✝)
[PROOFSTEP]
rfl
[GOAL]
case neg
α : Type u_1
a✝ : PosNum
⊢ -succ (neg a✝) = pred (-neg a✝)
[PROOFSTEP]
try {rfl
}
[GOAL]
case neg
α : Type u_1
a✝ : PosNum
⊢ -succ (neg a✝) = pred (-neg a✝)
[PROOFSTEP]
{rfl
}
[GOAL]
case neg
α : Type u_1
a✝ : PosNum
⊢ -succ (neg a✝) = pred (-neg a✝)
[PROOFSTEP]
rfl
[GOAL]
case neg
α : Type u_1
a✝ : PosNum
⊢ -succ (neg a✝) = pred (-neg a✝)
[PROOFSTEP]
rw [succ, Num.zneg_toZNumNeg]
[GOAL]
case neg
α : Type u_1
a✝ : PosNum
⊢ Num.toZNum (pred' a✝) = pred (-neg a✝)
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
n : ZNum
⊢ -pred n = succ (-n)
[PROOFSTEP]
rw [← zneg_zneg (succ (-n)), zneg_succ, zneg_zneg]
[GOAL]
α : Type u_1
p : PosNum
⊢ natAbs ↑↑p = natAbs (-↑p)
[PROOFSTEP]
rw [p.to_nat_to_int, Int.natAbs_neg]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
⊢ ↑↑0 = ↑0
[PROOFSTEP]
rw [cast_zero, cast_zero, Int.cast_zero]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
p : PosNum
⊢ ↑↑(pos p) = ↑(pos p)
[PROOFSTEP]
rw [cast_pos, cast_pos, PosNum.cast_to_int]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
p : PosNum
⊢ ↑↑(neg p) = ↑(neg p)
[PROOFSTEP]
rw [cast_neg, cast_neg, Int.cast_neg, PosNum.cast_to_int]
[GOAL]
α : Type u_1
a : PosNum
⊢ sub' 1 (_root_.bit0 a) = ZNum.bit1 (neg a)
[PROOFSTEP]
rw [PosNum.one_sub', a.bit0_of_bit0]
[GOAL]
α : Type u_1
a : PosNum
⊢ Num.toZNumNeg (pred' (PosNum.bit0 a)) = ZNum.bit1 (neg a)
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
p : PosNum
⊢ ↑(ZNum.bit0 (pos p)) = _root_.bit0 ↑(pos p)
[PROOFSTEP]
rw [ZNum.bit0, cast_pos, cast_pos]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
p : PosNum
⊢ ↑(PosNum.bit0 p) = _root_.bit0 ↑p
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
p : PosNum
⊢ ↑(ZNum.bit0 (neg p)) = _root_.bit0 ↑(neg p)
[PROOFSTEP]
rw [ZNum.bit0, cast_neg, cast_neg, PosNum.cast_bit0, _root_.bit0, _root_.bit0, neg_add_rev]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
⊢ ↑(ZNum.bit1 0) = _root_.bit1 ↑0
[PROOFSTEP]
simp [ZNum.bit1, _root_.bit1, _root_.bit0]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
p : PosNum
⊢ ↑(ZNum.bit1 (pos p)) = _root_.bit1 ↑(pos p)
[PROOFSTEP]
rw [ZNum.bit1, cast_pos, cast_pos]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
p : PosNum
⊢ ↑(PosNum.bit1 p) = _root_.bit1 ↑p
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
p : PosNum
⊢ ↑(ZNum.bit1 (neg p)) = _root_.bit1 ↑(neg p)
[PROOFSTEP]
rw [ZNum.bit1, cast_neg, cast_neg]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
p : PosNum
⊢ -↑(Num.casesOn (pred' p) 1 PosNum.bit1) = _root_.bit1 (-↑p)
[PROOFSTEP]
cases' e : pred' p with a
[GOAL]
case zero
α : Type u_1
inst✝ : AddGroupWithOne α
p : PosNum
e : pred' p = Num.zero
⊢ -↑(Num.casesOn Num.zero 1 PosNum.bit1) = _root_.bit1 (-↑p)
[PROOFSTEP]
have ep : p = _ := (succ'_pred' p).symm.trans (congr_arg Num.succ' e)
[GOAL]
case pos
α : Type u_1
inst✝ : AddGroupWithOne α
p a : PosNum
e : pred' p = Num.pos a
⊢ -↑(Num.casesOn (Num.pos a) 1 PosNum.bit1) = _root_.bit1 (-↑p)
[PROOFSTEP]
have ep : p = _ := (succ'_pred' p).symm.trans (congr_arg Num.succ' e)
[GOAL]
case zero
α : Type u_1
inst✝ : AddGroupWithOne α
p : PosNum
e : pred' p = Num.zero
ep : p = Num.succ' Num.zero
⊢ -↑(Num.casesOn Num.zero 1 PosNum.bit1) = _root_.bit1 (-↑p)
[PROOFSTEP]
conv at ep => change p = 1
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
p : PosNum
e : pred' p = Num.zero
ep : p = Num.succ' Num.zero
| p = Num.succ' Num.zero
[PROOFSTEP]
change p = 1
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
p : PosNum
e : pred' p = Num.zero
ep : p = Num.succ' Num.zero
| p = Num.succ' Num.zero
[PROOFSTEP]
change p = 1
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
p : PosNum
e : pred' p = Num.zero
ep : p = Num.succ' Num.zero
| p = Num.succ' Num.zero
[PROOFSTEP]
change p = 1
[GOAL]
case zero
α : Type u_1
inst✝ : AddGroupWithOne α
p : PosNum
e : pred' p = Num.zero
ep : p = 1
⊢ -↑(Num.casesOn Num.zero 1 PosNum.bit1) = _root_.bit1 (-↑p)
[PROOFSTEP]
subst p
[GOAL]
case zero
α : Type u_1
inst✝ : AddGroupWithOne α
e : pred' 1 = Num.zero
⊢ -↑(Num.casesOn Num.zero 1 PosNum.bit1) = _root_.bit1 (-↑1)
[PROOFSTEP]
simp [_root_.bit1, _root_.bit0]
  -- Porting note: `rw [Num.succ']` yields a `match` pattern.
[GOAL]
case pos
α : Type u_1
inst✝ : AddGroupWithOne α
p a : PosNum
e : pred' p = Num.pos a
ep : p = Num.succ' (Num.pos a)
⊢ -↑(Num.casesOn (Num.pos a) 1 PosNum.bit1) = _root_.bit1 (-↑p)
[PROOFSTEP]
dsimp only [Num.succ'] at ep 
[GOAL]
case pos
α : Type u_1
inst✝ : AddGroupWithOne α
p a : PosNum
e : pred' p = Num.pos a
ep : p = PosNum.succ a
⊢ -↑(Num.casesOn (Num.pos a) 1 PosNum.bit1) = _root_.bit1 (-↑p)
[PROOFSTEP]
subst p
[GOAL]
case pos
α : Type u_1
inst✝ : AddGroupWithOne α
a : PosNum
e : pred' (PosNum.succ a) = Num.pos a
⊢ -↑(Num.casesOn (Num.pos a) 1 PosNum.bit1) = _root_.bit1 (-↑(PosNum.succ a))
[PROOFSTEP]
have : (↑(-↑a : ℤ) : α) = -1 + ↑(-↑a + 1 : ℤ) := by simp [add_comm (-↑a : ℤ) 1]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
a : PosNum
e : pred' (PosNum.succ a) = Num.pos a
⊢ ↑(-↑a) = -1 + ↑(-↑a + 1)
[PROOFSTEP]
simp [add_comm (-↑a : ℤ) 1]
[GOAL]
case pos
α : Type u_1
inst✝ : AddGroupWithOne α
a : PosNum
e : pred' (PosNum.succ a) = Num.pos a
this : ↑(-↑a) = -1 + ↑(-↑a + 1)
⊢ -↑(Num.casesOn (Num.pos a) 1 PosNum.bit1) = _root_.bit1 (-↑(PosNum.succ a))
[PROOFSTEP]
simpa [_root_.bit1, _root_.bit0] using this
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
n : ZNum
⊢ ↑(ZNum.bitm1 n) = _root_.bit0 ↑n - 1
[PROOFSTEP]
conv =>
  lhs
  rw [← zneg_zneg n]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
n : ZNum
| ↑(ZNum.bitm1 n) = _root_.bit0 ↑n - 1
[PROOFSTEP]
  lhs
  rw [← zneg_zneg n]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
n : ZNum
| ↑(ZNum.bitm1 n) = _root_.bit0 ↑n - 1
[PROOFSTEP]
  lhs
  rw [← zneg_zneg n]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
n : ZNum
| ↑(ZNum.bitm1 n) = _root_.bit0 ↑n - 1
[PROOFSTEP]
lhs
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
n : ZNum
| ↑(ZNum.bitm1 n)
[PROOFSTEP]
rw [← zneg_zneg n]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
n : ZNum
⊢ ↑(ZNum.bitm1 (- -n)) = _root_.bit0 ↑n - 1
[PROOFSTEP]
rw [← zneg_bit1, cast_zneg, cast_bit1]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
n : ZNum
⊢ -_root_.bit1 ↑(-n) = _root_.bit0 ↑n - 1
[PROOFSTEP]
have : ((-1 + n + n : ℤ) : α) = (n + n + -1 : ℤ) := by simp [add_comm, add_left_comm]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
n : ZNum
⊢ ↑(-1 + ↑n + ↑n) = ↑(↑n + ↑n + -1)
[PROOFSTEP]
simp [add_comm, add_left_comm]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
n : ZNum
this : ↑(-1 + ↑n + ↑n) = ↑(↑n + ↑n + -1)
⊢ -_root_.bit1 ↑(-n) = _root_.bit0 ↑n - 1
[PROOFSTEP]
simpa [_root_.bit1, _root_.bit0, sub_eq_add_neg] using this
[GOAL]
α : Type u_1
n : ZNum
⊢ n + 0 = n
[PROOFSTEP]
cases n
[GOAL]
case zero
α : Type u_1
⊢ zero + 0 = zero
[PROOFSTEP]
rfl
[GOAL]
case pos
α : Type u_1
a✝ : PosNum
⊢ pos a✝ + 0 = pos a✝
[PROOFSTEP]
rfl
[GOAL]
case neg
α : Type u_1
a✝ : PosNum
⊢ neg a✝ + 0 = neg a✝
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
n : ZNum
⊢ 0 + n = n
[PROOFSTEP]
cases n
[GOAL]
case zero
α : Type u_1
⊢ 0 + zero = zero
[PROOFSTEP]
rfl
[GOAL]
case pos
α : Type u_1
a✝ : PosNum
⊢ 0 + pos a✝ = pos a✝
[PROOFSTEP]
rfl
[GOAL]
case neg
α : Type u_1
a✝ : PosNum
⊢ 0 + neg a✝ = neg a✝
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
p : PosNum
⊢ neg p + 1 = succ (neg p)
[PROOFSTEP]
cases p
[GOAL]
case one
α : Type u_1
⊢ neg one + 1 = succ (neg one)
[PROOFSTEP]
rfl
[GOAL]
case bit1
α : Type u_1
a✝ : PosNum
⊢ neg (PosNum.bit1 a✝) + 1 = succ (neg (PosNum.bit1 a✝))
[PROOFSTEP]
rfl
[GOAL]
case bit0
α : Type u_1
a✝ : PosNum
⊢ neg (PosNum.bit0 a✝) + 1 = succ (neg (PosNum.bit0 a✝))
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
a : PosNum
⊢ ↑(sub' a 1) = ↑a - ↑1
[PROOFSTEP]
rw [sub'_one, Num.cast_toZNum, ← Num.cast_to_nat, pred'_to_nat, ← Nat.sub_one]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
a : PosNum
⊢ ↑(↑a - 1) = ↑a - ↑1
[PROOFSTEP]
simp [PosNum.cast_pos]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
b : PosNum
⊢ ↑(sub' 1 b) = ↑1 - ↑b
[PROOFSTEP]
rw [one_sub', Num.cast_toZNumNeg, ← neg_sub, neg_inj, ← Num.cast_to_nat, pred'_to_nat, ← Nat.sub_one]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
b : PosNum
⊢ ↑(↑b - 1) = ↑b - ↑1
[PROOFSTEP]
simp [PosNum.cast_pos]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
a b : PosNum
⊢ ↑(sub' (bit0 a) (bit0 b)) = ↑(bit0 a) - ↑(bit0 b)
[PROOFSTEP]
rw [sub', ZNum.cast_bit0, cast_sub' a b]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
a b : PosNum
⊢ _root_.bit0 (↑a - ↑b) = ↑(bit0 a) - ↑(bit0 b)
[PROOFSTEP]
have : ((a + -b + (a + -b) : ℤ) : α) = a + a + (-b + -b) := by simp [add_left_comm]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
a b : PosNum
⊢ ↑(↑a + -↑b + (↑a + -↑b)) = ↑a + ↑a + (-↑b + -↑b)
[PROOFSTEP]
simp [add_left_comm]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
a b : PosNum
this : ↑(↑a + -↑b + (↑a + -↑b)) = ↑a + ↑a + (-↑b + -↑b)
⊢ _root_.bit0 (↑a - ↑b) = ↑(bit0 a) - ↑(bit0 b)
[PROOFSTEP]
simpa [_root_.bit0, sub_eq_add_neg] using this
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
a b : PosNum
⊢ ↑(sub' (bit0 a) (bit1 b)) = ↑(bit0 a) - ↑(bit1 b)
[PROOFSTEP]
rw [sub', ZNum.cast_bitm1, cast_sub' a b]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
a b : PosNum
⊢ _root_.bit0 (↑a - ↑b) - 1 = ↑(bit0 a) - ↑(bit1 b)
[PROOFSTEP]
have : ((-b + (a + (-b + -1)) : ℤ) : α) = (a + -1 + (-b + -b) : ℤ) := by simp [add_comm, add_left_comm]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
a b : PosNum
⊢ ↑(-↑b + (↑a + (-↑b + -1))) = ↑(↑a + -1 + (-↑b + -↑b))
[PROOFSTEP]
simp [add_comm, add_left_comm]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
a b : PosNum
this : ↑(-↑b + (↑a + (-↑b + -1))) = ↑(↑a + -1 + (-↑b + -↑b))
⊢ _root_.bit0 (↑a - ↑b) - 1 = ↑(bit0 a) - ↑(bit1 b)
[PROOFSTEP]
simpa [_root_.bit1, _root_.bit0, sub_eq_add_neg] using this
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
a b : PosNum
⊢ ↑(sub' (bit1 a) (bit0 b)) = ↑(bit1 a) - ↑(bit0 b)
[PROOFSTEP]
rw [sub', ZNum.cast_bit1, cast_sub' a b]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
a b : PosNum
⊢ _root_.bit1 (↑a - ↑b) = ↑(bit1 a) - ↑(bit0 b)
[PROOFSTEP]
have : ((-b + (a + (-b + 1)) : ℤ) : α) = (a + 1 + (-b + -b) : ℤ) := by simp [add_comm, add_left_comm]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
a b : PosNum
⊢ ↑(-↑b + (↑a + (-↑b + 1))) = ↑(↑a + 1 + (-↑b + -↑b))
[PROOFSTEP]
simp [add_comm, add_left_comm]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
a b : PosNum
this : ↑(-↑b + (↑a + (-↑b + 1))) = ↑(↑a + 1 + (-↑b + -↑b))
⊢ _root_.bit1 (↑a - ↑b) = ↑(bit1 a) - ↑(bit0 b)
[PROOFSTEP]
simpa [_root_.bit1, _root_.bit0, sub_eq_add_neg] using this
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
a b : PosNum
⊢ ↑(sub' (bit1 a) (bit1 b)) = ↑(bit1 a) - ↑(bit1 b)
[PROOFSTEP]
rw [sub', ZNum.cast_bit0, cast_sub' a b]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
a b : PosNum
⊢ _root_.bit0 (↑a - ↑b) = ↑(bit1 a) - ↑(bit1 b)
[PROOFSTEP]
have : ((-b + (a + -b) : ℤ) : α) = a + (-b + -b) := by simp [add_left_comm]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
a b : PosNum
⊢ ↑(-↑b + (↑a + -↑b)) = ↑a + (-↑b + -↑b)
[PROOFSTEP]
simp [add_left_comm]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
a b : PosNum
this : ↑(-↑b + (↑a + -↑b)) = ↑a + (-↑b + -↑b)
⊢ _root_.bit0 (↑a - ↑b) = ↑(bit1 a) - ↑(bit1 b)
[PROOFSTEP]
simpa [_root_.bit1, _root_.bit0, sub_eq_add_neg] using this
[GOAL]
α : Type u_1
n : PosNum
⊢ ↑n = ↑(pred' n) + 1
[PROOFSTEP]
rw [← Num.succ'_to_nat, n.succ'_pred']
[GOAL]
α : Type u_1
n : PosNum
⊢ ↑n = ↑↑(pred' n) + 1
[PROOFSTEP]
rw [← n.to_nat_to_int, to_nat_eq_succ_pred]
[GOAL]
α : Type u_1
n : PosNum
⊢ ↑(↑(pred' n) + 1) = ↑↑(pred' n) + 1
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
p : PosNum
⊢ toZNumNeg (PosNum.pred' (succ' (pos p))) = ZNum.neg p
[PROOFSTEP]
rw [PosNum.pred'_succ']
[GOAL]
α : Type u_1
p : PosNum
⊢ toZNumNeg (pos p) = ZNum.neg p
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
p : PosNum
⊢ ZNum.succ (ZNum.pred (ZNum.pos p)) = ZNum.pos p
[PROOFSTEP]
rw [ZNum.pred, ← toZNum_succ, Num.succ, PosNum.succ'_pred', toZNum]
[GOAL]
α : Type u_1
n : ℕ
⊢ ZNum.ofInt' (↑n + 1) = ZNum.ofInt' ↑n + 1
[PROOFSTEP]
change ZNum.ofInt' (n + 1 : ℕ) = ZNum.ofInt' (n : ℕ) + 1
[GOAL]
α : Type u_1
n : ℕ
⊢ ZNum.ofInt' ↑(n + 1) = ZNum.ofInt' ↑n + 1
[PROOFSTEP]
dsimp only [ZNum.ofInt', ZNum.ofInt']
[GOAL]
α : Type u_1
n : ℕ
⊢ toZNum (ofNat' (n + 1)) = toZNum (ofNat' n) + 1
[PROOFSTEP]
rw [Num.ofNat'_succ, Num.add_one, toZNum_succ, ZNum.add_one]
[GOAL]
α : Type u_1
⊢ ZNum.ofInt' (-[0+1] + 1) = ZNum.ofInt' -[0+1] + 1
[PROOFSTEP]
change ZNum.ofInt' 0 = ZNum.ofInt' (-[0+1]) + 1
[GOAL]
α : Type u_1
⊢ ZNum.ofInt' 0 = ZNum.ofInt' -[0+1] + 1
[PROOFSTEP]
dsimp only [ZNum.ofInt', ZNum.ofInt']
[GOAL]
α : Type u_1
⊢ toZNum (ofNat' 0) = toZNumNeg (ofNat' (0 + 1)) + 1
[PROOFSTEP]
rw [ofNat'_succ, ofNat'_zero]
[GOAL]
α : Type u_1
⊢ toZNum 0 = toZNumNeg (0 + 1) + 1
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
n : ℕ
⊢ ZNum.ofInt' (-[n + 1+1] + 1) = ZNum.ofInt' -[n + 1+1] + 1
[PROOFSTEP]
change ZNum.ofInt' -[n+1] = ZNum.ofInt' -[(n + 1)+1] + 1
[GOAL]
α : Type u_1
n : ℕ
⊢ ZNum.ofInt' -[n+1] = ZNum.ofInt' -[n + 1+1] + 1
[PROOFSTEP]
dsimp only [ZNum.ofInt', ZNum.ofInt']
[GOAL]
α : Type u_1
n : ℕ
⊢ toZNumNeg (ofNat' (n + 1)) = toZNumNeg (ofNat' (n + 1 + 1)) + 1
[PROOFSTEP]
rw [@Num.ofNat'_succ (n + 1), Num.add_one, toZNumNeg_succ, @ofNat'_succ n, Num.add_one, ZNum.add_one, pred_succ]
[GOAL]
α : Type u_1
n : ℕ
⊢ toZNum ↑(n + 1) = ZNum.ofInt' ↑(n + 1)
[PROOFSTEP]
rw [Nat.cast_succ, Num.add_one, toZNum_succ, ofInt'_toZNum n, Nat.cast_succ, succ_ofInt', ZNum.add_one]
[GOAL]
α : Type u_1
m : Num
p : PosNum
⊢ pos p = m ↔ ZNum.pos p = toZNum m
[PROOFSTEP]
cases m
[GOAL]
case zero
α : Type u_1
p : PosNum
⊢ pos p = zero ↔ ZNum.pos p = toZNum zero
[PROOFSTEP]
constructor
[GOAL]
case pos
α : Type u_1
p a✝ : PosNum
⊢ pos p = pos a✝ ↔ ZNum.pos p = toZNum (pos a✝)
[PROOFSTEP]
constructor
[GOAL]
case zero.mp
α : Type u_1
p : PosNum
⊢ pos p = zero → ZNum.pos p = toZNum zero
[PROOFSTEP]
intro h
[GOAL]
case zero.mpr
α : Type u_1
p : PosNum
⊢ ZNum.pos p = toZNum zero → pos p = zero
[PROOFSTEP]
intro h
[GOAL]
case pos.mp
α : Type u_1
p a✝ : PosNum
⊢ pos p = pos a✝ → ZNum.pos p = toZNum (pos a✝)
[PROOFSTEP]
intro h
[GOAL]
case pos.mpr
α : Type u_1
p a✝ : PosNum
⊢ ZNum.pos p = toZNum (pos a✝) → pos p = pos a✝
[PROOFSTEP]
intro h
[GOAL]
case zero.mp
α : Type u_1
p : PosNum
h : pos p = zero
⊢ ZNum.pos p = toZNum zero
[PROOFSTEP]
try cases h <;> rfl
[GOAL]
case zero.mp
α : Type u_1
p : PosNum
h : pos p = zero
⊢ ZNum.pos p = toZNum zero
[PROOFSTEP]
cases h
[GOAL]
case zero.mpr
α : Type u_1
p : PosNum
h : ZNum.pos p = toZNum zero
⊢ pos p = zero
[PROOFSTEP]
try cases h <;> rfl
[GOAL]
case zero.mpr
α : Type u_1
p : PosNum
h : ZNum.pos p = toZNum zero
⊢ pos p = zero
[PROOFSTEP]
cases h
[GOAL]
case pos.mp
α : Type u_1
p a✝ : PosNum
h : pos p = pos a✝
⊢ ZNum.pos p = toZNum (pos a✝)
[PROOFSTEP]
try cases h <;> rfl
[GOAL]
case pos.mp
α : Type u_1
p a✝ : PosNum
h : pos p = pos a✝
⊢ ZNum.pos p = toZNum (pos a✝)
[PROOFSTEP]
cases h
[GOAL]
case pos.mp.refl
α : Type u_1
p : PosNum
⊢ ZNum.pos p = toZNum (pos p)
[PROOFSTEP]
rfl
[GOAL]
case pos.mpr
α : Type u_1
p a✝ : PosNum
h : ZNum.pos p = toZNum (pos a✝)
⊢ pos p = pos a✝
[PROOFSTEP]
try cases h <;> rfl
[GOAL]
case pos.mpr
α : Type u_1
p a✝ : PosNum
h : ZNum.pos p = toZNum (pos a✝)
⊢ pos p = pos a✝
[PROOFSTEP]
cases h
[GOAL]
case pos.mpr.refl
α : Type u_1
p : PosNum
⊢ pos p = pos p
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
m : Num
p : PosNum
h : ZNum.neg p = toZNum m
⊢ m ∈ ofZNum' (ZNum.neg p)
[PROOFSTEP]
cases m
[GOAL]
case zero
α : Type u_1
p : PosNum
h : ZNum.neg p = toZNum zero
⊢ zero ∈ ofZNum' (ZNum.neg p)
[PROOFSTEP]
cases h
[GOAL]
case pos
α : Type u_1
p a✝ : PosNum
h : ZNum.neg p = toZNum (pos a✝)
⊢ pos a✝ ∈ ofZNum' (ZNum.neg p)
[PROOFSTEP]
cases h
[GOAL]
α : Type u_1
p : PosNum
⊢ castNum <$> ofZNum' (ZNum.pos p) = toNat' ↑p
[PROOFSTEP]
rw [← PosNum.to_nat_to_int p]
[GOAL]
α : Type u_1
p : PosNum
⊢ castNum <$> ofZNum' (ZNum.pos p) = toNat' ↑↑p
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
p : PosNum
⊢ ↑(↑(PosNum.pred' p) + 1) = ↑p
[PROOFSTEP]
rw [← succ'_to_nat]
[GOAL]
α : Type u_1
p : PosNum
⊢ ↑↑(succ' (PosNum.pred' p)) = ↑p
[PROOFSTEP]
simp
[GOAL]
α : Type u_1
p : PosNum
⊢ ↑(ofZNum (ZNum.pos p)) = toNat ↑p
[PROOFSTEP]
rw [← PosNum.to_nat_to_int p]
[GOAL]
α : Type u_1
p : PosNum
⊢ ↑(ofZNum (ZNum.pos p)) = toNat ↑↑p
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
p : PosNum
⊢ ↑(↑(PosNum.pred' p) + 1) = ↑p
[PROOFSTEP]
rw [← succ'_to_nat]
[GOAL]
α : Type u_1
p : PosNum
⊢ ↑↑(succ' (PosNum.pred' p)) = ↑p
[PROOFSTEP]
simp
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
n : ZNum
⊢ ↑(ofZNum n) = ↑(toNat ↑n)
[PROOFSTEP]
rw [← cast_to_nat, ofZNum_toNat]
[GOAL]
α : Type u_1
m n : Num
⊢ ↑(ofZNum (sub' m n)) = ↑m - ↑n
[PROOFSTEP]
rw [ofZNum_toNat, cast_sub', ← to_nat_to_int, ← to_nat_to_int, Int.toNat_sub]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
a : ZNum
⊢ ↑(0 + a) = ↑0 + ↑a
[PROOFSTEP]
cases a
[GOAL]
case zero
α : Type u_1
inst✝ : AddGroupWithOne α
⊢ ↑(0 + zero) = ↑0 + ↑zero
[PROOFSTEP]
exact (_root_.zero_add _).symm
[GOAL]
case pos
α : Type u_1
inst✝ : AddGroupWithOne α
a✝ : PosNum
⊢ ↑(0 + pos a✝) = ↑0 + ↑(pos a✝)
[PROOFSTEP]
exact (_root_.zero_add _).symm
[GOAL]
case neg
α : Type u_1
inst✝ : AddGroupWithOne α
a✝ : PosNum
⊢ ↑(0 + neg a✝) = ↑0 + ↑(neg a✝)
[PROOFSTEP]
exact (_root_.zero_add _).symm
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
b : ZNum
⊢ ↑(b + 0) = ↑b + ↑0
[PROOFSTEP]
cases b
[GOAL]
case zero
α : Type u_1
inst✝ : AddGroupWithOne α
⊢ ↑(zero + 0) = ↑zero + ↑0
[PROOFSTEP]
exact (_root_.add_zero _).symm
[GOAL]
case pos
α : Type u_1
inst✝ : AddGroupWithOne α
a✝ : PosNum
⊢ ↑(pos a✝ + 0) = ↑(pos a✝) + ↑0
[PROOFSTEP]
exact (_root_.add_zero _).symm
[GOAL]
case neg
α : Type u_1
inst✝ : AddGroupWithOne α
a✝ : PosNum
⊢ ↑(neg a✝ + 0) = ↑(neg a✝) + ↑0
[PROOFSTEP]
exact (_root_.add_zero _).symm
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
a b : PosNum
⊢ ↑(pos a + neg b) = ↑(pos a) + ↑(neg b)
[PROOFSTEP]
simpa only [sub_eq_add_neg] using PosNum.cast_sub' (α := α) _ _
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
a b : PosNum
⊢ ↑b + -↑a = -↑a + ↑b
[PROOFSTEP]
rw [← PosNum.cast_to_int a, ← PosNum.cast_to_int b, ← Int.cast_neg, ← Int.cast_add (-a)]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
a b : PosNum
⊢ ↑↑b + ↑(-↑a) = ↑(-↑a + ↑b)
[PROOFSTEP]
simp [add_comm]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
a b : PosNum
⊢ -↑(a + b) = -↑a + -↑b
[PROOFSTEP]
rw [PosNum.cast_add, neg_eq_iff_eq_neg, neg_add_rev, neg_neg, neg_neg, ← PosNum.cast_to_int a, ← PosNum.cast_to_int b, ←
  Int.cast_add, ← Int.cast_add, add_comm]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
n : ZNum
⊢ ↑(succ n) = ↑n + 1
[PROOFSTEP]
rw [← add_one, cast_add, cast_one]
[GOAL]
α : Type u_1
a : ZNum
⊢ ↑(0 * a) = ↑0 * ↑a
[PROOFSTEP]
cases a
[GOAL]
case zero
α : Type u_1
⊢ ↑(0 * zero) = ↑0 * ↑zero
[PROOFSTEP]
exact (zero_mul _).symm
[GOAL]
case pos
α : Type u_1
a✝ : PosNum
⊢ ↑(0 * pos a✝) = ↑0 * ↑(pos a✝)
[PROOFSTEP]
exact (zero_mul _).symm
[GOAL]
case neg
α : Type u_1
a✝ : PosNum
⊢ ↑(0 * neg a✝) = ↑0 * ↑(neg a✝)
[PROOFSTEP]
exact (zero_mul _).symm
[GOAL]
α : Type u_1
b : ZNum
⊢ ↑(b * 0) = ↑b * ↑0
[PROOFSTEP]
cases b
[GOAL]
case zero
α : Type u_1
⊢ ↑(zero * 0) = ↑zero * ↑0
[PROOFSTEP]
exact (mul_zero _).symm
[GOAL]
case pos
α : Type u_1
a✝ : PosNum
⊢ ↑(pos a✝ * 0) = ↑(pos a✝) * ↑0
[PROOFSTEP]
exact (mul_zero _).symm
[GOAL]
case neg
α : Type u_1
a✝ : PosNum
⊢ ↑(neg a✝ * 0) = ↑(neg a✝) * ↑0
[PROOFSTEP]
exact (mul_zero _).symm
[GOAL]
α : Type u_1
a b : PosNum
⊢ -↑(a * b) = ↑a * -↑b
[PROOFSTEP]
rw [PosNum.cast_mul, neg_mul_eq_mul_neg]
[GOAL]
α : Type u_1
a b : PosNum
⊢ -↑(a * b) = -↑a * ↑b
[PROOFSTEP]
rw [PosNum.cast_mul, neg_mul_eq_neg_mul]
[GOAL]
α : Type u_1
a b : PosNum
⊢ ↑(a * b) = -↑a * -↑b
[PROOFSTEP]
rw [PosNum.cast_mul, neg_mul_neg]
[GOAL]
α : Type u_1
inst✝ : Ring α
m n : ZNum
⊢ ↑(m * n) = ↑m * ↑n
[PROOFSTEP]
rw [← cast_to_int, mul_to_int, Int.cast_mul, cast_to_int, cast_to_int]
[GOAL]
α : Type u_1
n : ℕ
⊢ ofInt' ↑(n + 1) = -ofInt' -[n+1]
[PROOFSTEP]
simp only [ofInt', Num.zneg_toZNumNeg]
[GOAL]
α : Type u_1
⊢ Num.toZNum (Num.ofNat' 0) = -Num.toZNum (Num.ofNat' 0)
[PROOFSTEP]
rw [Num.ofNat'_zero]
[GOAL]
α : Type u_1
⊢ Num.toZNum 0 = -Num.toZNum 0
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
n : ℕ
⊢ Num.toZNumNeg (Num.ofNat' (Nat.add n 0 + 1)) = -Num.toZNum (Num.ofNat' (n + 1))
[PROOFSTEP]
rw [Num.zneg_toZNum]
[GOAL]
α : Type u_1
⊢ ofInt' ↑0 = 0
[PROOFSTEP]
dsimp [ofInt', cast_zero]
[GOAL]
α : Type u_1
⊢ Num.toZNum (Num.ofNat' 0) = 0
[PROOFSTEP]
erw [Num.ofNat'_zero, Num.toZNum]
[GOAL]
α : Type u_1
a : PosNum
⊢ ofInt' ↑(pos a) = pos a
[PROOFSTEP]
rw [cast_pos, ← PosNum.cast_to_nat, ← Num.ofInt'_toZNum, PosNum.of_to_nat]
[GOAL]
α : Type u_1
a : PosNum
⊢ Num.toZNum (Num.pos a) = pos a
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
a : PosNum
⊢ ofInt' ↑(neg a) = neg a
[PROOFSTEP]
rw [cast_neg, ofInt'_neg, ← PosNum.cast_to_nat, ← Num.ofInt'_toZNum, PosNum.of_to_nat]
[GOAL]
α : Type u_1
a : PosNum
⊢ -Num.toZNum (Num.pos a) = neg a
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
a b : PosNum
⊢ Ordering.casesOn (cmp (pos a) (pos b)) (↑(pos a) < ↑(pos b)) (pos a = pos b) (↑(pos b) < ↑(pos a))
[PROOFSTEP]
have := PosNum.cmp_to_nat a b
[GOAL]
α : Type u_1
a b : PosNum
this : Ordering.casesOn (PosNum.cmp a b) (↑a < ↑b) (a = b) (↑b < ↑a)
⊢ Ordering.casesOn (cmp (pos a) (pos b)) (↑(pos a) < ↑(pos b)) (pos a = pos b) (↑(pos b) < ↑(pos a))
[PROOFSTEP]
revert this
[GOAL]
α : Type u_1
a b : PosNum
⊢ Ordering.casesOn (PosNum.cmp a b) (↑a < ↑b) (a = b) (↑b < ↑a) →
    Ordering.casesOn (cmp (pos a) (pos b)) (↑(pos a) < ↑(pos b)) (pos a = pos b) (↑(pos b) < ↑(pos a))
[PROOFSTEP]
dsimp [cmp]
[GOAL]
α : Type u_1
a b : PosNum
⊢ Ordering.rec (↑a < ↑b) (a = b) (↑b < ↑a) (PosNum.cmp a b) →
    Ordering.rec (↑a < ↑b) (pos a = pos b) (↑b < ↑a) (PosNum.cmp a b)
[PROOFSTEP]
cases PosNum.cmp a b <;> dsimp <;> [simp; exact congr_arg pos; simp [GT.gt]]
[GOAL]
α : Type u_1
a b : PosNum
⊢ Ordering.rec (↑a < ↑b) (a = b) (↑b < ↑a) (PosNum.cmp a b) →
    Ordering.rec (↑a < ↑b) (pos a = pos b) (↑b < ↑a) (PosNum.cmp a b)
[PROOFSTEP]
cases PosNum.cmp a b
[GOAL]
case lt
α : Type u_1
a b : PosNum
⊢ Ordering.rec (↑a < ↑b) (a = b) (↑b < ↑a) Ordering.lt → Ordering.rec (↑a < ↑b) (pos a = pos b) (↑b < ↑a) Ordering.lt
[PROOFSTEP]
dsimp
[GOAL]
case eq
α : Type u_1
a b : PosNum
⊢ Ordering.rec (↑a < ↑b) (a = b) (↑b < ↑a) Ordering.eq → Ordering.rec (↑a < ↑b) (pos a = pos b) (↑b < ↑a) Ordering.eq
[PROOFSTEP]
dsimp
[GOAL]
case gt
α : Type u_1
a b : PosNum
⊢ Ordering.rec (↑a < ↑b) (a = b) (↑b < ↑a) Ordering.gt → Ordering.rec (↑a < ↑b) (pos a = pos b) (↑b < ↑a) Ordering.gt
[PROOFSTEP]
dsimp
[GOAL]
case lt
α : Type u_1
a b : PosNum
⊢ ↑a < ↑b → ↑a < ↑b
[PROOFSTEP]
simp
[GOAL]
case eq
α : Type u_1
a b : PosNum
⊢ a = b → pos a = pos b
[PROOFSTEP]
exact congr_arg pos
[GOAL]
case gt
α : Type u_1
a b : PosNum
⊢ ↑b < ↑a → ↑b < ↑a
[PROOFSTEP]
simp [GT.gt]
[GOAL]
α : Type u_1
a b : PosNum
⊢ Ordering.casesOn (cmp (neg a) (neg b)) (↑(neg a) < ↑(neg b)) (neg a = neg b) (↑(neg b) < ↑(neg a))
[PROOFSTEP]
have := PosNum.cmp_to_nat b a
[GOAL]
α : Type u_1
a b : PosNum
this : Ordering.casesOn (PosNum.cmp b a) (↑b < ↑a) (b = a) (↑a < ↑b)
⊢ Ordering.casesOn (cmp (neg a) (neg b)) (↑(neg a) < ↑(neg b)) (neg a = neg b) (↑(neg b) < ↑(neg a))
[PROOFSTEP]
revert this
[GOAL]
α : Type u_1
a b : PosNum
⊢ Ordering.casesOn (PosNum.cmp b a) (↑b < ↑a) (b = a) (↑a < ↑b) →
    Ordering.casesOn (cmp (neg a) (neg b)) (↑(neg a) < ↑(neg b)) (neg a = neg b) (↑(neg b) < ↑(neg a))
[PROOFSTEP]
dsimp [cmp]
[GOAL]
α : Type u_1
a b : PosNum
⊢ Ordering.rec (↑b < ↑a) (b = a) (↑a < ↑b) (PosNum.cmp b a) →
    Ordering.rec (-↑a < -↑b) (neg a = neg b) (-↑b < -↑a) (PosNum.cmp b a)
[PROOFSTEP]
cases PosNum.cmp b a <;> dsimp <;> [simp; simp (config := { contextual := true }); simp [GT.gt]]
[GOAL]
α : Type u_1
a b : PosNum
⊢ Ordering.rec (↑b < ↑a) (b = a) (↑a < ↑b) (PosNum.cmp b a) →
    Ordering.rec (-↑a < -↑b) (neg a = neg b) (-↑b < -↑a) (PosNum.cmp b a)
[PROOFSTEP]
cases PosNum.cmp b a
[GOAL]
case lt
α : Type u_1
a b : PosNum
⊢ Ordering.rec (↑b < ↑a) (b = a) (↑a < ↑b) Ordering.lt →
    Ordering.rec (-↑a < -↑b) (neg a = neg b) (-↑b < -↑a) Ordering.lt
[PROOFSTEP]
dsimp
[GOAL]
case eq
α : Type u_1
a b : PosNum
⊢ Ordering.rec (↑b < ↑a) (b = a) (↑a < ↑b) Ordering.eq →
    Ordering.rec (-↑a < -↑b) (neg a = neg b) (-↑b < -↑a) Ordering.eq
[PROOFSTEP]
dsimp
[GOAL]
case gt
α : Type u_1
a b : PosNum
⊢ Ordering.rec (↑b < ↑a) (b = a) (↑a < ↑b) Ordering.gt →
    Ordering.rec (-↑a < -↑b) (neg a = neg b) (-↑b < -↑a) Ordering.gt
[PROOFSTEP]
dsimp
[GOAL]
case lt
α : Type u_1
a b : PosNum
⊢ ↑b < ↑a → -↑a < -↑b
[PROOFSTEP]
simp
[GOAL]
case eq
α : Type u_1
a b : PosNum
⊢ b = a → neg a = neg b
[PROOFSTEP]
simp (config := { contextual := true })
[GOAL]
case gt
α : Type u_1
a b : PosNum
⊢ ↑a < ↑b → -↑b < -↑a
[PROOFSTEP]
simp [GT.gt]
[GOAL]
α : Type u_1
m n : ZNum
h : Ordering.casesOn Ordering.lt (↑m < ↑n) (m = n) (↑n < ↑m)
⊢ ↑m < ↑n ↔ Ordering.lt = Ordering.lt
[PROOFSTEP]
simp at h 
[GOAL]
α : Type u_1
m n : ZNum
h : ↑m < ↑n
⊢ ↑m < ↑n ↔ Ordering.lt = Ordering.lt
[PROOFSTEP]
simp [h]
[GOAL]
α : Type u_1
m n : ZNum
h : Ordering.casesOn Ordering.eq (↑m < ↑n) (m = n) (↑n < ↑m)
⊢ ↑m < ↑n ↔ Ordering.eq = Ordering.lt
[PROOFSTEP]
simp at h 
[GOAL]
α : Type u_1
m n : ZNum
h : m = n
⊢ ↑m < ↑n ↔ Ordering.eq = Ordering.lt
[PROOFSTEP]
simp [h, lt_irrefl]
[GOAL]
α : Type u_1
m n : ZNum
h : Ordering.casesOn Ordering.gt (↑m < ↑n) (m = n) (↑n < ↑m)
⊢ ↑m < ↑n ↔ Ordering.gt = Ordering.lt
[PROOFSTEP]
simp [not_lt_of_gt h]
[GOAL]
α : Type u_1
m n : ZNum
⊢ ↑m ≤ ↑n ↔ m ≤ n
[PROOFSTEP]
rw [← not_lt]
[GOAL]
α : Type u_1
m n : ZNum
⊢ ¬↑n < ↑m ↔ m ≤ n
[PROOFSTEP]
exact not_congr lt_to_int
[GOAL]
α : Type u_1
inst✝ : LinearOrderedRing α
m n : ZNum
⊢ ↑m < ↑n ↔ m < n
[PROOFSTEP]
rw [← cast_to_int m, ← cast_to_int n, Int.cast_lt, lt_to_int]
[GOAL]
α : Type u_1
inst✝ : LinearOrderedRing α
m n : ZNum
⊢ ↑m ≤ ↑n ↔ m ≤ n
[PROOFSTEP]
rw [← not_lt]
[GOAL]
α : Type u_1
inst✝ : LinearOrderedRing α
m n : ZNum
⊢ ¬↑n < ↑m ↔ m ≤ n
[PROOFSTEP]
exact not_congr cast_lt
[GOAL]
α : Type u_1
inst✝ : LinearOrderedRing α
m n : ZNum
⊢ ↑m = ↑n ↔ m = n
[PROOFSTEP]
rw [← cast_to_int m, ← cast_to_int n, Int.cast_inj (α := α), to_int_inj]
[GOAL]
α : Type u_1
⊢ ∀ (a : ZNum), a ≤ a
[PROOFSTEP]
transfer
[GOAL]
α : Type u_1
⊢ ∀ (a b c : ZNum), a ≤ b → b ≤ c → a ≤ c
[PROOFSTEP]
intro a b c
[GOAL]
α : Type u_1
a b c : ZNum
⊢ a ≤ b → b ≤ c → a ≤ c
[PROOFSTEP]
transfer_rw
[GOAL]
α : Type u_1
a b c : ZNum
⊢ ↑a ≤ ↑b → ↑b ≤ ↑c → ↑a ≤ ↑c
[PROOFSTEP]
apply le_trans
[GOAL]
α : Type u_1
⊢ ∀ (a b : ZNum), a < b ↔ a ≤ b ∧ ¬b ≤ a
[PROOFSTEP]
intro a b
[GOAL]
α : Type u_1
a b : ZNum
⊢ a < b ↔ a ≤ b ∧ ¬b ≤ a
[PROOFSTEP]
transfer_rw
[GOAL]
α : Type u_1
a b : ZNum
⊢ ↑a < ↑b ↔ ↑a ≤ ↑b ∧ ¬↑b ≤ ↑a
[PROOFSTEP]
apply lt_iff_le_not_le
[GOAL]
α : Type u_1
⊢ ∀ (a b : ZNum), a ≤ b → b ≤ a → a = b
[PROOFSTEP]
intro a b
[GOAL]
α : Type u_1
a b : ZNum
⊢ a ≤ b → b ≤ a → a = b
[PROOFSTEP]
transfer_rw
[GOAL]
α : Type u_1
a b : ZNum
⊢ ↑a ≤ ↑b → ↑b ≤ ↑a → ↑a = ↑b
[PROOFSTEP]
apply le_antisymm
[GOAL]
α : Type u_1
⊢ ∀ (a b : ZNum), a ≤ b ∨ b ≤ a
[PROOFSTEP]
intro a b
[GOAL]
α : Type u_1
a b : ZNum
⊢ a ≤ b ∨ b ≤ a
[PROOFSTEP]
transfer_rw
[GOAL]
α : Type u_1
a b : ZNum
⊢ ↑a ≤ ↑b ∨ ↑b ≤ ↑a
[PROOFSTEP]
apply le_total
[GOAL]
α : Type u_1
⊢ ∀ (a b c : ZNum), a + b + c = a + (b + c)
[PROOFSTEP]
transfer
[GOAL]
α : Type u_1
⊢ ∀ (a : ZNum), -a + a = 0
[PROOFSTEP]
transfer
[GOAL]
α : Type u_1
⊢ ∀ (a b : ZNum), a + b = b + a
[PROOFSTEP]
transfer
[GOAL]
α : Type u_1
src✝ : AddCommGroup ZNum := addCommGroup
⊢ Num.toZNum (Num.ofNat' 0) = 0
[PROOFSTEP]
rw [Num.ofNat'_zero]
[GOAL]
α : Type u_1
src✝ : AddCommGroup ZNum := addCommGroup
⊢ Num.toZNum 0 = 0
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
src✝ : AddCommGroup ZNum := addCommGroup
n : ℕ
⊢ Num.toZNum (Num.ofNat' (n + 1)) = Num.toZNum (Num.ofNat' n) + 1
[PROOFSTEP]
rw [Num.ofNat'_succ, Num.add_one, Num.toZNum_succ, ZNum.add_one]
[GOAL]
α : Type u_1
⊢ ∀ (a b : ZNum), a * b = b * a
[PROOFSTEP]
transfer
[GOAL]
α : Type u_1
⊢ ∀ (a b : ZNum), a ≤ b → ∀ (c : ZNum), c + a ≤ c + b
[PROOFSTEP]
intro a b h c
[GOAL]
α : Type u_1
a b : ZNum
h : a ≤ b
c : ZNum
⊢ c + a ≤ c + b
[PROOFSTEP]
revert h
[GOAL]
α : Type u_1
a b c : ZNum
⊢ a ≤ b → c + a ≤ c + b
[PROOFSTEP]
transfer_rw
[GOAL]
α : Type u_1
a b c : ZNum
⊢ ↑a ≤ ↑b → ↑c + ↑a ≤ ↑c + ↑b
[PROOFSTEP]
exact fun h => _root_.add_le_add_left h c
[GOAL]
α : Type u_1
src✝² : LinearOrder ZNum := linearOrder
src✝¹ : AddCommGroup ZNum := addCommGroup
src✝ : AddMonoidWithOne ZNum := addMonoidWithOne
⊢ ∀ (a b c : ZNum), a * (b + c) = a * b + a * c
[PROOFSTEP]
transfer
[GOAL]
α : Type u_1
src✝² : LinearOrder ZNum := linearOrder
src✝¹ : AddCommGroup ZNum := addCommGroup
src✝ : AddMonoidWithOne ZNum := addMonoidWithOne
a✝ b✝ c✝ : ZNum
⊢ ↑a✝ * (↑b✝ + ↑c✝) = ↑a✝ * ↑b✝ + ↑a✝ * ↑c✝
[PROOFSTEP]
simp [mul_add]
[GOAL]
α : Type u_1
src✝² : LinearOrder ZNum := linearOrder
src✝¹ : AddCommGroup ZNum := addCommGroup
src✝ : AddMonoidWithOne ZNum := addMonoidWithOne
⊢ ∀ (a b c : ZNum), (a + b) * c = a * c + b * c
[PROOFSTEP]
transfer
[GOAL]
α : Type u_1
src✝² : LinearOrder ZNum := linearOrder
src✝¹ : AddCommGroup ZNum := addCommGroup
src✝ : AddMonoidWithOne ZNum := addMonoidWithOne
a✝ b✝ c✝ : ZNum
⊢ ↑c✝ * (↑a✝ + ↑b✝) = ↑a✝ * ↑c✝ + ↑b✝ * ↑c✝
[PROOFSTEP]
simp [mul_add, _root_.mul_comm]
[GOAL]
α : Type u_1
src✝² : LinearOrder ZNum := linearOrder
src✝¹ : AddCommGroup ZNum := addCommGroup
src✝ : AddMonoidWithOne ZNum := addMonoidWithOne
⊢ ∀ (a : ZNum), 0 * a = 0
[PROOFSTEP]
transfer
[GOAL]
α : Type u_1
src✝² : LinearOrder ZNum := linearOrder
src✝¹ : AddCommGroup ZNum := addCommGroup
src✝ : AddMonoidWithOne ZNum := addMonoidWithOne
⊢ ∀ (a : ZNum), a * 0 = 0
[PROOFSTEP]
transfer
[GOAL]
α : Type u_1
src✝² : LinearOrder ZNum := linearOrder
src✝¹ : AddCommGroup ZNum := addCommGroup
src✝ : AddMonoidWithOne ZNum := addMonoidWithOne
⊢ ∀ (a b c : ZNum), a * b * c = a * (b * c)
[PROOFSTEP]
transfer
[GOAL]
α : Type u_1
src✝² : LinearOrder ZNum := linearOrder
src✝¹ : AddCommGroup ZNum := addCommGroup
src✝ : AddMonoidWithOne ZNum := addMonoidWithOne
⊢ ∀ (a : ZNum), 1 * a = a
[PROOFSTEP]
transfer
[GOAL]
α : Type u_1
src✝² : LinearOrder ZNum := linearOrder
src✝¹ : AddCommGroup ZNum := addCommGroup
src✝ : AddMonoidWithOne ZNum := addMonoidWithOne
⊢ ∀ (a : ZNum), a * 1 = a
[PROOFSTEP]
transfer
[GOAL]
α : Type u_1
src✝² : LinearOrder ZNum := linearOrder
src✝¹ : AddCommGroup ZNum := addCommGroup
src✝ : AddMonoidWithOne ZNum := addMonoidWithOne
⊢ 0 ≠ 1
[PROOFSTEP]
decide
[GOAL]
α : Type u_1
src✝² : LinearOrder ZNum := linearOrder
src✝¹ : AddCommGroup ZNum := addCommGroup
src✝ : AddMonoidWithOne ZNum := addMonoidWithOne
⊢ 0 ≤ 1
[PROOFSTEP]
decide
[GOAL]
α : Type u_1
src✝² : LinearOrder ZNum := linearOrder
src✝¹ : AddCommGroup ZNum := addCommGroup
src✝ : AddMonoidWithOne ZNum := addMonoidWithOne
a b : ZNum
⊢ 0 < a → 0 < b → 0 < a * b
[PROOFSTEP]
transfer_rw
[GOAL]
α : Type u_1
src✝² : LinearOrder ZNum := linearOrder
src✝¹ : AddCommGroup ZNum := addCommGroup
src✝ : AddMonoidWithOne ZNum := addMonoidWithOne
a b : ZNum
⊢ 0 < ↑a → 0 < ↑b → 0 < ↑a * ↑b
[PROOFSTEP]
apply mul_pos
[GOAL]
α : Type u_1
inst✝ : Ring α
m n : ZNum
⊢ ↑(m - n) = ↑m - ↑n
[PROOFSTEP]
simp [sub_eq_neg_add]
[GOAL]
α : Type u_1
⊢ ↑(-0) = -↑0
[PROOFSTEP]
rw [Int.cast_neg, Int.cast_zero]
[GOAL]
α : Type u_1
n : ℕ
⊢ ofInt' -[n+1] = ↑-[n+1]
[PROOFSTEP]
show Num.toZNumNeg (n + 1 : ℕ) = -(n + 1 : ℕ)
[GOAL]
α : Type u_1
n : ℕ
⊢ Num.toZNumNeg ↑(n + 1) = -↑(n + 1)
[PROOFSTEP]
rw [← neg_inj, neg_neg, Nat.cast_succ, Num.add_one, Num.zneg_toZNumNeg, Num.toZNum_succ, Nat.cast_succ, ZNum.add_one]
[GOAL]
α : Type u_1
n : ℕ
⊢ succ (Num.toZNum ↑n) = succ ↑n
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
n : ZNum
⊢ ↑↑n = n
[PROOFSTEP]
rw [← ofInt'_eq, of_to_int']
[GOAL]
α : Type u_1
n : ℤ
⊢ ↑↑0 = 0
[PROOFSTEP]
simp
[GOAL]
α : Type u_1
n : ℤ
⊢ ∀ (k : ℤ), 0 ≤ k → ↑↑k = k → ↑↑(k + 1) = k + 1
[PROOFSTEP]
simp
[GOAL]
α : Type u_1
n : ℤ
⊢ ∀ (k : ℤ), k ≤ 0 → ↑↑k = k → ↑↑(k - 1) = k - 1
[PROOFSTEP]
simp
[GOAL]
α : Type u_1
n : ℕ
⊢ Num.toZNumNeg ↑n = -↑n
[PROOFSTEP]
rw [← of_nat_toZNum, Num.zneg_toZNum]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
n : ℤ
⊢ ↑↑n = ↑n
[PROOFSTEP]
rw [← cast_to_int, to_of_int]
[GOAL]
α : Type u_1
inst✝ : AddGroupWithOne α
n : ℕ
⊢ ↑↑n = ↑n
[PROOFSTEP]
rw [← Int.cast_ofNat, of_int_cast, Int.cast_ofNat]
[GOAL]
α : Type u_1
m n : ZNum
x✝ : ↑m ∣ ↑n
k : ℤ
e : ↑n = ↑m * k
⊢ n = m * ↑k
[PROOFSTEP]
rw [← of_to_int n, e]
[GOAL]
α : Type u_1
m n : ZNum
x✝ : ↑m ∣ ↑n
k : ℤ
e : ↑n = ↑m * k
⊢ ↑(↑m * k) = m * ↑k
[PROOFSTEP]
simp
[GOAL]
α : Type u_1
m n : ZNum
x✝ : m ∣ n
k : ZNum
e : n = m * k
⊢ ↑n = ↑m * ↑k
[PROOFSTEP]
simp [e]
[GOAL]
n d : PosNum
q r : Num
h₁ : ↑r + ↑d * _root_.bit0 ↑q = ↑n
h₂ : ↑r < 2 * ↑d
⊢ ↑(divModAux d q r).snd + ↑d * ↑(divModAux d q r).fst = ↑n ∧ ↑(divModAux d q r).snd < ↑d
[PROOFSTEP]
unfold divModAux
[GOAL]
n d : PosNum
q r : Num
h₁ : ↑r + ↑d * _root_.bit0 ↑q = ↑n
h₂ : ↑r < 2 * ↑d
⊢ ↑(match Num.ofZNum' (Num.sub' r (Num.pos d)) with
            | some r' => (Num.bit1 q, r')
            | none => (Num.bit0 q, r)).snd +
        ↑d *
          ↑(match Num.ofZNum' (Num.sub' r (Num.pos d)) with
              | some r' => (Num.bit1 q, r')
              | none => (Num.bit0 q, r)).fst =
      ↑n ∧
    ↑(match Num.ofZNum' (Num.sub' r (Num.pos d)) with
          | some r' => (Num.bit1 q, r')
          | none => (Num.bit0 q, r)).snd <
      ↑d
[PROOFSTEP]
have : ∀ {r₂}, Num.ofZNum' (Num.sub' r (Num.pos d)) = some r₂ ↔ (r : ℕ) = r₂ + d :=
  by
  intro r₂
  apply Num.mem_ofZNum'.trans
  rw [← ZNum.to_int_inj, Num.cast_toZNum, Num.cast_sub', sub_eq_iff_eq_add, ← Int.coe_nat_inj']
  simp
[GOAL]
n d : PosNum
q r : Num
h₁ : ↑r + ↑d * _root_.bit0 ↑q = ↑n
h₂ : ↑r < 2 * ↑d
⊢ ∀ {r₂ : Num}, Num.ofZNum' (Num.sub' r (Num.pos d)) = some r₂ ↔ ↑r = ↑r₂ + ↑d
[PROOFSTEP]
intro r₂
[GOAL]
n d : PosNum
q r : Num
h₁ : ↑r + ↑d * _root_.bit0 ↑q = ↑n
h₂ : ↑r < 2 * ↑d
r₂ : Num
⊢ Num.ofZNum' (Num.sub' r (Num.pos d)) = some r₂ ↔ ↑r = ↑r₂ + ↑d
[PROOFSTEP]
apply Num.mem_ofZNum'.trans
[GOAL]
n d : PosNum
q r : Num
h₁ : ↑r + ↑d * _root_.bit0 ↑q = ↑n
h₂ : ↑r < 2 * ↑d
r₂ : Num
⊢ Num.sub' r (Num.pos d) = Num.toZNum r₂ ↔ ↑r = ↑r₂ + ↑d
[PROOFSTEP]
rw [← ZNum.to_int_inj, Num.cast_toZNum, Num.cast_sub', sub_eq_iff_eq_add, ← Int.coe_nat_inj']
[GOAL]
n d : PosNum
q r : Num
h₁ : ↑r + ↑d * _root_.bit0 ↑q = ↑n
h₂ : ↑r < 2 * ↑d
r₂ : Num
⊢ ↑r = ↑r₂ + ↑(Num.pos d) ↔ ↑↑r = ↑(↑r₂ + ↑d)
[PROOFSTEP]
simp
[GOAL]
n d : PosNum
q r : Num
h₁ : ↑r + ↑d * _root_.bit0 ↑q = ↑n
h₂ : ↑r < 2 * ↑d
this : ∀ {r₂ : Num}, Num.ofZNum' (Num.sub' r (Num.pos d)) = some r₂ ↔ ↑r = ↑r₂ + ↑d
⊢ ↑(match Num.ofZNum' (Num.sub' r (Num.pos d)) with
            | some r' => (Num.bit1 q, r')
            | none => (Num.bit0 q, r)).snd +
        ↑d *
          ↑(match Num.ofZNum' (Num.sub' r (Num.pos d)) with
              | some r' => (Num.bit1 q, r')
              | none => (Num.bit0 q, r)).fst =
      ↑n ∧
    ↑(match Num.ofZNum' (Num.sub' r (Num.pos d)) with
          | some r' => (Num.bit1 q, r')
          | none => (Num.bit0 q, r)).snd <
      ↑d
[PROOFSTEP]
cases' e : Num.ofZNum' (Num.sub' r (Num.pos d)) with r₂
[GOAL]
case none
n d : PosNum
q r : Num
h₁ : ↑r + ↑d * _root_.bit0 ↑q = ↑n
h₂ : ↑r < 2 * ↑d
this : ∀ {r₂ : Num}, Num.ofZNum' (Num.sub' r (Num.pos d)) = some r₂ ↔ ↑r = ↑r₂ + ↑d
e : Num.ofZNum' (Num.sub' r (Num.pos d)) = none
⊢ ↑(match none with
            | some r' => (Num.bit1 q, r')
            | none => (Num.bit0 q, r)).snd +
        ↑d *
          ↑(match none with
              | some r' => (Num.bit1 q, r')
              | none => (Num.bit0 q, r)).fst =
      ↑n ∧
    ↑(match none with
          | some r' => (Num.bit1 q, r')
          | none => (Num.bit0 q, r)).snd <
      ↑d
[PROOFSTEP]
simp [divModAux]
[GOAL]
case some
n d : PosNum
q r : Num
h₁ : ↑r + ↑d * _root_.bit0 ↑q = ↑n
h₂ : ↑r < 2 * ↑d
this : ∀ {r₂ : Num}, Num.ofZNum' (Num.sub' r (Num.pos d)) = some r₂ ↔ ↑r = ↑r₂ + ↑d
r₂ : Num
e : Num.ofZNum' (Num.sub' r (Num.pos d)) = some r₂
⊢ ↑(match some r₂ with
            | some r' => (Num.bit1 q, r')
            | none => (Num.bit0 q, r)).snd +
        ↑d *
          ↑(match some r₂ with
              | some r' => (Num.bit1 q, r')
              | none => (Num.bit0 q, r)).fst =
      ↑n ∧
    ↑(match some r₂ with
          | some r' => (Num.bit1 q, r')
          | none => (Num.bit0 q, r)).snd <
      ↑d
[PROOFSTEP]
simp [divModAux]
[GOAL]
case none
n d : PosNum
q r : Num
h₁ : ↑r + ↑d * _root_.bit0 ↑q = ↑n
h₂ : ↑r < 2 * ↑d
this : ∀ {r₂ : Num}, Num.ofZNum' (Num.sub' r (Num.pos d)) = some r₂ ↔ ↑r = ↑r₂ + ↑d
e : Num.ofZNum' (Num.sub' r (Num.pos d)) = none
⊢ ↑r + ↑d * _root_.bit0 ↑q = ↑n ∧ ↑r < ↑d
[PROOFSTEP]
refine' ⟨h₁, lt_of_not_ge fun h => _⟩
[GOAL]
case none
n d : PosNum
q r : Num
h₁ : ↑r + ↑d * _root_.bit0 ↑q = ↑n
h₂ : ↑r < 2 * ↑d
this : ∀ {r₂ : Num}, Num.ofZNum' (Num.sub' r (Num.pos d)) = some r₂ ↔ ↑r = ↑r₂ + ↑d
e : Num.ofZNum' (Num.sub' r (Num.pos d)) = none
h : ↑r ≥ ↑d
⊢ False
[PROOFSTEP]
cases' Nat.le.dest h with r₂ e'
[GOAL]
case none.intro
n d : PosNum
q r : Num
h₁ : ↑r + ↑d * _root_.bit0 ↑q = ↑n
h₂ : ↑r < 2 * ↑d
this : ∀ {r₂ : Num}, Num.ofZNum' (Num.sub' r (Num.pos d)) = some r₂ ↔ ↑r = ↑r₂ + ↑d
e : Num.ofZNum' (Num.sub' r (Num.pos d)) = none
h : ↑r ≥ ↑d
r₂ : ℕ
e' : ↑d + r₂ = ↑r
⊢ False
[PROOFSTEP]
rw [← Num.to_of_nat r₂, add_comm] at e' 
[GOAL]
case none.intro
n d : PosNum
q r : Num
h₁ : ↑r + ↑d * _root_.bit0 ↑q = ↑n
h₂ : ↑r < 2 * ↑d
this : ∀ {r₂ : Num}, Num.ofZNum' (Num.sub' r (Num.pos d)) = some r₂ ↔ ↑r = ↑r₂ + ↑d
e : Num.ofZNum' (Num.sub' r (Num.pos d)) = none
h : ↑r ≥ ↑d
r₂ : ℕ
e' : ↑↑r₂ + ↑d = ↑r
⊢ False
[PROOFSTEP]
cases e.symm.trans (this.2 e'.symm)
[GOAL]
case some
n d : PosNum
q r : Num
h₁ : ↑r + ↑d * _root_.bit0 ↑q = ↑n
h₂ : ↑r < 2 * ↑d
this : ∀ {r₂ : Num}, Num.ofZNum' (Num.sub' r (Num.pos d)) = some r₂ ↔ ↑r = ↑r₂ + ↑d
r₂ : Num
e : Num.ofZNum' (Num.sub' r (Num.pos d)) = some r₂
⊢ ↑r₂ + ↑d * _root_.bit1 ↑q = ↑n ∧ ↑r₂ < ↑d
[PROOFSTEP]
have := this.1 e
[GOAL]
case some
n d : PosNum
q r : Num
h₁ : ↑r + ↑d * _root_.bit0 ↑q = ↑n
h₂ : ↑r < 2 * ↑d
this✝ : ∀ {r₂ : Num}, Num.ofZNum' (Num.sub' r (Num.pos d)) = some r₂ ↔ ↑r = ↑r₂ + ↑d
r₂ : Num
e : Num.ofZNum' (Num.sub' r (Num.pos d)) = some r₂
this : ↑r = ↑r₂ + ↑d
⊢ ↑r₂ + ↑d * _root_.bit1 ↑q = ↑n ∧ ↑r₂ < ↑d
[PROOFSTEP]
constructor
[GOAL]
case some.left
n d : PosNum
q r : Num
h₁ : ↑r + ↑d * _root_.bit0 ↑q = ↑n
h₂ : ↑r < 2 * ↑d
this✝ : ∀ {r₂ : Num}, Num.ofZNum' (Num.sub' r (Num.pos d)) = some r₂ ↔ ↑r = ↑r₂ + ↑d
r₂ : Num
e : Num.ofZNum' (Num.sub' r (Num.pos d)) = some r₂
this : ↑r = ↑r₂ + ↑d
⊢ ↑r₂ + ↑d * _root_.bit1 ↑q = ↑n
[PROOFSTEP]
rwa [_root_.bit1, add_comm _ 1, mul_add, mul_one, ← add_assoc, ← this]
[GOAL]
case some.right
n d : PosNum
q r : Num
h₁ : ↑r + ↑d * _root_.bit0 ↑q = ↑n
h₂ : ↑r < 2 * ↑d
this✝ : ∀ {r₂ : Num}, Num.ofZNum' (Num.sub' r (Num.pos d)) = some r₂ ↔ ↑r = ↑r₂ + ↑d
r₂ : Num
e : Num.ofZNum' (Num.sub' r (Num.pos d)) = some r₂
this : ↑r = ↑r₂ + ↑d
⊢ ↑r₂ < ↑d
[PROOFSTEP]
rwa [this, two_mul, add_lt_add_iff_right] at h₂ 
[GOAL]
d n : PosNum
⊢ ↑n / ↑d = ↑(divMod d n).fst ∧ ↑n % ↑d = ↑(divMod d n).snd
[PROOFSTEP]
rw [Nat.div_mod_unique (PosNum.cast_pos _)]
[GOAL]
d n : PosNum
⊢ ↑(divMod d n).snd + ↑d * ↑(divMod d n).fst = ↑n ∧ ↑(divMod d n).snd < ↑d
[PROOFSTEP]
induction' n with n IH n IH
[GOAL]
case one
d : PosNum
⊢ ↑(divMod d one).snd + ↑d * ↑(divMod d one).fst = ↑one ∧ ↑(divMod d one).snd < ↑d
[PROOFSTEP]
exact divMod_to_nat_aux (by simp) (Nat.mul_le_mul_left 2 (PosNum.cast_pos d : (0 : ℕ) < d))
[GOAL]
d : PosNum
⊢ ↑1 + ↑d * _root_.bit0 ↑0 = ↑one
[PROOFSTEP]
simp
[GOAL]
case bit1
d n : PosNum
IH : ↑(divMod d n).snd + ↑d * ↑(divMod d n).fst = ↑n ∧ ↑(divMod d n).snd < ↑d
⊢ ↑(divMod d (bit1 n)).snd + ↑d * ↑(divMod d (bit1 n)).fst = ↑(bit1 n) ∧ ↑(divMod d (bit1 n)).snd < ↑d
[PROOFSTEP]
unfold divMod
[GOAL]
case bit1
d n : PosNum
IH : ↑(divMod d n).snd + ↑d * ↑(divMod d n).fst = ↑n ∧ ↑(divMod d n).snd < ↑d
⊢ ↑(match divMod d n with
            | (q, r₁) => divModAux d q (Num.bit1 r₁)).snd +
        ↑d *
          ↑(match divMod d n with
              | (q, r₁) => divModAux d q (Num.bit1 r₁)).fst =
      ↑(bit1 n) ∧
    ↑(match divMod d n with
          | (q, r₁) => divModAux d q (Num.bit1 r₁)).snd <
      ↑d
[PROOFSTEP]
revert IH
[GOAL]
case bit1
d n : PosNum
⊢ ↑(divMod d n).snd + ↑d * ↑(divMod d n).fst = ↑n ∧ ↑(divMod d n).snd < ↑d →
    ↑(match divMod d n with
              | (q, r₁) => divModAux d q (Num.bit1 r₁)).snd +
          ↑d *
            ↑(match divMod d n with
                | (q, r₁) => divModAux d q (Num.bit1 r₁)).fst =
        ↑(bit1 n) ∧
      ↑(match divMod d n with
            | (q, r₁) => divModAux d q (Num.bit1 r₁)).snd <
        ↑d
[PROOFSTEP]
cases' divMod d n with q r
[GOAL]
case bit1.mk
d n : PosNum
q r : Num
⊢ ↑(q, r).snd + ↑d * ↑(q, r).fst = ↑n ∧ ↑(q, r).snd < ↑d →
    ↑(match (q, r) with
              | (q, r₁) => divModAux d q (Num.bit1 r₁)).snd +
          ↑d *
            ↑(match (q, r) with
                | (q, r₁) => divModAux d q (Num.bit1 r₁)).fst =
        ↑(bit1 n) ∧
      ↑(match (q, r) with
            | (q, r₁) => divModAux d q (Num.bit1 r₁)).snd <
        ↑d
[PROOFSTEP]
intro IH
[GOAL]
case bit1.mk
d n : PosNum
q r : Num
IH : ↑(q, r).snd + ↑d * ↑(q, r).fst = ↑n ∧ ↑(q, r).snd < ↑d
⊢ ↑(match (q, r) with
            | (q, r₁) => divModAux d q (Num.bit1 r₁)).snd +
        ↑d *
          ↑(match (q, r) with
              | (q, r₁) => divModAux d q (Num.bit1 r₁)).fst =
      ↑(bit1 n) ∧
    ↑(match (q, r) with
          | (q, r₁) => divModAux d q (Num.bit1 r₁)).snd <
      ↑d
[PROOFSTEP]
simp only [divMod] at IH ⊢
[GOAL]
case bit1.mk
d n : PosNum
q r : Num
IH : ↑r + ↑d * ↑q = ↑n ∧ ↑r < ↑d
⊢ ↑(divModAux d q (Num.bit1 r)).snd + ↑d * ↑(divModAux d q (Num.bit1 r)).fst = ↑(bit1 n) ∧
    ↑(divModAux d q (Num.bit1 r)).snd < ↑d
[PROOFSTEP]
apply divMod_to_nat_aux
[GOAL]
case bit1.mk.h₁
d n : PosNum
q r : Num
IH : ↑r + ↑d * ↑q = ↑n ∧ ↑r < ↑d
⊢ ↑(Num.bit1 r) + ↑d * _root_.bit0 ↑q = ↑(bit1 n)
[PROOFSTEP]
simp
[GOAL]
case bit1.mk.h₂
d n : PosNum
q r : Num
IH : ↑r + ↑d * ↑q = ↑n ∧ ↑r < ↑d
⊢ ↑(Num.bit1 r) < 2 * ↑d
[PROOFSTEP]
simp
[GOAL]
case bit1.mk.h₁
d n : PosNum
q r : Num
IH : ↑r + ↑d * ↑q = ↑n ∧ ↑r < ↑d
⊢ _root_.bit1 ↑r + ↑d * _root_.bit0 ↑q = _root_.bit1 ↑n
[PROOFSTEP]
rw [_root_.bit1, _root_.bit1, add_right_comm, bit0_eq_two_mul (n : ℕ), ← IH.1, mul_add, ← bit0_eq_two_mul,
  mul_left_comm, ← bit0_eq_two_mul]
[GOAL]
case bit1.mk.h₂
d n : PosNum
q r : Num
IH : ↑r + ↑d * ↑q = ↑n ∧ ↑r < ↑d
⊢ _root_.bit1 ↑r < 2 * ↑d
[PROOFSTEP]
rw [← bit0_eq_two_mul]
[GOAL]
case bit1.mk.h₂
d n : PosNum
q r : Num
IH : ↑r + ↑d * ↑q = ↑n ∧ ↑r < ↑d
⊢ _root_.bit1 ↑r < _root_.bit0 ↑d
[PROOFSTEP]
exact Nat.bit1_lt_bit0 IH.2
[GOAL]
case bit0
d n : PosNum
IH : ↑(divMod d n).snd + ↑d * ↑(divMod d n).fst = ↑n ∧ ↑(divMod d n).snd < ↑d
⊢ ↑(divMod d (bit0 n)).snd + ↑d * ↑(divMod d (bit0 n)).fst = ↑(bit0 n) ∧ ↑(divMod d (bit0 n)).snd < ↑d
[PROOFSTEP]
unfold divMod
[GOAL]
case bit0
d n : PosNum
IH : ↑(divMod d n).snd + ↑d * ↑(divMod d n).fst = ↑n ∧ ↑(divMod d n).snd < ↑d
⊢ ↑(match divMod d n with
            | (q, r₁) => divModAux d q (Num.bit0 r₁)).snd +
        ↑d *
          ↑(match divMod d n with
              | (q, r₁) => divModAux d q (Num.bit0 r₁)).fst =
      ↑(bit0 n) ∧
    ↑(match divMod d n with
          | (q, r₁) => divModAux d q (Num.bit0 r₁)).snd <
      ↑d
[PROOFSTEP]
revert IH
[GOAL]
case bit0
d n : PosNum
⊢ ↑(divMod d n).snd + ↑d * ↑(divMod d n).fst = ↑n ∧ ↑(divMod d n).snd < ↑d →
    ↑(match divMod d n with
              | (q, r₁) => divModAux d q (Num.bit0 r₁)).snd +
          ↑d *
            ↑(match divMod d n with
                | (q, r₁) => divModAux d q (Num.bit0 r₁)).fst =
        ↑(bit0 n) ∧
      ↑(match divMod d n with
            | (q, r₁) => divModAux d q (Num.bit0 r₁)).snd <
        ↑d
[PROOFSTEP]
cases' divMod d n with q r
[GOAL]
case bit0.mk
d n : PosNum
q r : Num
⊢ ↑(q, r).snd + ↑d * ↑(q, r).fst = ↑n ∧ ↑(q, r).snd < ↑d →
    ↑(match (q, r) with
              | (q, r₁) => divModAux d q (Num.bit0 r₁)).snd +
          ↑d *
            ↑(match (q, r) with
                | (q, r₁) => divModAux d q (Num.bit0 r₁)).fst =
        ↑(bit0 n) ∧
      ↑(match (q, r) with
            | (q, r₁) => divModAux d q (Num.bit0 r₁)).snd <
        ↑d
[PROOFSTEP]
intro IH
[GOAL]
case bit0.mk
d n : PosNum
q r : Num
IH : ↑(q, r).snd + ↑d * ↑(q, r).fst = ↑n ∧ ↑(q, r).snd < ↑d
⊢ ↑(match (q, r) with
            | (q, r₁) => divModAux d q (Num.bit0 r₁)).snd +
        ↑d *
          ↑(match (q, r) with
              | (q, r₁) => divModAux d q (Num.bit0 r₁)).fst =
      ↑(bit0 n) ∧
    ↑(match (q, r) with
          | (q, r₁) => divModAux d q (Num.bit0 r₁)).snd <
      ↑d
[PROOFSTEP]
simp only [divMod] at IH ⊢
[GOAL]
case bit0.mk
d n : PosNum
q r : Num
IH : ↑r + ↑d * ↑q = ↑n ∧ ↑r < ↑d
⊢ ↑(divModAux d q (Num.bit0 r)).snd + ↑d * ↑(divModAux d q (Num.bit0 r)).fst = ↑(bit0 n) ∧
    ↑(divModAux d q (Num.bit0 r)).snd < ↑d
[PROOFSTEP]
apply divMod_to_nat_aux
[GOAL]
case bit0.mk.h₁
d n : PosNum
q r : Num
IH : ↑r + ↑d * ↑q = ↑n ∧ ↑r < ↑d
⊢ ↑(Num.bit0 r) + ↑d * _root_.bit0 ↑q = ↑(bit0 n)
[PROOFSTEP]
simp
[GOAL]
case bit0.mk.h₂
d n : PosNum
q r : Num
IH : ↑r + ↑d * ↑q = ↑n ∧ ↑r < ↑d
⊢ ↑(Num.bit0 r) < 2 * ↑d
[PROOFSTEP]
simp
[GOAL]
case bit0.mk.h₁
d n : PosNum
q r : Num
IH : ↑r + ↑d * ↑q = ↑n ∧ ↑r < ↑d
⊢ _root_.bit0 ↑r + ↑d * _root_.bit0 ↑q = _root_.bit0 ↑n
[PROOFSTEP]
rw [bit0_eq_two_mul (n : ℕ), ← IH.1, mul_add, ← bit0_eq_two_mul, mul_left_comm, ← bit0_eq_two_mul]
[GOAL]
case bit0.mk.h₂
d n : PosNum
q r : Num
IH : ↑r + ↑d * ↑q = ↑n ∧ ↑r < ↑d
⊢ _root_.bit0 ↑r < 2 * ↑d
[PROOFSTEP]
rw [← bit0_eq_two_mul]
[GOAL]
case bit0.mk.h₂
d n : PosNum
q r : Num
IH : ↑r + ↑d * ↑q = ↑n ∧ ↑r < ↑d
⊢ _root_.bit0 ↑r < _root_.bit0 ↑d
[PROOFSTEP]
exact Nat.bit0_lt IH.2
[GOAL]
n : Num
⊢ div n 0 = 0
[PROOFSTEP]
cases n
[GOAL]
case zero
⊢ div zero 0 = 0
[PROOFSTEP]
rfl
[GOAL]
case pos
a✝ : PosNum
⊢ div (pos a✝) 0 = 0
[PROOFSTEP]
simp [Num.div]
[GOAL]
⊢ ↑(0 / 0) = ↑0 / ↑0
[PROOFSTEP]
simp
[GOAL]
n : Num
⊢ mod n 0 = n
[PROOFSTEP]
cases n
[GOAL]
case zero
⊢ mod zero 0 = zero
[PROOFSTEP]
rfl
[GOAL]
case pos
a✝ : PosNum
⊢ mod (pos a✝) 0 = pos a✝
[PROOFSTEP]
simp [Num.mod]
[GOAL]
⊢ ↑(0 % 0) = ↑0 % ↑0
[PROOFSTEP]
simp
[GOAL]
n : ℕ
a : PosNum
b : Num
ab : pos a ≤ b
h : natSize (pos a * b) ≤ Nat.succ n
⊢ ↑(gcdAux (Nat.succ n) (pos a) b) = Nat.gcd ↑(pos a) ↑b
[PROOFSTEP]
simp [gcdAux]
[GOAL]
n : ℕ
a : PosNum
b : Num
ab : pos a ≤ b
h : natSize (pos a * b) ≤ Nat.succ n
⊢ ↑(gcdAux n (b % pos a) (pos a)) = Nat.gcd ↑a ↑b
[PROOFSTEP]
rw [Nat.gcd_rec, gcd_to_nat_aux, mod_to_nat]
[GOAL]
n : ℕ
a : PosNum
b : Num
ab : pos a ≤ b
h : natSize (pos a * b) ≤ Nat.succ n
⊢ Nat.gcd (↑b % ↑(pos a)) ↑(pos a) = Nat.gcd (↑b % ↑a) ↑a
[PROOFSTEP]
rfl
[GOAL]
case a
n : ℕ
a : PosNum
b : Num
ab : pos a ≤ b
h : natSize (pos a * b) ≤ Nat.succ n
⊢ b % pos a ≤ pos a
[PROOFSTEP]
rw [← le_to_nat, mod_to_nat]
[GOAL]
case a
n : ℕ
a : PosNum
b : Num
ab : pos a ≤ b
h : natSize (pos a * b) ≤ Nat.succ n
⊢ ↑b % ↑(pos a) ≤ ↑(pos a)
[PROOFSTEP]
exact le_of_lt (Nat.mod_lt _ (PosNum.cast_pos _))
[GOAL]
case a
n : ℕ
a : PosNum
b : Num
ab : pos a ≤ b
h : natSize (pos a * b) ≤ Nat.succ n
⊢ natSize (b % pos a * pos a) ≤ n
[PROOFSTEP]
rw [natSize_to_nat, mul_to_nat, Nat.size_le] at h ⊢
[GOAL]
case a
n : ℕ
a : PosNum
b : Num
ab : pos a ≤ b
h : ↑(pos a) * ↑b < 2 ^ Nat.succ n
⊢ ↑(b % pos a) * ↑(pos a) < 2 ^ n
[PROOFSTEP]
rw [mod_to_nat, mul_comm]
[GOAL]
case a
n : ℕ
a : PosNum
b : Num
ab : pos a ≤ b
h : ↑(pos a) * ↑b < 2 ^ Nat.succ n
⊢ ↑(pos a) * (↑b % ↑(pos a)) < 2 ^ n
[PROOFSTEP]
rw [pow_succ', ← Nat.mod_add_div b (pos a)] at h 
[GOAL]
case a
n : ℕ
a : PosNum
b : Num
ab : pos a ≤ b
h : ↑(pos a) * (↑b % ↑(pos a) + ↑(pos a) * (↑b / ↑(pos a))) < 2 ^ n * 2
⊢ ↑(pos a) * (↑b % ↑(pos a)) < 2 ^ n
[PROOFSTEP]
refine' lt_of_mul_lt_mul_right (lt_of_le_of_lt _ h) (Nat.zero_le 2)
[GOAL]
case a
n : ℕ
a : PosNum
b : Num
ab : pos a ≤ b
h : ↑(pos a) * (↑b % ↑(pos a) + ↑(pos a) * (↑b / ↑(pos a))) < 2 ^ n * 2
⊢ ↑(pos a) * (↑b % ↑(pos a)) * 2 ≤ ↑(pos a) * (↑b % ↑(pos a) + ↑(pos a) * (↑b / ↑(pos a)))
[PROOFSTEP]
rw [mul_two, mul_add]
[GOAL]
case a
n : ℕ
a : PosNum
b : Num
ab : pos a ≤ b
h : ↑(pos a) * (↑b % ↑(pos a) + ↑(pos a) * (↑b / ↑(pos a))) < 2 ^ n * 2
⊢ ↑(pos a) * (↑b % ↑(pos a)) + ↑(pos a) * (↑b % ↑(pos a)) ≤
    ↑(pos a) * (↑b % ↑(pos a)) + ↑(pos a) * (↑(pos a) * (↑b / ↑(pos a)))
[PROOFSTEP]
refine' add_le_add_left (Nat.mul_le_mul_left _ (le_trans (le_of_lt (Nat.mod_lt _ (PosNum.cast_pos _))) _)) _
[GOAL]
case a
n : ℕ
a : PosNum
b : Num
ab : pos a ≤ b
h : ↑(pos a) * (↑b % ↑(pos a) + ↑(pos a) * (↑b / ↑(pos a))) < 2 ^ n * 2
⊢ ↑a ≤ ↑(pos a) * (↑b / ↑(pos a))
[PROOFSTEP]
suffices : 1 ≤ _
[GOAL]
case a
n : ℕ
a : PosNum
b : Num
ab : pos a ≤ b
h : ↑(pos a) * (↑b % ↑(pos a) + ↑(pos a) * (↑b / ↑(pos a))) < 2 ^ n * 2
this : 1 ≤ ?m.1208915
⊢ ↑a ≤ ↑(pos a) * (↑b / ↑(pos a))
case this
n : ℕ
a : PosNum
b : Num
ab : pos a ≤ b
h : ↑(pos a) * (↑b % ↑(pos a) + ↑(pos a) * (↑b / ↑(pos a))) < 2 ^ n * 2
⊢ 1 ≤ ?m.1208915
[PROOFSTEP]
simpa using Nat.mul_le_mul_left (pos a) this
[GOAL]
case this
n : ℕ
a : PosNum
b : Num
ab : pos a ≤ b
h : ↑(pos a) * (↑b % ↑(pos a) + ↑(pos a) * (↑b / ↑(pos a))) < 2 ^ n * 2
⊢ 1 ≤ ↑b / ↑a
[PROOFSTEP]
rw [Nat.le_div_iff_mul_le a.cast_pos, one_mul]
[GOAL]
case this
n : ℕ
a : PosNum
b : Num
ab : pos a ≤ b
h : ↑(pos a) * (↑b % ↑(pos a) + ↑(pos a) * (↑b / ↑(pos a))) < 2 ^ n * 2
⊢ ↑a ≤ ↑b
[PROOFSTEP]
exact le_to_nat.2 ab
[GOAL]
⊢ ∀ (a b : Num), ↑(gcd a b) = Nat.gcd ↑a ↑b
[PROOFSTEP]
have : ∀ a b : Num, (a * b).natSize ≤ a.natSize + b.natSize :=
  by
  intros
  simp [natSize_to_nat]
  rw [Nat.size_le, pow_add]
  exact mul_lt_mul'' (Nat.lt_size_self _) (Nat.lt_size_self _) (Nat.zero_le _) (Nat.zero_le _)
[GOAL]
⊢ ∀ (a b : Num), natSize (a * b) ≤ natSize a + natSize b
[PROOFSTEP]
intros
[GOAL]
a✝ b✝ : Num
⊢ natSize (a✝ * b✝) ≤ natSize a✝ + natSize b✝
[PROOFSTEP]
simp [natSize_to_nat]
[GOAL]
a✝ b✝ : Num
⊢ Nat.size (↑a✝ * ↑b✝) ≤ Nat.size ↑a✝ + Nat.size ↑b✝
[PROOFSTEP]
rw [Nat.size_le, pow_add]
[GOAL]
a✝ b✝ : Num
⊢ ↑a✝ * ↑b✝ < 2 ^ Nat.size ↑a✝ * 2 ^ Nat.size ↑b✝
[PROOFSTEP]
exact mul_lt_mul'' (Nat.lt_size_self _) (Nat.lt_size_self _) (Nat.zero_le _) (Nat.zero_le _)
[GOAL]
this : ∀ (a b : Num), natSize (a * b) ≤ natSize a + natSize b
⊢ ∀ (a b : Num), ↑(gcd a b) = Nat.gcd ↑a ↑b
[PROOFSTEP]
intros
[GOAL]
this : ∀ (a b : Num), natSize (a * b) ≤ natSize a + natSize b
a✝ b✝ : Num
⊢ ↑(gcd a✝ b✝) = Nat.gcd ↑a✝ ↑b✝
[PROOFSTEP]
unfold gcd
[GOAL]
this : ∀ (a b : Num), natSize (a * b) ≤ natSize a + natSize b
a✝ b✝ : Num
⊢ ↑(if a✝ ≤ b✝ then gcdAux (natSize a✝ + natSize b✝) a✝ b✝ else gcdAux (natSize b✝ + natSize a✝) b✝ a✝) =
    Nat.gcd ↑a✝ ↑b✝
[PROOFSTEP]
split_ifs with h
[GOAL]
case pos
this : ∀ (a b : Num), natSize (a * b) ≤ natSize a + natSize b
a✝ b✝ : Num
h : a✝ ≤ b✝
⊢ ↑(gcdAux (natSize a✝ + natSize b✝) a✝ b✝) = Nat.gcd ↑a✝ ↑b✝
[PROOFSTEP]
exact gcd_to_nat_aux h (this _ _)
[GOAL]
case neg
this : ∀ (a b : Num), natSize (a * b) ≤ natSize a + natSize b
a✝ b✝ : Num
h : ¬a✝ ≤ b✝
⊢ ↑(gcdAux (natSize b✝ + natSize a✝) b✝ a✝) = Nat.gcd ↑a✝ ↑b✝
[PROOFSTEP]
rw [Nat.gcd_comm]
[GOAL]
case neg
this : ∀ (a b : Num), natSize (a * b) ≤ natSize a + natSize b
a✝ b✝ : Num
h : ¬a✝ ≤ b✝
⊢ ↑(gcdAux (natSize b✝ + natSize a✝) b✝ a✝) = Nat.gcd ↑b✝ ↑a✝
[PROOFSTEP]
exact gcd_to_nat_aux (le_of_not_le h) (this _ _)
[GOAL]
m n : Num
⊢ m ∣ n ↔ n % m = 0
[PROOFSTEP]
rw [← dvd_to_nat, Nat.dvd_iff_mod_eq_zero, ← to_nat_inj, mod_to_nat]
[GOAL]
m n : Num
⊢ ↑n % ↑m = 0 ↔ ↑n % ↑m = ↑0
[PROOFSTEP]
rfl
[GOAL]
n : ZNum
⊢ div n 0 = 0
[PROOFSTEP]
cases n
[GOAL]
case zero
⊢ div zero 0 = 0
[PROOFSTEP]
rfl
[GOAL]
case pos
a✝ : PosNum
⊢ div (pos a✝) 0 = 0
[PROOFSTEP]
rfl
[GOAL]
case neg
a✝ : PosNum
⊢ div (neg a✝) 0 = 0
[PROOFSTEP]
rfl
[GOAL]
⊢ ↑(0 / 0) = ↑0 / ↑0
[PROOFSTEP]
simp [Int.ediv_zero]
[GOAL]
n d : PosNum
⊢ ↑(PosNum.div' n d) = ↑(pos n) / ↑(pos d)
[PROOFSTEP]
rw [← Num.to_nat_to_int]
[GOAL]
n d : PosNum
⊢ ↑↑(PosNum.div' n d) = ↑(pos n) / ↑(pos d)
[PROOFSTEP]
simp
[GOAL]
n d : PosNum
⊢ -↑(PosNum.div' n d) = ↑(pos n) / ↑(neg d)
[PROOFSTEP]
rw [← Num.to_nat_to_int]
[GOAL]
n d : PosNum
⊢ -↑↑(PosNum.div' n d) = ↑(pos n) / ↑(neg d)
[PROOFSTEP]
simp
[GOAL]
n d : PosNum
⊢ -↑(Num.succ' (PosNum.pred' n / Num.pos d)) = -↑n / ↑d
[PROOFSTEP]
rw [n.to_int_eq_succ_pred, d.to_int_eq_succ_pred, ← PosNum.to_nat_to_int, Num.succ'_to_nat, Num.div_to_nat]
[GOAL]
n d : PosNum
⊢ -↑(↑(PosNum.pred' n) / ↑(Num.pos d) + 1) = -(↑↑(PosNum.pred' n) + 1) / (↑↑(PosNum.pred' d) + 1)
[PROOFSTEP]
change -[n.pred' / ↑d+1] = -[n.pred' / (d.pred' + 1)+1]
[GOAL]
n d : PosNum
⊢ -[↑(PosNum.pred' n) / ↑d+1] = -[↑(PosNum.pred' n) / (↑(PosNum.pred' d) + 1)+1]
[PROOFSTEP]
rw [d.to_nat_eq_succ_pred]
[GOAL]
n d : PosNum
⊢ ↑(Num.succ' (PosNum.pred' n / Num.pos d)) = -↑n / -↑d
[PROOFSTEP]
rw [n.to_int_eq_succ_pred, d.to_int_eq_succ_pred, ← PosNum.to_nat_to_int, Num.succ'_to_nat, Num.div_to_nat]
[GOAL]
n d : PosNum
⊢ ↑(↑(PosNum.pred' n) / ↑(Num.pos d) + 1) = -(↑↑(PosNum.pred' n) + 1) / -(↑↑(PosNum.pred' d) + 1)
[PROOFSTEP]
change (Nat.succ (_ / d) : ℤ) = Nat.succ (n.pred' / (d.pred' + 1))
[GOAL]
n d : PosNum
⊢ ↑(Nat.succ (↑(PosNum.pred' n) / ↑d)) = ↑(Nat.succ (↑(PosNum.pred' n) / (↑(PosNum.pred' d) + 1)))
[PROOFSTEP]
rw [d.to_nat_eq_succ_pred]
[GOAL]
n : PosNum
d : ZNum
⊢ ↑(Num.pos n % abs d) = ↑(pos n) % ↑d
[PROOFSTEP]
rw [← Num.to_nat_to_int, cast_pos, Num.mod_to_nat, ← PosNum.to_nat_to_int, abs_to_nat]
[GOAL]
n : PosNum
d : ZNum
⊢ ↑(↑(Num.pos n) % natAbs ↑d) = ↑↑n % ↑d
[PROOFSTEP]
rfl
[GOAL]
n : PosNum
d : ZNum
⊢ ↑(abs d) - ↑(Num.succ (PosNum.pred' n % abs d)) = ↑(neg n) % ↑d
[PROOFSTEP]
rw [← Num.to_nat_to_int, cast_neg, ← Num.to_nat_to_int, Num.succ_to_nat, Num.mod_to_nat, abs_to_nat, ←
  Int.subNatNat_eq_coe, n.to_int_eq_succ_pred]
[GOAL]
n : PosNum
d : ZNum
⊢ subNatNat (natAbs ↑d) (↑(PosNum.pred' n) % natAbs ↑d + 1) = -(↑↑(PosNum.pred' n) + 1) % ↑d
[PROOFSTEP]
rfl
[GOAL]
a b : ZNum
⊢ Nat.gcd ↑(abs a) ↑(abs b) = Int.gcd ↑a ↑b
[PROOFSTEP]
simp
[GOAL]
a b : ZNum
⊢ Nat.gcd (natAbs ↑a) (natAbs ↑b) = Int.gcd ↑a ↑b
[PROOFSTEP]
rfl
[GOAL]
m n : ZNum
⊢ m ∣ n ↔ n % m = 0
[PROOFSTEP]
rw [← dvd_to_int, Int.dvd_iff_emod_eq_zero, ← to_int_inj, mod_to_int]
[GOAL]
m n : ZNum
⊢ ↑n % ↑m = 0 ↔ ↑n % ↑m = ↑0
[PROOFSTEP]
rfl
