Commit graph

92 commits

Author SHA1 Message Date
Leonardo de Moura
2a67a49f31
chore: simp_arith has been deprecated (#7043)
This PR deprecates the tactics `simp_arith`, `simp_arith!`,
`simp_all_arith` and `simp_all_arith!`. Users can just use the `+arith`
option.
2025-02-12 03:55:45 +00:00
Kim Morrison
6893913683
feat: replace List.lt with List.Lex (#6379)
This PR replaces `List.lt` with `List.Lex`, from Mathlib, and adds the
new `Bool` valued lexicographic comparatory function `List.lex`. This
subtly changes the definition of `<` on Lists in some situations.

`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.
2024-12-15 08:22:39 +00:00
Sebastian Ullrich
88573c802d
test: do not filter output for non-diff tests (#6308) 2024-12-04 17:49:35 +00:00
Kim Morrison
c3948cba24
feat: upstream definition of Vector from Batteries (#6197)
This PR upstreams the definition of `Vector` from Batteries, along with
the basic functions.
2024-11-24 23:01:32 +00:00
Andrii Kurdiumov
51d1cc61d7
fix: remove obsolete sentence in doc-string (#6185)
Even if this sentence is technically true, it do not add anything to the
explanation of typechecker and code.
2024-11-23 07:56:31 +00:00
euprunin
ba43ce18c3
chore: remove repeated words (#5438)
Co-authored-by: euprunin <euprunin@users.noreply.github.com>
Co-authored-by: Kim Morrison <scott.morrison@gmail.com>
2024-09-24 03:40:11 +00:00
euprunin
edf2327229
chore: fix spelling mistakes in examples (doc/examples/) (#5434)
Co-authored-by: euprunin <euprunin@users.noreply.github.com>
2024-09-23 21:44:55 +00:00
Wojciech Nawrocki
2bc87298d9
doc: update user widget manual (#5006)
Updates the user widget manual to account for more recent changes. One
issue is that the samples no longer work on https://live.lean-lang.org/
because it uses an outdated version of the `@leanprover/infoview` NPM
package. They work on https://lean.math.hhu.de/ and in recent versions
of the VSCode extension.
2024-08-23 19:03:39 +00:00
Joachim Breitner
7d60d8b563
feat: safer #eval, and #eval! (#4810)
previously, `#eval` would happily evaluate expressions that contain
`sorry`, either explicitly or because of failing tactics. In conjunction
with operations like array access this can lead to the lean process
crashing, which isn't particularly great.

So how `#eval` will refuse to run code that (transitively) depends on
the `sorry` axiom (using the same code as `#print axioms`).

If the user really wants to run it, they can use `#eval!`.

Closes #1697
2024-07-23 15:26:56 +00:00
David Thrane Christiansen
8fef03d1cc
feat: support Lake for building Lean core oleans (#3886)
This is from a ~~pair~~triple programming session with @tydeu and
@mhuisi.

If stage 1 is built with `-DUSE_LAKE=ON`, the CMake run will generate
`lakefile.toml` files for the root, `src`, and `tests`. These Lake
configuration files can then be used to build core oleans. While they do
not yet allow Lake to be used to build the Lean binaries. they do allow
Lake to be used for working interactively with the Lean source. In our
preliminary experiments, this allowed updates to `Init.Data.Nat` to be
noticed automatically when reloading downstream files, rather than
requiring a full manual compiler rebuild. This will make it easier to
work on the system.

As part of this change, Lake is added to stage 0. This allows Lake to
function in `src`, which uses the stage 0 toolchain.

---------

Co-authored-by: Mac Malone <tydeu@hatpress.net>
Co-authored-by: Sebastian Ullrich <sebasti@nullri.ch>
2024-06-13 16:18:24 +00:00
Sebastian Ullrich
f97a7d4234
feat: incremental elaboration of definition headers, bodies, and tactics (#3940)
Extends Lean's incremental reporting and reuse between commands into
various steps inside declarations:
* headers and bodies of each (mutual) definition/theorem
* `theorem ... := by` for each contained tactic step, including
recursively inside supported combinators currently consisting of
  * `·` (cdot), `case`, `next`
  * `induction`, `cases`
  * macros such as `next` unfolding to the above

![Recording 2024-05-10 at 11 07
32](https://github.com/leanprover/lean4/assets/109126/c9d67b6f-c131-4bc3-a0de-7d63eaf1bfc9)

*Incremental reuse* means not recomputing any such steps if they are not
affected by a document change. *Incremental reporting* includes the
parts seen in the recording above: the progress bar and messages. Other
language server features such as hover etc. are *not yet* supported
incrementally, i.e. they are shown only when the declaration has been
fully processed as before.

---------

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
2024-05-22 13:23:30 +00:00
Mario Carneiro
4f664fb3b5
feat: improve @[deprecated] attr (#3968)
Complement to #3967 , adds a `(since := "<date>")` field to
`@[deprecated]` so that metaprogramming code has access to the
deprecation date for e.g. bulk removals. Also adds `@[deprecated
"deprecation message"]` to optionally replace the default text
"`{declName}` has been deprecated, use `{newName}` instead".
2024-04-23 17:00:32 +00:00
Joe Hendrix
01104cc81e
chore: bool and prop lemmas for Mathlib compatibility and improved confluence (#3508)
This adds a number of lemmas for simplification of `Bool` and `Prop`
terms. It pulls lemmas from Mathlib and adds additional lemmas where
confluence or consistency suggested they are needed.

It has been tested against Mathlib using some automated test
infrastructure.

That testing module is not yet included in this PR, but will be included
as part of this.

Note. There are currently some comments saying the origin of the simp
rule. These will be removed prior to merging, but are added to clarify
where the rule came from during review.

---------

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
2024-03-04 23:56:30 +00:00
Joe Hendrix
8b0dd2e835
chore: upstream Std.Logic (#3312)
This will collect definitions from Std.Logic

---------

Co-authored-by: David Thrane Christiansen <david@davidchristiansen.dk>
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
2024-02-14 09:40:55 +00:00
Joachim Breitner
b5122b6a7b feat: per-function termination hints
This change

 * moves `termination_by` and `decreasing_by` next to the function they
   apply to
 * simplify the syntax of `termination_by`
 * apply the `decreasing_by` goal to all goals at once, for better
   interactive use.

See the section in `RELEASES.md` for more details and migration advise.

This is a hard breaking change, requiring developers to touch every
`termination_by` in their code base. We decided to still do it as a
hard-breaking change, because supporting both old and new syntax at the
same time would be non-trivial, and not save that much. Moreover, this
requires changes to some metaprograms that developers might have
written, and supporting both syntaxes at the same time would make
_their_ migration harder.
2024-01-10 17:27:35 +01:00
Wojciech Nawrocki
8d04ac171d
feat: bundle of widget improvements (#2964)
Implements RFC #2963.

Leftover tasks:
- [x] Provide companion PR to vscode-lean4 (leanprover/vscode-lean4#376)
- [x] Companion PR to std4 (leanprover/std4#467)
- [x] Companion PR to ProofWidgets4
(leanprover-community/ProofWidgets4#36)
- [X] Companion commit to mathlib4
(0f4660f655)
- [ ] ~~Update the manual chapter~~ (will do in a follow-up)
2023-12-21 06:24:33 +00:00
int-y1
ce4ae37c19 chore: fix more typos in comments 2023-10-08 14:37:34 -07:00
Scott Morrison
1dd443a368 doc: improve doc-string for Meta.getConst? 2023-08-24 07:42:28 -07:00
Scott Morrison
f1412ddb45 feat: enable failIfUnchanged by default in simp 2023-08-16 10:14:23 -07:00
Wojciech Nawrocki
7034e64b4f doc: update widget example 2022-12-09 09:51:08 +01:00
Leonardo de Moura
89e1bc72ed doc: examples for Certora tutorial 2022-11-21 17:02:28 -08:00
E.W.Ayers
73644fc6f6 docs: add a section about how to insert text from a widget 2022-11-16 18:57:28 -08:00
E.W.Ayers
aca4703f04 fix: fix the code example for widgets docs. 2022-11-16 18:57:28 -08:00
Mario Carneiro
dd5948d641 chore: snake-case attributes (part 1) 2022-10-19 09:28:08 -07:00
Gabriel Ebner
fb4d90a58b feat: dynamic quotations for categories 2022-10-18 14:59:14 -07:00
Wojciech Nawrocki
98571e6620 doc: explain acronym 2022-08-12 10:28:49 +02:00
Wojciech Nawrocki
7b7e2f54da fix: image paths 2022-08-06 23:46:09 +02:00
Wojciech Nawrocki
bbe11d6e20 doc: clarify widget tutorial 2022-08-06 11:54:44 -07:00
Wojciech Nawrocki
9b595649bf hack: rm JavaScript snippet 2022-08-06 11:54:44 -07:00
Wojciech Nawrocki
72b9ba0dc5 chore: move tutorial to examples folder 2022-08-06 11:54:44 -07:00
Leonardo de Moura
d38fca5f4d chore: update phoas.lean
https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/PHOAS.20example/near/291433426
2022-07-30 08:44:18 -07:00
Sebastian Ullrich
5160cb7b0f refactor: remove some unnecessary antiquotation kind annotations 2022-07-23 17:09:32 +02:00
Leonardo de Moura
6d17e8abbf chore: ICERM notation demo 2022-07-21 08:13:20 -04:00
Leonardo de Moura
977329ce1c chore: ICERM examples 2022-07-21 06:49:47 -04:00
Leonardo de Moura
2116f69315 chore: unused variables 2022-07-17 13:04:08 -04:00
Leonardo de Moura
fce7697151 fix: def _root_ and dotted notation in recursive definitions
closes #1289
2022-07-07 07:57:51 -07:00
kzvi
7326c817d2 fix: fix typos in deBruijn.lean and phoas.lean examples 2022-07-02 16:12:05 -07:00
Timo
e49a81bb56 doc: fix typo 2022-06-27 19:48:45 -07:00
Sebastian Ullrich
388ed62858 chore: update Alectryon 2022-06-07 17:14:41 +02:00
larsk21
cf4e106304 fix: unused variables linter review comments
- ignore unused variables in dep arrows
- avoid negated options
- make syntax stack generation more performant
- make ignore functions more extensible
- change message severity to `warning`
2022-06-03 13:03:52 +02:00
larsk21
393fdef972 fix: disable linters in tests 2022-06-03 13:03:52 +02:00
Leonardo de Moura
cb32681978 doc: add slide headers to examples 2022-05-23 18:20:37 -07:00
Leonardo de Moura
bf5f107e74 doc: missing NFM examples 2022-05-23 18:04:03 -07:00
Leonardo de Moura
6ce6b12707 doc: NFM'22 examples 2022-05-22 19:21:30 -07:00
William Blake
9c72917f5e
doc: fix typo gree -> tree 2022-05-09 09:44:48 +02:00
Leonardo de Moura
7fc139fdb0 chore: add doc-string for tactics 2022-04-15 14:19:03 -07:00
Leonardo de Moura
ed85a68550 chore: missing backtick 2022-04-10 11:11:51 -07:00
Marcus Rossel
a8db183d5c chore: typos 2022-04-09 13:02:01 -07:00
Leonardo de Moura
e5b8d94a65 chore: remove unnecessary annotation 2022-04-06 16:38:16 -07:00
Leonardo de Moura
5b15a97d72 chore: break long lines 2022-04-06 16:37:38 -07:00