Lean 4.0.0 (2023-09-08)
-
Lean.Meta.getConst?
has been renamed. We have renamedgetConst?
togetUnfoldableConst?
(andgetConstNoEx?
togetUnfoldableConstNoEx?
). These were not intended to be part of the public API, but downstream projects had been using them (sometimes expecting different behaviour) incorrectly instead ofLean.getConstInfo
. -
dsimp
/simp
/simp_all
now fail by default if they make no progress.This can be overridden with the
(config := { failIfUnchanged := false })
option. This change was made to ease manual use ofsimp
(with complicated goals it can be hard to tell if it was effective) and to allow easier flow control in tactics internally usingsimp
. See the summary discussion on zulip for more details. -
simp_all
now preserves order of hypotheses.In order to support the
failIfUnchanged
configuration option fordsimp
/simp
/simp_all
the waysimp_all
replaces hypotheses has changed. In particular it is now more likely to preserve the order of hypotheses. Seesimp_all
reorders hypotheses unnecessarily. (Previously all non-dependent propositional hypotheses were reverted and reintroduced. Now only such hypotheses which were changed, or which come after a changed hypothesis, are reverted and reintroduced. This has the effect of preserving the ordering amongst the non-dependent propositional hypotheses, but now any dependent or non-propositional hypotheses retain their position amongst the unchanged non-dependent propositional hypotheses.) This may affect proofs that userename_i
,case ... =>
, ornext ... =>
. -
this
is now a regular identifier again that is implicitly introduced by anonymoushave :=
for the remainder of the tactic block. It used to be a keyword that was visible in all scopes and led to unexpected behavior when explicitly used as a binder name. -
Make
calc
require the sequence of relation/proof-s to have the same indentation, and addcalc
alternative syntax allowing underscores_
in the first relation.The flexible indentation in
calc
was often used to align the relation symbols:example (x y : Nat) : (x + y) * (x + y) = x * x + y * x + x * y + y * y := calc (x + y) * (x + y) = (x + y) * x + (x + y) * y := by rw [Nat.mul_add] -- improper indentation _ = x * x + y * x + (x + y) * y := by rw [Nat.add_mul] _ = x * x + y * x + (x * y + y * y) := by rw [Nat.add_mul] _ = x * x + y * x + x * y + y * y := by rw [βNat.add_assoc]
This is no longer legal. The new syntax puts the first term right after the
calc
and each step has the same indentation:example (x y : Nat) : (x + y) * (x + y) = x * x + y * x + x * y + y * y := calc (x + y) * (x + y) _ = (x + y) * x + (x + y) * y := by rw [Nat.mul_add] _ = x * x + y * x + (x + y) * y := by rw [Nat.add_mul] _ = x * x + y * x + (x * y + y * y) := by rw [Nat.add_mul] _ = x * x + y * x + x * y + y * y := by rw [βNat.add_assoc]
-
Update Lake to latest prerelease.
-
Make go-to-definition on a typeclass projection application go to the instance(s).
-
Add
linter.deprecated
option to silence deprecation warnings. -
simp
can track information and can print an equivalentsimp only
. PR #1626. -
Enforce uniform indentation in tactic blocks / do blocks. See issue #1606.
-
Moved
AssocList
,HashMap
,HashSet
,RBMap
,RBSet
,PersistentArray
,PersistentHashMap
,PersistentHashSet
to the Lean package. The standard library contains versions that will evolve independently to simplify bootstrapping process. -
Standard library moved to the std4 GitHub repository.
-
InteractiveGoals
now has information that a client infoview can use to show what parts of the goal have changed after applying a tactic. PR #1610. -
Add
[inheritDoc]
attribute. PR #1480. -
Expose that
panic = default
. PR #1614. -
New code generator project has started.
-
Remove description argument from
register_simp_attr
. PR #1566. -
Many new doc strings have been added to declarations at
Init
.