This PR is an effort to improve reasoning at the Nat level about bitvectors and reduce of Fin and Nat. It slightly tightens some proofs, but is generally aimed at reducing inconsistencies between definitions at the Nat and Fin types in favor of more consistently using Nat operations. This ports leanprover/std4#664 to Lean core. Here was the rational I provided in the discussion for leanprover/std4#664: It's mostly about consistency. If we use the same types and style in definitions and proofs, there is less surprise when unfolding or otherwise using definitions. We use some Nat based operations that haven't been extended to Fin such as the bitwise operations, and I don't want to pay the overhead of introducing a Fin version of every Bitvector operation. So this basically means Nat is preferred. One argument potentially in favor of Fin is that we could reuse results proven there, but that doesn't really seem to be the case so far. A second argument is that we want to simplify expression to use more canonical forms and we currently can pretty-print those operations better using ofNat than ofFin. We could define the notations using ofFin of course though, but that's additional operators that will show up in expressions.
14 lines
336 B
Text
14 lines
336 B
Text
def gfxabc (x : Nat) := x
|
|
def gfxacc (x : Nat) := x
|
|
def gfxadc (x : Nat) := x
|
|
def gfxbbc (x : Nat) := x
|
|
#check gfxabc
|
|
--^ textDocument/completion
|
|
|
|
def Boo.gfxabc (x : Nat) := x
|
|
def Boo.gfxacc (x : Nat) := x
|
|
def Boo.gfxadc (x : Nat) := x
|
|
def Boo.gfxbbc (x : Nat) := x
|
|
|
|
#check Boo.gfxabc
|
|
--^ textDocument/completion
|