Skip to content

Add left and right versions of ++⁺ for pointwise relations #1131

Closed
@mechvel

Description

@mechvel

Data.List.Relation.Binary.Pointwise has

module _ {_∼_ : REL A B ℓ} where                                                                                                                                
  ++⁺ : ∀ {ws xs ys zs} → Pointwise _∼_ ws xs → Pointwise _∼_ ys zs →             
                                        Pointwise _∼_ (ws ++ ys) (xs ++ zs)  

According to the library style, needs it to be
++-cong₂ : _++_ Preserves₂ (Pointwise _~_) ⟶ (Pointwise _~_) ⟶ (Pointwise _~_)
?
There remains a question of the difference between REL A B _ and Rel A _, Rel B _.
So that I wonder.
Anyway, it has, probably, sense to add lemmas derived from ++⁺, named ++-cong<foo>,
and having Preserves/Preserves₂ in the signature.
For example, in my program, I write for lists over a setoid:

  ++cong1=ₗ :   ∀ {ys} → (_++ ys) Preserves _=ₗ_ ⟶ _=ₗ_
  ++cong1=ₗ {ys} ws=ₗxs =   ++⁺ {_∼_ = _≈_} ws=ₗxs =ₗrefl 

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions