Skip to content

Releases: leanprover/lean4

v4.15.0-rc1

02 Dec 01:25
Compare
Choose a tag to compare
v4.15.0-rc1 Pre-release
Pre-release

What's Changed

  • chore: begin development cycle for v4.15 by @kim-em in #5936
  • chore: upstream lemmas about Fin.foldX by @kim-em in #5937
  • chore: upstream List.ofFn and relate to Array.ofFn by @kim-em in #5938
  • feat: List.mapFinIdx, lemmas, relate to Array version by @kim-em in #5941
  • feat: introduce synthetic atoms in bv_decide by @hargoniX in #5942
  • feat: add Int16/Int32/Int64 by @hargoniX in #5885
  • feat: update toolchain on lake update by @tydeu in #5684
  • fix: make all_goals admit goals on failure by @kmill in #5934
  • chore: port release notes for v4.13.0 to master by @kim-em in #5947
  • feat: List.pmap_eq_self by @vihdzp in #5927
  • feat: add Option.or_some' by @vihdzp in #5926
  • chore: remove @[simp] from BitVec.ofFin_sub and sub_ofFin by @kim-em in #5951
  • feat: relate Array.takeWhile with List.takeWhile by @kim-em in #5950
  • feat: relate Array.eraseIdx with List.eraseIdx by @kim-em in #5952
  • chore: CI: check for GitHub Actions updates once per month by @Kha in #5954
  • chore: CI: bump nwtgck/actions-netlify from 2.0 to 3.0 by @dependabot in #5956
  • chore: CI: bump softprops/action-gh-release from 1 to 2 by @dependabot in #5955
  • chore: CI: bump raven-actions/actionlint from 1 to 2 by @dependabot in #5957
  • chore: CI: bump actions/stale from 8 to 9 by @dependabot in #5958
  • chore: CI: give Linux Debug unlimited test stack size by @Kha in #5953
  • chore: CI: bump lycheeverse/lychee-action from 1.9.0 to 2.0.2 by @dependabot in #5959
  • chore: CI: bump actions/github-script from 6 to 7 by @dependabot in #5962
  • chore: CI: bump dawidd6/action-download-artifact from 2 to 6 by @dependabot in #5964
  • chore: CI: bump dcarbone/install-jq-action from 1.0.1 to 2.1.0 by @dependabot in #5965
  • feat: define ISize and basic operations on it by @hargoniX in #5961
  • fix: do not link statically against pthread/dl/rt by @TwoFX in #5966
  • chore: fix all_goals test, simulate the max rec depth error by @kmill in #5967
  • chore: deprecate Array.split in favour of identical Array.partition by @kim-em in #5970
  • fix: arg conv tactic misreported number of arguments on error by @kmill in #5968
  • feat: relate Array.isPrefixOf with List.isPrefixOf by @kim-em in #5971
  • chore: consolidate decide_True and decide_true_eq_true by @kim-em in #5949
  • feat: relate Array.zipWith/zip/unzip with List versions by @kim-em in #5972
  • chore: exclude leanruntest_task_test_io for now by @TwoFX in #5973
  • feat: add another List.find?_eq_some lemma by @kim-em in #5974
  • chore: CI: bump mymindstorm/setup-emsdk from 12 to 14 by @dependabot in #5963
  • chore: tag prerelease builds with -pre by @Kha in #5943
  • feat: BitVec.twoPow in bv_decide by @hargoniX in #5979
  • feat: minor lemmas about List.ofFn by @kim-em in #5982
  • chore: upstream List.insertIdx from Batteries, lemmas from Mathlib, and revise lemmas by @kim-em in #5969
  • feat: interactions between List.foldX and List.filterX by @kim-em in #5984
  • feat: lemmas relating Array.findX and List.findX by @kim-em in #5985
  • feat: BitVec.getMsbD in bv_decide by @hargoniX in #5987
  • refactor: name the default SizeOf instance by @nomeata in #5981
  • chore: fix test exclusion by @Kha in #5990
  • style: fix style in bv_decide normalizer by @hargoniX in #5992
  • feat: BitVec.sshiftRight' in bv_decide by @hargoniX in #5995
  • chore: new PR changelog template by @Kha in #5976
  • chore: revert "CI: give Linux Debug unlimited test stack size" by @Kha in #6001
  • chore: List.modifyTailIdx naming fix by @kim-em in #6007
  • chore: missing @[ext] attribute on monad transformer ext lemmas by @kim-em in #6008
  • feat: verify keys method on HashMaps by @monsterkrampe in #5866
  • fix: unset trailing for simpa? "try this" suggestion by @kmill in #5907
  • feat: change bv_decide to an elaborated config by @hargoniX in #6010
  • fix: ensure instantiateMVarsProfiling adds a trace node by @alexkeizer in #5501
  • fix: avoid max heartbeat error in completion by @mhuisi in #5996
  • perf: avoid negative environment lookup by @Kha in #5429
  • chore: CI: exempt drafts from PR body check by @Kha in #6002
  • feat: decide +revert and improvements to native_decide by @kmill in #5999
  • feat: prop instance yields theorems by @kmill in #5856
  • fix: avoid delaborating with field notation if object is a metavariable by @kmill in #6014
  • fix: bv_decide benchmarks by @hargoniX in #6017
  • chore: cleanup by @JovanGerb in #6021
  • feat: BitVec lemmas for smtUDiv, smtSDiv when denominator is zero by @bollu in #5616
  • feat: variants of List.forIn_eq_foldlM by @kim-em in #6023
  • chore: deprecate duplicated Fin.size_pos by @kim-em in #6025
  • feat: change Array.set to take a Nat and a tactic provided bound by @kim-em in #5988
  • feat: BitVec normalization rule for udiv by twoPow by @bollu in #6029
  • fix: simp only [Β· ∈ Β·] by @nomeata in #6030
  • feat: bv_decide and flattening by @hargoniX in #6035
  • fix: avoid new term info around def bodies by @Kha in #6031
  • fix: bv_decide embedded constraint substitution changes models by @hargoniX in #6037
  • feat: only direct parents of classes create projections by @kmill in #5920
  • feat: change Array.get to take a Nat and a proof by @kim-em in #6032
  • chore: review Array operations argument order by @kim-em in #6041
  • feat: various minor changes to List/Array API by @kim-em in #6044
  • chore: deprecate Array.sequenceMap by @kim-em in #6027
  • chore: mark Meta.Context.config as private by @leodemoura in #6051
  • refactor: mark the Simp.Context constructor as private by @leodemoura in #6054
  • refactor: omega: avoid MVar machinery by @nomeata in #5991
  • chore: pr-body: run as part of merge_group, but do not do anything by @nomeata in #6069
  • fix: line break in simp? output by @Kha in #6048
  • feat: Bool.to(U)IntX by @hargoniX in #6060
  • test: synthetic simp_arith benchmark by @nomeata in #6061
  • perf: optimize Nat.Linear.Expr.toPoly by @nomeata in #6062
  • fix: make sure monad lift coercion elaborator has no side effects by @kmill in #6024
  • perf: optimize Nat.Linear.Poly.norm by @nomeata in #6064
  • feat: message kinds by @tydeu in #5945
  • chore: add newline at end of file for lake new templates by @alissa-tung in #6026
  • chore: remove >6 month old deprecations by @kim-em in #6057
  • chore: upstream some NameMap functions by @kim-em in #6056
  • feat: lemmas about for loops...
Read more

v4.14.0

01 Dec 23:57
Compare
Choose a tag to compare

Full Changelog: v4.13.0...v4.14.0

Language features, tactics, and metaprograms

  • structure and inductive commands

    • #5517 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 inductive/structure 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).
    • #5842 and #5783 implement a feature where the structure command can now define recursive inductive types:
      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
    • #5814 fixes a bug where Mathlib's Type* elaborator could lead to incorrect universe parameters with the inductive command.
    • #3152 and #5844 fix bugs in default value processing for structure instance notation (with @arthur-adjedj).
    • #5399 promotes instance synthesis order calculation failure from a soft error to a hard error.
    • #5542 deprecates := variants of inductive and structure (see breaking changes).
  • Application elaboration improvements

    • #5671 makes @[elab_as_elim] require at least one discriminant, since otherwise there is no advantage to this alternative elaborator.
    • #5528 enables field notation in explicit mode. The syntax @x.f elaborates as @S.f with x supplied to the appropriate parameter.
    • #5692 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.
    • #5658 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.
    • #5933 fixes a bug where .. ellipses in patterns made use of optparams and autoparams.
    • #5770 makes dot notation for structures resolve using all ancestors. Adds a resolution order for generalized field notation. This is the order of namespaces visited during resolution when trying to resolve names. The algorithm to compute a resolution order is the commonly used C3 linearization (used for example by Python), which when successful ensures that immediate parents' namespaces are considered before more distant ancestors' namespaces. By default we use a relaxed version of the algorithm that tolerates inconsistencies, but using set_option structure.strictResolutionOrder true makes inconsistent parent orderings into warnings.
  • Recursion and induction principles

    • #5619 fixes functional induction principle generation to avoid over-eta-expanding in the preprocessing step.
    • #5766 fixes structural nested recursion so that it is not confused when a nested type appears first.
    • #5803 fixes a bug in functional induction principle generation when there are let bindings.
    • #5904 improves functional induction principle generation to unfold aux definitions more carefully.
    • #5850 refactors code for Predefinition.Structural.
  • Error messages

    • #5276 fixes a bug in "type mismatch" errors that would structurally assign metavariables during the algorithm to expose differences.
    • #5919 makes "type mismatch" errors add type ascriptions to expose differences for numeric literals.
    • #5922 makes "type mismatch" errors expose differences in the bodies of functions and pi types.
    • #5888 improves the error message for invalid induction alternative names in match expressions (@josojo).
    • #5719 improves calc error messages.
  • #5627 and #5663 improve the #eval command and introduce some new features.

    • Now results can be pretty printed if there is a ToExpr instance, which means hoverable output. If ToExpr fails, it then tries looking for a Repr or ToString instance like before. Setting set_option eval.pp false disables making use of ToExpr instances.
    • There is now auto-derivation of Repr instances, enabled with the pp.derive.repr option (default to true). For example:
      inductive Baz
      | a | b
      
      #eval Baz.a
      -- Baz.a
      It simply does deriving instance Repr for Baz when there's no way to represent Baz.
    • The option eval.type controls whether or not to include the type in the output. For now the default is false.
    • Now expressions such as #eval do return 2, where monad is unknown, work. It tries unifying the monad with CommandElabM, TermElabM, or IO.
    • The classes Lean.Eval and Lean.MetaEval have been removed. These each used to be responsible for adapting monads and printing results. Now the MonadEval class is responsible for adapting monads for evaluation (it is similar to MonadLift, but instances are allowed to use default data when initializing state), and representing results is handled through a separate process.
    • Error messages about failed instance synthesis are now more precise. Once it detects that a MonadEval class applies, then the error message will be specific about missing ToExpr/Repr/ToString instances.
    • Fixes bugs where evaluating MetaM and CoreM wouldn't collect log messages.
    • Fixes a bug where let rec could not be used in #eval.
  • partial definitions

    • #5780 improves the error message when partial fails to prove a type is inhabited. Add delta deriving.
    • #5821 gives partial inhabitation the ability to create local Inhabited instances from parameters.
  • New tactic configuration syntax. The configuration syntax for all core tactics has been given an upgrade. Rather than simp (config := { contextual := true, maxSteps := 22}), one can now write simp +contextual (maxSteps := 22). Tactic authors can migrate by switching from (config)? to optConfig in tactic syntaxes and potentially deleting mkOptionalNode in elaborators. #5883, #5898, #5928, and #5932. (Tactic authors, see breaking changes.)

  • simp tactic

    • #5632 fixes the simpproc for Fin literals to reduce more consistently.
    • #5648 fixes a bug in simpa ... using t where metavariables in t were not properly accounted for, and also improves the type mismatch error.
    • #5838 fixes the docstring of simp! to actually talk about simp!.
    • #5870 adds support for attribute [simp ←] (note the reverse direction). This adds the reverse of a theorem as a global simp theorem.
  • decide tactic

    • #5665 adds decide! tactic for using kernel reduction (warning: this is renamed to decide +kernel in a future release).
  • bv_decide tactic

Read more

v4.14.0-rc3

29 Nov 02:14
Compare
Choose a tag to compare
v4.14.0-rc3 Pre-release
Pre-release
feat: lake: detailed Reservoir fetch error (#6231)

This PR 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.

Closes #5330.

v4.14.0-rc2

05 Nov 23:52
Compare
Choose a tag to compare
v4.14.0-rc2 Pre-release
Pre-release
fix: do not link statically against pthread/dl/rt (#5966)

v4.14.0-rc1

04 Nov 00:11
Compare
Choose a tag to compare
v4.14.0-rc1 Pre-release
Pre-release
chore: set LEAN_VERSION_IS_RELEASE

v4.13.0

01 Nov 02:36
Compare
Choose a tag to compare

Full Changelog: v4.12.0...v4.13.0

Language features, tactics, and metaprograms

  • structure command

    • #5511 allows structure parents to be type synonyms.
    • #5531 allows default values for structure fields to be noncomputable.
  • rfl and apply_rfl tactics

  • unfold tactic

    • #4834 let unfold do zeta-delta reduction of local definitions, incorporating functionality of the Mathlib unfold_let tactic.
  • omega tactic

  • simp tactic

    • #5479 lets simp apply rules with higher-order patterns.
  • induction tactic

    • #5494 fixes induction’s "pre-tactic" block to always be indented, avoiding unintended uses of it.
  • ac_nf tactic

    • #5524 adds ac_nf, a counterpart to ac_rfl, for normalizing expressions with respect to associativity and commutativity. Tests it with BitVec expressions.
  • bv_decide

    • #5211 makes extractLsb' the primitive bv_decide understands, rather than extractLsb (@alexkeizer)
    • #5365 adds bv_decide diagnoses.
    • #5375 adds bv_decide normalization rules for ofBool (a.getLsbD i) and ofBool a[i] (@alexkeizer)
    • #5423 enhances the rewriting rules of bv_decide
    • #5433 presents the bv_decide counterexample at the API
    • #5484 handles BitVec.ofNat with Nat fvars in bv_decide
    • #5506, #5507 add bv_normalize rules.
    • #5568 generalize the bv_normalize pipeline to support more general preprocessing passes
    • #5573 gets bv_normalize up-to-date with the current BitVec rewrites
    • Cleanups: #5408, #5493, #5578
  • Elaboration improvements

    • #5266 preserve order of overapplied arguments in elab_as_elim procedure.
    • #5510 generalizes elab_as_elim to allow arbitrary motive applications.
    • #5283, #5512 refine how named arguments suppress explicit arguments. Breaking change: some previously omitted explicit arguments may need explicit _ arguments now.
    • #5376 modifies projection instance binder info for instances, making parameters that are instance implicit in the type be implicit.
    • #5402 localizes universe metavariable errors to let bindings and fun binders if possible. Makes "cannot synthesize metavariable" errors take precedence over unsolved universe level errors.
    • #5419 must not reduce ite in the discriminant of match-expression when reducibility setting is .reducible
    • #5474 have autoparams report parameter/field on failure
    • #5530 makes automatic instance names about types with hygienic names be hygienic.
  • Deriving handlers

    • #5432 makes Repr deriving instance handle explicit type parameters
  • Functional induction

    • #5364 adds more equalities in context, more careful cleanup.
  • Linters

    • #5335 fixes the unused variables linter complaining about match/tactic combinations
    • #5337 fixes the unused variables linter complaining about some wildcard patterns
  • Other fixes

    • #4768 fixes a parse error when .. appears with a . on the next line
  • Metaprogramming

    • #3090 handles level parameters in Meta.evalExpr (@eric-wieser)
    • #5401 instance for Inhabited (TacticM Ξ±) (@alexkeizer)
    • #5412 expose Kernel.check for debugging purposes
    • #5556 improves the "invalid projection" type inference error in inferType.
    • #5587 allows MVarId.assertHypotheses to set BinderInfo and LocalDeclKind.
    • #5588 adds MVarId.tryClearMany', a variant of MVarId.tryClearMany.

Language server, widgets, and IDE extensions

  • #5205 decreases the latency of auto-completion in tactic blocks.
  • #5237 fixes symbol occurrence highlighting in VS Code not highlighting occurrences when moving the text cursor into the identifier from the right.
  • #5257 fixes several instances of incorrect auto-completions being reported.
  • #5299 allows auto-completion to report completions for global identifiers when the elaborator fails to provide context-specific auto-completions.
  • #5312 fixes the server breaking when changing whitespace after the module header.
  • #5322 fixes several instances of auto-completion reporting non-existent namespaces.
  • #5428 makes sure to always report some recent file range as progress when waiting for elaboration.

Pretty printing

  • #4979 make pretty printer escape identifiers that are tokens.
  • #5389 makes formatter use the current token table.
  • #5513 use breakable instead of unbreakable whitespace when formatting tokens.

Library

  • #5222 reduces allocations in Json.compress.

  • #5231 upstreams Zero and NeZero

  • #5292 refactors Lean.Elab.Deriving.FromToJson (@arthur-adjedj)

  • #5415 implements Repr Empty (@TomasPuverle)

  • #5421 implements To/FromJSON Empty (@TomasPuverle)

  • Logic

    • #5263 allows simplifying dite_not/decide_not with only Decidable (Β¬p).
    • #5268 fixes binders on ite_eq_left_iff
    • #5284 turns off Inhabited (Sum Ξ± Ξ²) instances
    • #5355 adds simp lemmas for LawfulBEq
    • #5374 add Nonempty instances for products, allowing more partial functions to elaborate successfully
    • #5447 updates Pi instance names
    • #5454 makes some instance arguments implicit
    • #5456 adds heq_comm
    • #5529 moves @[simp] from exists_prop' to exists_prop
  • Bool

    • #5228 fills gaps in Bool lemmas
    • #5332 adds notation ^^ for Bool.xor
    • #5351 removes _root_.and (and or/not/xor) and instead exports/uses Bool.and (etc.).
  • BitVec

    • #5240 removes BitVec simps with complicated RHS
    • #5247 BitVec.getElem_zeroExtend
    • #5248 simp lemmas for BitVec, improving confluence
    • #5249 removes @[simp] from some BitVec lemmas
    • #5252 changes BitVec.intMin/Max from abbrev to def
    • [#5278](https://...
Read more

v4.13.0-rc4

22 Oct 00:05
Compare
Choose a tag to compare
v4.13.0-rc4 Pre-release
Pre-release
fix: do not force snapshot tree too early (#5752)

This turns out to be the issue behind #5736, though really it is yet
another indicator of a general thread pool weakness.

(cherry picked from commit fc5e3cc66e3f317a03a17d9b19cc8d6476cf31cd)

v4.13.0-rc3

04 Oct 08:01
Compare
Choose a tag to compare
v4.13.0-rc3 Pre-release
Pre-release
Reapply "refactor: reduce Reservoir build fetch attempts & warnings (…

v4.13.0-rc2

04 Oct 02:23
Compare
Choose a tag to compare
v4.13.0-rc2 Pre-release
Pre-release
Revert "feat: lake: Reservoir build cache (#5486)"

This reverts commit ffb4c5becf89d57560dd6f48f7693b2fdb9de6f9.

v4.13.0-rc1

03 Oct 12:02
Compare
Choose a tag to compare
v4.13.0-rc1 Pre-release
Pre-release
chore: update CMakeLists.txt