3.1 KiB
v4.0.0-m4 (WIP)
-
Support notation
let <pattern> := <expr> | <else-case>indoblocks. -
Remove support for "auto"
pure. In the Zulip thread, the consensus seemed to be that "auto"pureis more confusing than it's worth. -
Remove restriction in
congrtheorems that all function arguments on the left-hand-side must be free variables. For example, the following theorem is now a validcongrtheorem.
@[congr]
theorem dep_congr [DecidableEq ι] {p : ι → Set α} [∀ i, Inhabited (p i)] :
∀ {i j} (h : i = j) (x : p i) (y : α) (hx : x = y), Pi.single (f := (p ·)) i x = Pi.single (f := (p ·)) j ⟨y, hx ▸ h ▸ x.2⟩ :=
-
Improve elaboration postponement heuristic when expected type is a metavariable. Lean now reduces the expected type before performing the test.
-
Remove deprecated leanpkg in favor of Lake now bundled with Lean.
-
Various improvements to go-to-definition & find-all-references accuracy.
-
Auto generated congruence lemmas with support for casts on proofs and
Decidableinstances (see whishlist). -
Rename option
autoBoundImplicitLocal=>autoImplicit. -
Relax auto-implicit restrictions. The command
set_option relaxedAutoImplicit falsedisables the relaxations. -
contradictiontactic now closes the goal if there is aFalse.elimapplication in the target. -
Renamed tatic
byCases=>by_cases(motivation: enforcing naming convention). -
Local instances occurring in patterns are now considered by the type class resolution procedure. Example:
def concat : List ((α : Type) × ToString α × α) → String
| [] => ""
| ⟨_, _, a⟩ :: as => toString a ++ concat as
- Notation for providing the motive for
matchexpressions has changed. Before:
match x, rfl : (y : Nat) → x = y → Nat with
| 0, h => ...
| x+1, h => ...
Now:
match (motive := (y : Nat) → x = y → Nat) x, rfl with
| 0, h => ...
| x+1, h => ...
With this change, the notation for giving names to equality proofs in match-expressions is not whitespace sensitive anymore. That is,
we can now write
match h : sort.swap a b with
| (r₁, r₂) => ... -- `h : sort.swap a b = (r₁, r₂)`
(generalizing := true)is the default behavior formatchexpressions even if the expected type is not a proposition. In the following example, we used to have to include(generalizing := true)manually.
inductive Fam : Type → Type 1 where
| any : Fam α
| nat : Nat → Fam Nat
example (a : α) (x : Fam α) : α :=
match x with
| Fam.any => a
| Fam.nat n => n
- We now use
PSum(instead ofSum) when compiling mutually recursive definitions using well-founded recursion.