Commit graph

46 commits

Author SHA1 Message Date
Mario Carneiro
6e88119f55 feat(init/meta/injection_tactic): better injection tactic
(1) The lhs and rhs will be reduced to whnf before getting the constructor apps
(2) If the lhs and rhs are distinct constructors, it discharges the goal by contradiction
(3) The interactive injection tactic will try to close the goal by assumption if successful
2017-05-27 04:59:40 -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
cba0eef101 fix(library/data, library/init/data/array): adjust hash_map PR 2017-05-16 14:46: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
ed6b7662df feat(library/init/data): add aux lemmas 2017-05-16 14:25:06 -07:00
Mario Carneiro
7ace147f25 refactor(init/meta/tactic): replace assertv -> note, definev -> pose 2017-05-14 19:34:27 -07:00
Joe Hendrix
216d619d90 chore(library/init/data/nat): Remove [simp] from nat.pow_succ 2017-05-08 10:15: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
Johannes Hölzl
c4c2d703f6 feat(library/init/data): simplify int.transfer; add int and nat to zero_ne_one_class 2017-03-28 18:44:56 -07:00
Leonardo de Moura
71685e4dd6 feat(frontends/lean): add support for t.<id> and t.<idx> when t is a composite term
Replace `^.` with `.` in the stdlib
2017-03-28 17:47:49 -07:00
Leonardo de Moura
87932f1c56 feat(frontends/lean): change notation for inaccessible patterns
The following are accepted
 .(t)
 ._

We don't accept .t anymore because it will conflict with the field
access notation.
2017-03-28 16:09:15 -07:00
Simon Hudon
b6889e91fe feat(lib/init/data/nat): add function pow and a Galois connection between div and mul 2017-03-12 09:38:19 -07:00
Johannes Hölzl
4c88e2c5b0 feat(library/init/data/int): use relators for proof of int is a ring 2017-03-07 19:30:51 -08:00
Leonardo de Moura
0049a42336 feat(library/init/data/fin): add div 2017-03-05 16:43:15 -08:00
Leonardo de Moura
6134a4a70e feat(library/init): basic operations for (fin n) 2017-03-05 16:00:02 -08:00
Simon Hudon
b34eac6f1d feat(library/init/data/nat): add theorem decomposing numbers into quotient and remainder 2017-03-05 08:29:34 -08:00
Leonardo de Moura
d8371a4b0d feat(library/data/hash_map): avoid read' and write' operations that require an extra test 2017-03-01 22:06:48 -08:00
Leonardo de Moura
04991692bf feat(library/init/data/nat/lemmas): aux lemmas 2017-03-01 20:28:27 -08:00
Leonardo de Moura
b52e8d67be feat(library/init/meta): simp&intro tactics 2017-02-19 13:02:27 -08:00
Leonardo de Moura
0d22410e2e feat(library/tactic): add zeta option, refactor simplify config option, allow users to change simplify_config in interactive mode 2017-02-19 12:11:22 -08:00
Leonardo de Moura
632c98aade feat(library/data/list): cleanup proofs 2017-02-17 19:42:57 -08:00
Rob Lewis
46a46c9ee0 feat(norm_num): handle nat subtraction as a special case 2017-02-12 17:15:08 -08:00
Leonardo de Moura
38557b5d6c feat(library/init/data/nat/basic): missing lemma 2017-02-07 17:21:26 -08:00
Leonardo de Moura
77a9feaf70 refactor(frontends/lean): PType ==> Sort
see #1341
2017-01-30 11:54:00 -08:00
Leonardo de Moura
bf9f7560f7 feat(frontends/lean): (Type u) can't be a proposition
(Type u)  is the old (Type (u+1))
(PType u) is the old (Type u)
Type*     is the old (Type (_+1))
PType*    is the old Type*

The stdlib can be compiled, but we still have > 70 broken tests

See discussion at #1341
2017-01-30 11:54:00 -08:00
Leonardo de Moura
f7edf601c8 fix(library/init/data/nat/lemmas): avoid bad patterns in nat sub ematch lemmas
The attribute [ematch_lhs] instructs Lean to use the left-hand-side of
the conclusion as a pattern.
2017-01-22 19:48:01 -08:00
Leonardo de Moura
d9528ffad8 chore(library/init/data/nat/lemmas): add comment 2017-01-21 03:11:59 -08:00
Gabriel Ebner
03e09db70e refactor(library/data/bitvec,library/data/tuple): use automation 2017-01-21 09:48:35 +01:00
Leonardo de Moura
97b98c58d0 refactor(library): move nat lemmas to library/init/data/nat/lemmas.lean 2017-01-17 17:42:13 -08:00
Leonardo de Moura
d0c86f13bb chore(library/init/data/nat): rename nat.less_than to nat.less_than_or_equal as suggested by Rob 2017-01-11 17:47:49 -08:00
Leonardo de Moura
f56250d41e chore(library/init/data/nat/lemmas): mark nat.add_zero as protected 2017-01-07 14:17:56 -08:00
Leonardo de Moura
32cc36214a feat(library/init/meta/smt_tactic): allow user to select simp attribute to be used during SMT preprocessing, use preprocessing at intros too 2017-01-01 22:26:26 -08:00
Leonardo de Moura
244e115412 chore(library/init/data): add more "short-circuit" instances for int/nat 2016-12-27 11:51:42 -08:00
Leonardo de Moura
58ca9a3059 feat(library/init/data/int/comp_lemmas): add auxiliary lemmas for comparing int numerals 2016-12-24 13:52:48 -08:00
Sebastian Ullrich
d95e817a56 refactor(library/data/{bitvec,tuple}): style, conventions, conversions 2016-12-18 13:25:00 -08:00
Leonardo de Moura
1726d37d4e fix(library/algebra/order): decidable_linear_order
Add fields for decidable_eq and decidable_le.
We need this because a concrete instance may have its own
implementation that is not definitionally equal to
the old ones defined at library/algebra/order.lean.
Without this change, types such as nat and int would
have multiple definitions for decidable_eq and decidable_le
which are not definitionally equal.
2016-12-17 14:01:43 -08:00
Leonardo de Moura
422d43cf47 fix(library/init/data/nat/basic): issue reported by @kha 2016-12-17 13:17:30 -08:00
Jeremy Avigad
57dcbcc1c6 feat(library/init/data/nat/lemmas): add facts about order and subtraction 2016-12-15 09:56:09 -08:00
Leonardo de Moura
13ae8b07b3 feat(library/init/data/nat/lemmas): add missing lemmas 2016-12-12 13:25:30 -08:00
Leonardo de Moura
c8d6836aa1 feat(library): port nat sub lemmas 2016-12-11 09:46:45 -08:00
Leonardo de Moura
692701c5ef feat(library/init/meta): use cheap "reflexivity" after simp and rewrite
The idea is to make sure lean doesn't timeout (at reflexivity) when we apply simp or
rewrite in goals such as

    (x y : nat) |- x + y + 10000000000 = x + y + 200000000000000

This commit also addresses an issue raised at #1218
2016-12-08 14:41:26 -08:00
Jeremy Avigad
281903edee refactor(library/init/data/nat/lemmas): better name for self_lt_succ 2016-12-08 07:20:39 -08:00
Jeremy Avigad
814da88858 refactor(library/init/data/nat/basic,lemmas): alternative name, and rename le.elim to le.dest 2016-12-08 07:20:02 -08:00
Leonardo de Moura
e423588463 refactor(library/init): merge some files 2016-12-02 16:13:45 -08:00
Leonardo de Moura
d96fed26b0 refactor(library/init): move propext to its own file 2016-12-02 16:04:39 -08:00
Leonardo de Moura
e11fd8820a refactor(library/init): create init.data folder 2016-12-02 14:23:06 -08:00