Commit graph

93 commits

Author SHA1 Message Date
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
Sebastian Ullrich
763097dbd2 refactor(library): revise the monadic hierarchy 2017-03-09 20:30:03 -08:00
Jeremy Avigad
95f75bbbee refactor(library/init/data/subtype/basic): rename subtype constructor and projections 2017-03-08 19:31:27 -08:00
Leonardo de Moura
7ac6b14d2a chore(library/init/data/int/basic): use abstract when transfering in an instance declaration
@johoelzl I'm using `abstract` tactic because instances are
automatically marked as [reducible], and they will be unfolded when
solving unification constraints. This cannot be avoided since we need to
solve unification constraints such as

      int.has_add =?= comm_ring.to_has_add int.comm_ring

The `abstract tac` tactic creates an auxiliary lemma to store the proof
generated by `tac`. If we use `print int.comm_ring` we can see that
the definition is much smaller. The proofs are irrelevant. So, this has
no drawbacks, and gives us a good performance boost.
2017-03-07 19:57:43 -08:00
Johannes Hölzl
1f45995c16 feat(library/init/meta/transfer): add transfer and use for int
This commit introduces the transfer method. As application it is
used it to prove that the integers form a commutative ring.
2017-03-07 19:30:51 -08:00
Johannes Hölzl
9e9b289031 feat(library/init/data/prod): add prod.map 2017-03-07 19:30:51 -08:00
Johannes Hölzl
b593d090f2 feat(library/init/data/list): add remove_all 2017-03-07 19:30:51 -08:00
Johannes Hölzl
1c30a593c1 feat(library/init/data/list): add enum 2017-03-07 19:30:51 -08:00
Johannes Hölzl
16aaa9b88e feat(library/init/data/list): add unzip 2017-03-07 19:30:51 -08: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
0c6108ce7a chore(library/init/data/quot): use Sort instead of Type
Remark: The kernel was already using Sort. So, the limitation was
artificial. Moreover, it may seem unnecessary to have quotients of
proofs in a proof irrelevant system, but this is useful for proving
a more general funext lemma. This more general version is needed in
the new tested contributed by @digama0.
2017-03-07 14:29:57 -08:00
Leonardo de Moura
9a263a2766 chore(library/init): instances are reducible and are inlined by the compiler
So, these instances would create two copies of `p` after inlining
2017-03-07 10:58:09 -08:00
Leonardo de Moura
7cae7a5b02 feat(library/init/data/fin/ops): add def lemmas 2017-03-05 16:57:36 -08:00
Leonardo de Moura
0049a42336 feat(library/init/data/fin): add div 2017-03-05 16:43:15 -08:00
Leonardo de Moura
1cdf13821c feat(library/init/data/unsigned): add basic unsigned operations 2017-03-05 16:14:16 -08:00
Leonardo de Moura
6134a4a70e feat(library/init): basic operations for (fin n) 2017-03-05 16:00:02 -08:00
Leonardo de Moura
76f989d51c chore(library/init/data/bool/lemmas): add (coe tt) and (coe ff) simp lemmas 2017-03-05 09:50:01 -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
471c3644a3 chore(library/init/data/option/basic): add lift for option_t 2017-03-05 08:17:55 -08:00
Leonardo de Moura
aeb370ac6b feat(library/init/data/bool/lemmas): add more simp lemmas for bool 2017-03-04 17:01:52 -08:00
Leonardo de Moura
c812e12651 chore(library/init/data/list/lemmas): remove old comment 2017-03-04 16:31:31 -08:00
Leonardo de Moura
05962604f1 feat(library/init/data/bool): add basic simp lemmas for bool 2017-03-04 16:31:16 -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
52221cdbd1 fix(frontends/lean/elaborator): {} elaboration issue 2017-02-24 21:20:39 -08:00
Leonardo de Moura
b9204cefbc feat(library/init/data/array): add helper functions and instances 2017-02-21 13:45:03 -08:00
Daniel Selsam
5f630e5866 fix(library/init/data/option/basic.lean): remove unused type parameter in instance 2017-02-21 11:00:40 -08:00
Leonardo de Moura
d1d5428808 feat(library): add check_constants.lean validation, cleanup unused names, minor stdlib fixes 2017-02-21 10:45:31 -08:00
Leonardo de Moura
e9a98362d3 feat(library): functional arrays 2017-02-20 22:00:02 -08:00
Leonardo de Moura
1ca5c78cf8 feat(library/tools/mini_crush): improve mini_crush 2017-02-19 18:33:12 -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
4f3fd2cba6 feat(library/init/data/list/qsort): add temp qsort as meta definition 2017-02-17 21:07:09 -08:00
Sebastian Ullrich
b9424975b3 refactor(init/meta): replace dynamically-checked quotes where possible 2017-02-17 19:59:57 -08:00
Leonardo de Moura
632c98aade feat(library/data/list): cleanup proofs 2017-02-17 19:42:57 -08:00
Sebastian Ullrich
d15591a2d8 feat(library,frontends/lean): expose parser to Lean and use for parsing tactic parameters 2017-02-17 13:45:56 +01: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
2f5159e7eb feat(library/init/meta): add simple tactics for testing where a declaration was defined 2017-02-11 10:57:06 -08:00
Leonardo de Moura
32e6442d0a feat(frontends/lean): no global universes in the frontend 2017-02-08 17:23:04 -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
d3db3661af refactor(library/init/core): simpler has_sep type class with out_param 2017-01-30 18:54:56 -08:00
Leonardo de Moura
04a8518104 refactor(library/init/core): simpler has_insert type class with out_param 2017-01-30 18:50:21 -08:00
Leonardo de Moura
f176c272b4 refactor(library/init/core): simpler has_mem type class with out_param 2017-01-30 18:43:05 -08:00
Leonardo de Moura
41bf46dbba chore(library/init): adjust Sort vs Type in definitions 2017-01-30 12:50:18 -08:00
Leonardo de Moura
3b38f71f11 fix(library,tests/lean): fix run/interactive tests, and problems in the standard library due to the new interpretation for Type
We had to change subtype to use Sort since the axiom
strong_indefinite_description uses it.

see #1341
2017-01-30 11:54:00 -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
0ba60e62d7 feat(kernel/quotient/quotient): make quotient module robust against users that define their own prelude's
Before this commit, an user could define their own prelude and change
the types of quot, quot.mk, quot.lift or quot.ind.
By doing that, they could prove false.

This commit prevents this kind of abuse.
It also modifies the definition of `quot` and avoids the `setoid`
dependency.
The previous `quot` type is now called `quotient`, and it is defined
using the new `quot` type provided by the kernel.

See discussion at #1330
2017-01-24 15:59:38 -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