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
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.