Skip to content

Commit 64ab276

Browse files
committed
chore: add urem theorems
1 parent 4abe468 commit 64ab276

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

src/Init/Data/BitVec/Lemmas.lean

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5025,6 +5025,46 @@ theorem smtUDiv_35 {x : BitVec w} (ht : x.smtUDiv s = t) :
50255025
theorem smtUDiv_36 {x : BitVec w} (ht : x.smtUDiv s = t) (hw : w ≠ 2):
50265026
x ≠ (1 - (x <<< (x - t))) := sorry
50275027

5028+
section Abstractions
5029+
section smtURem
5030+
variable {w : Nat} {x s t : BitVec w} (ht : BitVec.umod x s = t)
5031+
5032+
theorem smtURem_1 (hs : s = twoPow w i) :
5033+
t = (x.extractLsb' 0 (i - 1)).zeroExtend _ := sorry -- t = 0_[k(x) -i] : x[i-1 : 0]
5034+
5035+
theorem smtURem_2 (hs : s ≠ 0) : t ≤ s := sorry
5036+
5037+
theorem smtURem_3 (hx : x = 0) : t = 0 := sorry
5038+
5039+
theorem smtURem_4 (hs : s = 0) : t = x := sorry
5040+
5041+
theorem smtURem_5 (hs : s = x) : t = 0 := sorry
5042+
5043+
theorem smtURem_6 (hx : x ≤ s) : t = x := sorry
5044+
5045+
theorem smtURem_7 : t ≤ (~~~ (- s)) := sorry
5046+
5047+
theorem smtURem_8 : x = x &&& (s ||| (t ||| -s )) := sorry
5048+
5049+
theorem smtURem_9 : (t ||| (x &&& s)) ≤ x := sorry
5050+
5051+
theorem smtURem_10 : 1#w ≠ (t &&& ~~~(x ||| s)) := sorry
5052+
5053+
theorem smtURem_11 : t ≠ (~~~x ||| -s) := sorry
5054+
5055+
theorem smtURem_12 : (t &&& 1#w) ≤ (t &&& (x ||| s)) := sorry
5056+
5057+
theorem smtURem_13 (hw : 2 < w) :
5058+
x ≠ (-x ||| - ~~~ t) := sorry
5059+
5060+
theorem smtURem_14 :
5061+
t ≤ x + - s := sorry
5062+
5063+
theorem smtURem_15 :
5064+
(-s ^^^ (x ||| s)) ≥ t := sorry
5065+
5066+
end smtURem
5067+
end Abstractions
50285068
/-! ### Deprecations -/
50295069

50305070
set_option linter.missingDocs false

0 commit comments

Comments
 (0)