Commit graph

166 commits

Author SHA1 Message Date
Mario Carneiro
c06c62c03e refactor(init/data/nat/gcd): define gcd using eqn compiler 2017-06-27 18:55:52 -07:00
Mario Carneiro
9f2980a524 feat(init/data/int): int lemmas, more bitwise theorems 2017-06-27 18:55:52 -07:00
Mario Carneiro
9f4f93e931 feat(init/data/int): prove int bitwise ops 2017-06-27 18:55:52 -07:00
Mario Carneiro
e705d89490 feat(init/data/int): bitwise ops for integers 2017-06-27 18:55:52 -07:00
Mario Carneiro
a63bafcc5c refactor(init/data/nat/bitwise): change definitions to avoid WF
The type-correctness of binary_rec_eq (the statement, not the proof) depends on unfolding the embedded well-founded definition of mod. This definition avoids it by using two simpler functions bodd and div2 that reduce well in the kernel.
2017-06-27 18:55:52 -07:00
Gabriel Ebner
30a9217a78 feat(library/type_context): unfold lemmas in major premise of acc.rec 2017-06-22 08:33:11 -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
Gabriel Ebner
2e142d87ae fix(library/init/data/repr): give correct implementation of nat.repr 2017-06-19 16:20:27 +02:00
Gabriel Ebner
82bb37422d fix(library/init/data/int): add to_string instance for integers 2017-06-19 14:30:58 +02:00
Leonardo de Moura
8b88f21c91 refactor(library): add has_to_string back (but it produces unquoted values)
See issue #1664
2017-06-18 18:30:10 -07:00
Leonardo de Moura
dc1a1c8540 refactor(library): has_to_string ==> has_repr
See issue #1664

This is just the first step to implement proposal described at issue #1664.
2017-06-18 18:29:19 -07:00
Johannes Hölzl
8d438e1012 feat(library/init/meta): add coinduction method 2017-06-12 20:42:48 -07:00
Gabriel Ebner
dc81915da6 refactor(library): unify char.to_string and char.has_to_string 2017-06-12 16:32:35 +02:00
Leonardo de Moura
0b04376676 refactor(library/init/data/string/basic): mark string implementation as private
See issue #1175

BTW, we may have to revise this decision in the future when we decide to
populate the string library with lemmas.
It is inconvenient to prove the lemmas at string/basic.lean since the
tactic framework has not been defined yet.
Anyway, I think it is worth to keep the private for now, and make sure
nobody relies on its implementation.
2017-06-07 18:00:24 -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
Leonardo de Moura
ea8ecfd390 fix(library/init/meta/interactive): use replace_target at simp_goal
replace_target uses id_locked.
The id_locked solution is more robust because simp may build a proof
using refl lemmas, but type_context may not be able to establish that
the previous and new target are definitionally equal.

@Armael This commit fixes the issue in the KreMLin proof you showed me.
Now, the following tactic succeeds (as expected)
```
        simp [lowstar_semantics.apply_ectx],
```
and the resulting goal is
```
...
|- exp.subbuf (exp.loc (b, n, list.nil field)) a_1 = exp.subbuf ↑?m_1 ?m_2
```
2017-06-05 15:21:20 -07:00
Mario Carneiro
d82b8ed59e feat(init/data/int,init/data/nat,init/algebra): more algebra theorems 2017-06-01 15:15:40 -07:00
Leonardo de Moura
293ab6a032 fix(library/init/data/nat/bitwise): broken lemma 2017-05-31 15:08:03 -07:00
Mario Carneiro
41b928a546 feat(init/data/nat/bitwise): properties of bitwise ops 2017-05-31 14:18:44 -07:00
Mario Carneiro
18b622d709 chore(init/data/nat): modify bitwise defs 2017-05-31 14:18:44 -07:00
Leonardo de Moura
cbca84a8ea chore(library/init/data/nat/bitwise): fix copyright date 2017-05-30 13:05:37 -07:00
Mario Carneiro
860e2d904d feat(init/data/nat): bitwise operations 2017-05-30 12:47:44 -07:00
Mario Carneiro
e92fba8eda feat(init/data/ordering): ordering.swap 2017-05-30 14:22:49 +02:00
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
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
Mario Carneiro
558efb33c1 feat(init/data/option): option.get 2017-05-27 04:14:05 -04:00
Mario Carneiro
a0503f964c feat(init/algebra, init/data/int): more ring theorems 2017-05-27 04:14:04 -04:00
Mario Carneiro
39e7e5cba8 feat(data/vector): more vector operations 2017-05-27 04:14:02 -04:00
Mario Carneiro
07f4055dc0 feat(init/data/int): some more basic int theorems 2017-05-27 04:14:02 -04:00
Mario Carneiro
0d977f46e6 feat(init/data/quot): show that quot is the quotient by the generated equivalence 2017-05-27 04:14:00 -04:00
Mario Carneiro
b28ff94780 feat(init/data/option_t): option_t is a monad transformer 2017-05-27 04:14:00 -04:00
Mario Carneiro
52e41ecd1d feat(init/data/subtype): add subtype.eta 2017-05-27 04:13:59 -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
18c7f5f1b7 refactor(library/init/data/sigma/lex): define psigma.lex
We actually use psigma instead of sigma in the equation compiler.
2017-05-23 20:39:09 -07:00
Leonardo de Moura
499fc355df feat(library/init): add has_well_founded type class 2017-05-17 14:34:52 -07:00
Leonardo de Moura
cb6d5675df chore(library/init): ^. ==> . 2017-05-16 15:00:58 -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
ed6b7662df feat(library/init/data): add aux lemmas 2017-05-16 14:25:06 -07:00
Leonardo de Moura
8b32f3e7a9 chore(library/init/data/fin/basic): pretty print fin.mk using anonymous constructor notation 2017-05-16 13:54:12 -07:00
Mario Carneiro
7ace147f25 refactor(init/meta/tactic): replace assertv -> note, definev -> pose 2017-05-14 19:34:27 -07:00