statement
stringlengths
1
8.65k
proof
stringlengths
0
19.6k
type
stringclasses
12 values
symbolic_name
stringlengths
1
110
library
stringclasses
165 values
filename
stringclasses
822 values
imports
listlengths
0
19
deps
listlengths
0
64
docstring
stringlengths
0
3.64k
source_url
stringclasses
1 value
commit
stringclasses
1 value
neutralConfig : Simp.Config
{ zeta := false beta := false eta := false iota := false proj := false decide := false arith := false autoUnfold := false ground := false zetaDelta := false zetaUnused := false...
def
Lean.Meta.Simp.neutralConfig
Init
src/Init/MetaTypes.lean
[]
[]
A neutral configuration for `simp`, turning off all reductions and other built-in simplifications.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
NormCastConfig extends Simp.Config where zeta
false beta := false eta := false proj := false iota := false
structure
Lean.Meta.Simp.NormCastConfig
Init
src/Init/MetaTypes.lean
[]
[]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
Occurrences where /-- All occurrences should be rewritten. -/ | all /-- A list of indices for which occurrences should be rewritten. -/ | pos (idxs : List Nat) /-- A list of indices for which occurrences should not be rewritten. -/ | neg (idxs : List Nat) deriving Inhabited, BEq
inductive
Lean.Meta.Occurrences
Init
src/Init/MetaTypes.lean
[]
[ "BEq", "Inhabited", "List", "Nat" ]
Configuration for which occurrences that match an expression should be rewritten.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
ExtractLetsConfig where /-- If true (default: false), extract lets from subterms that are proofs. Top-level lets are always extracted. -/ proofs : Bool
false /-- If true (default: true), extract lets from subterms that are types. Top-level lets are always extracted. -/ types : Bool := true /-- If true (default: false), extract lets from subterms that are implicit arguments. -/ implicits : Bool := false /-- If false (default: true), extracts only top-level ...
structure
Lean.Meta.ExtractLetsConfig
Init
src/Init/MetaTypes.lean
[]
[ "Bool" ]
Configuration for the `extract_lets` tactic.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
LiftLetsConfig extends ExtractLetsConfig where lift
true preserveBinderNames := true
structure
Lean.Meta.LiftLetsConfig
Init
src/Init/MetaTypes.lean
[]
[]
Configuration for the `lift_lets` tactic.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
ReduceConfig where /-- Do reductions of types and propositions. Default: `false`. -/ types : Bool
false /-- Do reductions of proof terms. Default: `false`. -/ proofs : Bool := false /-- In applications, do reductions of implicit arguments. Default: `false`. -/ implicits : Bool := false /-- Transparency mode for reduction. Default: `all`. -/ transparency : TransparencyMode := .all /-- Use "smart unfold...
structure
Lean.Meta.Command.ReduceConfig
Init
src/Init/MetaTypes.lean
[]
[ "Bool" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
Add.add_eq_hAdd {α : Type u} [inst : Add α] : Eq (@Add.add α inst) (@HAdd.hAdd α α α (@instHAdd α inst))
rfl
theorem
Add.add_eq_hAdd
Init
src/Init/MethodSpecsSimp.lean
[]
[ "Add", "Eq", "instHAdd", "rfl" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
Sub.sub_eq_hSub [Sub α] : Eq (@Sub.sub α _) (@HSub.hSub α α α _)
rfl
theorem
Sub.sub_eq_hSub
Init
src/Init/MethodSpecsSimp.lean
[]
[ "Eq", "Sub", "rfl" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
Mul.mul_eq_hMul [Mul α] : Eq (@Mul.mul α _) (@HMul.hMul α α α _)
rfl
theorem
Mul.mul_eq_hMul
Init
src/Init/MethodSpecsSimp.lean
[]
[ "Eq", "Mul", "rfl" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
Div.div_eq_hDiv [Div α] : Eq (@Div.div α _) (@HDiv.hDiv α α α _)
rfl
theorem
Div.div_eq_hDiv
Init
src/Init/MethodSpecsSimp.lean
[]
[ "Div", "Eq", "rfl" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
Mod.mod_eq_hMod [Mod α] : Eq (@Mod.mod α _) (@HMod.hMod α α α _)
rfl
theorem
Mod.mod_eq_hMod
Init
src/Init/MethodSpecsSimp.lean
[]
[ "Eq", "Mod", "rfl" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
Pow.pow_eq_hPow {α β} [Pow α β] : Eq (@Pow.pow α β _) (@HPow.hPow α β α _)
rfl
theorem
Pow.pow_eq_hPow
Init
src/Init/MethodSpecsSimp.lean
[]
[ "Eq", "Pow", "rfl" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
SMul.smul_eq_hSMul {α β} [SMul α β] : Eq (@SMul.smul α β _) (@HSMul.hSMul α β β _)
rfl
theorem
SMul.smul_eq_hSMul
Init
src/Init/MethodSpecsSimp.lean
[]
[ "Eq", "SMul", "rfl" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
Mul.mul_eq_smul {α} [Mul α] : Eq (@Mul.mul α _) (@SMul.smul α α _)
rfl
theorem
Mul.mul_eq_smul
Init
src/Init/MethodSpecsSimp.lean
[]
[ "Eq", "Mul", "rfl" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
Append.append_eq_hAppend [Append α] : Eq (@Append.append α _) (@HAppend.hAppend α α α _)
rfl
theorem
Append.append_eq_hAppend
Init
src/Init/MethodSpecsSimp.lean
[]
[ "Append", "Eq", "rfl" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
OrElse.orElse_eq_hOrElse [OrElse α] : Eq (@OrElse.orElse α _) (@HOrElse.hOrElse α α α _)
rfl
theorem
OrElse.orElse_eq_hOrElse
Init
src/Init/MethodSpecsSimp.lean
[]
[ "Eq", "OrElse", "rfl" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
AndThen.andThen_eq_hAndThen [AndThen α] : Eq (@AndThen.andThen α _) (@HAndThen.hAndThen α α α _)
rfl
theorem
AndThen.andThen_eq_hAndThen
Init
src/Init/MethodSpecsSimp.lean
[]
[ "AndThen", "Eq", "rfl" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
AndOp.andOp_hAnd [AndOp α] : Eq (@AndOp.and α _) (@HAnd.hAnd α α α _)
rfl
theorem
AndOp.andOp_hAnd
Init
src/Init/MethodSpecsSimp.lean
[]
[ "AndOp", "Eq", "rfl" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
XorOp.xor_hXor [XorOp α] : Eq (@XorOp.xor α _) (@HXor.hXor α α α _)
rfl
theorem
XorOp.xor_hXor
Init
src/Init/MethodSpecsSimp.lean
[]
[ "Eq", "XorOp", "rfl" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
OrOp.or_hOr [OrOp α] : Eq (@OrOp.or α _) (@HOr.hOr α α α _)
rfl
theorem
OrOp.or_hOr
Init
src/Init/MethodSpecsSimp.lean
[]
[ "Eq", "OrOp", "rfl" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
ShiftLeft.shiftLeft_hShiftLeft [ShiftLeft α] : Eq (@ShiftLeft.shiftLeft α _) (@HShiftLeft.hShiftLeft α α α _)
rfl
theorem
ShiftLeft.shiftLeft_hShiftLeft
Init
src/Init/MethodSpecsSimp.lean
[]
[ "Eq", "ShiftLeft", "rfl" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
ShiftRight.shiftRight_hShiftRight [ShiftRight α] : Eq (@ShiftRight.shiftRight α _) (@HShiftRight.hShiftRight α α α _)
rfl
theorem
ShiftRight.shiftRight_hShiftRight
Init
src/Init/MethodSpecsSimp.lean
[]
[ "Eq", "ShiftRight", "rfl" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
Parser.Category
structure
Lean.Parser.Category
Init
src/Init/Notation.lean
[]
[]
Auxiliary type used to represent syntax categories. We mainly use auxiliary definitions with this type to attach doc strings to syntax categories.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
command : Category
{}
def
Lean.Parser.Category.command
Init
src/Init/Notation.lean
[]
[]
`command` is the syntax category for things that appear at the top level of a lean file. For example, `def foo := 1` is a `command`, as is `namespace Foo` and `end Foo`. Commands generally have an effect on the state of adding something to the environment (like a new definition), as well as commands like `variable` whi...
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
term : Category
{}
def
Lean.Parser.Category.term
Init
src/Init/Notation.lean
[]
[]
`term` is the builtin syntax category for terms. A term denotes an expression in lean's type theory, for example `2 + 2` is a term. The difference between `Term` and `Expr` is that the former is a kind of syntax, while the latter is the result of elaboration. For example `by simp` is also a `Term`, but it elaborates to...
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
tactic : Category
{}
def
Lean.Parser.Category.tactic
Init
src/Init/Notation.lean
[]
[]
`tactic` is the builtin syntax category for tactics. These appear after `by` in proofs, and they are programs that take in the proof context (the hypotheses in scope plus the type of the term to synthesize) and construct a term of the expected type. For example, `simp` is a tactic, used in: ``` example : 2 + 2 = 4 := b...
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
doElem : Category
{}
def
Lean.Parser.Category.doElem
Init
src/Init/Notation.lean
[]
[]
`doElem` is a builtin syntax category for elements that can appear in the `do` notation. For example, `let x ← e` is a `doElem`, and a `do` block consists of a list of `doElem`s.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
structInstFieldDecl : Category
{}
def
Lean.Parser.Category.structInstFieldDecl
Init
src/Init/Notation.lean
[]
[]
`structInstFieldDecl` is the syntax category for value declarations for fields in structure instance notation. For example, the `:= 1` and `| 0 => 0 | n + 1 => n` in `{ x := 1, f | 0 => 0 | n + 1 => n }` are in the `structInstFieldDecl` class.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
level : Category
{}
def
Lean.Parser.Category.level
Init
src/Init/Notation.lean
[]
[]
`level` is a builtin syntax category for universe levels. This is the `u` in `Sort u`: it can contain `max` and `imax`, addition with constants, and variables.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
attr : Category
{}
def
Lean.Parser.Category.attr
Init
src/Init/Notation.lean
[]
[]
`attr` is a builtin syntax category for attributes. Declarations can be annotated with attributes using the `@[...]` notation.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
stx : Category
{}
def
Lean.Parser.Category.stx
Init
src/Init/Notation.lean
[]
[]
`stx` is a builtin syntax category for syntax. This is the abbreviated parser notation used inside `syntax` and `macro` declarations.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
prio : Category
{}
def
Lean.Parser.Category.prio
Init
src/Init/Notation.lean
[]
[]
`prio` is a builtin syntax category for priorities. Priorities are used in many different attributes. Higher numbers denote higher priority, and for example typeclass search will try high priority instances before low priority. In addition to literals like `37`, you can also use `low`, `mid`, `high`, as well as add and...
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
prec : Category
{}
def
Lean.Parser.Category.prec
Init
src/Init/Notation.lean
[]
[]
`prec` is a builtin syntax category for precedences. A precedence is a value that expresses how tightly a piece of syntax binds: for example `1 + 2 * 3` is parsed as `1 + (2 * 3)` because `*` has a higher precedence than `+`. Higher numbers denote higher precedence. In addition to literals like `37`, there are some spe...
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
"max" : prec => `(prec| 1024)
macro
max
Init
src/Init/Notation.lean
[]
[]
Maximum precedence used in term parsers, in particular for terms in function position (`ident`, `paren`, ...)
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
"arg" : prec => `(prec| 1023)
macro
arg
Init
src/Init/Notation.lean
[]
[]
Precedence used for application arguments (`do`, `by`, ...).
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
"lead" : prec => `(prec| 1022)
macro
lead
Init
src/Init/Notation.lean
[]
[]
Precedence used for terms not supposed to be used as arguments (`let`, `have`, ...).
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
"(" p:prec ")" : prec => return p
macro
(
Init
src/Init/Notation.lean
[]
[]
Parentheses are used for grouping precedence expressions.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
"min" : prec => `(prec| 10)
macro
min
Init
src/Init/Notation.lean
[]
[]
Minimum precedence used in term parsers.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
"min1" : prec => `(prec| 11)
macro
min1
Init
src/Init/Notation.lean
[]
[]
`(min+1)` (we can only write `min+1` after `Meta.lean`)
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
"max_prec" : term => `(1024)
macro
max_prec
Init
src/Init/Notation.lean
[]
[]
`max:prec` as a term. It is equivalent to `eval_prec max` for `eval_prec` defined at `Meta.lean`. We use `max_prec` to workaround bootstrapping issues.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
"default" : prio => `(prio| 1000)
macro
default
Init
src/Init/Notation.lean
[]
[]
The default priority `default = 1000`, which is used when no priority is set.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
"low" : prio => `(prio| 100)
macro
low
Init
src/Init/Notation.lean
[]
[]
The standardized "low" priority `low = 100`, for things that should be lower than default priority.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
"mid" : prio => `(prio| 500)
macro
mid
Init
src/Init/Notation.lean
[]
[]
The standardized "medium" priority `mid = 500`. This is lower than `default`, and higher than `low`.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
"high" : prio => `(prio| 10000)
macro
high
Init
src/Init/Notation.lean
[]
[]
The standardized "high" priority `high = 10000`, for things that should be higher than default priority.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
"(" p:prio ")" : prio => return p
macro
(
Init
src/Init/Notation.lean
[]
[]
Parentheses are used for grouping priority expressions.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
:arg x:stx:max ",*" : stx => `(stx| sepBy($x, ",", ", "))
macro
,*
Init
src/Init/Notation.lean
[]
[]
`p,*` is shorthand for `sepBy(p, ",")`. It parses 0 or more occurrences of `p` separated by `,`, that is: `empty | p | p,p | p,p,p | ...`. It produces a `nullNode` containing a `SepArray` with the interleaved parser results. It has arity 1, and auto-groups its component parser if needed.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
:arg x:stx:max ",+" : stx => `(stx| sepBy1($x, ",", ", "))
macro
,+
Init
src/Init/Notation.lean
[]
[]
`p,+` is shorthand for `sepBy1(p, ",")`. It parses 1 or more occurrences of `p` separated by `,`, that is: `p | p,p | p,p,p | ...`. It produces a `nullNode` containing a `SepArray` with the interleaved parser results. It has arity 1, and auto-groups its component parser if needed.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
:arg x:stx:max ",*,?" : stx => `(stx| sepBy($x, ",", ", ", allowTrailingSep))
macro
,*,?
Init
src/Init/Notation.lean
[]
[]
`p,*,?` is shorthand for `sepBy(p, ",", allowTrailingSep)`. It parses 0 or more occurrences of `p` separated by `,`, possibly including a trailing `,`, that is: `empty | p | p, | p,p | p,p, | p,p,p | ...`. It produces a `nullNode` containing a `SepArray` with the interleaved parser results. It has arity 1, and auto-gr...
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
:arg x:stx:max ",+,?" : stx => `(stx| sepBy1($x, ",", ", ", allowTrailingSep))
macro
,+,?
Init
src/Init/Notation.lean
[]
[]
`p,+,?` is shorthand for `sepBy1(p, ",", allowTrailingSep)`. It parses 1 or more occurrences of `p` separated by `,`, possibly including a trailing `,`, that is: `p | p, | p,p | p,p, | p,p,p | ...`. It produces a `nullNode` containing a `SepArray` with the interleaved parser results. It has arity 1, and auto-groups it...
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
:arg "!" x:stx:max : stx => `(stx| notFollowedBy($x))
macro
!
Init
src/Init/Notation.lean
[]
[]
`!p` parses the negation of `p`. That is, it fails if `p` succeeds, and otherwise parses nothing. It has arity 0.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
"without_expected_type " x:term : term => `(let aux := $x; aux)
macro
without_expected_type
Init
src/Init/Notation.lean
[]
[]
`without_expected_type t` instructs Lean to elaborate `t` without an expected type. Recall that terms such as `match ... with ...` and `⟨...⟩` will postpone elaboration until expected type is known. So, `without_expected_type` is not effective in this case.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
expandExplicitBindersAux (combinator : Syntax) (idents : Array Syntax) (type? : Option Syntax) (body : Syntax) : MacroM Syntax
let rec loop (i : Nat) (h : i ≤ idents.size) (acc : Syntax) := do match i, h with | 0, _ => pure acc | i + 1, h => let ident := idents[i][0] let acc ← match ident.isIdent, type? with | true, none => `($combinator fun $ident => $acc) | true, some type => `($combinator fun...
def
Lean.expandExplicitBindersAux
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Array", "Nat", "Nat.le_of_succ_le", "Option" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
expandBracketedBindersAux (combinator : Syntax) (binders : Array Syntax) (body : Syntax) : MacroM Syntax
let rec loop (i : Nat) (h : i ≤ binders.size) (acc : Syntax) := do match i, h with | 0, _ => pure acc | i+1, h => let idents := binders[i][1].getArgs let type := binders[i][3] loop i (Nat.le_of_succ_le h) (← expandExplicitBindersAux combinator idents (some type) acc) loop binders.siz...
def
Lean.expandBracketedBindersAux
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Array", "Nat", "Nat.le_of_succ_le" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
expandExplicitBinders (combinatorDeclName : Name) (explicitBinders : Syntax) (body : Syntax) : MacroM Syntax
do let combinator := mkCIdentFrom (← getRef) combinatorDeclName let explicitBinders := explicitBinders[0] if explicitBinders.getKind == ``Lean.unbracketedExplicitBinders then let idents := explicitBinders[0].getArgs let type? := if explicitBinders[1].isNone then none else some explicitBinders[1][1] ...
def
Lean.expandExplicitBinders
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
expandBracketedBinders (combinatorDeclName : Name) (bracketedExplicitBinders : Syntax) (body : Syntax) : MacroM Syntax
do let combinator := mkCIdentFrom (← getRef) combinatorDeclName expandBracketedBindersAux combinator #[bracketedExplicitBinders] body
def
Lean.expandBracketedBinders
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
"∃" xs:explicitBinders ", " b:term : term => expandExplicitBinders ``Exists xs b
macro
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Exists" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
"exists" xs:explicitBinders ", " b:term : term => expandExplicitBinders ``Exists xs b
macro
exists
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Exists" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
"Σ" xs:explicitBinders ", " b:term : term => expandExplicitBinders ``Sigma xs b
macro
Σ
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Sigma" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
"Σ'" xs:explicitBinders ", " b:term : term => expandExplicitBinders ``PSigma xs b
macro
Σ'
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "PSigma" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
:35 xs:bracketedExplicitBinders " × " b:term:35 : term => expandBracketedBinders ``Sigma xs b
macro
×
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Sigma" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
:35 xs:bracketedExplicitBinders " ×' " b:term:35 : term => expandBracketedBinders ``PSigma xs b
macro
×'
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "PSigma" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
tk:"calc" steps:calcSteps : conv => `(conv| tactic => calc%$tk $steps)
macro
calc
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
unexpandUnit : Lean.PrettyPrinter.Unexpander
| `($(_)) => `(())
def
unexpandUnit
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Lean.PrettyPrinter.Unexpander" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
unexpandListNil : Lean.PrettyPrinter.Unexpander
| `($(_)) => `([])
def
unexpandListNil
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Lean.PrettyPrinter.Unexpander" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
unexpandListCons : Lean.PrettyPrinter.Unexpander
| `($(_) $x $tail) => match tail with | `([]) => `([$x]) | `([$xs,*]) => `([$x, $xs,*]) | `(⋯) => `([$x, $tail]) -- Unexpands to `[x, y, z, ⋯]` for `⋯ : List α` | _ => throw () | _ => throw ()
def
unexpandListCons
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Lean.PrettyPrinter.Unexpander" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
unexpandListToArray : Lean.PrettyPrinter.Unexpander
| `($(_) [$xs,*]) => `(#[$xs,*]) | _ => throw ()
def
unexpandListToArray
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Lean.PrettyPrinter.Unexpander" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
unexpandProdMk : Lean.PrettyPrinter.Unexpander
| `($(_) $x ($y, $ys,*)) => `(($x, $y, $ys,*)) | `($(_) $x $y) => `(($x, $y)) | _ => throw ()
def
unexpandProdMk
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Lean.PrettyPrinter.Unexpander" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
unexpandIte : Lean.PrettyPrinter.Unexpander
| `($(_) $c $t $e) => `(if $c then $t else $e) | _ => throw ()
def
unexpandIte
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Lean.PrettyPrinter.Unexpander" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
unexpandEqNDRec : Lean.PrettyPrinter.Unexpander
| `($(_) $m $h) => `($h ▸ $m) | _ => throw ()
def
unexpandEqNDRec
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Lean.PrettyPrinter.Unexpander" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
unexpandEqRec : Lean.PrettyPrinter.Unexpander
| `($(_) $m $h) => `($h ▸ $m) | _ => throw ()
def
unexpandEqRec
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Lean.PrettyPrinter.Unexpander" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
unexpandExists : Lean.PrettyPrinter.Unexpander
| `($(_) fun $x:ident => ∃ $xs:binderIdent*, $b) => `(∃ $x:ident $xs:binderIdent*, $b) | `($(_) fun $x:ident => $b) => `(∃ $x:ident, $b) | `($(_) fun ($x:ident : $t) => $b) => `(∃ ($x:ident : $t), $b) | _ => throw ()
def
unexpandExists
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Lean.PrettyPrinter.Unexpander" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
unexpandSigma : Lean.PrettyPrinter.Unexpander
| `($(_) fun ($x:ident : $t) => $b) => `(($x:ident : $t) × $b) | _ => throw ()
def
unexpandSigma
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Lean.PrettyPrinter.Unexpander" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
unexpandPSigma : Lean.PrettyPrinter.Unexpander
| `($(_) fun ($x:ident : $t) => $b) => `(($x:ident : $t) ×' $b) | _ => throw ()
def
unexpandPSigma
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Lean.PrettyPrinter.Unexpander" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
unexpandSubtype : Lean.PrettyPrinter.Unexpander
| `($(_) fun ($x:ident : $type) => $p) => `({ $x : $type // $p }) | `($(_) fun $x:ident => $p) => `({ $x // $p }) | _ => throw ()
def
unexpandSubtype
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Lean.PrettyPrinter.Unexpander" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
unexpandTSyntax : Lean.PrettyPrinter.Unexpander
| `($f [$k]) => `($f $k) | _ => throw ()
def
unexpandTSyntax
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Lean.PrettyPrinter.Unexpander" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
unexpandTSyntaxArray : Lean.PrettyPrinter.Unexpander
| `($f [$k]) => `($f $k) | _ => throw ()
def
unexpandTSyntaxArray
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Lean.PrettyPrinter.Unexpander" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
unexpandTSepArray : Lean.PrettyPrinter.Unexpander
| `($f [$k] $sep) => `($f $k $sep) | _ => throw ()
def
unexpandTSepArray
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Lean.PrettyPrinter.Unexpander" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
unexpandGetElem : Lean.PrettyPrinter.Unexpander
| `($_ $array $index $_) => `($array[$index]) | _ => throw ()
def
unexpandGetElem
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Lean.PrettyPrinter.Unexpander" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
unexpandGetElem! : Lean.PrettyPrinter.Unexpander
| `($_ $array $index) => `($array[$index]!) | _ => throw ()
def
unexpandGetElem!
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Lean.PrettyPrinter.Unexpander" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
unexpandGetElem? : Lean.PrettyPrinter.Unexpander
| `($_ $array $index) => `($array[$index]?) | _ => throw ()
def
unexpandGetElem?
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Lean.PrettyPrinter.Unexpander" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
unexpandArrayEmpty : Lean.PrettyPrinter.Unexpander
| _ => `(#[])
def
unexpandArrayEmpty
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Lean.PrettyPrinter.Unexpander" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
unexpandMkArray0 : Lean.PrettyPrinter.Unexpander
| _ => `(#[])
def
unexpandMkArray0
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Lean.PrettyPrinter.Unexpander" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
unexpandMkArray1 : Lean.PrettyPrinter.Unexpander
| `($(_) $a1) => `(#[$a1]) | _ => throw ()
def
unexpandMkArray1
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Lean.PrettyPrinter.Unexpander" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
unexpandMkArray2 : Lean.PrettyPrinter.Unexpander
| `($(_) $a1 $a2) => `(#[$a1, $a2]) | _ => throw ()
def
unexpandMkArray2
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Lean.PrettyPrinter.Unexpander" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
unexpandMkArray3 : Lean.PrettyPrinter.Unexpander
| `($(_) $a1 $a2 $a3) => `(#[$a1, $a2, $a3]) | _ => throw ()
def
unexpandMkArray3
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Lean.PrettyPrinter.Unexpander" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
unexpandMkArray4 : Lean.PrettyPrinter.Unexpander
| `($(_) $a1 $a2 $a3 $a4) => `(#[$a1, $a2, $a3, $a4]) | _ => throw ()
def
unexpandMkArray4
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Lean.PrettyPrinter.Unexpander" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
unexpandMkArray5 : Lean.PrettyPrinter.Unexpander
| `($(_) $a1 $a2 $a3 $a4 $a5) => `(#[$a1, $a2, $a3, $a4, $a5]) | _ => throw ()
def
unexpandMkArray5
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Lean.PrettyPrinter.Unexpander" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
unexpandMkArray6 : Lean.PrettyPrinter.Unexpander
| `($(_) $a1 $a2 $a3 $a4 $a5 $a6) => `(#[$a1, $a2, $a3, $a4, $a5, $a6]) | _ => throw ()
def
unexpandMkArray6
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Lean.PrettyPrinter.Unexpander" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
unexpandMkArray7 : Lean.PrettyPrinter.Unexpander
| `($(_) $a1 $a2 $a3 $a4 $a5 $a6 $a7) => `(#[$a1, $a2, $a3, $a4, $a5, $a6, $a7]) | _ => throw ()
def
unexpandMkArray7
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Lean.PrettyPrinter.Unexpander" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
unexpandMkArray8 : Lean.PrettyPrinter.Unexpander
| `($(_) $a1 $a2 $a3 $a4 $a5 $a6 $a7 $a8) => `(#[$a1, $a2, $a3, $a4, $a5, $a6, $a7, $a8]) | _ => throw ()
def
unexpandMkArray8
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Lean.PrettyPrinter.Unexpander" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
:50 e:term:51 " matches " p:sepBy1(term:51, " | ") : term => `(((match $e:term with | $[$p:term]|* => true | _ => false) : Bool))
macro
matches
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
singletonUnexpander : Lean.PrettyPrinter.Unexpander
| `($_ $a) => `({ $a:term }) | _ => throw ()
def
Lean.singletonUnexpander
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Lean.PrettyPrinter.Unexpander" ]
Unexpander for the `{ x }` notation.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
insertUnexpander : Lean.PrettyPrinter.Unexpander
| `($_ $a { $ts:term,* }) => `({$a:term, $ts,*}) | _ => throw ()
def
Lean.insertUnexpander
Init
src/Init/NotationExtra.lean
[ "Init.Meta.Defs" ]
[ "Lean.PrettyPrinter.Unexpander" ]
Unexpander for the `{ x, y, ... }` notation.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
lcErased : Type
axiom
lcErased
Init
src/Init/Prelude.lean
[]
[]
Marker for information that has been erased by the code generator.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
lcAny : Type
axiom
lcAny
Init
src/Init/Prelude.lean
[]
[]
Marker for type dependency that has been erased by the code generator.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
lcVoid : Type
axiom
lcVoid
Init
src/Init/Prelude.lean
[]
[]
Internal representation of `Void` in the compiler.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
PUnit : Sort u where /-- The only element of the universe-polymorphic unit type. -/ | unit : PUnit
inductive
PUnit
Init
src/Init/Prelude.lean
[]
[]
The canonical universe-polymorphic type with just one element. It should be used in contexts that require a type to be universe polymorphic, thus disallowing `Unit`.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
Eq : α → α → Prop where /-- `Eq.refl a : a = a` is reflexivity, the unique constructor of the equality type. See also `rfl`, which is usually used instead. -/ | refl (a : α) : Eq a a
inductive
Eq
Init
src/Init/Prelude.lean
[]
[]
The equality relation. It has one introduction rule, `Eq.refl`. We use `a = b` as notation for `Eq a b`. A fundamental property of equality is that it is an equivalence relation. ``` variable (α : Type) (a b c d : α) variable (hab : a = b) (hcb : c = b) (hcd : c = d) example : a = d := Eq.trans (Eq.trans hab (Eq.sym...
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
Eq.ndrec.{u1, u2} {α : Sort u2} {a : α} {motive : α → Sort u1} (m : motive a) {b : α} (h : Eq a b) : motive b
h.rec m
abbrev
Eq.ndrec.
Init
src/Init/Prelude.lean
[]
[ "Eq" ]
Non-dependent recursor for the equality type.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
HEq : {α : Sort u} → α → {β : Sort u} → β → Prop where /-- Reflexivity of heterogeneous equality. -/ | refl (a : α) : HEq a a
inductive
HEq
Init
src/Init/Prelude.lean
[]
[]
Heterogeneous equality. `a ≍ b` asserts that `a` and `b` have the same type, and casting `a` across the equality yields `b`, and vice versa. You should avoid using this type if you can. Heterogeneous equality does not have all the same properties as `Eq`, because the assumption that the types of `a` and `b` are equal ...
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6