Skip to content

Commit 05642c2

Browse files
committed
update comment
1 parent 8229a13 commit 05642c2

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

src/Init/Prelude.lean

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2106,25 +2106,7 @@ instance : DecidableEq UInt64 := UInt64.decEq
21062106
instance : Inhabited UInt64 where
21072107
default := UInt64.ofNatCore 0 (by decide)
21082108

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`. -/
21282110
abbrev USize.size : Nat := (hPow 2 System.Platform.numBits)
21292111

21302112
theorem usize_size_eq : Or (Eq USize.size 4294967296) (Eq USize.size 18446744073709551616) :=

0 commit comments

Comments
 (0)