Skip to content

Add antisym-≡ to Data.Vec.Relation.Binary.Pointwise.Inductive - #3117

Open
Taneb wants to merge 1 commit into
masterfrom
vec-pwi-antisym-eq
Open

Taneb wants to merge 1 commit into
masterfrom
vec-pwi-antisym-eq

Conversation

@Taneb

@Taneb Taneb commented Sep 10, 2026

Copy link
Copy Markdown
Member

By analogy to what exists in, for example, Relation.Binary.Construct.Add.Infimum.NonStrict.

Something similar could also be added to Data.Vec.Relation.Binary.Pointwise.Extensional

@gallais

gallais commented Sep 10, 2026

Copy link
Copy Markdown
Member

This feels like a consequence of antisym and the fact that pointwise propositional
equality is equivalent to propositional equality.

@jamesmckinna

Copy link
Copy Markdown
Collaborator

This feels like a consequence of antisym and the fact that pointwise propositional equality is equivalent to propositional equality.

Fairbairn threshold?

@Taneb

Taneb commented Sep 10, 2026

Copy link
Copy Markdown
Member Author

This composes better if you're using nested Pointwise than combining antisym and Pointwise-≡⇒≡.

Compare:

foo :  {a ℓ m n} {A : Set a} {P : Rel A ℓ}  Antisymmetric _≡_ P  Antisymmetric _≡_ (Pointwise (Pointwise P {n}) {m})
foo antisym = Pointwise.antisym-≡ (Pointwise.antisym-≡ antisym)

bar :  {a ℓ m n} {A : Set a} {P : Rel A ℓ}  Antisymmetric _≡_ P  Antisymmetric _≡_ (Pointwise (Pointwise P {n}) {m})
bar antisym a b = Pointwise.Pointwise-≡⇒≡ (Pointwise.antisym (λ c d  Pointwise.Pointwise-≡⇒≡ (Pointwise.antisym antisym c d)) a b)

That said, I realised as I was writing that that the lambdas were unnecessary with Function.Base._∘₂_:

baz :  {a ℓ m n} {A : Set a} {P : Rel A ℓ}  Antisymmetric _≡_ P  Antisymmetric _≡_ (Pointwise (Pointwise P {n}) {m})
baz antisym = Pointwise.Pointwise-≡⇒≡ ∘₂ Pointwise.antisym (Pointwise.Pointwise-≡⇒≡ ∘₂ Pointwise.antisym antisym)

But while that's a better way to do this than what I was doing, I still think adding this is worth it.


I initially implemented this directly to avoid reordering the module. Pointwise-≡⇒≡ is defined almost right at the end, and I wanted antisym-≡ to remain near antisym. I don't think it would be that bad to move the Pointwise _≡_ is equivalent to _≡_ proofs earlier in the module, though. If we conclude that this does pass the Fairbairn threshold after all, then I'll do that and redefine antisym-≡ accordingly.

@jamesmckinna

Copy link
Copy Markdown
Collaborator

I think that moving code is always OK, so long as the dependency order is respected, and I certainly agree with wanting the keep any definition of antisym-≡ spatially near to that of antisym.

As for Fairbairn, for sure I felt obliged to raise the question, but I'd be OK with adding this lemma.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants