Skip to content

Commit ed137ae

Browse files
committed
More
1 parent 65d45e5 commit ed137ae

File tree

7 files changed

+20
-15
lines changed

7 files changed

+20
-15
lines changed

src/Init/Data/BitVec/Bitblast.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import all Init.Data.BitVec.Basic
1717
public import Init.Data.BitVec.Decidable
1818
public import Init.Data.BitVec.Lemmas
1919
public import Init.Data.BitVec.Folds
20+
import Init.BinderPredicates
2021

2122
@[expose] public section
2223

src/Init/Data/BitVec/Lemmas.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ public import Init.Data.Int.Pow
2222
public import Init.Data.Int.LemmasAux
2323
public import Init.Data.BitVec.Bootstrap
2424
public import Init.Data.Order.Factories
25+
public import Init.Data.List.BasicAux
26+
import Init.Data.List.Lemmas
27+
import Init.Data.BEq
2528

2629
public section
2730

src/Init/Data/List/Find.lean

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,6 @@ namespace List
3030

3131
open Nat
3232

33-
/-! ### Results about `List.sum` specialized to `Nat` -/
34-
35-
protected theorem sum_pos_iff_exists_pos {l : List Nat} : 0 < l.sum ↔ ∃ x ∈ l, 0 < x := by
36-
induction l with
37-
| nil => simp
38-
| cons x xs ih =>
39-
simp [← ih]
40-
omega
41-
4233
/-! ### findSome? -/
4334

4435
@[simp] theorem findSome?_cons_of_isSome {l} (h : (f a).isSome) : findSome? f (a :: l) = f a := by

src/Init/Data/List/Nat/Find.lean

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,19 @@ public section
1414
set_option linter.listVariables true -- Enforce naming conventions for `List`/`Array`/`Vector` variables.
1515
set_option linter.indexVariables true -- Enforce naming conventions for index variables.
1616

17+
protected theorem Nat.sum_pos_iff_exists_pos {l : List Nat} : 0 < l.sum ↔ ∃ x ∈ l, 0 < x := by
18+
induction l with
19+
| nil => simp
20+
| cons x xs ih =>
21+
simp [← ih]
22+
omega
23+
1724
namespace List
1825

1926
open Nat
2027

28+
/-! ### Results about `List.sum` specialized to `Nat` -/
29+
2130
theorem find?_eq_some_iff_getElem {xs : List α} {p : α → Bool} {b : α} :
2231
xs.find? p = some b ↔ p b ∧ ∃ i h, xs[i] = b ∧ ∀ j : Nat, (hj : j < i) → !p xs[j] := by
2332
rw [find?_eq_some_iff_append]

src/Init/Data/List/OfFn.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module
77

88
prelude
99
public import Init.Data.Fin.Fold
10-
import Init.Data.List.Lemmas
10+
public import Init.Data.List.Lemmas
1111

1212
public section
1313

src/Init/Omega/IntList.lean

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ private theorem getElem?_zipWithAll {f : Option α → Option β → γ} {i : Na
3939
private theorem map_id (l : List α) : map (id : α → α) l = l := by
4040
induction l <;> simp_all
4141

42-
[simp] private theorem map_id' (l : List α) : map (fun (a : α) => a) l = l := map_id l
42+
private theorem map_id' (l : List α) : map (fun (a : α) => a) l = l := map_id l
4343

4444
private theorem getElem?_zipWith {f : α → β → γ} {i : Nat} :
4545
(zipWith f as bs)[i]? = match as[i]?, bs[i]? with
@@ -52,9 +52,9 @@ private theorem getElem?_zipWith {f : α → β → γ} {i : Nat} :
5252
| nil => simp
5353
| cons b bs => cases i <;> simp_all [getElem?_cons_succ]
5454

55-
@[simp] private theorem mem_cons_self {a : α} {l : List α} : a ∈ a :: l := .head ..
55+
private theorem mem_cons_self {a : α} {l : List α} : a ∈ a :: l := .head ..
5656

57-
@[simp] private theorem mem_cons_of_mem (y : α) {a : α} {l : List α} : a ∈ l → a ∈ y :: l := .tail _
57+
private theorem mem_cons_of_mem (y : α) {a : α} {l : List α} : a ∈ l → a ∈ y :: l := .tail _
5858

5959
private theorem length_map {as : List α} (f : α → β) : (as.map f).length = as.length := by
6060
induction as with
@@ -314,7 +314,7 @@ theorem dot_of_left_zero (w : ∀ x, x ∈ xs → x = 0) : dot xs ys = 0 := by
314314
cases ys with
315315
| nil => simp
316316
| cons y ys =>
317-
rw [dot_cons₂, w x (by simp), ih]
317+
rw [dot_cons₂, w x (by simp [List.mem_cons_self]), ih]
318318
· simp
319319
· intro x m
320320
apply w
@@ -363,7 +363,7 @@ theorem dvd_gcd (xs : IntList) (c : Nat) (w : ∀ {a : Int}, a ∈ xs → (c : I
363363
simp
364364
apply Nat.dvd_gcd
365365
· apply w
366-
simp
366+
simp [List.mem_cons_self]
367367
· apply ih
368368
intro b m
369369
apply w

src/Std/Tactic/BVDecide/Normalize/Bool.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public import Init.SimpLemmas
1010
public import Init.Data.Bool
1111
public import Init.Data.BitVec.Lemmas
1212
public import Init.Data.BitVec.Decidable
13+
import Init.Data.BEq
1314

1415
@[expose] public section
1516

0 commit comments

Comments
 (0)