Kim Morrison
ddd471223c
chore: cleaning up redundant simp lemmas ( #5381 )
...
Problems reported by the simpNF linter downstream.
2024-09-18 10:06:29 +00:00
Kim Morrison
d08051cf0b
chore: variables appearing on both sides of an iff should be implicit ( #5254 )
2024-09-04 08:33:24 +00:00
Kim Morrison
07013da720
chore: running the simpNF linter over Lean ( #5133 )
...
This should resolve nearly all of the simpNF lints. This is a follow-up
to #4620 .
2024-08-24 07:10:07 +00:00
Kim Morrison
0f6a802314
feat: characterisations of List.Sublist ( #4704 )
2024-07-09 21:34:29 +00:00
Kim Morrison
9cc1164305
chore: follow simpNF linter's advice ( #4620 )
...
We can run the `simpNF` environment linter from Batteries. Nearly all
its advice is good.
2024-07-02 04:30:00 +00:00
Markus Himmel
f4ae6fc8aa
fix: add instances to make ac_rfl work out of the box ( #3942 )
...
Previously the `ac_rfl` tactic was only really usable when depending on
mathlib. With these instances, `ac_rfl` can deal with the various
operations defined in Lean.
---------
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
2024-04-24 06:12:36 +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
Leonardo de Moura
928f3e434e
chore: add norm_cast_add_elim ne_eq
...
Recall that `add_elim` was a local command in Std
2024-02-20 07:00:47 -08: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
Leonardo de Moura
25baf73005
feat: replace ite and dite shortcircuit theorems with simproc
...
Motivation: better `simp` cache behavior. Recall that `simp` cache
uses `dischargeDepth`.
2024-01-09 12:57:15 +01:00
Leonardo de Moura
22c8154811
feat: add pre simp lemmas for if-then-else terms
...
See new test for example that takes exponential time without new simp
theorems.
TODO: replace auxiliary theorems with simprocs as soon as we implement them.
2024-01-09 12:57:15 +01:00
Scott Morrison
f3c3a1b62d
feat: find Decidable instances via unification ( #2816 )
...
Because `Decidable` carries data,
when writing `@[simp]` lemmas which include a `Decidable` instance on the LHS,
it is best to use `{_ : Decidable p}` rather than `[Decidable p]`
so that non-canonical instances can be found via unification rather than
typeclass search.
(Previously this behaviour was often being hidden by the default `decide :=
true` in `simp`.)
2023-11-12 00:47:13 +00:00
Mauricio Collares
cfe5a5f188
chore: change simp default to decide := false ( #2722 )
2023-11-02 10:06:38 +11:00
Leonardo de Moura
50d0aced7f
feat: add auxiliary lemma for simp
2023-10-23 06:19:19 -07:00
Leonardo de Moura
32d5def5b8
feat: add bne_iff_ne
2023-07-05 08:51:34 -07:00
Scott Morrison
06c752448b
chore: add missing simp lemma (¬ False) = True
2023-04-10 21:05:54 -07:00
Leonardo de Moura
bc21716bad
chore: helper simp theorems
2022-11-29 23:05:48 -08:00
Mario Carneiro
ce3c0c0e6b
feat: add TR versions of Nat.{fold, any, all, repeat}
2022-08-31 17:52:59 -07:00
Mario Carneiro
c089639b19
refactor: Init.SimpLemmas proof golf / cleanup
2022-08-31 11:27:58 -07:00
Wojciech Nawrocki
aacfd11508
feat: boolean inequality lemmas
2022-06-25 11:18:09 +02:00
François G. Dorais
bc206b2992
fix: LawfulBEq class
...
make arguments implicit and protect `LawfulBEq.rfl`
2022-06-16 15:33:32 -07:00
Sebastian Ullrich
ae7b895f7a
refactor: unname some unused variables
2022-06-07 16:37:45 -07:00
Leonardo de Moura
9852fe3db8
feat: add simp theorems
2022-04-20 16:14:01 -07:00
Leonardo de Moura
8e29747fe7
feat: add simp theorem (a : Nat) : (a ≤ 0) = (a = 0)
2022-03-14 15:43:42 -07:00
Leonardo de Moura
fd519401ff
feat: add Membership instance for List
...
and the theorem `a ∈ as -> sizeOf a < sizeOf as`.
We will use theorems like this one to improve the `decreasing_tactic`.
2022-03-03 18:13:21 -08:00
Leonardo de Moura
3fa001911b
feat: add ite_self simp theorem
2022-03-03 11:55:05 -08:00
Leonardo de Moura
9bd82b798a
chore: use bif instead of if at Linear.lean
2022-03-01 10:55:03 -08:00
Leonardo de Moura
da55789c26
feat: add a proper BEq instance for Nat
2022-03-01 09:01:08 -08:00
Leonardo de Moura
0f06fbf648
feat: LawfulBEq must be reflexive
2022-02-28 19:27:51 -08:00
Leonardo de Moura
4e310ac63d
feat: improve SimpTheorem preprocessor
2022-02-28 18:27:36 -08:00
Leonardo de Moura
e8fb0c96ac
feat: add helper theorems
2022-02-28 18:06:02 -08:00
Leonardo de Moura
8131aa5a64
chore: add simp theorem heq_eq_eq
2022-02-24 13:45:34 -08:00
Leonardo de Moura
43c2169f78
fix: when performing contextual simplification, and arrow may become a dependent arrow
...
fixes #1024
2022-02-23 18:43:32 -08:00
Leonardo de Moura
24249fecd3
feat: helper simp theorems
2022-02-22 16:03:36 -08:00
Leonardo de Moura
1491253479
feat: helper simp theorems
2022-02-10 17:06:16 -08:00
Mario Carneiro
caf09e85ad
chore: universe generalize implies_true
2021-12-17 14:19:54 -08:00
Leonardo de Moura
4630c9af7c
feat: add congruence lemmas for let-expressions
2021-09-10 18:53:23 -07:00
Leonardo de Moura
9cc94296e5
chore: remove staging workaround theorems
2021-08-07 12:52:31 -07:00
Leonardo de Moura
a821dcbff2
chore: enforce naming convention for theorems
...
see issue #402
fix: `ElabTerm.lean`
2021-08-07 12:48:38 -07:00
Sebastian Ullrich
a02c6fd3eb
chore: adapt stdlib & tests
2021-05-20 15:17:36 -07:00
Leonardo de Moura
449c92a1bd
feat: add dite_True and dite_False simp lemmas
2021-05-13 17:21:49 -07:00
François G. Dorais
9949aa653e
feat: add missing simp lemmas for <->
2021-04-05 06:41:39 -07:00
Leonardo de Moura
94e2d0b313
feat: simp theorems for && and ||
2021-03-31 08:12:24 -07:00
Leonardo de Moura
e4d4db45e9
feat: add missing simp lemmas for ->
2021-03-24 14:51:18 -07:00
Leonardo de Moura
99ba21a881
chore: annotations for simp
2021-02-15 17:04:47 -08:00
Leonardo de Moura
51bdf670fa
chore: add simp helper lemmas
2021-02-15 12:42:13 -08:00
Leonardo de Moura
9528c1abd7
chore: add basic simp lemmas
...
TODO: consistent naming convention for theorems.
cc @Kha
2021-02-15 11:32:19 -08:00
Leonardo de Moura
2944da2a0b
feat: use simp itself as default method for discharging hypotheses of conditional rewriting rules
2021-02-13 18:55:19 -08:00
Leonardo de Moura
1a4eaa2418
chore: arguments occurring in the lhs should be marked as implicit
2021-02-13 18:55:19 -08:00
Leonardo de Moura
16a6778fb6
fix: avoid nonstandard instances at ite and dite congruence lemmas
...
cc @gebner
2021-02-12 16:52:56 -08:00