Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - refactor(library): decouple algebraic hierarchy from core lib #229

Closed
wants to merge 97 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
e55c7e1
Remove norm_num
jcommelin May 11, 2020
a349f31
Remove a bunch of tests
jcommelin May 11, 2020
b1c6ca1
And remove another test
jcommelin May 11, 2020
93ac6c4
Merge remote-tracking branch 'origin/master' into remove-norm-num
jcommelin May 11, 2020
864a425
Regenerate constants
jcommelin May 11, 2020
7774d40
Make import lines start with 'import'
jcommelin May 11, 2020
83a50a5
Decouple algebraic hierarchy from core lib
jcommelin May 11, 2020
5c41ca3
Merge branch 'master' into strip-algebra
jcommelin May 11, 2020
55ddbbc
Remove unshackled files
jcommelin May 11, 2020
ee2c42f
Remove commented code
jcommelin May 12, 2020
b7f8b57
Remove a test
jcommelin May 12, 2020
8a9d32d
Revert "Remove commented code"
jcommelin May 13, 2020
97a0088
Revert "Remove unshackled files"
jcommelin May 13, 2020
23f9ca8
wip
jcommelin May 13, 2020
b249cba
Merge branch 'master' into strip-algebra
jcommelin May 13, 2020
0449851
Hooray, we're compiling again
jcommelin May 13, 2020
83cf72d
Remove unshackled files
jcommelin May 11, 2020
1a190f3
Fix constants
jcommelin May 13, 2020
245b721
Remove unused code.
gebner May 13, 2020
9b0c7cd
Revert "Remove a test"
jcommelin May 13, 2020
96a135e
Fix the first test
jcommelin May 13, 2020
21112da
Update test 1862
jcommelin May 13, 2020
d0146ca
Update test 1898
jcommelin May 13, 2020
ec8a62e
Update test 1952
jcommelin May 13, 2020
961a2ae
Update test bad_end_error_pos
jcommelin May 13, 2020
208ab57
Update test field_type_mismatch
jcommelin May 13, 2020
9d152e9
Update test get_unused_name
jcommelin May 13, 2020
ae63119
Update test nested_match
jcommelin May 13, 2020
243e7a1
Update test out_param_proj
jcommelin May 13, 2020
fc414d8
Update test quote_error_pos
jcommelin May 13, 2020
33bb06e
Update test rquote
jcommelin May 13, 2020
4984748
Update test simp_symm
jcommelin May 13, 2020
b6744bc
Update test task
jcommelin May 13, 2020
f5d6090
Fix expected output of nested_match
jcommelin May 13, 2020
fe4b8c4
Update test type_context
jcommelin May 13, 2020
00e7e25
Update test vm_override
jcommelin May 13, 2020
1dd6bdd
Update run test 1675
jcommelin May 13, 2020
c7a784e
Update run test 1442
jcommelin May 13, 2020
8418586
Update run test 1685
jcommelin May 13, 2020
c1aa6c5
Update run test ac_refl1
jcommelin May 13, 2020
0eca641
Update run test add_semi
jcommelin May 13, 2020
0416b9e
Update run test auto_param_in_structures
jcommelin May 13, 2020
83808cc
Update run test auto_quote1
jcommelin May 13, 2020
8a86880
Update run test bin_tree
jcommelin May 13, 2020
97794a1
Update run test conv_tact1
jcommelin May 13, 2020
f7f097a
Fix a bunch of cc run tests
jcommelin May 13, 2020
e5c5df5
Fix run test mario_type_context
jcommelin May 13, 2020
7b2f7e6
Fix run test local_attribute
jcommelin May 13, 2020
f3a0e36
Fix run test interactive1
jcommelin May 13, 2020
00a339e
Fix run test mrw
jcommelin May 13, 2020
13edd11
Fix run test funext_tactic
jcommelin May 13, 2020
d6bee26
Fix run test hand_then
jcommelin May 13, 2020
74c0217
Fix run test show_goal
jcommelin May 13, 2020
956f322
Fix run test sebastian_coe_simp
jcommelin May 13, 2020
23564c1
Fix run tests hinst_lemma(s)1
jcommelin May 13, 2020
9c03765
Fix run test eq_cases_on
jcommelin May 13, 2020
9f41176
Fix run test intros_defeq_canonizer_bug
jcommelin May 13, 2020
93a3fe9
Fix run test dsimp_options
jcommelin May 13, 2020
6a47cdf
Fix run test dsimp_proj
jcommelin May 13, 2020
c6c54cc
Fix interactive test goal_info
jcommelin May 13, 2020
9a3f472
Fix test 1898
jcommelin May 13, 2020
a6f8119
Fix expected output for tests/lean/quote_error_pos.lean
jcommelin May 13, 2020
926ba81
Fix run test rw1
jcommelin May 14, 2020
bd6c3c3
Fix run test psum_wf_rec
jcommelin May 14, 2020
3268769
Hopefully fix interactive test goal_info
jcommelin May 14, 2020
bc1c8a7
Fix run test simp_tc_err
jcommelin May 14, 2020
6621ed9
Fix run test simp_zeta
jcommelin May 14, 2020
c2edac9
Fix expected output of test get_unused_name
jcommelin May 14, 2020
4c480a9
Fix expected output of test type_context
jcommelin May 14, 2020
c9c9ac1
Fix run test u_eq_max_u_v
jcommelin May 14, 2020
9a24ea9
Fix run test term_app2
jcommelin May 14, 2020
0fd581c
Fix run test name_resolution_with_params_bug
jcommelin May 14, 2020
ce986cd
Fix run test simp_lemmas_with_mvars
jcommelin May 14, 2020
6e3598a
Fix run test cc_ac3
jcommelin May 14, 2020
fdf0053
Fix run test nat_sub_ematch
jcommelin May 14, 2020
d0b6e4e
Fix run test smt_assert_define
jcommelin May 14, 2020
008beb7
Fix run test smt_ematch1
jcommelin May 14, 2020
b4209e2
Almost fix run test smt_ematch3
jcommelin May 14, 2020
36afaaa
Fix run test smt_tests
jcommelin May 14, 2020
7682053
Fix run test exhaustive_vm_impl_test
jcommelin May 14, 2020
3883029
Partial fix for run test ematch_attr_to_defs
jcommelin May 14, 2020
0b87e21
The aexp test is thoroughly broken
jcommelin May 14, 2020
830947d
Workaround nasty issues in aexp test
jcommelin May 14, 2020
512e797
Fix run test cc_ac5, thanks Mario
jcommelin May 14, 2020
ff22d1c
Almost fixed run test ematch2
jcommelin May 14, 2020
7076b9e
Fix run test smt_ematch_alg_issue
jcommelin May 14, 2020
4ff4ece
Fix run test simp_lemma_issue
jcommelin May 14, 2020
5ee4e4f
Fix run test ematch2
jcommelin May 14, 2020
1a3031c
Remove example in run test using_smt2
jcommelin May 14, 2020
9ff741d
Remove 4 failing tests
jcommelin May 14, 2020
82d875d
Fix test 123-2
jcommelin May 14, 2020
6260f1b
Merge branch 'master' into strip-algebra
jcommelin May 14, 2020
2b5d4bf
Remove a lot of dead code, put gcd back in core
jcommelin May 15, 2020
02b8bcd
Revert "Fix run test exhaustive_vm_impl_test"
jcommelin May 15, 2020
aec23b2
Remove more commented code
jcommelin May 15, 2020
3a09238
Merge remote-tracking branch 'origin/master' into strip-algebra
jcommelin May 15, 2020
c2787f2
Fix run test 236c
jcommelin May 15, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions library/data/bitvec.lean
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ section shift
begin
by_cases (i ≤ n),
{ have h₁ := sub_le n i,
rw [min_eq_right h], rw [min_eq_left h₁, ← nat.add_sub_assoc h, add_comm, nat.add_sub_cancel] },
rw [min_eq_right h], rw [min_eq_left h₁, ← nat.add_sub_assoc h, nat.add_comm, nat.add_sub_cancel] },
{ have h₁ := le_of_not_ge h,
rw [min_eq_left h₁, sub_eq_zero_of_le h₁, zero_min, add_zero] }
rw [min_eq_left h₁, sub_eq_zero_of_le h₁, zero_min, nat.add_zero] }
end $
repeat fill (min n i) ++ₜ take (n-i) x

Expand Down Expand Up @@ -158,7 +158,9 @@ section conversion
theorem bits_to_nat_to_list {n : ℕ} (x : bitvec n)
: bitvec.to_nat x = bits_to_nat (vector.to_list x) := rfl

local attribute [simp] add_comm add_assoc add_left_comm mul_comm mul_assoc mul_left_comm
local attribute [simp] nat.add_comm nat.add_assoc nat.add_left_comm nat.mul_comm nat.mul_assoc
local attribute [simp] nat.zero_add nat.add_zero nat.one_mul nat.mul_one nat.zero_mul nat.mul_zero
-- mul_left_comm

theorem to_nat_append {m : ℕ} (xs : bitvec m) (b : bool)
: bitvec.to_nat (xs ++ₜ b::nil) = bitvec.to_nat xs * 2 + bitvec.to_nat (b::nil) :=
Expand Down Expand Up @@ -189,15 +191,10 @@ section conversion
theorem to_nat_of_nat {k n : ℕ}
: bitvec.to_nat (bitvec.of_nat k n) = n % 2^k :=
begin
induction k with k generalizing n,
induction k with k ih generalizing n,
{ unfold pow nat.pow, simp [nat.mod_one], refl },
{ have h : 0 < 2, { apply le_succ },
rw [ of_nat_succ
, to_nat_append
, k_ih
, bits_to_nat_to_bool
, mod_pow_succ h],
ac_refl, }
rw [of_nat_succ, to_nat_append, ih, bits_to_nat_to_bool, mod_pow_succ h, nat.mul_comm] }
end

protected def to_int : Π {n : nat}, bitvec n → int
Expand Down
4 changes: 2 additions & 2 deletions library/data/rbtree/basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ lemma depth_max' : ∀ {c n} {t : rbnode α}, is_red_black t c n → depth max t
begin
intros c n' t h,
induction h,
case leaf_rb { simp [max, depth, upper] },
case leaf_rb { simp [max, depth, upper, nat.mul_zero] },
case red_rb {
suffices : succ (max (depth max h_l) (depth max h_r)) ≤ 2 * h_n + 1,
{ simp [depth, upper, *] at * },
Expand All @@ -211,7 +211,7 @@ begin
have : depth max h_l ≤ 2*h_n + 1, from le_trans h_ih_rb_l (upper_le _ _),
have : depth max h_r ≤ 2*h_n + 1, from le_trans h_ih_rb_r (upper_le _ _),
suffices new : max (depth max h_l) (depth max h_r) + 1 ≤ 2 * h_n + 2*1,
{ simp [depth, upper, succ_eq_add_one, left_distrib, *] at * },
{ simp [depth, upper, succ_eq_add_one, nat.left_distrib, *] at * },
apply succ_le_succ, apply max_le; assumption
}
end
Expand Down
4 changes: 2 additions & 2 deletions library/data/stream.lean
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ theorem head_cons (a : α) (s : stream α) : head (a :: s) = a := rfl
theorem tail_cons (a : α) (s : stream α) : tail (a :: s) = s := rfl

theorem tail_drop (n : nat) (s : stream α) : tail (drop n s) = drop n (tail s) :=
funext (λ i, begin unfold tail drop, simp [add_comm, add_left_comm] end)
funext (λ i, begin unfold tail drop, simp [nat.add_comm, nat.add_left_comm] end)

theorem nth_drop (n m : nat) (s : stream α) : nth n (drop m s) = nth (n+m) s := rfl

theorem tail_eq_drop (s : stream α) : tail s = drop 1 s := rfl

theorem drop_drop (n m : nat) (s : stream α) : drop n (drop m s) = drop (n+m) s :=
funext (λ i, begin unfold drop, rw add_assoc end)
funext (λ i, begin unfold drop, rw nat.add_assoc end)

theorem nth_succ (n : nat) (s : stream α) : nth (succ n) s = nth n (tail s) := rfl

Expand Down
3 changes: 1 addition & 2 deletions library/init/algebra/default.lean
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Leonardo de Moura
-/
prelude
import init.algebra.group init.algebra.ordered_group init.algebra.ring init.algebra.ordered_ring
import init.algebra.field init.algebra.ordered_field init.algebra.norm_num init.algebra.functions
import init.algebra.functions
Loading