Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A tweak for the cong! tactic #2310

Merged
merged 19 commits into from
Mar 18, 2024
Merged

Conversation

uncle-betty
Copy link
Contributor

Hello there.

It's known that the cong! tactic's anti-unification is a tad too granular for some use cases. In the following, for example, it descends past the application of _+_ in b + c and c + b, so that the following definition doesn't type-check.

proof : ∀ a b c → a + (b + c) ≡ a + (c + b)
proof a b c =
  a + (b + c) ≡⟨ cong! (+-comm b c) ⟩
  a + (c + b) ∎

Note, however, that the following does type-check. (Note the added application of id to b + c.)

proof : ∀ a b c → a + (b + c) ≡ a + (c + b)
proof a b c =
  a + id (b + c) ≡⟨ cong! (+-comm b c) ⟩
  a + (c + b)    ∎

It works, because the cong! tactic inhibits normalisation, the application of id isn't reduced, anti-unification finds that id (b + c) is different from (c + b) (because id is different from _+_) - and doesn't descend further.

Unfortunately, this hack falls apart, when using cong! multiple times in a row. The following, for example, doesn't type-check.

proof : ∀ a b c d → a + b + (c + d) ≡ b + a + (d + c)
proof a b c d =
  a + b + id (c + d)   ≡⟨ cong! (+-comm c d) ⟩
  id (a + b) + (d + c) ≡⟨ cong! (+-comm a b) ⟩
  b + a + (d + c)      ∎

I think that this can be worked around, however, by slightly tweaking the cong! tactic to replace any id x on the right-hand side of the equality with x, i.e., by manually reducing id x to x on the RHS.

The modifications contemplated in this pull request do two things:

As a result, the following example type-checks:

module Demo where

open import Data.Nat
open import Data.Nat.Properties
open import Relation.Binary.PropositionalEquality
open import Tactic.Cong

proof : ∀ a b c d → a + b + (c + d) ≡ b + a + (d + c)
proof a b c d =
  a + b + ⌞ c + d ⌟   ≡⟨ cong! (+-comm c d) ⟩
  ⌞ a + b ⌟ + (d + c) ≡⟨ cong! (+-comm a b) ⟩
  b + a + (d + c)     ∎
  where open ≡-Reasoning

proof′ : ∀ a b → a + b + (a + b) ≡ b + a + (b + a)
proof′ a b =
  ⌞ a + b ⌟ + ⌞ a + b ⌟   ≡⟨ cong! (+-comm a b) ⟩
  b + a + (b + a)         ∎
  where open ≡-Reasoning

This could be a useful tweak to the cong! tactic, no? Or am I missing something?

Copy link
Contributor

@MatthewDaggitt MatthewDaggitt left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! Yup, I agree with all your analysis.

Before we merge this in, could you:

@uncle-betty
Copy link
Contributor Author

Great! Thank you for the review.

I've started to make the requested additions, but now I also have second thoughts: The whole idea breaks, when using ≡˘⟨ ? ⟩. sym swaps the RHS and the LHS, and as the underlying idea is to have special treatment for the RHS, things break.

I'll have to spend more thought on this over the next days.

@shhyou
Copy link
Contributor

shhyou commented Mar 6, 2024

@uncle-betty
Copy link
Contributor Author

Thank you, @shhyou, for the pointer! I'll check out #2033.

@uncle-betty
Copy link
Contributor Author

Alright - catchTC to the rescue! I think that fixed the issue with ≡˘⟨ ? ⟩.

The idea is to use catchTC to detect when anti-unification doesn't yield a correct solution. And then try again, with the RHS and LHS swapped. This incurs additional cost, but only when the first attempt at anti-unification fails. So, there's only a performance penalty in the following two cases:

  • The proof is a work in progress and not yet complete/correct. Now it takes a little longer for type-checking to fail, because there are two attempts at anti-unification.
  • The proof contains ⌞_⌟ and uses ≡˘⟨ ? ⟩. The first anti-unification attempt always fails, resulting in a second attempt.

Complete/correct proofs that don't contain ⌞_⌟ won't be affected at all.

(I double-checked that let is lazy by adding debug log messages to uni and uni'.)

I'm not sure whether this is good enough for inclusion in the standard library. I guess one could try to find a smarter way to address cong! failures. What I like about this approach, though, is that it's basically a 10-line add-on to existing proven technology. Maybe collect some more feedback from people? I'll go over to #2033 and ask.

@uncle-betty
Copy link
Contributor Author

Out of curiosity, a quick performance smoke test with --profile=definitions.

README.Tactic.Cong on the master branch:

README.Tactic.Cong.succinct-example                   31ms 
README.Tactic.Cong.EquationalReasoningTests.test₁     30ms 
README.Tactic.Cong.EquationalReasoningTests.test₂     26ms 
README.Tactic.Cong.verbose-example                    24ms 
README.Tactic.Cong.LambdaTests.test₂                  14ms 
README.Tactic.Cong.HigherOrderTests.test₂             12ms 

On the cong-tweak branch:

README.Tactic.Cong.succinct-example                   29ms 
README.Tactic.Cong.EquationalReasoningTests.test₁     36ms                                                                                                                                        
README.Tactic.Cong.EquationalReasoningTests.test₂     25ms 
README.Tactic.Cong.verbose-example                    21ms 
README.Tactic.Cong.LambdaTests.test₂                  10ms 
README.Tactic.Cong.HigherOrderTests.test₂             12ms 
README.Tactic.Cong.marker-example₁                    25ms 
README.Tactic.Cong.marker-example₂                    13ms 

As expected, pretty much the same, within the margin of error, no? Sometimes cong-tweak is faster, sometimes master is. (I don't know why not all top-level definitions show up.)

When I change the two marker-example proofs (which contain ⌞_⌟) to use ≡˘⟨ ? ⟩ instead of ≡⟨ ? ⟩, then they take longer to type-check, as expected. So, the second anti-unification and other extra work does show.

README.Tactic.Cong.marker-example₁                    45ms 
README.Tactic.Cong.marker-example₂                    17ms 

Note that succinct-example also uses a ≡˘⟨ ? ⟩ and doesn't see a slow-down, because it does not contain ⌞_⌟.

So, I'm now cautiously optimistic that the thoughts about performance in my previous comment are reasonable.

@uncle-betty
Copy link
Contributor Author

Hmmmm. Maybe I'm overthinking the performance angle.

As a comparison, I just ran #2033 on marker-example₁. (It doesn't seem to support multiple markers per proof step, as in marker-example₂.)

Demo.marker-example₁     94ms 

Repeating the original results from above for context. Tweaked cong! with ≡⟨ ? ⟩:

README.Tactic.Cong.marker-example₁                    25ms

Tweaked cong! with ≡˘⟨ ? ⟩:

README.Tactic.Cong.marker-example₁                    45ms

So, even with the overhead of the second anti-unification in ≡˘⟨ ? ⟩, the tweaked cong! seems faster in this specific case.

I'm starting to feel a little more bullish about this tweak.

Sorry about all the comments. I'm just trying to be transparent about my reasoning so that others can chime in, if interested.

@gallais
Copy link
Member

gallais commented Mar 8, 2024

Rather than guessing using catchTC, wouldn't it be easier to provide combinators
that include the call to the cong! tactic?

E.g.

_≡⟨_⟩_ -- forwards step
_≡⟪_⟫_ -- forwards step with magic cong

_≡⟨_⟨_ -- backwards step
_≡⟪_⟪_ -- backwards step with magic cong

? Never start by forgetting the user's stated intent only to then attempt to guess it
via computations...

@uncle-betty
Copy link
Contributor Author

Oooooh! Cool! I like the idea of having combinators that include the cong!.

Earlier, I tried to come up with something in this vein, but couldn't. I tried to find a way to make cong! figure out somehow, whether it's being used in ≡˘⟨ ? ⟩ vs. ≡⟨ ? ⟩. Which seems impossible.

This proposal would solve that problem elegantly.

Does anyone have any opinions on the user ergonomics of the proposed approach?

@uncle-betty
Copy link
Contributor Author

uncle-betty commented Mar 8, 2024

I've been thinking about the combinator proposal a little more. Let me make sure that I have this right by breaking it down a little. I think I might need some adult supervision here.

The combinators would be syntax declarations, say:

syntax cong!-≡-⟫ x y≡z x'≡y' = x ≡⟪ x'≡y' ⟫ y≡z
syntax cong!-≡-⟪ x y≡z y'≡x' = x ≡⟪ y'≡x' ⟪ y≡z

The overall proof of x ≡ z would be trans (cong ... x'≡y') y≡z, where ... is the part the tactic has to figure out. cong ... x'≡y' would have type x ≡ y.

The two macros used by the syntax declarations would look like this:

cong!-≡-⟫ : ∀ {a} {A : Set a} (x : A) {x' y' y z : A} → y ≡ z → x' ≡ y' → Term → TC ⊤
cong!-≡-⟫ x y≡z x'≡y' hole = ...

cong!-≡-⟪ : ∀ {a} {A : Set a} (x : A) {x' y' y z : A} → y ≡ z → y' ≡ x' → Term → TC ⊤
cong!-≡-⟪ x y≡z y'≡x' hole = ...
  • hole would be the overall goal, x ≡ z. I somehow have to get from there to x ≡ y, because that's what I want to run anti-unification on.
  • How would I do that? I guess I would create a new meta variable and construct a term trans <meta> y≡z. I would then unify this constructed term with hole. The meta variable would then have type x ≡ y, which would be my new goal.
  • From this point on, it's all basically like the existing cong!: I would run anti-unification on this new goal. Then I would unify the resulting cong ... x'≡y' term with my new meta variable (as opposed to the overall goal, as cong! currently does).

Does this make sense at all? Maybe it would be nice to pull the trans out of the macros, in order to simplify them - but I don't see how this can be done.

@uncle-betty
Copy link
Contributor Author

OMG! It works! It works, it works, it WORKS! I guess, to a certain extent, one can compensate a lack of experience with enthusiasm and tenacity. :)

I haven't yet changed the documentation. Let's first decide whether these custom combinators are what we really want. And whether my proposed implementation makes sense. If not, I'll roll back the changes. Otherwise, I'll fix the documentation and examples.

@MatthewDaggitt
Copy link
Contributor

This does look very exciting! I guess my main question is do these combinators work with any reasoning module (e.g. preorder, partial order reasoning) as well? It looks like they should, but it would be good to get confirmation!

Minor bikeshedding, but I think it would be good if we could include the tactic symbol ! in the combinator names. Maybe _≡⟨!_⟩_?

@uncle-betty
Copy link
Contributor Author

uncle-betty commented Mar 9, 2024

Oh, excellent question! I'm glad you asked, because it turns out that the combinators don't work with anything else right now.

Turns out that the ≡-syntax module, for example, is parameterized by the relation and the trans that goes with it. And that the relation isn't necessarily _≡_, but would more typically be _IsRelatedTo_, which differs between the stdlib's different reasoning modules.

Shame. Now a user cannot simply generically import the combinators from Tactic.Cong and use them with any reasoning module, can they?

Instead, we'd have to parameterize the new combinators as well. Then, say, ≤-Reasoning for Data.Nat would have to import the combinators from Tactic.Cong with the parameters filled in appropriately, and re-export the now specialized combinators.

Or is there a better way?

Have a good weekend, everyone.

P. S. Happy to change the name of the combinators. I don't have a preference.

@uncle-betty
Copy link
Contributor Author

I started sketching the idea of having, say, Relation.Binary.Reasoning.Base.Triple import Tactic.Cong and re-export explicitly parameterized versions of the combinators.

Unfortunately, this causes an import cycle: Tactic.Cong imports Reflection, which imports Data.Nat.Properties, which (via Relation.Binary.Reasoning.Base.Triple) imports Tactic.Cong.

I'll try to understand the dependencies a little better, but I'm a little hesitant to change the structure of stdlib just to suit a relatively small additional feature. But maybe there's another way.

I also double-checked my assumption that the combinators have to be explicitly parameterized. What, if they could take the relation as an implicit parameter instead and figure out the relation (e.g., _≡_ or _IsRelatedTo_) themselves? As I had assumed, this doesn't work. In applications of the following test function, for example, Agda cannot figure out B.

test : ∀ {a b} {A : Set a} {B : REL A A b} {x y : A} → B x y → REL A A b 
test {B = B} Bxy = B

_ = test {B = _≡_} {x = 1} refl -- B  must be explicitly specified

I'll spend some more thought on this. I'd definitely prefer the combinator approach over my original catchTC hack.

@JacquesCarette
Copy link
Contributor

For efficiency of checking and for having minimal dependencies, I doubt we'll ever want to use tactics in the "low level" parts of the library. So I wouldn't spend much time on this.

Using tactics is great for users, and for exploratory development, but some parts of the library will always use explicit proofs.

@uncle-betty
Copy link
Contributor Author

Thank you for looking into this!

Unfortunately, the cyclic dependencies are a more general issue, as far as I can tell. Suppose that I'd like to use ≤-Reasoning from Data.Nat.Properties in a higher-level proof outside of stdlib.

  • Then Data.Nat.Properties would presumably have to import Tactic.Cong, which provides the new cong! combinators to ≤-Reasoning.
  • However, conversely, Tactic.Cong imports stdlib's reflection machinery, which imports Data.Nat.Properties.

It looks like this generally precludes combinators from using reflection.

Here's how I ended up where I am:

≡-Reasoning from Relation.Binary.PropositionalEquality is based on Trans _≡_ _≡_ _≡_. That's what the cong! combinators on the cong-tweak branch work with right now. That's solved.

However, other reasoning modules are based on Trans _≡_ R R. (I.e., the current proof step uses _≡_, the rest of the proof down to the _∎ uses R.) So, I'm now trying to generalize the combinators to work with any R.

My first idea was to make R an implicit argument to the cong! combinators. But Agda seems unable to automatically derive this argument in applications of the combinators. (As the test function from my previous comment illustrates.)

That's why the idea I'm currently pursuing is to explicitly parameterize the cong! combinators by way of an explicit relation parameter to the cong! combinators module. (This also seems to be the general pattern followed by stdlib.) Data.Nat.Properties would then import the cong! combinators module providing _IsRelatedTo_ (which is the R for ≤-Reasoning) as the explicit relation parameter.

Currently, I see two ways out:

  • The reflection machinery in stdlib imports Data.Nat.Properties solely for _≟_, as a foundation for its own decidable equality on ASTs. So, effectively, it only imports a dozen or so lines of code. Could that simply be duplicated in the reflection machinery? Or factored out into some other place under Data.Nat?

  • Abandon the idea of custom combinators and go back to the catchTC construct. (Which I'm not too thrilled about.)

Or am I missing something?

@JacquesCarette
Copy link
Contributor

I've been of the opinion for quite some time that things like _≟_ should be in their own modules -- explicitly because of dependency issues. Data.Nat.Properties pulls in a lot of stuff, legitimately, but one often needs some particular relations, like _≟_ without all that baggage. It was deemed too big a breaking change, even for stdlib-2.0. Sigh.

@uncle-betty
Copy link
Contributor Author

Oh, well! Luckily I just found other cycles, so now it's not just Data.Nat.Properties that causes me trouble! :)

≡-Reasoning from Relation.Binary.PropositionalEquality would also have to import Tactic.Cong for its combinators, which causes additional cycles via the reflection subsystem.

At this point, I think that combinators and reflection just don't mix well.

But let me take a step back. Maybe I took a wrong turn at an earlier point that led me into this dead-end.

The reason why my combinators use macros and reflection is so that there isn't any need to flip the goal for the macro when doing a backwards step. The cong! macro application is integrated into the combinator, so that the combinator for a backwards step can do, say, cong! (sym (+-comm m n)) instead of what the existing combinators do, sym (cong! (+-comm m n)).

Unfortunately, the hack that my proposal builds upon depends on the goal not getting flipped. Hence the need for custom combinators that avoid the need to flip the goal in a backwards step.

I'll keep pondering this over the next few days. At this point, the only viable solution seems to be catchTC, which seems super hacky.

@uncle-betty
Copy link
Contributor Author

Alright. Progress!

The combinators now support all reasoning modules that are based on Relation.Binary.Reasoning.Base.Single, [...].Double, and [...].Triple, in addition to ≡-Reasoning from Relation.Binary.PropositionalEquality.

I also renamed the combinators to ≡⟨! ... ⟩ and ≡⟨! ... ⟨.

The updated code is considerably more complex and brittle, though, than the older version that was based on catchTC and that didn't have the custom combinators. I hope that we aren't setting ourselves up for a maintenance nightmare.

The main insight is that I can figure out the relation to be used via reflection:

  • As I said earlier, Agda cannot figure out the R in {R : Rel A r} {y z : A} (yRz : R y z) based on the given yRz.
  • So, let's instead do this: {R : Set r} (yRz : R). And then use reflection to figure out what R is, by getting the type of yRz and looking at its name.
  • Once we have the name of R, we can map it to the corresponding step function. So, Cong.agda now contains a hard-coded list of which relation goes with which step function.
  • Previously, I was trying to pass the relation and step function from the individual ...-Reasoning modules into Tactic.Cong. Which caused the cycles. Now this knowledge is hard-coded in Tactic.Cong. Of course this means, that Tactic.Cong may need to be changed if any of the ...-Reasoning modules changes.
  • Modules like Relation.Binary.Reasoning.Base.Triple have a lot of parameters. So, how do I construct the complete parameter list for the step functions? I make the following assumptions.
    • The relation and the step function live in the same module.
    • When I strip the last two arguments off the relation's n arguments (e.g., the x and y off x ≡ y) and apply the step function to the remaning (n - 2) arguments, then the remaining arguments to the step function are {x} {y} {z} x≡y yRz.
    • Example: Suppose that the relation is _≡_ {0ℓ} {ℕ} x y. Stripping off x and y yields the argument list {0ℓ} {ℕ}. Thus the step function that goes with _≡_, trans, is expected to take arguments {0ℓ} {ℕ} {x} {y} {z} x≡y yRz.
  • Again, this might turn out to be brittle. Should the relationship between a relation's arguments and its step function's arguments ever change, Tactic.Cong will have to be changed.

I'm not quite sure what to make of all of this. The solution still feels a little hackish, because Tactic.Cong now:

  • Contains knowledge about other parts of stdlib, namely the mapping of relations to step functions.
  • Makes assumptions about how the parameters of relations and step functions relate.
  • Has gained quite a bit of complexity.

Maybe the quoteTC-based solution now doesn't look that bad, after all?

@uncle-betty
Copy link
Contributor Author

After a good night's sleep: Maybe I'm overthinking this. The modules on whose implementation details Tactic.Cong now depends don't seem to see that much change. So, maybe this won't turn into a maintenance nightmare.

On the other hand, I just checked - and, oh boy! The performance is now considerably lower:

README.Tactic.Cong.marker-example₁                    64ms 
README.Tactic.Cong.marker-example₂                    84ms 

Previously: 25 ms and 13 ms, respectively. So the combinators take ~3x and ~6x as much time as the quoteTC solution in this benchmark.

Which makes sense. The combinator approach delegates more responsibility from Agda's built-in type-checking to the macro. The combinators operate "on a larger hole" than cong!.

So, I'm a little torn. If the difference weren't that massive, I'd say: Sure, let's opt for the more principled approach via the combinators. But given that the performance difference is substantial, I'm not so sure any longer.

@uncle-betty
Copy link
Contributor Author

uncle-betty commented Mar 11, 2024

Alright. Another day, another suggestion. But this one's really cool, I think. I think that it marries the simplicity and robustness of the quoteTC approach to the combinator approach.

Idea: Instead of having cong!-specific combinators, have generic tactic combinators. Say, _≡⟪_⟫_ and _≡⟪_⟪_. They would differ from the existing forward and backward combinators in that they enrich a goal. So, a tactic used with these tactic combinators would operate on an enriched goal. The enrichment would communicate additional context to the tactic. For now, it would just be the direction of the combinator, forward or backward.

Let me sketch some code:

  data Direction : Set where
    forward : Direction
    backward : Direction

  data Goal {a : Level} (d : Direction) (A : Set a) : Set (sucℓ a) where
    proof : A → Goal d A

  makeGoal : ∀ {a} {A : Set a} (d : Direction) → Goal d A → A
  makeGoal _ (proof p) = p

  test : ∀ m n o p → m + n + (o + p) ≡ n + m + (p + o)
  test m n o p = begin
    ⌞ m + n ⌟ + (o + p) ≡⟨ makeGoal forward  (proof (cong (λ ϕ → ϕ + (o + p)) (+-comm m n))) ⟩
    n + m + ⌞ o + p ⌟   ≡⟨ makeGoal backward (proof (cong (λ ϕ → n + m + ϕ)   (+-comm p o))) ⟨
    n + m + (p + o)     ∎

The idea is to have a tactic operate on, say, Goal forward (⌞ m + n ⌟ + (o + p) ≡ n + m + ⌞ o + p ⌟) instead of just ⌞ m + n ⌟ + (o + p) ≡ n + m + ⌞ o + p ⌟. To this end, the forward combinator would apply makeGoal forward to the tactic's result. The backward combinator would apply makeGoal backward. So, the two tactic combinators would automate what I manually did above. The tactic would be responsible for providing the (proof ...) part.

From the enriched goal, the tactic would know which direction we're going and could act accordingly, if it is direction-sensitive.

In order to support the tactic combinators, existing tactics would have to:

  • Become able to break down an enriched goal.
  • Wrap their generated proof in proof.

Sorry about the back and forth. I thought that this pull request was in pretty good shape, but then I got nerd-sniped with the idea of having new combinators.

But I think that we might finally have gone from primitive, via complicated, to simple. (Story of my life.)

How does such a more generic tactic combinator framework sound? If this is a non-starter, then I'd suggest that we go back to the catchTC approach.

@uncle-betty
Copy link
Contributor Author

After playing around a little more, here's what I think: For the purpose of this pull request, let's leave it at the original tweak based on catchTC. If that doesn't clear the bar for stdlib, then that's perfectly fine. Then let's close this pull request.

To recap: The disadvantage of this approach is that when ⌞_⌟ is used with cong! in a backward step, then anti-unification is done twice, which results in lower performance of cong!. Other cases are not affected, e.g., using cong! without ⌞_⌟, or using cong! with ⌞_⌟ in a forward step.

My reasoning:

  • It's just a few dozen lines. Easy to undo, should we come up with a more principled approach. And while not perfect, I think that it provides pretty good value.
  • Custom combinators for cong! are trickier than I thought. I either ended up with import cycles, or I had to build the combinators on implementation details of other parts of stdlib, which was brittle and slow.
  • I still like the idea of generic tactic combinators and the idea of enriched goals. But that would change how tactics work in stdlib. That's quite a bit of an overhaul. If at all, then this should be done in a larger context, it should consider the needs of other existing and possible future tactics, and it should consider the use of tactics without combinators. It shouldn't be done in this pull request.

Copy link
Contributor

@MatthewDaggitt MatthewDaggitt left a comment

Choose a reason for hiding this comment

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

Thanks for thinking about this so thoroughly! I agree with all your analysis in the last few posts. In particular the enriched proof equality combinators sound like a nice idea, but we'd need to think about how easy they were to extend.

Having said that, yes the current PR seems a strict improvement over what we have at the moment so I think it should absolutely get merged in.

I've got two minor documentation changes to propose, but after that more than happy to hit merge!

@uncle-betty
Copy link
Contributor Author

Great! Thank you for the review. I made the changes. I'm excited that this is making it into stdlib!

@MatthewDaggitt
Copy link
Contributor

I'm excited that this is making it into stdlib!

Haha, I'm glad! We'd of course welcome any further similarly high-quality contributions you might be interested in making. 👍 I've hit merge, so it should be in in the next couple of hours.

@uncle-betty
Copy link
Contributor Author

Thank you for the encouragement!

(It looks like there still is an open change request, which prevents merging.)

@MatthewDaggitt MatthewDaggitt added this pull request to the merge queue Mar 18, 2024
@MatthewDaggitt
Copy link
Contributor

Whoops, approved.

Merged via the queue into agda:master with commit 098a65e Mar 18, 2024
1 check passed
@uncle-betty uncle-betty deleted the cong-tweak branch March 18, 2024 10:09
andreasabel pushed a commit that referenced this pull request Jul 10, 2024
* ⌞_⌟ for marking spots to rewrite.

* Added documentation.

* In case of failure, try swapping the RHS with the LHS. Fixes ≡˘⟨ ... ⟩.

* Added comments.

* More clarity. Less redundancy.

* Fixed performance regression.

* Changelog entry.

* cong!-specific combinators instead of catchTC.

* Support other reasoning modules.

* Clarifying comment.

* Slight performance boost.

* Go back to catchTC.

* Fix example after merge.

* Use renamed backward step.

* Language tweaks.

---------

Co-authored-by: MatthewDaggitt <[email protected]>
@andreasabel andreasabel mentioned this pull request Jul 24, 2024
github-merge-queue bot pushed a commit that referenced this pull request Sep 7, 2024
* Bump stdlib and agda version in installation guide (#2027)

* Simplify more `Data.Product` imports to `Data.Product.Base` (#2036)

* Simplify more `Data.Product` import to `Data.Product.Base`

* Simplify more `Data.Product` import to `Data.Product.Base`

* Indent

* Wrapping Comments & Fixing Code Delimiters (#2015)

* Add new pattern synonym `divides-refl` to `Data.Nat.Divisibility.Core`

* Simplify more `Relation.Binary` imports (#2034)

* Rename and deprecate `excluded-middle` (#2026)

* Simplified `String` imports (#2016)

* Change `Function.Definitions` to use strict inverses (#1156)

* Proofs `take/drop/head -map-commute` added to Data.List.Properties (#1986)

* Simplified `Vec` import (#2018)

* More `Data.Product` simplifications (#2039)

* Added Unnormalised Rational Field Structure (#1959)

* More simplifications for `Relation.Binary` imports (#2038)

* Move just a few more things over to new Function hierarchy. (#2044)

* Final `Data.Product` import simplifications (#2052)

* Added properties of Heyting Commutative Ring (#1968)

* Add more properties for `xor` (#2035)

* Additional lemmas about lists and vectors (#2020)

* Removed redundant `import`s from `Data.Bool.Base` (#2062)

* Tidying up `Data.String`  (#2061)

* More `Relation.Binary` simplifications (#2053)

* Add `drop-drop` in `Data.List.Properties` (#2043)

* Rename `push-function-into-if`

* agda-stdlib-utils/AllNonAsciiChars: use List1.head instead of List.head

* Bump resolvers in stack-{9.4.5,9.6.2}.yaml

* Bump Haskell CI to GHC 9.8.0 and 9.4.6; allow text-2.1

* Rename `take-drop-id` and `take++drop` (#2069)

A useful improvement to consistency of names,

* Add `find`, `findIndex`, and `findIndices` for `Data.List` (#2042)

* `find*` functions for `Data.List`

both decidable predicate and boolean function variants

* Back to `Maybe.map`

* New type for findIndices

* Add comments

* Respect style guide

---------

Co-authored-by: jamesmckinna <[email protected]>

* Final `Relation.Binary` simplifications (#2068)

* Spellchecked `CHANGELOG` (#2078)

* #2075: Remove symmetry assumption from lexicographic well-foundedness (#2077)

* Make sure RawRing defines rawRingWithoutOne (#1967)

* Direct products and minor fixes (#1909)

* Refine imports in `Reflection.AST` (#2072)

* Add some `_∷ʳ_` properties to `Data.Vec.Properties` (#2041)

* Monadic join (#2079)

* Move `≡-setoid` to `Function.Indexed.Relation.Binary.Equality` (#2047)

* Making (more) arguments implicit in lexicographic ordering lemmas

* `WellFounded` proofs for transitive closure (#2082)

* Add properties of Vector operations `reverse`, `_++_` and `fromList` (#2045)

* Rename `minor changes` section in CHANGELOG

* Improve implementation of `splitAt`, `take` and `drop` in `Data.List`. (#2056)

* Add a recursive view of `Fin n` (#1923)

* Use new style `Function` hierarchy everywhere. (#1895)

* Fix typo and whitespace violation (#2104)

* Add Kleene Algebra morphism with composition and identity construct (#1936)

* Added foldr of permutation of Commutative Monoid (#1944)

* Add `begin-irrefl` reasoning combinator (#1470)

* Refactor some lookup and truncation lemmas (#2101)

* Add style-guide note about local suffix (#2109)

* Weakened pre-conditions of grouped map lemmas (#2108)

* Undeprecate inspect idiom (#2107)

* Add some lemmas related to renamings and substitutions (#1750)

* Proof of the Binomial Theorem for `(Commutative)Semiring` [supersedes #1287] (#1928)

* Modernise `Relation.Nullary` code (#2110)

* Add new fixities (#2116)

Co-authored-by: Sofia El Boufi--Crouzet <[email protected]>

* Adds setoid export to `Algebra.Bundles.SemiringWithoutOne`

* #453: added `Dense` relations and `DenseLinearOrder` (#2111)

* Rectifies the negated equality symbol in `Data.Rational.Unnormalised.*` (#2118)

* Sync insert, remove, and update functionalities for `List` and `Vec` (#2049)

* De-symmetrising `Relation.Binary.Bundles.Preorder._∼_` (#2099)

* Redefines `Data.Nat.Base._≤″_` (#1948)

* Sync `iterate` and `replicate` for `List` and `Vec` (#2051)

* Changes explicit argument `y` to implicit in `Induction.WellFounded.WfRec` (#2084)

* Re-export numeric subclass instances

* Revert "Re-export numeric subclass instances"

This reverts commit 91fd951c117311b2beb2db4a582c4f152eac787d.

* Add (propositional) equational reasoning combinators for vectors (#2067)

* Strict and non-strict transitive property names (#2089)

* Re-export numeric subclass instances (#2122)

* Added Irreflexivity and Asymmetry of WellFounded Relations (#2119)

* Fix argument order of composition operators (#2121)

* Make size parameter on 'replicate' explicit (#2120)

* [fixes #2130] Moving `Properties.HeytingAlgebra` from `Relation.Binary` to `Relation.Binary.Lattice` (#2131)

* [fixes #2127] Fixes #1930 `import` bug (#2128)

* [fixes #1214] Add negated ordering relation symbols systematically to `Relation.Binary.*` (#2095)

* Refactoring (inversion) properties of `_<_` on `Nat`, plus consequences (#2000)

* Bump CI tests to Agda-2.6.4 (#2134)

* Remove `Algebra.Ordered` (#2133)

* [ fix ] missing name in LICENCE file (#2139)

* Add new blocking primitives to `Reflection.TCM` (#1972)

* Change definition of `IsStrictTotalOrder` (#2137)

* Add _<$>_ operator for Function bundle (#2144)

* [ fix #2086 ] new web deployment strategy (#2147)

* [ admin ] fix sorting logic (#2151)

With the previous script we were sorting entries of the form
html/vX.Y.Z/index.html but the order is such that vX.Y/ < vX.Y.Z/
and so we were ending up with v1.7 coming after v1.7.3.

This fixes that by using sed to get rid of the html/ prefix
and the /index.html suffix before the sorting phase.

* Add coincidence law to modules (#1898)

* Make reasoning modular by adding new `Reasoning.Syntax` module (#2152)

* Fixes typos identified in #2154 (#2158)

* tackles #2124 as regards `case_return_of_` (#2157)

* Rename preorder ~ relation reasoning combinators (#2156)

* Move ≡-Reasoning from Core to Properties and implement using syntax (#2159)

* Add consistent deprecation warnings to old function hierarchy (#2163)

* Rename symmetric reasoning combinators. Minimal set of changes (#2160)

* Restore 'return' as an alias for 'pure' (#2164)

* [ fix #2153 ] Properly re-export specialised combinators (#2161)

* Connect `LeftInverse` with (`Split`)`Surjection` (#2054)

* Added remaining flipped and negated relations to binary relation bundles (#2162)

* Tidy up CHANGELOG in preparation for release candidate (#2165)

* Spellcheck CHANGELOG (#2167)

* spellcheck; `fix-whitespace`; unfixed: a few alignment issues; typo `predications` to `predicates` in `Relation.Unary.Relation.Binary.Equality`

* Fixed Agda version typo in README (#2176)

* Fixed in deprecation warning for `<-transˡ` (#2173)

* Bump Haskell CI (original!) to latest minor GHC versions (#2187)

* [fixes #2175] Documentation misc. typos etc. for RC1  (#2183)

* missing comma!

* corrected reference to `README.Design.Decidability`

* typo: capitalisation

* updated `installation-guide`

* added word to `NonZero` section heading

* Run workflows on any PR

* Add merge-group trigger to workflows

---------

Co-authored-by: MatthewDaggitt <[email protected]>

* [fixes #2178] regularise and specify/systematise, the conventions for symbol usage (#2185)

* regularise and specify/systematise, the conventions for symbol usage

* typos/revisions

* Move `T?` to `Relation.Nullary.Decidable.Core` (#2189)

* Move `T?` to `Relation.Nullary.Decidable.Core`

* Var name fix

* Some refactoring

* Fix failing tests and address remaining comments

* Fix style-guide

* Make decidable versions of sublist functions the default (#2186)

* Make decdable versions of sublist functions the default

* Remove imports Bool.Properties

* Address comments

* [ fix #1743 ] move README to `doc/` directory (#2184)

* [ admin ] dev playground

* [ fix #1743 ] move README to doc/ directory

* [ fix ] whitespace violations

* [ ci ] update to cope with new doc/ directory

* [ cleanup ] remove stale reference to travis.yml

* [ admin ] update README-related instructions

* [ admin ] fix build badges

* [ fix ] `make test` build

* Moved contents of notes/ to doc/

* Added CHANGELOG entry

---------

Co-authored-by: MatthewDaggitt <[email protected]>

* documentation: fix link to `installation-guide`, `README.agda`, `README.md`... (#2197)

* fix link to `installation-guide`

* catching another reference to `notes/`

* note on instance brackets

* `HACKING` guide

* added Gurmeet Singh's changes

* [ fix ] links in README.md

---------

Co-authored-by: Guillaume Allais <[email protected]>

* easy deprecation; leftover from `v1.6` perhaps? (#2203)

* fix Connex comment (#2204)

Connex allows both relations to hold, so the old comment was wrong.

* Add `Function.Consequences.Setoid` (#2191)

* Add Function.Consequences.Setoid

* Fix comment

* Fix re-export bug

* Finally fixed bug I hope

* Removed rogue comment

* More tidying up

* Deprecating `Relation.Binary.PropositionalEquality.isPropositional` (#2205)

* deprecating `isPropositional`

* tighten `import`s

* bumped Agda version number in comment

* definition of `Irreducible` and `Rough`; refactoring of `Prime` and `Composite` cf. #2180 (#2181)

* definition of `Irreducible`; refactoring of `Prime` and `Composite`

* tidying up old cruft

* knock-on consequences: `Coprimality`

* considerable refactoring of `Primality`

* knock-on consequences: `Coprimality`

* refactoring: no appeal to `Data.Nat.Induction`

* refactoring: renamed `SmoothAt` and its constructor; added pattern synonym; proved `Decidable Irreducible`; misc. tweaks

* knock-on consequences: `Coprimality`

* refactoring: removed `NonZero` analysis; misc. tweaks

* knock-on consequences: `Coprimality`; tightened `import`s

* knock-on consequences: `Coprimality`; tightened `import`s

* refactoring: every number is `1-rough`

* knock-on consequences: `Coprimality`; use of smart constructor

* refactoring: every number is `0-rough`; streamlining; inverse to `prime`; documentation

* attempt to optimise for a nearly-common case pseudo-constructor

* fiddling now

* refactoring: better use of `primality` API

* `Rough` is bounded

* removed unnecessary implicits

* comment

* refactoring: comprehensive shift over to `NonTrivial` instances

* refactoring: oops!

* tidying up: removed infixes

* tidying up: restored `rough⇒≤`

* further refinements; added `NonTrivial` proofs

* tidying up

* moving definitions to `Data.Nat.Base`

* propagated changes; many more explicit s required?

* `NonTrivial` is `Recomputable`

* all instances of `NonTrivial` now irrelevant; weird to need `NonTrivial 2` explicitly

* tidying up `Coprimality`, eg with `variable`s

* `NonTrivial` is `Decidable`

* systematise proofs of `Decidable` properties via the `UpTo` predicates

* explicit quantifier now in `composite≢`

* Nathan's simplification

* interaction of `NonZero` and `NonTrivial` instances

* divisor now a record field; final lemmas: closure under divisibility; plus partial `CHANGELOG` entries

* '(non-)instances' become '(counter-)examples'

* stylistics

* removed `k` as a variable/parameter

* renamed fields and smart constructors

* moved smart constructors; made  a local definition

* tidying up

* refactoring per review comments: equivalence of `UpTo` predicates; making more things `private`

* tidying up: names congruent to ordering relation

* removed variable `k`; removed old proof in favour of new one with `NonZero` instance

* removed `recomputable` in favour of a private lemma

* regularised use of instance brackets

* made instances more explicit

* made instances more explicit

* blank line

* made `nonTrivial⇒nonZero` take an explicit argument in lieu of being able to make it an `instance`

* regularised use of instance brackets

* regularised use of instance brackets

* trimming

* tidied up `Coprimality` entries

* Make HasBoundedNonTrivialDivisor infix

* Make NonTrivial into a record to fix instance resolution bug

* Move HasNonTrivialDivisor to Divisibility.Core and hide UpTo lemmas

* Rearrange file to follow standard ordering of lemmas in the rest of the library

* Move UpTo predicates into decidability proofs

* No-op refactoring to curb excessively long lines

* Make a couple of names consistent with style-guide

* new definition of `Prime`

* renamed fundamental definition

* one last reference in `CHANGELOG`

* more better words; one fewer definition

* tidied up `Definitions` section; rejigged order of proofs of properties to reflect definitional order

* refactored proof of `prime⇒irreducible`

* finishing touches

* missing lemma from irrelevant instance list

* regularised final proof to use `contradiction`

* added fixity `infix 10`

* added fixity `infix 10`; made `composite` a pattern synonym; knock-on improvements

* comprehensive `CHNAGELOG` entry; whitespace fixes

* Rename 1<2+ to sz<ss

* Rename hasNonTrivialDivisor relation

* Updated CHANGELOG

---------

Co-authored-by: MatthewDaggitt <[email protected]>

* [fixes #2168] Change names in `Algebra.Consequences.*` to reflect `style-guide` conventions (#2206)

* fixes issue #2168

* added more names for deprecation, plus `hiding` them in `Propositional`

* Add biased versions of Function structures (#2210)

* Fixes #2166 by fixing names in `IsSemilattice` (#2211)

* Fix names in IsSemilattice

* Add reference to changes to Semilattice to CHANGELOG

* remove final references to `Category.*` (#2214)

* Fix #2195 by removing redundant zero from IsRing (#2209)

* Fix #2195 by removing redundant zero from IsRing

* Moved proofs eariler to IsSemiringWithoutOne

* Updated CHANGELOG

* Fix bug

* Refactored Properties.Ring

* Fix renaming

* Fix #2216 by making divisibility definitions records (#2217)

* Fix #2216 by making divisibility definitions records

* remove spurious/ambiguous `import`

---------

Co-authored-by: jamesmckinna <[email protected]>

* Fix deprecated modules (#2224)

* Fix deprecated modules

* [ ci ] Also build deprecated modules

* [ ci ] ignore user warnings in test

* [ ci ] fix filtering logic

Deprecation and safety are not the same thing

---------

Co-authored-by: Guillaume Allais <[email protected]>

* Final admin changes for v2.0 release (#2225)

* Final admin changes for v2.0 release

* Fix Agda versions

* Fix typo in raise deprecation message (#2226)

* Setup for v2.1 (#2227)

* Added tabulate+< (#2190)

* added tabulate+<

* renamed tabulate function

---------

Co-authored-by: Guilherme <[email protected]>
Co-authored-by: MatthewDaggitt <[email protected]>

* Added pointwise and catmaybe in Lists (#2222)

* added pointwise and catmaybe

* added pointwise to any

* added cat maybe all

* changed pointwise definition

* changed files name

* fixed changelogs and properties

* changed Any solution

* changed pointwise to catMaybe

---------

Co-authored-by: Guilherme <[email protected]>
Co-authored-by: MatthewDaggitt <[email protected]>

* [fixes #1711] Refactoring `Data.Nat.Divisibility` and `Data.Nat.DivMod` (#2182)

* added new definitions to `_∣_`

* `CHANGELOG`

* don't declare `quotient≢0` as an `instance`

* replace use of `subst` with one of `trans`

* what's sauce for the goose...

* switch to a `rewrite`-based solution...

* tightened `import`s

* simplified dependenciess

* simplified dependencies; `CHANGELOG`

* removed `module` abstractions

* delegated proof of `quotient≢0` to `Data.Nat.Properties`

* removed redundant property

* cosmetic review changes; others to follow

* better proof of `quotient>1`

* `where` clause layout

* leaving in the flipped equality; moved everything else

* new lemmas moved from `Core`; knock-on consequences; lots of tidying up

* tidying up; `CHANGELOG`

* cosmetic tweaks

* reverted to simple version

* problems with exporting `quotient`

* added last lemma: defining equation for `_/_`

* improved `CHANGELOG`

* revert: simplified imports

* improved `CHANGELOG`

* endpoint of simplifying the proof of `*-pres-∣`

* simplified the proof of `n/m≡quotient`

* simplified the proof of `∣m+n∣m⇒∣n`

* simplified the proof of `∣m∸n∣n⇒∣m`

* simplified `import`s

* simplified a lot of proofs, esp. wrt `divides-refl` and `NonZero` reasoning

* simplified more proofs, esp. wrt `divides-refl` reasoning

* simplified `import`s

* moved `equalityᵒ` proof out of `Core`

* `CHANGELOG`

* temporary fix: further `NonZero` refactoring advised!

* regularised use of instance brackets

* further instance simplification

* further streamlining

* tidied up `CHANGELOG`

* simplified `NonZero` pattern matching

* regularised use of instance brackets

* simplified proof of `/-*-interchange`

* simplified proof of `/-*-interchange`

* ... permitting the migration of `*-pres-∣` to `Data.Nat.Divisibility`

* tweaked proof of `/-*-interchange`

* narrowed `import`s

* simplified proof; renamed new proofs

* Capitalisation

* streamlined `import`s; streamlined proof of decidability

* spurious duplication after merge

* missing symbol import

* replaced one use of `1 < m` with `{{NonTrivial m}}`

* fixed `CHANGELOG`

* removed use of identifier `k`

* refactoring: more use of `NonTrivial` instances

* knock-on consequences: simplified function

* two new lemmas

* refactoring: use of `connex` in proofs

* new lemmas about `pred`

* new lemmas about monus

* refactoring: use of the new properties, simplifying pattern analysis

* whitespace

* questionable? revision after comments on #2221

* silly argument name typo; remove parens

* tidied up imports of `Relation.Nullary`

* removed spurious `instance`

* localised appeals to `Reasoning`

* further use of `variable`s

* tidied up `record` name in comment

* cosmetic

* reconciled implicit/explicit arguments in various monus lemmas

* fixed knock-on change re monus; reverted change to `m/n<m`

* reverted change to `m/n≢0⇒n≤m`

* reverted breaking changes involving `NonZero` inference

* revised `CHANGELOG`

* restored deleted proof

* fix whitespace

* renaming: `DivMod.nonZeroDivisor`

* localised use of `≤-Reasoning`

* reverted export; removed anonymous module

* revert commit re `yes/no`

* renamed flipped equality

* tweaked comment

* added alias for `equality`

* [fixes #2232] (#2233)

* fixes #2232

* corrected major version number

* Add `map` to `Data.String.Base` (#2208)

* add map to Data.String

* Add test for Data.String map

* CHANGELOG.md add map to list of new functions in Data.String.Base

* precise import of Data.String to avoid conflict on map

* Fix import statements

---------

Co-authored-by: lemastero <[email protected]>
Co-authored-by: MatthewDaggitt <[email protected]>

* fixes issue #2237 (#2238)

* fixes issue #2237

* leftover from #2182: subtle naming 'bug'/anomaly

* Bring back a convenient short-cut for infix Func (#2239)

* Bring back a convenient short-cut for infix Func

* change name as per suggestion from Matthew

* propagate use of shortcut to where it increases readability

* Revert "propagate use of shortcut to where it increases readability"

This reverts commit debfec19a0b6ad93cadce4e88f559790b287a316.

* Move definitions up. Fix comments.

* fixes #2234 (#2241)

* Update `HACKING` (#2242)

* added paragraph on coupled contributions

* typo

* Bring back shortcut [fix CHANGELOG] (#2246)

* Bring back a convenient short-cut for infix Func

* change name as per suggestion from Matthew

* propagate use of shortcut to where it increases readability

* Revert "propagate use of shortcut to where it increases readability"

This reverts commit debfec19a0b6ad93cadce4e88f559790b287a316.

* Move definitions up. Fix comments.

* fix CHANGELOG to report the correct syntax.

* fix toList-replicate's statement about vectors (#2261)

* Remove all external use of `less-than-or-equal` beyond `Data.Nat.*` (#2256)

* removed all external use of `less-than-or-equal` beyond `Data.Nat.*`

* use of `variable`s

* Raw modules bundles (#2263)

* Raw bundles for modules

* Export raw bundles from module bundles

* Update chnagelog

* Remove redundant field

* Reexport raw bundles, add raw bundles for zero

* Add missing reexports, raw bundles for direct product

* Raw bundles for tensor unit

* Update changelog again

* Remove unused open

* Fix typo

* Put a few more definitions in the fake record modules for RawModule and RawSemimodule

* Parametrize module morphisms by raw bundles (#2265)

* Index module morphisms by raw bundles

* Use synonyms for RawModule's RawBimodule etc

* Update changelog

* Update constructed morphisms

* Fix Algebra.Module.Morphism.ModuleHomomorphism

* add lemma (#2271)

* additions to `style-guide` (#2270)

* added stub content on programming idioms

* added para on qualified import names

* fixes issue #1688 (#2254)

* Systematise relational definitions at all arities (#2259)

* fixes #2091

* revised along the lines of @MatthewDaggitt's suggestions

---------

Co-authored-by: MatthewDaggitt <[email protected]>

* lemmas about semiring structure induced by `_× x` (#2272)

* tidying up proofs of, and using, semiring structure induced by `_× x`

* reinstated lemma about `0#`

* fixed name clash

* added companion lemma for `1#`

* new lemma, plus refactoring

* removed anonymous `module`

* don't inline use  of the lemma

* revised deprecation warning

* Qualified import of `Data.Nat` fixing #2280 (#2281)

* `Algebra.Properties.Semiring.Binomial`

* `Codata.Sized.Cowriter`

* `Data.Char.Properties`

* `Data.Difference*`

* `Data.Fin.*`

* `Data.Float.Properties`

* `Data.Graph.Acyclic`

* `Data.Integer.Divisibility`: still need to disambiguate `Divisibility`?

* `Data.List.Extrema.Nat`

* `Data.List.Relation.Binary.*`

* `Data.Nat.Binary.*`

* `Data.Rational.Base`

* `Data.String`

* `Data.Vec.*`

* `Data.Word`

* `Induction.Lexicographic`

* `Reflection.AST`

* `Tactic.*`

* `Text.*`

* Fix import in README.Data.Fin.Substitution.UntypedLambda (#2279)

Also import this module in doc/README.agda so that it is covered by CI.

Closes #2278.

* Qualified import of reasoning modules fixing #2280 (#2282)

* `Data.List.Relation.Relation.Binary.BagAndSetEquality`

* `Relation.Binary.Reasoning.*`

* preorder reasoning

* setoid reasoning

* alignment

* Qualified import of `Data.Product.Base` fixing #2280 (#2284)

* Qualified import of `Data.Product.Base as Product`

* more modules affected

* standardise use of `Properties` modules (#2283)

* missing code endquote (#2286)

* manual fix for #1380 (#2285)

* fixed `sized-types` error in orphan module (#2295)

* Qualified import of `PropositionalEquality` etc. fixing #2280 (#2293)

* Qualified import of `PropositionalEquality` fixing #2280

* Qualified import of `PropositionalEquality.Core` fixing #2280

* Qualified import of `HeterogeneousEquality.Core` fixing #2280

* simplified imports; fixed `README` link

* simplified imports

* Added functional vector permutation (#2066)

* added functional vector permutation

* added one line to CHANGELOG

* added permutation properties

* Added Base to imports

Co-authored-by: Nathan van Doorn <[email protected]>

* Added Base to import

Co-authored-by: Nathan van Doorn <[email protected]>

* Added core to import

Co-authored-by: Nathan van Doorn <[email protected]>

* added definitions

* removed unnecessary zs

* renamed types in changelog

* removed unnecessary code

* added more to changelog

* added end of changelog

---------

Co-authored-by: Nathan van Doorn <[email protected]>
Co-authored-by: Guilherme <[email protected]>

* Nagata's "idealization of a module" construction (#2244)

* Nagata's construction

* removed redundant `zero`

* first round of Jacques' review comments

* proved the additional properties

* some of Matthew's suggestions, plus more vertical whitespace, less horizontal; more comments

* Matthew's suggestion: using `private` modules

* Matthew's suggestion: lifting out left-/right- sublemmas

* standardised names, as far as possible

* Matthew's suggestion: lifting out left-/right- sublemmas

* fixed constraint problem with ambiguous symbol; renamed ideal lemmas

* renamed module

* renamed module in `CHANGELOG`

* added generalised annihilation lemma

* typos

* use correct rexported names

* now as a paramterised module instead

* or did you intend this?

* fix whitespace

* aligned one step of reasoning

* more re-alignment of reasoning steps

* more re-alignment of reasoning steps

* Matthew's review comments

* blanklines

* Qualified import of `Data.Sum.Base` fixing #2280 (#2290)

* Qualified import of `Data.Sum.Base as Sum`

* resolve merge conflict in favour of #2293

* [ new ] associativity of Appending (#2023)

* [ new ] associativity of Appending

* Removed unneeded variable

* Renamed Product module

---------

Co-authored-by: MatthewDaggitt <[email protected]>

* [ new ] symmetric core of a binary relation (#2071)

* [ new ] symmetric core of a binary relation

* [ fix ] name clashes

* [ more ] respond to McKinna's comments

* [ rename ] fields to lhs≤rhs and rhs≤lhs

* [ more ] incorporate parts of McKinna's review

* [ minor ] remove implicit argument application from transitive

* [ edit ] pull out isEquivalence and do some renaming

* [ minor ] respond to easy comments

* [ refactor ] remove IsProset, and move Proset to main hierarchy

* Eliminate Proset

* Fixed CHANGELOG typo

---------

Co-authored-by: MatthewDaggitt <[email protected]>

* refactored proofs from #2023 (#2301)

* Qualified imports in `Data.Integer.Divisibility` fixing #2280 (#2294)

* fixing #2280

* re-export constructor via pattern synonym

* updated `README`

* refactor: better disambiguation; added a note in `CHANGELOG`

* guideline for `-Reasoning` module imports (#2309)

* Function setoid is back. (#2240)

* Function setoid is back.

* make all changes asked for in review

* fix indentation

* Style guide: avoid `renaming` on qualified import cf. #2294 (#2308)

* recommendation from #2294

* spellcheck

* comma

---------

Co-authored-by: MatthewDaggitt <[email protected]>

* make `mkRawMonad` and `mkRawApplicative` universe-polymorphic (#2314)

* make `mkRawMonad` and `mkRawApplicative` universe-polymorphic

* fix unresolved metas

---------

Co-authored-by: Gan Shen <[email protected]>

* Some properties of upTo and downFrom (#2316)

* Some properties of upTo and downFrom

* Rename things per review comments

* Fix changelog typo

* Tidy up `README` imports #2280 (#2313)

* tidying up `README` imports

* address Matthew's review comments

* Add unique morphisms from/to `Initial` and `Terminal` algebras (#2296)

* added unique morphisms

* refactored for uniformity's sake

* exploit the uniformity

* add missing instances

* finish up, for now

* `CHANGELOG`

* `CHANGELOG`

* `TheMorphism`

* comment

* comment

* comment

* `The` to `Unique`

* lifted out istantiated `import`

* blank line

* note on instantiated `import`s

* parametrise on the `Raw` bundle

* parametrise on the `Raw` bundle

* Rerranged to get rid of lots of boilerplate

---------

Co-authored-by: MatthewDaggitt <[email protected]>

* Setoid version of indexed containers. (#1511)

* Setoid version of indexed containers.

Following the structure for non-indexed containers.

* An example for indexed containers: multi-sorted algebras.

This tests the new setoid version of indexed containers.

* Brought code up to date

* Added CHANGELOG entry

---------

Co-authored-by: MatthewDaggitt <[email protected]>

* 'No infinite descent' for (`Acc`essible elements of) `WellFounded` relations (#2126)

* basic result

* added missing lemma; is there a better name for this?

* renamed lemma

* final tidying up; `CHANGELOG`

* final tidying up

* missing `CHANGELOG` entry

* `InfiniteDescent` definition and proof

* revised `InfiniteDescent` definition and proof

* major revision: renames things, plus additional corollaries

* spacing

* added `NoSmallestCounterExample` principles for `Stable` predicates

* refactoring; move `Stable` to `Relation.Unary`

* refactoring; remove explicit definition of `CounterExample`

* refactoring; rename qualified `import`

* [fixes #2130] Moving `Properties.HeytingAlgebra` from `Relation.Binary` to `Relation.Binary.Lattice` (#2131)

* [fixes #2127] Fixes #1930 `import` bug (#2128)

* [fixes #1214] Add negated ordering relation symbols systematically to `Relation.Binary.*` (#2095)

* Refactoring (inversion) properties of `_<_` on `Nat`, plus consequences (#2000)

* Bump CI tests to Agda-2.6.4 (#2134)

* Remove `Algebra.Ordered` (#2133)

* [ fix ] missing name in LICENCE file (#2139)

* Add new blocking primitives to `Reflection.TCM` (#1972)

* Change definition of `IsStrictTotalOrder` (#2137)

* Add _<$>_ operator for Function bundle (#2144)

* [ fix #2086 ] new web deployment strategy (#2147)

* [ admin ] fix sorting logic (#2151)

With the previous script we were sorting entries of the form
html/vX.Y.Z/index.html but the order is such that vX.Y/ < vX.Y.Z/
and so we were ending up with v1.7 coming after v1.7.3.

This fixes that by using sed to get rid of the html/ prefix
and the /index.html suffix before the sorting phase.

* Add coincidence law to modules (#1898)

* Make reasoning modular by adding new `Reasoning.Syntax` module (#2152)

* Fixes typos identified in #2154 (#2158)

* tackles #2124 as regards `case_return_of_` (#2157)

* Rename preorder ~ relation reasoning combinators (#2156)

* Move ≡-Reasoning from Core to Properties and implement using syntax (#2159)

* Add consistent deprecation warnings to old function hierarchy (#2163)

* Rename symmetric reasoning combinators. Minimal set of changes (#2160)

* Restore 'return' as an alias for 'pure' (#2164)

* [ fix #2153 ] Properly re-export specialised combinators (#2161)

* Connect `LeftInverse` with (`Split`)`Surjection` (#2054)

* Added remaining flipped and negated relations to binary relation bundles (#2162)

* Tidy up CHANGELOG in preparation for release candidate (#2165)

* Spellcheck CHANGELOG (#2167)

* spellcheck; `fix-whitespace`; unfixed: a few alignment issues; typo `predications` to `predicates` in `Relation.Unary.Relation.Binary.Equality`

* Fixed Agda version typo in README (#2176)

* Fixed in deprecation warning for `<-transˡ` (#2173)

* Bump Haskell CI (original!) to latest minor GHC versions (#2187)

* [fixes #2175] Documentation misc. typos etc. for RC1  (#2183)

* missing comma!

* corrected reference to `README.Design.Decidability`

* typo: capitalisation

* updated `installation-guide`

* added word to `NonZero` section heading

* Run workflows on any PR

* Add merge-group trigger to workflows

---------

Co-authored-by: MatthewDaggitt <[email protected]>

* [fixes #2178] regularise and specify/systematise, the conventions for symbol usage (#2185)

* regularise and specify/systematise, the conventions for symbol usage

* typos/revisions

* Move `T?` to `Relation.Nullary.Decidable.Core` (#2189)

* Move `T?` to `Relation.Nullary.Decidable.Core`

* Var name fix

* Some refactoring

* Fix failing tests and address remaining comments

* Fix style-guide

* Make decidable versions of sublist functions the default (#2186)

* Make decdable versions of sublist functions the default

* Remove imports Bool.Properties

* Address comments

* new `CHANGELOG`

* resolved merge conflict

* resolved merge conflict, this time

* revised in line with review comments

* tweaked `export`s; does that fix things now?

* Fix merge mistake

* Refactored to remove a indirection and nested modules

* Touch up names

* Reintroduce anonymous module for descent

* cosmetics asper final comment

---------

Co-authored-by: MatthewDaggitt <[email protected]>
Co-authored-by: G. Allais <[email protected]>
Co-authored-by: Amélia <[email protected]>
Co-authored-by: Nathan van Doorn <[email protected]>
Co-authored-by: James Wood <[email protected]>
Co-authored-by: Andreas Abel <[email protected]>

* Add new operations (cf. `RawQuasigroup`) to `IsGroup` (#2251)

* added new operations to `IsGroup`

* fixed notations

* fixed `CHANGELOG`

* refactoring `Group` properties: added `isQuasigroup` and `isLoop`

* refactoring `*-helper` lemmas

* fixed `CHANGELOG`

* lemma relating quasigroup operations and `Commutative` property

* simplified proof

* added converse property to \¬Algebra.Properties.AbelianGroup`

* moved lemma

* indentation; congruence lemmas

* untangled operation definitions

* untangled operation definitions in `CHANGELOG`

* fixed names

* reflexive reasoning; tightened imports

* refactoring to push properties into `Loop`, and re-export them from there and `Quasigroup`

* further refactoring

* final refactoring

* Minor naming tweaks

---------

Co-authored-by: MatthewDaggitt <[email protected]>

* Add prime factorization and its properties (#1969)

* Add prime factorization and its properties

* Add missing header comment

I'd missed this when copy-pasting from my old code in a separate repo

* Remove completely trivial lemma

* Use equational reasoning in quotient|n proof

* Fix typo in module header

* Factorization => Factorisation

* Use Nat lemma in extend-|/

* [ cleanup ] part of the proof

* [ cleanup ] finishing up the job

* [ cleanup ] a little bit more

* [ cleanup ] the import list

* [ fix ] header style

* [ fix ] broken merge: missing import

* Move Data.Nat.Rough to Data.Nat.Primality.Rough

* Rename productPreserves↭⇒≡ to product-↭

* Use proof of Prime=>NonZero

* Open reasoning once in factoriseRec

* Rename Factorisation => PrimeFactorisation

* Move wheres around

* Tidy up Rough a bit

* Move quotient|n to top of file

* Replace factorisationPullToFront with slightly more generally useful factorisationHasAllPrimeFactors and a bit of logic

* Fix import after merge

* Clean up proof of 2-rough-n

* Make argument to 2-rough-n implicit

* Rename 2-rough-n to 2-rough

* Complete merge, rewrite factorisation logic a bit

Rewrite partially based on suggestions from James McKinna

* Short circuit when candidate is greater than square root of product

* Remove redefined lemma

* Minor simplifications

* Remove private pattern synonyms

* Change name of lemma

* Typo

* Remove using list from import

It feels like we're importing half the module anyway

* Clean up proof

* Fixes after merge

* Addressed some feedback

* Fix previous merge

---------

Co-authored-by: Guillaume Allais <[email protected]>
Co-authored-by: MatthewDaggitt <[email protected]>

* Refactor `Data.List.Relation.Binary.BagAndSetEquality` (#2321)

* easy refactorings for better abstraction

* tweaking irrefutable `with`

* Tidy up functional vector permutation #2066 (#2312)

* added structure and bundle; tidied up

* added structure and bundle; tidied up

* fix order of entries

* blank line

* standardise `variable` names

* alignment

* A tweak for the cong! tactic (#2310)

* ⌞_⌟ for marking spots to rewrite.

* Added documentation.

* In case of failure, try swapping the RHS with the LHS. Fixes ≡˘⟨ ... ⟩.

* Added comments.

* More clarity. Less redundancy.

* Fixed performance regression.

* Changelog entry.

* cong!-specific combinators instead of catchTC.

* Support other reasoning modules.

* Clarifying comment.

* Slight performance boost.

* Go back to catchTC.

* Fix example after merge.

* Use renamed backward step.

* Language tweaks.

---------

Co-authored-by: MatthewDaggitt <[email protected]>

* Simplify `Data.List.Relation.Unary.Any.Properties`: remove dependency on `List.Properties` (#2323)

* simplifed proof; removed dependency on `List.Properties`

* corrected module long name in comment

* Refactor `Data.Integer.Divisibility.Signed` (#2307)

* removed extra space

* refactor to introduce new `Data.Integer.Properties`

* refactor proofs to use new properties; streamline reasoning

* remove final blank line

* first review comment: missing annotation

* removed two new lemmas: `i*j≢0⇒i≢0` and `i*j≢0⇒j≢0`

* Sublists: generalize disjoint-union-is-cospan to upper-bound-is-cospan (#2320)

* Sublists: generalize disjoint-union-is-cospan to upper-bound-is-cospan

The disjointness assumption is superfluous.

* Move sublist cospan stuff to new module SubList.Propositional.Slice

* CHANGELOG

* Include CHANGELOG in fix-whitespace and whitespace fixes (#2325)

* Fix standard-library.agda-lib (#2326)

* Predicate transformers: Reconciling `Induction.RecStruct` with `Relation.Unary.PredicateTransformer.PT` (#2140)

* reconciling `Induction.RecStruct` with `Relation.Unary.PredicateTransformer.PT`

* relaxing `PredicateTransformer` levels

* `CHANGELOG`; `fix-whitespace`

* added `variable`s; plus tweaked comments`

* restored `FreeMonad`

* restored `Predicate`

* removed linebreaks

* Github action to check for whitespace violations (#2328)

Co-authored-by: MatthewDaggitt <[email protected]>

* [refactor] Relation.Nulllary.Decidable.Core (#2329)

* minor refactor: use Data.Unit.Polymorphic instead of an explicit Lift.

* additional tweak: use contradiction where possible.

* Some design documentation (here: level polymorphism) (#2322)

* add some design documentation corresponding to issue #312. (Redo of bad 957)

* more documentation about LevelPolymorphism

* more documentation precision

* document issues wrt Relation.Unary, both in design doc and in file itself.

* mark variables private in Data.Container.FreeMonad (#2332)

* Move pointwise equality to `.Core` module (#2335)

* Closes #2331.

Also makes a few changes of imports that are related. Many of the places
which look like this improvement might also help use other things from
`Relation.Binary.PropositionalEquality` that should *not* be moved to `.Core`.
(But it might make sense to split them off into their own lighter weight module.)

* don't import Data.Nullary itself since its sub-modules were already imported, just redistribute the using properly.

* fix warning: it was pointing to a record that did not exist. (#2344)

* Tighten imports some more (#2343)

* no need to use Function when only import is from Function.Base

* Use Function.Base when it suffices

* use Data.Product.Base as much as possible. Make imports more precise in many of the files touched. Split an example off into a README instead of using more imports just for its sake.

* more tightening of imports.

* a few more tightening imports

* Tighten imports (#2334)

* tighten imports in some files, and make imports explicit in others. Driven by staring at a partial dependency graph.

* more tightening of imports

* and even more tightening of imports

* some explicit  for precision

---------

Co-authored-by: G. Allais <[email protected]>

* [fixes #2273] Add `SuccessorSet` and associated boilerplate (#2277)

* added `RawNNO`

* [fix #2273] Add `NNO`-related modules

* start again, fail better...

* rectify names

* tighten `import`s

* rectify names: `CHANGELOG`

---------

Co-authored-by: MatthewDaggitt <[email protected]>

* Tighten imports, last big versoin (#2347)

* more tightening of imports. Mostly driven by Data.Bool, Data.Nat and Data.Char.

* more tightening of imports

* mostly Data.Unit

* slightly tighten imports.

* remove import of unused Lift)

* fix all 3 things noticed by @jamesmckinna

* Systematise use of `Relation.Binary.Definitions.DecidableEquality` (#2354)

* systematic use of `DecidableEquality`

* tweak

* Added missing v1.7.3 CHANGELOG (#2356)

* Improve `Data.List.Base.mapMaybe` (#2359; deprecate use of `with` #2123) (#2361)

* `with`-free definitions plus tests

* `CHANGELOG`

* use `foldr` on @JacquesCarette 's solution

* tidied up unsolved metas

* factrored out comparison as removable module `MapMaybeTest`

* tidied up; removed `mapMaybeTest`

* tidied up; removed v2.1 deprecation section

* tidy up long line

* Update src/Data/List/Base.agda

Co-authored-by: G. Allais <[email protected]>

* @gallais 's comments

* Update src/Data/List/Base.agda

Oops!

Co-authored-by: G. Allais <[email protected]>

---------

Co-authored-by: G. Allais <[email protected]>

* Add a consequence of definition straight to IsCancellativeCommutativeSemiring (#2370)

* Closes #2315

* whitespace

* [ new ] System.Random bindings (#2368)

* [ new ] System.Random bindings

* [ more ] Show functions, test

* [ fix ] Nat bug, more random generators, test case

* [ fix ] missing file + local gitignore

* [ fix ] forgot to update the CHANGELOG

* Another tweak to cong! (#2340)

* Disallow meta variables in goals - they break anti-unification.

* Postpone checking for metas.

* CHANGELOG entry, unit tests, code tweak.

* Move blockOnMetas to a new Reflection.TCM.Utilities module.

* Improve `Data.List.Base.unfold` (#2359; deprecate use of `with` #2123) (#2364)

* `with`-free definition of `unfold`

* fixed previous commit

* fix #2253 (#2357)

* Remove uses of `Data.Nat.Solver` from a number of places (#2337)

* tighten imports in some files, and make imports explicit in others. Driven by staring at a partial dependency graph.

* more tightening of imports

* and even more tightening of imports

* some explicit  for precision

* new Nat Lemmas to use instead of Solve in Data.Integer.Properties

* use direct proofs instead of solver for all Nat proofs in these files

* two more uses of Data.Nat.Solver for rather simple proofs, now made direct.

* fix whitespace violations

* remove some unneeded parens

* minor fixups based on review

* Relation.Binary.PropositionalEquality over-use, (#2345)

* Relation.Binary.PropositionalEquality over-use, can usually be .Core and/or .Properties

* unused import

* another large batch of dependency cleanup, mostly cenetered on Relation.Binary.PropositionalEquality.

* another big batch of making imports more precise.

* last big batch. After this will come some tweaks based on reviews.

* fix things pointed out in review; add CHANGELOG.

* Update DecPropositional.agda

Bad merge

* proper merge

* [ new ] IO buffering, and loops (#2367)

* [ new ] IO conditionals & loops

* [ new ] stdin, stdout, stderr, buffering, etc.

* [ fix ] and test for the new IO primitives

* [ fix ] compilation

* [ fix ] more import fixing

* [ done (?) ] with compilation fixes

* [ test ] add test to runner

* [ doc ] explain the loop

* [ compat ] add deprecated stub

* [ fix ] my silly mistake

* [ doc ] list re-exports in CHANGELOG

* [ cleanup ] imports in the Effect.Monad modules (#2371)

* Add proofs to Data.List.Properties (#2355)

* Add map commutation with other operations

map commutes with most list operations in some way,
and I initially made a section just for these proofs,
but later decided to spread them into each section
for consistency.

* Add congruence to operations that miss it

* Add flip & comm proofs to align[With] & [un]zip[With]

For the case of zipWith, the existing comm proof
can be provided in terms of cong and flip.

For the case of unzip[With], the comm proof has
little use and the flip proof is better named "swap".

* Remove unbound parameter

The alignWith section begins with a
module _ {f g : These A B → C} where
but g is only used by the first function.

* Add properties for take

* Proof of zip[With] and unzip[With] being inverses

* fixup! don't put list parameters in modules

* fixup! typo in changelog entry

* fixup! use equational reasoning in place of trans

* Add interaction with ++ in two more operations

* fixup! foldl-cong: don't take d ≡ e

* prove properties about catMaybes

now that catMaybes is no longer defined in
terms of mapMaybe, properties about mapMaybe
need to be proven for catMaybe as well

* move mapMaybe properties down

see next commit (given that mapMaybe-concatMap
now depends on map-concatMap, it has to be
moved down)

* simplify mapMaybe proofs

since mapMaybe is now defined in terms
of catMaybes and map, we can derive its
proofs from the proofs of those rather
than using induction directly

---------

Co-authored-by: MatthewDaggitt <[email protected]>

* Improve `Data.List.Base` (fix #2359; deprecate use of `with` #2123) (#2365)

* refactor towards `if_then_else_` and away from `yes`/`no`

* reverted chnages to `derun` proofs

* undo last reversion!

* layout

* A number of `with` are not really needed (#2363)

* a number of 'with' are not really needed. Many, many more were, so left as is.

* whitespace

* deal with a few outstanding comments.

* actually re-introduce a 'with' as it is actually clearer.

* with fits better here too.

* tweak things a little from review by James.

* Update src/Codata/Sized/Cowriter.agda

layout for readability

Co-authored-by: G. Allais <[email protected]>

* Update src/Data/Fin/Base.agda

layout for readability

Co-authored-by: G. Allais <[email protected]>

* Update src/Data/List/Fresh/Relation/Unary/All.agda

layout for readability

Co-authored-by: G. Allais <[email protected]>

---------

Co-authored-by: G. Allais <[email protected]>

* [ new ] ⁻¹-anti-homo-(// | \\) (#2349)

* [ new ] ¹-anti-homo‿-

* Update CHANGELOG.md

Co-authored-by: Nathan van Doorn <[email protected]>

* Update src/Algebra/Properties/Group.agda

Co-authored-by: jamesmckinna <[email protected]>

* Update CHANGELOG.md

Co-authored-by: jamesmckinna <[email protected]>

* [ more ] symmetric lemma

* [ new ] ⁻¹-anti-homo‿- : (x - y) ⁻¹ ≈ y - x

---------

Co-authored-by: MatthewDaggitt <[email protected]>
Co-authored-by: Nathan van Doorn <[email protected]>
Co-authored-by: jamesmckinna <[email protected]>

* Add `_>>_` for `IO.Primitive.Core` (#2374)

This has to be in scope for desugaring `do` blocks that don't bind
intermediate results.

* refactored to lift out `isEquivalence` (#2382)

* `Data.List.Base.reverse` is self adjoint wrt `Data.List.Relation.Binary.Subset.Setoid._⊆_` (#2378)

* `reverse` is `SelfInverse`

* use `Injective` for `reverse-injective`

* fixes #2353

* combinatory form

* removed redundant implicits

* added comment on unit/counit of the adjunction

* fixes #2375 (#2377)

* fixes #2375

* removed redundant `Membership` instances

* fix merge conflict error

* Add `Data.List.Relation.Binary.Sublist.Setoid` categorical properties (#2385)

* refactor: `variable` declarations and `contradiction`

* refactor: one more `contradiction`

* left- and right-unit lemmas

* left- and right-unit lemmas

* `CHANGELOG`

* `CHANGELOG`

* associativity; fixes #816

* Use cong2 to save rewrites

* Make splits for ⊆-assoc exact, simplifying the [] case

* Simplify ⊆-assoc not using rewrite

* Remove now unused private helper

* fix up names and `assoc` orientation; misc. cleanup

* new proofs can now move upwards

* delegate proofs to `Setoid.Properties`

---------

Co-authored-by: Andreas Abel <[email protected]>

* Pointwise `Algebra` (#2381)

* Pointwise `Algebra`

* temporary commit

* better `CHANGELOG` entry?

* begin removing redundant `module` implementation

* finish removing redundant `module` implementation

* make `liftRel` implicitly quantified

* Algebra fixity (#2386)

* put the fixity recommendations into the style guide

* mixing fixity declaration

* was missing a case

* use the new case

* add fixities for everything in Algebra

* incorporate some suggestions for extra cases

* Decidable Setoid -> Apartness Relation and Rational Heyting Field (#2194)

* new stuff

* forgot to add bundles for rational instance of Heyting*

* one more (obvious) simplification

* a few more simplifications

* comments on DecSetoid properties from jamesmckinna

* not working, but partially there

* woo!

* fix anonymous instance

* fix errant whitespace

* `fix-whitespace`

* rectified wrt `contradiction`

* rectified `DecSetoid` properties

* rectified `Group` properties

* inlined lemma; tidied up

---------

Co-authored-by: jamesmckinna <[email protected]>
Co-authored-by: James McKinna <[email protected]>

* CI bumps: ghc 9.10, action versions, Agda to 2.6.4.3 (#2398)

* Haskell CI (for GenerateEverything) and dependencies bumped to GHC 9.10.1

* CI: bump some versions, satisfy some shellcheck complaints

* Refactor `Data.List.Base.scan*` and their properties (#2395)

* refactor `scanr` etc.

* restore `inits` etc. but lazier; plus knock-on consequences

* more refactoring; plus knock-on consequences

* tidy up

* refactored into `Base`

* ... and `Properties`

* fix-up `inits` and `tails`

* fix up `import`s

* knock-ons

* Andreas's suggestions

* further, better, refactoring is possible

* yet further, better, refactoring is possible: remove explicit equational reasoning!

* Update CHANGELOG.md

Fix deprecated names

* Update Base.agda

Fix deprecations

* Update Properties.agda

Fix deprecations

* Update CHANGELOG.md

Fix deprecated names

* fixes #2390 (#2392)

* Add the `Setoid`-based `Monoid` on `(List, [], _++_)` (#2393)

* refactored from #2350

* enriched the `module` contents in response to review comments

* Lists: decidability of Subset+Disjoint relations (#2399)

* fixes #906 (#2401)

* More list properties about `catMaybes/mapMaybe` (#2389)

* More list properties about `catMaybes/mapMaybe`

- Follow-up to PR #2361
- Ported from my [formal-prelude](https://github.com/omelkonian/formal-prelude/tree/c10fe94876a7378088f2e4cf68d9b18858dcc256)

* Revert irrefutable `with`s for inductive hypotheses.

* Very dependent map (#2373)

* add some 'very dependent' maps to Data.Product. More documentation to come later.

* and document

* make imports more precise

* minimal properties of very-dependen map and zipWith. Structured to make it easy to add more.

* whitespace

* implement new names and suggestions about using pattern-matching in the type

* whitespace in CHANGELOG

* small cleanup based on latest round of comments

* and fix the names in the comments too.

---------

Co-authored-by: jamesmckinna <[email protected]>

* Improve `Data.List.Base` (fix #2359; deprecate use of with #2123) (#2366)

* refactor towards `if_then_else_`

* layout

* `let` into `where`

* Adds `Relation.Nullary.Recomputable` plus consequences (#2243)

* prototype for fixing #2199

* delegate to `Relation.Nullary.Negation.Core.weak-contradiction`

* refactoring: lift out `Recomputable` in its own right

* forgot to add this module

* refactoring: tweak

* tidying up; added `CHANGELOG`

* more tidying up

* streamlined `import`s

* removed `Recomputable` from `Relation.Nullary`

* fixed multiple definitions in `Relation.Unary`

* reorder `CHANGELOG` entries after merge

* `contradiciton` via `weak-contradiction`

* irrefutable `with`

* use `of`

* only use *irrelevant* `⊥-elim-irr`

* tightened `import`s

* removed `irr-contradiction`

* inspired by #2329

* conjecture: all uses of `contradiction` can be made weak

* second thoughts: reverted last round of chnages

* lazier pattern analysis cf. #2055

* dependencies: uncoupled from `Recomputable`

* moved `⊥` and `¬ A` properties to this one place

* removed `contradictionᵒ` and rephrased everything in terms of `weak-contradiction`

* knock-on consequences; simplified `import`s

* narrow `import`s

* narrow `import`s; irrefutable `with`

* narrow `import`s; `CHANGELOG`

* narrow `import`s

* response to review comments

* irrelevance of `recompute`

* knock-on, plus proof of `UIP` from #2149

* knock-ons from renaming

* knock-on from renaming

* pushed proof `recompute-constant` to `Recomputable`

* Refactor `List.Membership.*` and `List.Relation.Unary.Any` (#2324)

* `contradiction` against `⊥-elim`

* tightened `import`s

* added two operations `∃∈` and `∀∈`

* added to `CHANGELOG`

* knock-on for the `Propositional` case

* refactor `lose∘find` and `find∘lose` in terms of new lemmas `∃∈-Any∘find` and `find∘∃∈-Any`

* `CHANGELOG`

* reorder

* knock-on viscosity

* knock-on viscosity; plus refactoring of `×↔` for intelligibility

* knock-on viscosity

* tightened `import`s

* misc. import and other tweaks

* misc. import and other tweaks

* misc. import and other tweaks

* removed spurious module name

* better definition of `find`

* make intermediate terms explicit in proof of `to∘from`

* tweaks

* Update Setoid.agda

Remove redundant import of `index` from `Any`

* Update Setoid.agda

Removed more redundant `import`ed operations

* Update Properties.agda

Another redundant `import`

* Update Properties.agda

Another redundant `import`ed operation

* `with` into `let`

* `with` into `let`

* `with` into `let`

* `with` into `let`

* indentation

* fix `universal-U`

* added `map-cong`

* deprecate `map-compose` in favour of `map-∘`

* explicit `let` in statement of `find∘map`

* knock-on viscosity: hide `map-cong`

* use of `Product.map₁`

* revert use of `Product.map₁`

* inlined lemmas!

* alpha conversion and further inlining!

* correctted use of `Product.map₂`

* added `syntax` declarations for the new combinators

* remove`⊥-elim`

* reordered `CHANGELOG`

* revise combinator names

* tighten `import`s

* tighten `import`s

* fixed merge conflict bug

* removed new syntax

* knock-on

* Port two Endomorphism submodules over to new Function hierarchy (#2342)

* port over two modules

* and add to CHANGELOG

* fix whitespace

* fix warning: it was pointing to a record that did not exist.

* fix things as per Matthew's review - though this remains a breaking change.

* take care of comments from James.

* adjust CHANGELOG for what will be implemented shortly

* Revert "take care of comments from James."

This reverts commit 93e9e0fdf482164c0fb7e709ef8799fbc3fa0385.

* Revert "fix things as per Matthew's review - though this remains a breaking change."

This reverts commit d1cae72dcb3b44d4ba3c7290f3535544be32ab1e.

* Revert "fix whitespace"

This reverts commit 81230ecf0c8ff634433c9d17d53c9d2e8b3c1fd2.

* Revert "port over two modules"

This reverts commit 6619f114346e86ead3cf62b1170ab23d31056b48.

* rename these

* fix tiny merge issue

* get deprecations right (remove where not needed, make more global where needed)

* style guide - missing blank lines

* fix a bad merge

* fixed deprecations

* fix #2394

* minor tweaks

---------

Co-authored-by: James McKinna <[email protected]>

* Add `IsIdempotentMonoid` and `IsCommutativeBand` to `Algebra.Structures` (#2402)

* fix #2138

* fixed `Structures`; added `Bundles`

* added fields; plus redefined `IsSemilattice` and `IsBoundedSemilattice` as aliases

* `fix-whitespace`

* reexported `comm`

* fixed `Lattice.Bundles`

* knock-on

* added text about redefinition of `Is(Bounded)Semilattice`

* add manifest fields to `IsIdempotentSemiring`

* final missing `Bundles`

* `CHANGELOG`

* [ new ] Word8, Bytestring, Bytestring builder (#2376)

* [ admin ] deprecate Word -> Word64

* [ new ] a type of bytes

* [ new ] Bytestrings and builders

* [ test ] for bytestrings, builders, word conversion, show, etc.

* [ ci ] bump ghc & cabal numbers

* [ fix ] actually set the bits ya weapon

* [ ci ] bump options to match makefile

* [ ci ] more heap

* [ more ] add hexadecimal show functions too

* Update LICENSE (#2409)

* Update LICENSE year

* Remove extraneous 'i'

---------

Co-authored-by: Lex van der Stoep <[email protected]>

* Remove (almost!) all external use of `_≤″_` beyond `Data.Nat.*` (#2262)

* additional proofs and patterns in `Data.Nat.Properties`

* added two projections; refactored `pad*` operations

* `CHANGELOG`

* removed one more use

* removed final uses of `<″-offset` outside `Data.Nat.Base|Properties`

* rename `≤-proof` to `m≤n⇒∃[o]m+o≡n`

* removed new pattern synonyms

* interim commit: deprecate everything!

* add guarded monus; make arguments more irrelevant

* fixed up `CHANGELOG`

* propagate use of irrelevance

* tidy up deprecations; reinstate `s<″s⁻¹` for `Data.Fin.Properties`

* tightened up the deprecation story

* paragraph on use of `pattern` synonyms

* removed `import`

* Update CHANGELOG.md

Fix refs to Algebra.Definitions.RawMagma

* Update Base.agda

Fix refs. to Algebra.Definitions.RawMagma

* inlined guarded monus definition in property

* remove comment about guarded monus

* Refactor `Data.Sum.{to|from}Dec` via move+deprecate in `Relation.Nullary.Decidable.Core` (#2405)

* fixes #2059 on the model of #2336

* fixed `import` dependencies

* simplified `import` dependencies

* final tweak

* `CHANGELOG`

* Implement move-via-deprecate of `decToMaybe` as per #2330 (#2336)

* Make the main home of `decToMaybe` be `Relation.Nullary.Decidable.Core`, but
deprecate the one in `Data.Maybe.Base` instead of removing it entirely.
Fix the library accordingly.

Note that this forces `Relation.Nullary.Decidable.Core` to use `Agda.Builtin.Maybe`
to avoid a cyclic import. This can be fixed once the deprecation is done.

* Update src/Relation/Nullary/Decidable/Core.agda

Good idea.

Co-authored-by: G. Allais <[email protected]>

* simplified the deprecation

* `CHANGELOG`

* narrowed import too far

* tweak a couple of the solvers for consistency, as per suggestions.

* chnage to `public` re-export of `Relation.Nullary.Decidable.Core.decToMaybe`

* Revert "chnage to `public` re-export of `Relation.Nullary.Decidable.Core.decToMaybe`"

This reverts commit 256a50589dacab913c69f4db5b4570b46cf440d7.

* `fix-whitespace`

* simplify `import`s

* make consistent with `Idempotent` case

* tidy up

* instead of an alias, open public so that Agda knows these really are the same. This is a better deprecation strategy.

* rename(provisional)+deprecate

* knock-on

* knock-on: refactor via `dec⇒maybe`

* deprecation via delegation

* fix `CHANGELOG`

---------

Co-authored-by: G. Allais <[email protected]>
Co-authored-by: James McKinna <[email protected]>
Co-authored-by: jamesmckinna <[email protected]>

* fixes #2411 (#2413)

* fixes #2411

* now via local -defined auxiliaries

* Tidy up CHANGELOG in preparation for v2.1 release candidate (#2412)

* Tidy up CHANGELOG in preparation for v2.1 release candidate

* Fixed WHITESPACE

* Fixed James' feedback and improved alphabetical order

* [v2.1-rc1] fixes #2400: use explicit quantification instead (#2429)

* fixes #2400: use explicit quantification

* fix knock-ons

* Revert "Improve `Data.List.Base` (fix #2359; deprecate use of `with` #2123) (#2365)" (#2423)

This reverts commit 438f9ed4c30751be35718297bbe0c8ec7d3fb669.

Specifically, it restores `with`-based definitions of the
`Decidable`-definable functions on `List`s, incl. `filter`
Fixes #2415

* implicit to explicit in `liftRel` (#2433)

* fix changelog (#2435)

couple fixes for changelog rendering

* Export missing IsDecEquivalence instance for Quantity from Reflection.AST.Instances

* Add missing `showQuantity` function to Reflection.AST.Show

* Compatibility with Agda PR #7322: add quantity to reflected syntax of constructor

* Bump CI for experimental to latest Agda master

* Final admin changes

* Added v2.1.1 CHANGELOG entry

* Fix #2462 by removing duplicate infix definition

* Updated remaining documentation for v2.1.1 release

* Update CHANGELOG.md typo

* Update CHANGELOG.md

* Update installation-guide.md

* Update src/Reflection/AST/Definition.agda

Fix typo

* Update CITATION.cff

bring the date forward to today

---------

Co-authored-by: Saransh Chopra <[email protected]>
Co-authored-by: Maximilien Tirard <[email protected]>
Co-authored-by: jamesmckinna <[email protected]>
Co-authored-by: Sofia El Boufi--Crouzet <[email protected]>
Co-authored-by: Alex Rice <[email protected]>
Co-authored-by: Guilherme Silva <[email protected]>
Co-authored-by: Jacques Carette <[email protected]>
Co-authored-by: Ambroise <[email protected]>
Co-authored-by: Andreas Abel <[email protected]>
Co-authored-by: Nathan van Doorn <[email protected]>
Co-authored-by: Akshobhya K M <[email protected]>
Co-authored-by: shuhung <[email protected]>
Co-authored-by: fredins <[email protected]>
Co-authored-by: Nils Anders Danielsson <[email protected]>
Co-authored-by: Ioannis Markakis <[email protected]>
Co-authored-by: G. Allais <[email protected]>
Co-authored-by: Amélia <[email protected]>
Co-authored-by: James Wood <[email protected]>
Co-authored-by: Jesin <[email protected]>
Co-authored-by: jamesmckinna <[email protected]>
Co-authored-by: Guilherme <[email protected]>
Co-authored-by: Piotr Paradziński <[email protected]>
Co-authored-by: lemastero <[email protected]>
Co-authored-by: Gan Shen <[email protected]>
Co-authored-by: Gan Shen <[email protected]>
Co-authored-by: Uncle Betty <[email protected]>
Co-authored-by: Chris <[email protected]>
Co-authored-by: Alba Mendez <[email protected]>
Co-authored-by: Naïm Favier <[email protected]>
Co-authored-by: Orestis Melkonian <[email protected]>
Co-authored-by: Lex van der Stoep <[email protected]>
Co-authored-by: Lex van der Stoep <[email protected]>
Co-authored-by: Jesper Cockx <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants