Skip to content

Commit

Permalink
chore: rm @[eqns] in Ordmap (#11645)
Browse files Browse the repository at this point in the history
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
  • Loading branch information
semorrison and semorrison committed Mar 25, 2024
1 parent 31188bc commit c1056b0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 7 additions & 5 deletions Mathlib/Data/Ordmap/Ordnode.lean
Expand Up @@ -138,14 +138,16 @@ def size : Ordnode α → ℕ
| node sz _ _ _ => sz
#align ordnode.size Ordnode.size

theorem size_nil : size (nil : Ordnode α) = 0 :=
-- Adaptation note:
-- During the port we marked these lemmas with `@[eqns]` to emulate the old Lean 3 behaviour.
-- See https://github.com/leanprover-community/mathlib4/issues/11647

@[simp] theorem size_nil : size (nil : Ordnode α) = 0 :=
rfl
theorem size_node (sz : ℕ) (l : Ordnode α) (x : α) (r : Ordnode α) : size (node sz l x r) = sz :=
@[simp] theorem size_node (sz : ℕ) (l : Ordnode α) (x : α) (r : Ordnode α) :
size (node sz l x r) = sz :=
rfl

attribute [eqns size_nil size_node] size
attribute [simp] size

/-- O(1). Is the set empty?
empty ∅ = tt
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Data/Ordmap/Ordset.lean
Expand Up @@ -808,7 +808,7 @@ theorem Raised.add_right (k) {n m} (H : Raised n m) : Raised (n + k) (m + k) :=

theorem Raised.right {l x₁ x₂ r₁ r₂} (H : Raised (size r₁) (size r₂)) :
Raised (size (@node' α l x₁ r₁)) (size (@node' α l x₂ r₂)) := by
rw [node', size, size]; generalize size r₂ = m at H ⊢
rw [node', size_node, size_node]; generalize size r₂ = m at H ⊢
rcases H with (rfl | rfl)
· exact Or.inl rfl
· exact Or.inr rfl
Expand Down Expand Up @@ -1395,7 +1395,7 @@ theorem Valid'.eraseMax_aux {s l x r o₁ o₂} (H : Valid' o₁ (.node s l x r)
rcases IHrr H.right with ⟨h, e⟩
refine' ⟨Valid'.balanceL H.left h (Or.inr ⟨_, Or.inr e, H.3.1⟩), _⟩
rw [eraseMax, size_balanceL H.3.2.1 h.3 H.2.2.1 h.2 (Or.inr ⟨_, Or.inr e, H.3.1⟩)]
rw [size, e]; rfl
rw [size_node, e]; rfl
#align ordnode.valid'.erase_max_aux Ordnode.Valid'.eraseMax_aux

theorem Valid'.eraseMin_aux {s l} {x : α} {r o₁ o₂} (H : Valid' o₁ (.node s l x r) o₂) :
Expand Down

0 comments on commit c1056b0

Please sign in to comment.