Skip to content

Commit 3b281d5

Browse files
committed
Remove beqUnit
1 parent 7ef173e commit 3b281d5

File tree

2 files changed

+5
-24
lines changed

2 files changed

+5
-24
lines changed

src/Std/Data/ExtDHashMap/Basic.lean

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -406,22 +406,6 @@ theorem eq_of_beq [LawfulBEq α] [BEq β] [LawfulBEq β] (m₁ m₂ : ExtDHashMa
406406

407407
end Const
408408

409-
namespace Const
410-
411-
@[inline, inherit_doc DHashMap.beq]
412-
def beqUnit [LawfulBEq α] (m₁ m₂ : ExtDHashMap α fun _ => Unit) : Bool := lift₂ (fun x y : DHashMap α fun _ => Unit => DHashMap.Const.beq x y)
413-
(fun _ _ _ _ => DHashMap.Const.Equiv.beq_congr) m₁ m₂
414-
415-
theorem beqUnit_of_eq [LawfulBEq α] (m₁ m₂ : ExtDHashMap α fun _ => Unit) (h : m₁ = m₂) : Const.beqUnit m₁ m₂ := by
416-
apply beq_of_eq
417-
exact h
418-
419-
theorem eq_of_beqUnit [LawfulBEq α] (m₁ m₂ : ExtDHashMap α fun _ => Unit) (h : Const.beqUnit m₁ m₂) : m₁ = m₂ := by
420-
apply eq_of_beq
421-
exact h
422-
423-
end Const
424-
425409
@[inline, inherit_doc DHashMap.inter]
426410
def inter [EquivBEq α] [LawfulHashable α] (m₁ m₂ : ExtDHashMap α β) : ExtDHashMap α β := lift₂ (fun x y : DHashMap α β => mk (x.inter y))
427411
(fun a b c d equiv₁ equiv₂ => by

src/Std/Data/ExtHashSet/Basic.lean

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -205,24 +205,21 @@ def union [EquivBEq α] [LawfulHashable α] (m₁ m₂ : ExtHashSet α) : ExtHas
205205
instance [EquivBEq α] [LawfulHashable α] : Union (ExtHashSet α) := ⟨union⟩
206206

207207
@[inline, inherit_doc ExtHashMap.beq]
208-
def beq [LawfulBEq α] (m₁ m₂ : ExtHashSet α) : Bool := ExtDHashMap.Const.beqUnit m₁.inner.inner m₂.inner.inner
208+
def beq [LawfulBEq α] (m₁ m₂ : ExtHashSet α) : Bool := ExtDHashMap.Const.beq m₁.inner.inner m₂.inner.inner
209209

210210
instance [LawfulBEq α] : BEq (ExtHashSet α) := ⟨beq⟩
211211

212212
instance [LawfulBEq α] : ReflBEq (ExtHashSet α) where
213-
rfl := by
214-
intro a
215-
cases a
216-
case mk a =>
217-
apply ExtDHashMap.Const.beqUnit_of_eq
218-
rfl
213+
rfl {a} := by
214+
have ⟨a⟩ := a
215+
exact ExtDHashMap.Const.beq_of_eq _ _ rfl
219216

220217
instance [LawfulBEq α] : LawfulBEq (ExtHashSet α) where
221218
eq_of_beq {a} {b} hyp := by
222219
have ⟨⟨a⟩⟩ := a
223220
have ⟨⟨b⟩⟩ := b
224221
simp only [mk.injEq, ExtHashMap.mk.injEq] at |- hyp
225-
exact ExtDHashMap.Const.eq_of_beqUnit _ _ hyp
222+
exact ExtDHashMap.Const.eq_of_beq _ _ hyp
226223

227224
/--
228225
Computes the intersection of the given hash sets.

0 commit comments

Comments
 (0)