implements `Simp.Config.implicitDefEqsProofs`. When `true` (default: `true`), `simp` will **not** create a proof term for a rewriting rule associated with an `rfl`-theorem. Rewriting rules are provided by users by annotating theorems with the attribute `@[simp]`. If the proof of the theorem is just `rfl` (reflexivity), and `implicitDefEqProofs := true`, `simp` will **not** create a proof term which is an application of the annotated theorem.


avoid negative environment lookup


ensure `instantiateMVarsProfiling` adds a trace node


adds a feature to the the mutual def elaborator where the `instance` command yields theorems instead of definitions when the class is a `Prop`.


unset trailing for `simpa?` "try this" suggestion


changes the rule for which projections become instances. Before, all parents along with all indirect ancestors that were represented as subobject fields would have their projections become instances. Now only projections for direct parents become instances.


make `all_goals` admit goals on failure


introduce synthetic atoms in bv_decide


adds a new definition `Message.kind` which returns the top-level tag of a message. This is serialized as the new field `kind` in `SerialMessaege` so that i can be used by external consumers (e.g., Lake) to identify messages via `lean --json`.


`arg` conv tactic misreported number of arguments on error


BitVec.twoPow in bv_decide


simplifies the implementation of `omega`.


fix style in bv_decide normalizer


adds configuration options for `decide`/`decide!`/`native_decide` and refactors the tactics to be frontends to the same backend. Adds a `+revert` option that cleans up the local context and reverts all local variables the goal depends on, along with indirect propositional hypotheses. Makes `native_decide` fail at elaboration time on failure without sacrificing performance (the decision procedure is still evaluated just once). Now `native_decide` supports universe polymorphism.


changes `bv_decide`'s configuration from lots of `set_option` to an elaborated config like `simp` or `omega`. The notable exception is `sat.solver` which is still a `set_option` such that users can configure a custom SAT solver globally for an entire project or file. Additionally it introduces the ability to set `maxSteps` for the simp preprocessing run through the new config.


improves the validation of new syntactic tokens. Previously, the validation code had inconsistencies: some atoms would be accepted only if they had a leading space as a pretty printer hint. Additionally, atoms with internal whitespace are no longer allowed.


removes the `decide!` tactic in favor of `decide +kernel` (breaking change).


removes @[specilize] from `MkBinding.mkBinding`, which is a function that cannot be specialized (as none of its arguments are functions). As a result, the specializable function `Nat.foldRevM.loop` doesn't get specialized, which leads to worse performing code.


makes the `change` tactic and conv tactic use the same elaboration strategy. It works uniformly for both the target and local hypotheses. Now `change` can assign metavariables, for example:
```lean
example (x y z : Nat) : x + y = z := by
  change ?a = _
  let w := ?a
  -- now `w : Nat := x + y`
```


fixes a bug where the monad lift coercion elaborator would partially unify expressions even if they were not monads. This could be taken advantage of to propagate information that could help elaboration make progress, for example the first `change` worked because the monad lift coercion elaborator was unifying `@Eq _ _` with `@Eq (Nat × Nat) p`. As such, this is a breaking change; you may need to adjust expressions to include additional implicit arguments.


adds a normalization rule to `bv_normalize` (which is used by `bv_decide`) that converts `x / 2^k` into `x >>> k` under suitable conditions, allowing cheaper shifting circuits instead of expensive division circuits.


fixes `simp only [· ∈ ·]` after #5020.


introduces the and flattening pre processing pass from Bitwuzla to `bv_decide`. It splits hypotheses of the form `(a && b) = true` into `a = true` and `b = true` which synergizes with the existing embedded constraint substitution pass.


fixes `bv_decide`'s embedded constraint substitution to generate correct counter examples in the corner case where duplicate theorems are in the local context.


add `LEAN_ALWAYS_INLINE` to some functions


fixes `simp?` suggesting output with invalid indentation


mark `Meta.Context.config` as private


fixes the caching infrastructure for `whnf` and `isDefEq`, ensuring the cache accounts for all relevant configuration flags. Cleans up `WHNF.lean` and improves `whnf` configuration.


adds a simp_arith benchmark.


optimize Nat.Linear.Expr.toPoly


optimize Nat.Linear.Poly.norm


improves the asymptotic performance of `simp_arith` when there are many variables to consider.


adds options to `bv_decide`'s configuration so that all non mandatory preprocessing passes can be disabled.


changes how the canonicalizer handles `forall` and `lambda`, replacing bvars with temporary fvars. Fixes a bug reported by @hrmacbeth on zulip about quantifiers in CanonM.


use mkFreshUserName in ArgsPacker


improves the `#print` command for structures to show all fields and which parents the fields were inherited from, hiding internal details such as which parents are represented as subobjects. The pretty printer for private constants is also improved. Private names from the current module are handled like other names; private names from other modules are hygienic.


modifies the signature of `Nat.fold`, `Nat.foldRev`, `Nat.any`, `Nat.all`, so that the function is passed the upper bound, enabling compile time checks instead of runtime checks.


adds a primitive for creating temporary directories, akin to the existing functionality for creating temporary files.


completes the elementwise accessors for `ofNatLt`, `allOnes`, and `not` by adding their implementations of `getMsbD`.


completes the `toInt` interface for `BitVec` bitwise operations.


implements `BitVec.toInt_abs`.


adds `toNat` theorems for `BitVec.signExtend.`


adds toInt theorems for BitVec.signExtend.


adds theorem `mod_eq_sub`, makes theorem `sub_mul_eq_mod_of_lt_of_le` not private anymore and moves it within the `rotate*` section to use it in other proofs.


uses `Array.findFinIdx?` in preference to `Array.findIdx?` where possible, converting runtime checks to compile time checks.


completes the `toNat` theorems for bitwise operations (`and`, `or`, `xor`, `shiftLeft`, `shiftRight`) of the UInt types and adds `toBitVec` theorems as well; renames `and_toNat` to `toNat_and`.


adds the builtin simproc `USize.reduceToNat` which reduces `USize.toNat` on literals less than `UInt32.size`.


adds `Array.zipWithAll` and lemmas relating it to `List.zipWithAll`.


adds deprecations for `Lean.HashMap` functions which did not receive deprecation attributes initially.


completes the TODO in `Init.Data.Array.BinSearch`, removing `partial` and converting runtime checks to compile time checks.


changes the signature of `Array.swap`, so it takes `Nat` with tactic-provided proofs of bounds. Renames `Array.swap!` to `Array.swapIfInBounds`.


renames `Array.setD` to `Array.setIfInBounds`.


upstreams the definition of `Vector` from Batteries, along with basic functions.


upstreams `Nat.lt_pow_self` and `Nat.lt_two_pow` from Mathlib and uses them to prove the simp theorem `Nat.mod_two_pow`.


makes `USize.toUInt64` a regular non-opaque definition.


adds theorems `le_usize_size` and `usize_size_le`, simplifying inequalities about `USize.size`.


upstreams some UInt theorems from Batteries and adds more `toNat`-related theorems. Also adds missing `UInt8` and `UInt16` to/from `USize` conversions.


ensures `Fin.foldl` and `Fin.foldr` are semireducible so that certain defeqs (like `example (f : Fin 3 → ℕ) : List.ofFn f = [f 0, f 1, f 2] := rfl`) succeed.


fix Vector.indexOf?


adds `simp` lemmas about `List`'s `==` operation.


fixes problems in non-Ubuntu Linux distributions for `tzdata` directory by providing a fallback, and trims unnecessary characters from local time identifier.


changes the definition of `HashSet.insertMany` so it is equivalent to repeated `HashSet.insert`. Also clarifies docstrings of `insert` and `insertMany`.


copies some lemmas about `List.foldX` to `Array`.


upstreams lemmas about `Vector` from Batteries.


upstreams the definition and lemmas about `List.finRange` from Batteries.


relates `Nat.fold`/`foldRev`/`any`/`all` to corresponding list operations over `List.finRange`.


refactors `Array.qsort` to remove runtime array checks and avoid `partial`. Uses `Vector` API with auto_params. Benchmarks show no regression.


deprecates `Fin.ofNat` in favor of `Fin.ofNat'` which takes `[NeZero]` instead of returning `Fin (n+1)`.


adds `numBits_pos`, `le_numBits`, `numBits_le` to simplify inequalities about `System.Platform.numBits`.


changes `lean_sharecommon_{eq,hash}` to only consider the salient bytes of an object, not uninitialized capacity bytes.


fixes a bug in the constant folding of `Nat.ble` and `Nat.blt` in the old code generator, preventing miscompilation.


should make Lean better-behaved around sanitizers, addressing https://github.com/google/sanitizers/issues/1688. Taking the address of a local does not produce a monotonic measure of stack usage.


fixes an issue where edits to a command containing a nested docstring fail to reparse the entire command.


fixes `trace.profiler.pp` not using the term pretty printer.


adds core metaprogramming functions for forking off background tasks from elaboration so that their results show up in reporting and the language server.


fixes a bug with the `structure`/`class` command where parents not represented as subobjects but used other parents as instances caused a kernel error. Closes #2611.


fixes a non-termination bug when generating match-expression equation theorems. The proof automation repeatedly applied `injection(` to the same local decl. See issue #6067.


adds the builtin simproc `USize.reduceToNat` for `USize.toNat` on small literals. (Duplicate mention from above, but relevant to the code generator.)


adds a primitive for accessing the current thread ID.


fixes a bug in the proof assembly procedure used by the grind tactic (placeholder text).


adds `Lean.loadPlugin` exposing functionality similar to `--plugin` to Lean code.


adds the option `pp.parens` (default: false) to eagerly insert parentheses, helpful for teaching and clarifying expression structure.


prevents `Nat.succ ?_` from pretty printing as `?_.succ`, improving `apply?` usability.


improves term info for coercions like `DFunLike.coe` so "go to definition" on the function name works. Also shows the coercee rather than the coercion expression on hover.


improves the `#print` command for structures to show all fields and their inheritance, hiding subobject parent details. Private constants pretty print better, handling current-module private names normally and others hygienically.


adds a new delab option `pp.coercions.types` which shows all coercions with an explicit type ascription when enabled.


ensures whitespace is printed before `+opt` and `-opt` config options, improving tactics like `simp?`.


fixes a bug where `#check ident` would ignore `pp.raw`. Closes #6090.


exposes the difference in "synthesized type class instance is not definitionally equal" errors.


fixes a typo in the docstring for prec and improves the text slightly.


join → flatten in docstring


does some mild refactoring of the `Lean.Elab.StructInst` module while adding documentation.


converts 3 doc-strings to module docs, presumably their intended usage.


refine kernel code comments


adjust file reference in Data.Sum


explains the order in which `Expr.abstract` introduces de Bruijn indices.


adds auto-completion for fields in structure instance notation. Querying completions in whitespace now shows the full list of fields. Custom syntax can enable this by wrapping its fields parser in `structInstFields`.


fixes an old auto-completion bug where `x.` gave nonsensical completions if `x.` could not be elaborated as a dot completion.


avoid max heartbeat error in completion


fixes a regression with go-to-definition and doc highlight misbehaving on tactic blocks.


fixes a performance issue where the Lean language server walked the full project file tree on every save, blocking all other requests and increasing latency.


update toolchain on `lake update`


adds a newline at end of each Lean file generated by `lake new` templates.


makes Lake no longer automatically fetch GitHub cloud releases if the package build directory is already present, preventing the cache from overwriting existing prebuilt artifacts unless manually fetched with `lake build <pkg>:release`.


makes `lake build` also print package materialization log lines eagerly. Previously only `lake update` did so.


improves errors when Lake fails to fetch from Reservoir, suggesting how to require it from GitHub if not indexed.


makes all message constructors handle pretty printer errors.


runs all linters for a single command (together) on a separate thread from further elaboration, making a first step towards parallelizing the elaborator.


makes it harder to create "fake" theorems about definitions that are stubbed-out with sorry by ensuring that each sorry is not definitionally equal to any other. For example, this now fails:
lean
example : (sorry : Nat) = sorry := rfl -- fails

However, this still succeeds, since the sorry is a single indeterminate Nat:
lean
def f (n : Nat) : Nat := sorry
example : f 0 = f 1 := rfl -- succeeds

One can be more careful by putting parameters to the right of the colon:
lean
def f : (n : Nat) → Nat := sorry
example : f 0 = f 1 := rfl -- fails

Most sources of synthetic sorries (recall: a sorry that originates from the elaborator) are now unique, except for elaboration errors, since making these unique tends to cause a confusing cascade of errors. In general, however, such sorries are labeled. This enables "go to definition" on sorry in the Infoview, which brings you to its origin. The option set_option pp.sorrySource true causes the pretty printer to show source position information on sorries.


ensures that the configuration in Simp.Config is used when reducing terms and checking definitional equality in simp.


lets _ be used in numeric literals as a separator. For example, 1_000_000, 0xff_ff or 0b_10_11_01_00. New lexical syntax:
text
numeral10 : [0-9]+ ("_"+ [0-9]+)*
numeral2  : "0" [bB] ("_"* [0-1]+)+
numeral8  : "0" [oO] ("_"* [0-7]+)+
numeral16 : "0" [xX] ("_"* hex_char+)+
float     : numeral10 "." numeral10? [eE[+-]numeral10]


fixes a bug that could cause the injectivity tactic to fail in reducible mode, which could cause unfolding lemma generation to fail (used by tactics such as unfold). In particular, Lean.Meta.isConstructorApp'? was not aware that n + 1 is equivalent to Nat.succ n.


modifies the "foo has been deprecated: use betterFoo instead" warning so that foo and betterFoo are hoverable.


enables simp configuration options to be passed to norm_cast.


ensure bv_decide uses definitional equality in its reflection procedure as much as possible. Previously it would build up explicit congruence proofs for the kernel to check. This reduces the size of proof terms passed to kernel speeds up checking of large reflection proofs.


uses Lean.RArray in bv_decide's reflection proofs. Giving speedups on problems with lots of variables.


sets up simprocs for all the remaining operations defined in Init.Data.Fin.Basic


adds the debug.proofAsSorry option. When enabled, the proofs of theorems are ignored and replaced with sorry.


removes unnecessary parameters from the funcion induction principles. This is a breaking change; broken code can typically be adjusted simply by passing fewer parameters.


adds the --error=kind option (shorthand: -Ekind) to the lean CLI. When set, messages of kind (e.g., linter.unusedVariables) will be reported as errors. This setting does nothing in interactive contexts (e.g., the server).


adds support for Float32 and fixes a bug in the runtime.


fixes a bug in the simplifier. It was producing terms with loose bound variables when eliminating unused let_fun expressions.


adds an explanation to the error message when cases and induction are applied to a term whose type is not an inductive type. For Prop, these tactics now suggest the by_cases tactic. Example:
tactic 'cases' failed, major premise type is not an inductive type
  Prop


fixes a bug in withTrackingZetaDelta and withTrackingZetaDeltaSet. The MetaM caches need to be reset. See new test.


fixes a bug in simp_all? that caused some local declarations to be omitted from the Try this: suggestions.


ensures that revertAll clears auxiliary declarations when invoked directly by users.


fixes a type error in the proof generated by the contradiction tactic.


ensures that simp and dsimp do not unfold definitions that are not intended to be unfolded by the user. See issue #5755 for an example affected by this issue.


ensures Meta.check check projections.


adds reserved names for congruence theorems used in the simplifier and grind tactics. The idea is prevent the same congruence theorems to be generated over and over again.


introduces the following features to the WIP grind tactic:
- Expr internalization.
- Congruence theorem cache.
- Procedure for adding new facts
- New tracing options
- New preprocessing steps: fold projections and eliminate dangling Expr.mdata


fixes a bug in Lean.Meta.Closure that would introduce under-applied delayed assignment metavariables, which would keep them from ever getting instantiated. This bug affected match elaboration when the expected type contained postponed elaboration problems, for example tactic blocks.


fixes multiple bugs in the WIP grind tactic. It also adds support for printing the grind internal state.


adds a new preprocessing step to the grind tactic: universe-level normalization. The goal is to avoid missing equalities in the congruence closure module.


adds the predicate Expr.fvarsSet a b, which returns true if and only if the free variables in a are a subset of the free variables in b.


adds a custom type and instance canonicalizer for the (WIP) grind tactic. The grind tactic uses congruence closure but disregards types, type formers, instances, and proofs. Proofs are ignored due to proof irrelevance. Types, type formers, and instances are considered supporting elements and are not factored into congruence detection. Instead, grind only checks whether elements are structurally equal, which, in the context of the grind tactic, is equivalent to pointer equality. See new tests for examples where the canonicalizer is important.


implements the congruence table for the (WIP) grind tactic. It also fixes several bugs, and adds a new preprocessing step.


adds support for detecting congruent terms in the (WIP) grind tactic. It also introduces the grind.debug option, which, when set to true, checks many invariants after each equivalence class is merged. This option is intended solely for debugging purposes.


ensures norm_cast doesn't fail to act in the presence of no_index annotations


adds basic truth value propagation rules to the (WIP) grind tactic.


fixes the checkParents sanity check in grind.


adds support for propagating the truth value of equalities in the (WIP) grind tactic.


refactors grind and adds support for invoking the simplifier using the GrindM monad.


declares the command builtin_grind_propagator for registering equation propagator for grind. It also declares the auxiliary the attribute.


completes the implementation of the command builtin_grind_propagator.


adds support for generating (small) proofs for any two expressions that belong to the same equivalence class in the grind tactic state.


improves bv_decide's performance in the presence of large literals.


fixes a bug in the equality proof generator in the (WIP) grind tactic.


fixes another bug in the equality proof generator in the (WIP) grind tactic.


adds support for generating congruence proofs for congruences detected by the grind tactic.


adds support for compact congruence proofs in the (WIP) grind tactic. The mkCongrProof function now verifies whether the congruence proof can be constructed using only congr, congrFun, and congrArg, avoiding the need to generate the more complex hcongr auxiliary theorems.


adds the (WIP) grind tactic. It currently generates a warning message to make it clear that the tactic is not ready for production.


adds a new propagation rule for negation to the (WIP) grind tactic.


adds support for constructors to the (WIP) grind tactic. When merging equivalence classes, grind checks for equalities between constructors. If they are distinct, it closes the goal; if they are the same, it applies injectivity.


completes support for literal values in the (WIP) grind tactic. grind now closes the goal whenever it merges two equivalence classes with distinct literal values.


adds support for projection functions to the (WIP) grind tactic.


completes the implementation of addCongrTable in the (WIP) grind tactic. It also adds a new test to demonstrate why the extra check is needed. It also updates the field cgRoot (congruence root).


fixes issue #6467


adds support code for implementing e-match in the (WIP) grind tactic.


introduces a command for specifying patterns used in the heuristic instantiation of global theorems in the grind tactic. Note that this PR only adds the parser.


implements the command grind_pattern. The new command allows users to associate patterns with theorems. These patterns are used for performing heuristic instantiation with e-matching. In the future, we will add the attributes @[grind_eq], @[grind_fwd], and @[grind_bwd] to compute the patterns automatically for theorems.


adds a deriving handler for the ToExpr class. It can handle mutual and nested inductive types, however it falls back to creating partial instances in such cases. This is upstreamed from the Mathlib deriving handler written by @kmill, but has fixes to handle autoimplicit universe level variables.


adds pattern validation to the grind_pattern command. The new checkCoverage function will also be used to implement the attributes @[grind_eq], @[grind_fwd], and @[grind_bwd].


adds support for activating relevant theorems for the (WIP) grind tactic. We say a theorem is relevant to a grind goal if the symbols occurring in its patterns also occur in the goal.


internalize nested ground patterns when activating ematch theorems in the (WIP) grind tactic.


implements E-matching for the (WIP) grind tactic. We still need to finalize and internalize the new instances.


addresses a few error messages where diffs weren't being exposed.


implements Grind.EMatch.instantiateTheorem in the (WIP) grind tactic.


adds source position information for structure parent projections, supporting "go to definition". Closes #3063.


fixes and refactors the E-matching module for the (WIP) grind tactic.


adds basic configuration options for the grind tactic.


fixes a bug in the theorem instantiation procedure in the (WIP) grind tactic. For example, it was missing the following instance in one of the tests:


fixes another theorem instantiation bug in the grind tactic. It also moves new instances to be processed to Goal.


adds support in the grind tactic for propagating dependent forall terms forall (h : p), q[h] where p is a proposition.


fixes the proof canonicalizer for grind.


fixes a bug in the markNestedProofs used in grind. See new test.


fixes a bug in the proof assembly procedure utilized by the grind tactic.


adds a simple strategy to the (WIP) grind tactic. It just keeps internalizing new theorem instances found by E-matching. The simple strategy can solve examples such as:


adds the monotonicity tactic, intended to be used inside the partial_fixpoint feature.


fixes a bug in the sanity checkers for the grind tactic. See the new test for an example of a case where it was panicking.


fixes a bug in the congruence closure data structure used in the grind tactic. The new test includes an example that previously caused a panic. A similar panic was also occurring in the test grind_nested_proofs.lean.


adds a custom congruence rule for equality in grind. The new rule takes into account that Eq is a symmetric relation. In the future, we will add support for arbitrary symmetric relations. The current rule is important for propagating disequalities effectively in grind.


introduces support for user-defined fallback code in the grind tactic. The fallback code can be utilized to inspect the state of failing grind subgoals and/or invoke user-defined automation. Users can now write grind on_failure <code>, where <code> should have the type GoalM Unit. See the modified tests in this PR for examples.


adds support for (dependent) if-then-else terms (i.e., ite and dite applications) in the grind tactic.


enhances the assertion of new facts in grind by avoiding the creation of unnecessary metavariables.


adds BitVec.[toInt|toFin]_concat and moves a couple of theorems into the concat section, as BitVec.msb_concat is needed for the toInt_concat proof.


completes the toNat theorems for the bitwise operations (and, or, xor, shiftLeft, shiftRight) of the UInt types and adds toBitVec theorems as well. It also renames and_toNat to toNat_and to fit with the current naming convention.


adds theorems characterizing the value of the unsigned shift right of a bitvector in terms of its 2s complement interpretation as an integer. Unsigned shift right by at least one bit makes the value of the bitvector less than or equal to 2^(w-1), makes the interpretation of the bitvector Int and Nat agree. In the case when n = 0, then the shift right value equals the integer interpretation.


changes the implementation of HashMap.toList, so the ordering agrees with HashMap.toArray.


introduces the basic theory of permutations of Arrays and proves Array.swap_perm.


moves IO.Channel and IO.Mutex from Init to Std.Sync and renames them to Std.Channel and Std.Mutex.


upstreams List.length_flatMap, countP_flatMap and count_flatMap from Mathlib. These were not possible to state before we upstreamed List.sum.


adds protected to Fin.cast and BitVec.cast, to avoid confusion with _root_.cast. These should mostly be used via dot-notation in any case.


adds lemmas simplifying for loops over Option into Option.pelim, giving parity with lemmas simplifying for loops of List into List.fold.


completes the basic API for BitVec.ofBool.


generalizes the universe level for Array.find?, by giving it a separate implementation from Array.findM?.


adds GetElem lemmas for the basic Vector operations.


generalizes the panic functions to a type of Sort u rather than Type u. This better supports universe polymorphic types and avoids confusing errors.


adds Nat theorems for distributing >>> over bitwise operations, paralleling those of BitVec.


adds BitVec.[toFin|getMsbD]_setWidth and [getMsb|msb]_signExtend as well as ofInt_toInt.


generalizes DecidableRel to allow a heterogeneous relation.


reproduces the API around List.any/all for Array.any/all.


makes fixes suggested by the Batteries environment linters, particularly simpNF, and unusedHavesSuffices.


expands the Array.set and Array.setIfInBounds lemmas to match existing lemmas for List.set.


brings Vector lemmas about membership and indexing to parity with List and Array.


adds lemmas about Vector.set, anyM, any, allM, and all.


adds theorems about == on Vector, reproducing those already on List and Array.


replaces the inductive predicate List.lt with an upstreamed version of List.Lex from Mathlib. (Previously Lex.lt was defined in terms of <; now it is generalized to take an arbitrary relation.) This subtly changes the notion of ordering on List α.

  List.lt was a weaker relation: in particular if l₁ < l₂, then a :: l₁ < b :: l₂ may hold according to List.lt even if a and b are merely incomparable (either neither a < b nor b < a), whereas according to List.Lex this would require a = b.

  When < is total, in the sense that ¬ · < · is antisymmetric, then the two relations coincide.

  Mathlib was already overriding the order instances for List α, so this change should not be noticed by anyone already using Mathlib.

  We simultaneously add the boolean valued List.lex function, parameterised by a BEq typeclass and an arbitrary lt function. This will support the flexibility previously provided for List.lt, via a == function which is weaker than strict equality.


redefines Range.forIn' and Range.forM, in preparation for writing lemmas about them.


requires that the step size in Std.Range is positive, to avoid ill-specified behaviour.


adds lemmas reducing for loops over Std.Range to for loops over List.range'.


adds basic lemmas about lexicographic order on Array and Vector, achieving parity with List.


adds missing lemmas about lexicographic order on List/Array/Vector.


adds the necessary domain theory that backs the partial_fixpoint feature.


adds support for HEq to the new code generator.


adds support for Float32 to the Lean runtime.


adds missing features and fixes bugs in the Float32 support


ensures the new code generator produces code for opaque definitions that are not tagged as @[extern].
Remark: This is the behavior of the old code generator.


adds support for erasure of Decidable.decide to the new code generator. It also adds a new Probe.runOnDeclsNamed function, which is helpful for writing targeted single-file tests of compiler internals.


fixes a bug in the sharecommon module, which was returning incorrect results for objects that had already been processed by sharecommon. See the new test for an example that triggered the bug.


adds support for extern LCNF decls, which is required for parity with the existing code generator.


adjusts the way the pretty printer unresolves names. It used to make use of all exports when pretty printing, but now it only uses exports that put names into parent namespaces (heuristic: these are "API exports" that are intended by the library author), rather than "horizontal exports" that put the names into an unrelated namespace, which the dot notation feature in #6189 now incentivizes.


makes it harder to create "fake" theorems about definitions that are stubbed-out with sorry by ensuring that each sorry is not definitionally equal to any other. For example, this now fails:
lean
example : (sorry : Nat) = sorry := rfl -- fails

However, this still succeeds, since the sorry is a single indeterminate Nat:
lean
def f (n : Nat) : Nat := sorry
example : f 0 = f 1 := rfl -- succeeds

One can be more careful by putting parameters to the right of the colon:
lean
def f : (n : Nat) → Nat := sorry
example : f 0 = f 1 := rfl -- fails

Most sources of synthetic sorries (recall: a sorry that originates from the elaborator) are now unique, except for elaboration errors, since making these unique tends to cause a confusing cascade of errors. In general, however, such sorries are labeled. This enables "go to definition" on sorry in the Infoview, which brings you to its origin. The option set_option pp.sorrySource true causes the pretty printer to show source position information on sorries.


adds a docstring to the @[app_delab] attribute.


fixes a bug in structure instance field completion that caused it to not function correctly for bracketed structure instances written in Mathlib style.


fixes a regression where goals that don't exist were being displayed. The regression was triggered by #5835 and originally caused by #4926.


changes Lake's build process to no longer use leanc for compiling C files or linking shared libraries and executables. Instead, it directly invokes the bundled compiler (or the native compiler if none) using the necessary flags.


adapts Lake modules to use prelude and includes them in the check-prelude CI.


ensures the the log error position is properly preserved when prepending stray log entries to the job log. It also adds comparison support for Log.Pos.


merges BuildJob and Job, deprecating the former. Job now contains a trace as part of its state which can be interacted with monadically. also simplifies the implementation of OpaqueJob.


adds the ability to override package entries in a Lake manifest via a separate JSON file. This file can be specified on the command line with --packages or applied persistently by placing it at .lake/package-overrides.json.


fixes a bug in #6388 where the Package.afterBuildCahe* functions would produce different traces depending on whether the cache was fetched.


upstreams the ToLevel typeclass from mathlib and uses it to fix the existing ToExpr instances so that they are truly universe polymorphic (previously it generated malformed expressions when the universe level was nonzero). We improve on the mathlib definition of ToLevel to ensure the class always lives in Type, irrespective of the universe parameter.


fixes errors at load time in the comparison mode of the Firefox profiler.


implements `Simp.Config.implicitDefEqsProofs`. When `true` (default: `true`), `simp` will **not** create a proof term for a rewriting rule associated with an `rfl`-theorem. Rewriting rules are provided by users by annotating theorems with the attribute `@[simp]`. If the proof of the theorem is just `rfl` (reflexivity), and `implicitDefEqProofs := true`, `simp` will **not** create a proof term which is an application of the annotated theorem.


avoid negative environment lookup


ensure `instantiateMVarsProfiling` adds a trace node


adds a feature to the the mutual def elaborator where the `instance` command yields theorems instead of definitions when the class is a `Prop`.


unset trailing for `simpa?` "try this" suggestion


changes the rule for which projections become instances. Before, all parents along with all indirect ancestors that were represented as subobject fields would have their projections become instances. Now only projections for direct parents become instances.


make `all_goals` admit goals on failure


introduce synthetic atoms in bv_decide


adds a new definition `Message.kind` which returns the top-level tag of a message. This is serialized as the new field `kind` in `SerialMessaege` so that i can be used by external consumers (e.g., Lake) to identify messages via `lean --json`.


`arg` conv tactic misreported number of arguments on error


BitVec.twoPow in bv_decide


simplifies the implementation of `omega`.


fix style in bv_decide normalizer


adds configuration options for `decide`/`decide!`/`native_decide` and refactors the tactics to be frontends to the same backend. Adds a `+revert` option that cleans up the local context and reverts all local variables the goal depends on, along with indirect propositional hypotheses. Makes `native_decide` fail at elaboration time on failure without sacrificing performance (the decision procedure is still evaluated just once). Now `native_decide` supports universe polymorphism.


changes `bv_decide`'s configuration from lots of `set_option` to an elaborated config like `simp` or `omega`. The notable exception is `sat.solver` which is still a `set_option` such that users can configure a custom SAT solver globally for an entire project or file. Additionally it introduces the ability to set `maxSteps` for the simp preprocessing run through the new config.


improves the validation of new syntactic tokens. Previously, the validation code had inconsistencies: some atoms would be accepted only if they had a leading space as a pretty printer hint. Additionally, atoms with internal whitespace are no longer allowed.


removes the `decide!` tactic in favor of `decide +kernel` (breaking change).


removes @[specilize] from `MkBinding.mkBinding`, which is a function that cannot be specialized (as none of its arguments are functions). As a result, the specializable function `Nat.foldRevM.loop` doesn't get specialized, which leads to worse performing code.


makes the `change` tactic and conv tactic use the same elaboration strategy. It works uniformly for both the target and local hypotheses. Now `change` can assign metavariables, for example:
```lean
example (x y z : Nat) : x + y = z := by
  change ?a = _
  let w := ?a
  -- now `w : Nat := x + y`
```


fixes a bug where the monad lift coercion elaborator would partially unify expressions even if they were not monads. This could be taken advantage of to propagate information that could help elaboration make progress, for example the first `change` worked because the monad lift coercion elaborator was unifying `@Eq _ _` with `@Eq (Nat × Nat) p`:
```lean
example (p : Nat × Nat) : p = p := by
  change _ = ⟨_, _⟩ -- used to work (yielding `p = (p.fst, p.snd)`), now it doesn't
  change ⟨_, _⟩ = _ -- never worked
```
As such, this is a breaking change; you may need to adjust expressions to include additional implicit arguments.


adds a normalization rule to `bv_normalize` (which is used by `bv_decide`) that converts `x / 2^k` into `x >>> k` under suitable conditions. This allows us to simplify the expensive division circuits that are used for bitblasting into much cheaper shifting circuits. Concretely, it allows for the following canonicalization:


fixes `simp only [· ∈ ·]` after #5020.


introduces the and flattening pre processing pass from Bitwuzla to `bv_decide`. It splits hypotheses of the form `(a && b) = true` into `a = true` and `b = true` which has synergy potential with the already existing embedded constraint substitution pass.


fixes `bv_decide`'s embedded constraint substitution to generate correct counter examples in the corner case where duplicate theorems are in the local context.


add `LEAN_ALWAYS_INLINE` to some functions


fixes `simp?` suggesting output with invalid indentation


mark `Meta.Context.config` as private


fixes the caching infrastructure for `whnf` and `isDefEq`, ensuring the cache accounts for all relevant configuration flags. It also cleans up the `WHNF.lean` module and improves the configuration of `whnf`.


adds a simp_arith benchmark.


optimize Nat.Linear.Expr.toPoly


optimize Nat.Linear.Poly.norm


improves the asymptotic performance of `simp_arith` when there are many variables to consider.


adds options to `bv_decide`'s configuration structure such that all non mandatory preprocessing passes can be disabled.


changes how the canonicalizer handles `forall` and `lambda`, replacing bvars with temporary fvars. Fixes a bug reported by @hrmacbeth on [zulip](https://leanprover.zulipchat.com/#narrow/channel/270676-lean4/topic/Quantifiers.20in.20CanonM/near/482483448).


use mkFreshUserName in ArgsPacker


improves the `#print` command for structures to show all fields and which parents the fields were inherited from, hiding internal details such as which parents are represented as subobjects. This information is still present in the constructor if needed. The pretty printer for private constants is also improved, and it now handles private names from the current module like any other name; private names from other modules are made hygienic.


modifies the signature of `Nat.fold`, `Nat.foldRev`, `Nat.any`, `Nat.all`, so that the function is passed the upper bound. This allows us to change runtime array bounds checks to compile time checks in many places.


adds a primitive for creating temporary directories, akin to the existing functionality for creating temporary files.


completes the elementwise accessors for `ofNatLt`, `allOnes`, and `not` by adding their implementations of `getMsbD`.


completes the `toInt` interface for `BitVec` bitwise operations.


implements `BitVec.toInt_abs`.


adds `toNat` theorems for `BitVec.signExtend.`


adds toInt theorems for BitVec.signExtend.


adds theorem `mod_eq_sub`, makes theorem `sub_mul_eq_mod_of_lt_of_le` not private anymore and moves its location within the `rotate*` section to use it in other proofs.


uses `Array.findFinIdx?` in preference to `Array.findIdx?` where it allows converting a runtime bounds check to a compile time bounds check.


completes the `toNat` theorems for the bitwise operations (`and`, `or`, `xor`, `shiftLeft`, `shiftRight`) of the UInt types and adds `toBitVec` theorems as well. It also renames `and_toNat` to `toNat_and` to fit with the current naming convention.


adds the builtin simproc `USize.reduceToNat` which reduces the `USize.toNat` operation on literals less than `UInt32.size` (i.e., `4294967296`).


adds `Array.zipWithAll`, and the basic lemmas relating it to `List.zipWithAll`.


adds deprecations for `Lean.HashMap` functions which did not receive deprecation attributes initially.


completes the TODO in `Init.Data.Array.BinSearch`, removing the `partial` keyword and converting runtime array bounds checks to compile time bounds checks.


changes the signature of `Array.swap`, so it takes `Nat` arguments with tactic provided bounds checking. It also renames `Array.swap!` to `Array.swapIfInBounds`.


renames `Array.setD` to `Array.setIfInBounds`.


upstreams the definition of `Vector` from Batteries, along with the basic functions.


upstreams `Nat.lt_pow_self` and `Nat.lt_two_pow` from Mathlib and uses them to prove the simp theorem `Nat.mod_two_pow`.


makes `USize.toUInt64` a regular non-opaque definition.


adds theorems `le_usize_size`, `usize_size_le`, which make proving inequalities about `USize.size` easier.


upstreams some UInt theorems from Batteries and adds more `toNat`-related theorems. It also adds the missing `UInt8` and `UInt16` to/from `USize` conversions so that the interface is uniform across the UInt types.


ensures the `Fin.foldl` and `Fin.foldr` are semireducible. Without this the defeq `example (f : Fin 3 → ℕ) : List.ofFn f = [f 0, f 1, f 2] := rfl` was failing.


fix Vector.indexOf?


adds `simp` lemmas about `List`'s `==` operation.


fixes:
- Problems in other linux distributions that the default `tzdata` directory is not the same as previously defined by ensuring it with a fallback behavior when directory is missing.
- Trim unnecessary characters from local time identifier.


changes the definition of `HashSet.insertMany` and `HashSet.Raw.insertMany` so that it is equivalent to repeatedly calling `HashSet.insert`/`HashSet.Raw.insert`. It also clarifies the docstrings of all the `insert` and `insertMany` functions.


copies some lemmas about `List.foldX` to `Array`.


upstreams lemmas about `Vector` from Batteries.


upstreams the definition and basic lemmas about `List.finRange` from Batteries.


relates that operations `Nat.fold`/`foldRev`/`any`/`all` to the corresponding List operations over `List.finRange`.


refactors `Array.qsort` to remove runtime array bounds checks, and avoids the use of `partial`. We use the `Vector` API, along with auto_params, to avoid having to write any proofs. The new code benchmarks indistinguishably from the old.


deprecates `Fin.ofNat` in favour of `Fin.ofNat'` (which takes an `[NeZero]` instance, rather than returning an element of `Fin (n+1)`).


adds the theorems `numBits_pos`, `le_numBits`, `numBits_le`, which make proving inequalities about `System.Platform.numBits` easier.


changes `lean_sharecommon_{eq,hash}` to only consider the salient bytes of an object, and not any bytes of any unspecified/uninitialized unused capacity.


fixes a bug in the constant folding for the `Nat.ble` and `Nat.blt` function in the old code generator, leading to a miscompilation.


should make lean better-behaved around sanitizers, per https://github.com/google/sanitizers/issues/1688. As far as I can tell, https://github.com/google/sanitizers/wiki/AddressSanitizerUseAfterReturn#algorithm replaces local variables with heap allocations, and so taking the address of a local is not effective at producing a monotonic measure of stack usage.


fixes an issue where edits to a command containing a nested docstring fail to reparse the entire command.


fixes `trace.profiler.pp` not using the term pretty printer.


adds core metaprogramming functions for forking off background tasks from elaboration such that their results are visible to reporting and the language server.


fixes a bug with the `structure`/`class` command where if there are parents that are not represented as subobjects but which used other parents as instances, then there would be a kernel error. Closes #2611.


fixes a non-termination bug that occurred when generating the match-expression equation theorems. The bug was triggered when the proof automation for the equation theorem repeatedly applied `injection(` to the same local declaration, as it could not be removed due to forward dependencies. See issue #6067 for an example that reproduces this issue.


adds the builtin simproc `USize.reduceToNat` which reduces the `USize.toNat` operation on literals less than `UInt32.size` (i.e., `4294967296`).


adds a primitive for accessing the current thread ID.


fixes a bug in the proof assembly procedure utilized by the grind tactic.


adds `Lean.loadPlugin` which exposes functionality similar to the `lean` executable's `--plugin` option to Lean code.


adds the option `pp.parens` (default: false) that causes the pretty printer to eagerly insert parentheses, which can be useful for teaching and for understanding the structure of expressions. For example, it causes `p → q → r` to pretty print as `p → (q → r)`.


prevents `Nat.succ ?_` from pretty printing as `?_.succ`, which should make `apply?` be more usable.


improves the term info for coercions marked with `CoeFnType.coeFun` (such as `DFunLike.coe` in Mathlib), making "go to definition" on the function name work. Hovering over such a coerced function will show the coercee rather than the coercion expression. The coercion expression can still be seen by hovering over the whitespace in the function application.


improves the `#print` command for structures to show all fields and which parents the fields were inherited from, hiding internal details such as which parents are represented as subobjects. This information is still present in the constructor if needed. The pretty printer for private constants is also improved, and it now handles private names from the current module like any other name; private names from other modules are made hygienic.


adds a new delab option `pp.coercions.types` which, when enabled, will display all coercions with an explicit type ascription.


ensures whitespace is printed before `+opt` and `-opt` configuration options when pretty printing, improving the experience of tactics such as `simp?`.


fixes a bug where the signature pretty printer would ignore the current setting of `pp.raw`. This fixes an issue where `#check ident` would not heed `pp.raw`. Closes #6090.


exposes the difference in "synthesized type class instance is not definitionally equal" errors.


fixes a typo in the docstring for prec and makes the text slightly more precise.


join → flatten in docstring


does some mild refactoring of the `Lean.Elab.StructInst` module while adding documentation.


converts 3 doc-string to module docs since it seems that this is what they were intended to be!


refine kernel code comments


adjust file reference in Data.Sum


explains the order in which `Expr.abstract` introduces de Bruijn indices.


adds auto-completion for the fields of structure instance notation. Specifically, querying the completions via `Ctrl+Space` in the whitespace of a structure instance notation will now bring up the full list of fields. Whitespace structure completion can be enabled for custom syntax by wrapping the parser for the list of fields in a `structInstFields` parser.


fixes an old auto-completion bug where `x.` would issue nonsensical completions when `x.` could not be elaborated as a dot completion.


avoid max heartbeat error in completion


fixes a regression with go-to-definition and document highlight misbehaving on tactic blocks.


fixes a performance issue where the Lean language server would walk the full project file tree every time a file was saved, blocking the processing of all other requests and notifications and significantly increasing overall language server latency after saving.


update toolchain on `lake update`


adds a newline at end of each Lean file generated by `lake new` templates.


makes Lake no longer automatically fetch GitHub cloud releases if the package build directory is already present (mirroring the behavior of the Reservoir cache). This prevents the cache from clobbering existing prebuilt artifacts. Users can still manually fetch the cache and clobber the build directory by running `lake build <pkg>:release`.


makes `lake build` also eagerly print package materialization log lines. Previously, only a `lake update` performed eager logging.


improves the errors Lake produces when it fails to fetch a dependency from Reservoir. If the package is not indexed, it will produce a suggestion about how to require it from GitHub.


Language features, tactics, and metaprograms

improves universe level inference for the resulting type of an `inductive` or `structure.` Recall that a `Prop`-valued inductive type is a syntactic subsingleton if it has at most one constructor and all the arguments to the constructor are in `Prop`. Such types have large elimination, so they could be defined in `Type` or `Prop` without any trouble. The way inference has changed is that if a type is a syntactic subsingleton with exactly one constructor, and the constructor has at least one parameter/field, then the command will prefer creating a `Prop` instead of a `Type`. The upshot is that the `: Prop` in `structure S : Prop` is often no longer needed. (With @arthur-adjedj).


the command can now define recursive inductive types:
```lean
structure Tree where
  n : Nat
  children : Fin n → Tree

def Tree.size : Tree → Nat
  | {n, children} => Id.run do
    let mut s := 0
    for h : i in [0 : n] do
      s := s + (children ⟨i, h.2⟩).size
    pure s
```


fixes a bug where Mathlib's `Type*` elaborator could lead to incorrect universe parameters with the command.


fix bugs in default value processing for structure instance notation (with @arthur-adjedj).


promotes instance synthesis order calculation failure from a soft error to a hard error.


deprecates `:=` variants of `inductive` and `structure` (see breaking changes).


makes `@[elab_as_elim]` require at least one discriminant, since otherwise there is no advantage to this alternative elaborator.


enables field notation in explicit mode. The syntax `@x.f` elaborates as `@S.f` with `x` supplied to the appropriate parameter.


modifies the dot notation resolution algorithm so that it can apply `CoeFun` instances. For example, Mathlib has `Multiset.card : Multiset α →+ Nat`, and now with `m : Multiset α`, the notation `m.card` resolves to `⇑Multiset.card m`.


fixes a bug where 'don't know how to synthesize implicit argument' errors might have the incorrect local context when the eta arguments feature is activated.


fixes a bug where `..` ellipses in patterns made use of optparams and autoparams.


makes dot notation for structures resolve using all ancestors. Adds a resolution order for generalized field notation. By default a relaxed version of the algorithm tolerates inconsistencies, but `set_option structure.strictResolutionOrder true` makes inconsistent parent orderings into warnings.


fixes functional induction principle generation to avoid over-eta-expanding in the preprocessing step.


fixes structural nested recursion so that it is not confused when a nested type appears first.


fixes a bug in functional induction principle generation when there are `let` bindings.


improves functional induction principle generation to unfold aux definitions more carefully.


refactors code for `Predefinition.Structural`.


fixes a bug in "type mismatch" errors that would structurally assign metavariables during the algorithm to expose differences.


makes "type mismatch" errors add type ascriptions to expose differences for numeric literals.


makes "type mismatch" errors expose differences in the bodies of functions and pi types.


improves the error message for invalid induction alternative names in `match` expressions (@josojo).


improves `calc` error messages.


improve the `#eval` command and introduce new features such as hoverable output when a `ToExpr` instance exists, auto-derivation of `Repr` instances, a new option `eval.type`, more precise error messages about missing `ToExpr`/`Repr`/`ToString`, collecting log messages in `MetaM`/`CoreM`, and a fix for `let rec` usage.


improves the error message when `partial` fails to prove a type is inhabited. Add delta deriving.


gives `partial` inhabitation the ability to create local `Inhabited` instances from parameters.


new tactic configuration syntax. For example `simp +contextual (maxSteps := 22)` instead of `simp (config := { contextual := true, maxSteps := 22})`. This affects core tactics and how authors can define tactic configuration syntaxes. (See breaking changes.)


fixes the simpproc for `Fin` literals to reduce more consistently.


fixes a bug in `simpa ... using t` where metavariables in `t` were not properly accounted for, and improves the type mismatch error.


fixes the docstring of `simp!` to actually talk about `simp!`.


adds support for `attribute [simp ←]` which adds the reverse of a theorem as a global simp theorem.


adds `decide!` tactic for using kernel reduction. (Renamed to `decide +kernel` in a future release.)


adds inequality regression tests to `bv_decide` (@alexkeizer).


adds `bv_toNat` tag for `toNat_ofInt` (@bollu).


adds support for `at` in `ac_nf` and uses it in `bv_normalize` (@tobiasgrosser).


adds udiv support to `bv_decide`.


adds auxiliary bitblasters for negation and subtraction.


adds more `getLsbD` bitblaster theory.


adds umod support to `bv_decide`.


adds performance benchmark for modulo in `bv_decide`.


reduces error on `bv_check` to warning.


adds `~~~(-x)` support in `bv_decide`.


disables `ac_nf` by default in `bv_decide`.


fixes context tracking in `bv_decide` counter example generation.


adds an error when the LRAT proof is invalid in `bv_decide`.


introduces uninterpreted symbols everywhere in `bv_decide`.


adds `BitVec.sdiv` support to `bv_decide`.


adds `BitVec.ofBool` support to `bv_decide`.


adds `if` support to `bv_decide`.


adds support for all the SMTLIB BitVec divison/remainder operations to `bv_decide`.


adds embedded constraint substitution to `bv_decide`.


fixes loose mvars bug in `bv_normalize`.


improves the `congr` conv tactic to handle over-applied functions.


improves the `arg` conv tactic so it can access more arguments, handle over-applied functions, generate specialized congruence lemmas for the specific argument, apply to pi types, and adds negative indexing. Also shows intermediate states with `enter [...]`.


fixes a bug where `generalize ... at *` would apply to implementation details. (@ymherklotz)


upstreams the `classical` tactic combinator.


improves the error message when trying to unfold a local hypothesis that is not a local definition.


changes how `apply` and `simp` elaborate, making them not disable error recovery. Improves hovers and completions with elaboration errors.


adds declaration ranges for delta-derived instances in deriving clauses.


removes unused syntax in `deriving` clauses for providing arguments to deriving handlers (see breaking changes).


upstreams and updates `#where`, a command that reports the current scope information.


makes the unused variables linter ignore variables defined in tactics by default, avoiding performance bottlenecks.


ensures that linters do not run on `#guard_msgs` itself.


adds `pushGoal`/`pushGoals` and `popGoal` for manipulating the goal state. Modifies `closeMainGoalUsing` to run callbacks in a context with the main goal removed, etc. Also modifies `withCollectingNewGoalsFrom` to take the `parentTag` explicitly. Modifies `elabTermWithHoles` to optionally take `parentTag?`.


fixes `getFunInfo` and `inferType` to use `withAtLeastTransparency` instead of `withTransparency`.


fixes `RecursorVal.getInduct` to return the name of major argument’s type, enabling structure eta for nested inductives.


removes unused `mkRecursorInfoForKernelRec`.


makes discrimination trees index the domains of foralls, improving performance of `simplify` and type class search.


adds `Lean.Expr.name?` recognizer for `Name` expressions.


modifies `liftCommandElabM` to preserve more state, fixing an issue where using it would drop messages.


makes it possible to use dot notation in `m!` strings, for example `m!"{.ofConstName n}"`.


records the complete list of `structure` parents in the `StructureInfo` environment extension.


fixes a bug introduced earlier where heartbeat exceptions were no longer handled properly. Now such exceptions are tagged with `runtime.maxHeartbeats` (@eric-wieser).


modifies proof objects produced by `ac_nf0` and `simp_arith` so the kernel is less prone to reducing expensive atoms.


adds a `#version` command that prints Lean's version information.


fixes elaborator algorithms to match kernel algorithms for primitive projections (`Expr.proj`).


improves the docstring for the `rwa` tactic.


Language server, widgets, and IDE extensions

fixes `WorkspaceClientCapabilities` to make `applyEdit` optional, matching the LSP specification (@pzread).


fixes a server deadlock when shutting down the language server and a desync between client and language server after a file worker crash.


makes `initialize` and `builtin_initialize` participate in call hierarchy and other requests.


makes references in attributes participate in call hierarchy and other requests.


add auto-completion in tactic blocks without needing to type the first character of the tactic, and add tactic completion docs to tactic auto-completion items.


fixes several cases where goal states were not displayed in certain text cursor positions.


indicates deprecations in auto-completion items.


fix various performance issues in the language server.


distinguishes theorem auto-completions from non-theorem auto-completions.


fixes a bug where goal states in messages might print newlines as spaces.


adds option `pp.mvars.delayed` (default false) which when false causes delayed assignment metavariables to pretty print with what they are assigned to, rather than something like `?m.7 x`.


adds options `pp.mvars.anonymous` and `pp.mvars.levels` which when false cause expression or level metavariables to print as `?_`.


adjusts the `⋯` elaboration warning to mention `pp.maxSteps`.


fixes the app unexpander for `sorryAx`.


improves accuracy of binder names in the signature printer (e.g. for `#check`). Also fixes issues with consecutive hygienic names printing without a space, now `(x✝ y✝ : Nat)` instead of `(x✝y✝ : Nat)`.


makes sure core delaborators respect `pp.explicit` when appropriate.


makes sure name literals use escaping when pretty printing.


adds delaborators for `<|>`, `<*>`, `>>`, `<*`, and `*>`.


deprecates `Array.data`.


uses a better default value for `Array.swapAt!`.


moves `Array.mapIdx` lemmas to a new file.


simplifies signature of `Array.mapIdx`.


upstreams `Array.reduceOption`.


adds simp lemmas for `Array.isEqv` and `BEq`.


renames `Array.shrink` to `Array.take`, and relates it to `List.take`.


upstreams `List.modify`, adds lemmas, and relates to `Array.modify`.


relates `Array.forIn` and `List.forIn`.


adds `Array.forIn'`, relating it to `List`.


fixes deprecations in `Init.Data.Array.Basic` to not recommend a deprecated constant.


adds `LawfulBEq (Array α) ↔ LawfulBEq α`.


moves `@[simp]` from `back_eq_back?` to `back_push`.


renames `Array.back` to `back!`.


removes `List.redLength`.


upstreams `List.mapIdx` and adds lemmas.


upstreams `List.foldxM_map`.


renames `List.join` to `List.flatten`.


upstreams `List.sum`.


marks `prefix_append_right_inj` as a simp lemma.


fixes `List.drop_drop` addition order.


renames `List.bind` and `Array.concatMap` to `flatMap`.


renames `List.pure` to `List.singleton`.


upstreams `ne_of_mem_of_not_mem`.


upstreams `ne_of_apply_ne`.


adds more `List.modify` lemmas.


renames `List.groupBy` to `splitBy`.


relates `for` loops over `List` with `foldlM`.


removes `instBEqNat` which was not defeq to `instBEqOfDecidableEq`.


deprecates `Nat.sum`.


adds `Nat.forall_lt_succ` and variants.


redefines unsigned fixed width integers in terms of `BitVec`.


adds `UIntX.[val_ofNat, toBitVec_ofNat]`.


defines `Int8`.


removes native code for `UInt8.modn`.


completes `BitVec.[getMsbD|getLsbD|msb]` for shifts.


adds lemmas for division when denominator is zero.


documents Bitblasting.


moves `BitVec.udiv/umod/sdiv/smod` after `add/sub/mul/lt`.


defines `udiv` normal form to be `/`, resp. `umod` and `%`.


adds lemmas about arithmetic inequalities.


expands relationship with `toFin`.


adds `(getMSbD, msb)_(add, sub)` and `getLsbD_sub`.


adds `udiv|umod_[zero|one|self]`.


adds `sdiv_[zero|one|self]`.


adds `(msb, getMsbD, getLsbD)_(neg, abs)`.


adds `BitVec.toInt_sub`, simplifies `BitVec.toInt_neg`.


proves that `intMin` is the smallest signed bitvector.


adds `(msb, getMsbD)_twoPow`.


adds `BitVec.[zero_ushiftRight|zero_sshiftRight|zero_mul]` and cleans up BVDecide.


adds `(msb, getMsbD)_concat`.


adds `Hashable (BitVec n)`.


upstreams `String.dropPrefix?`.


changes `String.dropPrefix?` signature.


adds `Hashable Char` instance.


adds interim implementation of `HashMap.modify`/`alter`.


removes `@[simp]` from `Option.isSome_eq_isSome`.


upstreams material on `Prod`.


moves `Antisymm` to `Std.Antisymm`.


upstreams basic material on `Sum`.


adds `Nat.log2_two_pow` (@spinylobster).


removes duplicated `ForIn` instances.


removes `@[simp]` from `Sum.forall` and `Sum.exists`.


removes redundant `Decidable` assumptions.


fixes help message flags, removes the `-f` flag and adds the `-g` flag.


adds `--short-version` (`-V`) option to display short version.


switches all 64-bit platforms over to consistently using GMP for bignum arithmetic.


raises the minimum supported Windows version to Windows 10 1903 (released May 2019).


changes `lake new math` to use `autoImplicit false`.


makes `Lake` not create core aliases in the `Lake` namespace.


adds a `text` option for `buildFile*` utilities.


makes `lake init` not `git init` when inside a git work tree.


has Lake update a package's `lean-toolchain` file on `lake update` if it finds the package's direct dependencies use a newer compatible toolchain, unless `--keep-toolchain` is used. (See breaking changes.)


makes Lake no longer automatically fetch GitHub cloud releases if the package build directory is already present. This prevents overwriting existing prebuilt artifacts unless the user manually fetches them with `lake build <pkg>:release`.


improves the errors Lake produces when it fails to fetch a dependency from Reservoir, providing suggestions about how to require it from GitHub if not indexed.


fixes MSYS2 build instructions.


points out that `OfScientific` is called with raw literals.


adds a stub for application ellipsis notation.


the syntax for providing arguments to deriving handlers has been removed. The minimum supported Windows version is now Windows 10 1903. The `--lean` CLI option for `lake` was removed. The old `inductive/structure/class ... :=` syntax is deprecated. Tactic configuration elaborators now land in TacticM. See details above.


allows structure parents to be type synonyms.


allows default values for structure fields to be noncomputable.


improve the `rfl` tactic and give better error messages.


makes `rfl` no longer use kernel defeq for ground terms.


tags `Iff.refl` with `@[refl]` (@Parcly-Taxel).


ensures that the `rfl` tactic tries `Iff.rfl` (@Parcly-Taxel).


lets `unfold` do zeta-delta reduction of local definitions (like the Mathlib `unfold_let`).


fixes spurious error in #5315 for `omega`.


supports `Int.toNat` in `omega`.


lets `simp` apply rules with higher-order patterns.


fixes `induction`'s "pre-tactic" block indentation to avoid unintended usage.


adds `ac_nf` tactic for normalizing expressions w.r.t. associativity and commutativity, tested on `BitVec` expressions.


makes `extractLsb'` the primitive recognized by `bv_decide` instead of `extractLsb` (@alexkeizer).


adds `bv_decide` diagnoses.


adds normalization rules for `ofBool (a.getLsbD i)` and `ofBool a[i]` to `bv_decide` (@alexkeizer).


enhances rewriting rules of `bv_decide`.


presents the `bv_decide` counterexample at the API.


handles `BitVec.ofNat` with `Nat` fvars in `bv_decide`.


adds `bv_normalize` rules.


generalizes the `bv_normalize` pipeline to support more preprocessing passes.


updates `bv_normalize` to current `BitVec` rewrites.


bv_decide cleanups.


preserve order of overapplied arguments in `elab_as_elim` procedure.


generalizes `elab_as_elim` to allow arbitrary motive applications.


refine how named arguments suppress explicit arguments. Breaking change: some omitted explicit args may need `_` now.


modifies projection instance binder info so parameters that are instance-implicit in the type remain implicit.


localizes universe metavariable errors to `let`-bindings and `fun` binders if possible, and prioritizes unsolved metavars over unsolved universes.


must not reduce `ite` in the discriminant of a `match` when reducibility is `.reducible`.


have autoparams report parameter/field on failure.


makes automatic instance names about hygienic type names also be hygienic.


makes `Repr` deriving instance handle explicit type parameters.


functional induction: adds more equalities in context, more careful cleanup.


fixes the unused variables linter complaining about match/tactic combos.


fixes the unused variables linter complaining about wildcard patterns.


fixes a parse error when `..` is followed by a `.` on the next line.


handles level parameters in `Meta.evalExpr` (@eric-wieser).


instance for `Inhabited (TacticM α)` (@alexkeizer).


expose `Kernel.check` for debugging purposes.


improves the "invalid projection" type inference error in `inferType`.


allows `MVarId.assertHypotheses` to set `BinderInfo` and `LocalDeclKind`.


adds `MVarId.tryClearMany'`, a variant of `tryClearMany`.


decreases latency of auto-completion in tactic blocks.


fixes symbol occurrence highlighting in VS Code when moving cursor in from the right.


fixes several incorrect auto-completions being reported.


allows fallback to global auto-completions when context-specific completions fail.


fixes server break when changing whitespace after module header.


fixes auto-completion reporting non-existent namespaces.


always report some recent file range as progress while waiting for elaboration.


make pretty printer escape identifiers that are tokens.


makes formatter use the current token table.


use breakable instead of unbreakable whitespace in token formatting.


reduces allocations in `Json.compress`.


upstreams `Zero` and `NeZero`.


refactors `Lean.Elab.Deriving.FromToJson` (@arthur-adjedj).


implements `Repr Empty` (@TomasPuverle).


implements `To/FromJSON Empty` (@TomasPuverle).


allows simplifying `dite_not`/`decide_not` with only `Decidable (¬p)`.


fixes binders on `ite_eq_left_iff`.


turns off `Inhabited (Sum α β)` instances.


adds simp lemmas for `LawfulBEq`.


adds `Nonempty` instances for products, letting more `partial` functions elaborate.


updates Pi instance names.


makes some instance arguments implicit.


adds `heq_comm`.


moves `@[simp]` from `exists_prop'` to `exists_prop`.


fills gaps in `Bool` lemmas.


adds notation `^^` for `Bool.xor`.


removes `_root_.and` etc. and consistently uses `Bool.and`/`Bool.or`/`Bool.not`/`Bool.xor`.


removes BitVec simps with complicated RHS.


adds more simp lemmas for BitVec, improving confluence.


removes `@[simp]` from some BitVec lemmas.


changes `BitVec.intMin/Max` from abbrev to def.


adds `BitVec.getElem_truncate` (@tobiasgrosser).


adds udiv/umod bitblasting for `bv_decide` (@bollu).


`BitVec` unsigned order theoretic results.


adds more BitVec ordering theory for `UInt`.


adds `toNat_sub_of_le` for BitVec (@bollu).


adds `BitVec.truncate` lemmas.


introduces `BitVec.setWidth` to unify zeroExtend and truncate (@tobiasgrosser).


some BitVec GetElem lemmas.


adds `BitVec.ofBool_[and|or|xor]_ofBool` theorems (@tobiasgrosser).


more of `BitVec.getElem_*` (@tobiasgrosser).


BitVec analogues of `Nat.mul_two` etc. (@bollu).


`BitVec.toNat_{add,sub,mul_of_lt}` for non-overflow reasoning (@bollu).


adds `_self`, `_zero`, `_allOnes` for `BitVec.[and|or|xor]` (@tobiasgrosser).


adds `LawCommIdentity + IdempotentOp` for `BitVec.[and|or|xor]` (@tobiasgrosser).


decidable quantifiers for BitVec.


adds `BitVec.toInt_[intMin|neg|neg_of_ne_intMin]` (@tobiasgrosser).


missing BitVec lemmas.


adds `BitVec.[not_not, allOnes_shiftLeft_or_shiftLeft, allOnes_shiftLeft_and_shiftLeft]` (@luisacicolini).


adds `BitVec.(shiftLeft_add_distrib, shiftLeft_ushiftRight)` (@luisacicolini).


adds `sdiv_eq`/`smod_eq` for bitblasting in `bv_decide` (@bollu).


adds `BitVec.toNat_[abs|sdiv|smod]` (@tobiasgrosser).


`BitVec.(not_sshiftRight, not_sshiftRight_not, getMsb_not, msb_not)` (@luisacicolini).


drop non-terminal simps in `BitVec.Lemmas` (@tobiasgrosser).


unsimps `BitVec.divRec_succ'`.


adds `BitVec.getElem_[add|add_add_bool|mul|rotateLeft|rotateRight…` (@tobiasgrosser).


adds `BitVec.[add, sub, mul]_eq_xor` and `width_one_cases` (@luisacicolini).


improve naming for `List.mergeSort` lemmas.


provide `mergeSort` comparator autoParam.


fix name of `List.length_mergeSort`.


upstream `map_mergeSort`.


modify signature of lemmas about `mergeSort`.


avoid importing `List.Basic` without `List.Impl`.


review of List API.


remove HashMap's duplicated `Pairwise` and `Sublist` from List file.


remove `@[simp]` from `List.head_mem` and similar.


lemmas about `List.attach`.


reverse direction of `List.tail_map`.


more `List.attach` lemmas.


`List.count` lemmas.


use boolean predicates in `List.filter`.


`List.mem_ite_nil_left` and analogues.


cleanup of `List.findIdx` / `List.take` lemmas.


switch primes on `List.getElem_take` lemmas.


more `List.findIdx` theorems.


fix `List.all/any` lemmas.


fix `List.countP` lemmas.


`List.tail` lemma.


fix implicitness of `List.getElem_mem`.


`List.replicate` lemmas.


`List.attachWith` lemmas.


lemmas about `List.tail`.


review of `List.erase` / `List.find` lemmas.


`List.fold` / `attach` lemmas.


`List.fold` relators.


lemmas about `List.maximum?`.


theorems about `List.toArray`.


reverse direction of `List.set_map`.


add lemmas about `List.IsPrefix` (@Command-Master).


adds `List.set_replicate_self` lemma.


rename `List.maximum?` to `max?`.


upstream `List.fold` lemmas.


restore `@[simp]` on `List.getElem_mem` etc.


List simp fixes.


`List.unattach` and simp lemmas.


induction-friendly `List.min?_cons`.


cleanup imports of `Array.Lemmas`.


split `Init.Data.Array.Lemmas` for better bootstrapping.


rename `Array.data` to `Array.toList`.


cleanup of `List.getElem_append` variants.


reorganization in Array/Basic.


make `Array` functions semireducible or use structural recursion.


refactor `DecidableEq (Array α)`.


refactor of Array, see commits for details.


cleanup of Array docstrings after refactor.


restore `@[simp]` on `Array.swapAt!_def`.


improve Array GetElem lemmas.


`Array.foldX` lemmas.


@[simp] lemmas about `List.toArray`.


reverse simp direction for `toArray_concat`.


`Array.eraseReps`.


upstream `Array.qsortOrd`.


upstream `Subarray.empty`.


fix name of `Array.length_toList`.


reduce use of deprecated lemmas in Array.


cleanup of Array GetElem lemmas.


fix `Array.modify` lemmas.


upstream `Array.flatten` lemmas.


switch obvious cases of array indexing to rely on existing hypothesis (@TomasPuverle).


add missing simp to `Array.size_feraseIdx`.


`Array/Option.unattach`.


remove @[simp] from `Option.pmap/pbind`, add new simp lemmas.


restore Option simp confluence.


remove @[simp] from `Option.bind_map`.


`Option.attach`.


fix explicitness of `Option.mem_toList`.


add @[simp] to `Nat.add_eq_zero_iff`.


Nat bitwise lemmas.


`Nat.testBit_add_one` is no longer a global simp lemma.


protect some Nat bitwise theorems.


rename Nat bitwise lemmas.


add `Nat.self_sub_mod` lemma.


restore @[simp] to `Nat.lt_off_iff` from upstream.


rename `Int.div/mod` to `Int.tdiv/tmod`.


add `ediv_nonneg_of_nonpos_of_nonpos` to `DivModLemmas` (@sakehl).


missing lemma about `Fin.ofNat'`.


`Fin.ofNat'` uses `NeZero`.


remove some @[simp] from Fin lemmas.


missing Fin @[simp] lemmas.


adds DHashMap/HashMap/HashSet `(getKey? / getKey / getKey! / getKeyD).`


remove last uses of `Lean.HashSet/HashMap` in library code.


`HashSet.ofArray`.


`HashSet.partition`.


`Singleton` / `Insert` / `Union` instances for `HashMap` and `HashSet`.


`HashSet.all`/`any`.


`Insert` / `Singleton` / `Union` for `HashMap` / `Set.Raw`.


`HashSet.Raw.all`/`any`.


upstream some monad lemmas.


adjust simp attributes on monad lemmas.


more monadic simp lemmas.


remove redundant simp annotations.


remove Int simp lemmas that cannot fire.


some variables on both sides of an iff should be implicit.


cleaning up redundant simp lemmas.


fixes a typo in the C `run_new_frontend` signature.


IR checker suggests using `noncomputable` for missing definitions.


adds a shared library for Lake.


removes (syntactically) duplicate imports (@euprunin).


updates `src/lake/lakefile.toml` to the adjusted Lake build process.


removes new shared libs before build to better support Windows.


make `lean.h` compile with MSVC (@kant2002).


removes non-conforming size-0 arrays (@eric-wieser).


Reservoir build cache: Lake attempts to fetch a pre-built copy of packages in leanprover or leanprover-community. `--no-cache` or env var can disable. Breaking: a package's extraDep no longer transitively builds dependencies’ extraDep facets.


`lake new` and `lake init` now produce TOML configurations by default.


fixes a serious issue where Lake would delete path dependencies when cleaning up a dependency with an incorrect name.


`@[builtin_doc]` attribute (@digama0).


explains borrow syntax (@eric-wieser).


adds documentation for `groupBy.loop` (@vihdzp).


fixes typo in `BitVec.mul` docstring (@llllvvuu).


fixes typos in `Lean.MetavarContext` docstrings.


removes mention of `Lean.withSeconds` (@alexkeizer).


updates docs/tests for `toUIntX` functions (@TomasPuverle).


mentions that `inferType` does not ensure type correctness.


spelling fixes across doc-strings (@euprunin).


allows addition of `release-ci` label via comment (@thorimur).


sets check level correctly during workflow (@thorimur).


Mathlib's `lean-pr-testing-NNNN` branches use Batteries' `lean-pr-testing-NNNN` branches.


commit `lake-manifest.json` when updating `lean-pr-testing` branches.


use separate secrets for commenting and branching in `pr-release.yml`.


introduces the `bv_decide` tactic for goals involving `BitVec` and `Bool`. It reduces the goal to a SAT instance for an external solver, uses an LRAT proof, and the Lean compiler is part of the TCB. CaDiCaL solver is bundled. Includes counterexample functionality and examples in `tests/lean/run/bv_*`.


fixes a panic in the `reducePow` simproc for `simp`.


exposes the `index` option to the `dsimp` tactic, which was introduced to `simp` in #4202.


fixes a panic at `Fin.isValue` simproc in `simp`.


renames `simpCtorEq` simproc to `reduceCtorEq` and makes it optional (see breaking changes).


ensures `reduceCtorEq` is enabled in the `norm_cast` tactic.


modifies the simp debug trace messages to use "dpre" and "dpost" instead of "pre" and "post" in definitional rewrite mode. #5054 explains the `reduce` steps in `trace.Debug.Meta.Tactic.simp` messages.


reduces default maximum iteration depth of `ext` from 1000000 to 100.


fixes a bug in `induction` where `let` bindings in minor premises weren't counted correctly.


fixes a panic in `omega` tactic.


improves `arg n` in `conv` to handle subsingleton instance arguments.


upstreams the `#time` command.


makes `#check` and `#reduce` typecheck the elaborated terms.


fixes regression in incrementality where we wouldn't interrupt elaboration of previous doc versions.


fixes a performance regression in incremental mode.


disables incremental body elaboration in presence of `where` clauses in declarations.


enables infotrees on the command line for ilean generation.


improves performance of info trees in incremental elaboration.


disables incrementality in the `case .. | ..` tactic.


fixes an issue where changing whitespace after the module header could break subsequent commands. Overlaps with #5312.


adds `clean_wf` tactic in `decreasing_by` to clean up tactic state. Disabled by `set_option debug.rawDecreasingByGoal false`.


unifies equational theorems between structural and well-founded recursion. See also #5055 for details.


allows mutually recursive functions to use different parameter names in the fixed parameter prefix.


adds fine-grained equational lemmas for non-recursive functions. See breaking changes (#4154).


unifies equation lemmas for recursive and non-recursive definitions. `backward.eqns.deepRecursiveSplit = false` reverts old behavior. See breaking changes (#5129).


adds `f.eq_unfold` lemmas. Lean now produces four rewrite rules: eq_1, eq_2, eq_def, eq_unfold for each function, eq_unfold is especially good for rewriting under binders.


fixes bugs in recursion over predicates (#5136).


documents that `include` applies only to theorems currently.


fixes a bug where autoparam errors were associated to the wrong source position.


fixes cdot anonymous function expansions so `(· + ·)` becomes `fun x1 x2 => x1 + x2` and not ambiguous notation.


improves the tactic that proves array indexing in bounds (#5037).


fixes a loop in the array indexing tactic when mvars are present.


makes the structure type clickable in "not a field of structure" errors for instance notation.


fixes a bug where mutual `inductive` could create terms the kernel rejects.


fixes a bug where `variable` could fail mixing binder updates and declarations.


changes `syntheticHole` parser so hovering over `?_` yields docstring for synthetic holes.


uses emoji variant selectors for ✅, ❌, 💥 in messages, improving font selection.


fixes a bug in `rename_i` where it could rename implementation detail hypotheses.


resolves two LS bugs, especially on Windows: editing header might fail to restart file worker, or server might not start at all on slow Windows. Also fixes missed messages if a file worker restarts (#4821).


updates the user widget manual.


updates the quickstart guide with new Lean 4 extension display name.


fixes bug where "import out of date" messages would accumulate over time.


improves ilean loading performance by ~2x (#4900). Optimizes JSON parsing. See PR for details.


localizes an instance in `Lsp.Diagnostics` to fix issues (#5031).


introduces `@[app_delab]` macro for constant-specific delaborators. Syntax `@[app_delab ident]` expands to `@[delab app.name]`.


fixes a bug in the pretty printer for structure projections, which can appear in type mismatch errors. Improves hover in `#print` for structures.


adds `pp.exprSizes` debug option. When true, printed expressions get `[size a/b/c]` prefix showing sizes with/without sharing.


swaps the parameters to `Membership.mem`, so the set-like `CoeSort` refers to `fun x => mem s x`. See breaking changes (#5020).


adds `@[ext]` attribute to `Array.ext` and deprecates `Array.get_modify` (#4957).


deprecates `Array.get_modify` (#4970).


upstreams `List.findIdx` lemmas.


adds `List.Sublist` lemmas, some upstreamed. Also fixes implicitness in `refl/rfl` lemma binders. (#5029, #5048, #5132, #5077).


fixes implicitness in `List.Sublist` lemma binders (#5077).


upstreams `List.Pairwise` lemmas.


adds `List.find?/findSome?/findIdx?` theorems (#5053, #5124, #5161).


adds `List.foldlRecOn` and `List.foldrRecOn` to prove theorems about `foldl`/`foldr` (#5039).


upstreams `List.Perm` (#5069).


adds `List.mergeSort` with fast `@[csimp]` implementation (#5092, #5107).


makes the simp lemmas for `List.subset` more aggressive (#5103).


changes the statement of `List.getLast?_cons` (#5106).


adds `List.range` and `List.iota` lemmas (#5123, #5158).


adds `List.join` lemmas (#5130).


adds `List.append` lemmas (#5131).


adds `List.erase(|P|Idx)` lemmas (#5152).


misc lemma updates for `List` (#5127).


lemmas about `List.attach` / `List.pmap` (#5153, #5160).


adds `List.find?` and `List.range'/range/iota` lemmas (#5164, #5177, #5215).


adds `List.Pairwise_erase` etc. (#5196).


improves confluence of `List` simp lemmas (#5151, #5163, #5105, #5102).


adjust `List` simp lemmas (#5105, #5102).


removes `List.getLast_eq_iff_getLast_eq_some` as a simp lemma (#5178).


reverses meaning of `List.getElem_drop` / `List.getElem_drop'` (#5210).


adds `Nat.add_left_eq_self` and similar (#5104).


adds `Nat.and_xor_distrib_(left|right)` (#5146).


improves confluence of `Nat` and `Int` simp lemmas (#5148, #5190).


adjusts `Int` simp lemmas (#5165).


adds `Int` lemmas about `neg` with `emod`/`mod` (#5166).


reverses direction of `Int.toNat_sub` simp lemma (#5208).


adds `Nat.bitwise` lemmas (#5209).


corrects docstrings for integer division and modulus (#5230).


adds `Option` lemmas (#5128, #5154).


adds `sshiftRight` bitblasting to `BitVec` (#4889).


adds `Std.Associative` and `Std.Commutative` for `BitVec.[and|or|xor]` (#4981).


enables `missingDocs` error for `BitVec` modules (#4913).


makes parameter names more consistent in `BitVec` (#4930).


adds `BitVec.intMin`, introduces `boolToPropSimps` set for boolean→propositional (#5098).


renames `BitVec.getLsb` etc. to `BitVec.getLsbD`, aligning with `List`/`Array` naming (#5200, #5217).


various BitVec theorems (#4977, #4951, #4667, #5007, #4997, #5083, #5081, #4392).


fixes naming convention for `UInt` lemmas (#4514).


deprecates variants of hash map query methods, switching `Lean.HashMap`→`Std.HashMap` (#4943).


switches library/Lean to `Std.HashMap`/`Std.HashSet` (#4917).


deprecates `Lean.HashMap` and `Lean.HashSet` (#4954).


cleans up lemma parameters in HashMap/HashSet (#5023).


adds definitions of SAT/CNF in `Std.Sat` for `bv_decide` (#4933).


defines "and-inverter graphs" (AIGs) for `Std.Sat` (#4953).


generalizes `Parsec` for iterable data, moves from `Lean.Data.Parsec` to `Std.Internal.Parsec`. Breaking changes (#4774).


moves `Lean.Data.Parsec` to `Std.Internal.Parsec` for bootstrapping (#5115).


upstreams `Thunk.ext` (#4969).


`IO.FS.lines` now handles `\r\n` on all OSes (#4973).


adds `createTempFile`/`withTempFile` for secure temporary files (#5125).


adds `Array`, `Bool`, and `Prod` utilities from LeanSAT (#4945).


adds `Relation.TransGen.trans` (#4960).


states `WellFoundedRelation Nat` using `<` not `Nat.lt` (#5012).


uses `≠` in `Fin.ne_of_val_ne` (#5011).


upstreams `Fin.le_antisymm` (#5197).


reduces usage of `refine'` (#5042).


adds about `if-then-else` and `Option` (#5101).


adds basic instances for `ULift` and `PLift` (#5112).


fixes from running the simpNF linter over Lean (#5133, #5168).


removes a bad simp lemma in `omega` (#5156).


improves confluence of `Bool` simp lemmas (#5155).


improves confluence of `Function.comp` simp lemmas (#5162).


improves confluence of `if-then-else` simp lemmas (#5191).


adds `@[elab_as_elim]` to `Quot.rec`, `Nat.strongInductionOn`, etc. Renames `Nat.strongInductionOn`→`Nat.strongRecOn` (#5147, deprecated in #5179).


renames `Nat.strongInductionOn`→`Nat.strongRecOn` (deprecated in #5179).


disables some simp lemmas with bad discrimination tree keys (#5180).


cleans up leaked internal simp lemmas (#5189).


cleans up `allowUnsafeReducibility` (#5198).


removes unused lemmas from some `simp` tactics (#5229).


removes >6 month old deprecations (#5199).


rewrote some core algorithms in C++ for performance. `instantiateLevelMVars`, `instantiateExprMVars` are ~30% faster. (#4910, #4912, #4915, #4922, #4931).


optimizes kernel's `Expr` equality test (#4934).


fixes bug in hashing for the kernel's `Expr` equality test (#4990).


skips some `PreDefinition` transformations if not needed (#4935, #4936).


adds caching for visited exprs at `CheckAssignmentQuick` in `ExprDefEq` (#5225).


maximizes term sharing in `instantiateMVarDeclMVars` (#5226).


adds profiling for `instantiateMVars` in `Lean.Elab.MutualDef` (#4923).


adds diagnostics for large theorems, configured by `diagnostics.threshold.proofSize` (#4924).


improves display of diagnostic results (#4897).


cleans up `Expr.betaRev` (#4921).


fixes tests so we don't write to stdout from separate threads (#4940).


documents that `stderrAsMessages` is now default on the CLI (#4955).


updates macOS build docs (#4647).


makes direct mvar assignments take precedence over delayed ones in `instantiateMVars` (#4987).


adds linter name to errors if a linter crashes (#4967).


cleans up command line snapshots logic (#5043).


minimizes some imports (#5067).


generalizes the monad for `addMatcherInfo` (#5068).


adds missing test for #5126 (#f71a1fb).


restores a test (#5201).


fixes a bug where label attributes did not pass on the attribute kind (#3698).


typo fixes (#5080, #5150, #5202).


moves frontend to new snapshot architecture (#3106). `Frontend.processCommand` and `FrontendM` remain but not used by Lean core.


adds missing include in runtime for `AUTO_THREAD_FINALIZATION` on Windows (#4919).


adds more `LEAN_EXPORT`s for Windows (#4941).


improves formatting of CLI help text (#4911).


improves file read/write: `readBinFile` uses fewer syscalls, `Handle.getLine` no longer tripped by NUL (#4950).


handles SIGBUS for stack overflows (#4971).


avoids overwriting existing signal handlers (#5062), referencing rust-lang/rust#69685.


improves Windows build by splitting `libleanshared`, removing `LEAN_EXPORT` denylist, adds missing exports (#4860).


ensures panics go to Lean's stderr, so they're visible in LS and command line (#4952).


links LibUV (#4963). LibUV is now required for building Lean from source (see breaking changes).


removes dead code (#5030).


adds fields to package config for Reservoir (#4770). See PR for details.


improves release checklist (#4914, #4937).


ignores stale leanpkg tests (#4925).


upgrades `actions/cache` in CI (#5003).


sets `save-always` in cache actions (#5010).


adds more libuv search patterns for speedcenter (#5008).


reduces runs for "fast" benchmarks from 10 to 3 in speedcenter (#5009).


adjusts lakefile editing to new `git` syntax in `pr-release` (#5014).


passes `--retry` to `curl` in `pr-release` (#5025).


builds MacOS Aarch64 release for PRs by default (#5022).


adds libuv to the MacOS docs (#5045).


fixes the install name of `libleanshared_1` on macOS (#5034).


fixes Windows stage 0 (#5051).


fixes 32bit stage 0 builds (#5052).


avoids rebuilding `leanmanifest` in each build (#5057).


makes `restart-on-label` filter by commit SHA (#5099).


adds CaDiCaL (#4325).


LibUV is now required to build Lean from source. Devs compiling Lean themselves must install LibUV. (#4963)


Recursive defs with `decreasing_by` that begin with `simp_wf` may break. Remove `simp_wf` or replace with `simp`. (#5016)


Behavior changed for `rw [f]` when `f` is a non-recursive function defined by pattern matching. For example, `rw [Option.map]` now fails. Remedies: split on parameter, use `f.eq_def`, or `set_option backward.eqns.nonrecursive false`. (#4154)


Unified equation lemmas for recursive and non-recursive functions adds more eq lemmas. Might break rewrites if numbering changed. See #5129, #5207. Also can set `backward.eqns.deepRecursiveSplit false`. (#5129)


The `reduceCtorEq` simproc is now optional. Might need `simp only [reduceCtorEq]`. (#5167)


`Nat.strongInductionOn` → `Nat.strongRecOn`, `Nat.caseStrongInductionOn` → `Nat.caseStrongRecOn`. (#5147)


The parameters to `Membership.mem` are swapped, which affects `SetLike` usage. (#5020)


`List.getElem_drop` and `List.getElem_drop'` got reversed. (#5210)


`Parsec` moved from `Lean.Data.Parsec` to `Std.Internal.Parsec`. It's now more general. For strings, use `Parser` in `Std.Internal.Parsec.String`. (#4774)


`Lean.HashMap` and `Lean.HashSet` are deprecated in favor of `Std.HashMap/Std.HashSet`. Query functions are renamed, `map[key]` expects presence. (#4943, #4954)


The variable inclusion mechanism has been changed. Like before, when a definition mentions a variable, Lean will add it as an argument of the definition, but now in theorem bodies, variables are not included based on usage in order to ensure that changes to the proof cannot change the statement of the overall theorem. Instead, variables are only available to the proof if they have been mentioned in the theorem header or in an include command or are instance implicit and depend only on such variables. The omit command can be used to omit included variables. See breaking changes below. PR references follow.


Structural recursion can now be explicitly requested using `termination_by structural x` in analogy to the existing `termination_by x` syntax for well-founded recursion. See PR for details.


Fixes a bug that could lead to ill-typed terms in structural recursion. See PR for details.


The `termination_by?` syntax no longer forces well-founded recursion. When structural recursion is inferred, it prints the result using `termination_by structural` syntax.


Mutual structural recursion is now supported, both for mutual recursion over a non-mutual data type, as well as recursion over mutual or nested data types. Nested structural recursion is still not supported. The system also generates functional induction principles (f.induct, f.mutual_induct) for these definitions.


Unnecessary termination_by clauses now produce warnings, not errors.


Improves handling of nested structural recursion through non-recursive types in certain cases.


Improves structural recursion over inductive predicates with reflexive arguments.


Sets Simp.Config.implicitDefEqProofs to true by default (simp tactic).


Normalizes the order of constraints in error messages (omega tactic).


Prevents pushing casts into multiplications unless it produces a non-trivial linear combination (omega tactic).


Decide tactic now uses at least default transparency when reducing the Decidable instance.


Adds detailed feedback on decide tactic failure, including blame for non-reducing or classical instances, with hints for solutions.


Makes @[ext] realize ext_iff theorems from user ext theorems. Also includes more robust local/scoped usage. The ext_iff theorem preserves instance implicit binder types rather than making all binder types implicit.


Makes 'go to definition' work for @[ext] generated lemmas. Adjusts core library usage of ext_iff generation.


Makes ext_iff theorem preserve inst implicit binder types rather than making all binder types implicit.


Introduces a safer #eval that prevents evaluation of terms containing sorry, helping avoid Lean process crashes. A new #eval! command reverts to the previous unsafe behavior.


Adjusts a test to accommodate the new #eval safety checks.


Adds #discr_tree_key and #discr_tree_simp_key commands for debugging discrimination tree keys, including simp lemma left-hand side transformations.


Changes option parsing to allow user-defined options from the command line. Initial options are re-parsed and validated after importing. Also discards 'weak.'-prefixed command line option assignments if the underlying option does not exist.


Improves the construction of the BEq deriving handler, enabling better code generation.


Makes BEq deriving handler work when there are dependently typed fields.


Refactors DecidableEq deriving to use 'termination_by structural'.


Adds unresolveNameGlobalAvoidingLocals to metaprogramming support.


Deletes deprecated functions from 2022 in Lean's metaprogramming layer.


Adds Meta.lambdaBoundedTelescope to metaprogramming support.


Adds Meta.withErasedFVars for entering a context where certain fvars are removed from the local context.


Adds assignment validation at closeMainGoal, preventing tactics from bypassing the occurs check via exact, etc.


Introduces Lean.Meta.PProdN for packing and projecting nested PProds in metaprogramming code.


Fixes Syntax.unsetTrailing, enabling 'go to definition' to work on the last module name in an import block.


Responses to info view requests come as soon as the relevant tactic finishes execution.


Whitespace changes do not invalidate imports, so starting to type the first declaration after imports no longer triggers reloading them.


Fixes an issue where hovering over unimported builtin names could cause a panic.


Fixes pp.instantiateMVars setting and changes its default to true.


Ensures syntax nodes always run their formatters, fixing an issue with ppSpace in macros or elab commands not producing a space.


Fixes a bug with overly hoverable signatures in #check caused by pp.tagAppFns being set. Hover is now more precise.


Makes match pretty printer obey pp.explicit, so hovering over a match in Infoview shows the underlying term if explicit is on.


Documents why anonymous constructor notation is not flattened in pretty printing.


Parenthesizer changes so only parentheses are hoverable. The parentheses 'steal' the term info from the enclosed expression.


Allows arbitrarily long sequences of optional arguments to be omitted from the end of applications, rather than just one.


Adds bitwise lemmas Nat.and_le_(left|right).


Adds simprocs for simplifying bit expressions on Nat.


Fixes performance of HPow Int Nat Int synthesis by rewriting as a NatPow Int instance.


Adds lemmas for UInt* and Fin, including *.and_toNat support.


Adds *.and_toNat for UInt* and Fin, among others.


Option: adds get lemmas such as Option.get for more robust rewriting.


Adds Option.or, a strict version of Option.orElse in the second argument.


Adds getElem_congr for rewriting indices in GetElem operations.


Upstreams List.attach, Array.attach, Subset, Sublist, and Pairwise/Nodup from Batteries, plus more. Adjusts List.replicate simps, simprocs, reorg of list getters, simprocs for literal array indexing, etc. Many references below.


Upstreams List.Subset and List.Sublist from Batteries, plus more improvements. See also #4697, #4706, #4720, #4836, #4837, #4855, #4856, #4866, #4865 for further expansions of List API from mathlib/batteries synergy.


Upstreams List.Pairwise, List.Nodup from Batteries. Adds basic material. Also see #4707 for more Pairwise/Nodup testing, #4790 removing typeclass assumptions on List.Nodup.eraseP, etc.


Upstreams more List.erase API. Also see #4835 cleanup, #4843, #4868, #4877 corrections to List.Subset lemmas, #4882 usage in subexpressions, etc.


Upstreams List.IsPrefix, List.IsSuffix, List.IsInfix plus Decidable instances (#4836, #4837).


Upstreams List.attach, List.findIdx, List.indexOf, List.countP, List.count, List.range' (#4855).


Upstreams more List lemmas (#4856).


Upstreams List.pairwise_iff_getElem (#4866).


Upstreams List.eraseIdx lemmas (#4865).


Adjusts List.replicate simp lemmas and simprocs for more consistent rewriting.


Adds characterizations of List.Sublist (#4704).


Adds simp normal form tests for List.Pairwise and List.Nodup (#4707).


Reorganizes lemmas on list getters (#4708, #4815).


Adds simprocs for literal array accesses like #[1,2,3][2] (#4765).


Removes typeclass assumptions for List.Nodup.eraseP (#4790).


Adds efficient usize functions for array types (#4801).


List.filterMapM now runs left-to-right (#4820). Breaking change in monadic side effects ordering.


Fills in and cleans up gaps in List API (#4835).


Corrects List.Subset lemmas (#4843, #4868, #4877).


Splits Init.Data.List.Lemmas into function-specific files (#4863).


Fixes statement of List.take_takeWhile (#4875).


Removes 'partial' from ByteArray.toList and ByteArray.findIdx?, eliminating partial usage (#4582).


Adds recurrence theorems for bitblasting multiplication on BitVec (#4568).


Adds shiftLeftRec lemmas for BitVec (#4571).


Adds ushiftRightRec and lemmas for BitVec (#4872).


Adds getLsb_replicate for BitVec (#4873).


Adds Std.HashMap as a verified replacement for Lean.HashMap, with rename from remove to erase (#4583).


Adds Inhabited instances for new Std.HashMap (#4682).


Improves BEq argument order in Std.HashMap lemmas (#4732).


Makes lemmas resolve instances via unification in Std.HashMap (#4759).


Documents that HashMap usage should be linear to avoid expensive copies (#4771).


Removes 'bif' from HashMap lemmas (#4791).


Adds more lemmas for Std.HashMap (#4803).


Upstreams SMap.foldM (#4690).


Adds PartialEquivBEq, ReflBEq, EquivBEq, LawfulHashable classes (#4607).


Adds IO.Process.Child.tryWait (#4660).


Adds ×' syntax for PProd and a delaborator for PProd/MProd to print as angle-bracket tuples (#4747, #4730, #4756).


Adds lemmas for cond (#4604).


Changes some definitions into theorems (#4619).


Fixes some names with duplicated namespaces (#4616).


Fixes simp lemmas flagged by the simpNF linter (#4620).


Makes the Antisymm class be a Prop (#4666).


Cleans up unused arguments flagged by linter (#4621).


Adds imports for orphaned Init modules (#4680).


Adds imports for orphaned Std.Data modules (#4679).


Adds forward/backward directions of not_exists (#4688).


Upstreams eq_iff_true_of_subsingleton (#4689).


Fixes precedence handling for Repr negative numbers on Int/Float (#4709).


Renames TC (transitive closure) to Relation.TransGen (#4760).


Fixes List deprecations (#4842).


Upstreams some Mathlib attributes (#4852).


Improves a proof (#93ac63).


Generalizes universe for PSigma.exists, renames to Exists.of_psigma_prop (#4862, #4878).


Fixes typos (#4737, #7d2155) and updates docs (#4782, #4869, #4648).


Enforces isDefEqStuckEx at unstuckMVar, providing better error messages and letting rw produce instance solutions in certain cases (#2736).


Fixes deprecation warnings for overloaded symbols (#4713).


Elab_as_elim improvements: checks that inferred motive is type-correct (#4722).


Elab_as_elim improvements: elaborates arguments for parameters in target types (#4800).


Elab_as_elim improvements: better handling for explicit motive arguments (#4817).


Adds a term elaborator for named patterns like n@(n'+1) to detect usage outside pattern-matching contexts (#4792).


Makes anonymous dot notation work with pi-type-valued type synonyms (#4818).


SynthAppInstances improved for rewriting/apply tactics, adding a loop for complex instance ordering (#4646).


Refactors InductiveVal: isNested -> numNested (#4684, also backported as 98ee78). Modifies kernel representation of inductives.


Improves performance of Replacement.apply (#4776).


Fixes .eq_def theorem generation with messy universes (#4712).


Improves transformation match for IndPredBelow by better finding T.below x (#4841).