<div dir="ltr"><p style="color:rgb(0,0,0);font-family:sans-serif;font-size:14.24px">Or a little more neatly via “irrefutable <code class="gmail-sourceCode gmail-haskell" style="font-size:13.528px;background:transparent;border:none;overflow:auto;font-family:Menlo,"Lucida Console",Monaco,monospace">with</code>”:</p><div class="gmail-sourceCode" id="gmail-cb38" style="color:rgb(0,0,0);font-family:sans-serif;font-size:14.24px"><pre class="gmail-sourceCode gmail-agda" style="border:1px solid rgb(221,221,221);overflow:auto;border-radius:0.3em;margin:0.5em 1.5em;padding:0.5em 1em 0.5em 0.5em;background:rgba(255,255,0,0.15)"><code class="gmail-sourceCode gmail-agda" style="font-size:13.528px;background:transparent;border:none;overflow:auto;font-family:Menlo,"Lucida Console",Monaco,monospace;padding:0em"><a class="gmail-sourceLine" id="gmail-cb38-1" title="1">example g h p q s t M e <span class="gmail-kw">with</span> refl ← equation g h p q s t e <span class="gmail-ot">=</span></a>
<a class="gmail-sourceLine" id="gmail-cb38-2" title="2"> ⟨ <span class="gmail-ot">(</span>M ↑ p<span class="gmail-ot">)</span> ↓ q , collapse g h ⟩</a></code></pre></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Dec 24, 2021 at 10:23 AM Miëtek Bak <<a href="mailto:mietek@bak.io">mietek@bak.io</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">In this case, the simplest solution seems to be using with-abstraction to pattern match on the result of `equation`, in order to let Agda take the desired equality `G ≡ H` into account.<br>
<a href="https://agda.readthedocs.io/en/latest/language/with-abstraction.html" rel="noreferrer" target="_blank">https://agda.readthedocs.io/en/latest/language/with-abstraction.html</a><br>
<br>
```diff<br>
--- <a href="http://Example-before.lagda.md" rel="noreferrer" target="_blank">Example-before.lagda.md</a><br>
+++ <a href="http://Example-after.lagda.md" rel="noreferrer" target="_blank">Example-after.lagda.md</a><br>
@@ -147 +147,2 @@<br>
-example g h p q s t M e = {!!}<br>
+example g h p q s t M e with equation g h p q s t e<br>
+... | refl = ⟨ (M ↑ p) ↓ q , collapse g h ⟩<br>
```<br>
<br>
-- <br>
MB<br>
<br>
<br>
On Fri, Dec 24, 2021, at 18:03, Philip Wadler wrote:<br>
> I'm having trouble completing a proof, and would be grateful for help. <br>
> The problem arises because I need to show two values are equal, but the <br>
> equality of the values follows from a complex equation. In fact, it is <br>
> not hard to show that the equality follows from the equation, but when <br>
> I attempt to use the desired equality for rewriting Agda complains and <br>
> I can't work out what it is complaining about (or how to fix it).<br>
><br>
> A complete example is attached. The original is more complex, I've <br>
> tried to boil it down to its simplest form. My apologies that the <br>
> simplest form is not so simple!<br>
><br>
> Thank you for your help. Go well, -- P<br>
><br>
><br>
><br>
> . \ Philip Wadler, Professor of Theoretical Computer Science,<br>
> . /\ School of Informatics, University of Edinburgh<br>
> . / \ and Senior Research Fellow, IOHK<br>
> . <a href="http://homepages.inf.ed.ac.uk/wadler/" rel="noreferrer" target="_blank">http://homepages.inf.ed.ac.uk/wadler/</a><br>
><br>
> The University of Edinburgh is a charitable body, registered in<br>
> Scotland, with registration number SC005336.<br>
><br>
> _______________________________________________<br>
> Agda mailing list<br>
> <a href="mailto:Agda@lists.chalmers.se" target="_blank">Agda@lists.chalmers.se</a><br>
> <a href="https://lists.chalmers.se/mailman/listinfo/agda" rel="noreferrer" target="_blank">https://lists.chalmers.se/mailman/listinfo/agda</a><br>
><br>
> Attachments:<br>
> * <a href="http://Example.lagda.md" rel="noreferrer" target="_blank">Example.lagda.md</a><br>
_______________________________________________<br>
Agda mailing list<br>
<a href="mailto:Agda@lists.chalmers.se" target="_blank">Agda@lists.chalmers.se</a><br>
<a href="https://lists.chalmers.se/mailman/listinfo/agda" rel="noreferrer" target="_blank">https://lists.chalmers.se/mailman/listinfo/agda</a><br>
</blockquote></div>