Theorem: FinInt.add_toSint_msb (MLIR/Util/FinInt.lean)

State before:
sz : ℕ
n m : FinInt (sz + 1)
⊢ toSint (n + m) =
    match n, m with
    | next false n', next false m' =>
      match n + m with
      | next false a => toSint n + toSint m
      | next true a => toSint n + toSint m - 2 ^ (sz + 1)
    | next false n', next true m' => toSint n + toSint m
    | next true n', next false m' => toSint n + toSint m
    | next true n', next true m' =>
      match n + m with
      | next false a => toSint n + toSint m + 2 ^ (sz + 1)
      | next true a => toSint n + toSint m
Tactic:
have h := addfull_toSint n m
State after:
sz : ℕ
n m : FinInt (sz + 1)
h :
  toSint (addfull n m) =
    match n, m with
    | next false n', next false m' => toSint n + toSint m
    | next false n', next true m' =>
      match addfull n m with
      | next false a => toSint n + toSint m + 2 ^ (sz + 1)
      | next true a => toSint n + toSint m - 2 ^ (sz + 1)
    | next true n', next false m' =>
      match addfull n m with
      | next false a => toSint n + toSint m + 2 ^ (sz + 1)
      | next true a => toSint n + toSint m - 2 ^ (sz + 1)
    | next true n', next true m' => toSint n + toSint m
⊢ toSint (n + m) =
    match n, m with
    | next false n', next false m' =>
      match n + m with
      | next false a => toSint n + toSint m
      | next true a => toSint n + toSint m - 2 ^ (sz + 1)
    | next false n', next true m' => toSint n + toSint m
    | next true n', next false m' => toSint n + toSint m
    | next true n', next true m' =>
      match n + m with
      | next false a => toSint n + toSint m + 2 ^ (sz + 1)
      | next true a => toSint n + toSint m

State before:
sz : ℕ
n m : FinInt (sz + 1)
h :
  toSint (addfull n m) =
    match n, m with
    | next false n', next false m' => toSint n + toSint m
    | next false n', next true m' =>
      match addfull n m with
      | next false a => toSint n + toSint m + 2 ^ (sz + 1)
      | next true a => toSint n + toSint m - 2 ^ (sz + 1)
    | next true n', next false m' =>
      match addfull n m with
      | next false a => toSint n + toSint m + 2 ^ (sz + 1)
      | next true a => toSint n + toSint m - 2 ^ (sz + 1)
    | next true n', next true m' => toSint n + toSint m
⊢ toSint (n + m) =
    match n, m with
    | next false n', next false m' =>
      match n + m with
      | next false a => toSint n + toSint m
      | next true a => toSint n + toSint m - 2 ^ (sz + 1)
    | next false n', next true m' => toSint n + toSint m
    | next true n', next false m' => toSint n + toSint m
    | next true n', next true m' =>
      match n + m with
      | next false a => toSint n + toSint m + 2 ^ (sz + 1)
      | next true a => toSint n + toSint m
Tactic:
cases n
State after:
case next
sz : ℕ
m : FinInt (sz + 1)
a✝¹ : Bool
a✝ : FinInt sz
h :
  toSint (addfull (next a✝¹ a✝) m) =
    match next a✝¹ a✝, m with
    | next false n', next false m' => toSint (next a✝¹ a✝) + toSint m
    | next false n', next true m' =>
      match addfull (next a✝¹ a✝) m with
      | next false a => toSint (next a✝¹ a✝) + toSint m + 2 ^ (sz + 1)
      | next true a => toSint (next a✝¹ a✝) + toSint m - 2 ^ (sz + 1)
    | next true n', next false m' =>
      match addfull (next a✝¹ a✝) m with
      | next false a => toSint (next a✝¹ a✝) + toSint m + 2 ^ (sz + 1)
      | next true a => toSint (next a✝¹ a✝) + toSint m - 2 ^ (sz + 1)
    | next true n', next true m' => toSint (next a✝¹ a✝) + toSint m
⊢ toSint (next a✝¹ a✝ + m) =
    match next a✝¹ a✝, m with
    | next false n', next false m' =>
      match next a✝¹ a✝ + m with
      | next false a => toSint (next a✝¹ a✝) + toSint m
      | next true a => toSint (next a✝¹ a✝) + toSint m - 2 ^ (sz + 1)
    | next false n', next true m' => toSint (next a✝¹ a✝) + toSint m
    | next true n', next false m' => toSint (next a✝¹ a✝) + toSint m
    | next true n', next true m' =>
      match next a✝¹ a✝ + m with
      | next false a => toSint (next a✝¹ a✝) + toSint m + 2 ^ (sz + 1)
      | next true a => toSint (next a✝¹ a✝) + toSint m

State before:
sz : ℕ
m : FinInt (sz + 1)
bn : Bool
n' : FinInt sz
h :
  toSint (addfull (next bn n') m) =
    match next bn n', m with
    | next false n'_1, next false m' => toSint (next bn n') + toSint m
    | next false n'_1, next true m' =>
      match addfull (next bn n') m with
      | next false a => toSint (next bn n') + toSint m + 2 ^ (sz + 1)
      | next true a => toSint (next bn n') + toSint m - 2 ^ (sz + 1)
    | next true n'_1, next false m' =>
      match addfull (next bn n') m with
      | next false a => toSint (next bn n') + toSint m + 2 ^ (sz + 1)
      | next true a => toSint (next bn n') + toSint m - 2 ^ (sz + 1)
    | next true n'_1, next true m' => toSint (next bn n') + toSint m
⊢ toSint (next bn n' + m) =
    match next bn n', m with
    | next false n'_1, next false m' =>
      match next bn n' + m with
      | next false a => toSint (next bn n') + toSint m
      | next true a => toSint (next bn n') + toSint m - 2 ^ (sz + 1)
    | next false n'_1, next true m' => toSint (next bn n') + toSint m
    | next true n'_1, next false m' => toSint (next bn n') + toSint m
    | next true n'_1, next true m' =>
      match next bn n' + m with
      | next false a => toSint (next bn n') + toSint m + 2 ^ (sz + 1)
      | next true a => toSint (next bn n') + toSint m
Tactic:
case next bn n' =>
cases m; case next bm m' =>
cases bn <;> cases bm <;> simp [addfull] at *
case false.false =>
match h': addfull n' m' with
| .next br r =>
rw [h'] at h
cases br <;> simp [bne, toSint] at * <;> sorry_arith
case false.true =>
match h': addfull n' m' with
| .next br r =>
rw [h'] at h
cases br <;> simp [bne, BEq.beq, toSint] at * <;> sorry_arith
case true.false =>
match h': addfull n' m' with
| .next br r =>
rw [h'] at h
cases br <;> simp [bne, BEq.beq, toSint] at * <;> sorry_arith
case true.true =>
match h': addfull n' m' with
| .next br r =>
rw [h'] at h
cases br <;> simp [bne, toSint] at * <;> sorry_arith
State after:
no goals

State before:
sz : ℕ
m : FinInt (sz + 1)
bn : Bool
n' : FinInt sz
h :
  toSint (addfull (next bn n') m) =
    match next bn n', m with
    | next false n'_1, next false m' => toSint (next bn n') + toSint m
    | next false n'_1, next true m' =>
      match addfull (next bn n') m with
      | next false a => toSint (next bn n') + toSint m + 2 ^ (sz + 1)
      | next true a => toSint (next bn n') + toSint m - 2 ^ (sz + 1)
    | next true n'_1, next false m' =>
      match addfull (next bn n') m with
      | next false a => toSint (next bn n') + toSint m + 2 ^ (sz + 1)
      | next true a => toSint (next bn n') + toSint m - 2 ^ (sz + 1)
    | next true n'_1, next true m' => toSint (next bn n') + toSint m
⊢ toSint (next bn n' + m) =
    match next bn n', m with
    | next false n'_1, next false m' =>
      match next bn n' + m with
      | next false a => toSint (next bn n') + toSint m
      | next true a => toSint (next bn n') + toSint m - 2 ^ (sz + 1)
    | next false n'_1, next true m' => toSint (next bn n') + toSint m
    | next true n'_1, next false m' => toSint (next bn n') + toSint m
    | next true n'_1, next true m' =>
      match next bn n' + m with
      | next false a => toSint (next bn n') + toSint m + 2 ^ (sz + 1)
      | next true a => toSint (next bn n') + toSint m
Tactic:
cases m
State after:
case next
sz : ℕ
bn : Bool
n' : FinInt sz
a✝¹ : Bool
a✝ : FinInt sz
h :
  toSint (addfull (next bn n') (next a✝¹ a✝)) =
    match next bn n', next a✝¹ a✝ with
    | next false n'_1, next false m' => toSint (next bn n') + toSint (next a✝¹ a✝)
    | next false n'_1, next true m' =>
      match addfull (next bn n') (next a✝¹ a✝) with
      | next false a => toSint (next bn n') + toSint (next a✝¹ a✝) + 2 ^ (sz + 1)
      | next true a => toSint (next bn n') + toSint (next a✝¹ a✝) - 2 ^ (sz + 1)
    | next true n'_1, next false m' =>
      match addfull (next bn n') (next a✝¹ a✝) with
      | next false a => toSint (next bn n') + toSint (next a✝¹ a✝) + 2 ^ (sz + 1)
      | next true a => toSint (next bn n') + toSint (next a✝¹ a✝) - 2 ^ (sz + 1)
    | next true n'_1, next true m' => toSint (next bn n') + toSint (next a✝¹ a✝)
⊢ toSint (next bn n' + next a✝¹ a✝) =
    match next bn n', next a✝¹ a✝ with
    | next false n'_1, next false m' =>
      match next bn n' + next a✝¹ a✝ with
      | next false a => toSint (next bn n') + toSint (next a✝¹ a✝)
      | next true a => toSint (next bn n') + toSint (next a✝¹ a✝) - 2 ^ (sz + 1)
    | next false n'_1, next true m' => toSint (next bn n') + toSint (next a✝¹ a✝)
    | next true n'_1, next false m' => toSint (next bn n') + toSint (next a✝¹ a✝)
    | next true n'_1, next true m' =>
      match next bn n' + next a✝¹ a✝ with
      | next false a => toSint (next bn n') + toSint (next a✝¹ a✝) + 2 ^ (sz + 1)
      | next true a => toSint (next bn n') + toSint (next a✝¹ a✝)

State before:
sz : ℕ
bn : Bool
n' : FinInt sz
bm : Bool
m' : FinInt sz
h :
  toSint (addfull (next bn n') (next bm m')) =
    match next bn n', next bm m' with
    | next false n'_1, next false m'_1 => toSint (next bn n') + toSint (next bm m')
    | next false n'_1, next true m'_1 =>
      match addfull (next bn n') (next bm m') with
      | next false a => toSint (next bn n') + toSint (next bm m') + 2 ^ (sz + 1)
      | next true a => toSint (next bn n') + toSint (next bm m') - 2 ^ (sz + 1)
    | next true n'_1, next false m'_1 =>
      match addfull (next bn n') (next bm m') with
      | next false a => toSint (next bn n') + toSint (next bm m') + 2 ^ (sz + 1)
      | next true a => toSint (next bn n') + toSint (next bm m') - 2 ^ (sz + 1)
    | next true n'_1, next true m'_1 => toSint (next bn n') + toSint (next bm m')
⊢ toSint (next bn n' + next bm m') =
    match next bn n', next bm m' with
    | next false n'_1, next false m'_1 =>
      match next bn n' + next bm m' with
      | next false a => toSint (next bn n') + toSint (next bm m')
      | next true a => toSint (next bn n') + toSint (next bm m') - 2 ^ (sz + 1)
    | next false n'_1, next true m'_1 => toSint (next bn n') + toSint (next bm m')
    | next true n'_1, next false m'_1 => toSint (next bn n') + toSint (next bm m')
    | next true n'_1, next true m'_1 =>
      match next bn n' + next bm m' with
      | next false a => toSint (next bn n') + toSint (next bm m') + 2 ^ (sz + 1)
      | next true a => toSint (next bn n') + toSint (next bm m')
Tactic:
case next bm m' =>
cases bn <;> cases bm <;> simp [addfull] at *
case false.false =>
match h': addfull n' m' with
| .next br r =>
rw [h'] at h
cases br <;> simp [bne, toSint] at * <;> sorry_arith
case false.true =>
match h': addfull n' m' with
| .next br r =>
rw [h'] at h
cases br <;> simp [bne, BEq.beq, toSint] at * <;> sorry_arith
case true.false =>
match h': addfull n' m' with
| .next br r =>
rw [h'] at h
cases br <;> simp [bne, BEq.beq, toSint] at * <;> sorry_arith
case true.true =>
match h': addfull n' m' with
| .next br r =>
rw [h'] at h
cases br <;> simp [bne, toSint] at * <;> sorry_arith
State after:
no goals

State before:
sz : ℕ
bn : Bool
n' : FinInt sz
bm : Bool
m' : FinInt sz
h :
  toSint (addfull (next bn n') (next bm m')) =
    match next bn n', next bm m' with
    | next false n'_1, next false m'_1 => toSint (next bn n') + toSint (next bm m')
    | next false n'_1, next true m'_1 =>
      match addfull (next bn n') (next bm m') with
      | next false a => toSint (next bn n') + toSint (next bm m') + 2 ^ (sz + 1)
      | next true a => toSint (next bn n') + toSint (next bm m') - 2 ^ (sz + 1)
    | next true n'_1, next false m'_1 =>
      match addfull (next bn n') (next bm m') with
      | next false a => toSint (next bn n') + toSint (next bm m') + 2 ^ (sz + 1)
      | next true a => toSint (next bn n') + toSint (next bm m') - 2 ^ (sz + 1)
    | next true n'_1, next true m'_1 => toSint (next bn n') + toSint (next bm m')
⊢ toSint (next bn n' + next bm m') =
    match next bn n', next bm m' with
    | next false n'_1, next false m'_1 =>
      match next bn n' + next bm m' with
      | next false a => toSint (next bn n') + toSint (next bm m')
      | next true a => toSint (next bn n') + toSint (next bm m') - 2 ^ (sz + 1)
    | next false n'_1, next true m'_1 => toSint (next bn n') + toSint (next bm m')
    | next true n'_1, next false m'_1 => toSint (next bn n') + toSint (next bm m')
    | next true n'_1, next true m'_1 =>
      match next bn n' + next bm m' with
      | next false a => toSint (next bn n') + toSint (next bm m') + 2 ^ (sz + 1)
      | next true a => toSint (next bn n') + toSint (next bm m')
Tactic:
cases bn <;> cases bm <;> simp [addfull] at *
State after:
case false.false
sz : ℕ
n' m' : FinInt sz
h :
  toSint
      (match addfull n' m' with
      | next false r => next false (next false r)
      | next true r => next false (next true r)) =
    toSint (next false n') + toSint (next false m')
⊢ toSint (next false n' + next false m') =
    match next false n' + next false m' with
    | next false a => toSint (next false n') + toSint (next false m')
    | next true a => toSint (next false n') + toSint (next false m') - 2 ^ (sz + 1)

case false.true
sz : ℕ
n' m' : FinInt sz
h :
  toSint
      (match addfull n' m' with
      | next false r => next false (next (false != true) r)
      | next true r => next true (next (false == true) r)) =
    match
      match addfull n' m' with
      | next false r => next false (next (false != true) r)
      | next true r => next true (next (false == true) r) with
    | next false a => toSint (next false n') + toSint (next true m') + 2 ^ (sz + 1)
    | next true a => toSint (next false n') + toSint (next true m') - 2 ^ (sz + 1)
⊢ toSint (next false n' + next true m') = toSint (next false n') + toSint (next true m')

case true.false
sz : ℕ
n' m' : FinInt sz
h :
  toSint
      (match addfull n' m' with
      | next false r => next false (next (true != false) r)
      | next true r => next true (next (true == false) r)) =
    match
      match addfull n' m' with
      | next false r => next false (next (true != false) r)
      | next true r => next true (next (true == false) r) with
    | next false a => toSint (next true n') + toSint (next false m') + 2 ^ (sz + 1)
    | next true a => toSint (next true n') + toSint (next false m') - 2 ^ (sz + 1)
⊢ toSint (next true n' + next false m') = toSint (next true n') + toSint (next false m')

case true.true
sz : ℕ
n' m' : FinInt sz
h :
  toSint
      (match addfull n' m' with
      | next false r => next true (next false r)
      | next true r => next true (next true r)) =
    toSint (next true n') + toSint (next true m')
⊢ toSint (next true n' + next true m') =
    match next true n' + next true m' with
    | next false a => toSint (next true n') + toSint (next true m') + 2 ^ (sz + 1)
    | next true a => toSint (next true n') + toSint (next true m')

State before:
sz : ℕ
n' m' : FinInt sz
h :
  toSint
      (match addfull n' m' with
      | next false r => next false (next false r)
      | next true r => next false (next true r)) =
    toSint (next false n') + toSint (next false m')
⊢ toSint (next false n' + next false m') =
    match next false n' + next false m' with
    | next false a => toSint (next false n') + toSint (next false m')
    | next true a => toSint (next false n') + toSint (next false m') - 2 ^ (sz + 1)
Tactic:
case false.false =>
  match h': addfull n' m' with
  | .next br r =>
    rw [h'] at h
    cases br <;> simp [bne, toSint] at * <;> sorry_arith
State after:
no goals

State before:
sz : ℕ
n' m' : FinInt sz
h :
  toSint
      (match addfull n' m' with
      | next false r => next false (next (false != true) r)
      | next true r => next true (next (false == true) r)) =
    match
      match addfull n' m' with
      | next false r => next false (next (false != true) r)
      | next true r => next true (next (false == true) r) with
    | next false a => toSint (next false n') + toSint (next true m') + 2 ^ (sz + 1)
    | next true a => toSint (next false n') + toSint (next true m') - 2 ^ (sz + 1)
⊢ toSint (next false n' + next true m') = toSint (next false n') + toSint (next true m')
Tactic:
case false.true =>
  match h': addfull n' m' with
  | .next br r =>
    rw [h'] at h
    cases br <;> simp [bne, BEq.beq, toSint] at * <;> sorry_arith
State after:
no goals

State before:
sz : ℕ
n' m' : FinInt sz
h :
  toSint
      (match addfull n' m' with
      | next false r => next false (next (true != false) r)
      | next true r => next true (next (true == false) r)) =
    match
      match addfull n' m' with
      | next false r => next false (next (true != false) r)
      | next true r => next true (next (true == false) r) with
    | next false a => toSint (next true n') + toSint (next false m') + 2 ^ (sz + 1)
    | next true a => toSint (next true n') + toSint (next false m') - 2 ^ (sz + 1)
⊢ toSint (next true n' + next false m') = toSint (next true n') + toSint (next false m')
Tactic:
case true.false =>
  match h': addfull n' m' with
  | .next br r =>
    rw [h'] at h
    cases br <;> simp [bne, BEq.beq, toSint] at * <;> sorry_arith
State after:
no goals

State before:
sz : ℕ
n' m' : FinInt sz
h :
  toSint
      (match addfull n' m' with
      | next false r => next true (next false r)
      | next true r => next true (next true r)) =
    toSint (next true n') + toSint (next true m')
⊢ toSint (next true n' + next true m') =
    match next true n' + next true m' with
    | next false a => toSint (next true n') + toSint (next true m') + 2 ^ (sz + 1)
    | next true a => toSint (next true n') + toSint (next true m')
Tactic:
case true.true =>
  match h': addfull n' m' with
  | .next br r =>
    rw [h'] at h
    cases br <;> simp [bne, toSint] at * <;> sorry_arith
State after:
no goals

State before:
sz : ℕ
n' m' : FinInt sz
h :
  toSint
      (match addfull n' m' with
      | next false r => next false (next false r)
      | next true r => next false (next true r)) =
    toSint (next false n') + toSint (next false m')
⊢ toSint (next false n' + next false m') =
    match next false n' + next false m' with
    | next false a => toSint (next false n') + toSint (next false m')
    | next true a => toSint (next false n') + toSint (next false m') - 2 ^ (sz + 1)
Tactic:
match h': addfull n' m' with
| .next br r =>
  rw [h'] at h
  cases br <;> simp [bne, toSint] at * <;> sorry_arith
State after:
no goals

State before:
sz : ℕ
n' m' : FinInt sz
h :
  toSint
      (match addfull n' m' with
      | next false r => next false (next false r)
      | next true r => next false (next true r)) =
    toSint (next false n') + toSint (next false m')
br : Bool
r : FinInt sz
h' : addfull n' m' = next br r
⊢ toSint (next false n' + next false m') =
    match next false n' + next false m' with
    | next false a => toSint (next false n') + toSint (next false m')
    | next true a => toSint (next false n') + toSint (next false m') - 2 ^ (sz + 1)
Tactic:
rw [h'] at h
State after:
sz : ℕ
n' m' : FinInt sz
br : Bool
r : FinInt sz
h :
  toSint
      (match next br r with
      | next false r => next false (next false r)
      | next true r => next false (next true r)) =
    toSint (next false n') + toSint (next false m')
h' : addfull n' m' = next br r
⊢ toSint (next false n' + next false m') =
    match next false n' + next false m' with
    | next false a => toSint (next false n') + toSint (next false m')
    | next true a => toSint (next false n') + toSint (next false m') - 2 ^ (sz + 1)

State before:
sz : ℕ
n' m' : FinInt sz
br : Bool
r : FinInt sz
h :
  toSint
      (match next br r with
      | next false r => next false (next false r)
      | next true r => next false (next true r)) =
    toSint (next false n') + toSint (next false m')
h' : addfull n' m' = next br r
⊢ toSint (next false n' + next false m') =
    match next false n' + next false m' with
    | next false a => toSint (next false n') + toSint (next false m')
    | next true a => toSint (next false n') + toSint (next false m') - 2 ^ (sz + 1)
Tactic:
cases br <;> simp [bne, toSint] at * <;> sorry_arith
State after:
no goals

State before:
sz : ℕ
n' m' : FinInt sz
h :
  toSint
      (match addfull n' m' with
      | next false r => next false (next (false != true) r)
      | next true r => next true (next (false == true) r)) =
    match
      match addfull n' m' with
      | next false r => next false (next (false != true) r)
      | next true r => next true (next (false == true) r) with
    | next false a => toSint (next false n') + toSint (next true m') + 2 ^ (sz + 1)
    | next true a => toSint (next false n') + toSint (next true m') - 2 ^ (sz + 1)
⊢ toSint (next false n' + next true m') = toSint (next false n') + toSint (next true m')
Tactic:
match h': addfull n' m' with
| .next br r =>
  rw [h'] at h
  cases br <;> simp [bne, BEq.beq, toSint] at * <;> sorry_arith
State after:
no goals

State before:
sz : ℕ
n' m' : FinInt sz
h :
  toSint
      (match addfull n' m' with
      | next false r => next false (next (false != true) r)
      | next true r => next true (next (false == true) r)) =
    match
      match addfull n' m' with
      | next false r => next false (next (false != true) r)
      | next true r => next true (next (false == true) r) with
    | next false a => toSint (next false n') + toSint (next true m') + 2 ^ (sz + 1)
    | next true a => toSint (next false n') + toSint (next true m') - 2 ^ (sz + 1)
br : Bool
r : FinInt sz
h' : addfull n' m' = next br r
⊢ toSint (next false n' + next true m') = toSint (next false n') + toSint (next true m')
Tactic:
rw [h'] at h
State after:
sz : ℕ
n' m' : FinInt sz
br : Bool
r : FinInt sz
h :
  toSint
      (match next br r with
      | next false r => next false (next (false != true) r)
      | next true r => next true (next (false == true) r)) =
    match
      match next br r with
      | next false r => next false (next (false != true) r)
      | next true r => next true (next (false == true) r) with
    | next false a => toSint (next false n') + toSint (next true m') + 2 ^ (sz + 1)
    | next true a => toSint (next false n') + toSint (next true m') - 2 ^ (sz + 1)
h' : addfull n' m' = next br r
⊢ toSint (next false n' + next true m') = toSint (next false n') + toSint (next true m')

State before:
sz : ℕ
n' m' : FinInt sz
br : Bool
r : FinInt sz
h :
  toSint
      (match next br r with
      | next false r => next false (next (false != true) r)
      | next true r => next true (next (false == true) r)) =
    match
      match next br r with
      | next false r => next false (next (false != true) r)
      | next true r => next true (next (false == true) r) with
    | next false a => toSint (next false n') + toSint (next true m') + 2 ^ (sz + 1)
    | next true a => toSint (next false n') + toSint (next true m') - 2 ^ (sz + 1)
h' : addfull n' m' = next br r
⊢ toSint (next false n' + next true m') = toSint (next false n') + toSint (next true m')
Tactic:
cases br <;> simp [bne, BEq.beq, toSint] at * <;> sorry_arith
State after:
no goals

State before:
sz : ℕ
n' m' : FinInt sz
h :
  toSint
      (match addfull n' m' with
      | next false r => next false (next (true != false) r)
      | next true r => next true (next (true == false) r)) =
    match
      match addfull n' m' with
      | next false r => next false (next (true != false) r)
      | next true r => next true (next (true == false) r) with
    | next false a => toSint (next true n') + toSint (next false m') + 2 ^ (sz + 1)
    | next true a => toSint (next true n') + toSint (next false m') - 2 ^ (sz + 1)
⊢ toSint (next true n' + next false m') = toSint (next true n') + toSint (next false m')
Tactic:
match h': addfull n' m' with
| .next br r =>
  rw [h'] at h
  cases br <;> simp [bne, BEq.beq, toSint] at * <;> sorry_arith
State after:
no goals

State before:
sz : ℕ
n' m' : FinInt sz
h :
  toSint
      (match addfull n' m' with
      | next false r => next false (next (true != false) r)
      | next true r => next true (next (true == false) r)) =
    match
      match addfull n' m' with
      | next false r => next false (next (true != false) r)
      | next true r => next true (next (true == false) r) with
    | next false a => toSint (next true n') + toSint (next false m') + 2 ^ (sz + 1)
    | next true a => toSint (next true n') + toSint (next false m') - 2 ^ (sz + 1)
br : Bool
r : FinInt sz
h' : addfull n' m' = next br r
⊢ toSint (next true n' + next false m') = toSint (next true n') + toSint (next false m')
Tactic:
rw [h'] at h
State after:
sz : ℕ
n' m' : FinInt sz
br : Bool
r : FinInt sz
h :
  toSint
      (match next br r with
      | next false r => next false (next (true != false) r)
      | next true r => next true (next (true == false) r)) =
    match
      match next br r with
      | next false r => next false (next (true != false) r)
      | next true r => next true (next (true == false) r) with
    | next false a => toSint (next true n') + toSint (next false m') + 2 ^ (sz + 1)
    | next true a => toSint (next true n') + toSint (next false m') - 2 ^ (sz + 1)
h' : addfull n' m' = next br r
⊢ toSint (next true n' + next false m') = toSint (next true n') + toSint (next false m')

State before:
sz : ℕ
n' m' : FinInt sz
br : Bool
r : FinInt sz
h :
  toSint
      (match next br r with
      | next false r => next false (next (true != false) r)
      | next true r => next true (next (true == false) r)) =
    match
      match next br r with
      | next false r => next false (next (true != false) r)
      | next true r => next true (next (true == false) r) with
    | next false a => toSint (next true n') + toSint (next false m') + 2 ^ (sz + 1)
    | next true a => toSint (next true n') + toSint (next false m') - 2 ^ (sz + 1)
h' : addfull n' m' = next br r
⊢ toSint (next true n' + next false m') = toSint (next true n') + toSint (next false m')
Tactic:
cases br <;> simp [bne, BEq.beq, toSint] at * <;> sorry_arith
State after:
no goals

State before:
sz : ℕ
n' m' : FinInt sz
h :
  toSint
      (match addfull n' m' with
      | next false r => next true (next false r)
      | next true r => next true (next true r)) =
    toSint (next true n') + toSint (next true m')
⊢ toSint (next true n' + next true m') =
    match next true n' + next true m' with
    | next false a => toSint (next true n') + toSint (next true m') + 2 ^ (sz + 1)
    | next true a => toSint (next true n') + toSint (next true m')
Tactic:
match h': addfull n' m' with
| .next br r =>
  rw [h'] at h
  cases br <;> simp [bne, toSint] at * <;> sorry_arith
State after:
no goals

State before:
sz : ℕ
n' m' : FinInt sz
h :
  toSint
      (match addfull n' m' with
      | next false r => next true (next false r)
      | next true r => next true (next true r)) =
    toSint (next true n') + toSint (next true m')
br : Bool
r : FinInt sz
h' : addfull n' m' = next br r
⊢ toSint (next true n' + next true m') =
    match next true n' + next true m' with
    | next false a => toSint (next true n') + toSint (next true m') + 2 ^ (sz + 1)
    | next true a => toSint (next true n') + toSint (next true m')
Tactic:
rw [h'] at h
State after:
sz : ℕ
n' m' : FinInt sz
br : Bool
r : FinInt sz
h :
  toSint
      (match next br r with
      | next false r => next true (next false r)
      | next true r => next true (next true r)) =
    toSint (next true n') + toSint (next true m')
h' : addfull n' m' = next br r
⊢ toSint (next true n' + next true m') =
    match next true n' + next true m' with
    | next false a => toSint (next true n') + toSint (next true m') + 2 ^ (sz + 1)
    | next true a => toSint (next true n') + toSint (next true m')

State before:
sz : ℕ
n' m' : FinInt sz
br : Bool
r : FinInt sz
h :
  toSint
      (match next br r with
      | next false r => next true (next false r)
      | next true r => next true (next true r)) =
    toSint (next true n') + toSint (next true m')
h' : addfull n' m' = next br r
⊢ toSint (next true n' + next true m') =
    match next true n' + next true m' with
    | next false a => toSint (next true n') + toSint (next true m') + 2 ^ (sz + 1)
    | next true a => toSint (next true n') + toSint (next true m')
Tactic:
cases br <;> simp [bne, toSint] at * <;> sorry_arith
State after:
no goals