Leonardo de Moura
746134d11c
feat(library/init/meta/interactive): add goal tagging support for by_cases
...
This commit also incorporates changes suggested at commit 84a1911949dec94.
2017-12-13 15:17:13 -08:00
Leonardo de Moura
bf8fa50481
feat(library/init/data/list/basic): add is_prefix_of and is_suffix_of
2017-12-11 16:27:03 -08:00
Leonardo de Moura
ddfcc2cb0b
feat(library/init/data/list/basic): define decidable_eq (list A) instance manually
...
Motivation: make sure we can use it before we define the tactic `mk_dec_eq_instance`.
2017-12-11 16:27:03 -08:00
Leonardo de Moura
49e7a642c3
feat(library/init/meta/interactive): merge ginduction and induction
...
This commit is based on 638b34b16de6443.
The changes were applied manually to make sure all changes are
compatible with our plans to `induction`.
2017-12-07 19:10:10 -08:00
Leonardo de Moura
b7322e28c1
feat(library): do not using simp lemmas for sorting arguments of AC operators by default
2017-12-03 15:03:58 -08:00
Leonardo de Moura
52d6adc19c
chore(library): use new structure update notation in the core lib
2017-11-17 16:57:54 -08:00
Leonardo de Moura
8e076da666
feat(library/init/data/list/basic): has_le and has_lt instances for lists
2017-11-13 21:52:12 -08:00
Leonardo de Moura
445cd8f0ae
chore(library/init/data/list/lemmas): ._ ==> _
2017-11-13 21:50:25 -08:00
Leonardo de Moura
a39c0531cf
feat(library/init/data): has_lt for string and list
2017-11-13 15:30:41 -08:00
Leonardo de Moura
10184315fb
feat(library/vm/vm_string): add builtin VM implementation for string.has_decidable_eq
2017-10-23 10:55:26 -07:00
Sebastian Ullrich
f255513fdc
fix(frontends/lean/definition_cmds): apply attributes after declaring equational lemmas
...
Fixes `@[simp] def ...`
2017-09-01 13:36:53 +02:00
Mario Carneiro
26548c956c
feat(init/meta/interactive): rw at *, rw at h1 h2 |- support
...
Now tactics supporting locations can also specify the goal among the locations by using the name `⊢` or `|-`. Also `rw at *` is implemented so that it will rewrite any hypotheses or the goal for which the whole sequence of rewrites succeeds. (This is different from `rw at h1 h2 ... hn |-`, which requires that all rewrites run to completion on each specified target.)
2017-07-28 16:47:02 +01:00
Leonardo de Moura
1ec65bed44
refactor(library/init): move bitvector to main repo
...
@digama0 I moved bitvec back to the main repo, and many nat lemmas.
I want these lemmas here for now. I will need some of them for future
decision procedures.
2017-07-26 13:35:38 +01:00
Mario Carneiro
fb2447468b
chore(init/category/combinators): remove monad.for
...
and variations, in favor of monad.map and variations
2017-07-26 11:52:11 +01:00
Mario Carneiro
4dc261393f
refactor(init/data/list): move out advanced list defs
2017-07-26 11:52:11 +01:00
Mario Carneiro
813fda9ba5
refactor(init/data/{nat,list}): rename for consistency with stdlib
2017-07-26 11:52:10 +01:00
Mario Carneiro
cc81118892
refactor(init/data): move out some nat lemmas
2017-07-26 11:52:10 +01:00
Leonardo de Moura
4faae27069
perf(frontends/lean): add notation #[...]
...
The new notation should be use to input long sequences.
Closes #1755
2017-07-21 04:20:48 -07:00
Sebastian Ullrich
ac8de2472e
feat(library/tactic/induction_tactic): clear hypothesis before introducing new ones
2017-07-07 10:06:30 -07:00
Leonardo de Moura
9645e7588e
chore(library/init/data): recent changes
2017-07-05 12:44:56 -07:00
Mario Carneiro
a1cfce88d5
feat(init/data/list): filter theorems, non-meta qsort
2017-07-05 12:37:54 -07:00
Mario Carneiro
803af7cd63
feat(library/data/stream): more stream theorems
2017-07-05 12:37:53 -07:00
Leonardo de Moura
bb9e3ddae2
feat(library/init/meta/interactive): rw [-h] ==> rw [← h]
...
@Armael: this change may affect your project.
The file `doc/changes.md` explains the motivation for the change.
2017-07-05 11:42:55 -07:00
Sebastian Ullrich
30f4b2f2dd
refactor(library): list.taken/dropn ~> list.take/drop
2017-07-05 11:20:10 -07:00
Sebastian Ullrich
c8d6b40991
refactor(frontends/lean/builtin_exprs,library): suppose ~> assume :
2017-07-05 11:20:10 -07:00
Sebastian Ullrich
f024ccd75d
refactor(frontends/lean/token_table,library): take ~> assume
2017-07-05 11:20:10 -07:00
Leonardo de Moura
e24f3341d4
feat(library/init/meta/interactive): simp without foo ==> simp [-foo]
...
This commit also adds "exception" validation.
A bad "exception" was being silently ignored.
We can also exclude hypotheses. Example: `simp [*, -h]`
2017-07-03 17:10:46 -07:00
Leonardo de Moura
76799db032
feat(library/init/meta/interactive): simph ==> simp [*]
...
This modification was suggested by @kha.
TODO:
- Use `simp [-f]` instead of `simp without f`
- Allow users to remove hypothesis from `*`. Example: `simp [*, -h]`
for simplify using all hypotheses but `h`.
2017-07-03 15:14:47 -07:00
Leonardo de Moura
16711fcdba
feat(library/tactic/dsimplify): new configuration options for dsimp
...
TODO for `dsimp`:
- Add an option for reducing [reducible] definitions
- Add (to_unfold : list name) similar to the one in the `simp` tactic
2017-07-02 18:26:03 -07:00
Leonardo de Moura
52d4189805
feat(library/tactic): add dsimp_config configuration object for the dsimp tactic family
...
Now, `dsimp` fails if the goal did not change.
We can use the config object to obtain the previous behavior:
```
dsimp {fail_if_unchaged := ff}
```
See comment https://github.com/leanprover/lean/issues/1694#issuecomment-310956315
at issue #1694
2017-06-30 17:15:10 -07:00
Sebastian Ullrich
0a48809469
refactor(frontends/lean/tactic_notation): rename note/define tactics to have/let
2017-06-22 08:03:23 -07:00
Mario Carneiro
b775a01fba
refactor(init/meta/interactive): merge assert -> note
2017-06-22 08:03:23 -07:00
Johannes Hölzl
8d438e1012
feat(library/init/meta): add coinduction method
2017-06-12 20:42:48 -07:00
Leonardo de Moura
4eefc41b6e
refactor(*): wrap string in a structure
...
We want to make sure string users do not depend on the string
implementation. This is the first step.
We need this refactoring *now* to make sure it will not be
super painful to address issue #1175
2017-06-07 17:30:49 -07:00
Mario Carneiro
961d0cd6ed
feat(init/data/list): list mem lemmas for map, join, bind
2017-05-27 04:16:24 -04:00
Mario Carneiro
57837c2b3e
fix(init/meta/tactic): let by_cases handle elimination to Type
2017-05-27 04:14:06 -04:00
Leonardo de Moura
62c24f9bb5
chore(*): remove pos_num and num from stdlib
2017-05-25 18:24:16 -07:00
Leonardo de Moura
0bf51e63e8
fix(library/init/meta/constructor_tactic): fixes #1598
2017-05-25 09:57:15 -07:00
Leonardo de Moura
56dd09058f
feat(library/init/data/list/basic): add auxiliary list functions
2017-05-24 14:34:54 -07:00
Leonardo de Moura
cba0eef101
fix(library/data, library/init/data/array): adjust hash_map PR
2017-05-16 14:46:43 -07:00
Mario Carneiro
6b28499e47
feat(init/data/list,data/list): new basic list operations from haskell
2017-05-16 14:38:43 -07:00
Mario Carneiro
7257e32eca
refactor(init/data/list/lemmas): remove projection notation
2017-05-16 14:38:43 -07:00
Mario Carneiro
69c2c998a7
fix(init/data/list/lemmas): fix references to drop
2017-05-16 14:38:43 -07:00
Mario Carneiro
19a919061f
fix(library/data/hash_map): respond to review comments
2017-05-16 14:38:43 -07:00
Mario Carneiro
5d89a93fce
feat(library/data/hash_map): verified hash_map
2017-05-16 14:38:43 -07:00
Mario Carneiro
3b89739850
feat(library/data/list, library/data/array): theorems needed for new hash_map
...
Note that hash_map is moved to library_dev, where the more advanced theorems on lists are available
2017-05-16 14:38:43 -07:00
Leonardo de Moura
5cef84709f
refactor(library): avoid auxiliary definitions such as add/mul/le/etc
...
See Section "Other goodies" at
https://github.com/leanprover/lean/wiki/Refactoring-structures
This commit also improves the support for projections in the
unifier/matcher.
Now, we consider the extra case-split for projections.
Given a projection `proj`, and the constraint `proj s =?= proj t`, we need to try first `s =?= t` and if it fails, then try to reduce.
This is needed in the standard library because we now have constraints such as:
```
@has_le.le ?A ?s ?a ?b =?= @has_le.le nat nat.has_add x y
```
If we reduce the right hand side, we get the unsolvable constraint
```
@has_le.le ?A ?s ?a ?b =?= nat.le x y
```
Before this change, the constraint was `@le ?A ?s ?a ?b =?= @le nat nat.has_add x y`, and we already perform a case-split in this case.
Moreover, projections were eagerly reduced whenever possible.
The extra case-split generates a performance problem in several tests. For example `fib 8 = 34` was timing out.
I worked around this issue by performing the case-split only when the constraint contains meta-variables.
There are also minor issues. Example. `<` is notation for `has_lt.lt`, but `>` is for `gt`.
2017-05-01 08:52:19 -07:00
Sebastian Ullrich
9e8ef54402
refactor(init/data/list/instances): simplify proofs
2017-03-27 13:42:08 -07:00
Sebastian Ullrich
dfd84666e2
feat(library): add functor, applicative, and monad laws, and prove them correct for non-meta instances
2017-03-27 13:42:08 -07:00
Sebastian Ullrich
3ead6be9ca
feat(init): add default value proofs to the monadic hierarchy
2017-03-27 13:42:08 -07:00