url
stringclasses
147 values
commit
stringclasses
147 values
file_path
stringlengths
7
101
full_name
stringlengths
1
94
start
stringlengths
6
10
end
stringlengths
6
11
tactic
stringlengths
1
11.2k
state_before
stringlengths
3
2.09M
state_after
stringlengths
6
2.09M
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.eq_of_toUint_eq
[434, 1]
[446, 28]
cases a
sz : β„• ih : βˆ€ (a b : FinInt sz), toUint a = toUint b β†’ a = b a b : FinInt (Nat.succ sz) h : toUint a = toUint b ⊒ a = b
case next n✝ : β„• a✝¹ : Bool a✝ : FinInt n✝ ih : βˆ€ (a b : FinInt (Nat.add n✝ 0)), toUint a = toUint b β†’ a = b b : FinInt (Nat.succ (Nat.add n✝ 0)) h : toUint (next a✝¹ a✝) = toUint b ⊒ next a✝¹ a✝ = b
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.eq_of_toUint_eq
[434, 1]
[446, 28]
case next sz da a' => cases b; case next db b' => cases da <;> cases db <;> simp [toUint] at h <;> simp . apply ih _ _ h . have h₁ := @toUint_lt _ a'; have hβ‚‚ := @toUint_ge _ b'; sorry_arith . have h₁ := @toUint_ge _ a'; have hβ‚‚ := @toUint_lt _ b'; sorry_arith . apply ih; sorry_arith
sz : β„• da : Bool a' : FinInt sz ih : βˆ€ (a b : FinInt (Nat.add sz 0)), toUint a = toUint b β†’ a = b b : FinInt (Nat.succ (Nat.add sz 0)) h : toUint (next da a') = toUint b ⊒ next da a' = b
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.eq_of_toUint_eq
[434, 1]
[446, 28]
cases b
sz : β„• da : Bool a' : FinInt sz ih : βˆ€ (a b : FinInt (Nat.add sz 0)), toUint a = toUint b β†’ a = b b : FinInt (Nat.succ (Nat.add sz 0)) h : toUint (next da a') = toUint b ⊒ next da a' = b
case next sz : β„• da : Bool a' : FinInt sz ih : βˆ€ (a b : FinInt (Nat.add sz 0)), toUint a = toUint b β†’ a = b a✝¹ : Bool a✝ : FinInt sz h : toUint (next da a') = toUint (next a✝¹ a✝) ⊒ next da a' = next a✝¹ a✝
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.eq_of_toUint_eq
[434, 1]
[446, 28]
case next db b' => cases da <;> cases db <;> simp [toUint] at h <;> simp . apply ih _ _ h . have h₁ := @toUint_lt _ a'; have hβ‚‚ := @toUint_ge _ b'; sorry_arith . have h₁ := @toUint_ge _ a'; have hβ‚‚ := @toUint_lt _ b'; sorry_arith . apply ih; sorry_arith
sz : β„• da : Bool a' : FinInt sz ih : βˆ€ (a b : FinInt (Nat.add sz 0)), toUint a = toUint b β†’ a = b db : Bool b' : FinInt sz h : toUint (next da a') = toUint (next db b') ⊒ next da a' = next db b'
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.eq_of_toUint_eq
[434, 1]
[446, 28]
cases da <;> cases db <;> simp [toUint] at h <;> simp
sz : β„• da : Bool a' : FinInt sz ih : βˆ€ (a b : FinInt (Nat.add sz 0)), toUint a = toUint b β†’ a = b db : Bool b' : FinInt sz h : toUint (next da a') = toUint (next db b') ⊒ next da a' = next db b'
case false.false sz : β„• a' : FinInt sz ih : βˆ€ (a b : FinInt (Nat.add sz 0)), toUint a = toUint b β†’ a = b b' : FinInt sz h : toUint a' = toUint b' ⊒ a' = b' case false.true sz : β„• a' : FinInt sz ih : βˆ€ (a b : FinInt (Nat.add sz 0)), toUint a = toUint b β†’ a = b b' : FinInt sz h : toUint a' = 2 ^ sz + toUint b' ⊒ False case true.false sz : β„• a' : FinInt sz ih : βˆ€ (a b : FinInt (Nat.add sz 0)), toUint a = toUint b β†’ a = b b' : FinInt sz h : 2 ^ sz + toUint a' = toUint b' ⊒ False case true.true sz : β„• a' : FinInt sz ih : βˆ€ (a b : FinInt (Nat.add sz 0)), toUint a = toUint b β†’ a = b b' : FinInt sz h : toUint a' = toUint b' ⊒ a' = b'
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.eq_of_toUint_eq
[434, 1]
[446, 28]
. apply ih _ _ h
case false.false sz : β„• a' : FinInt sz ih : βˆ€ (a b : FinInt (Nat.add sz 0)), toUint a = toUint b β†’ a = b b' : FinInt sz h : toUint a' = toUint b' ⊒ a' = b' case false.true sz : β„• a' : FinInt sz ih : βˆ€ (a b : FinInt (Nat.add sz 0)), toUint a = toUint b β†’ a = b b' : FinInt sz h : toUint a' = 2 ^ sz + toUint b' ⊒ False case true.false sz : β„• a' : FinInt sz ih : βˆ€ (a b : FinInt (Nat.add sz 0)), toUint a = toUint b β†’ a = b b' : FinInt sz h : 2 ^ sz + toUint a' = toUint b' ⊒ False case true.true sz : β„• a' : FinInt sz ih : βˆ€ (a b : FinInt (Nat.add sz 0)), toUint a = toUint b β†’ a = b b' : FinInt sz h : toUint a' = toUint b' ⊒ a' = b'
case false.true sz : β„• a' : FinInt sz ih : βˆ€ (a b : FinInt (Nat.add sz 0)), toUint a = toUint b β†’ a = b b' : FinInt sz h : toUint a' = 2 ^ sz + toUint b' ⊒ False case true.false sz : β„• a' : FinInt sz ih : βˆ€ (a b : FinInt (Nat.add sz 0)), toUint a = toUint b β†’ a = b b' : FinInt sz h : 2 ^ sz + toUint a' = toUint b' ⊒ False case true.true sz : β„• a' : FinInt sz ih : βˆ€ (a b : FinInt (Nat.add sz 0)), toUint a = toUint b β†’ a = b b' : FinInt sz h : toUint a' = toUint b' ⊒ a' = b'
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.eq_of_toUint_eq
[434, 1]
[446, 28]
. have h₁ := @toUint_lt _ a'; have hβ‚‚ := @toUint_ge _ b'; sorry_arith
case false.true sz : β„• a' : FinInt sz ih : βˆ€ (a b : FinInt (Nat.add sz 0)), toUint a = toUint b β†’ a = b b' : FinInt sz h : toUint a' = 2 ^ sz + toUint b' ⊒ False case true.false sz : β„• a' : FinInt sz ih : βˆ€ (a b : FinInt (Nat.add sz 0)), toUint a = toUint b β†’ a = b b' : FinInt sz h : 2 ^ sz + toUint a' = toUint b' ⊒ False case true.true sz : β„• a' : FinInt sz ih : βˆ€ (a b : FinInt (Nat.add sz 0)), toUint a = toUint b β†’ a = b b' : FinInt sz h : toUint a' = toUint b' ⊒ a' = b'
case true.false sz : β„• a' : FinInt sz ih : βˆ€ (a b : FinInt (Nat.add sz 0)), toUint a = toUint b β†’ a = b b' : FinInt sz h : 2 ^ sz + toUint a' = toUint b' ⊒ False case true.true sz : β„• a' : FinInt sz ih : βˆ€ (a b : FinInt (Nat.add sz 0)), toUint a = toUint b β†’ a = b b' : FinInt sz h : toUint a' = toUint b' ⊒ a' = b'
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.eq_of_toUint_eq
[434, 1]
[446, 28]
. have h₁ := @toUint_ge _ a'; have hβ‚‚ := @toUint_lt _ b'; sorry_arith
case true.false sz : β„• a' : FinInt sz ih : βˆ€ (a b : FinInt (Nat.add sz 0)), toUint a = toUint b β†’ a = b b' : FinInt sz h : 2 ^ sz + toUint a' = toUint b' ⊒ False case true.true sz : β„• a' : FinInt sz ih : βˆ€ (a b : FinInt (Nat.add sz 0)), toUint a = toUint b β†’ a = b b' : FinInt sz h : toUint a' = toUint b' ⊒ a' = b'
case true.true sz : β„• a' : FinInt sz ih : βˆ€ (a b : FinInt (Nat.add sz 0)), toUint a = toUint b β†’ a = b b' : FinInt sz h : toUint a' = toUint b' ⊒ a' = b'
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.eq_of_toUint_eq
[434, 1]
[446, 28]
. apply ih; sorry_arith
case true.true sz : β„• a' : FinInt sz ih : βˆ€ (a b : FinInt (Nat.add sz 0)), toUint a = toUint b β†’ a = b b' : FinInt sz h : toUint a' = toUint b' ⊒ a' = b'
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.eq_of_toUint_cong2
[448, 1]
[452, 52]
intros h
n : β„• a b : FinInt n ⊒ toUint a ≑ toUint b [2^n] β†’ a = b
n : β„• a b : FinInt n h : toUint a ≑ toUint b [2^n] ⊒ a = b
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.eq_of_toUint_cong2
[448, 1]
[452, 52]
apply eq_of_toUint_eq
n : β„• a b : FinInt n h : toUint a ≑ toUint b [2^n] ⊒ a = b
case a n : β„• a b : FinInt n h : toUint a ≑ toUint b [2^n] ⊒ toUint a = toUint b
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.eq_of_toUint_cong2
[448, 1]
[452, 52]
apply cong2_to_eq n h toUint_bounds toUint_bounds
case a n : β„• a b : FinInt n h : toUint a ≑ toUint b [2^n] ⊒ toUint a = toUint b
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.comp_toUint
[487, 1]
[497, 18]
induction sz
sz : β„• n : FinInt sz ⊒ toUint (comp n) = 2 ^ sz - 1 - toUint n
case zero n : FinInt Nat.zero ⊒ toUint (comp n) = 2 ^ Nat.zero - 1 - toUint n case succ n✝ : β„• n_ih✝ : βˆ€ (n : FinInt n✝), toUint (comp n) = 2 ^ n✝ - 1 - toUint n n : FinInt (Nat.succ n✝) ⊒ toUint (comp n) = 2 ^ Nat.succ n✝ - 1 - toUint n
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.comp_toUint
[487, 1]
[497, 18]
case zero => cases n; simp
n : FinInt Nat.zero ⊒ toUint (comp n) = 2 ^ Nat.zero - 1 - toUint n
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.comp_toUint
[487, 1]
[497, 18]
case succ sz ih => simp [comp] at ih cases n; case next sz bn n' => cases bn <;> simp [ih] . sorry_arith . sorry_arith
sz : β„• ih : βˆ€ (n : FinInt sz), toUint (comp n) = 2 ^ sz - 1 - toUint n n : FinInt (Nat.succ sz) ⊒ toUint (comp n) = 2 ^ Nat.succ sz - 1 - toUint n
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.comp_toUint
[487, 1]
[497, 18]
cases n
n : FinInt Nat.zero ⊒ toUint (comp n) = 2 ^ Nat.zero - 1 - toUint n
case nil ⊒ toUint (comp nil) = 2 ^ Nat.zero - 1 - toUint nil
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.comp_toUint
[487, 1]
[497, 18]
simp
case nil ⊒ toUint (comp nil) = 2 ^ Nat.zero - 1 - toUint nil
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.comp_toUint
[487, 1]
[497, 18]
simp [comp] at ih
sz : β„• ih : βˆ€ (n : FinInt sz), toUint (comp n) = 2 ^ sz - 1 - toUint n n : FinInt (Nat.succ sz) ⊒ toUint (comp n) = 2 ^ Nat.succ sz - 1 - toUint n
sz : β„• ih : βˆ€ (n : FinInt sz), toUint (logic1 (fun x => !x) n) = 2 ^ sz - 1 - toUint n n : FinInt (Nat.succ sz) ⊒ toUint (comp n) = 2 ^ Nat.succ sz - 1 - toUint n
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.comp_toUint
[487, 1]
[497, 18]
cases n
sz : β„• ih : βˆ€ (n : FinInt sz), toUint (logic1 (fun x => !x) n) = 2 ^ sz - 1 - toUint n n : FinInt (Nat.succ sz) ⊒ toUint (comp n) = 2 ^ Nat.succ sz - 1 - toUint n
case next n✝ : β„• a✝¹ : Bool a✝ : FinInt n✝ ih : βˆ€ (n : FinInt (Nat.add n✝ 0)), toUint (logic1 (fun x => !x) n) = 2 ^ Nat.add n✝ 0 - 1 - toUint n ⊒ toUint (comp (next a✝¹ a✝)) = 2 ^ Nat.succ (Nat.add n✝ 0) - 1 - toUint (next a✝¹ a✝)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.comp_toUint
[487, 1]
[497, 18]
case next sz bn n' => cases bn <;> simp [ih] . sorry_arith . sorry_arith
sz : β„• bn : Bool n' : FinInt sz ih : βˆ€ (n : FinInt (Nat.add sz 0)), toUint (logic1 (fun x => !x) n) = 2 ^ Nat.add sz 0 - 1 - toUint n ⊒ toUint (comp (next bn n')) = 2 ^ Nat.succ (Nat.add sz 0) - 1 - toUint (next bn n')
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.comp_toUint
[487, 1]
[497, 18]
cases bn <;> simp [ih]
sz : β„• bn : Bool n' : FinInt sz ih : βˆ€ (n : FinInt (Nat.add sz 0)), toUint (logic1 (fun x => !x) n) = 2 ^ Nat.add sz 0 - 1 - toUint n ⊒ toUint (comp (next bn n')) = 2 ^ Nat.succ (Nat.add sz 0) - 1 - toUint (next bn n')
case false sz : β„• n' : FinInt sz ih : βˆ€ (n : FinInt (Nat.add sz 0)), toUint (logic1 (fun x => !x) n) = 2 ^ Nat.add sz 0 - 1 - toUint n ⊒ 2 ^ sz + (2 ^ sz - 1 - toUint n') = 2 ^ Nat.succ sz - 1 - toUint n' case true sz : β„• n' : FinInt sz ih : βˆ€ (n : FinInt (Nat.add sz 0)), toUint (logic1 (fun x => !x) n) = 2 ^ Nat.add sz 0 - 1 - toUint n ⊒ 2 ^ sz - 1 - toUint n' = 2 ^ Nat.succ sz - 1 - (2 ^ sz + toUint n')
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.comp_toUint
[487, 1]
[497, 18]
. sorry_arith
case false sz : β„• n' : FinInt sz ih : βˆ€ (n : FinInt (Nat.add sz 0)), toUint (logic1 (fun x => !x) n) = 2 ^ Nat.add sz 0 - 1 - toUint n ⊒ 2 ^ sz + (2 ^ sz - 1 - toUint n') = 2 ^ Nat.succ sz - 1 - toUint n' case true sz : β„• n' : FinInt sz ih : βˆ€ (n : FinInt (Nat.add sz 0)), toUint (logic1 (fun x => !x) n) = 2 ^ Nat.add sz 0 - 1 - toUint n ⊒ 2 ^ sz - 1 - toUint n' = 2 ^ Nat.succ sz - 1 - (2 ^ sz + toUint n')
case true sz : β„• n' : FinInt sz ih : βˆ€ (n : FinInt (Nat.add sz 0)), toUint (logic1 (fun x => !x) n) = 2 ^ Nat.add sz 0 - 1 - toUint n ⊒ 2 ^ sz - 1 - toUint n' = 2 ^ Nat.succ sz - 1 - (2 ^ sz + toUint n')
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.comp_toUint
[487, 1]
[497, 18]
. sorry_arith
case true sz : β„• n' : FinInt sz ih : βˆ€ (n : FinInt (Nat.add sz 0)), toUint (logic1 (fun x => !x) n) = 2 ^ Nat.add sz 0 - 1 - toUint n ⊒ 2 ^ sz - 1 - toUint n' = 2 ^ Nat.succ sz - 1 - (2 ^ sz + toUint n')
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toUint
[511, 11]
[533, 22]
revert n m
sz : β„• n m : FinInt sz ⊒ toUint (addfull n m) = toUint n + toUint m
sz : β„• ⊒ βˆ€ (n m : FinInt sz), toUint (addfull n m) = toUint n + toUint m
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toUint
[511, 11]
[533, 22]
induction sz <;> intros n m
sz : β„• ⊒ βˆ€ (n m : FinInt sz), toUint (addfull n m) = toUint n + toUint m
case zero n m : FinInt Nat.zero ⊒ toUint (addfull n m) = toUint n + toUint m case succ n✝ : β„• n_ih✝ : βˆ€ (n m : FinInt n✝), toUint (addfull n m) = toUint n + toUint m n m : FinInt (Nat.succ n✝) ⊒ toUint (addfull n m) = toUint n + toUint m
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toUint
[511, 11]
[533, 22]
case zero => cases n; cases m; simp [addfull]
n m : FinInt Nat.zero ⊒ toUint (addfull n m) = toUint n + toUint m
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toUint
[511, 11]
[533, 22]
case succ sz ih => cases n; case next sz dn n' => cases m; case next dm m' => simp [addfull] split case h_1 r h => have h': r.toUint = n'.toUint + m'.toUint := by rw [←ih n' m']; simp [h] simp at h' cases dn <;> cases dm <;> simp [FinInt.toUint, h'] <;> sorry_arith case h_2 r h => have h': r.toUint = n'.toUint + m'.toUint - 2^sz := by rw [←ih n' m'] simp [h, Int.add_comm, toSint] simp at h' cases dn <;> cases dm <;> simp [FinInt.toUint, h', toSint] <;> sorry_arith
sz : β„• ih : βˆ€ (n m : FinInt sz), toUint (addfull n m) = toUint n + toUint m n m : FinInt (Nat.succ sz) ⊒ toUint (addfull n m) = toUint n + toUint m
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toUint
[511, 11]
[533, 22]
cases n
n m : FinInt Nat.zero ⊒ toUint (addfull n m) = toUint n + toUint m
case nil m : FinInt Nat.zero ⊒ toUint (addfull nil m) = toUint nil + toUint m
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toUint
[511, 11]
[533, 22]
cases m
case nil m : FinInt Nat.zero ⊒ toUint (addfull nil m) = toUint nil + toUint m
case nil.nil ⊒ toUint (addfull nil nil) = toUint nil + toUint nil
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toUint
[511, 11]
[533, 22]
simp [addfull]
case nil.nil ⊒ toUint (addfull nil nil) = toUint nil + toUint nil
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toUint
[511, 11]
[533, 22]
cases n
sz : β„• ih : βˆ€ (n m : FinInt sz), toUint (addfull n m) = toUint n + toUint m n m : FinInt (Nat.succ sz) ⊒ toUint (addfull n m) = toUint n + toUint m
case next n✝ : β„• a✝¹ : Bool a✝ : FinInt n✝ ih : βˆ€ (n m : FinInt (Nat.add n✝ 0)), toUint (addfull n m) = toUint n + toUint m m : FinInt (Nat.succ (Nat.add n✝ 0)) ⊒ toUint (addfull (next a✝¹ a✝) m) = toUint (next a✝¹ a✝) + toUint m
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toUint
[511, 11]
[533, 22]
case next sz dn n' => cases m; case next dm m' => simp [addfull] split case h_1 r h => have h': r.toUint = n'.toUint + m'.toUint := by rw [←ih n' m']; simp [h] simp at h' cases dn <;> cases dm <;> simp [FinInt.toUint, h'] <;> sorry_arith case h_2 r h => have h': r.toUint = n'.toUint + m'.toUint - 2^sz := by rw [←ih n' m'] simp [h, Int.add_comm, toSint] simp at h' cases dn <;> cases dm <;> simp [FinInt.toUint, h', toSint] <;> sorry_arith
sz : β„• dn : Bool n' : FinInt sz ih : βˆ€ (n m : FinInt (Nat.add sz 0)), toUint (addfull n m) = toUint n + toUint m m : FinInt (Nat.succ (Nat.add sz 0)) ⊒ toUint (addfull (next dn n') m) = toUint (next dn n') + toUint m
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toUint
[511, 11]
[533, 22]
cases m
sz : β„• dn : Bool n' : FinInt sz ih : βˆ€ (n m : FinInt (Nat.add sz 0)), toUint (addfull n m) = toUint n + toUint m m : FinInt (Nat.succ (Nat.add sz 0)) ⊒ toUint (addfull (next dn n') m) = toUint (next dn n') + toUint m
case next sz : β„• dn : Bool n' : FinInt sz ih : βˆ€ (n m : FinInt (Nat.add sz 0)), toUint (addfull n m) = toUint n + toUint m a✝¹ : Bool a✝ : FinInt sz ⊒ toUint (addfull (next dn n') (next a✝¹ a✝)) = toUint (next dn n') + toUint (next a✝¹ a✝)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toUint
[511, 11]
[533, 22]
case next dm m' => simp [addfull] split case h_1 r h => have h': r.toUint = n'.toUint + m'.toUint := by rw [←ih n' m']; simp [h] simp at h' cases dn <;> cases dm <;> simp [FinInt.toUint, h'] <;> sorry_arith case h_2 r h => have h': r.toUint = n'.toUint + m'.toUint - 2^sz := by rw [←ih n' m'] simp [h, Int.add_comm, toSint] simp at h' cases dn <;> cases dm <;> simp [FinInt.toUint, h', toSint] <;> sorry_arith
sz : β„• dn : Bool n' : FinInt sz ih : βˆ€ (n m : FinInt (Nat.add sz 0)), toUint (addfull n m) = toUint n + toUint m dm : Bool m' : FinInt sz ⊒ toUint (addfull (next dn n') (next dm m')) = toUint (next dn n') + toUint (next dm m')
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toUint
[511, 11]
[533, 22]
simp [addfull]
sz : β„• dn : Bool n' : FinInt sz ih : βˆ€ (n m : FinInt (Nat.add sz 0)), toUint (addfull n m) = toUint n + toUint m dm : Bool m' : FinInt sz ⊒ toUint (addfull (next dn n') (next dm m')) = toUint (next dn n') + toUint (next dm m')
sz : β„• dn : Bool n' : FinInt sz ih : βˆ€ (n m : FinInt (Nat.add sz 0)), toUint (addfull n m) = toUint n + toUint m dm : Bool m' : FinInt sz ⊒ toUint (match addfull n' m' with | next false r => next (dn && dm) (next (dn != dm) r) | next true r => next (dn || dm) (next (dn == dm) r)) = toUint (next dn n') + toUint (next dm m')
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toUint
[511, 11]
[533, 22]
split
sz : β„• dn : Bool n' : FinInt sz ih : βˆ€ (n m : FinInt (Nat.add sz 0)), toUint (addfull n m) = toUint n + toUint m dm : Bool m' : FinInt sz ⊒ toUint (match addfull n' m' with | next false r => next (dn && dm) (next (dn != dm) r) | next true r => next (dn || dm) (next (dn == dm) r)) = toUint (next dn n') + toUint (next dm m')
case h_1 sz : β„• dn : Bool n' : FinInt sz ih : βˆ€ (n m : FinInt (Nat.add sz 0)), toUint (addfull n m) = toUint n + toUint m dm : Bool m' : FinInt sz n✝ : FinInt (sz + 0 + 1) m✝ : FinInt (sz + 0) heq✝ : addfull n' m' = next false m✝ ⊒ toUint (next (dn && dm) (next (dn != dm) m✝)) = toUint (next dn n') + toUint (next dm m') case h_2 sz : β„• dn : Bool n' : FinInt sz ih : βˆ€ (n m : FinInt (Nat.add sz 0)), toUint (addfull n m) = toUint n + toUint m dm : Bool m' : FinInt sz n✝ : FinInt (sz + 0 + 1) m✝ : FinInt (sz + 0) heq✝ : addfull n' m' = next true m✝ ⊒ toUint (next (dn || dm) (next (dn == dm) m✝)) = toUint (next dn n') + toUint (next dm m')
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toUint
[511, 11]
[533, 22]
case h_1 r h => have h': r.toUint = n'.toUint + m'.toUint := by rw [←ih n' m']; simp [h] simp at h' cases dn <;> cases dm <;> simp [FinInt.toUint, h'] <;> sorry_arith
sz : β„• dn : Bool n' : FinInt sz ih : βˆ€ (n m : FinInt (Nat.add sz 0)), toUint (addfull n m) = toUint n + toUint m dm : Bool m' : FinInt sz n✝ : FinInt (sz + 0 + 1) r : FinInt (sz + 0) h : addfull n' m' = next false r ⊒ toUint (next (dn && dm) (next (dn != dm) r)) = toUint (next dn n') + toUint (next dm m')
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toUint
[511, 11]
[533, 22]
case h_2 r h => have h': r.toUint = n'.toUint + m'.toUint - 2^sz := by rw [←ih n' m'] simp [h, Int.add_comm, toSint] simp at h' cases dn <;> cases dm <;> simp [FinInt.toUint, h', toSint] <;> sorry_arith
sz : β„• dn : Bool n' : FinInt sz ih : βˆ€ (n m : FinInt (Nat.add sz 0)), toUint (addfull n m) = toUint n + toUint m dm : Bool m' : FinInt sz n✝ : FinInt (sz + 0 + 1) r : FinInt (sz + 0) h : addfull n' m' = next true r ⊒ toUint (next (dn || dm) (next (dn == dm) r)) = toUint (next dn n') + toUint (next dm m')
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toUint
[511, 11]
[533, 22]
have h': r.toUint = n'.toUint + m'.toUint := by rw [←ih n' m']; simp [h]
sz : β„• dn : Bool n' : FinInt sz ih : βˆ€ (n m : FinInt (Nat.add sz 0)), toUint (addfull n m) = toUint n + toUint m dm : Bool m' : FinInt sz n✝ : FinInt (sz + 0 + 1) r : FinInt (sz + 0) h : addfull n' m' = next false r ⊒ toUint (next (dn && dm) (next (dn != dm) r)) = toUint (next dn n') + toUint (next dm m')
sz : β„• dn : Bool n' : FinInt sz ih : βˆ€ (n m : FinInt (Nat.add sz 0)), toUint (addfull n m) = toUint n + toUint m dm : Bool m' : FinInt sz n✝ : FinInt (sz + 0 + 1) r : FinInt (sz + 0) h : addfull n' m' = next false r h' : toUint r = toUint n' + toUint m' ⊒ toUint (next (dn && dm) (next (dn != dm) r)) = toUint (next dn n') + toUint (next dm m')
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toUint
[511, 11]
[533, 22]
cases dn <;> cases dm <;> simp [FinInt.toUint, h'] <;> sorry_arith
sz : β„• dn : Bool n' : FinInt sz ih : βˆ€ (n m : FinInt (Nat.add sz 0)), toUint (addfull n m) = toUint n + toUint m dm : Bool m' : FinInt sz n✝ : FinInt (sz + 0 + 1) r : FinInt (sz + 0) h : addfull n' m' = next false r h' : toUint r = toUint n' + toUint m' ⊒ toUint (next (dn && dm) (next (dn != dm) r)) = toUint (next dn n') + toUint (next dm m')
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toUint
[511, 11]
[533, 22]
rw [←ih n' m']
sz : β„• dn : Bool n' : FinInt sz ih : βˆ€ (n m : FinInt (Nat.add sz 0)), toUint (addfull n m) = toUint n + toUint m dm : Bool m' : FinInt sz n✝ : FinInt (sz + 0 + 1) r : FinInt (sz + 0) h : addfull n' m' = next false r ⊒ toUint r = toUint n' + toUint m'
sz : β„• dn : Bool n' : FinInt sz ih : βˆ€ (n m : FinInt (Nat.add sz 0)), toUint (addfull n m) = toUint n + toUint m dm : Bool m' : FinInt sz n✝ : FinInt (sz + 0 + 1) r : FinInt (sz + 0) h : addfull n' m' = next false r ⊒ toUint r = toUint (addfull n' m')
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toUint
[511, 11]
[533, 22]
simp [h]
sz : β„• dn : Bool n' : FinInt sz ih : βˆ€ (n m : FinInt (Nat.add sz 0)), toUint (addfull n m) = toUint n + toUint m dm : Bool m' : FinInt sz n✝ : FinInt (sz + 0 + 1) r : FinInt (sz + 0) h : addfull n' m' = next false r ⊒ toUint r = toUint (addfull n' m')
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toUint
[511, 11]
[533, 22]
have h': r.toUint = n'.toUint + m'.toUint - 2^sz := by rw [←ih n' m'] simp [h, Int.add_comm, toSint]
sz : β„• dn : Bool n' : FinInt sz ih : βˆ€ (n m : FinInt (Nat.add sz 0)), toUint (addfull n m) = toUint n + toUint m dm : Bool m' : FinInt sz n✝ : FinInt (sz + 0 + 1) r : FinInt (sz + 0) h : addfull n' m' = next true r ⊒ toUint (next (dn || dm) (next (dn == dm) r)) = toUint (next dn n') + toUint (next dm m')
sz : β„• dn : Bool n' : FinInt sz ih : βˆ€ (n m : FinInt (Nat.add sz 0)), toUint (addfull n m) = toUint n + toUint m dm : Bool m' : FinInt sz n✝ : FinInt (sz + 0 + 1) r : FinInt (sz + 0) h : addfull n' m' = next true r h' : toUint r = toUint n' + toUint m' - 2 ^ sz ⊒ toUint (next (dn || dm) (next (dn == dm) r)) = toUint (next dn n') + toUint (next dm m')
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toUint
[511, 11]
[533, 22]
cases dn <;> cases dm <;> simp [FinInt.toUint, h', toSint] <;> sorry_arith
sz : β„• dn : Bool n' : FinInt sz ih : βˆ€ (n m : FinInt (Nat.add sz 0)), toUint (addfull n m) = toUint n + toUint m dm : Bool m' : FinInt sz n✝ : FinInt (sz + 0 + 1) r : FinInt (sz + 0) h : addfull n' m' = next true r h' : toUint r = toUint n' + toUint m' - 2 ^ sz ⊒ toUint (next (dn || dm) (next (dn == dm) r)) = toUint (next dn n') + toUint (next dm m')
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toUint
[511, 11]
[533, 22]
rw [←ih n' m']
sz : β„• dn : Bool n' : FinInt sz ih : βˆ€ (n m : FinInt (Nat.add sz 0)), toUint (addfull n m) = toUint n + toUint m dm : Bool m' : FinInt sz n✝ : FinInt (sz + 0 + 1) r : FinInt (sz + 0) h : addfull n' m' = next true r ⊒ toUint r = toUint n' + toUint m' - 2 ^ sz
sz : β„• dn : Bool n' : FinInt sz ih : βˆ€ (n m : FinInt (Nat.add sz 0)), toUint (addfull n m) = toUint n + toUint m dm : Bool m' : FinInt sz n✝ : FinInt (sz + 0 + 1) r : FinInt (sz + 0) h : addfull n' m' = next true r ⊒ toUint r = toUint (addfull n' m') - 2 ^ sz
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toUint
[511, 11]
[533, 22]
simp [h, Int.add_comm, toSint]
sz : β„• dn : Bool n' : FinInt sz ih : βˆ€ (n m : FinInt (Nat.add sz 0)), toUint (addfull n m) = toUint n + toUint m dm : Bool m' : FinInt sz n✝ : FinInt (sz + 0 + 1) r : FinInt (sz + 0) h : addfull n' m' = next true r ⊒ toUint r = toUint (addfull n' m') - 2 ^ sz
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toSint
[535, 1]
[578, 68]
cases n
sz : β„• n m : FinInt (sz + 1) ⊒ 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
case next sz : β„• m : FinInt (sz + 1) a✝¹ : Bool a✝ : FinInt sz ⊒ 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
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toSint
[535, 1]
[578, 68]
case next bn n' => cases m; case next bm m' => cases bn <;> cases bm <;> simp [addfull] case false.false => match h: addfull n' m' with | .next br r => cases br <;> simp [toSint, ←FinInt.addfull_toUint, h] case false.true => match h: addfull n' m' with | .next br r => have h' := FinInt.addfull_toUint n' m' rw [h] at h' cases br <;> simp at h' <;> simp [toSint] . simp [h']; sorry_arith . sorry_arith case true.false => match h: addfull n' m' with | .next br r => have h' := FinInt.addfull_toUint n' m' rw [h] at h' cases br <;> simp at h' <;> simp [toSint] . simp [h']; sorry_arith . sorry_arith case true.true => match h: addfull n' m' with | .next br r => have h' := FinInt.addfull_toUint n' m' rw [h] at h' cases br <;> simp at h' <;> simp [toSint, h'] <;> sorry_arith
sz : β„• m : FinInt (sz + 1) bn : Bool n' : FinInt sz ⊒ 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
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toSint
[535, 1]
[578, 68]
cases m
sz : β„• m : FinInt (sz + 1) bn : Bool n' : FinInt sz ⊒ 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
case next sz : β„• bn : Bool n' : FinInt sz a✝¹ : Bool a✝ : FinInt sz ⊒ 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✝)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toSint
[535, 1]
[578, 68]
case next bm m' => cases bn <;> cases bm <;> simp [addfull] case false.false => match h: addfull n' m' with | .next br r => cases br <;> simp [toSint, ←FinInt.addfull_toUint, h] case false.true => match h: addfull n' m' with | .next br r => have h' := FinInt.addfull_toUint n' m' rw [h] at h' cases br <;> simp at h' <;> simp [toSint] . simp [h']; sorry_arith . sorry_arith case true.false => match h: addfull n' m' with | .next br r => have h' := FinInt.addfull_toUint n' m' rw [h] at h' cases br <;> simp at h' <;> simp [toSint] . simp [h']; sorry_arith . sorry_arith case true.true => match h: addfull n' m' with | .next br r => have h' := FinInt.addfull_toUint n' m' rw [h] at h' cases br <;> simp at h' <;> simp [toSint, h'] <;> sorry_arith
sz : β„• bn : Bool n' : FinInt sz bm : Bool m' : FinInt sz ⊒ 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')
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toSint
[535, 1]
[578, 68]
cases bn <;> cases bm <;> simp [addfull]
sz : β„• bn : Bool n' : FinInt sz bm : Bool m' : FinInt sz ⊒ 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')
case false.false sz : β„• n' m' : FinInt sz ⊒ 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') case false.true sz : β„• n' m' : FinInt sz ⊒ 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) case true.false sz : β„• n' m' : FinInt sz ⊒ 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) case true.true sz : β„• n' m' : FinInt sz ⊒ 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')
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toSint
[535, 1]
[578, 68]
case false.false => match h: addfull n' m' with | .next br r => cases br <;> simp [toSint, ←FinInt.addfull_toUint, h]
sz : β„• n' m' : FinInt sz ⊒ 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')
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toSint
[535, 1]
[578, 68]
case false.true => match h: addfull n' m' with | .next br r => have h' := FinInt.addfull_toUint n' m' rw [h] at h' cases br <;> simp at h' <;> simp [toSint] . simp [h']; sorry_arith . sorry_arith
sz : β„• n' m' : FinInt sz ⊒ 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)
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toSint
[535, 1]
[578, 68]
case true.false => match h: addfull n' m' with | .next br r => have h' := FinInt.addfull_toUint n' m' rw [h] at h' cases br <;> simp at h' <;> simp [toSint] . simp [h']; sorry_arith . sorry_arith
sz : β„• n' m' : FinInt sz ⊒ 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)
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toSint
[535, 1]
[578, 68]
case true.true => match h: addfull n' m' with | .next br r => have h' := FinInt.addfull_toUint n' m' rw [h] at h' cases br <;> simp at h' <;> simp [toSint, h'] <;> sorry_arith
sz : β„• n' m' : FinInt sz ⊒ 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')
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toSint
[535, 1]
[578, 68]
match h: addfull n' m' with | .next br r => cases br <;> simp [toSint, ←FinInt.addfull_toUint, h]
sz : β„• n' m' : FinInt sz ⊒ 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')
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toSint
[535, 1]
[578, 68]
cases br <;> simp [toSint, ←FinInt.addfull_toUint, h]
sz : β„• n' m' : FinInt sz br : Bool r : FinInt sz h : addfull n' m' = next br r ⊒ 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')
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toSint
[535, 1]
[578, 68]
match h: addfull n' m' with | .next br r => have h' := FinInt.addfull_toUint n' m' rw [h] at h' cases br <;> simp at h' <;> simp [toSint] . simp [h']; sorry_arith . sorry_arith
sz : β„• n' m' : FinInt sz ⊒ 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)
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toSint
[535, 1]
[578, 68]
have h' := FinInt.addfull_toUint n' m'
sz : β„• n' m' : FinInt sz br : Bool r : FinInt sz h : addfull n' m' = next br r ⊒ 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)
sz : β„• n' m' : FinInt sz br : Bool r : FinInt sz h : addfull n' m' = next br r h' : toUint (addfull n' m') = toUint n' + toUint m' ⊒ 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)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toSint
[535, 1]
[578, 68]
rw [h] at h'
sz : β„• n' m' : FinInt sz br : Bool r : FinInt sz h : addfull n' m' = next br r h' : toUint (addfull n' m') = toUint n' + toUint m' ⊒ 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)
sz : β„• n' m' : FinInt sz br : Bool r : FinInt sz h : addfull n' m' = next br r h' : toUint (next br r) = toUint n' + toUint m' ⊒ 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)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toSint
[535, 1]
[578, 68]
cases br <;> simp at h' <;> simp [toSint]
sz : β„• n' m' : FinInt sz br : Bool r : FinInt sz h : addfull n' m' = next br r h' : toUint (next br r) = toUint n' + toUint m' ⊒ 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)
case false sz : β„• n' m' r : FinInt sz h : addfull n' m' = next false r h' : toUint r = toUint n' + toUint m' ⊒ 2 ^ sz + toUint r = toUint n' + (toUint m' - 2 ^ sz) + 2 ^ (sz + 1) case true sz : β„• n' m' r : FinInt sz h : addfull n' m' = next true r h' : 2 ^ sz + toUint r = toUint n' + toUint m' ⊒ toUint r = toUint n' + (toUint m' - 2 ^ sz)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toSint
[535, 1]
[578, 68]
. simp [h']; sorry_arith
case false sz : β„• n' m' r : FinInt sz h : addfull n' m' = next false r h' : toUint r = toUint n' + toUint m' ⊒ 2 ^ sz + toUint r = toUint n' + (toUint m' - 2 ^ sz) + 2 ^ (sz + 1) case true sz : β„• n' m' r : FinInt sz h : addfull n' m' = next true r h' : 2 ^ sz + toUint r = toUint n' + toUint m' ⊒ toUint r = toUint n' + (toUint m' - 2 ^ sz)
case true sz : β„• n' m' r : FinInt sz h : addfull n' m' = next true r h' : 2 ^ sz + toUint r = toUint n' + toUint m' ⊒ toUint r = toUint n' + (toUint m' - 2 ^ sz)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toSint
[535, 1]
[578, 68]
. sorry_arith
case true sz : β„• n' m' r : FinInt sz h : addfull n' m' = next true r h' : 2 ^ sz + toUint r = toUint n' + toUint m' ⊒ toUint r = toUint n' + (toUint m' - 2 ^ sz)
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toSint
[535, 1]
[578, 68]
match h: addfull n' m' with | .next br r => have h' := FinInt.addfull_toUint n' m' rw [h] at h' cases br <;> simp at h' <;> simp [toSint] . simp [h']; sorry_arith . sorry_arith
sz : β„• n' m' : FinInt sz ⊒ 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)
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toSint
[535, 1]
[578, 68]
have h' := FinInt.addfull_toUint n' m'
sz : β„• n' m' : FinInt sz br : Bool r : FinInt sz h : addfull n' m' = next br r ⊒ 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)
sz : β„• n' m' : FinInt sz br : Bool r : FinInt sz h : addfull n' m' = next br r h' : toUint (addfull n' m') = toUint n' + toUint m' ⊒ 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)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toSint
[535, 1]
[578, 68]
rw [h] at h'
sz : β„• n' m' : FinInt sz br : Bool r : FinInt sz h : addfull n' m' = next br r h' : toUint (addfull n' m') = toUint n' + toUint m' ⊒ 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)
sz : β„• n' m' : FinInt sz br : Bool r : FinInt sz h : addfull n' m' = next br r h' : toUint (next br r) = toUint n' + toUint m' ⊒ 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)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toSint
[535, 1]
[578, 68]
cases br <;> simp at h' <;> simp [toSint]
sz : β„• n' m' : FinInt sz br : Bool r : FinInt sz h : addfull n' m' = next br r h' : toUint (next br r) = toUint n' + toUint m' ⊒ 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)
case false sz : β„• n' m' r : FinInt sz h : addfull n' m' = next false r h' : toUint r = toUint n' + toUint m' ⊒ 2 ^ sz + toUint r = toUint n' - 2 ^ sz + toUint m' + 2 ^ (sz + 1) case true sz : β„• n' m' r : FinInt sz h : addfull n' m' = next true r h' : 2 ^ sz + toUint r = toUint n' + toUint m' ⊒ toUint r = toUint n' - 2 ^ sz + toUint m'
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toSint
[535, 1]
[578, 68]
. simp [h']; sorry_arith
case false sz : β„• n' m' r : FinInt sz h : addfull n' m' = next false r h' : toUint r = toUint n' + toUint m' ⊒ 2 ^ sz + toUint r = toUint n' - 2 ^ sz + toUint m' + 2 ^ (sz + 1) case true sz : β„• n' m' r : FinInt sz h : addfull n' m' = next true r h' : 2 ^ sz + toUint r = toUint n' + toUint m' ⊒ toUint r = toUint n' - 2 ^ sz + toUint m'
case true sz : β„• n' m' r : FinInt sz h : addfull n' m' = next true r h' : 2 ^ sz + toUint r = toUint n' + toUint m' ⊒ toUint r = toUint n' - 2 ^ sz + toUint m'
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toSint
[535, 1]
[578, 68]
. sorry_arith
case true sz : β„• n' m' r : FinInt sz h : addfull n' m' = next true r h' : 2 ^ sz + toUint r = toUint n' + toUint m' ⊒ toUint r = toUint n' - 2 ^ sz + toUint m'
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toSint
[535, 1]
[578, 68]
match h: addfull n' m' with | .next br r => have h' := FinInt.addfull_toUint n' m' rw [h] at h' cases br <;> simp at h' <;> simp [toSint, h'] <;> sorry_arith
sz : β„• n' m' : FinInt sz ⊒ 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')
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toSint
[535, 1]
[578, 68]
have h' := FinInt.addfull_toUint n' m'
sz : β„• n' m' : FinInt sz br : Bool r : FinInt sz h : addfull n' m' = next br r ⊒ 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')
sz : β„• n' m' : FinInt sz br : Bool r : FinInt sz h : addfull n' m' = next br r h' : toUint (addfull n' m') = toUint n' + toUint m' ⊒ 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')
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toSint
[535, 1]
[578, 68]
rw [h] at h'
sz : β„• n' m' : FinInt sz br : Bool r : FinInt sz h : addfull n' m' = next br r h' : toUint (addfull n' m') = toUint n' + toUint m' ⊒ 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')
sz : β„• n' m' : FinInt sz br : Bool r : FinInt sz h : addfull n' m' = next br r h' : toUint (next br r) = toUint n' + toUint m' ⊒ 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')
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_toSint
[535, 1]
[578, 68]
cases br <;> simp at h' <;> simp [toSint, h'] <;> sorry_arith
sz : β„• n' m' : FinInt sz br : Bool r : FinInt sz h : addfull n' m' = next br r h' : toUint (next br r) = toUint n' + toUint m' ⊒ 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')
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_comm
[580, 1]
[585, 44]
induction sz <;> cases n <;> cases m <;> simp [addfull]
sz : β„• n m : FinInt sz ⊒ addfull n m = addfull m n
case succ.next.next n✝ : β„• a✝³ : Bool a✝² : FinInt n✝ n_ih✝ : βˆ€ (n m : FinInt (Nat.add n✝ 0)), addfull n m = addfull m n a✝¹ : Bool a✝ : FinInt n✝ ⊒ (match addfull a✝² a✝ with | next false r => next (a✝³ && a✝¹) (next (a✝³ != a✝¹) r) | next true r => next (a✝³ || a✝¹) (next (a✝³ == a✝¹) r)) = match addfull a✝ a✝² with | next false r => next (a✝¹ && a✝³) (next (a✝¹ != a✝³) r) | next true r => next (a✝¹ || a✝³) (next (a✝¹ == a✝³) r)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_comm
[580, 1]
[585, 44]
case succ.next.next sz bn n' ih bm m' => simp [ih n' m'] split <;> cases bn <;> cases bm <;> rfl
sz : β„• bn : Bool n' : FinInt sz ih : βˆ€ (n m : FinInt (Nat.add sz 0)), addfull n m = addfull m n bm : Bool m' : FinInt sz ⊒ (match addfull n' m' with | next false r => next (bn && bm) (next (bn != bm) r) | next true r => next (bn || bm) (next (bn == bm) r)) = match addfull m' n' with | next false r => next (bm && bn) (next (bm != bn) r) | next true r => next (bm || bn) (next (bm == bn) r)
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_comm
[580, 1]
[585, 44]
simp [ih n' m']
sz : β„• bn : Bool n' : FinInt sz ih : βˆ€ (n m : FinInt (Nat.add sz 0)), addfull n m = addfull m n bm : Bool m' : FinInt sz ⊒ (match addfull n' m' with | next false r => next (bn && bm) (next (bn != bm) r) | next true r => next (bn || bm) (next (bn == bm) r)) = match addfull m' n' with | next false r => next (bm && bn) (next (bm != bn) r) | next true r => next (bm || bn) (next (bm == bn) r)
sz : β„• bn : Bool n' : FinInt sz ih : βˆ€ (n m : FinInt (Nat.add sz 0)), addfull n m = addfull m n bm : Bool m' : FinInt sz ⊒ (match addfull m' n' with | next false r => next (bn && bm) (next (bn != bm) r) | next true r => next (bn || bm) (next (bn == bm) r)) = match addfull m' n' with | next false r => next (bm && bn) (next (bm != bn) r) | next true r => next (bm || bn) (next (bm == bn) r)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addfull_comm
[580, 1]
[585, 44]
split <;> cases bn <;> cases bm <;> rfl
sz : β„• bn : Bool n' : FinInt sz ih : βˆ€ (n m : FinInt (Nat.add sz 0)), addfull n m = addfull m n bm : Bool m' : FinInt sz ⊒ (match addfull m' n' with | next false r => next (bn && bm) (next (bn != bm) r) | next true r => next (bn || bm) (next (bn == bm) r)) = match addfull m' n' with | next false r => next (bm && bn) (next (bm != bn) r) | next true r => next (bm || bn) (next (bm == bn) r)
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addc_comm
[595, 1]
[596, 28]
simp [addc, addfull_comm]
sz : β„• n m : FinInt sz ⊒ addc n m = addc m n
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_comm'
[602, 1]
[603, 27]
simp [add, addfull_comm]
sz : β„• n m : FinInt sz ⊒ add n m = add m n
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_comm
[608, 1]
[609, 30]
simp [HAdd.hAdd, add_comm']
sz : β„• n m : FinInt sz ⊒ n + m = m + n
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toUint_msb
[611, 11]
[624, 18]
match h: addfull n m with | .next br r => have h₁ := FinInt.addfull_toUint n m rw [h] at h₁ have hβ‚‚: n+m = r := by simp [HAdd.hAdd, add, h] cases br <;> simp [hβ‚‚] at * . exact h₁ . sorry_arith
sz : β„• n m : FinInt sz ⊒ toUint (n + m) = match addfull n m with | next false a => toUint n + toUint m | next true a => toUint n + toUint m - 2 ^ sz
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toUint_msb
[611, 11]
[624, 18]
have h₁ := FinInt.addfull_toUint n m
sz : β„• n m : FinInt sz br : Bool r : FinInt sz h : addfull n m = next br r ⊒ toUint (n + m) = match next br r with | next false a => toUint n + toUint m | next true a => toUint n + toUint m - 2 ^ sz
sz : β„• n m : FinInt sz br : Bool r : FinInt sz h : addfull n m = next br r h₁ : toUint (addfull n m) = toUint n + toUint m ⊒ toUint (n + m) = match next br r with | next false a => toUint n + toUint m | next true a => toUint n + toUint m - 2 ^ sz
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toUint_msb
[611, 11]
[624, 18]
rw [h] at h₁
sz : β„• n m : FinInt sz br : Bool r : FinInt sz h : addfull n m = next br r h₁ : toUint (addfull n m) = toUint n + toUint m ⊒ toUint (n + m) = match next br r with | next false a => toUint n + toUint m | next true a => toUint n + toUint m - 2 ^ sz
sz : β„• n m : FinInt sz br : Bool r : FinInt sz h : addfull n m = next br r h₁ : toUint (next br r) = toUint n + toUint m ⊒ toUint (n + m) = match next br r with | next false a => toUint n + toUint m | next true a => toUint n + toUint m - 2 ^ sz
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toUint_msb
[611, 11]
[624, 18]
have hβ‚‚: n+m = r := by simp [HAdd.hAdd, add, h]
sz : β„• n m : FinInt sz br : Bool r : FinInt sz h : addfull n m = next br r h₁ : toUint (next br r) = toUint n + toUint m ⊒ toUint (n + m) = match next br r with | next false a => toUint n + toUint m | next true a => toUint n + toUint m - 2 ^ sz
sz : β„• n m : FinInt sz br : Bool r : FinInt sz h : addfull n m = next br r h₁ : toUint (next br r) = toUint n + toUint m hβ‚‚ : n + m = r ⊒ toUint (n + m) = match next br r with | next false a => toUint n + toUint m | next true a => toUint n + toUint m - 2 ^ sz
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toUint_msb
[611, 11]
[624, 18]
cases br <;> simp [hβ‚‚] at *
sz : β„• n m : FinInt sz br : Bool r : FinInt sz h : addfull n m = next br r h₁ : toUint (next br r) = toUint n + toUint m hβ‚‚ : n + m = r ⊒ toUint (n + m) = match next br r with | next false a => toUint n + toUint m | next true a => toUint n + toUint m - 2 ^ sz
case false sz : β„• n m r : FinInt sz h : addfull n m = next false r h₁ : toUint r = toUint n + toUint m hβ‚‚ : True ⊒ toUint r = toUint n + toUint m case true sz : β„• n m r : FinInt sz h : addfull n m = next true r hβ‚‚ : True h₁ : 2 ^ sz + toUint r = toUint n + toUint m ⊒ toUint r = toUint n + toUint m - 2 ^ sz
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toUint_msb
[611, 11]
[624, 18]
. exact h₁
case false sz : β„• n m r : FinInt sz h : addfull n m = next false r h₁ : toUint r = toUint n + toUint m hβ‚‚ : True ⊒ toUint r = toUint n + toUint m case true sz : β„• n m r : FinInt sz h : addfull n m = next true r hβ‚‚ : True h₁ : 2 ^ sz + toUint r = toUint n + toUint m ⊒ toUint r = toUint n + toUint m - 2 ^ sz
case true sz : β„• n m r : FinInt sz h : addfull n m = next true r hβ‚‚ : True h₁ : 2 ^ sz + toUint r = toUint n + toUint m ⊒ toUint r = toUint n + toUint m - 2 ^ sz
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toUint_msb
[611, 11]
[624, 18]
. sorry_arith
case true sz : β„• n m r : FinInt sz h : addfull n m = next true r hβ‚‚ : True h₁ : 2 ^ sz + toUint r = toUint n + toUint m ⊒ toUint r = toUint n + toUint m - 2 ^ sz
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toUint_msb
[611, 11]
[624, 18]
simp [HAdd.hAdd, add, h]
sz : β„• n m : FinInt sz br : Bool r : FinInt sz h : addfull n m = next br r h₁ : toUint (next br r) = toUint n + toUint m ⊒ n + m = r
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toUint_by_lt
[626, 1]
[638, 18]
intros h_bound
sz : β„• n m : FinInt sz ⊒ toUint n + toUint m < 2 ^ sz β†’ toUint (n + m) = toUint n + toUint m
sz : β„• n m : FinInt sz h_bound : toUint n + toUint m < 2 ^ sz ⊒ toUint (n + m) = toUint n + toUint m
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toUint_by_lt
[626, 1]
[638, 18]
simp [HAdd.hAdd, FinInt.add, FinInt.addfull_toUint]
sz : β„• n m : FinInt sz h_bound : toUint n + toUint m < 2 ^ sz ⊒ toUint (n + m) = toUint n + toUint m
sz : β„• n m : FinInt sz h_bound : toUint n + toUint m < 2 ^ sz ⊒ toUint (match addfull n m with | next carry n => n) = Add.add (toUint n) (toUint m)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toUint_by_lt
[626, 1]
[638, 18]
cases h₁: addfull n m
sz : β„• n m : FinInt sz h_bound : toUint n + toUint m < 2 ^ sz ⊒ toUint (match addfull n m with | next carry n => n) = Add.add (toUint n) (toUint m)
case next sz : β„• n m : FinInt sz h_bound : toUint n + toUint m < 2 ^ sz a✝¹ : Bool a✝ : FinInt sz h₁ : addfull n m = next a✝¹ a✝ ⊒ toUint (match next a✝¹ a✝ with | next carry n => n) = Add.add (toUint n) (toUint m)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toUint_by_lt
[626, 1]
[638, 18]
case next carry r => have hβ‚‚: (addfull n m).toUint = (next carry r).toUint := by simp [h₁] cases carry <;> simp at hβ‚‚ . simp [←hβ‚‚, FinInt.addfull_toUint, HAdd.hAdd] . simp [FinInt.addfull_toUint] at hβ‚‚ rw [hβ‚‚] at h_bound sorry_arith
sz : β„• n m : FinInt sz h_bound : toUint n + toUint m < 2 ^ sz carry : Bool r : FinInt sz h₁ : addfull n m = next carry r ⊒ toUint (match next carry r with | next carry n => n) = Add.add (toUint n) (toUint m)
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toUint_by_lt
[626, 1]
[638, 18]
have hβ‚‚: (addfull n m).toUint = (next carry r).toUint := by simp [h₁]
sz : β„• n m : FinInt sz h_bound : toUint n + toUint m < 2 ^ sz carry : Bool r : FinInt sz h₁ : addfull n m = next carry r ⊒ toUint (match next carry r with | next carry n => n) = Add.add (toUint n) (toUint m)
sz : β„• n m : FinInt sz h_bound : toUint n + toUint m < 2 ^ sz carry : Bool r : FinInt sz h₁ : addfull n m = next carry r hβ‚‚ : toUint (addfull n m) = toUint (next carry r) ⊒ toUint (match next carry r with | next carry n => n) = Add.add (toUint n) (toUint m)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toUint_by_lt
[626, 1]
[638, 18]
cases carry <;> simp at hβ‚‚
sz : β„• n m : FinInt sz h_bound : toUint n + toUint m < 2 ^ sz carry : Bool r : FinInt sz h₁ : addfull n m = next carry r hβ‚‚ : toUint (addfull n m) = toUint (next carry r) ⊒ toUint (match next carry r with | next carry n => n) = Add.add (toUint n) (toUint m)
case false sz : β„• n m : FinInt sz h_bound : toUint n + toUint m < 2 ^ sz r : FinInt sz h₁ : addfull n m = next false r hβ‚‚ : toUint (addfull n m) = toUint r ⊒ toUint (match next false r with | next carry n => n) = Add.add (toUint n) (toUint m) case true sz : β„• n m : FinInt sz h_bound : toUint n + toUint m < 2 ^ sz r : FinInt sz h₁ : addfull n m = next true r hβ‚‚ : toUint (addfull n m) = 2 ^ sz + toUint r ⊒ toUint (match next true r with | next carry n => n) = Add.add (toUint n) (toUint m)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toUint_by_lt
[626, 1]
[638, 18]
. simp [←hβ‚‚, FinInt.addfull_toUint, HAdd.hAdd]
case false sz : β„• n m : FinInt sz h_bound : toUint n + toUint m < 2 ^ sz r : FinInt sz h₁ : addfull n m = next false r hβ‚‚ : toUint (addfull n m) = toUint r ⊒ toUint (match next false r with | next carry n => n) = Add.add (toUint n) (toUint m) case true sz : β„• n m : FinInt sz h_bound : toUint n + toUint m < 2 ^ sz r : FinInt sz h₁ : addfull n m = next true r hβ‚‚ : toUint (addfull n m) = 2 ^ sz + toUint r ⊒ toUint (match next true r with | next carry n => n) = Add.add (toUint n) (toUint m)
case true sz : β„• n m : FinInt sz h_bound : toUint n + toUint m < 2 ^ sz r : FinInt sz h₁ : addfull n m = next true r hβ‚‚ : toUint (addfull n m) = 2 ^ sz + toUint r ⊒ toUint (match next true r with | next carry n => n) = Add.add (toUint n) (toUint m)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toUint_by_lt
[626, 1]
[638, 18]
. simp [FinInt.addfull_toUint] at hβ‚‚ rw [hβ‚‚] at h_bound sorry_arith
case true sz : β„• n m : FinInt sz h_bound : toUint n + toUint m < 2 ^ sz r : FinInt sz h₁ : addfull n m = next true r hβ‚‚ : toUint (addfull n m) = 2 ^ sz + toUint r ⊒ toUint (match next true r with | next carry n => n) = Add.add (toUint n) (toUint m)
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toUint_by_lt
[626, 1]
[638, 18]
simp [h₁]
sz : β„• n m : FinInt sz h_bound : toUint n + toUint m < 2 ^ sz carry : Bool r : FinInt sz h₁ : addfull n m = next carry r ⊒ toUint (addfull n m) = toUint (next carry r)
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toUint_rem
[640, 1]
[652, 52]
simp [FinInt.add_toUint_msb]
sz : β„• n m : FinInt sz ⊒ toUint (n + m) = if toUint n + toUint m < 2 ^ sz then toUint n + toUint m else toUint n + toUint m - 2 ^ sz
sz : β„• n m : FinInt sz ⊒ (match addfull n m with | next false a => toUint n + toUint m | next true a => toUint n + toUint m - 2 ^ sz) = if toUint n + toUint m < 2 ^ sz then toUint n + toUint m else toUint n + toUint m - 2 ^ sz
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toUint_rem
[640, 1]
[652, 52]
cases h_full: addfull n m
sz : β„• n m : FinInt sz ⊒ (match addfull n m with | next false a => toUint n + toUint m | next true a => toUint n + toUint m - 2 ^ sz) = if toUint n + toUint m < 2 ^ sz then toUint n + toUint m else toUint n + toUint m - 2 ^ sz
case next sz : β„• n m : FinInt sz a✝¹ : Bool a✝ : FinInt sz h_full : addfull n m = next a✝¹ a✝ ⊒ (match next a✝¹ a✝ with | next false a => toUint n + toUint m | next true a => toUint n + toUint m - 2 ^ sz) = if toUint n + toUint m < 2 ^ sz then toUint n + toUint m else toUint n + toUint m - 2 ^ sz
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toUint_rem
[640, 1]
[652, 52]
case next br r' => cases br <;> simp . have h := O_lt r'; rw [←h_full] at h simp [FinInt.addfull_toUint] at h; simp [h] . have h := I_not_lt r'; rw [←h_full] at h; sorry
sz : β„• n m : FinInt sz br : Bool r' : FinInt sz h_full : addfull n m = next br r' ⊒ (match next br r' with | next false a => toUint n + toUint m | next true a => toUint n + toUint m - 2 ^ sz) = if toUint n + toUint m < 2 ^ sz then toUint n + toUint m else toUint n + toUint m - 2 ^ sz
no goals