[ refactor ] Restate, and use, the definitions of Monotonic etc. operations#2580
[ refactor ] Restate, and use, the definitions of Monotonic etc. operations#2580MatthewDaggitt merged 30 commits intoagda:masterfrom
Monotonic etc. operations#2580Conversation
|
Thanks - these already are easier to understand. |
|
How do I remove #1579 from the |
Not sure how you did it, but it's gone for me 🎉 |
|
Now that the abstract definitions are mostly in place, can look at the instantiations in |
JacquesCarette
left a comment
There was a problem hiding this comment.
Coming along nicely.
|
Remark: all of the |
MatthewDaggitt
left a comment
There was a problem hiding this comment.
Otherwise looks really good! Massive improvement.
src/Data/Nat/Properties.agda
Outdated
| *-monoʳ-≤ : ∀ n → (n *_) Preserves _≤_ ⟶ _≤_ | ||
| *-monoʳ-≤ n m≤o = *-mono-≤ (≤-refl {n}) m≤o | ||
| *-monoʳ-≤ : LeftMonotonic _≤_ _≤_ _*_ | ||
| *-monoʳ-≤ = mono₂⇒monoˡ {≤₁ = _≤_} {≤₂ = _≤_} {≤₃ = _≤_} ≤-refl *-mono-≤ |
There was a problem hiding this comment.
This providing of implicits is annoying. Suggests that some of them should be explicit in the proof?
There was a problem hiding this comment.
Yes, I've been scratching my head over how it might be avoided... without a conclusion yet.
There was a problem hiding this comment.
So if you make all 3 underscores, which ones are yellow? I notice that the previous proof provided the n explicitly, might that work here as well?
There was a problem hiding this comment.
It seems that only {≤₃ = _≤_} is required here...
There was a problem hiding this comment.
Aaargh: there's a difference depending on whether we consider left or right, presumably because of the left-biased implementations. Will need to investigate further. Sigh.
*-monoˡ-≤ : RightMonotonic _≤_ _≤_ _*_
*-monoˡ-≤ = mono₂⇒monoʳ {≤₃ = _≤_} ≤-refl *-mono-≤
*-monoʳ-≤ : LeftMonotonic _≤_ _≤_ _*_
*-monoʳ-≤ = mono₂⇒monoˡ {≤₁ = _≤_} {≤₂ = _≤_} {≤₃ = _≤_} ≤-refl *-mono-≤
src/Data/Nat/Properties.agda
Outdated
| +-monoʳ-≤ : ∀ n → (n +_) Preserves _≤_ ⟶ _≤_ | ||
| +-monoʳ-≤ n m≤o = +-mono-≤ (≤-refl {n}) m≤o | ||
| +-monoʳ-≤ : LeftMonotonic _≤_ _≤_ _+_ | ||
| +-monoʳ-≤ = mono₂⇒monoˡ {≤₃ = _≤_} ≤-refl +-mono-≤ |
There was a problem hiding this comment.
But here just 1 suffices:
+-monoˡ-≤ : RightMonotonic _≤_ _≤_ _+_
+-monoˡ-≤ = mono₂⇒monoʳ {≤₃ = _≤_} ≤-refl +-mono-≤
+-monoʳ-≤ : LeftMonotonic _≤_ _≤_ _+_
+-monoʳ-≤ = mono₂⇒monoˡ {≤₃ = _≤_} ≤-refl +-mono-≤|
I'll resolve the merge conflict later, meanwhile tricky questions above needing more thought... ;-)... so have converted back to DRAFT. |
src/Data/Nat/Properties.agda
Outdated
| *-monoʳ-≤ : ∀ n → (n *_) Preserves _≤_ ⟶ _≤_ | ||
| *-monoʳ-≤ n m≤o = *-mono-≤ (≤-refl {n}) m≤o | ||
| *-monoʳ-≤ : LeftMonotonic _≤_ _≤_ _*_ | ||
| *-monoʳ-≤ = mono₂⇒monoˡ {≤₁ = _≤_} {≤₂ = _≤_} {≤₃ = _≤_} ≤-refl *-mono-≤ |
There was a problem hiding this comment.
So if you make all 3 underscores, which ones are yellow? I notice that the previous proof provided the n explicitly, might that work here as well?
|
Have fixed the merge conflict, and... not sure what else to do! Maybe it can still be improved wrt implicits? |
|
Just needs a second reviewer. |
Aim: towards tackling #1579
TODO:
Data.Nat.*UPDATED: unsolved metas suggest some more revision is necessary :-(Data.Integer.*Data.Rational.*breakingchanges (v3.0: separate PR once the rest is done?)