File tree Expand file tree Collapse file tree 1 file changed +1
-19
lines changed Expand file tree Collapse file tree 1 file changed +1
-19
lines changed Original file line number Diff line number Diff line change @@ -2106,25 +2106,7 @@ instance : DecidableEq UInt64 := UInt64.decEq
2106
2106
instance : Inhabited UInt64 where
2107
2107
default := UInt64.ofNatCore 0 (by decide)
2108
2108
2109
- /--
2110
- The size of type `USize`, that is, `2^System.Platform.numBits`, which may
2111
- be either `2^32` or `2^64` depending on the platform's architecture.
2112
-
2113
- Remark: we define `USize.size` using `(2^numBits - 1) + 1` to ensure the
2114
- Lean unifier can solve contraints such as `?m + 1 = USize.size`. Recall that
2115
- `numBits` does not reduce to a numeral in the Lean kernel since it is platform
2116
- specific. Without this trick, the following definition would be rejected by the
2117
- Lean type checker.
2118
- ```
2119
- def one: Fin USize.size := 1
2120
- ```
2121
- Because Lean would fail to synthesize instance `OfNat (Fin USize.size) 1`.
2122
- Recall that the `OfNat` instance for `Fin` is
2123
- ```
2124
- instance : OfNat (Fin (n+1)) i where
2125
- ofNat := Fin.ofNat i
2126
- ```
2127
- -/
2109
+ /-- The size of type `USize`, that is, `2^System.Platform.numBits`. -/
2128
2110
abbrev USize.size : Nat := (hPow 2 System.Platform.numBits)
2129
2111
2130
2112
theorem usize_size_eq : Or (Eq USize.size 4294967296 ) (Eq USize.size 18446744073709551616 ) :=
You can’t perform that action at this time.
0 commit comments