Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,11 @@ Additions to existing modules
contradiction′ : ¬ A → A → Whatever
```

* In `Relation.Unary`
```agda
_⊣_ : (A → B) → Pred A ℓ → Pred B _
```

* In `System.Random`:
```agda
randomIO : IO Bool
Expand Down
7 changes: 6 additions & 1 deletion src/Relation/Unary.agda
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ Decidable P = ∀ x → Dec (P x)
-- Operations on sets

infix 10 ⋃ ⋂
infixr 9 _⊢_
infixr 9 _⊢_ _⊣_
infixr 8 _⇒_
infixr 7 _∩_
infixr 6 _∪_
Expand Down Expand Up @@ -266,6 +266,11 @@ P ⊥′ Q = P ∩ Q ⊆′ ∅
_⊢_ : (A → B) → Pred B ℓ → Pred A ℓ
f ⊢ P = λ x → P (f x)

-- Pushforward.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a certain amount of the discussion on the PR should go in comments here. At least that would give a hope of someone finding this via just plain 'grep'.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anything in particular, you'd want to capture from these disucssions?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what are all the concepts that this represents. More words so that if someone is "grep"ping through the sources to find something, they'd get a hit.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to leave this to @bsaul , but can beef things up downstream if necessary?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JacquesCarette I re-requested a review from you (towards merging this as-is), so that we can move the discussion on 'more commentary' to #2866


_⊣_ : (A → B) → Pred A ℓ → Pred B _
f ⊣ P = λ b → ∃ λ a → f a ≡ b × P a
Copy link
Collaborator

@jamesmckinna jamesmckinna Oct 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a spirit of 'compromise', and taking @gallais 's nudge about relative position wrt the turnstile, suggest instead:

Suggested change
_⊣_ : (A B) Pred A ℓ Pred B _
f ⊣ P = λ b λ a f a ≡ b × P a
∃[_]⊢_ : (A B) Pred A ℓ Pred B _
∃[ f ]⊢ P = λ b λ a f a ≡ b × P a

so that one can also then add (plus fixing up the fixity declarations! sigh...)

∀[_]⊢_ : (A  B)  Pred A ℓ  Pred B _
∀[ f ]⊢ P = λ b   a  f a ≡ b  P a

per Lawvere, and consider refinements of this in a setoidal context downstream?

Copy link
Collaborator

@jamesmckinna jamesmckinna Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, if we wanted to retain the box/diamond duality, we could instead write

⟨_⟩⊢_ : (A  B)  Pred A ℓ  Pred B _
[_]⊢_ : (A  B)  Pred A ℓ  Pred B _

and avoid the explicit quantifier pollution? Less ink, but maybe the reader/user has to work correspondingly harder?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to fix the Levels...


------------------------------------------------------------------------
-- Predicate combinators

Expand Down