v4.7.0-rc1
版本发布时间: 2024-03-04 22:03:16
leanprover/lean4最新发布版本:v4.12.0-rc1(2024-09-03 11:01:10)
Changes since v4.6.0 (from RELEASES.md)
-
simp
andrw
now use instance arguments found by unification, rather than always resynthesizing. For backwards compatibility, the original behaviour is available viaset_option tactic.skipAssignedInstances false
. #3507 and #3509. -
When the
pp.proofs
is false, now omitted proofs use⋯
rather than_
, which gives a more helpful error message when copied from the Infoview. Thepp.proofs.threshold
option lets small proofs always be pretty printed. #3241. -
pp.proofs.withType
is now set to false by default to reduce noise in the info view. -
The pretty printer for applications now handles the case of over-application itself when applying app unexpanders. In particular, the
| `($_ $a $b $xs*) => `(($a + $b) $xs*)
case of anapp_unexpander
is no longer necessary. #3495. -
New
simp
(anddsimp
) configuration option:zetaDelta
. It isfalse
by default. Thezeta
option is stilltrue
by default, but their meaning has changed.- When
zeta := true
,simp
anddsimp
reduce terms of the formlet x := val; e[x]
intoe[val]
. - When
zetaDelta := true
,simp
anddsimp
will expand let-variables in the context. For example, suppose the context containsx := val
. Then, any occurrence ofx
is replaced withval
.
See issue #2682 for additional details. Here are some examples:
example (h : z = 9) : let x := 5; let y := 4; x + y = z := by intro x simp /- New goal: h : z = 9; x := 5 |- x + 4 = z -/ rw [h] example (h : z = 9) : let x := 5; let y := 4; x + y = z := by intro x -- Using both `zeta` and `zetaDelta`. simp (config := { zetaDelta := true }) /- New goal: h : z = 9; x := 5 |- 9 = z -/ rw [h] example (h : z = 9) : let x := 5; let y := 4; x + y = z := by intro x simp [x] -- asks `simp` to unfold `x` /- New goal: h : z = 9; x := 5 |- 9 = z -/ rw [h] example (h : z = 9) : let x := 5; let y := 4; x + y = z := by intro x simp (config := { zetaDelta := true, zeta := false }) /- New goal: h : z = 9; x := 5 |- let y := 4; 5 + y = z -/ rw [h]
- When
-
When adding new local theorems to
simp
, the system assumes that the function application arguments have been annotated withno_index
. This modification, which addresses issue #2670, restores the Lean 3 behavior that users expect. With this modification, the following examples are now operational:example {α β : Type} {f : α × β → β → β} (h : ∀ p : α × β, f p p.2 = p.2) (a : α) (b : β) : f (a, b) b = b := by simp [h] example {α β : Type} {f : α × β → β → β} (a : α) (b : β) (h : f (a,b) (a,b).2 = (a,b).2) : f (a, b) b = b := by simp [h]
In both cases,
h
is applicable becausesimp
does not index f-arguments anymore when addingh
to thesimp
-set. It's important to note, however, that global theorems continue to be indexed in the usual manner. -
Improved the error messages produced by the
decide
tactic. #3422 -
Improved auto-completion performance. #3460
-
Improved initial language server startup performance. #3552
-
Changed call hierarchy to sort entries and strip private header from names displayed in the call hierarchy. #3482
-
There is now a low-level error recovery combinator in the parsing framework, primarily intended for DSLs. #3413
-
You can now write
termination_by?
after a declaration to see the automatically inferred termination argument, and turn it into atermination_by …
clause using the “Try this” widget or a code action. #3514 -
A large fraction of
Std
has been moved into the Lean repository. This was motivated by:- Making universally useful tactics such as
ext
,by_cases
,change at
,norm_cast
,rcases
,simpa
,simp?
,omega
, andexact?
available to all users of Lean, without imports. - Minimizing the syntactic changes between plain Lean and Lean with
import Std
. - Simplifying the development process for the basic data types
Nat
,Int
,Fin
(and variants such asUInt64
),List
,Array
, andBitVec
as we begin making the APIs and simp normal forms for these types more complete and consistent. - Laying the groundwork for the Std roadmap, as a library focused on
essential datatypes not provided by the core langauge (e.g.
RBMap
) and utilities such as basic IO. While we have achieved most of our initial aims inv4.7.0-rc1
, some upstreaming will continue over the coming months.
- Making universally useful tactics such as
-
The
/
and%
notations inInt
now useInt.ediv
andInt.emod
(i.e. the rounding conventions have changed). PreviouslyStd
overrode these notations, so this is no change for users ofStd
. There is now kernel support for these functions. #3376. -
omega
, our integer linear arithmetic tactic, is now availabe in the core langauge.- It is supplemented by a preprocessing tactic
bv_omega
which can solve goals aboutBitVec
which naturally translate into linear arithmetic problems. #3435. -
omega
now has support forFin
#3427, the<<<
operator #3433. - During the port
omega
was modified to no longer identify atoms up to definitional equality (so in particular it can no longer proveid x ≤ x
). #3525. This may cause some regressions. We plan to provide a general purpose preprocessing tactic later, or anomega!
mode. -
omega
is now invoked in Lean's automation for termination proofs #3503 as well as in array indexing proofs #3515. This automation will be substantially revised in the medium term, and whileomega
does help automate some proofs, we plan to make this much more robust.
- It is supplemented by a preprocessing tactic
-
The library search tactics
exact?
andapply?
that were originally in Mathlib are now available in Lean itself. These use the implementation using lazy discrimination trees fromStd
, and thus do not require a disk cache but have a slightly longer startup time. The order used for selection lemmas has changed as well to favor goals purely based on how many terms in the head pattern match the current goal. -
The
solve_by_elim
tactic has been ported fromStd
to Lean so that library search can use it. -
New
#check_tactic
and#check_simp
commands have been added. These are useful for checking tactics (particularlysimp
) behave as expected in test suites. -
Previously, app unexpanders would only be applied to entire applications. However, some notations produce functions, and these functions can be given additional arguments. The solution so far has been to write app unexpanders so that they can take an arbitrary number of additional arguments. However this leads to misleading hover information in the Infoview. For example, while
HAdd.hAdd f g 1
pretty prints as(f + g) 1
, hovering overf + g
showsf
. There is no way to fix the situation from within an app unexpander; the expression position forHAdd.hAdd f g
is absent, and app unexpanders cannot register TermInfo.This commit changes the app delaborator to try running app unexpanders on every prefix of an application, from longest to shortest prefix. For efficiency, it is careful to only try this when app delaborators do in fact exist for the head constant, and it also ensures arguments are only delaborated once. Then, in
(f + g) 1
, thef + g
gets TermInfo registered for that subexpression, making it properly hoverable.
Breaking changes:
-
Lean.withTraceNode
and variants got a strongerMonadAlwaysExcept
assumption to fix trace trees not being built on elaboration runtime exceptions. Instances for most elaboration monads built onEIO Exception
should be synthesized automatically. - The
match ... with.
andfun.
notations previously in Std have been replaced bynomatch ...
andnofun
. #3279 and #3286
Other improvements:
- several bug fixes for
simp
: - fixes for
match
expressions: - improve
termination_by
error messages #3255 - fix
rename_i
in macros, fixes #3553 #3581 - fix excessive resource usage in
generalize
, fixes #3524 #3575 - an equation lemma with autoParam arguments fails to rewrite, fixing #2243 #3316
-
add_decl_doc
should check that declarations are local #3311 - instantiate the types of inductives with the right parameters, closing #3242 #3246
- New simprocs for many basic types. #3407
Lake fixes:
1、 lean-4.7.0-rc1-darwin.tar.zst 163.73MB
2、 lean-4.7.0-rc1-darwin.zip 228.62MB
3、 lean-4.7.0-rc1-darwin_aarch64.tar.zst 159.67MB
4、 lean-4.7.0-rc1-darwin_aarch64.zip 224.01MB
5、 lean-4.7.0-rc1-linux.tar.zst 168.86MB
6、 lean-4.7.0-rc1-linux.zip 294.6MB
7、 lean-4.7.0-rc1-linux_aarch64.tar.zst 167.62MB
8、 lean-4.7.0-rc1-linux_aarch64.zip 299.58MB
9、 lean-4.7.0-rc1-linux_wasm32.tar.zst 120.43MB
10、 lean-4.7.0-rc1-linux_wasm32.zip 163.99MB
11、 lean-4.7.0-rc1-linux_x86.tar.zst 144.56MB
12、 lean-4.7.0-rc1-linux_x86.zip 196.28MB
13、 lean-4.7.0-rc1-windows.tar.zst 169.75MB
14、 lean-4.7.0-rc1-windows.zip 237.82MB