Skip to content

Commit

Permalink
Get started
Browse files Browse the repository at this point in the history
  • Loading branch information
TwoFX committed Jan 29, 2025
1 parent c7c1e09 commit b9284a5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/Init/Core.lean
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,8 @@ the `BEq` typeclass.
Unlike `x ≠ y` (which is notation for `Ne x y`), this is `Bool` valued instead of
`Prop` valued. It is mainly intended for programming applications.
The recommended way to refer to this notation in names is `bne`.
-/
@[inline] def bne {α : Type u} [BEq α] (a b : α) : Bool :=
!(a == b)
Expand Down
5 changes: 4 additions & 1 deletion src/Init/Data/BitVec/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,10 @@ end Int

section Syntax

/-- Notation for bit vector literals. `i#n` is a shorthand for `BitVec.ofNat n i`. -/
/-- Notation for bit vector literals. `i#n` is a shorthand for `BitVec.ofNat n i`.
The recommended way to refer to this notation in names is to suppress it, i.e., `0#n` should turn
into `zero`, not `ofNat_zero`. -/
syntax:max num noWs "#" noWs term:max : term
macro_rules | `($i:num#$n) => `(BitVec.ofNat $n $i)

Expand Down
6 changes: 5 additions & 1 deletion src/Init/Data/Vector/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ abbrev Array.toVector (xs : Array α) : Vector α xs.size := .mk xs rfl

namespace Vector

/-- Syntax for `Vector α n` -/
/-- Syntax for `Vector α n`
The recommended way to refer to `#v[]` in names is `empty`.
The recommended way to refer to `#v[a]` in names is `singleton`. -/
syntax "#v[" withoutPosition(sepBy(term, ", ")) "]" : term

open Lean in
Expand Down
2 changes: 2 additions & 0 deletions src/Init/Prelude.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,8 @@ if `x` is false then `y` is not evaluated.
/--
`not x`, or `!x`, is the boolean "not" operation (not to be confused
with `Not : Prop → Prop`, which is the propositional connective).
The recommended way to refer to this notation in names is `not`.
-/
@[inline] def Bool.not : Bool → Bool
| true => false
Expand Down

0 comments on commit b9284a5

Please sign in to comment.