<div dir="ltr">Fantastic! Trust this group to find the answer quickly. Thank you very much!<div><br></div><div>But I thought rewrite was an abbreviation for using a with to match refl, and rewrite did not work. What is the difference?</div><div><br></div><div>Go well, -- P</div><div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><div dir="ltr">. \ Philip Wadler, Professor of Theoretical Computer Science,<br>. /\ School of Informatics, University of Edinburgh<br></div><div>. / \ and Senior Research Fellow, IOHK<br></div><div dir="ltr">. <span><a href="http://homepages.inf.ed.ac.uk/wadler/" target="_blank">http://homepages.inf.ed.ac.uk/wadler/</a></span></div></div><div dir="ltr"><br></div></div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 24 Dec 2021 at 18:23, 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">This email was sent to you by someone outside the University.<br>
You should only click on links or attachments if you are certain that the email is genuine and the content is safe.<br>
<br>
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>