l3lab/ntp-mathlib huggingface dataset:
theorem cmp_swap (m n) : (cmp m n).swap = cmp n m := by
  cases m <;> 

Proof state:
case pos
α : Type u_1
n : Num
a✝ : PosNum
⊢ Ordering.swap (cmp (pos a✝) n) = cmp n (pos a✝)

Next tactic:
cases n
theorem cmp_swap (m n) : (cmp m n).swap = cmp n m := by
  cases m <;> cases n <;> 

Proof state:
case zero.zero
α : Type u_1
⊢ Ordering.swap (cmp zero zero) = cmp zero zero

Next tactic:
try { unfold cmp }
theorem cmp_swap (m n) : (cmp m n).swap = cmp n m := by
  cases m <;> cases n <;> try 

Proof state:
case zero.zero
α : Type u_1
⊢ Ordering.swap (cmp zero zero) = cmp zero zero

Next tactic:
{ unfold cmp }
theorem cmp_swap (m n) : (cmp m n).swap = cmp n m := by
  cases m <;> cases n <;> try { 

Proof state:
case zero.zero
α : Type u_1
⊢ Ordering.swap (cmp zero zero) = cmp zero zero

Next tactic:
unfold cmp
theorem cmp_swap (m n) : (cmp m n).swap = cmp n m := by
  cases m <;> cases n <;> 

Proof state:
case zero.pos
α : Type u_1
a✝ : PosNum
⊢ Ordering.swap (cmp zero (pos a✝)) = cmp (pos a✝) zero

Next tactic:
try { unfold cmp }
theorem cmp_swap (m n) : (cmp m n).swap = cmp n m := by
  cases m <;> cases n <;> try 

Proof state:
case zero.pos
α : Type u_1
a✝ : PosNum
⊢ Ordering.swap (cmp zero (pos a✝)) = cmp (pos a✝) zero

Next tactic:
{ unfold cmp }
theorem cmp_swap (m n) : (cmp m n).swap = cmp n m := by
  cases m <;> cases n <;> try { 

Proof state:
case zero.pos
α : Type u_1
a✝ : PosNum
⊢ Ordering.swap (cmp zero (pos a✝)) = cmp (pos a✝) zero

Next tactic:
unfold cmp
theorem cmp_swap (m n) : (cmp m n).swap = cmp n m := by
  cases m <;> cases n <;> 

Proof state:
case pos.zero
α : Type u_1
a✝ : PosNum
⊢ Ordering.swap (cmp (pos a✝) zero) = cmp zero (pos a✝)

Next tactic:
try { unfold cmp }
theorem cmp_swap (m n) : (cmp m n).swap = cmp n m := by
  cases m <;> cases n <;> try 

Proof state:
case pos.zero
α : Type u_1
a✝ : PosNum
⊢ Ordering.swap (cmp (pos a✝) zero) = cmp zero (pos a✝)

Next tactic:
{ unfold cmp }
theorem cmp_swap (m n) : (cmp m n).swap = cmp n m := by
  cases m <;> cases n <;> try { 

Proof state:
case pos.zero
α : Type u_1
a✝ : PosNum
⊢ Ordering.swap (cmp (pos a✝) zero) = cmp zero (pos a✝)

Next tactic:
unfold cmp
theorem cmp_swap (m n) : (cmp m n).swap = cmp n m := by
  cases m <;> cases n <;> 

Proof state:
case pos.pos
α : Type u_1
a✝¹ a✝ : PosNum
⊢ Ordering.swap (cmp (pos a✝¹) (pos a✝)) = cmp (pos a✝) (pos a✝¹)

Next tactic:
try { unfold cmp }
theorem cmp_swap (m n) : (cmp m n).swap = cmp n m := by
  cases m <;> cases n <;> try 

Proof state:
case pos.pos
α : Type u_1
a✝¹ a✝ : PosNum
⊢ Ordering.swap (cmp (pos a✝¹) (pos a✝)) = cmp (pos a✝) (pos a✝¹)

Next tactic:
{ unfold cmp }
theorem cmp_swap (m n) : (cmp m n).swap = cmp n m := by
  cases m <;> cases n <;> try { 

Proof state:
case pos.pos
α : Type u_1
a✝¹ a✝ : PosNum
⊢ Ordering.swap (cmp (pos a✝¹) (pos a✝)) = cmp (pos a✝) (pos a✝¹)

Next tactic:
unfold cmp
theorem cmp_swap (m n) : (cmp m n).swap = cmp n m := by
  cases m <;> cases n <;> try { unfold cmp } <;> 

Proof state:
case zero.zero
α : Type u_1
⊢ Ordering.swap (cmp zero zero) = cmp zero zero

Next tactic:
try { rfl }
theorem cmp_swap (m n) : (cmp m n).swap = cmp n m := by
  cases m <;> cases n <;> try { unfold cmp } <;> try 

Proof state:
case zero.zero
α : Type u_1
⊢ Ordering.swap (cmp zero zero) = cmp zero zero

Next tactic:
{ rfl }
theorem cmp_swap (m n) : (cmp m n).swap = cmp n m := by
  cases m <;> cases n <;> try { unfold cmp } <;> try { 

Proof state:
case zero.zero
α : Type u_1
⊢ Ordering.swap (cmp zero zero) = cmp zero zero

Next tactic:
rfl
theorem cmp_swap (m n) : (cmp m n).swap = cmp n m := by
  cases m <;> cases n <;> try { unfold cmp } <;> 

Proof state:
case zero.pos
α : Type u_1
a✝ : PosNum
⊢ Ordering.swap (cmp zero (pos a✝)) = cmp (pos a✝) zero

Next tactic:
try { rfl }
theorem cmp_swap (m n) : (cmp m n).swap = cmp n m := by
  cases m <;> cases n <;> try { unfold cmp } <;> try 

Proof state:
case zero.pos
α : Type u_1
a✝ : PosNum
⊢ Ordering.swap (cmp zero (pos a✝)) = cmp (pos a✝) zero

Next tactic:
{ rfl }
theorem cmp_swap (m n) : (cmp m n).swap = cmp n m := by
  cases m <;> cases n <;> try { unfold cmp } <;> try { 

Proof state:
case zero.pos
α : Type u_1
a✝ : PosNum
⊢ Ordering.swap (cmp zero (pos a✝)) = cmp (pos a✝) zero

Next tactic:
rfl
theorem cmp_swap (m n) : (cmp m n).swap = cmp n m := by
  cases m <;> cases n <;> try { unfold cmp } <;> 

Proof state:
case pos.zero
α : Type u_1
a✝ : PosNum
⊢ Ordering.swap (cmp (pos a✝) zero) = cmp zero (pos a✝)

Next tactic:
try { rfl }
theorem cmp_swap (m n) : (cmp m n).swap = cmp n m := by
  cases m <;> cases n <;> try { unfold cmp } <;> try 

Proof state:
case pos.zero
α : Type u_1
a✝ : PosNum
⊢ Ordering.swap (cmp (pos a✝) zero) = cmp zero (pos a✝)

Next tactic:
{ rfl }
theorem cmp_swap (m n) : (cmp m n).swap = cmp n m := by
  cases m <;> cases n <;> try { unfold cmp } <;> try { 

Proof state:
case pos.zero
α : Type u_1
a✝ : PosNum
⊢ Ordering.swap (cmp (pos a✝) zero) = cmp zero (pos a✝)

Next tactic:
rfl
theorem cmp_swap (m n) : (cmp m n).swap = cmp n m := by
  cases m <;> cases n <;> try { unfold cmp } <;> 

Proof state:
case pos.pos
α : Type u_1
a✝¹ a✝ : PosNum
⊢ Ordering.swap (cmp (pos a✝¹) (pos a✝)) = cmp (pos a✝) (pos a✝¹)

Next tactic:
try { rfl }
theorem cmp_swap (m n) : (cmp m n).swap = cmp n m := by
  cases m <;> cases n <;> try { unfold cmp } <;> try 

Proof state:
case pos.pos
α : Type u_1
a✝¹ a✝ : PosNum
⊢ Ordering.swap (cmp (pos a✝¹) (pos a✝)) = cmp (pos a✝) (pos a✝¹)

Next tactic:
{ rfl }
theorem cmp_swap (m n) : (cmp m n).swap = cmp n m := by
  cases m <;> cases n <;> try { unfold cmp } <;> try { 

Proof state:
case pos.pos
α : Type u_1
a✝¹ a✝ : PosNum
⊢ Ordering.swap (cmp (pos a✝¹) (pos a✝)) = cmp (pos a✝) (pos a✝¹)

Next tactic:
rfl
theorem cmp_swap (m n) : (cmp m n).swap = cmp n m := by
  cases m <;> cases n <;> try { unfold cmp } <;> try { rfl }; 

Proof state:
case pos.pos
α : Type u_1
a✝¹ a✝ : PosNum
⊢ Ordering.swap (cmp (pos a✝¹) (pos a✝)) = cmp (pos a✝) (pos a✝¹)

Next tactic:
apply PosNum.cmp_swap
theorem cmp_eq (m n) : cmp m n = Ordering.eq ↔ m = n := by
  

Proof state:
α : Type u_1
m n : Num
⊢ cmp m n = Ordering.eq ↔ m = n

Next tactic:
have := cmp_to_nat m n
theorem cmp_eq (m n) : cmp m n = Ordering.eq ↔ m = n := by
  have := cmp_to_nat m n
  -- Porting note: `cases` didn't rewrite at `this`, so `revert` & `intro` are required.
  

Proof state:
α : 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

Next tactic:
revert this
theorem cmp_eq (m n) : cmp m n = Ordering.eq ↔ m = n := by
  have := cmp_to_nat m n
  -- Porting note: `cases` didn't rewrite at `this`, so `revert` & `intro` are required.
  revert this; 

Proof state:
α : Type u_1
m n : Num
⊢ Ordering.casesOn (cmp m n) (↑m < ↑n) (m = n) (↑n < ↑m) → (cmp m n = Ordering.eq ↔ m = n)

Next tactic:
cases cmp m n
theorem cmp_eq (m n) : cmp m n = Ordering.eq ↔ m = n := by
  have := cmp_to_nat m n
  -- Porting note: `cases` didn't rewrite at `this`, so `revert` & `intro` are required.
  revert this; cases cmp m n <;> 

Proof state:
case lt
α : Type u_1
m n : Num
⊢ Ordering.casesOn Ordering.lt (↑m < ↑n) (m = n) (↑n < ↑m) → (Ordering.lt = Ordering.eq ↔ m = n)

Next tactic:
intro this
theorem cmp_eq (m n) : cmp m n = Ordering.eq ↔ m = n := by
  have := cmp_to_nat m n
  -- Porting note: `cases` didn't rewrite at `this`, so `revert` & `intro` are required.
  revert this; cases cmp m n <;> 

Proof state:
case eq
α : Type u_1
m n : Num
⊢ Ordering.casesOn Ordering.eq (↑m < ↑n) (m = n) (↑n < ↑m) → (Ordering.eq = Ordering.eq ↔ m = n)

Next tactic:
intro this
theorem cmp_eq (m n) : cmp m n = Ordering.eq ↔ m = n := by
  have := cmp_to_nat m n
  -- Porting note: `cases` didn't rewrite at `this`, so `revert` & `intro` are required.
  revert this; cases cmp m n <;> 

Proof state:
case gt
α : Type u_1
m n : Num
⊢ Ordering.casesOn Ordering.gt (↑m < ↑n) (m = n) (↑n < ↑m) → (Ordering.gt = Ordering.eq ↔ m = n)

Next tactic:
intro this
theorem cmp_eq (m n) : cmp m n = Ordering.eq ↔ m = n := by
  have := cmp_to_nat m n
  -- Porting note: `cases` didn't rewrite at `this`, so `revert` & `intro` are required.
  revert this; cases cmp m n <;> intro this <;> 

Proof state:
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

Next tactic:
simp at this ⊢
theorem cmp_eq (m n) : cmp m n = Ordering.eq ↔ m = n := by
  have := cmp_to_nat m n
  -- Porting note: `cases` didn't rewrite at `this`, so `revert` & `intro` are required.
  revert this; cases cmp m n <;> intro this <;> 

Proof state:
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

Next tactic:
simp at this ⊢
theorem cmp_eq (m n) : cmp m n = Ordering.eq ↔ m = n := by
  have := cmp_to_nat m n
  -- Porting note: `cases` didn't rewrite at `this`, so `revert` & `intro` are required.
  revert this; cases cmp m n <;> intro this <;> 

Proof state:
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

Next tactic:
simp at this ⊢
theorem cmp_eq (m n) : cmp m n = Ordering.eq ↔ m = n := by
  have := cmp_to_nat m n
  -- Porting note: `cases` didn't rewrite at `this`, so `revert` & `intro` are required.
  revert this; cases cmp m n <;> intro this <;> simp at this ⊢ <;> 

Proof state:
case lt
α : Type u_1
m n : Num
this : ↑m < ↑n
⊢ ¬m = n

Next tactic:
try { exact this }
theorem cmp_eq (m n) : cmp m n = Ordering.eq ↔ m = n := by
  have := cmp_to_nat m n
  -- Porting note: `cases` didn't rewrite at `this`, so `revert` & `intro` are required.
  revert this; cases cmp m n <;> intro this <;> simp at this ⊢ <;> try 

Proof state:
case lt
α : Type u_1
m n : Num
this : ↑m < ↑n
⊢ ¬m = n

Next tactic:
{ exact this }
theorem cmp_eq (m n) : cmp m n = Ordering.eq ↔ m = n := by
  have := cmp_to_nat m n
  -- Porting note: `cases` didn't rewrite at `this`, so `revert` & `intro` are required.
  revert this; cases cmp m n <;> intro this <;> simp at this ⊢ <;> try { 

Proof state:
case lt
α : Type u_1
m n : Num
this : ↑m < ↑n
⊢ ¬m = n

Next tactic:
exact this
theorem cmp_eq (m n) : cmp m n = Ordering.eq ↔ m = n := by
  have := cmp_to_nat m n
  -- Porting note: `cases` didn't rewrite at `this`, so `revert` & `intro` are required.
  revert this; cases cmp m n <;> intro this <;> simp at this ⊢ <;> 

Proof state:
case eq
α : Type u_1
m n : Num
this : m = n
⊢ m = n

Next tactic:
try { exact this }
theorem cmp_eq (m n) : cmp m n = Ordering.eq ↔ m = n := by
  have := cmp_to_nat m n
  -- Porting note: `cases` didn't rewrite at `this`, so `revert` & `intro` are required.
  revert this; cases cmp m n <;> intro this <;> simp at this ⊢ <;> try 

Proof state:
case eq
α : Type u_1
m n : Num
this : m = n
⊢ m = n

Next tactic:
{ exact this }
theorem cmp_eq (m n) : cmp m n = Ordering.eq ↔ m = n := by
  have := cmp_to_nat m n
  -- Porting note: `cases` didn't rewrite at `this`, so `revert` & `intro` are required.
  revert this; cases cmp m n <;> intro this <;> simp at this ⊢ <;> try { 

Proof state:
case eq
α : Type u_1
m n : Num
this : m = n
⊢ m = n

Next tactic:
exact this
theorem cmp_eq (m n) : cmp m n = Ordering.eq ↔ m = n := by
  have := cmp_to_nat m n
  -- Porting note: `cases` didn't rewrite at `this`, so `revert` & `intro` are required.
  revert this; cases cmp m n <;> intro this <;> simp at this ⊢ <;> 

Proof state:
case gt
α : Type u_1
m n : Num
this : ↑n < ↑m
⊢ ¬m = n

Next tactic:
try { exact this }
theorem cmp_eq (m n) : cmp m n = Ordering.eq ↔ m = n := by
  have := cmp_to_nat m n
  -- Porting note: `cases` didn't rewrite at `this`, so `revert` & `intro` are required.
  revert this; cases cmp m n <;> intro this <;> simp at this ⊢ <;> try 

Proof state:
case gt
α : Type u_1
m n : Num
this : ↑n < ↑m
⊢ ¬m = n

Next tactic:
{ exact this }
theorem cmp_eq (m n) : cmp m n = Ordering.eq ↔ m = n := by
  have := cmp_to_nat m n
  -- Porting note: `cases` didn't rewrite at `this`, so `revert` & `intro` are required.
  revert this; cases cmp m n <;> intro this <;> simp at this ⊢ <;> try { 

Proof state:
case gt
α : Type u_1
m n : Num
this : ↑n < ↑m
⊢ ¬m = n

Next tactic:
exact this
theorem cmp_eq (m n) : cmp m n = Ordering.eq ↔ m = n := by
  have := cmp_to_nat m n
  -- Porting note: `cases` didn't rewrite at `this`, so `revert` & `intro` are required.
  revert this; cases cmp m n <;> intro this <;> simp at this ⊢ <;> try { exact this } <;>
    

Proof state:
case lt
α : Type u_1
m n : Num
this : ↑m < ↑n
⊢ ¬m = n

Next tactic:
simp [show m ≠ n from fun e => by rw [e] at this; exact lt_irrefl _ this]
theorem cmp_eq (m n) : cmp m n = Ordering.eq ↔ m = n := by
  have := cmp_to_nat m n
  -- Porting note: `cases` didn't rewrite at `this`, so `revert` & `intro` are required.
  revert this; cases cmp m n <;> intro this <;> simp at this ⊢ <;> try { exact this } <;>
    simp [show m ≠ n from fun e => by 

Proof state:
α : Type u_1
m n : Num
this : ↑m < ↑n
e : m = n
⊢ False

Next tactic:
rw [e] at this
theorem cmp_eq (m n) : cmp m n = Ordering.eq ↔ m = n := by
  have := cmp_to_nat m n
  -- Porting note: `cases` didn't rewrite at `this`, so `revert` & `intro` are required.
  revert this; cases cmp m n <;> intro this <;> simp at this ⊢ <;> try { exact this } <;>
    simp [show m ≠ n from fun e => by rw [e] at this; 

Proof state:
α : Type u_1
m n : Num
this : ↑n < ↑n
e : m = n
⊢ False

Next tactic:
exact lt_irrefl _ this
theorem cmp_eq (m n) : cmp m n = Ordering.eq ↔ m = n := by
  have := cmp_to_nat m n
  -- Porting note: `cases` didn't rewrite at `this`, so `revert` & `intro` are required.
  revert this; cases cmp m n <;> intro this <;> simp at this ⊢ <;> try { exact this } <;>
    

Proof state:
case gt
α : Type u_1
m n : Num
this : ↑n < ↑m
⊢ ¬m = n

Next tactic:
simp [show m ≠ n from fun e => by rw [e] at this; exact lt_irrefl _ this]
theorem cmp_eq (m n) : cmp m n = Ordering.eq ↔ m = n := by
  have := cmp_to_nat m n
  -- Porting note: `cases` didn't rewrite at `this`, so `revert` & `intro` are required.
  revert this; cases cmp m n <;> intro this <;> simp at this ⊢ <;> try { exact this } <;>
    simp [show m ≠ n from fun e => by 

Proof state:
α : Type u_1
m n : Num
this : ↑n < ↑m
e : m = n
⊢ False

Next tactic:
rw [e] at this
@[simp, norm_cast]
theorem cast_lt [LinearOrderedSemiring α] {m n : Num} : (m : α) < n ↔ m < n := by
  

Proof state:
α : Type u_1
inst✝ : LinearOrderedSemiring α
m n : Num
⊢ ↑m < ↑n ↔ m < n

Next tactic:
rw [← cast_to_nat m, ← cast_to_nat n, Nat.cast_lt (α := α), lt_to_nat]
@[simp, norm_cast]
theorem cast_le [LinearOrderedSemiring α] {m n : Num} : (m : α) ≤ n ↔ m ≤ n := by
  

Proof state:
α : Type u_1
inst✝ : LinearOrderedSemiring α
m n : Num
⊢ ↑m ≤ ↑n ↔ m ≤ n

Next tactic:
rw [← not_lt]
@[simp, norm_cast]
theorem cast_le [LinearOrderedSemiring α] {m n : Num} : (m : α) ≤ n ↔ m ≤ n := by
  rw [← not_lt]; 

Proof state:
α : Type u_1
inst✝ : LinearOrderedSemiring α
m n : Num
⊢ ¬↑n < ↑m ↔ m ≤ n

Next tactic:
exact not_congr cast_lt
@[simp, norm_cast]
theorem cast_inj [LinearOrderedSemiring α] {m n : Num} : (m : α) = n ↔ m = n := by
  

Proof state:
α : Type u_1
inst✝ : LinearOrderedSemiring α
m n : Num
⊢ ↑m = ↑n ↔ m = n

Next tactic:
rw [← cast_to_nat m, ← cast_to_nat n, Nat.cast_inj, to_nat_inj]
theorem le_iff_cmp {m n} : m ≤ n ↔ cmp m n ≠ Ordering.gt :=
  not_congr <| lt_iff_cmp.trans <| by 

Proof state:
α : Type u_1
m n : Num
⊢ cmp n m = Ordering.lt ↔ cmp m n = Ordering.gt

Next tactic:
rw [← cmp_swap]
theorem le_iff_cmp {m n} : m ≤ n ↔ cmp m n ≠ Ordering.gt :=
  not_congr <| lt_iff_cmp.trans <| by rw [← cmp_swap]; 

Proof state:
α : Type u_1
m n : Num
⊢ Ordering.swap (cmp m n) = Ordering.lt ↔ cmp m n = Ordering.gt

Next tactic:
cases cmp m n
theorem le_iff_cmp {m n} : m ≤ n ↔ cmp m n ≠ Ordering.gt :=
  not_congr <| lt_iff_cmp.trans <| by rw [← cmp_swap]; cases cmp m n <;> 

Proof state:
case lt
α : Type u_1
m n : Num
⊢ Ordering.swap Ordering.lt = Ordering.lt ↔ Ordering.lt = Ordering.gt

Next tactic:
exact by decide
theorem le_iff_cmp {m n} : m ≤ n ↔ cmp m n ≠ Ordering.gt :=
  not_congr <| lt_iff_cmp.trans <| by rw [← cmp_swap]; cases cmp m n <;> exact by 

Proof state:
α : Type u_1
m n : Num
⊢ Ordering.swap Ordering.lt = Ordering.lt ↔ Ordering.lt = Ordering.gt

Next tactic:
decide
theorem le_iff_cmp {m n} : m ≤ n ↔ cmp m n ≠ Ordering.gt :=
  not_congr <| lt_iff_cmp.trans <| by rw [← cmp_swap]; cases cmp m n <;> 

Proof state:
case eq
α : Type u_1
m n : Num
⊢ Ordering.swap Ordering.eq = Ordering.lt ↔ Ordering.eq = Ordering.gt

Next tactic:
exact by decide
theorem le_iff_cmp {m n} : m ≤ n ↔ cmp m n ≠ Ordering.gt :=
  not_congr <| lt_iff_cmp.trans <| by rw [← cmp_swap]; cases cmp m n <;> exact by 

Proof state:
α : Type u_1
m n : Num
⊢ Ordering.swap Ordering.eq = Ordering.lt ↔ Ordering.eq = Ordering.gt

Next tactic:
decide
theorem le_iff_cmp {m n} : m ≤ n ↔ cmp m n ≠ Ordering.gt :=
  not_congr <| lt_iff_cmp.trans <| by rw [← cmp_swap]; cases cmp m n <;> 

Proof state:
case gt
α : Type u_1
m n : Num
⊢ Ordering.swap Ordering.gt = Ordering.lt ↔ Ordering.gt = Ordering.gt

Next tactic:
exact by decide
theorem le_iff_cmp {m n} : m ≤ n ↔ cmp m n ≠ Ordering.gt :=
  not_congr <| lt_iff_cmp.trans <| by rw [← cmp_swap]; cases cmp m n <;> exact by 

Proof state:
α : Type u_1
m n : Num
⊢ Ordering.swap Ordering.gt = Ordering.lt ↔ Ordering.gt = Ordering.gt

Next tactic:
decide
theorem castNum_eq_bitwise {f : Num → Num → Num} {g : Bool → Bool → Bool}
    (p : PosNum → PosNum → Num)
    (gff : g false false = false) (f00 : f 0 0 = 0)
    (f0n : ∀ n, f 0 (pos n) = cond (g false true) (pos n) 0)
    (fn0 : ∀ n, f (pos n) 0 = cond (g true false) (pos n) 0)
    (fnn : ∀ m n, f (pos m) (pos n) = p m n) (p11 : p 1 1 = cond (g true true) 1 0)
    (p1b : ∀ b n, p 1 (PosNum.bit b n) = bit (g true b) (cond (g false true) (pos n) 0))
    (pb1 : ∀ a m, p (PosNum.bit a m) 1 = bit (g a true) (cond (g true false) (pos m) 0))
    (pbb : ∀ a b m n, 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 := by
  

Proof state:
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 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

Next tactic:
intros m n
theorem castNum_eq_bitwise {f : Num → Num → Num} {g : Bool → Bool → Bool}
    (p : PosNum → PosNum → Num)
    (gff : g false false = false) (f00 : f 0 0 = 0)
    (f0n : ∀ n, f 0 (pos n) = cond (g false true) (pos n) 0)
    (fn0 : ∀ n, f (pos n) 0 = cond (g true false) (pos n) 0)
    (fnn : ∀ m n, f (pos m) (pos n) = p m n) (p11 : p 1 1 = cond (g true true) 1 0)
    (p1b : ∀ b n, p 1 (PosNum.bit b n) = bit (g true b) (cond (g false true) (pos n) 0))
    (pb1 : ∀ a m, p (PosNum.bit a m) 1 = bit (g a true) (cond (g true false) (pos m) 0))
    (pbb : ∀ a b m n, 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 := by
  intros m n
  

Proof state:
α : Type u_1
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 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

Next tactic:
cases' m with m
theorem castNum_eq_bitwise {f : Num → Num → Num} {g : Bool → Bool → Bool}
    (p : PosNum → PosNum → Num)
    (gff : g false false = false) (f00 : f 0 0 = 0)
    (f0n : ∀ n, f 0 (pos n) = cond (g false true) (pos n) 0)
    (fn0 : ∀ n, f (pos n) 0 = cond (g true false) (pos n) 0)
    (fnn : ∀ m n, f (pos m) (pos n) = p m n) (p11 : p 1 1 = cond (g true true) 1 0)
    (p1b : ∀ b n, p 1 (PosNum.bit b n) = bit (g true b) (cond (g false true) (pos n) 0))
    (pb1 : ∀ a m, p (PosNum.bit a m) 1 = bit (g a true) (cond (g true false) (pos m) 0))
    (pbb : ∀ a b m n, 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 := by
  intros m n
  cases' m with m <;> 

Proof state:
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

Next tactic:
cases' n with n
theorem castNum_eq_bitwise {f : Num → Num → Num} {g : Bool → Bool → Bool}
    (p : PosNum → PosNum → Num)
    (gff : g false false = false) (f00 : f 0 0 = 0)
    (f0n : ∀ n, f 0 (pos n) = cond (g false true) (pos n) 0)
    (fn0 : ∀ n, f (pos n) 0 = cond (g true false) (pos n) 0)
    (fnn : ∀ m n, f (pos m) (pos n) = p m n) (p11 : p 1 1 = cond (g true true) 1 0)
    (p1b : ∀ b n, p 1 (PosNum.bit b n) = bit (g true b) (cond (g false true) (pos n) 0))
    (pb1 : ∀ a m, p (PosNum.bit a m) 1 = bit (g a true) (cond (g true false) (pos m) 0))
    (pbb : ∀ a b m n, 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 := by
  intros m n
  cases' m with m <;> 

Proof state:
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

Next tactic:
cases' n with n