Fix all Lean build warnings

- Update deprecated lemmas (ite_eq_left/right, ENat casts, List.Sublist, ...)
- Replace push_neg with push Not and resolve unused-variable warnings
- Convert flexible simp/simp_all calls to explicit simp only lists
- Remove unscoped maxHeartbeats options, open scoped Classical, and unused tactics
- Add missing module docstrings and clean up style linter hits
- Wrap over-long lines and flatten the deeply nested
  minimal_conflictRangeClosedForm_total proof

`lake build` now completes with zero warnings.
This commit is contained in:
andrew committed 2026-11-17 10:04:35 -05:00
1 parent a54a5f82f8
commit af318a7d32
51 files changed
+2542 -1357

No files matched your search

@@ -142,7 +142,8 @@ theorem gap_count_eq_beginSlack_of_resolve_head {db : DB} {r : RangeRead} {head
rw [hsplit, ← List.countP_eq_length_filter]
have hkey := anchor_eq_count_sub_slack db r (le_of_lt hbegin)
rw [hanchor] at hkey
have hcast : ((db.keys.countP (fun k : Key => decide (((k : Key) : WithTop Key) < r.begin.key)) : ℕ) : ℤ) =
have hcast : ((db.keys.countP (fun k : Key => decide (((k : Key) : WithTop Key) < r.begin.key))
: ℕ) : ℤ) =
(db.keys.countP (fun k : Key => decide (k < head)) : ℤ) +
((db.keys.filter (fun k : Key => decide
(((head : Key) : WithTop Key) ≤ ((k : Key) : WithTop Key) ∧
@@ -151,7 +152,8 @@ theorem gap_count_eq_beginSlack_of_resolve_head {db : DB} {r : RangeRead} {head
have hG : (db.keys.filter (fun k : Key => decide
(((head : Key) : WithTop Key) ≤ ((k : Key) : WithTop Key) ∧
((k : Key) : WithTop Key) < r.begin.key))).length = beginSlack r + 1 := by
have h1 : ((db.keys.countP (fun k : Key => decide (((k : Key) : WithTop Key) < r.begin.key)) : ℕ) : ℤ) =
have h1 : ((db.keys.countP (fun k : Key => decide (((k : Key) : WithTop Key) < r.begin.key)) :
ℕ) : ℤ) =
(db.keys.countP (fun k : Key => decide (k < head)) : ℤ) + (beginSlack r : ℤ) + 1 := by
linarith [hkey]
have : ((db.keys.filter (fun k : Key => decide
@@ -186,13 +188,15 @@ theorem resolve_begin_eq_head_of_agree_gap
(a := head) (B := r.begin.key) (le_of_lt hcross)
have hsplit₂ := countP_lt_eq_add_filter_withTop db₂.keys db₂.nodup
(a := head) (B := r.begin.key) (le_of_lt hcross)
have hsplit₁' : db₁.keys.countP (fun k : Key => decide (((k : Key) : WithTop Key) < r.begin.key)) =
have hsplit₁' : db₁.keys.countP (fun k : Key => decide (((k : Key) : WithTop Key) <
r.begin.key)) =
db₁.keys.countP (fun k : Key => decide (k < head)) +
db₁.keys.countP (fun k : Key => decide
(((head : Key) : WithTop Key) ≤ ((k : Key) : WithTop Key) ∧
((k : Key) : WithTop Key) < r.begin.key)) := by
rw [hsplit₁, ← List.countP_eq_length_filter]
have hsplit₂' : db₂.keys.countP (fun k : Key => decide (((k : Key) : WithTop Key) < r.begin.key)) =
have hsplit₂' : db₂.keys.countP (fun k : Key => decide (((k : Key) : WithTop Key) <
r.begin.key)) =
db₂.keys.countP (fun k : Key => decide (k < head)) +
db₂.keys.countP (fun k : Key => decide
(((head : Key) : WithTop Key) ≤ ((k : Key) : WithTop Key) ∧
@@ -281,7 +285,8 @@ theorem compatible_of_agree_negCross_trunc_nonposGap_nonbottom
have hlast_upper : ((last : Key) : WithTop Key) < upper := by
have hle := resolve_le_key_of_offset_nonpos (db := db1) (s := r.end_) hend
exact lt_of_lt_of_le (lt_of_lt_of_le hlt1 hle) (by rw [hupper]; exact le_max_right _ _)
have hmem := (agreeOn_iff (⟨((head : Key) : WithTop Key), upper⟩ : ConflictRange) db1 db2).mp hagree
have hmem := (agreeOn_iff (⟨((head : Key) : WithTop Key), upper⟩ : ConflictRange) db1 db2).mp
hagree
have hmk : ∀ k : Key, ((head : Key) : WithTop Key) ≤ (k : WithTop Key) →
(k : WithTop Key) < upper → (k ∈ db1.keys ↔ k ∈ db2.keys) := by
intro k hk1 hk2