Documentation

CslibFrontier.Foundations.Data.List.LookupBEq

Congruence of List.lookup and List.contains across lawful BEq instances #

Provides List.lookup_beq_congr and List.contains_beq_congr, allowing callers to swap between equivalent BEq instances (such as List.instBEq, instBEqProd, and instBEqOfDecidableEq) whenever both satisfy LawfulBEq.

theorem List.lookup_beq_congr {α β : Type} (inst₁ : BEq α) [hL₁ : LawfulBEq α] (inst₂ : BEq α) [hL₂ : LawfulBEq α] (k : α) (l : List (α × β)) :
lookup k l = lookup k l

Looking up a key in an association list does not depend on which lawful BEq instance is used.

theorem List.contains_beq_congr {α : Type} (inst₁ : BEq α) [hL₁ : LawfulBEq α] (inst₂ : BEq α) [hL₂ : LawfulBEq α] (l : List α) (x : α) :

Membership tests via List.contains do not depend on which lawful BEq instance is used.