<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/forest/default.xsl"?>
<fr:tree xmlns:fr="http://www.forester-notes.org" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:xml="http://www.w3.org/XML/1998/namespace" root="true" base-url="/forest/">
  <fr:frontmatter>
    <fr:authors>
      <fr:author>
        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
      </fr:author>
    </fr:authors>
    <fr:uri>https://liamoc.net/forest/index/</fr:uri>
    <fr:display-uri>index</fr:display-uri>
    <fr:route>/forest/index/</fr:route>
    <fr:title text="Liam O'Connor">Liam O'Connor</fr:title>
    <fr:meta name="author">false</fr:meta>
  </fr:frontmatter>
  <fr:mainmatter>


<fr:tree show-heading="false" show-metadata="false" toc="false"><fr:frontmatter><fr:authors /><fr:uri>https://liamoc.net/forest/liamoc/</fr:uri><fr:display-uri>liamoc</fr:display-uri><fr:route>/forest/liamoc/</fr:route><fr:title text="Liam O'Connor">Liam O'Connor</fr:title><fr:taxon>Person</fr:taxon><fr:meta name="external">https://liamoc.net</fr:meta><fr:meta name="institution"><fr:link href="/forest/anu/" title="Australian National University" uri="https://liamoc.net/forest/anu/" display-uri="anu" type="local">Australian National University</fr:link></fr:meta><fr:meta name="orcid">0000-0003-2765-4269</fr:meta><fr:meta name="position">Senior Lecturer</fr:meta></fr:frontmatter><fr:mainmatter><html:img class="portrait" src="/forest/bafkrmigqxgo6qtpz6e52y3cnlyd6iixw4iboqib5c7mk6y7hwhie3wwj4i.jpeg" /><html:p>I am a Senior Lecturer in Foundations at the <fr:link href="/forest/anu/" title="Australian National University" uri="https://liamoc.net/forest/anu/" display-uri="anu" type="local">Australian National University</fr:link> School of Computing, on <fr:link href="/forest/loc-000D/" title="Ngunnawal and Ngambri country" uri="https://liamoc.net/forest/loc-000D/" display-uri="loc-000D" type="local">Ngunnawal and Ngambri country</fr:link>. I'm also an Honorary Fellow at the <fr:link href="/forest/uoe/" title="University of Edinburgh" uri="https://liamoc.net/forest/uoe/" display-uri="uoe" type="local">University of Edinburgh</fr:link> Laboratory for Foundations of Computer Science, where I worked until 2024.</html:p><html:p>Lately, my research has been focused on <fr:link href="/forest/loc-000A/" title="Property-based testing" uri="https://liamoc.net/forest/loc-000A/" display-uri="loc-000A" type="local">property-based testing</fr:link>, <fr:link href="/forest/loc-000C/" title="Semantics" uri="https://liamoc.net/forest/loc-000C/" display-uri="loc-000C" type="local">semantics</fr:link> and <fr:link href="/forest/loc-000B/" title="Temporal logic" uri="https://liamoc.net/forest/loc-000B/" display-uri="loc-000B" type="local">temporal logic</fr:link>, but I have very broad research interests. See my <fr:link href="/forest/loc-0001/" title="Works of Liam O'Connor" uri="https://liamoc.net/forest/loc-0001/" display-uri="loc-0001" type="local">personal bibliography</fr:link> for a full list of my work.</html:p><html:p>Previously, I lectured courses at <fr:link href="/forest/unsw/" title="UNSW Sydney" uri="https://liamoc.net/forest/unsw/" display-uri="unsw" type="local">UNSW Sydney</fr:link>, where I did my PhD with <fr:link href="/forest/gckeller/" title="Gabriele Keller" uri="https://liamoc.net/forest/gckeller/" display-uri="gckeller" type="local">Gabriele Keller</fr:link> and the Trustworthy Systems Team lead by <fr:link href="/forest/heiser/" title="Gernot Heiser" uri="https://liamoc.net/forest/heiser/" display-uri="heiser" type="local">Gernot Heiser</fr:link>, focusing on the <fr:link href="/forest/cogent/" title="Cogent" uri="https://liamoc.net/forest/cogent/" display-uri="cogent" type="local">Cogent</fr:link> project.</html:p><html:p>Full details about me can be found on my <fr:link href="/forest/loc-0004/" title="Liam O'Connor › Curriculum vitæ" uri="https://liamoc.net/forest/loc-0004/" display-uri="loc-0004" type="local">curriculum vitæ</fr:link>, which includes a <fr:link href="/forest/loc-0002/" title="Liam O'Connor › Students" uri="https://liamoc.net/forest/loc-0002/" display-uri="loc-0002" type="local">list of students</fr:link>. My contact details can be found <fr:link href="/forest/loc-0009/" title="Liam O'Connor › Contact" uri="https://liamoc.net/forest/loc-0009/" display-uri="loc-0009" type="local">here</fr:link>.</html:p><html:p>I'm also an experienced liturgical singer and cantor. I journal my experiences in church music at the <fr:link href="/forest/loc-000P/" title="Church Music Corner" uri="https://liamoc.net/forest/loc-000P/" display-uri="loc-000P" type="local">Church Music Corner</fr:link>.</html:p></fr:mainmatter></fr:tree>

<fr:tree show-heading="true" show-metadata="false" toc="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/loc-000E/</fr:uri><fr:display-uri>loc-000E</fr:display-uri><fr:route>/forest/loc-000E/</fr:route><fr:title text="About this website">About this website</fr:title></fr:frontmatter><fr:mainmatter><html:p>This website is a "forest" created using the <fr:link href="https://www.forester-notes.org/" type="external">Forester tool</fr:link>, a system of evergreen hypertext notes developed by, among others, <fr:link href="/forest/jonsterling/" title="Jon Sterling" uri="https://liamoc.net/forest/jonsterling/" display-uri="jonsterling" type="local">Jon Sterling</fr:link> and <fr:link href="/forest/kentookura/" title="Kento Okura" uri="https://liamoc.net/forest/kentookura/" display-uri="kentookura" type="local">Kento Okura</fr:link>.  To search my forest, press <html:kbd>Ctrl</html:kbd>+<html:kbd>K</html:kbd>.</html:p></fr:mainmatter></fr:tree>
<fr:tree show-heading="true" show-metadata="false" toc="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:title text="Lecture notes">Lecture notes</fr:title></fr:frontmatter><fr:mainmatter><html:ul><html:li><fr:link href="/forest/dt-001Y/" title="Domain theory" uri="https://liamoc.net/forest/dt-001Y/" display-uri="dt-001Y" type="local">Domain theory</fr:link></html:li> <html:li><fr:link href="/forest/isa-0001/" title="Interactive theorem proving" uri="https://liamoc.net/forest/isa-0001/" display-uri="isa-0001" type="local">Interactive theorem proving</fr:link></html:li></html:ul></fr:mainmatter></fr:tree>
<fr:tree show-heading="true" show-metadata="false" toc="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/news/</fr:uri><fr:display-uri>news</fr:display-uri><fr:route>/forest/news/</fr:route><fr:title text="News">News</fr:title></fr:frontmatter><fr:mainmatter><html:p>See also <fr:link href="/forest/loc-001B/" title="Liam O'Connor › Weeknotes" uri="https://liamoc.net/forest/loc-001B/" display-uri="loc-001B" type="local">Weeknotes</fr:link></html:p>
  <html:table>

  <html:tr>
    
  <html:th> 26.03.01</html:th>

    
  <html:td><fr:link href="/forest/kaiphan/" title="Kai Phan" uri="https://liamoc.net/forest/kaiphan/" display-uri="kaiphan" type="local">Kai Phan</fr:link> starts her PhD this week, and <fr:link href="/forest/edwinpark/" title="Edwin Park" uri="https://liamoc.net/forest/edwinpark/" display-uri="edwinpark" type="local">Edwin Park</fr:link> starts his honours project. </html:td>

</html:tr>
  

  <html:tr>
    
  <html:th> 26.02.20</html:th>

    
  <html:td>I have accepted an invitation to serve on the PC of <fr:link href="/forest/popl27/" title="POPL ’27: 54th ACM SIGPLAN Symposium on Principles of Programming Languages" uri="https://liamoc.net/forest/popl27/" display-uri="popl27" type="local"><html:em>POPL ’27</html:em>: 54th ACM SIGPLAN Symposium on Principles of Programming Languages</fr:link>.</html:td>

</html:tr>
  

  <html:tr>
    
  <html:th> 26.01.16</html:th>

    
  <html:td>My student <fr:link href="/forest/kaiphan/" title="Kai Phan" uri="https://liamoc.net/forest/kaiphan/" display-uri="kaiphan" type="local">Kai Phan</fr:link> will start her PhD with me this semester.</html:td>

</html:tr>
  

  <html:tr>
    
  <html:th> 26.01.15</html:th>

    
  <html:td>I have agreed to join the supervision panel for <fr:link href="/forest/muehlboeck/" title="Fabian Mühlböck" uri="https://liamoc.net/forest/muehlboeck/" display-uri="muehlboeck" type="local">Fabian Mühlböck</fr:link>'s student, <fr:link href="/forest/carloz/" title="Carlo Zancanaro" uri="https://liamoc.net/forest/carloz/" display-uri="carloz" type="local">Carlo Zancanaro</fr:link>.</html:td>

</html:tr>


  <html:tr>
    
  <html:th> 25.12.17</html:th>

    
  <html:td>I have agreed to join the supervision panel for <fr:link href="/forest/nisansala/" title="Nisansala Yatapanage" uri="https://liamoc.net/forest/nisansala/" display-uri="nisansala" type="local">Nisansala Yatapanage</fr:link>'s student, <fr:link href="/forest/alinosher/" title="Ali Nosherwan Hamed" uri="https://liamoc.net/forest/alinosher/" display-uri="alinosher" type="local">Ali Nosherwan Hamed</fr:link>.</html:td>

</html:tr>


  <html:tr>
    
  <html:th> 25.12.01 </html:th>

    
  <html:td>My course on <fr:link href="/forest/isa-0001/" title="Interactive theorem proving" uri="https://liamoc.net/forest/isa-0001/" display-uri="isa-0001" type="local">Interactive theorem proving</fr:link> is running this week. </html:td>

</html:tr>
  

  <html:tr>
    
  <html:th> 25.09.19 </html:th>

    
  <html:td>I have agreed to teach COMP1110 <fr:link href="/forest/COMP1110/" title="Structured Programming" uri="https://liamoc.net/forest/COMP1110/" display-uri="COMP1110" type="local">Structured Programming</fr:link> in 2026 Semester 1. </html:td>

</html:tr>


  <html:tr>
    
  <html:th> 25.09.18 </html:th>

    
  <html:td>I will be teaching at the <fr:link href="/forest/loc-001W/" title="ANU Logic Summer School 2025" uri="https://liamoc.net/forest/loc-001W/" display-uri="loc-001W" type="local">ANU Logic Summer School 2025</fr:link> this December. </html:td>

</html:tr>


  <html:tr>
    
  <html:th> 25.09.12 </html:th>

    
  <html:td>I have been made a member of <fr:link href="/forest/wg21/" title="IFIP Working Group 2.1: Algorithmic Languages and Calculi" uri="https://liamoc.net/forest/wg21/" display-uri="wg21" type="local">IFIP Working Group 2.1: Algorithmic Languages and Calculi</fr:link>. </html:td>

</html:tr>


  <html:tr>
    
  <html:th> 25.09.08 </html:th>

    
  <html:td>The <fr:link href="/forest/icfpc25/" title="ICFP '25 Programming Contest" uri="https://liamoc.net/forest/icfpc25/" display-uri="icfpc25" type="local"><fr:link href="/forest/icfp25/" title="ICFP '25: 29th ACM SIGPLAN International Conference on Functional Programming" uri="https://liamoc.net/forest/icfp25/" display-uri="icfp25" type="local">ICFP '25</fr:link> Programming Contest</fr:link> has successfully concluded. </html:td>

</html:tr>


  <html:tr>
  
  <html:th> 25.08.22 </html:th>

  
  <html:td><fr:link href="/forest/xinloi/" title="Xin Lu" uri="https://liamoc.net/forest/xinloi/" display-uri="xinloi" type="local">Xin Lu</fr:link> starts her PhD with me and <fr:link href="/forest/hoefner/" title="Peter Höfner" uri="https://liamoc.net/forest/hoefner/" display-uri="hoefner" type="local">Peter Höfner</fr:link> today. </html:td>

</html:tr>


  <html:tr>
  
  <html:th> 25.07.22 </html:th>

  
  <html:td> <fr:link href="/forest/selene/" title="Pilar Selene Linares Arévalo" uri="https://liamoc.net/forest/selene/" display-uri="selene" type="local">Selene</fr:link>'s paper, <fr:link href="/forest/linares-dajosr-2025/" title="Memory Safety: Uniqueness as Separation" uri="https://liamoc.net/forest/linares-dajosr-2025/" display-uri="linares-dajosr-2025" type="local">Memory Safety: Uniqueness as Separation</fr:link>, has been accepted to <fr:link href="/forest/aplas25/" title="APLAS '25: 23rd Asian Symposium on Programming Languages and Systems" uri="https://liamoc.net/forest/aplas25/" display-uri="aplas25" type="local"><html:em>APLAS '25</html:em>: 23rd Asian Symposium on Programming Languages and Systems</fr:link>!</html:td>

</html:tr>


  <html:tr>
  
  <html:th> 25.07.20 </html:th>

  
  <html:td><fr:link href="/forest/miowu/" title="Mio Wu" uri="https://liamoc.net/forest/miowu/" display-uri="miowu" type="local">Mio Wu</fr:link> and <fr:link href="/forest/joshbrown/" title="Josh Brown" uri="https://liamoc.net/forest/joshbrown/" display-uri="joshbrown" type="local">Josh Brown</fr:link> are starting their Honours projects with me this semester, working on <fr:link href="/forest/loc-000V/" title="Rethinking Holbert" uri="https://liamoc.net/forest/loc-000V/" display-uri="loc-000V" type="local">the next generation of the Holbert proof assistant</fr:link>. </html:td>

</html:tr>
  

  <html:tr>
  
  <html:th> 25.05.30 </html:th>

  
  <html:td><fr:link href="/forest/xinloi/" title="Xin Lu" uri="https://liamoc.net/forest/xinloi/" display-uri="xinloi" type="local">Xin Lu</fr:link> will be starting her PhD with me and <fr:link href="/forest/hoefner/" title="Peter Höfner" uri="https://liamoc.net/forest/hoefner/" display-uri="hoefner" type="local">Peter Höfner</fr:link> in a few months. </html:td>

</html:tr>


  <html:tr>
 
  <html:th> 25.05.16 </html:th>

 
  <html:td>I have completed the <fr:link href="/forest/dt-001Y/" title="Domain theory" uri="https://liamoc.net/forest/dt-001Y/" display-uri="dt-001Y" type="local">domain theory</fr:link> lecture notes. </html:td>

</html:tr>


  <html:tr>
 
  <html:th> 25.05.01 </html:th>

 
  <html:td>I have agreed to co-supervise <fr:link href="/forest/yiyao/" title="Yi Yao" uri="https://liamoc.net/forest/yiyao/" display-uri="yiyao" type="local">Yi Yao</fr:link>, a new PhD student with <fr:link href="/forest/hoefner/" title="Peter Höfner" uri="https://liamoc.net/forest/hoefner/" display-uri="hoefner" type="local">Peter Höfner</fr:link>. </html:td>

</html:tr>


  <html:tr>
 
  <html:th> 25.03.22 </html:th>

 
  <html:td>I have joined the PC for <fr:link href="/forest/haskell25/" title="Haskell '25: 18th ACM SIGPLAN Haskell Symposium" uri="https://liamoc.net/forest/haskell25/" display-uri="haskell25" type="local"><html:em>Haskell '25</html:em>: 18th ACM SIGPLAN Haskell Symposium</fr:link>. </html:td>

</html:tr>


  <html:tr>
 
  <html:th> 25.03.13 </html:th>

 
  <html:td>I have joined the PC for <fr:link href="/forest/fproper25/" title="FProPer '25: 2nd ACM SIGPLAN Workshop on Functional Programming for Productivity and Performance" uri="https://liamoc.net/forest/fproper25/" display-uri="fproper25" type="local"><html:em>FProPer '25</html:em>: 2nd ACM SIGPLAN Workshop on Functional Programming for Productivity and Performance</fr:link>. </html:td>

</html:tr>


  <html:tr>
 
  <html:th> 25.02.04 </html:th>

 
  <html:td> <fr:link href="/forest/jackb/" title="Jack Bashford" uri="https://liamoc.net/forest/jackb/" display-uri="jackb" type="local">Jack Bashford</fr:link> has joined me for a semester project working on <fr:link href="/forest/oconnor-amjad-2022/" title="Holbert: Reading, Writing, Proving and Learning in the Browser" uri="https://liamoc.net/forest/oconnor-amjad-2022/" display-uri="oconnor-amjad-2022" type="local">Holbert</fr:link>. </html:td>

</html:tr>


  <html:tr>
 
  <html:th> 25.01.08 </html:th>

 
  <html:td>I have joined the PC for <fr:link href="/forest/aplas25/" title="APLAS '25: 23rd Asian Symposium on Programming Languages and Systems" uri="https://liamoc.net/forest/aplas25/" display-uri="aplas25" type="local"><html:em>APLAS '25</html:em>: 23rd Asian Symposium on Programming Languages and Systems</fr:link>. </html:td>

</html:tr>


  <html:tr>
 
  <html:th> 24.11.05 </html:th>

 
  <html:td>I have joined the PC for <fr:link href="/forest/icfp25/" title="ICFP '25: 29th ACM SIGPLAN International Conference on Functional Programming" uri="https://liamoc.net/forest/icfp25/" display-uri="icfp25" type="local"><html:em>ICFP '25</html:em>: 29th ACM SIGPLAN International Conference on Functional Programming</fr:link>. </html:td>

</html:tr>


  <html:tr>
 
  <html:th> 24.10.22 </html:th>

 
  <html:td>I have joined the PC for <fr:link href="/forest/pldi25/" title="PLDI '25: 46th ACM SIGPLAN International Conference on Programming Language Design and Implementation" uri="https://liamoc.net/forest/pldi25/" display-uri="pldi25" type="local"><html:em>PLDI '25</html:em>: 46th ACM SIGPLAN International Conference on Programming Language Design and Implementation</fr:link>. </html:td>

</html:tr>


  <html:tr>
 
  <html:th> 24.09.17 </html:th>

 
  <html:td>I have agreed to organise the <fr:link href="/forest/icfpc25/" title="ICFP '25 Programming Contest" uri="https://liamoc.net/forest/icfpc25/" display-uri="icfpc25" type="local"><fr:link href="/forest/icfp25/" title="ICFP '25: 29th ACM SIGPLAN International Conference on Functional Programming" uri="https://liamoc.net/forest/icfp25/" display-uri="icfp25" type="local">ICFP '25</fr:link> Programming Contest</fr:link>. </html:td>

</html:tr>


  <html:tr>
 
  <html:th>24.09.30 </html:th>

 
  <html:td>I was delighted to spend a week with the <fr:link href="/forest/wg21/" title="IFIP Working Group 2.1: Algorithmic Languages and Calculi" uri="https://liamoc.net/forest/wg21/" display-uri="wg21" type="local">WG2.1</fr:link> folks here at the <fr:link href="/forest/anu/" title="Australian National University" uri="https://liamoc.net/forest/anu/" display-uri="anu" type="local">ANU</fr:link>.</html:td>

</html:tr>


  <html:tr>
 
  <html:th> 24.09.09 </html:th>

 
  <html:td>Our student <fr:link href="/forest/rayhana/" title="Rayhana Amjad" uri="https://liamoc.net/forest/rayhana/" display-uri="rayhana" type="local">Rayhana Amjad</fr:link> has published her first paper, <fr:link href="/forest/amjad-vanglabbeek-oconnor-2024/" title="Semantics for Linear-time Temporal Logic with Finite Observations" uri="https://liamoc.net/forest/amjad-vanglabbeek-oconnor-2024/" display-uri="amjad-vanglabbeek-oconnor-2024" type="local">Semantics for Linear-time Temporal Logic with Finite Observations</fr:link> at <fr:link href="/forest/expresssos24/" title="EXPRESS/SOS '24: Combined 31st International Workshop on Expressiveness in Concurrency and 21st Workshop on Structural Operational Semantics" uri="https://liamoc.net/forest/expresssos24/" display-uri="expresssos24" type="local">EXPRESS/SOS</fr:link>. </html:td>

</html:tr>


  <html:tr>
 
  <html:th> 24.07.30 </html:th>

 
  <html:td>I have taken a new position as a Senior Lecturer at the <fr:link href="/forest/anu/" title="Australian National University" uri="https://liamoc.net/forest/anu/" display-uri="anu" type="local">Australian National University</fr:link>. </html:td>

</html:tr>



</html:table>
</fr:mainmatter></fr:tree>
</fr:mainmatter>
  <fr:backmatter>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="References">References</fr:title>
      </fr:frontmatter>
      <fr:mainmatter>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/forest/selene/" title="Pilar Selene Linares Arévalo" uri="https://liamoc.net/forest/selene/" display-uri="selene" type="local">Pilar Selene Linares Arévalo</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/forest/vjackson/" title="Vincent Jackson" uri="https://liamoc.net/forest/vjackson/" display-uri="vjackson" type="local">Vincent Jackson</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/forest/adeamorim/" title="Arthur Azevedo de Amorim" uri="https://liamoc.net/forest/adeamorim/" display-uri="adeamorim" type="local">Arthur Azevedo de Amorim</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/forest/pschachte/" title="Peter Schachte" uri="https://liamoc.net/forest/pschachte/" display-uri="pschachte" type="local">Peter Schachte</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/forest/crizkallah/" title="Christine Rizkallah" uri="https://liamoc.net/forest/crizkallah/" display-uri="crizkallah" type="local">Christine Rizkallah</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2025</fr:year>
              <fr:month>10</fr:month>
              <fr:day>27</fr:day>
            </fr:date>
            <fr:uri>https://liamoc.net/forest/linares-dajosr-2025/</fr:uri>
            <fr:display-uri>linares-dajosr-2025</fr:display-uri>
            <fr:route>/forest/linares-dajosr-2025/</fr:route>
            <fr:title text="Memory Safety: Uniqueness as Separation">Memory Safety: Uniqueness as Separation</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="venue">
              <fr:link href="/forest/aplas25/" title="APLAS '25: 23rd Asian Symposium on Programming Languages and Systems" uri="https://liamoc.net/forest/aplas25/" display-uri="aplas25" type="local"><html:em>APLAS '25</html:em>: 23rd Asian Symposium on Programming Languages and Systems</fr:link>
            </fr:meta>
          </fr:frontmatter>
          <fr:mainmatter>
            <html:p>Programming languages with uniqueness type systems prevent pointer aliasing, simplifying memory safety reasoning. However, code implemented in these languages often interoperates through foreign function interfaces with external components implemented in languages lacking the same level of static safety guarantees. To verify safe updates in a combined system, one must manually verify that the external components preserve the safety invariants of the uniqueness type system. In particular, recent work showed that one can manually discharge such obligations on C components from a cross-language Cogent-C system by directly reasoning about the C code in higher-order logic. However, even for simple examples, discharging the uniqueness safety obligations, known as frame conditions, within a logic not specifically designed for direct reasoning in terms of heaps and pointers was not ideal. Separation logic is an established logic that facilitates reasoning about imperative programs by localising reasoning to the parts of the heap that the program mutates. This raises a vital question. Can we use separation logic to discharge the safety obligations imposed by uniqueness types? The answer is yes. This paper demonstrates that the frame conditions can be inferred from particular separation logic triples and, hence, discharged by reasoning using separation logic. We identify and verify the soundness of specific separation logic triples that imply the frame conditions imposed by a uniqueness type system.</html:p>
            <html:p>To appear.</html:p>
          </fr:mainmatter>
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/forest/rayhana/" title="Rayhana Amjad" uri="https://liamoc.net/forest/rayhana/" display-uri="rayhana" type="local">Rayhana Amjad</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/forest/rvg/" title="Rob van Glabbeek" uri="https://liamoc.net/forest/rvg/" display-uri="rvg" type="local">Rob van Glabbeek</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2024</fr:year>
              <fr:month>11</fr:month>
              <fr:day>22</fr:day>
            </fr:date>
            <fr:uri>https://liamoc.net/forest/amjad-vanglabbeek-oconnor-2024/</fr:uri>
            <fr:display-uri>amjad-vanglabbeek-oconnor-2024</fr:display-uri>
            <fr:route>/forest/amjad-vanglabbeek-oconnor-2024/</fr:route>
            <fr:title text="Semantics for Linear-time Temporal Logic with Finite Observations">Semantics for Linear-time Temporal Logic with Finite Observations</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="venue">
              <fr:link href="/forest/expresssos24/" title="EXPRESS/SOS '24: Combined 31st International Workshop on Expressiveness in Concurrency and 21st Workshop on Structural Operational Semantics" uri="https://liamoc.net/forest/expresssos24/" display-uri="expresssos24" type="local"><html:em>EXPRESS/SOS '24</html:em>: Combined 31st International Workshop on Expressiveness in Concurrency and 21st Workshop on Structural Operational Semantics</fr:link>
            </fr:meta>
            <fr:meta name="doi">10.4204/EPTCS.412.4</fr:meta>
            <fr:meta name="source">
              <fr:link href="https://www.isa-afp.org/entries/LTL3_Semantics.html" type="external">Proofs on AFP</fr:link>
            </fr:meta>
          </fr:frontmatter>
          <fr:mainmatter>
            <html:p>LTL3 is a multi-valued variant of Linear-time Temporal Logic for runtime verification applications. The semantic descriptions of LTL3 in previous work are given only in terms of the relationship to conventional LTL. Our approach, by contrast, gives a full model-based inductive accounting of the semantics of LTL3, in terms of families of definitive prefix sets. We show that our definitive prefix sets are isomorphic to linear-time temporal properties (sets of infinite traces), and thereby show that our semantics of LTL3 directly correspond to the semantics of conventional LTL. In addition, we formalise the formula progression evaluation technique, popularly used in runtime verification and testing contexts, and show its soundness and completeness up to finite traces with respect to our semantics. All of our definitions and proofs are mechanised in Isabelle/HOL.</html:p>
          </fr:mainmatter>
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/forest/rayhana/" title="Rayhana Amjad" uri="https://liamoc.net/forest/rayhana/" display-uri="rayhana" type="local">Rayhana Amjad</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2022</fr:year>
              <fr:month>10</fr:month>
              <fr:day>17</fr:day>
            </fr:date>
            <fr:uri>https://liamoc.net/forest/oconnor-amjad-2022/</fr:uri>
            <fr:display-uri>oconnor-amjad-2022</fr:display-uri>
            <fr:route>/forest/oconnor-amjad-2022/</fr:route>
            <fr:title text="Holbert: Reading, Writing, Proving and Learning in the Browser">Holbert: Reading, Writing, Proving and Learning in the Browser</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="venue">
              <fr:link href="/forest/hatra22/" title="HATRA '22: Human Aspects of Types and Reasoning Assistants 2022" uri="https://liamoc.net/forest/hatra22/" display-uri="hatra22" type="local"><html:em>HATRA '22</html:em>: Human Aspects of Types and Reasoning Assistants 2022</fr:link>
            </fr:meta>
            <fr:meta name="doi">10.48550/arXiv.2210.11411</fr:meta>
            <fr:meta name="external">https://liamoc.net/hatra-2022/</fr:meta>
            <fr:meta name="video">https://www.youtube.com/watch?v=Rdb7P5MJZLw</fr:meta>
          </fr:frontmatter>
          <fr:mainmatter>
            <html:p>
This paper presents Holbert: a work-in-progress pedagogical proof assistant and online textbook platform, aimed at the educational use-case, specifically for the teaching of programming language theory. Holbert allows proof exercises and rule definitions to be embedded directly in an online textbook, where proofs and rules can be manipulated using a graphical interface. We give an overview of the logical foundations of Holbert, examples of its use, and give an update as to its current implementation status.
</html:p>
          </fr:mainmatter>
        </fr:tree>
      </fr:mainmatter>
    </fr:tree>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="Context">Context</fr:title>
      </fr:frontmatter>
      <fr:mainmatter />
    </fr:tree>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="Backlinks">Backlinks</fr:title>
      </fr:frontmatter>
      <fr:mainmatter />
    </fr:tree>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="Related">Related</fr:title>
      </fr:frontmatter>
      <fr:mainmatter>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
              </fr:author>
            </fr:authors>
            <fr:uri>https://liamoc.net/forest/dt-001Y/</fr:uri>
            <fr:display-uri>dt-001Y</fr:display-uri>
            <fr:route>/forest/dt-001Y/</fr:route>
            <fr:title text="Domain theory">Domain theory</fr:title>
            <fr:taxon>Lecture Notes</fr:taxon>
          </fr:frontmatter>
          <fr:mainmatter><html:p>These lecture notes are based on the material I used to teach the <fr:link href="/forest/typesig-dt/" title="Domain Theory (TypeSIG)" uri="https://liamoc.net/forest/typesig-dt/" display-uri="typesig-dt" type="local">Domain Theory (<fr:link href="/forest/typesig/" title="TypeSIG" uri="https://liamoc.net/forest/typesig/" display-uri="typesig" type="local">TypeSIG</fr:link>)</fr:link> course at the <fr:link href="/forest/uoe/" title="University of Edinburgh" uri="https://liamoc.net/forest/uoe/" display-uri="uoe" type="local">University of Edinburgh</fr:link> in 2024.</html:p>
<fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0005/</fr:uri><fr:display-uri>dt-0005</fr:display-uri><fr:route>/forest/dt-0005/</fr:route><fr:title text="Semantics and recursion">Semantics and recursion</fr:title><fr:taxon>Lecture</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>This lecture is based on material from <fr:link href="/forest/haskellhutt/" title="Graham Hutton" uri="https://liamoc.net/forest/haskellhutt/" display-uri="haskellhutt" type="local">Graham Hutton</fr:link>, <fr:link href="/forest/danascott/" title="Dana Scott" uri="https://liamoc.net/forest/danascott/" display-uri="danascott" type="local">Dana Scott</fr:link>, <fr:link href="/forest/jstoy/" title="Joseph Stoy" uri="https://liamoc.net/forest/jstoy/" display-uri="jstoy" type="local">Joseph Stoy</fr:link>, <fr:link href="/forest/cgunter/" title="Carl Gunter" uri="https://liamoc.net/forest/cgunter/" display-uri="cgunter" type="local">Carl Gunter</fr:link>, and <fr:link href="/forest/gwinskel/" title="Glynn Winskel" uri="https://liamoc.net/forest/gwinskel/" display-uri="gwinskel" type="local">Glynn Winskel</fr:link>.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0003/</fr:uri><fr:display-uri>dt-0003</fr:display-uri><fr:route>/forest/dt-0003/</fr:route><fr:title text="Denotational semantics">Denotational semantics</fr:title></fr:frontmatter><fr:mainmatter><html:p>In this course we are concerned with programming languages, which, as with natural languages, consist of a <html:em>syntax</html:em> and <html:em>semantics</html:em>.
 The syntax of a language is, for our purposes, merely an inductively-defined tree structure (i.e. abstract syntax).</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0000/</fr:uri><fr:display-uri>dt-0000</fr:display-uri><fr:route>/forest/dt-0000/</fr:route><fr:title text="The \mathcal {C} Language (without loops)">The <fr:tex display="inline"><![CDATA[\mathcal {C}]]></fr:tex> Language (without loops)</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p> Using notation similar to <html:em>Backus-Naur Form</html:em> (BNF):
<fr:tex display="block"><![CDATA[
\begin {array}{lcl}
\mathcal {E} & \Coloneqq  & n \mid  x \mid  \mathcal {E}_1 + \mathcal {E}_2 \mid  \mathcal {E}_1 - \mathcal {E}_2\\
\mathcal {B} & \Coloneqq  & \mathsf {false} \mid  \mathsf {true} \mid  \neg  \mathcal {B} \mid  \mathcal {E}_1 = \mathcal {E}_2\\
\mathcal {C} & \Coloneqq  & \mathsf {skip} \mid  x := \mathcal {E} \mid  \mathcal {C}_1 ; \mathcal {C}_2 \mid  \mathsf {if}\ \mathcal {B}\ \mathsf {then}\ \mathcal {C}_1\ \mathsf {else}\ \mathcal {C}_2\\
x & \in  & \mathcal {V}\; \textit {(variables)}\\
n & \in  & \mathbb {N}
\end {array}
]]></fr:tex></html:p></fr:mainmatter></fr:tree><html:p>In the language above, there are three <html:em>syntactic classes</html:em>: <fr:tex display="inline"><![CDATA[\mathcal {E}]]></fr:tex>, <fr:tex display="inline"><![CDATA[\mathcal {B}]]></fr:tex>, and <fr:tex display="inline"><![CDATA[\mathcal {C}]]></fr:tex>.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0001/</fr:uri><fr:display-uri>dt-0001</fr:display-uri><fr:route>/forest/dt-0001/</fr:route><fr:title text="Denotational semantics">Denotational semantics</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>A <html:em>denotational semantics</html:em> consists of, for each syntactic class <fr:tex display="inline"><![CDATA[\mathcal {X}]]></fr:tex> in a language:
<html:ol><html:li>A <html:em>semantic domain</html:em> <fr:tex display="inline"><![CDATA[D]]></fr:tex> which can be any set of mathematical objects (although, as we will see later, it is helpful if it obeys certain properties).</html:li>
<html:li>A <html:em>valuation function</html:em> <fr:tex display="inline"><![CDATA[\llbracket  \cdot  \rrbracket  : \mathcal {X} \rightarrow  D]]></fr:tex>. We require that this function be a <html:em>homomorphism</html:em>, that is that it is <html:em>compositional</html:em>. This means that the valuation (or <html:em>denotation</html:em>) of an expression should be made from the denotation of its components. In other words, for each syntactic constructor <fr:tex display="inline"><![CDATA[C(e_1,e_2,\dots )]]></fr:tex>, we should have a mathematical operation <fr:tex display="inline"><![CDATA[f(x_1,x_2,\dots )]]></fr:tex> such that the denotation of <fr:tex display="inline"><![CDATA[C]]></fr:tex> can be defined as: <fr:tex display="block"><![CDATA[\llbracket  C(e_1, e_2, \dots ) \rrbracket  = f(\llbracket  e_1 \rrbracket , \llbracket  e_2 \rrbracket , \dots )]]></fr:tex></html:li></html:ol></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0002/</fr:uri><fr:display-uri>dt-0002</fr:display-uri><fr:route>/forest/dt-0002/</fr:route><fr:taxon>Remark</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>The choices of semantic domain and valuation function are, essentially, arbitrary: we choose objects that reflect those aspects of our programs that we are interested in. For most of the simple languages we will examine, we are only concerned with the <html:em>results</html:em> of the computation, which is a semantics suitable for reasoning about program behaviour and correctness. However, there also exist denotational <html:em>cost models</html:em> that compositionally assign a measure of program performance to syntax. This measure is just another kind of <fr:link href="/forest/dt-0001/" title="Denotational semantics" uri="https://liamoc.net/forest/dt-0001/" display-uri="dt-0001" type="local">denotational semantics</fr:link>.</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0004/</fr:uri><fr:display-uri>dt-0004</fr:display-uri><fr:route>/forest/dt-0004/</fr:route><fr:title text="Denotational semantics for the \mathcal {C} language (without loops)"><fr:link href="/forest/dt-0001/" title="Denotational semantics" uri="https://liamoc.net/forest/dt-0001/" display-uri="dt-0001" type="local">Denotational semantics</fr:link> for <fr:link href="/forest/dt-0000/" title="The \mathcal {C} Language (without loops)" uri="https://liamoc.net/forest/dt-0000/" display-uri="dt-0000" type="local">the <fr:tex display="inline"><![CDATA[\mathcal {C}]]></fr:tex> language (without loops)</fr:link></fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>We shall first select a semantic domain for each syntactic class:
<fr:tex display="block"><![CDATA[
\begin {array}{lcl}
	\mathbf {E} & \triangleq  & \Sigma  \rightarrow  \mathbb {Z} \\
    \mathbf {B} & \triangleq  & \Sigma  \rightarrow  \mathbb {B} \\
    \mathbf {C} & \triangleq  & \Sigma  \rightarrow  \Sigma  \\
\end {array}
]]></fr:tex>
Here, <fr:tex display="inline"><![CDATA[\Sigma ]]></fr:tex> represents the set of <html:em>states</html:em>, which contains the values assigned to all variables:
<fr:tex display="block"><![CDATA[\Sigma  \;\triangleq \; \mathcal {V} \rightarrow  \mathbb {Z}]]></fr:tex></html:p><html:p>Now, we define our <html:em>valuation functions</html:em>,
<fr:tex display="inline"><![CDATA[
\llbracket \cdot \rrbracket _\mathcal {E} : \mathcal {E} \rightarrow  \mathbf {E}
]]></fr:tex>:
<fr:tex display="block"><![CDATA[
\begin {array}{lcl}
	\llbracket  n \rrbracket _\mathcal {E}\ \sigma  & = & n \\
	\llbracket  x \rrbracket _\mathcal {E}\ \sigma  & = & \sigma (x) \\
	\llbracket  e_1 + e_2 \rrbracket _\mathcal {E}\ \sigma  & = & \llbracket  e_1 \rrbracket _\mathcal {E}\ \sigma  + \llbracket  e_2 \rrbracket _\mathcal {E}\ \sigma \\
	\llbracket  e_1 - e_2 \rrbracket _\mathcal {E}\ \sigma  & = & \llbracket  e_1 \rrbracket _\mathcal {E}\ \sigma  - \llbracket  e_2 \rrbracket _\mathcal {E}\ \sigma \\[2em]
\end {array}
]]></fr:tex>
and <fr:tex display="inline"><![CDATA[\llbracket \cdot \rrbracket _\mathcal {B} : \mathcal {B} \rightarrow  \mathbf {B}]]></fr:tex>:
<fr:tex display="block"><![CDATA[
\begin {array}{lcl}
	\llbracket  \mathsf {false} \rrbracket _\mathcal {B}\ \sigma  & = & \mathit {F} \\
	\llbracket  \mathsf {true} \rrbracket _\mathcal {B}\ \sigma  & = & \mathit {T} \\
	\llbracket  \neg  b \rrbracket _\mathcal {B}\ \sigma  & = & \begin {cases}\mathit {F} & \text {if}\ \llbracket  b \rrbracket _\mathcal {B}\ \sigma  = \mathit {T} \\
  			\mathit {T} & \text {otherwise}
 \end {cases}
\\[1.1em]
	\llbracket  e_1 = e_2 \rrbracket _\mathcal {B}\ \sigma  & = & \begin {cases}\mathit {T} & \text {if}\ \llbracket  e_1 \rrbracket _\mathcal {E}\ \sigma  = \llbracket  e_2 \rrbracket _\mathcal {E}\ \sigma  \\
  			\mathit {F} & \text {otherwise}
 \end {cases}
 \end {array}
]]></fr:tex>
and <fr:tex display="inline"><![CDATA[\llbracket \cdot \rrbracket _\mathcal {C} : \mathcal {C} \rightarrow  \mathbf {C}]]></fr:tex>:
<fr:tex display="block"><![CDATA[
\begin {array}{lcl}
	\llbracket  \mathsf {skip} \rrbracket _\mathcal {C}\ \sigma  & = & \sigma  \\
	\llbracket  x := e \rrbracket _\mathcal {C}\ \sigma  & = & \sigma \left (x \mapsto  \llbracket  e \rrbracket _\mathcal {E}\right ) \\
	\llbracket  c_1 ; c_2 \rrbracket _\mathcal {C}\ \sigma  & = & \llbracket  c_2 \rrbracket _\mathcal {C}\ \left (\llbracket  c_1 \rrbracket _\mathcal {C}\ \sigma \right ) \\[0.3em]
	\llbracket  \textsf {if}\ b\ \textsf {then}\ c_1\ \textsf {else}\ c_2 \rrbracket _\mathcal {C}\ \sigma  & = & \begin {cases}\llbracket  c_1 \rrbracket _\mathcal {C}\ \sigma  & \text {if}\ \llbracket  b \rrbracket _\mathcal {B}\ \sigma  = \mathit {T} \\
  			\llbracket  c_2 \rrbracket _\mathcal {C}\ \sigma  & \text {otherwise}
 \end {cases}
 \end {array}
]]></fr:tex></html:p></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-000L/</fr:uri><fr:display-uri>dt-000L</fr:display-uri><fr:route>/forest/dt-000L/</fr:route><fr:title text="Recursion">Recursion</fr:title></fr:frontmatter><fr:mainmatter><html:p>So far, our semantic domains have just been (functions of) <html:em>sets</html:em>. While these have the advantage of being mathematically simple and intuitive, two language features make these sets insufficient for our purposes:
<html:ol><html:li><html:em>Recursively defined programs</html:em>, for dealing with recursion and loops, and</html:li>
<html:li><html:em>Recursively defined semantic domains</html:em>, for dealing with <html:em>higher-order</html:em> programs.</html:li></html:ol></html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0006/</fr:uri><fr:display-uri>dt-0006</fr:display-uri><fr:route>/forest/dt-0006/</fr:route><fr:title text="Recursively defined programs">Recursively defined programs</fr:title></fr:frontmatter><fr:mainmatter><html:p>
Suppose we extended <fr:link href="/forest/dt-0000/" title="The \mathcal {C} Language (without loops)" uri="https://liamoc.net/forest/dt-0000/" display-uri="dt-0000" type="local">the <fr:tex display="inline"><![CDATA[\mathcal {C}]]></fr:tex> language</fr:link> with a while loop construct:
<fr:tex display="block"><![CDATA[
\mathcal {C}\; \Coloneqq \; \cdots  \mid  \mathsf {while}\ \mathcal {B}\ \mathsf {do}\ \mathcal {C}\ \mathsf {od}
]]></fr:tex>
The intuitive way to assign a semantics would be to use a <html:em>recursive function</html:em>:
<fr:tex display="block"><![CDATA[
\llbracket  \mathsf {while}\ b\ \mathsf {do}\ c\ \mathsf {od} \rrbracket _\mathcal {C}\ \sigma \; = \; \begin {cases}  \llbracket  \mathsf {while}\ b\ \mathsf {do}\ c\ \mathsf {od} \rrbracket _\mathcal {C}\ (\llbracket  c \rrbracket _\mathcal {C}\ \sigma ) & \text {if}\ \llbracket  b \rrbracket _\mathcal {B}\ \sigma  = \mathit {T} \\
  	     \sigma  & \text {otherwise}
 \end {cases}
]]></fr:tex>
However, such an equation is not a good definition. If we consider the trivial infinite loop program <fr:tex display="inline"><![CDATA[L \triangleq  \mathsf {while}\ \mathsf {true}\ \mathsf {do}\ \mathsf {skip}\ \mathsf {od}]]></fr:tex>, and compute its semantics, we end up with:
<fr:tex display="block"><![CDATA[
\llbracket  \mathsf {while}\ \mathsf {true}\ \mathsf {do}\ \mathsf {skip}\ \mathsf {od} \rrbracket _\mathcal {C}\ \sigma  \; = \; \llbracket  \mathsf {while}\ \mathsf {true}\ \mathsf {do}\ \mathsf {skip}\ \mathsf {od} \rrbracket _\mathcal {C}\ \sigma 
]]></fr:tex>
This equation is satisfied by <html:em>any</html:em> function <fr:tex display="inline"><![CDATA[\Sigma  \rightarrow  \Sigma ]]></fr:tex>,
so it doesn't tell us which function corresponds to the program <fr:tex display="inline"><![CDATA[L]]></fr:tex>.</html:p><html:p>More generally, allowing our functions to be (generally) recursive causes these issues. The loop program <fr:tex display="inline"><![CDATA[L]]></fr:tex> gives rise to the recursive equation <fr:tex display="inline"><![CDATA[\ell (x) = \ell (x)]]></fr:tex>, which has an infinite number of solutions. </html:p><html:p>If we add recursion to our programming language, we could have programs that give rise to more complex recursive equations like <fr:tex display="inline"><![CDATA[f(x) = f(x) + 1]]></fr:tex>. By contrast to <fr:tex display="inline"><![CDATA[\ell (x)]]></fr:tex>, <fr:tex display="inline"><![CDATA[f(x)]]></fr:tex> <html:em>has no solutions</html:em> (assuming <fr:tex display="inline"><![CDATA[f(x)]]></fr:tex> operates on integers). </html:p>
  
  
<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Upshot</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
We need an <html:em>explicit</html:em> notion of "non-termination" on the semantics level, to properly deal with general recursion (or iteration).
</html:p></fr:mainmatter></fr:tree>
</fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0007/</fr:uri><fr:display-uri>dt-0007</fr:display-uri><fr:route>/forest/dt-0007/</fr:route><fr:title text="Recursively defined semantic domains">Recursively defined semantic domains</fr:title></fr:frontmatter><fr:mainmatter><html:p>Suppose we extend our notion of expressions in <fr:link href="/forest/dt-0000/" title="The \mathcal {C} Language (without loops)" uri="https://liamoc.net/forest/dt-0000/" display-uri="dt-0000" type="local">the <fr:tex display="inline"><![CDATA[\mathcal {C}]]></fr:tex> language</fr:link> with parameterless <html:em>higher-order</html:em> procedures:
<fr:tex display="block"><![CDATA[
\begin {array}{l}
\mathcal {E}\; \Coloneqq  \; \cdots  \mid  \mathsf {proc}\ \mathcal {C}\\
\mathcal {C}\; \Coloneqq  \; \cdots  \mid  x
\end {array}
]]></fr:tex></html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:title text="Using higher-order procedures">Using higher-order procedures</fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>We can store procedures in variables, so the program:
<fr:tex display="block"><![CDATA[\mathit {inc} := (\mathsf {proc}\ a := a + 1); \mathit {inc}; \mathit {inc}]]></fr:tex>
has the same effects on the variable <fr:tex display="inline"><![CDATA[a]]></fr:tex> as the program:
<fr:tex display="block"><![CDATA[a := a + 1; a := a + 1]]></fr:tex></html:p></fr:mainmatter></fr:tree><html:p>For our <fr:link href="/forest/dt-0001/" title="Denotational semantics" uri="https://liamoc.net/forest/dt-0001/" display-uri="dt-0001" type="local">denotational semantics</fr:link>, our domains now take this form (<fr:tex display="inline"><![CDATA[\textcolor {blue}{\text {blue}}]]></fr:tex> parts are new vs. <fr:link href="/forest/dt-0004/" title="Denotational semantics for the \mathcal {C} language (without loops)" uri="https://liamoc.net/forest/dt-0004/" display-uri="dt-0004" type="local">Example <fr:contextual-number uri="https://liamoc.net/forest/dt-0004/" display-uri="dt-0004" /></fr:link>), where <fr:tex display="inline"><![CDATA[\uplus ]]></fr:tex> denotes <html:em>disjoint union</html:em>:
<fr:tex display="block"><![CDATA[
\begin {array}{lcl}
	\mathbf {E} & \triangleq  & \Sigma  \rightarrow  \mathbb {Z}\textcolor {blue}{\ \uplus \ \mathbf {C}}\\
    \mathbf {B} & \triangleq  & \Sigma  \rightarrow  \mathbb {B} \\
    \mathbf {C} & \triangleq  & \Sigma  \rightarrow  \Sigma  \\[0.2em]
    \Sigma   & \triangleq  & \mathcal {V} \rightarrow  \mathbb {Z}\textcolor {blue}{\ \uplus \ \mathbf {C}}
\end {array}
]]></fr:tex>
<fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-000P/</fr:uri><fr:display-uri>dt-000P</fr:display-uri><fr:route>/forest/dt-000P/</fr:route><fr:taxon>Exercise</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Give a semantics to the <fr:tex display="inline"><![CDATA[\mathsf {proc}]]></fr:tex> construct:
	<html:ol><html:li><fr:tex display="inline"><![CDATA[\llbracket  \mathsf {proc}\ c \rrbracket _\mathcal {E}\ \sigma \ =\ ?]]></fr:tex></html:li>
	<html:li><fr:tex display="inline"><![CDATA[\llbracket  x \rrbracket _\mathcal {C}\ \sigma \ =\ ?]]></fr:tex></html:li></html:ol>

	
	
	
	<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter><html:ol><html:li><fr:tex display="inline"><![CDATA[\llbracket  \mathsf {proc}\ c \rrbracket _\mathcal {E}\ \sigma \ =\ \llbracket  c \rrbracket _\mathcal {C}]]></fr:tex></html:li>
		<html:li><fr:tex display="inline"><![CDATA[\llbracket  x \rrbracket _\mathcal {C}\ \sigma \ =\ \sigma (x)(\sigma )]]></fr:tex></html:li></html:ol></fr:mainmatter></fr:tree></html:p></fr:mainmatter></fr:tree>
Unfolding the definition of <fr:tex display="inline"><![CDATA[\Sigma ]]></fr:tex>, we end up with a recursive equation for the definition of <fr:tex display="inline"><![CDATA[\mathbf {C}]]></fr:tex>:
<fr:tex display="block"><![CDATA[\mathbf {C} \; = \; (\mathcal {V} \rightarrow  (\mathbb {Z} \uplus  \mathbf {C})) \rightarrow  (\mathcal {V} \rightarrow  (\mathbb {Z} \uplus  \mathbf {C}))]]></fr:tex>
Such equations have <html:em>no</html:em> set-theoretic solution, even if we weaken equality to mere <fr:link href="/forest/dm-000B/" title="Set isomorphism" uri="https://liamoc.net/forest/dm-000B/" display-uri="dm-000B" type="local">set isomorphism</fr:link> (here notated <fr:tex display="inline"><![CDATA[\simeq ]]></fr:tex>).
</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:title text="A simpler equation with no solution">A simpler equation with no solution</fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Consider the recursive equation <fr:tex display="inline"><![CDATA[X = X \rightarrow  \mathbb {B}]]></fr:tex>. Cantor's theorem says that there is no set <fr:tex display="inline"><![CDATA[X]]></fr:tex> such that <fr:tex display="inline"><![CDATA[X \simeq  \mathcal {P}(X)]]></fr:tex> (where <fr:tex display="inline"><![CDATA[\mathcal {P}(X)]]></fr:tex> is the <fr:link href="/forest/dm-0006/" title="Power set" uri="https://liamoc.net/forest/dm-0006/" display-uri="dm-0006" type="local">power set</fr:link> of <fr:tex display="inline"><![CDATA[X]]></fr:tex>), and seeing as <fr:tex display="inline"><![CDATA[\mathcal {P}(X) \simeq  (X \rightarrow  \mathbb {B})]]></fr:tex> it follows that <fr:tex display="inline"><![CDATA[X = X \rightarrow  \mathbb {B}]]></fr:tex> has no solution.</html:p></fr:mainmatter></fr:tree><html:p>Any kind of <html:em>higher-order</html:em> construct leads to such recursive domain equations.</html:p>
  
  
<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Upshot</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
	There are no (nontrivial) set-theoretic solutions to the recursive domain equations that arise from <html:em>higher-order</html:em> language constructs.
</html:p></fr:mainmatter></fr:tree>
</fr:mainmatter></fr:tree><html:p>We will return to this problem later on! For now, let's focus on representing non-termination.</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0009/</fr:uri><fr:display-uri>dt-0009</fr:display-uri><fr:route>/forest/dt-0009/</fr:route><fr:title text="Flat domains and information ordering">Flat domains and information ordering</fr:title></fr:frontmatter><fr:mainmatter><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-000A/</fr:uri><fr:display-uri>dt-000A</fr:display-uri><fr:route>/forest/dt-000A/</fr:route><fr:title text="The bottom value">The bottom value</fr:title></fr:frontmatter><fr:mainmatter><html:p>Following <fr:link href="/forest/danascott/" title="Dana Scott" uri="https://liamoc.net/forest/danascott/" display-uri="danascott" type="local">Scott</fr:link>, we introduce a special <html:em>bottom</html:em> value <fr:tex display="inline"><![CDATA[\bot ]]></fr:tex> to our semantic domains.
<fr:tex display="block"><![CDATA[\bot \ \text {represents}\ \begin {cases}\text {an undefined value;}\\\text {an error value;}\\\text {a \emph {non-terminating} computation.} \end {cases}]]></fr:tex></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0008/</fr:uri><fr:display-uri>dt-0008</fr:display-uri><fr:route>/forest/dt-0008/</fr:route><fr:title text="Flat domain">Flat domain</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Given a set <fr:tex display="inline"><![CDATA[X]]></fr:tex>, the <html:em>flat domain</html:em> (or <html:em>lifted set</html:em>) <fr:tex display="inline"><![CDATA[X_\bot ]]></fr:tex> is just the set <fr:tex display="inline"><![CDATA[X \cup  \{ \bot  \}]]></fr:tex> (where <fr:tex display="inline"><![CDATA[\bot  \notin  X]]></fr:tex>).</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-000B/</fr:uri><fr:display-uri>dt-000B</fr:display-uri><fr:route>/forest/dt-000B/</fr:route><fr:title text="Information ordering">Information ordering</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>An information ordering is a <fr:link href="/forest/dm-0000/" title="Partial order" uri="https://liamoc.net/forest/dm-0000/" display-uri="dm-0000" type="local">partial order</fr:link> on denotations, written <fr:tex display="inline"><![CDATA[a \sqsubseteq  b]]></fr:tex>. This indicates that <fr:tex display="inline"><![CDATA[b]]></fr:tex> is <html:em>approximated by</html:em>, or carries <html:em>more information</html:em> than, or is <html:em>more well-defined</html:em> than <fr:tex display="inline"><![CDATA[a]]></fr:tex>.
Naturally, <fr:link href="/forest/dt-000A/" title="The bottom value" uri="https://liamoc.net/forest/dt-000A/" display-uri="dt-000A" type="local">the bottom value</fr:link>, being totally uninformative, is always the least element in this ordering.</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-000C/</fr:uri><fr:display-uri>dt-000C</fr:display-uri><fr:route>/forest/dt-000C/</fr:route><fr:title text="Information ordering for flat domains">Information ordering for flat domains</fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Consider a <fr:link href="/forest/dt-0008/" title="Flat domain" uri="https://liamoc.net/forest/dt-0008/" display-uri="dt-0008" type="local">flat domain</fr:link> <fr:tex display="inline"><![CDATA[X_\bot ]]></fr:tex>. There is a natural <fr:link href="/forest/dt-000B/" title="Information ordering" uri="https://liamoc.net/forest/dt-000B/" display-uri="dt-000B" type="local">information ordering</fr:link> <fr:tex display="inline"><![CDATA[\sqsubseteq ]]></fr:tex> on <fr:tex display="inline"><![CDATA[X_\bot ]]></fr:tex>:</html:p><html:figure><fr:resource hash="634f6dd9d4785b8e60049475eebaf8ec"><fr:resource-content><html:img src="/forest/634f6dd9d4785b8e60049475eebaf8ec.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[\begin {tikzpicture}
	\node  (d1) at (-1,0) {$\cdots $};
	\node  (d2) at (4,0) {$\cdots $};
		\node  (d4) at (3.5,-1) {$\cdots $};
		\node  (d4) at (-0.5,-1) {$\cdots $};
	\node [anchor=west] (d3) at (5,-2) {(bottom)};
	\node [anchor=west] (d3) at (5,0) {(elements of $X$)};
	\node  (a1) at (0,0) {$\bullet $} ;
	\node  (a2) at (1,0) {$\bullet $} ;
	\node  (a3) at (2,0) {$\bullet $} ;
	\node  (a4) at (3,0) {$\bullet $} ;
	\node  (bot) at (1.5,-2) {$\bot $};
	\draw [ thick] (bot) -- (a1);
	\draw [ thick] (bot) -- (a2);
	\draw [ thick] (bot) -- (a3);
	\draw [ thick] (bot) -- (a4);
\end {tikzpicture}]]></fr:resource-source></fr:resource></html:figure><html:p>Formally, we say <fr:tex display="inline"><![CDATA[x \sqsubseteq  y]]></fr:tex> iff <fr:tex display="inline"><![CDATA[(x = y \lor  x = \bot )]]></fr:tex>.</html:p></fr:mainmatter></fr:tree>
  
  
<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Warning</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Don't confuse the <fr:link href="/forest/dt-000B/" title="Information ordering" uri="https://liamoc.net/forest/dt-000B/" display-uri="dt-000B" type="local">information ordering</fr:link> on numbers, i.e. <fr:tex display="inline"><![CDATA[\sqsubseteq ]]></fr:tex> on <fr:tex display="inline"><![CDATA[\mathbb {Z}_\bot ]]></fr:tex>, with the <html:em>numerical</html:em> ordering <fr:tex display="inline"><![CDATA[\leq ]]></fr:tex> on <fr:tex display="inline"><![CDATA[\mathbb {Z}]]></fr:tex>. We know <fr:tex display="inline"><![CDATA[0 \leq  1]]></fr:tex>, but <fr:tex display="inline"><![CDATA[0]]></fr:tex> and <fr:tex display="inline"><![CDATA[1]]></fr:tex> are not comparable in our flat <fr:link href="/forest/dt-000B/" title="Information ordering" uri="https://liamoc.net/forest/dt-000B/" display-uri="dt-000B" type="local">information ordering</fr:link>.</html:p></fr:mainmatter></fr:tree>
</fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-000D/</fr:uri><fr:display-uri>dt-000D</fr:display-uri><fr:route>/forest/dt-000D/</fr:route><fr:title text="Combining domains">Combining domains</fr:title></fr:frontmatter><fr:mainmatter><html:p>Some of our semantics may depend on the combination of multiple domains, i.e. semantic functions of multiple arguments. As an example, the semantics of an
<fr:tex display="inline"><![CDATA[\mathsf {if}]]></fr:tex> statement combines the semantics of the condition and the semantics of each of the two branches. In such scenarios, our domains are no longer flat — we must generalise to <fr:link href="/forest/dt-000G/" title="Pointed poset" uri="https://liamoc.net/forest/dt-000G/" display-uri="dt-000G" type="local">pointed poset</fr:link>s.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-000G/</fr:uri><fr:display-uri>dt-000G</fr:display-uri><fr:route>/forest/dt-000G/</fr:route><fr:title text="Pointed poset">Pointed poset</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>A <html:em>pointed <fr:link href="/forest/dm-0004/" title="Poset" uri="https://liamoc.net/forest/dm-0004/" display-uri="dm-0004" type="local">poset</fr:link></html:em> is a <fr:link href="/forest/dm-0004/" title="Poset" uri="https://liamoc.net/forest/dm-0004/" display-uri="dm-0004" type="local">partially ordered set</fr:link> with a <fr:link href="/forest/dt-000A/" title="The bottom value" uri="https://liamoc.net/forest/dt-000A/" display-uri="dt-000A" type="local">bottom value</fr:link>.</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-000E/</fr:uri><fr:display-uri>dt-000E</fr:display-uri><fr:route>/forest/dt-000E/</fr:route><fr:title text="Product of two pointed posets">Product of two pointed posets</fr:title><fr:taxon>Construction</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Given two <fr:link href="/forest/dt-000G/" title="Pointed poset" uri="https://liamoc.net/forest/dt-000G/" display-uri="dt-000G" type="local">pointed poset</fr:link>s <fr:tex display="inline"><![CDATA[X]]></fr:tex> and <fr:tex display="inline"><![CDATA[Y]]></fr:tex>, the <fr:link href="/forest/dm-0005/" title="Cartesian product" uri="https://liamoc.net/forest/dm-0005/" display-uri="dm-0005" type="local">product</fr:link> <fr:link href="/forest/dm-0004/" title="Poset" uri="https://liamoc.net/forest/dm-0004/" display-uri="dm-0004" type="local">poset</fr:link> <fr:tex display="inline"><![CDATA[X \times  Y]]></fr:tex> is ordered as follows:
<fr:tex display="block"><![CDATA[ (x,y) \sqsubseteq _{X \times  Y} (x',y') \quad  \text {iff} \quad  x \sqsubseteq _X x' \land  y \sqsubseteq _Y y' ]]></fr:tex>
Intuitively, this says that "the information content of a pair of values is increased by increasing the information of either or both of its component values".</html:p><html:p>This <fr:link href="/forest/dm-0005/" title="Cartesian product" uri="https://liamoc.net/forest/dm-0005/" display-uri="dm-0005" type="local">product</fr:link> <fr:link href="/forest/dm-0004/" title="Poset" uri="https://liamoc.net/forest/dm-0004/" display-uri="dm-0004" type="local">poset</fr:link> is also pointed, with bottom value <fr:tex display="inline"><![CDATA[\bot _{X \times  Y}]]></fr:tex> being <fr:tex display="inline"><![CDATA[(\bot _A, \bot _B)]]></fr:tex>.</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-000F/</fr:uri><fr:display-uri>dt-000F</fr:display-uri><fr:route>/forest/dt-000F/</fr:route><fr:title text="The domain \mathbb {B}_\bot  \times  \mathbb {B}_\bot ">The domain <fr:tex display="inline"><![CDATA[\mathbb {B}_\bot  \times  \mathbb {B}_\bot ]]></fr:tex></fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter><html:figure><fr:resource hash="beee880c0f10740e899aaf678987771d"><fr:resource-content><html:img src="/forest/beee880c0f10740e899aaf678987771d.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzpicture}
	\node  (ff) at (0,1) {$(F,F)$};
	\node  (ft) at (1.5,1) {$(F,T)$};
	\node  (tf) at (3,1) {$(T,F)$};
	\node  (tt) at (4.5,1) {$(T,T)$};
	\node  (fb) at (0,-1) {$(F,\bot )$};
	\node  (bt) at (1.5,-1) {$(\bot ,T)$};
	\node  (bf) at (3,-1) {$(\bot ,F)$};
	\node  (tb) at (4.5,-1) {$(T,\bot )$};
	\node  (bb) at (2.25,-3) {$(\bot ,\bot )$};
	\draw [thick] (bb) -- (fb)
				 (bb) -- (bt)
				 (bb) -- (bf)
				 (bb) -- (tb)
				 (fb.north) -- (ft)
				 (fb.north) -- (ff)
				 (bt.north) -- (tt)
				 (bt.north) -- (ft);
	\draw [thick,preaction={draw, line width=5pt, white}] (bf.north) -- (ff)
					 (bf.north) -- (tf)
				 (tb.north) -- (tt)
				 (tb.north) -- (tf);
\end {tikzpicture}
]]></fr:resource-source></fr:resource></html:figure><html:p>As can be seen above, the domain <fr:tex display="inline"><![CDATA[\mathbb {B}_\bot  \times  \mathbb {B}_\bot ]]></fr:tex> is not flat, but it is still a <fr:link href="/forest/dt-000G/" title="Pointed poset" uri="https://liamoc.net/forest/dt-000G/" display-uri="dt-000G" type="local">pointed poset</fr:link>.</html:p></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-000H/</fr:uri><fr:display-uri>dt-000H</fr:display-uri><fr:route>/forest/dt-000H/</fr:route><fr:title text="Monotonic functions">Monotonic functions</fr:title></fr:frontmatter><fr:mainmatter><html:p>If we model our semantic domains for values with <fr:link href="/forest/dt-000G/" title="Pointed poset" uri="https://liamoc.net/forest/dt-000G/" display-uri="dt-000G" type="local">pointed poset</fr:link>s, then programs are modelled by functions between such <fr:link href="/forest/dm-0004/" title="Poset" uri="https://liamoc.net/forest/dm-0004/" display-uri="dm-0004" type="local">poset</fr:link>s. But, not all functions are suitable:</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-000I/</fr:uri><fr:display-uri>dt-000I</fr:display-uri><fr:route>/forest/dt-000I/</fr:route><fr:title text="The halting query">The halting query</fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>The function <fr:tex display="inline"><![CDATA[H : \mathbb {B}_\bot  \rightarrow  \mathbb {B}_\bot ]]></fr:tex> seems to let us solve the halting problem, assuming <fr:tex display="inline"><![CDATA[\bot ]]></fr:tex> represents non-termination:
<fr:tex display="block"><![CDATA[
	H(v) \; = \; \begin {cases} F & \text {if}\ v = \bot  \\ T & \text {otherwise} \end {cases}
]]></fr:tex></html:p></fr:mainmatter></fr:tree><html:p>It stands to reason that the amount of information we get out of our functions should grow as we increase the amount of information we put into them.
Such functions are called <html:em>monotonic</html:em> with respect to our <fr:link href="/forest/dt-000B/" title="Information ordering" uri="https://liamoc.net/forest/dt-000B/" display-uri="dt-000B" type="local">information ordering</fr:link>.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-000J/</fr:uri><fr:display-uri>dt-000J</fr:display-uri><fr:route>/forest/dt-000J/</fr:route><fr:title text="Monotonicity">Monotonicity</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>A function <fr:tex display="inline"><![CDATA[f : X \rightarrow  Y]]></fr:tex> between <fr:link href="/forest/dm-0004/" title="Poset" uri="https://liamoc.net/forest/dm-0004/" display-uri="dm-0004" type="local">poset</fr:link>s <fr:tex display="inline"><![CDATA[X]]></fr:tex> and <fr:tex display="inline"><![CDATA[Y]]></fr:tex> is <html:em>monotone</html:em> (or <html:em>monotonic</html:em>) if, for all <fr:tex display="inline"><![CDATA[x, y \in  X]]></fr:tex>:
<fr:tex display="block"><![CDATA[ x \sqsubseteq  y\; \text {implies}\; f(x) \sqsubseteq  f(y) ]]></fr:tex></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-000K/</fr:uri><fr:display-uri>dt-000K</fr:display-uri><fr:route>/forest/dt-000K/</fr:route><fr:title text="Strictness">Strictness</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>A function <fr:tex display="inline"><![CDATA[f : X \rightarrow  Y]]></fr:tex> on pointed posets <fr:tex display="inline"><![CDATA[X]]></fr:tex> and <fr:tex display="inline"><![CDATA[Y]]></fr:tex> is <html:em>strict</html:em> if it preserves <fr:link href="/forest/dt-000A/" title="The bottom value" uri="https://liamoc.net/forest/dt-000A/" display-uri="dt-000A" type="local">the bottom value</fr:link>, i.e. <fr:tex display="inline"><![CDATA[f(\bot _X) = \bot _Y]]></fr:tex>. </html:p></fr:mainmatter></fr:tree>
  
  
<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Thesis</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Computable functions are <fr:link href="/forest/dt-000J/" title="Monotonicity" uri="https://liamoc.net/forest/dt-000J/" display-uri="dt-000J" type="local">monotonic</fr:link> (observe that <fr:tex display="inline"><![CDATA[H]]></fr:tex> is not).	</html:p></fr:mainmatter></fr:tree>
<fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-000N/</fr:uri><fr:display-uri>dt-000N</fr:display-uri><fr:route>/forest/dt-000N/</fr:route><fr:taxon>Exercise</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Consider the functions <fr:tex display="inline"><![CDATA[\mathbb {B}_\bot  \rightarrow  \mathbb {B}_\bot ]]></fr:tex>. Which ones are <fr:link href="/forest/dt-000J/" title="Monotonicity" uri="https://liamoc.net/forest/dt-000J/" display-uri="dt-000J" type="local">monotonic</fr:link>? There are a total of 27 such functions but only three significant classes.</html:p>



<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>The three classes are the nine <fr:link href="/forest/dt-000K/" title="Strictness" uri="https://liamoc.net/forest/dt-000K/" display-uri="dt-000K" type="local">strict</fr:link> functions (which map <fr:tex display="inline"><![CDATA[\bot ]]></fr:tex> to <fr:tex display="inline"><![CDATA[\bot ]]></fr:tex>), which are all <fr:link href="/forest/dt-000J/" title="Monotonicity" uri="https://liamoc.net/forest/dt-000J/" display-uri="dt-000J" type="local">monotonic</fr:link>, the two non-strict constant functions (which ignore their input and return <fr:tex display="inline"><![CDATA[\mathit {T}]]></fr:tex> and <fr:tex display="inline"><![CDATA[\mathit {F}]]></fr:tex> respectively), which are also monotonic, and the 16 non-monotonic functions.</html:p></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-000O/</fr:uri><fr:display-uri>dt-000O</fr:display-uri><fr:route>/forest/dt-000O/</fr:route><fr:taxon>Exercise</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Let <fr:tex display="inline"><![CDATA[\mathbf {K}_K]]></fr:tex> denote the chain of values <fr:tex display="inline"><![CDATA[x_1, x_2, x_3, \dots , x_K]]></fr:tex> where <fr:tex display="inline"><![CDATA[a \leq  b]]></fr:tex> implies <fr:tex display="inline"><![CDATA[x_a \sqsubseteq  x_b]]></fr:tex>. There is one <fr:link href="/forest/dt-000J/" title="Monotonicity" uri="https://liamoc.net/forest/dt-000J/" display-uri="dt-000J" type="local">monotonic</fr:link> function <fr:tex display="inline"><![CDATA[\mathbf {K}_1 \rightarrow  \mathbf {K}_1]]></fr:tex>:</html:p><html:figure><fr:resource hash="2745a0420a5e3ed0d798258bb77dcb48"><fr:resource-content><html:img src="/forest/2745a0420a5e3ed0d798258bb77dcb48.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzpicture}
	\node  (a) at (0,0) {$\bullet $};
	\node  (b) at (1,0) {$\bullet $};
	\draw [->,thick] (a) edge[bend left] (b);
\end {tikzpicture}]]></fr:resource-source></fr:resource></html:figure><html:p>And there are three monotonic functions <fr:tex display="inline"><![CDATA[\mathbf {K}_2 \rightarrow  \mathbf {K}_2]]></fr:tex>:</html:p><html:figure><fr:resource hash="cadeab4d92b31584b35761f5d8ddbe22"><fr:resource-content><html:img src="/forest/cadeab4d92b31584b35761f5d8ddbe22.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzpicture}
	\node  (a) at (0,0) {$\bullet $};
	\node  (b) at (1,0) {$\bullet $};
		\node  (a1) at (0,1) {$\bullet $};
	\node  (b1) at (1,1) {$\bullet $};
	\draw [->,thick] (a) edge (b);
					\draw [thick] (b) edge (b1);
		\draw [thick] (a) edge (a1);
	\draw [->,thick] (a1) edge (b1);
\end {tikzpicture}$\quad $
\begin {tikzpicture}
	\node  (a) at (0,0) {$\bullet $};
	\node  (b) at (1,0) {$\bullet $};
		\node  (a1) at (0,1) {$\bullet $};
	\node  (b1) at (1,1) {$\bullet $};
					\draw [thick] (b) edge (b1);
	\draw [->,thick] (a) edge (b);
		\draw [thick] (a) edge (a1);
	\draw [->,thick] (a1) edge (b);
\end {tikzpicture}$\quad $
\begin {tikzpicture}
	\node  (a) at (0,0) {$\bullet $};
	\node  (b) at (1,0) {$\bullet $};
		\node  (a1) at (0,1) {$\bullet $};
	\node  (b1) at (1,1) {$\bullet $};
	\draw [->,thick] (a) edge (b1);
		\draw [thick] (a) edge (a1);
				\draw [thick] (b) edge (b1);
	\draw [->,thick] (a1) edge (b1);
\end {tikzpicture}
]]></fr:resource-source></fr:resource></html:figure><html:ol><html:li> Write down the monotonic functions <fr:tex display="inline"><![CDATA[\mathbf {K}_3 \rightarrow  \mathbf {K}_3]]></fr:tex>.</html:li>
	
	
	
	
	<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>When drawn as a diagram like the above, the monotonic functions are all those whose lines do not cross.</html:p></fr:mainmatter></fr:tree>
	<html:li> Write a simple recursive program to calculate the number of monotonic functions <fr:tex display="inline"><![CDATA[\mathbf {K}_n \rightarrow  \mathbf {K}_m]]></fr:tex>.</html:li>
	
	
	
	
	<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>In Haskell:</html:p><html:pre>monotonics :: Int -&gt; Int -&gt; Int
monotonics n 1 = 1
monotonics n m = sum [monotonics (n-x) (m-1) | x &lt;- [0..n]]</html:pre></fr:mainmatter></fr:tree></html:ol></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-000U/</fr:uri><fr:display-uri>dt-000U</fr:display-uri><fr:route>/forest/dt-000U/</fr:route><fr:title text="Fixed points">Fixed points</fr:title></fr:frontmatter><fr:mainmatter><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-000R/</fr:uri><fr:display-uri>dt-000R</fr:display-uri><fr:route>/forest/dt-000R/</fr:route><fr:title text="From recursion to fixed points">From recursion to fixed points</fr:title></fr:frontmatter><fr:mainmatter><html:p>
Consider our recursive <fr:tex display="inline"><![CDATA[\mathsf {while}]]></fr:tex> loop semantics from <fr:link href="/forest/dt-0006/" title="Recursively defined programs" uri="https://liamoc.net/forest/dt-0006/" display-uri="dt-0006" type="local">§ <fr:contextual-number uri="https://liamoc.net/forest/dt-0006/" display-uri="dt-0006" /></fr:link>:

<fr:tex display="block"><![CDATA[
\llbracket  \mathsf {while}\ b\ \mathsf {do}\ c\ \mathsf {od} \rrbracket _\mathcal {C}\ \sigma \; = \; \begin {cases}  \llbracket  \mathsf {while}\ b\ \mathsf {do}\ c\ \mathsf {od} \rrbracket _\mathcal {C}\ (\llbracket  c \rrbracket _\mathcal {C}\ \sigma ) & \text {if}\ \llbracket  b \rrbracket _\mathcal {B}\ \sigma  = \mathit {T} \\
  	     \sigma  & \text {otherwise}
 \end {cases}
]]></fr:tex>
How do we ensure that solutions exist for such recursive equations? And, if multiple solutions exist, how do we decide which one to pick? To address these questions, let's factor out everything in our definition except the recursion into a separate (higher-order) function:
<fr:tex display="block"><![CDATA[
\begin {array}{l}
\llbracket  \mathsf {while}\ b\ \mathsf {do}\ c\ \mathsf {od} \rrbracket _\mathcal {C} = f(\llbracket  \mathsf {while}\ b\ \mathsf {do}\ c\ \mathsf {od} \rrbracket _\mathcal {C}) \\[0.5em]
\qquad  \text {where}\; f(X)\ \sigma \; \triangleq  \; \begin {cases}  X\ (\llbracket  c \rrbracket _\mathcal {C}\ \sigma ) & \text {if}\ \llbracket  b \rrbracket _\mathcal {B}\ \sigma  = \mathit {T} \\
  	     \sigma  & \text {otherwise}
 \end {cases}
\end {array}
]]></fr:tex>
Looking at it this way, we can see that any solution to this equation must be an element of our semantic domain <fr:tex display="inline"><![CDATA[X \in  \mathbf {C}]]></fr:tex> such that <fr:tex display="inline"><![CDATA[f(X) = X]]></fr:tex>. In other words, the problem of finding solutions to our recursive equations can be cast as the problem of finding a <fr:link href="/forest/dt-000S/" title="Fixed point" uri="https://liamoc.net/forest/dt-000S/" display-uri="dt-000S" type="local">fixed point</fr:link> for <html:em>non-recursive</html:em> higher-order functions.
</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-000S/</fr:uri><fr:display-uri>dt-000S</fr:display-uri><fr:route>/forest/dt-000S/</fr:route><fr:title text="Fixed point">Fixed point</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>A value <fr:tex display="inline"><![CDATA[x]]></fr:tex> is a <html:em>fixed point</html:em> of a function <fr:tex display="inline"><![CDATA[f]]></fr:tex> if <fr:tex display="inline"><![CDATA[f(x) = x]]></fr:tex>.
</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-000T/</fr:uri><fr:display-uri>dt-000T</fr:display-uri><fr:route>/forest/dt-000T/</fr:route><fr:title text="Monotonicity is insufficient">Monotonicity is insufficient</fr:title></fr:frontmatter><fr:mainmatter><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-000Q/</fr:uri><fr:display-uri>dt-000Q</fr:display-uri><fr:route>/forest/dt-000Q/</fr:route><fr:taxon>Exercise</fr:taxon></fr:frontmatter><fr:mainmatter><html:ol><html:li>Give an example of a <fr:link href="/forest/dm-0004/" title="Poset" uri="https://liamoc.net/forest/dm-0004/" display-uri="dm-0004" type="local">poset</fr:link> <fr:tex display="inline"><![CDATA[A]]></fr:tex> and a <fr:link href="/forest/dt-000J/" title="Monotonicity" uri="https://liamoc.net/forest/dt-000J/" display-uri="dt-000J" type="local">monotonic</fr:link> function <fr:tex display="inline"><![CDATA[f : A \rightarrow  A]]></fr:tex> such that <fr:tex display="inline"><![CDATA[f]]></fr:tex> <html:em>doesn't</html:em> have a <fr:link href="/forest/dt-000S/" title="Fixed point" uri="https://liamoc.net/forest/dt-000S/" display-uri="dt-000S" type="local">fixed point</fr:link>.




<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>In the poset <fr:tex display="inline"><![CDATA[(\mathbb {N},\leq )]]></fr:tex>, the function <fr:tex display="inline"><![CDATA[f(x) = x + 1]]></fr:tex> has no fixed points.</html:p></fr:mainmatter></fr:tree></html:li>
<html:li>Give an example of a <fr:link href="/forest/dm-0004/" title="Poset" uri="https://liamoc.net/forest/dm-0004/" display-uri="dm-0004" type="local">poset</fr:link> <fr:tex display="inline"><![CDATA[A]]></fr:tex> and a  <fr:link href="/forest/dt-000J/" title="Monotonicity" uri="https://liamoc.net/forest/dt-000J/" display-uri="dt-000J" type="local">monotonic</fr:link> function <fr:tex display="inline"><![CDATA[f : A \rightarrow  A]]></fr:tex> such that <fr:tex display="inline"><![CDATA[f]]></fr:tex> has <html:em>multiple</html:em> <fr:link href="/forest/dt-000S/" title="Fixed point" uri="https://liamoc.net/forest/dt-000S/" display-uri="dt-000S" type="local">fixed point</fr:link>s.</html:li>




<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>In the poset <fr:tex display="inline"><![CDATA[(\mathbb {N},\leq )]]></fr:tex>, the function <fr:tex display="inline"><![CDATA[f(x) = x]]></fr:tex> has infinitely many fixed points.</html:p></fr:mainmatter></fr:tree></html:ol></fr:mainmatter></fr:tree>
  
  
<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Problem</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Not all <fr:link href="/forest/dt-000J/" title="Monotonicity" uri="https://liamoc.net/forest/dt-000J/" display-uri="dt-000J" type="local">monotonic</fr:link> functions on <fr:link href="/forest/dm-0004/" title="Poset" uri="https://liamoc.net/forest/dm-0004/" display-uri="dm-0004" type="local">posets</fr:link> have <fr:link href="/forest/dt-000S/" title="Fixed point" uri="https://liamoc.net/forest/dt-000S/" display-uri="dt-000S" type="local">fixed points</fr:link>, and some have <html:em>multiple</html:em> <fr:link href="/forest/dt-000S/" title="Fixed point" uri="https://liamoc.net/forest/dt-000S/" display-uri="dt-000S" type="local">fixed point</fr:link>s!</html:p></fr:mainmatter></fr:tree><html:p>So, requiring our functions to be monotonic is insufficient to guarantee that a single "best" solution exists. </html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:contributor><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:contributor></fr:authors><fr:uri>https://liamoc.net/forest/dt-000Y/</fr:uri><fr:display-uri>dt-000Y</fr:display-uri><fr:route>/forest/dt-000Y/</fr:route><fr:title text="Chains and Unfolding">Chains and Unfolding</fr:title></fr:frontmatter><fr:mainmatter><html:p>Intuitively, recursive programs are executed by "unfolding" as much as necessary to get a result. We would like to characterise our domains to ensure that solutions always exist, and to allow us to pick the solutions that are "minimal" in the sense that they rely on a minimal amount of unfolding.</html:p><html:p>After converting a recursive program into a non-recursive <fr:link href="/forest/dt-000J/" title="Monotonicity" uri="https://liamoc.net/forest/dt-000J/" display-uri="dt-000J" type="local">monotonic</fr:link> higher order function <fr:tex display="inline"><![CDATA[f]]></fr:tex>, the <fr:link href="/forest/dt-000S/" title="Fixed point" uri="https://liamoc.net/forest/dt-000S/" display-uri="dt-000S" type="local">fixed point</fr:link> we desire would intuitively be the <html:em>limit</html:em> of the <fr:link href="/forest/dt-000X/" title="Ascending Kleene chain" uri="https://liamoc.net/forest/dt-000X/" display-uri="dt-000X" type="local">ascending Kleene chain</fr:link> of <fr:tex display="inline"><![CDATA[f]]></fr:tex>, i.e. <fr:tex display="inline"><![CDATA[f(f(f(f(\dots ))))]]></fr:tex>: </html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors /><fr:uri>https://liamoc.net/forest/dt-000X/</fr:uri><fr:display-uri>dt-000X</fr:display-uri><fr:route>/forest/dt-000X/</fr:route><fr:title text="Ascending Kleene chain">Ascending Kleene chain</fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
	Given a <fr:link href="/forest/dt-000G/" title="Pointed poset" uri="https://liamoc.net/forest/dt-000G/" display-uri="dt-000G" type="local">pointed poset</fr:link> <fr:tex display="inline"><![CDATA[(X,\subseteq )]]></fr:tex> and a <fr:link href="/forest/dt-000J/" title="Monotonicity" uri="https://liamoc.net/forest/dt-000J/" display-uri="dt-000J" type="local">monotonic</fr:link> function <fr:tex display="inline"><![CDATA[f : X \rightarrow  X]]></fr:tex>, the <html:em>ascending Kleene chain</html:em> is the <fr:link href="/forest/dt-000W/" title="\omega -chain" uri="https://liamoc.net/forest/dt-000W/" display-uri="dt-000W" type="local"><fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-chain</fr:link>:
	<fr:tex display="block"><![CDATA[ \bot  \sqsubseteq  f(\bot ) \sqsubseteq  f(f(\bot )) \sqsubseteq  f(f(f(\bot ))) \sqsubseteq  \cdots ]]></fr:tex>
	Because <fr:tex display="inline"><![CDATA[\bot ]]></fr:tex> is the <fr:link href="/forest/dt-000A/" title="The bottom value" uri="https://liamoc.net/forest/dt-000A/" display-uri="dt-000A" type="local">bottom element</fr:link>, we know that <fr:tex display="inline"><![CDATA[\bot  \sqsubseteq  f(\bot )]]></fr:tex>. Each subsequent step in the chain exists because of <fr:link href="/forest/dt-000J/" title="Monotonicity" uri="https://liamoc.net/forest/dt-000J/" display-uri="dt-000J" type="local">monotonicity</fr:link>.
</html:p></fr:mainmatter></fr:tree><html:p>Each successive element of <fr:link href="/forest/dt-000X/" title="Ascending Kleene chain" uri="https://liamoc.net/forest/dt-000X/" display-uri="dt-000X" type="local">this chain</fr:link> is another "unfolding" of the recursion.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-000V/</fr:uri><fr:display-uri>dt-000V</fr:display-uri><fr:route>/forest/dt-000V/</fr:route><fr:title text="Chain">Chain</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
	A <html:em>chain</html:em> in a <fr:link href="/forest/dm-0004/" title="Poset" uri="https://liamoc.net/forest/dm-0004/" display-uri="dm-0004" type="local">poset</fr:link> <fr:tex display="inline"><![CDATA[X]]></fr:tex> is a <fr:link href="/forest/dm-0007/" title="Total order" uri="https://liamoc.net/forest/dm-0007/" display-uri="dm-0007" type="local">totally ordered</fr:link> subset of <fr:tex display="inline"><![CDATA[X]]></fr:tex>. That is, a subset <fr:tex display="inline"><![CDATA[Y \subseteq  X]]></fr:tex> is a <html:em>chain</html:em> iff:
	<fr:tex display="block"><![CDATA[\forall  x, y \in  Y.\; x \sqsubseteq  y \lor  y \sqsubseteq  x]]></fr:tex></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-000W/</fr:uri><fr:display-uri>dt-000W</fr:display-uri><fr:route>/forest/dt-000W/</fr:route><fr:title text="\omega -chain"><fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-chain</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
	An <html:em><fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-chain</html:em> is a <fr:link href="/forest/dt-000V/" title="Chain" uri="https://liamoc.net/forest/dt-000V/" display-uri="dt-000V" type="local">chain</fr:link> that is <fr:link href="/forest/dm-0009/" title="Countable sets" uri="https://liamoc.net/forest/dm-0009/" display-uri="dm-0009" type="local">countable</fr:link>. In other words, it is a sequence of elements <fr:tex display="inline"><![CDATA[x_{i \in  \mathbb {N}}]]></fr:tex> such that:
	<fr:tex display="block"><![CDATA[x_0 \sqsubseteq  x_1 \sqsubseteq  x_2 \sqsubseteq  x_3 \dots ]]></fr:tex></html:p></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:contributor><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:contributor></fr:authors><fr:uri>https://liamoc.net/forest/dt-000Z/</fr:uri><fr:display-uri>dt-000Z</fr:display-uri><fr:route>/forest/dt-000Z/</fr:route><fr:title text="From chains to directed sets">From chains to directed sets</fr:title></fr:frontmatter><fr:mainmatter><html:p>While <fr:link href="/forest/dt-000W/" title="\omega -chain" uri="https://liamoc.net/forest/dt-000W/" display-uri="dt-000W" type="local"><fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-chains</fr:link> are technically sufficient for <fr:link href="/forest/dt-0001/" title="Denotational semantics" uri="https://liamoc.net/forest/dt-0001/" display-uri="dt-0001" type="local">denotational semantics</fr:link>, for our purposes it is a little more convenient to think in terms of <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed sets</fr:link> rather than <fr:link href="/forest/dt-000V/" title="Chain" uri="https://liamoc.net/forest/dt-000V/" display-uri="dt-000V" type="local">chains</fr:link>.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0010/</fr:uri><fr:display-uri>dt-0010</fr:display-uri><fr:route>/forest/dt-0010/</fr:route><fr:title text="Directed set">Directed set</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
Formally, a non-empty subset <fr:tex display="inline"><![CDATA[Y \subseteq  X]]></fr:tex> of a <fr:link href="/forest/dm-0004/" title="Poset" uri="https://liamoc.net/forest/dm-0004/" display-uri="dm-0004" type="local">poset</fr:link> <fr:tex display="inline"><![CDATA[(X,\sqsubseteq )]]></fr:tex> is <html:em>directed</html:em> iff: <fr:tex display="block"><![CDATA[\forall  x, y \in  Y.\ \exists  z \in  Y.\ x \sqsubseteq  z \land  y \sqsubseteq  z]]></fr:tex>
<html:figure><fr:resource hash="fb630a6d6e7162dc67c9116258fdf368"><fr:resource-content><html:img src="/forest/fb630a6d6e7162dc67c9116258fdf368.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzpicture}
\draw [dotted, thick] (0,0) circle (1.5 cm);
\draw [dotted, thick] (5,0) circle (1.5 cm);	
\node  at (2.5,0) {\Huge  $\Rightarrow $ };
\node  at (2.5,0.6) {$\exists  z$ };
\node  at (-0.7,-0.5) { \Large  $\bullet $ };
\node  at (-0.7,-0.8) { $x$ };
\node  at (0.7,-0.5) { \Large  $\bullet $ };
\node  at (0.7,-0.8) { $y$ };
\node  (x) at (4.3,-0.5) { \Large  $\bullet $ };
\node   at (4.3,-0.8) { $x$ };
\node  (y) at (5.7,-0.5) { \Large  $\bullet $ };
\node   at (5.7,-0.8) { $y$ };
\node  (z)at (5,0.5) { \Large  $\bullet $ };
\node   at (5,0.8) { $z$ };
\draw [thick] (x) -- (z)
	  (y) -- (z);
\end {tikzpicture}
]]></fr:resource-source></fr:resource></html:figure>
The <fr:tex display="inline"><![CDATA[z]]></fr:tex> above is an <fr:link href="/forest/dm-000C/" title="Upper bound" uri="https://liamoc.net/forest/dm-000C/" display-uri="dm-000C" type="local">upper bound</fr:link> of <fr:tex display="inline"><![CDATA[x]]></fr:tex> and <fr:tex display="inline"><![CDATA[y]]></fr:tex>. Hence, a non-empty set is <html:em>directed</html:em> iff every pair of values has an <fr:link href="/forest/dm-000C/" title="Upper bound" uri="https://liamoc.net/forest/dm-000C/" display-uri="dm-000C" type="local">upper bound</fr:link> <html:em>in the set</html:em>.</html:p><html:p>Intuitively, directed sets are "going somewhere" — given two elements we can always find a "greater" one in the set.</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors /><fr:uri>https://liamoc.net/forest/dt-0011/</fr:uri><fr:display-uri>dt-0011</fr:display-uri><fr:route>/forest/dt-0011/</fr:route><fr:title text="Power sets are directed">Power sets are directed</fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>The <fr:link href="/forest/dm-0006/" title="Power set" uri="https://liamoc.net/forest/dm-0006/" display-uri="dm-0006" type="local">power set</fr:link> of any set <fr:tex display="inline"><![CDATA[X]]></fr:tex> is directed under <fr:tex display="inline"><![CDATA[\subseteq ]]></fr:tex>.</html:p><html:p><html:strong>Below</html:strong>: <fr:tex display="inline"><![CDATA[\cal {P}(\{1,2,3\})]]></fr:tex>: </html:p><html:figure><fr:resource hash="6a8aa57572aac949ac0c7c8d5b6311db"><fr:resource-content><html:img src="/forest/6a8aa57572aac949ac0c7c8d5b6311db.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzpicture}
\node  (abc) at (1,3) {$\{1,2,3\}$};	
\node  (ab) at (0,2) {$\{1,2\}$};	
\node  (ac) at (1,2) {$\{1,3\}$};	
\node  (bc) at (2,2) {$\{2,3\}$};
\node  (a) at (0,1) {$\{1\}$};	
\node  (b) at (1,1) {$\{2\}$};	
\node  (c) at (2,1) {$\{3\}$};
\node  (em) at (1,0) {$\emptyset $};
\draw [thick]
	  (em) -- (a)
	  (em) -- (b)
	  (em) -- (c);
\draw [thick]
	  (ab) -- (abc)
	  (bc) -- (abc)
	  (ac) -- (abc);
\draw [thick]
	  (a) -- (ab)
	  (a) -- (ac);
\draw [thick]
	  (c) -- (bc)
	  (c) -- (ac);
\draw [thick]
	  (b) -- (bc)
	  (b) -- (ab);      
\end {tikzpicture}
]]></fr:resource-source></fr:resource></html:figure></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0012/</fr:uri><fr:display-uri>dt-0012</fr:display-uri><fr:route>/forest/dt-0012/</fr:route><fr:title text="Chain → Directed">Chain → Directed</fr:title><fr:taxon>Theorem</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>All non-empty <fr:link href="/forest/dt-000V/" title="Chain" uri="https://liamoc.net/forest/dt-000V/" display-uri="dt-000V" type="local">chains</fr:link> are <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link>.</html:p>


<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Proof</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Let <fr:tex display="inline"><![CDATA[C]]></fr:tex> be a <fr:link href="/forest/dt-000V/" title="Chain" uri="https://liamoc.net/forest/dt-000V/" display-uri="dt-000V" type="local">chain</fr:link>. Then, given two elements <fr:tex display="inline"><![CDATA[x,y \in  C]]></fr:tex> we know from <fr:link href="/forest/dm-0008/" title="Totality" uri="https://liamoc.net/forest/dm-0008/" display-uri="dm-0008" type="local">totality</fr:link> that either <fr:tex display="inline"><![CDATA[x \sqsubseteq  y]]></fr:tex> or <fr:tex display="inline"><![CDATA[y \sqsubseteq  x]]></fr:tex>. If <fr:tex display="inline"><![CDATA[x \sqsubseteq  y]]></fr:tex>, then <fr:tex display="inline"><![CDATA[y]]></fr:tex> is the <fr:link href="/forest/dm-000C/" title="Upper bound" uri="https://liamoc.net/forest/dm-000C/" display-uri="dm-000C" type="local">upper bound</fr:link>, otherwise <fr:tex display="inline"><![CDATA[x]]></fr:tex> is the <fr:link href="/forest/dm-000C/" title="Upper bound" uri="https://liamoc.net/forest/dm-000C/" display-uri="dm-000C" type="local">upper bound</fr:link>. </html:p></fr:mainmatter></fr:tree>
</fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors /><fr:uri>https://liamoc.net/forest/dt-0013/</fr:uri><fr:display-uri>dt-0013</fr:display-uri><fr:route>/forest/dt-0013/</fr:route><fr:title text="Consistent subset">Consistent subset</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
	A subset <fr:tex display="inline"><![CDATA[Y \subseteq  X]]></fr:tex> of a <fr:link href="/forest/dm-0004/" title="Poset" uri="https://liamoc.net/forest/dm-0004/" display-uri="dm-0004" type="local">poset</fr:link> <fr:tex display="inline"><![CDATA[X]]></fr:tex> is <html:em>consistent</html:em> iff
	<fr:tex display="block"><![CDATA[\exists  x \in  X.\ \forall  y \in  Y.\ y \sqsubseteq  x]]></fr:tex>
	Such an <fr:tex display="inline"><![CDATA[x]]></fr:tex> is called an <fr:link href="/forest/dm-000C/" title="Upper bound" uri="https://liamoc.net/forest/dm-000C/" display-uri="dm-000C" type="local">upper bound</fr:link> of <fr:tex display="inline"><![CDATA[Y]]></fr:tex>.
	<html:figure><fr:resource hash="8abf2277b5a3e77a16eed68338ef711a"><fr:resource-content><html:img src="/forest/8abf2277b5a3e77a16eed68338ef711a.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
	\begin {tikzpicture}
		\node  (a) at (-0.8,0) {$\bullet $};
		\node  (b) at (0.8,0) {$\bullet $};
		\node  (c) at (0,-1) {$\bullet $};
		\draw [thick] (c) -- (a) (c) -- (b);
		\draw [dashed, rounded corners=0.4cm] (-1.2,-0.4) rectangle (1.2,0.4);
		\node  (foo) at (2,-1.5) {a non-\emph {consistent} set};
		\draw [->,thick] (foo) edge[bend right] (1.2,0);
		\node  (a) at (4.2,0) {$\bullet $};
		\node  (b) at (5.8,0) {$\bullet $};
		\node  (x) at (4.2,1) {$\bullet $};
		\node  (y) at (5.8,1) {$\bullet $};
		\node  (c) at (5,-1) {$\bullet $};
		\draw [thick] (c) -- (a) (c) -- (b) (a) -- (x) (a) -- (y) (b) -- (x) (b) -- (y);
		\draw [dashed, rounded corners=0.4cm] (3.8,-0.4) rectangle (6.2,0.4);
		\node  (foo) at (7,-1.2) {a \emph {consistent} set};
		\draw [->,thick] (foo) edge[bend right] (6.2,0);
		\node  (foo) at (2,1) {upper bound};
		\draw [->,thick] (foo) edge[bend left] (x);
		\draw [->,thick] (foo) edge[bend left] (y);
	\end {tikzpicture}
	]]></fr:resource-source></fr:resource></html:figure></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0014/</fr:uri><fr:display-uri>dt-0014</fr:display-uri><fr:route>/forest/dt-0014/</fr:route><fr:title text="Alternative characterisation of directedness">Alternative characterisation of directedness</fr:title><fr:taxon>Theorem</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>A subset <fr:tex display="inline"><![CDATA[Y \subseteq  X]]></fr:tex> of a <fr:link href="/forest/dm-0004/" title="Poset" uri="https://liamoc.net/forest/dm-0004/" display-uri="dm-0004" type="local">poset</fr:link> <fr:tex display="inline"><![CDATA[X]]></fr:tex> is <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link> iff every <html:em>finite</html:em> subset of <fr:tex display="inline"><![CDATA[Y' \subseteq  Y]]></fr:tex> has an <fr:link href="/forest/dm-000C/" title="Upper bound" uri="https://liamoc.net/forest/dm-000C/" display-uri="dm-000C" type="local">upper bound</fr:link> in <fr:tex display="inline"><![CDATA[Y]]></fr:tex>.</html:p>


<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Proof</fr:taxon></fr:frontmatter><fr:mainmatter><html:ul><html:li><html:strong>⇐</html:strong>: Every pair of elements <fr:tex display="inline"><![CDATA[x,y \in  Y]]></fr:tex> has an  <fr:link href="/forest/dm-000C/" title="Upper bound" uri="https://liamoc.net/forest/dm-000C/" display-uri="dm-000C" type="local">upper bound</fr:link> simply by taking the  <fr:link href="/forest/dm-000C/" title="Upper bound" uri="https://liamoc.net/forest/dm-000C/" display-uri="dm-000C" type="local">upper bound</fr:link> of the set <fr:tex display="inline"><![CDATA[ \{x,y\}. ]]></fr:tex>
<html:li><html:strong>⇒</html:strong>: Given a finite set <fr:tex display="inline"><![CDATA[ X = \{x_1,x_2,\dots , x_n\} ]]></fr:tex>, we can show it has an <fr:link href="/forest/dm-000C/" title="Upper bound" uri="https://liamoc.net/forest/dm-000C/" display-uri="dm-000C" type="local">upper bound</fr:link> by an inductive process, first taking the <fr:link href="/forest/dm-000C/" title="Upper bound" uri="https://liamoc.net/forest/dm-000C/" display-uri="dm-000C" type="local">upper bound</fr:link> of <fr:tex display="inline"><![CDATA[x_1]]></fr:tex> and <fr:tex display="inline"><![CDATA[x_2]]></fr:tex>, and then taking the <fr:link href="/forest/dm-000C/" title="Upper bound" uri="https://liamoc.net/forest/dm-000C/" display-uri="dm-000C" type="local">upper bound</fr:link>  of that an <fr:tex display="inline"><![CDATA[x_3]]></fr:tex> and so on until we have an <fr:link href="/forest/dm-000C/" title="Upper bound" uri="https://liamoc.net/forest/dm-000C/" display-uri="dm-000C" type="local">upper bound</fr:link> for the whole set. This induction works because the set <fr:tex display="inline"><![CDATA[X]]></fr:tex> is finite.</html:li></html:li></html:ul></fr:mainmatter></fr:tree>
</fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0015/</fr:uri><fr:display-uri>dt-0015</fr:display-uri><fr:route>/forest/dt-0015/</fr:route><fr:taxon>Corollary</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>From <fr:link href="/forest/dt-0014/" title="Alternative characterisation of directedness" uri="https://liamoc.net/forest/dt-0014/" display-uri="dt-0014" type="local">Theorem <fr:contextual-number uri="https://liamoc.net/forest/dt-0014/" display-uri="dt-0014" /></fr:link> we can see that a <html:em>finite</html:em> set <fr:tex display="inline"><![CDATA[S]]></fr:tex> is <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link> iff it has a <html:em>top</html:em> element <fr:tex display="inline"><![CDATA[\top ]]></fr:tex>, i.e. <fr:tex display="inline"><![CDATA[\forall  x \in  S.\ x \sqsubseteq  \top ]]></fr:tex>.</html:p></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0016/</fr:uri><fr:display-uri>dt-0016</fr:display-uri><fr:route>/forest/dt-0016/</fr:route><fr:title text="Least upper bounds">Least upper bounds</fr:title></fr:frontmatter><fr:mainmatter><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0017/</fr:uri><fr:display-uri>dt-0017</fr:display-uri><fr:route>/forest/dt-0017/</fr:route><fr:title text="Least upper bound">Least upper bound</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Let <fr:tex display="inline"><![CDATA[X \subseteq  Y]]></fr:tex> be a subset of a <fr:link href="/forest/dm-0004/" title="Poset" uri="https://liamoc.net/forest/dm-0004/" display-uri="dm-0004" type="local">poset</fr:link> <fr:tex display="inline"><![CDATA[Y]]></fr:tex>. An element <fr:tex display="inline"><![CDATA[y \in  Y]]></fr:tex> is a <html:em>least upper bound</html:em> (or <html:em>lub</html:em>) for <fr:tex display="inline"><![CDATA[X]]></fr:tex> iff:
<html:ol><html:li> It is an <fr:link href="/forest/dm-000C/" title="Upper bound" uri="https://liamoc.net/forest/dm-000C/" display-uri="dm-000C" type="local">upper bound</fr:link>: <fr:tex display="inline"><![CDATA[\forall  x \in  X.\ x \sqsubseteq  y]]></fr:tex></html:li>
  <html:li> It is less than any other <fr:link href="/forest/dm-000C/" title="Upper bound" uri="https://liamoc.net/forest/dm-000C/" display-uri="dm-000C" type="local">upper bound</fr:link>: <fr:tex display="inline"><![CDATA[\forall  y' \in  Y.\ (\forall  x \in  X. x \sqsubseteq  y') \Rightarrow  y \sqsubseteq  y']]></fr:tex></html:li></html:ol>
It follows that lubs are unique if they exist. We write the lub of a set <fr:tex display="inline"><![CDATA[X]]></fr:tex> as <fr:tex display="inline"><![CDATA[\bigsqcup  X]]></fr:tex>, and usually write <fr:tex display="inline"><![CDATA[x \sqcup  y]]></fr:tex> as a shorthand for <fr:tex display="inline"><![CDATA[\bigsqcup  \{x,y\}]]></fr:tex>.
</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0018/</fr:uri><fr:display-uri>dt-0018</fr:display-uri><fr:route>/forest/dt-0018/</fr:route><fr:title text="Properties of \sqcup ">Properties of <fr:tex display="inline"><![CDATA[\sqcup ]]></fr:tex></fr:title><fr:taxon>Corollary</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
  When <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lubs</fr:link> exist, the binary <fr:tex display="inline"><![CDATA[\sqcup ]]></fr:tex> operator is <fr:link href="/forest/dm-000D/" title="Idempotence (of binary operators)" uri="https://liamoc.net/forest/dm-000D/" display-uri="dm-000D" type="local">idempotent</fr:link>, <fr:link href="/forest/dm-000E/" title="Commutativity" uri="https://liamoc.net/forest/dm-000E/" display-uri="dm-000E" type="local">commutative</fr:link>, and <fr:link href="/forest/dm-000F/" title="Associativity" uri="https://liamoc.net/forest/dm-000F/" display-uri="dm-000F" type="local">associative</fr:link>. Also, we have that <fr:tex display="inline"><![CDATA[x \sqsubseteq  y]]></fr:tex> iff <fr:tex display="inline"><![CDATA[x \sqcup  y = y]]></fr:tex>.
</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0019/</fr:uri><fr:display-uri>dt-0019</fr:display-uri><fr:route>/forest/dt-0019/</fr:route><fr:title text="Pointedness via lubs">Pointedness via lubs</fr:title><fr:taxon>Theorem</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
  A <fr:link href="/forest/dm-0004/" title="Poset" uri="https://liamoc.net/forest/dm-0004/" display-uri="dm-0004" type="local">poset</fr:link> <fr:tex display="inline"><![CDATA[Y]]></fr:tex> is <fr:link href="/forest/dt-000G/" title="Pointed poset" uri="https://liamoc.net/forest/dt-000G/" display-uri="dt-000G" type="local">pointed</fr:link> iff <fr:tex display="inline"><![CDATA[\bigsqcup  \emptyset ]]></fr:tex> exists, as the <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link> of an empty set is just the <fr:link href="/forest/dt-000A/" title="The bottom value" uri="https://liamoc.net/forest/dt-000A/" display-uri="dt-000A" type="local">bottom element</fr:link> in the <fr:link href="/forest/dm-0004/" title="Poset" uri="https://liamoc.net/forest/dm-0004/" display-uri="dm-0004" type="local">poset</fr:link>, i.e. <fr:tex display="inline"><![CDATA[\bigsqcup  \emptyset  = \bot ]]></fr:tex>.
</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors /><fr:uri>https://liamoc.net/forest/dt-001A/</fr:uri><fr:display-uri>dt-001A</fr:display-uri><fr:route>/forest/dt-001A/</fr:route><fr:title text="Information intuition">Information intuition</fr:title></fr:frontmatter><fr:mainmatter><html:p>When the <fr:link href="/forest/dm-0004/" title="Poset" uri="https://liamoc.net/forest/dm-0004/" display-uri="dm-0004" type="local">poset</fr:link> <fr:tex display="inline"><![CDATA[Y]]></fr:tex> from <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">Definition <fr:contextual-number uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" /></fr:link> is ordered by our <fr:link href="/forest/dt-000B/" title="Information ordering" uri="https://liamoc.net/forest/dt-000B/" display-uri="dt-000B" type="local">information ordering</fr:link>, the intuition of the <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link> <fr:tex display="inline"><![CDATA[\bigsqcup  X]]></fr:tex> is that it combines all of the information content of all the elements of <fr:tex display="inline"><![CDATA[X]]></fr:tex> but it does <html:em>not</html:em> add any additional information (hence <html:em>least</html:em>).</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors /><fr:uri>https://liamoc.net/forest/dt-001B/</fr:uri><fr:display-uri>dt-001B</fr:display-uri><fr:route>/forest/dt-001B/</fr:route><fr:title text="Lubs in the domain \mathbb {B}_\bot  \times  \mathbb {B}_\bot "><fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">Lubs</fr:link> in <fr:link href="/forest/dt-000F/" title="The domain \mathbb {B}_\bot  \times  \mathbb {B}_\bot " uri="https://liamoc.net/forest/dt-000F/" display-uri="dt-000F" type="local">the domain <fr:tex display="inline"><![CDATA[\mathbb {B}_\bot  \times  \mathbb {B}_\bot ]]></fr:tex></fr:link></fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter><html:ul><html:li><fr:tex display="inline"><![CDATA[(\bot , \mathit {F}) \sqcup  (\mathit {T},\bot ) = (\mathit {T},\mathit {F})]]></fr:tex></html:li>
  <html:li><fr:tex display="inline"><![CDATA[(\bot , \mathit {F}) \sqcup  (\bot ,\bot ) = (\bot ,\mathit {F})]]></fr:tex></html:li>
  <html:li><fr:tex display="inline"><![CDATA[(\bot , \mathit {F}) \sqcup  (\mathit {T}, \mathit {T})]]></fr:tex> does not exist.</html:li></html:ul></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors /><fr:uri>https://liamoc.net/forest/dt-001C/</fr:uri><fr:display-uri>dt-001C</fr:display-uri><fr:route>/forest/dt-001C/</fr:route><fr:taxon>Exercise</fr:taxon></fr:frontmatter><fr:mainmatter><html:p> What is the <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link> operator on subsets <fr:tex display="inline"><![CDATA[X \subseteq  \mathbb {N}]]></fr:tex> of the <fr:link href="/forest/dm-0004/" title="Poset" uri="https://liamoc.net/forest/dm-0004/" display-uri="dm-0004" type="local">poset</fr:link> <fr:tex display="inline"><![CDATA[(\mathbb {N},\leq )]]></fr:tex>?</html:p>



<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors /><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>The <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link> operator is <html:em>maximum</html:em>.</html:p></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-001E/</fr:uri><fr:display-uri>dt-001E</fr:display-uri><fr:route>/forest/dt-001E/</fr:route><fr:title text="Complete partial orders">Complete partial orders</fr:title></fr:frontmatter><fr:mainmatter><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-001D/</fr:uri><fr:display-uri>dt-001D</fr:display-uri><fr:route>/forest/dt-001D/</fr:route><fr:title text="Complete partial order">Complete partial order</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>A <html:em>complete partial order</html:em> or <html:em>cpo</html:em> (more specifically a <html:em>directed complete partial order</html:em> or <html:em>dcpo</html:em>) is a <fr:link href="/forest/dm-0004/" title="Poset" uri="https://liamoc.net/forest/dm-0004/" display-uri="dm-0004" type="local">poset</fr:link> where <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lubs</fr:link> exist for the empty set and for all <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link> subsets. That is, a <html:em>cpo</html:em> is a <fr:link href="/forest/dm-0004/" title="Poset" uri="https://liamoc.net/forest/dm-0004/" display-uri="dm-0004" type="local">poset</fr:link> <fr:tex display="inline"><![CDATA[A]]></fr:tex> such that:
<html:ol><html:li><fr:tex display="inline"><![CDATA[A]]></fr:tex> has a <fr:link href="/forest/dt-000A/" title="The bottom value" uri="https://liamoc.net/forest/dt-000A/" display-uri="dt-000A" type="local">bottom element</fr:link> <fr:tex display="inline"><![CDATA[\bot  \in  A]]></fr:tex>, that is the <fr:link href="/forest/dt-0019/" title="Pointedness via lubs" uri="https://liamoc.net/forest/dt-0019/" display-uri="dt-0019" type="local">lub of the empty set</fr:link>, and</html:li>
  <html:li><fr:tex display="inline"><![CDATA[\bigsqcup  X]]></fr:tex> exists for all <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link> <fr:tex display="inline"><![CDATA[X \subseteq  A]]></fr:tex>.</html:li></html:ol></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-001F/</fr:uri><fr:display-uri>dt-001F</fr:display-uri><fr:route>/forest/dt-001F/</fr:route><fr:title text="Other kinds of completeness">Other kinds of completeness</fr:title><fr:taxon>Aside</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>In <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">Definition <fr:contextual-number uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" /></fr:link> we defined cpos in terms of <html:em>directed completeness</html:em>. We may consider <html:em>chain completeness</html:em> instead, where, rather than require <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lubs</fr:link> for every <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link> subset of our <fr:link href="/forest/dm-0004/" title="Poset" uri="https://liamoc.net/forest/dm-0004/" display-uri="dm-0004" type="local">poset</fr:link> <fr:tex display="inline"><![CDATA[A]]></fr:tex>, we require <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lubs</fr:link> for every <fr:link href="/forest/dt-000V/" title="Chain" uri="https://liamoc.net/forest/dt-000V/" display-uri="dt-000V" type="local">chain</fr:link> <fr:tex display="inline"><![CDATA[X \subseteq  A]]></fr:tex>. We know from <fr:link href="/forest/dt-0012/" title="Chain → Directed" uri="https://liamoc.net/forest/dt-0012/" display-uri="dt-0012" type="local">Theorem <fr:contextual-number uri="https://liamoc.net/forest/dt-0012/" display-uri="dt-0012" /></fr:link> that all <fr:link href="/forest/dt-000V/" title="Chain" uri="https://liamoc.net/forest/dt-000V/" display-uri="dt-000V" type="local">chains</fr:link> are <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link>, so every directed complete cpo is also chain complete. It is also known that every chain complete cpo is also directed complete, so the notions are <html:strong>equivalent</html:strong>, although the proof is non-trivial, relying on transfinite induction (see <fr:link href="https://www.cs.cornell.edu/courses/cs6110/2023sp/lectures/lecC.pdf" type="external">these lecture notes</fr:link> for details).</html:p><html:p>If we weaken our completeness requirement to require <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lubs</fr:link> only for the countable <fr:link href="/forest/dt-000W/" title="\omega -chain" uri="https://liamoc.net/forest/dt-000W/" display-uri="dt-000W" type="local"><fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-chains</fr:link> and not necessarily all chains, we get what is called an <html:em><fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-cpo</html:em>. All <fr:link href="/forest/dt-000W/" title="\omega -chain" uri="https://liamoc.net/forest/dt-000W/" display-uri="dt-000W" type="local"><fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-chains</fr:link> are <fr:link href="/forest/dt-000V/" title="Chain" uri="https://liamoc.net/forest/dt-000V/" display-uri="dt-000V" type="local">chains</fr:link> and are therefore <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link>, but not all <fr:link href="/forest/dt-000V/" title="Chain" uri="https://liamoc.net/forest/dt-000V/" display-uri="dt-000V" type="local">chains</fr:link> are <fr:link href="/forest/dt-000W/" title="\omega -chain" uri="https://liamoc.net/forest/dt-000W/" display-uri="dt-000W" type="local"><fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-chains</fr:link>.</html:p><html:p>Working with just <fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-cpos is common in <fr:link href="/forest/dt-0001/" title="Denotational semantics" uri="https://liamoc.net/forest/dt-0001/" display-uri="dt-0001" type="local">denotational semantics</fr:link> practice, but working with <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link> completeness simplifies some of the properties we will discuss later.</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-001G/</fr:uri><fr:display-uri>dt-001G</fr:display-uri><fr:route>/forest/dt-001G/</fr:route><fr:taxon>Exercise</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>For each of the following <fr:link href="/forest/dm-0004/" title="Poset" uri="https://liamoc.net/forest/dm-0004/" display-uri="dm-0004" type="local">posets</fr:link>, determine if it is a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> or not. If it is, describe the <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lubs</fr:link>. If it is not, give a <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link> set which has no <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link>.</html:p><html:ol><html:li> A finite <fr:link href="/forest/dt-000G/" title="Pointed poset" uri="https://liamoc.net/forest/dt-000G/" display-uri="dt-000G" type="local">pointed poset</fr:link></html:li>
  <html:li><fr:tex display="inline"><![CDATA[(\mathcal {P}(S), \subseteq )]]></fr:tex> for some set <fr:tex display="inline"><![CDATA[S]]></fr:tex></html:li>
  <html:li><fr:tex display="inline"><![CDATA[(\mathbb {N},\leq )]]></fr:tex></html:li>
  <html:li><fr:tex display="inline"><![CDATA[(\mathbb {N} \cup  \{\infty \}, \leq )]]></fr:tex></html:li>
  <html:li><fr:tex display="inline"><![CDATA[ ([0,1] \subseteq  \mathbb {R}, \leq )]]></fr:tex></html:li>
  <html:li><fr:tex display="inline"><![CDATA[ ([0,1) \subseteq  \mathbb {R}, \leq )]]></fr:tex></html:li>
  <html:li><fr:tex display="inline"><![CDATA[ (\mathbb {Q}, \leq )]]></fr:tex></html:li>
  <html:li> A <fr:link href="/forest/dt-0008/" title="Flat domain" uri="https://liamoc.net/forest/dt-0008/" display-uri="dt-0008" type="local">flat domain</fr:link> <fr:tex display="inline"><![CDATA[S_\bot ]]></fr:tex> for some set <fr:tex display="inline"><![CDATA[S]]></fr:tex>.</html:li></html:ol>
  
  
  
  <fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter><html:ol><html:li> A finite <fr:link href="/forest/dt-000G/" title="Pointed poset" uri="https://liamoc.net/forest/dt-000G/" display-uri="dt-000G" type="local">pointed poset</fr:link> is a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link>, as all <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link> subsets will be finite and therefore have a <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link>. </html:li>
<html:li><fr:tex display="inline"><![CDATA[(\mathcal {P}(S), \subseteq )]]></fr:tex> is a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> as the <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link> is just the union. </html:li>
<html:li><fr:tex display="inline"><![CDATA[(\mathbb {N},\leq )]]></fr:tex> is <html:em>not</html:em> a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link>, as the <fr:link href="/forest/dt-000W/" title="\omega -chain" uri="https://liamoc.net/forest/dt-000W/" display-uri="dt-000W" type="local"><fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-chain</fr:link> <fr:tex display="inline"><![CDATA[1 \leq  2 \leq  3 \leq  \cdots ]]></fr:tex> has no <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link>.</html:li>
<html:li><fr:tex display="inline"><![CDATA[(\mathbb {N} \cup  \{\infty \}, \leq )]]></fr:tex> is a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link>, as <fr:tex display="inline"><![CDATA[\infty ]]></fr:tex> is the <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link> of any non-repeating <fr:link href="/forest/dt-000V/" title="Chain" uri="https://liamoc.net/forest/dt-000V/" display-uri="dt-000V" type="local">chain</fr:link>.  </html:li>
<html:li><fr:tex display="inline"><![CDATA[ ([0,1] \subseteq  \mathbb {R}, \leq )]]></fr:tex> is a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> with maximum as the <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link>.</html:li>
<html:li><fr:tex display="inline"><![CDATA[ ([0,1) \subseteq  \mathbb {R}, \leq )]]></fr:tex> is <html:em>not</html:em> a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link>, as the set <fr:tex display="inline"><![CDATA[\{0.9,0.99,0.999,\dots \}]]></fr:tex> has a <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link> of <fr:tex display="inline"><![CDATA[1 \notin  [0,1)]]></fr:tex>.</html:li>
<html:li><fr:tex display="inline"><![CDATA[ (\mathbb {Q}, \leq )]]></fr:tex> is <html:em>not</html:em> a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link>, and not just because it lacks a <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link> for <fr:tex display="inline"><![CDATA[\mathbb {Q}]]></fr:tex> itself, but also it doesn't contain <fr:tex display="inline"><![CDATA[\sqrt {2}]]></fr:tex>, which can be expressed as the <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link> of an infinite sequence of rational approximations. </html:li>
<html:li> A <fr:link href="/forest/dt-0008/" title="Flat domain" uri="https://liamoc.net/forest/dt-0008/" display-uri="dt-0008" type="local">flat domain</fr:link> <fr:tex display="inline"><![CDATA[S_\bot ]]></fr:tex> for some set <fr:tex display="inline"><![CDATA[S]]></fr:tex> is a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link>, as the largest <fr:link href="/forest/dt-000V/" title="Chain" uri="https://liamoc.net/forest/dt-000V/" display-uri="dt-000V" type="local">chains</fr:link> have two elements, and we always pick the non-<fr:tex display="inline"><![CDATA[\bot ]]></fr:tex> one as the <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link>. </html:li></html:ol></fr:mainmatter></fr:tree>
</fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors /><fr:uri>https://liamoc.net/forest/dt-001H/</fr:uri><fr:display-uri>dt-001H</fr:display-uri><fr:route>/forest/dt-001H/</fr:route><fr:title text="Lubs of chains"><fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">Lubs</fr:link> of chains</fr:title><fr:taxon>Remark</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>The <html:em>limit</html:em> of the <fr:link href="/forest/dt-000X/" title="Ascending Kleene chain" uri="https://liamoc.net/forest/dt-000X/" display-uri="dt-000X" type="local">ascending Kleene chain</fr:link> of a <fr:link href="/forest/dt-000J/" title="Monotonicity" uri="https://liamoc.net/forest/dt-000J/" display-uri="dt-000J" type="local">monotonic</fr:link> function <fr:tex display="inline"><![CDATA[f : X \rightarrow  X]]></fr:tex> is the same as the <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">least upper bound</fr:link> of the set <fr:tex display="inline"><![CDATA[\{ f^n(\bot ) \mid  n \in  \mathbb {N}\}]]></fr:tex> (where <fr:tex display="inline"><![CDATA[f^n]]></fr:tex> is the <fr:tex display="inline"><![CDATA[n]]></fr:tex>-fold self-composition of the function <fr:tex display="inline"><![CDATA[f]]></fr:tex>). If we require that our semantic domain <fr:tex display="inline"><![CDATA[X]]></fr:tex> is a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link>, we know that this limit exists. 

  
  
<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors /><fr:taxon>Thesis</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Our semantic domains are <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link>, ensuring the presence of these limits.</html:p></fr:mainmatter></fr:tree></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-001X/</fr:uri><fr:display-uri>dt-001X</fr:display-uri><fr:route>/forest/dt-001X/</fr:route><fr:taxon>Exercise</fr:taxon></fr:frontmatter><fr:mainmatter><html:ol><html:li>Show that if <fr:tex display="inline"><![CDATA[A]]></fr:tex> and <fr:tex display="inline"><![CDATA[B]]></fr:tex> are <fr:link href="/forest/dm-0004/" title="Poset" uri="https://liamoc.net/forest/dm-0004/" display-uri="dm-0004" type="local">posets</fr:link> and <fr:tex display="inline"><![CDATA[X \subseteq  A \times  B]]></fr:tex> is <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link> (by the ordering in <fr:link href="/forest/dt-000E/" title="Product of two pointed posets" uri="https://liamoc.net/forest/dt-000E/" display-uri="dt-000E" type="local">Construction <fr:contextual-number uri="https://liamoc.net/forest/dt-000E/" display-uri="dt-000E" /></fr:link>), then the subsets <fr:tex display="inline"><![CDATA[\pi _0(X) \subseteq  A]]></fr:tex> and <fr:tex display="inline"><![CDATA[\pi _1(X) \subseteq  B]]></fr:tex> (defined below) are also <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link>.
 <fr:tex display="block"><![CDATA[ \begin {array}{lcl}
		 \pi _0(X) & = & \{ a \in  A \mid  \exists  b \in  B.\ (a,b) \in  X \}\\
		  \pi _1(X) & = & \{ b \in  B \mid  \exists  a \in  A.\ (a,b) \in  X \}\\
 \end {array}
 ]]></fr:tex>

   
   
   
 <fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Given two elements <fr:tex display="inline"><![CDATA[x,y \in  \pi _0(X)]]></fr:tex>, we know that there exists <fr:tex display="inline"><![CDATA[b_x, b_y \in  B]]></fr:tex> such that <fr:tex display="inline"><![CDATA[(x,b_x) \in  X]]></fr:tex> and <fr:tex display="inline"><![CDATA[(y,b_y) \in  X]]></fr:tex>. Because <fr:tex display="inline"><![CDATA[X]]></fr:tex> is <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link>, we can conclude that there exists an <fr:link href="/forest/dm-000C/" title="Upper bound" uri="https://liamoc.net/forest/dm-000C/" display-uri="dm-000C" type="local">upper bound</fr:link> <fr:tex display="inline"><![CDATA[(z, b_z) \in  X]]></fr:tex> where <fr:tex display="inline"><![CDATA[x \sqsubseteq  z]]></fr:tex> and <fr:tex display="inline"><![CDATA[y \sqsubseteq  z]]></fr:tex>. As <fr:tex display="inline"><![CDATA[z \in  \pi _0(X)]]></fr:tex>, <fr:tex display="inline"><![CDATA[z]]></fr:tex> is an <fr:link href="/forest/dm-000C/" title="Upper bound" uri="https://liamoc.net/forest/dm-000C/" display-uri="dm-000C" type="local">upper bound</fr:link> in <fr:tex display="inline"><![CDATA[\pi _0(X)]]></fr:tex> for both <fr:tex display="inline"><![CDATA[x]]></fr:tex> and <fr:tex display="inline"><![CDATA[y]]></fr:tex> and thus <fr:tex display="inline"><![CDATA[\pi _0(X)]]></fr:tex> is <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link>. The proof for <fr:tex display="inline"><![CDATA[\pi _1]]></fr:tex> is analogous.
 </html:p></fr:mainmatter></fr:tree></html:li>
<html:li> Give an example of a set <fr:tex display="inline"><![CDATA[X \subseteq  \{\top ,\bot \}\times \{\top ,\bot \}]]></fr:tex> such that <fr:tex display="inline"><![CDATA[\pi _0(X)]]></fr:tex> and <fr:tex display="inline"><![CDATA[\pi _1(X)]]></fr:tex> are <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link>, but <fr:tex display="inline"><![CDATA[X]]></fr:tex> is not.

  
  
  
<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter><html:p><fr:tex display="inline"><![CDATA[X = \{(\top ,\bot ), (\bot ,\top )\}]]></fr:tex> is not directed as the two elements are not comparable, but <fr:tex display="inline"><![CDATA[\pi _0(X) = \pi _1(X) = \{\top ,\bot \}]]></fr:tex> which is directed as <fr:tex display="inline"><![CDATA[\bot  \sqsubseteq  \top ]]></fr:tex>.</html:p></fr:mainmatter></fr:tree></html:li>
<html:li> Show that if <fr:tex display="inline"><![CDATA[A]]></fr:tex> and <fr:tex display="inline"><![CDATA[B]]></fr:tex> are <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> and <fr:tex display="inline"><![CDATA[X \subseteq  A \times  B]]></fr:tex> is <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link>, then <fr:tex display="block"><![CDATA[\bigsqcup  X = \left (\bigsqcup  \pi _0(X), \bigsqcup \pi _1(X)\right )]]></fr:tex>
<html:strong>Note</html:strong>: Together with <fr:tex display="inline"><![CDATA[\bot _{A\times  B} = (\bot _A, \bot _B)]]></fr:tex> this shows that the <fr:link href="/forest/dm-0005/" title="Cartesian product" uri="https://liamoc.net/forest/dm-0005/" display-uri="dm-0005" type="local">Cartesian product</fr:link> of two <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> is itself a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link>.</html:li>

   
   
   
 <fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
 Let <fr:tex display="inline"><![CDATA[(x,y) = \left (\bigsqcup  \pi _0(X), \bigsqcup \pi _1(X)\right )]]></fr:tex>. Because of the ordering in <fr:link href="/forest/dt-000E/" title="Product of two pointed posets" uri="https://liamoc.net/forest/dt-000E/" display-uri="dt-000E" type="local">Construction <fr:contextual-number uri="https://liamoc.net/forest/dt-000E/" display-uri="dt-000E" /></fr:link>, <fr:tex display="inline"><![CDATA[(x,y)]]></fr:tex> is certainly <html:em>a</html:em> <fr:link href="/forest/dm-000C/" title="Upper bound" uri="https://liamoc.net/forest/dm-000C/" display-uri="dm-000C" type="local">upper bound</fr:link> of the directed set <fr:tex display="inline"><![CDATA[X]]></fr:tex>. To show it is the <html:em>least</html:em> <fr:link href="/forest/dm-000C/" title="Upper bound" uri="https://liamoc.net/forest/dm-000C/" display-uri="dm-000C" type="local">upper bound</fr:link>, assume for the sake of contradiction that <fr:tex display="inline"><![CDATA[(x,y)]]></fr:tex> is <html:em>not</html:em> the <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">least upper bound</fr:link> of <fr:tex display="inline"><![CDATA[X]]></fr:tex>. Then, there must be a <fr:tex display="inline"><![CDATA[(v,w)\sqsubset  (x,y)]]></fr:tex> such that <fr:tex display="inline"><![CDATA[\forall  x \in  X.\ x \sqsubseteq  (v,w)]]></fr:tex>. But then, <fr:tex display="inline"><![CDATA[v]]></fr:tex> would be a lesser <fr:link href="/forest/dm-000C/" title="Upper bound" uri="https://liamoc.net/forest/dm-000C/" display-uri="dm-000C" type="local">upper bound</fr:link> for <fr:tex display="inline"><![CDATA[\pi _0(X)]]></fr:tex> than <fr:tex display="inline"><![CDATA[x]]></fr:tex>, which is supposed to be the <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link>. Thus there is a contradiction, and <fr:tex display="inline"><![CDATA[(x,y)]]></fr:tex> must be the <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link> of <fr:tex display="inline"><![CDATA[X]]></fr:tex>.
 </html:p></fr:mainmatter></fr:tree></html:ol></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:contributor><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:contributor></fr:authors><fr:uri>https://liamoc.net/forest/dt-001I/</fr:uri><fr:display-uri>dt-001I</fr:display-uri><fr:route>/forest/dt-001I/</fr:route><fr:title text="Continuity and Fixed Points">Continuity and Fixed Points</fr:title></fr:frontmatter><fr:mainmatter><html:p>By choosing a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> for our semantic domain, we can ensure that the <fr:link href="/forest/dt-000X/" title="Ascending Kleene chain" uri="https://liamoc.net/forest/dt-000X/" display-uri="dt-000X" type="local">Kleene chain</fr:link> has a limit. However, it is not guaranteed that the limit we find will be a <fr:link href="/forest/dt-000S/" title="Fixed point" uri="https://liamoc.net/forest/dt-000S/" display-uri="dt-000S" type="local">fixed point</fr:link> to our <fr:link href="/forest/dt-000J/" title="Monotonicity" uri="https://liamoc.net/forest/dt-000J/" display-uri="dt-000J" type="local">monotonic</fr:link> function <fr:tex display="inline"><![CDATA[f]]></fr:tex>.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-001K/</fr:uri><fr:display-uri>dt-001K</fr:display-uri><fr:route>/forest/dt-001K/</fr:route><fr:title text="Monotonicity is insufficient">Monotonicity is insufficient</fr:title><fr:taxon>Problem</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Consider this <fr:link href="/forest/dt-000J/" title="Monotonicity" uri="https://liamoc.net/forest/dt-000J/" display-uri="dt-000J" type="local">monotonic</fr:link> function <fr:tex display="inline"><![CDATA[g]]></fr:tex> defined over a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> <fr:tex display="inline"><![CDATA[(\mathbb {R} \cup  \{\infty ,-\infty \}, \leq )]]></fr:tex>:
<fr:tex display="block"><![CDATA[g(x) = \begin {cases}
				\tan ^{-1} x & \text {if}\ x < 0\\
				1 & \text {otherwise}
			  \end {cases}
 ]]></fr:tex>
 Note this function is not continuous at 0. Starting from our <fr:link href="/forest/dt-000A/" title="The bottom value" uri="https://liamoc.net/forest/dt-000A/" display-uri="dt-000A" type="local"><fr:tex display="inline"><![CDATA[\bot ]]></fr:tex> element</fr:link> <fr:tex display="inline"><![CDATA[-\infty ]]></fr:tex>, we can see that the limit of the <fr:link href="/forest/dt-000X/" title="Ascending Kleene chain" uri="https://liamoc.net/forest/dt-000X/" display-uri="dt-000X" type="local">ascending Kleene chain</fr:link> is <fr:tex display="inline"><![CDATA[0]]></fr:tex>:
 <fr:tex display="block"><![CDATA[
 \begin {array}{lcl}
 g(-\infty ) & = & -\frac {\pi }{2}\\
 g(-\frac {\pi }{2}) & = & -1\\
 g(-1) & \approx  & -0.78\\	
 \end {array}
 ]]></fr:tex>
 But <fr:tex display="inline"><![CDATA[g(0) = 1]]></fr:tex>! — the <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link> of the <fr:link href="/forest/dt-000X/" title="Ascending Kleene chain" uri="https://liamoc.net/forest/dt-000X/" display-uri="dt-000X" type="local">Kleene chain</fr:link> is <html:em>not</html:em> a <fr:link href="/forest/dt-000S/" title="Fixed point" uri="https://liamoc.net/forest/dt-000S/" display-uri="dt-000S" type="local">fixed point</fr:link>! 
</html:p></fr:mainmatter></fr:tree><html:p>
To address this problem, we shall strengthen our requirement on functions from mere <fr:link href="/forest/dt-000J/" title="Monotonicity" uri="https://liamoc.net/forest/dt-000J/" display-uri="dt-000J" type="local">monotonicity</fr:link> to <html:em>continuity</html:em>.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-001J/</fr:uri><fr:display-uri>dt-001J</fr:display-uri><fr:route>/forest/dt-001J/</fr:route><fr:title text="Continuity">Continuity</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>A function <fr:tex display="inline"><![CDATA[f : A \rightarrow  B]]></fr:tex> on <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> <fr:tex display="inline"><![CDATA[A]]></fr:tex> and <fr:tex display="inline"><![CDATA[B]]></fr:tex> is <html:em>continuous</html:em> iff for all <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link> <fr:tex display="inline"><![CDATA[X \subseteq  A]]></fr:tex>,
<html:ol><html:li><fr:tex display="inline"><![CDATA[\bigsqcup  \{ f(x) \mid  x \in  X \}]]></fr:tex> exists, and</html:li>
	<html:li><fr:tex display="inline"><![CDATA[f(\bigsqcup  X) = \bigsqcup  \{ f(x) \mid  x \in  X \}]]></fr:tex>, i.e., <fr:tex display="inline"><![CDATA[f]]></fr:tex> preserves <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lubs</fr:link>.</html:li></html:ol>
The intuition behind continuity is that "nothing is suddenly invented at infinity": our function will behave analogously at the limit as it does for each element in our <fr:link href="/forest/dt-000V/" title="Chain" uri="https://liamoc.net/forest/dt-000V/" display-uri="dt-000V" type="local">chain</fr:link>.
</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-001L/</fr:uri><fr:display-uri>dt-001L</fr:display-uri><fr:route>/forest/dt-001L/</fr:route><fr:title text="Continuity implies monotonicity">Continuity implies monotonicity</fr:title><fr:taxon>Theorem</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>All <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link> functions are <fr:link href="/forest/dt-000J/" title="Monotonicity" uri="https://liamoc.net/forest/dt-000J/" display-uri="dt-000J" type="local">monotonic</fr:link>.

  
  
<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Proof</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Consider two elements <fr:tex display="inline"><![CDATA[x, y]]></fr:tex> of a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> where <fr:tex display="inline"><![CDATA[x \sqsubseteq  y]]></fr:tex>. Then <fr:tex display="inline"><![CDATA[\{x,y\}]]></fr:tex> is <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link> with a <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link> of <fr:tex display="inline"><![CDATA[y]]></fr:tex>. By the second condition in <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">Definition <fr:contextual-number uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" /></fr:link>, we get <fr:tex display="inline"><![CDATA[f(y) = f(x) \sqcup  f(y)]]></fr:tex> which is equivalent to <fr:tex display="inline"><![CDATA[f(x) \sqsubseteq  f(y)]]></fr:tex>.</html:p></fr:mainmatter></fr:tree></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-001M/</fr:uri><fr:display-uri>dt-001M</fr:display-uri><fr:route>/forest/dt-001M/</fr:route><fr:title text="Monotonic but not continuous"><fr:link href="/forest/dt-000J/" title="Monotonicity" uri="https://liamoc.net/forest/dt-000J/" display-uri="dt-000J" type="local">Monotonic</fr:link> but not <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link></fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Consider this function from <fr:tex display="inline"><![CDATA[\mathbb {N} \cup  \{\infty \} \rightarrow  \{\top ,\bot \}]]></fr:tex>, defined by:
	<fr:tex display="block"><![CDATA[f(x) = \begin {cases}
					\bot  & \text {if}\ x \in  \mathbb {N}\\
					\top  & \text {otherwise}
				  \end {cases}
	]]></fr:tex>
	This function is <fr:link href="/forest/dt-000J/" title="Monotonicity" uri="https://liamoc.net/forest/dt-000J/" display-uri="dt-000J" type="local">monotonic</fr:link>, but, taking <fr:tex display="inline"><![CDATA[X = \mathbb {N}]]></fr:tex> (which is a <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link> subset of the <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> <fr:tex display="inline"><![CDATA[\mathbb {N} \cup  \{\infty \}]]></fr:tex>), then <fr:tex display="inline"><![CDATA[f(\bigsqcup  \mathbb {N}) = f(\infty ) = \top ]]></fr:tex>, but <fr:tex display="inline"><![CDATA[\bigsqcup  \{ f(n) \mid  n \in  \mathbb {N} \} = \bigsqcup  \{ \bot  \} = \bot ]]></fr:tex>. Thus, this function is not <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link>.
</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-001N/</fr:uri><fr:display-uri>dt-001N</fr:display-uri><fr:route>/forest/dt-001N/</fr:route><fr:taxon>Exercise</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Show that if a function on <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> <fr:tex display="inline"><![CDATA[f : A \rightarrow  B]]></fr:tex> is <fr:link href="/forest/dt-000J/" title="Monotonicity" uri="https://liamoc.net/forest/dt-000J/" display-uri="dt-000J" type="local">monotonic</fr:link>, then <fr:tex display="inline"><![CDATA[\bigsqcup  \{ f(x) \mid  x \in  X \}]]></fr:tex>  exists for any <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link> <fr:tex display="inline"><![CDATA[X \subseteq  A]]></fr:tex> (i.e.the first condition for <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuity</fr:link> in <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">Definition <fr:contextual-number uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" /></fr:link>).</html:p><html:p><html:strong>Hint</html:strong>: It suffices to show that <fr:tex display="inline"><![CDATA[\{ f(x) \mid  x \in  X \} \subseteq  B]]></fr:tex> is <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link>.</html:p>
  
  
  
<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Because <fr:tex display="inline"><![CDATA[B]]></fr:tex> is a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link>, it suffices to show that <fr:tex display="inline"><![CDATA[\{ f(x) \mid  x \in  X \} \subseteq  B]]></fr:tex> is <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link>. Let <fr:tex display="inline"><![CDATA[a,b \in  \{ f(x) \mid  x \in  X \}]]></fr:tex>. Let <fr:tex display="inline"><![CDATA[x_a, x_b \in  X]]></fr:tex> be the values that <fr:tex display="inline"><![CDATA[f]]></fr:tex> maps to <fr:tex display="inline"><![CDATA[a]]></fr:tex> and <fr:tex display="inline"><![CDATA[b]]></fr:tex> respectively, i.e. <fr:tex display="inline"><![CDATA[f(x_a) = a]]></fr:tex> and <fr:tex display="inline"><![CDATA[f(x_b) = b]]></fr:tex>. Because <fr:tex display="inline"><![CDATA[X]]></fr:tex> is <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link>, an <fr:link href="/forest/dm-000C/" title="Upper bound" uri="https://liamoc.net/forest/dm-000C/" display-uri="dm-000C" type="local">upper bound</fr:link> of <fr:tex display="inline"><![CDATA[x_a]]></fr:tex> and <fr:tex display="inline"><![CDATA[x_b]]></fr:tex> exists in <fr:tex display="inline"><![CDATA[X]]></fr:tex>. Call this <fr:link href="/forest/dm-000C/" title="Upper bound" uri="https://liamoc.net/forest/dm-000C/" display-uri="dm-000C" type="local">upper bound</fr:link> <fr:tex display="inline"><![CDATA[x_c]]></fr:tex>. Because <fr:tex display="inline"><![CDATA[x_a \sqsubseteq  x_c]]></fr:tex> and <fr:tex display="inline"><![CDATA[x_b \sqsubseteq  x_c]]></fr:tex>, we know that <fr:tex display="inline"><![CDATA[f(x_a) = a \sqsubseteq  f(x_c)]]></fr:tex> and <fr:tex display="inline"><![CDATA[f(x_b) = b \sqsubseteq  f(x_c)]]></fr:tex> by <fr:link href="/forest/dt-000J/" title="Monotonicity" uri="https://liamoc.net/forest/dt-000J/" display-uri="dt-000J" type="local">monotonicity</fr:link> of <fr:tex display="inline"><![CDATA[f]]></fr:tex>. Also, <fr:tex display="inline"><![CDATA[f(x_c) \in  \{ f(x) \mid  x \in  X \}]]></fr:tex> because <fr:tex display="inline"><![CDATA[x_c \in  X]]></fr:tex>. Therefore, because two arbitrary elements in <fr:tex display="inline"><![CDATA[\{ f(x) \mid  x \in  X \}]]></fr:tex> have an <fr:link href="/forest/dm-000C/" title="Upper bound" uri="https://liamoc.net/forest/dm-000C/" display-uri="dm-000C" type="local">upper bound</fr:link> within the set, the set <fr:tex display="inline"><![CDATA[\{ f(x) \mid  x \in  X \}]]></fr:tex> is <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link>.     </html:p></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-001O/</fr:uri><fr:display-uri>dt-001O</fr:display-uri><fr:route>/forest/dt-001O/</fr:route><fr:title text="Alternative characterisation of continuity">Alternative characterisation of continuity</fr:title><fr:taxon>Theorem</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>A function <fr:tex display="inline"><![CDATA[f : A \rightarrow  B]]></fr:tex> on <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> <fr:tex display="inline"><![CDATA[A]]></fr:tex> and <fr:tex display="inline"><![CDATA[B]]></fr:tex> is <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link> iff:
<html:ol><html:li><fr:tex display="inline"><![CDATA[f]]></fr:tex> is <fr:link href="/forest/dt-000J/" title="Monotonicity" uri="https://liamoc.net/forest/dt-000J/" display-uri="dt-000J" type="local">monotonic</fr:link>, and</html:li>
	<html:li><fr:tex display="inline"><![CDATA[f(\bigsqcup  X) = \bigsqcup  \{ f(x) \mid  x \in  X \}]]></fr:tex>, for all <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link> <fr:tex display="inline"><![CDATA[X \subseteq  A]]></fr:tex></html:li></html:ol>

  
  
<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Proof</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>The second condition here is identical to that of <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">Definition <fr:contextual-number uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" /></fr:link>. The <fr:link href="/forest/dt-000J/" title="Monotonicity" uri="https://liamoc.net/forest/dt-000J/" display-uri="dt-000J" type="local">monotonicity</fr:link> requirement is equivalent to the first condition of <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">Definition <fr:contextual-number uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" /></fr:link>, with one direction shown by <fr:link href="/forest/dt-001L/" title="Continuity implies monotonicity" uri="https://liamoc.net/forest/dt-001L/" display-uri="dt-001L" type="local">Theorem <fr:contextual-number uri="https://liamoc.net/forest/dt-001L/" display-uri="dt-001L" /></fr:link>, and the other shown by the solution of <fr:link href="/forest/dt-001N/" title="https://liamoc.net/forest/dt-001N/" uri="https://liamoc.net/forest/dt-001N/" display-uri="dt-001N" type="local">Exercise <fr:contextual-number uri="https://liamoc.net/forest/dt-001N/" display-uri="dt-001N" /></fr:link>. </html:p></fr:mainmatter></fr:tree></html:p></fr:mainmatter></fr:tree>
  
  
<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors /><fr:taxon>Thesis</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Computable functions are <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link> functions on <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link>.</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-001W/</fr:uri><fr:display-uri>dt-001W</fr:display-uri><fr:route>/forest/dt-001W/</fr:route><fr:taxon>Exercise</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Show that if a function <fr:tex display="inline"><![CDATA[f : A \rightarrow  B]]></fr:tex> on <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> <fr:tex display="inline"><![CDATA[A]]></fr:tex> and <fr:tex display="inline"><![CDATA[B]]></fr:tex> is <fr:link href="/forest/dt-000J/" title="Monotonicity" uri="https://liamoc.net/forest/dt-000J/" display-uri="dt-000J" type="local">monotonic</fr:link> and <fr:tex display="inline"><![CDATA[A]]></fr:tex> is finite, then <fr:tex display="inline"><![CDATA[f]]></fr:tex> is <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link>. </html:p><html:p><html:em>Hint</html:em>: Finite <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link> sets contain their <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link></html:p>
	
	
	
	<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Because of <fr:link href="/forest/dt-001O/" title="Alternative characterisation of continuity" uri="https://liamoc.net/forest/dt-001O/" display-uri="dt-001O" type="local">Theorem <fr:contextual-number uri="https://liamoc.net/forest/dt-001O/" display-uri="dt-001O" /></fr:link>, it suffices to show the second condition of <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuity</fr:link>, as <fr:tex display="inline"><![CDATA[f]]></fr:tex> is <fr:link href="/forest/dt-000J/" title="Monotonicity" uri="https://liamoc.net/forest/dt-000J/" display-uri="dt-000J" type="local">monotonic</fr:link>.   </html:p><html:p>Because <fr:tex display="inline"><![CDATA[A]]></fr:tex> is finite, any directed subset <fr:tex display="inline"><![CDATA[X \subseteq  A]]></fr:tex> is also finite, and therefore <fr:tex display="inline"><![CDATA[\bigsqcup  X \in  X]]></fr:tex>. Because <fr:tex display="inline"><![CDATA[f]]></fr:tex> is <fr:link href="/forest/dt-000J/" title="Monotonicity" uri="https://liamoc.net/forest/dt-000J/" display-uri="dt-000J" type="local">monotone</fr:link>, <fr:tex display="inline"><![CDATA[f(x) \sqsubseteq  f (\bigsqcup  X)]]></fr:tex> for all <fr:tex display="inline"><![CDATA[x \in  X]]></fr:tex>. </html:p><html:p>The solution to <fr:link href="/forest/dt-001N/" title="https://liamoc.net/forest/dt-001N/" uri="https://liamoc.net/forest/dt-001N/" display-uri="dt-001N" type="local">Exercise <fr:contextual-number uri="https://liamoc.net/forest/dt-001N/" display-uri="dt-001N" /></fr:link> shows that <fr:tex display="inline"><![CDATA[\{f(x) \mid  x \in  X\}]]></fr:tex> is <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link> and therefore contains its upper bound <fr:tex display="inline"><![CDATA[c]]></fr:tex>. Because <fr:tex display="inline"><![CDATA[f]]></fr:tex> is monotone, <fr:tex display="inline"><![CDATA[f(\bigsqcup  X)]]></fr:tex> must be <fr:tex display="inline"><![CDATA[c]]></fr:tex> (else it would contradict the above).</html:p><html:p>Therefore <fr:tex display="inline"><![CDATA[\bigsqcup  \{f(x) \mid  x \in  X\} = f (\bigsqcup  X)]]></fr:tex>, as required. </html:p></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors /><fr:uri>https://liamoc.net/forest/dt-001P/</fr:uri><fr:display-uri>dt-001P</fr:display-uri><fr:route>/forest/dt-001P/</fr:route><fr:title text="The Kleene fixed point theorem">The Kleene fixed point theorem</fr:title><fr:taxon>Theorem</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Let <fr:tex display="inline"><![CDATA[(S, \sqsubseteq )]]></fr:tex> be a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> and <fr:tex display="inline"><![CDATA[f : S \rightarrow  S]]></fr:tex> be a <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link> function. Then the <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link> of the <fr:link href="/forest/dt-000X/" title="Ascending Kleene chain" uri="https://liamoc.net/forest/dt-000X/" display-uri="dt-000X" type="local">Kleene chain</fr:link> <fr:tex display="inline"><![CDATA[\bigsqcup _{n\in  \mathbb {N}}f^{n}(\bot )]]></fr:tex> is the least <fr:link href="/forest/dt-000S/" title="Fixed point" uri="https://liamoc.net/forest/dt-000S/" display-uri="dt-000S" type="local">fixed point</fr:link> of <fr:tex display="inline"><![CDATA[f]]></fr:tex>.</html:p>
  
  
<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors /><fr:taxon>Proof</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>We apply <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuity</fr:link> to show that it is a <fr:link href="/forest/dt-000S/" title="Fixed point" uri="https://liamoc.net/forest/dt-000S/" display-uri="dt-000S" type="local">fixed point</fr:link>:
	
	<fr:tex display="block"><![CDATA[\begin {array}{lclr}
	f(\bigsqcup _{n \in  \mathbb {N}} f^n(\bot )	) & = & 
	\bigsqcup _{n \in  \mathbb {N}} f(f^n(\bot )) & 
	\text {(continuity)} \\[0.5em]
		&=& \bigsqcup _{n \in  \mathbb {N}} f^{n+1}(\bot )\\[0.5em]
		&=& \bigsqcup _{n=1,2\dots }f^{n}(\bot )
		&\qquad \text {(reindexing)}\\[0.5em]
		&=& \bot  \sqcup  \bigsqcup _{n=1,2\dots }f^{n}(\bot )\\[0.5em]
			&=&\bigsqcup _{n\in  \mathbb {N}}f^{n}(\bot )\\[0.5em]
	\end {array}
	]]></fr:tex>
	To see that it is the <html:em>least</html:em> <fr:link href="/forest/dt-000S/" title="Fixed point" uri="https://liamoc.net/forest/dt-000S/" display-uri="dt-000S" type="local">fixed point</fr:link>: Let <fr:tex display="inline"><![CDATA[y]]></fr:tex> be a <fr:link href="/forest/dt-000S/" title="Fixed point" uri="https://liamoc.net/forest/dt-000S/" display-uri="dt-000S" type="local">fixed point</fr:link> of <fr:tex display="inline"><![CDATA[f]]></fr:tex>. We know that <fr:tex display="inline"><![CDATA[\bot  \sqsubseteq  y]]></fr:tex> by <fr:link href="/forest/dt-000A/" title="The bottom value" uri="https://liamoc.net/forest/dt-000A/" display-uri="dt-000A" type="local">definition of <fr:tex display="inline"><![CDATA[\bot ]]></fr:tex></fr:link>. Taking <fr:tex display="inline"><![CDATA[f]]></fr:tex> of both sides, we get <fr:tex display="inline"><![CDATA[f(\bot ) \sqsubseteq  y]]></fr:tex>. We can continue this inductively and thus we know that, for all <fr:tex display="inline"><![CDATA[n \in  \mathbb {N}]]></fr:tex>, <fr:tex display="inline"><![CDATA[f^n(\bot ) \sqsubseteq  y]]></fr:tex>. Because <fr:tex display="inline"><![CDATA[y]]></fr:tex> is, therefore, an <fr:link href="/forest/dm-000C/" title="Upper bound" uri="https://liamoc.net/forest/dm-000C/" display-uri="dm-000C" type="local">upper bound</fr:link> of the <fr:link href="/forest/dt-000X/" title="Ascending Kleene chain" uri="https://liamoc.net/forest/dt-000X/" display-uri="dt-000X" type="local">ascending Kleene chain</fr:link>, it must also be at least as large as the <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link> of that <fr:link href="/forest/dt-000V/" title="Chain" uri="https://liamoc.net/forest/dt-000V/" display-uri="dt-000V" type="local">chain</fr:link>.
</html:p></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-001Q/</fr:uri><fr:display-uri>dt-001Q</fr:display-uri><fr:route>/forest/dt-001Q/</fr:route><fr:title text="The \textbf {fix} operator">The <fr:tex display="inline"><![CDATA[\textbf {fix}]]></fr:tex> operator</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Let <fr:tex display="inline"><![CDATA[\textbf {fix}(f)]]></fr:tex> denote the least <fr:link href="/forest/dt-000S/" title="Fixed point" uri="https://liamoc.net/forest/dt-000S/" display-uri="dt-000S" type="local">fixed point</fr:link> of the <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous function</fr:link> <fr:tex display="inline"><![CDATA[f]]></fr:tex>, that is <fr:tex display="inline"><![CDATA[\bigsqcup _{n\in  \mathbb {N}}f^{n}(\bot )]]></fr:tex>, guaranteed to exist by <fr:link href="/forest/dt-001P/" title="The Kleene fixed point theorem" uri="https://liamoc.net/forest/dt-001P/" display-uri="dt-001P" type="local">Theorem <fr:contextual-number uri="https://liamoc.net/forest/dt-001P/" display-uri="dt-001P" /></fr:link>.</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-001S/</fr:uri><fr:display-uri>dt-001S</fr:display-uri><fr:route>/forest/dt-001S/</fr:route><fr:taxon>Exercise</fr:taxon></fr:frontmatter><fr:mainmatter><html:ol><html:li>What is <fr:tex display="inline"><![CDATA[\textbf {fix}(\mathsf {id})]]></fr:tex> where <fr:tex display="inline"><![CDATA[\mathsf {id}]]></fr:tex> is the identity function on <fr:tex display="inline"><![CDATA[\mathbb {B}_\bot ]]></fr:tex>?
	
	  
	  
	  
	<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter><fr:tex display="block"><![CDATA[\bigsqcup  \{ \bot , \mathsf {id}(\bot ), \mathsf {id}(\mathsf {id}(\bot )), \dots  \} = \bot ]]></fr:tex></fr:mainmatter></fr:tree></html:li>
	<html:li>What is <fr:tex display="inline"><![CDATA[\textbf {fix}(\kappa _\mathit {F})]]></fr:tex> where <fr:tex display="inline"><![CDATA[\kappa _\mathit {F}]]></fr:tex> is the constant function that always returns <fr:tex display="inline"><![CDATA[\mathit {F}]]></fr:tex>?
	 
	   
	   
	   
	 <fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter><fr:tex display="block"><![CDATA[\bigsqcup  \{ \bot , \kappa _F(\bot ), \kappa _F(\kappa _F(\bot )), \dots  \} = \mathit {F}]]></fr:tex></fr:mainmatter></fr:tree></html:li>
	<html:li>What is <fr:tex display="inline"><![CDATA[\textbf {fix}(f)]]></fr:tex> where 
		<fr:tex display="block"><![CDATA[\begin {array}{l}
		f : [\mathbb {N}_\bot ] \rightarrow  [\mathbb {N}_\bot ]\\
		f(x) = 1::x	
		\end {array}]]></fr:tex>
		(where <fr:tex display="inline"><![CDATA[[\mathbb {N}_\bot ]]]></fr:tex> denotes Haskell-style lazy lists of <fr:tex display="inline"><![CDATA[\mathbb {N}_\bot ]]></fr:tex>)?
		
		   
		   
		   
		 <fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter><html:p><fr:tex display="block"><![CDATA[\bigsqcup  \{ \bot , 1::\bot , 1::1::\bot , \dots  \} = 1::1::1::\cdots ]]></fr:tex>
Here  <fr:tex display="inline"><![CDATA[\textbf {fix}(f)]]></fr:tex>  would be the semantics of the recursive definition <fr:tex display="inline"><![CDATA[\mathsf {ones} = 1 :: \mathsf {ones}]]></fr:tex>.</html:p></fr:mainmatter></fr:tree></html:li></html:ol></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-001R/</fr:uri><fr:display-uri>dt-001R</fr:display-uri><fr:route>/forest/dt-001R/</fr:route><fr:title text="Semantics with fixed points">Semantics with fixed points</fr:title></fr:frontmatter><fr:mainmatter><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-001V/</fr:uri><fr:display-uri>dt-001V</fr:display-uri><fr:route>/forest/dt-001V/</fr:route><fr:title text="Semantics of loops">Semantics of loops</fr:title></fr:frontmatter><fr:mainmatter><html:p>Armed with <fr:link href="/forest/dt-001Q/" title="The \textbf {fix} operator" uri="https://liamoc.net/forest/dt-001Q/" display-uri="dt-001Q" type="local">the <fr:tex display="inline"><![CDATA[\textbf {fix}]]></fr:tex> operator</fr:link>, we can return to our semantics of <fr:tex display="inline"><![CDATA[\mathsf {while}]]></fr:tex> loops from <fr:link href="/forest/dt-0006/" title="Recursively defined programs" uri="https://liamoc.net/forest/dt-0006/" display-uri="dt-0006" type="local">§ <fr:contextual-number uri="https://liamoc.net/forest/dt-0006/" display-uri="dt-0006" /></fr:link> and <fr:link href="/forest/dt-000R/" title="From recursion to fixed points" uri="https://liamoc.net/forest/dt-000R/" display-uri="dt-000R" type="local">§ <fr:contextual-number uri="https://liamoc.net/forest/dt-000R/" display-uri="dt-000R" /></fr:link>, and at last define their semantics without relying on dubious recursive definitions:
<fr:tex display="block"><![CDATA[
\begin {array}{l}
\llbracket  \mathsf {while}\ b\ \mathsf {do}\ c\ \mathsf {od} \rrbracket _\mathcal {C} = \textbf {fix}(f)\\[0.5em]
\qquad  \text {where}\; f(X)\ \sigma \; \triangleq  \; \begin {cases}  X\ (\llbracket  c \rrbracket _\mathcal {C}\ \sigma ) & \text {if}\ \llbracket  b \rrbracket _\mathcal {B}\ \sigma  = \mathit {T} \\ 
		   \sigma  & \text {otherwise}
 \end {cases} 
\end {array}
]]></fr:tex></html:p><html:p>Proof that <fr:tex display="inline"><![CDATA[f]]></fr:tex> is <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link> is technically required but is omitted here.</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-001U/</fr:uri><fr:display-uri>dt-001U</fr:display-uri><fr:route>/forest/dt-001U/</fr:route><fr:title text="Semantics of recursive functions">Semantics of recursive functions</fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Consider the function <fr:tex display="inline"><![CDATA[\Phi  \in  (\mathbb {N}_\bot  \rightarrow  \mathbb {N}_\bot ) \rightarrow  (\mathbb {N}_\bot  \rightarrow  \mathbb {N}_\bot )]]></fr:tex>, given by:
<fr:tex display="block"><![CDATA[\Phi (f) = \lambda  n.\ \text {if}\ n = 0\ \text {then}\ 1\ \text {else}\ n\cdot  f(n-1)]]></fr:tex>
Looking at the first few elements of our <fr:link href="/forest/dt-000X/" title="Ascending Kleene chain" uri="https://liamoc.net/forest/dt-000X/" display-uri="dt-000X" type="local">Kleene chain</fr:link>, we get:
<fr:tex display="block"><![CDATA[
\begin {array}{lcl}
	\Phi ^0(\bot ) & = & \lambda  n.\ \bot  \quad  \text {(i.e. $\bot _{\mathbb {N}_\bot  \rightarrow  \mathbb {N}_\bot }$)}\\
	\Phi ^1(\bot ) & = & \lambda  n.\ \text {if}\ n = 0\ \text {then}\ 1\ \text {else}\ \bot \\
	\Phi ^2(\bot ) & = & \lambda  n.\ \text {if}\ n = 0\ \text {then}\ 1\ \text {else}\ n\cdot (\text {if}\ n - 1 = 0\ \text {then}\ 1\ \text {else}\ \bot )\\
	\cdots 
\end {array}
]]></fr:tex>
Continuing on, we see that the <fr:tex display="inline"><![CDATA[m]]></fr:tex>th approximation <fr:tex display="inline"><![CDATA[\Phi ^m(\bot )]]></fr:tex> to  <fr:tex display="inline"><![CDATA[\textbf {fix}(\Phi )]]></fr:tex> is the function that gives <fr:tex display="inline"><![CDATA[x!]]></fr:tex> for all <fr:tex display="inline"><![CDATA[x]]></fr:tex> up to <fr:tex display="inline"><![CDATA[m]]></fr:tex>, and diverges (<fr:tex display="inline"><![CDATA[\bot ]]></fr:tex>) for all other arguments. Hence the limit <fr:tex display="inline"><![CDATA[\textbf {fix}(\Phi )]]></fr:tex> is the <html:em>factorial</html:em> function on <fr:tex display="inline"><![CDATA[\mathbb {N}_\bot ]]></fr:tex>!
</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-001T/</fr:uri><fr:display-uri>dt-001T</fr:display-uri><fr:route>/forest/dt-001T/</fr:route><fr:taxon>Exercise</fr:taxon></fr:frontmatter><fr:mainmatter><html:ol><html:li>Write down the first few approximations <fr:tex display="inline"><![CDATA[\Phi ^m(\bot )]]></fr:tex> to <fr:tex display="inline"><![CDATA[\textbf {fix}(\Phi )]]></fr:tex>, where the higher order function <fr:tex display="inline"><![CDATA[\Phi  : (\mathbb {Z}_\bot  \rightarrow  [\mathbb {Z}_\bot ]) \rightarrow  (\mathbb {Z}_\bot  \rightarrow  [\mathbb {Z}_\bot ])]]></fr:tex> is given by:
<fr:tex display="block"><![CDATA[\Phi (f) = \lambda  n.\ n :: f (n+1)]]></fr:tex>
What is <fr:tex display="inline"><![CDATA[\Phi ^m(\bot )]]></fr:tex>? What is <fr:tex display="inline"><![CDATA[\textbf {fix}(\Phi )]]></fr:tex>?</html:li>
		
   
   
   
 <fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>The approximations are <fr:tex display="inline"><![CDATA[\{ \lambda  n.\ \bot ,  \lambda  n.\ n :: \bot , \lambda  n.\ n :: (n + 1) :: \bot , \dots  \}]]></fr:tex>. The limit is a function that, given a natural number <fr:tex display="inline"><![CDATA[n]]></fr:tex>, produces the infinite list of natural numbers starting from <fr:tex display="inline"><![CDATA[n]]></fr:tex>.</html:p></fr:mainmatter></fr:tree>
<html:li>Repeat the same process, but this time for a new higher order function  <fr:tex display="inline"><![CDATA[\Phi  : (\mathbb {Z}_\bot  \rightarrow  \mathbb {Z}_\bot ) \rightarrow  (\mathbb {Z}_\bot  \rightarrow  \mathbb {Z}_\bot )]]></fr:tex> given by:
<fr:tex display="block"><![CDATA[\Phi (f) = \lambda  n.\ \text {if}\ n = 0\ \text {then}\ 0\ \text {else}\ f(n-2)]]></fr:tex></html:li>
	
   
   
   
 <fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>The <fr:tex display="inline"><![CDATA[n]]></fr:tex>th approximation returns <fr:tex display="inline"><![CDATA[0]]></fr:tex> if the input number 
is non-negative, even and less than <fr:tex display="inline"><![CDATA[2n]]></fr:tex>, otherwise it diverges (returns <fr:tex display="inline"><![CDATA[\bot ]]></fr:tex>). The limit returns <fr:tex display="inline"><![CDATA[0]]></fr:tex> for any non-negative even number, and diverges otherwise. </html:p></fr:mainmatter></fr:tree></html:ol></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree>
<fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-001Z/</fr:uri><fr:display-uri>dt-001Z</fr:display-uri><fr:route>/forest/dt-001Z/</fr:route><fr:title text="Constructions on cpos and PCF">Constructions on <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> and PCF</fr:title><fr:taxon>Lecture</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>This lecture is based on material from <fr:link href="/forest/haskellhutt/" title="Graham Hutton" uri="https://liamoc.net/forest/haskellhutt/" display-uri="haskellhutt" type="local">Graham Hutton</fr:link>, <fr:link href="/forest/jlongley/" title="John Longley" uri="https://liamoc.net/forest/jlongley/" display-uri="jlongley" type="local">John Longley</fr:link>, <fr:link href="/forest/danascott/" title="Dana Scott" uri="https://liamoc.net/forest/danascott/" display-uri="danascott" type="local">Dana Scott</fr:link>, <fr:link href="/forest/jstoy/" title="Joseph Stoy" uri="https://liamoc.net/forest/jstoy/" display-uri="jstoy" type="local">Joseph Stoy</fr:link>, <fr:link href="/forest/cgunter/" title="Carl Gunter" uri="https://liamoc.net/forest/cgunter/" display-uri="cgunter" type="local">Carl Gunter</fr:link>, and <fr:link href="/forest/gwinskel/" title="Glynn Winskel" uri="https://liamoc.net/forest/gwinskel/" display-uri="gwinskel" type="local">Glynn Winskel</fr:link>.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-002K/</fr:uri><fr:display-uri>dt-002K</fr:display-uri><fr:route>/forest/dt-002K/</fr:route><fr:title text="Products">Products</fr:title></fr:frontmatter><fr:mainmatter><html:p>Recall <fr:link href="/forest/dt-000E/" title="Product of two pointed posets" uri="https://liamoc.net/forest/dt-000E/" display-uri="dt-000E" type="local">Construction <fr:contextual-number uri="https://liamoc.net/forest/dt-000E/" display-uri="dt-000E" /></fr:link>, which showed that the <fr:link href="/forest/dm-0005/" title="Cartesian product" uri="https://liamoc.net/forest/dm-0005/" display-uri="dm-0005" type="local">product</fr:link> of two <fr:link href="/forest/dt-000G/" title="Pointed poset" uri="https://liamoc.net/forest/dt-000G/" display-uri="dt-000G" type="local">pointed posets</fr:link> is itself a <fr:link href="/forest/dt-000G/" title="Pointed poset" uri="https://liamoc.net/forest/dt-000G/" display-uri="dt-000G" type="local">pointed poset</fr:link>.

In <fr:link href="/forest/dt-001X/" title="https://liamoc.net/forest/dt-001X/" uri="https://liamoc.net/forest/dt-001X/" display-uri="dt-001X" type="local">Exercise <fr:contextual-number uri="https://liamoc.net/forest/dt-001X/" display-uri="dt-001X" /></fr:link> you may also have shown that <fr:tex display="inline"><![CDATA[A \times  B]]></fr:tex> is also a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> if <fr:tex display="inline"><![CDATA[A]]></fr:tex> and <fr:tex display="inline"><![CDATA[B]]></fr:tex> are <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link>, with this definition for <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lubs</fr:link>:
<fr:tex display="block"><![CDATA[
\bigsqcup  X \; = \; \left (\bigsqcup  \{ x \mid  \exists  y.\ (x,y) \in  X \}, \bigsqcup  \{ y \mid  \exists  x.\ (x,y) \in  X \}\right )
]]></fr:tex>
This definition can be made a little more comprehensible by defining it in terms of the two projection operators for pairs:
</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0020/</fr:uri><fr:display-uri>dt-0020</fr:display-uri><fr:route>/forest/dt-0020/</fr:route><fr:title text="Projection operators for products">Projection operators for <fr:link href="/forest/dm-0005/" title="Cartesian product" uri="https://liamoc.net/forest/dm-0005/" display-uri="dm-0005" type="local">products</fr:link></fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Destruction of pairs is captured by the two <html:em>projection</html:em> operators, defined as follows:</html:p>
  <html:table>
  
  <html:tr>
    
  <html:td>
      <fr:resource hash="3996476a938ddd4ee17248f2c6d42fa9"><fr:resource-content><html:img src="/forest/3996476a938ddd4ee17248f2c6d42fa9.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {string-diagrams}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
      \begin {tikzpicture}
        \node  at (-1.5cm,0) {$ $};
        \node [box, box ports west = 2, box ports east = 2, minimum width=2cm, minimum height=2cm] (A) {};
        \node [dot] at (A.west.1) {};
        \node [dot] at (A.east.1) {};
        \draw [thick] (A.west.1) -- (A.east.1);
        \draw [thick,-|] (A.west.2) -- ([xshift=-1cm]A.east.2);
        \node  at ([xshift=-1cm,yshift=-0.8cm]A.east.2) {$\pi _1$};
        \node [dot] at (A.west.2) {};
      \end {tikzpicture}
      ]]></fr:resource-source></fr:resource>
    </html:td>

    
  <html:td>
      <fr:tex display="block"><![CDATA[
      \begin {array}{lcl}
      \pi _0 : A \times  B \rightarrow  A & \qquad   & \pi _1 : A \times  B \rightarrow  B \\
      \pi _0(x, y) = x & & \pi _1(x, y) = y \\
      \end {array}
      ]]></fr:tex>
    </html:td>

    
  <html:td>
      <fr:resource hash="326ee154bc1d65fe54e5713330e66aee"><fr:resource-content><html:img src="/forest/326ee154bc1d65fe54e5713330e66aee.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {string-diagrams}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
      \begin {tikzpicture}
        \node [box, box ports west = 2, box ports east = 2, minimum width=2cm, minimum height=2cm] (B) at (12cm,0) {};
        \node [dot] at (B.west.1) {};
        \node [dot] at (B.east.2) {};
        \draw [thick] (B.west.2) -- (B.east.2);
        \draw [thick,-|] (B.west.1) -- ([xshift=-1cm]B.east.1);
        \node  at ([xshift=-1cm,yshift=-0.8cm]B.east.2) {$\pi _2$};
        \node [dot] at (B.west.2) {};
      \end {tikzpicture}
      ]]></fr:resource-source></fr:resource>
    </html:td>

  </html:tr>

</html:table>
</fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0021/</fr:uri><fr:display-uri>dt-0021</fr:display-uri><fr:route>/forest/dt-0021/</fr:route><fr:title text="Product of cpos">Product of <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link></fr:title><fr:taxon>Construction</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Given <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> <fr:tex display="inline"><![CDATA[A]]></fr:tex> and <fr:tex display="inline"><![CDATA[B]]></fr:tex>, the <fr:link href="/forest/dt-000G/" title="Pointed poset" uri="https://liamoc.net/forest/dt-000G/" display-uri="dt-000G" type="local">product</fr:link> <fr:tex display="inline"><![CDATA[A \times  B]]></fr:tex> is itself a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link>, ordered by 
<fr:tex display="block"><![CDATA[ (x,y) \sqsubseteq _{X \times  Y} (x',y') \quad  \text {iff} \quad  x \sqsubseteq _X x' \land  y \sqsubseteq _Y y' ]]></fr:tex>
with bottom value <fr:tex display="inline"><![CDATA[\bot _{X \times  Y}]]></fr:tex> being <fr:tex display="inline"><![CDATA[(\bot _A, \bot _B)]]></fr:tex>. <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">Least upper bounds</fr:link> are found by taking the <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lubs</fr:link> of each component:</html:p><fr:tex display="block"><![CDATA[
  \bigsqcup  X \; = \; \left (\bigsqcup  \{ \pi _0(x) \mid  x \in  X \}, \bigsqcup  \{ \pi _1(x) \mid  x \in  X \}\right )
]]></fr:tex></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0022/</fr:uri><fr:display-uri>dt-0022</fr:display-uri><fr:route>/forest/dt-0022/</fr:route><fr:title text="Continuity of projection operations">Continuity of projection operations</fr:title><fr:taxon>Theorem</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>The <fr:link href="/forest/dt-0020/" title="Projection operators for products" uri="https://liamoc.net/forest/dt-0020/" display-uri="dt-0020" type="local">projection functions</fr:link> <fr:tex display="inline"><![CDATA[\pi _0]]></fr:tex> and <fr:tex display="inline"><![CDATA[\pi _1]]></fr:tex> are <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link>.</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0023/</fr:uri><fr:display-uri>dt-0023</fr:display-uri><fr:route>/forest/dt-0023/</fr:route><fr:title text="The split function">The split function</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p><html:div class="sidefigure"><fr:resource hash="9cae4dacd07e38d46baa6ef56d761b3e"><fr:resource-content><html:img src="/forest/9cae4dacd07e38d46baa6ef56d761b3e.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {string-diagrams}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
  \begin {tikzpicture}
    \node [box, box ports west = 1, box ports east = 2, minimum width=3cm, minimum height=3cm] (A) {};
    \node [dot] at (A.east.1) {};
    \node [dot] at (A.east.2) {};
    \node [dot] at (A.west.1) {};
    \node [dot] (X) at ([xshift=1cm]A.west.1) {};
    \node [box,thick] (f) at ([xshift=-1cm]A.east.1) {f};
    \node [box,thick] (g) at ([xshift=-1cm]A.east.2) {g};
    \wires [thick]{
      f = { west = X.north, east=A.east.1},
      g = { west = X.south, east=A.east.2},
      X = { west = A.west.1 }
    }{}
  \end {tikzpicture}]]></fr:resource-source></fr:resource></html:div>
  Construction of pairs is captured by the <html:em>split</html:em> function: If <fr:tex display="inline"><![CDATA[f : A \rightarrow  B]]></fr:tex> and <fr:tex display="inline"><![CDATA[g : B \rightarrow  C]]></fr:tex>, then <html:em>split</html:em>, written <fr:tex display="inline"><![CDATA[\langle  f , g \rangle ]]></fr:tex>, is defined as:
  
 
  <fr:tex display="block"><![CDATA[
  \begin {array}{lr}
    \langle  f , g \rangle  : A \rightarrow  B \times  C\\
    \langle  f , g \rangle \ a = (f(a), g(a))	
  \end {array}
  ]]></fr:tex></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0024/</fr:uri><fr:display-uri>dt-0024</fr:display-uri><fr:route>/forest/dt-0024/</fr:route><fr:title text="Continuity of split">Continuity of split</fr:title><fr:taxon>Theorem</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>For <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous functions</fr:link> <fr:tex display="inline"><![CDATA[f]]></fr:tex> and <fr:tex display="inline"><![CDATA[g]]></fr:tex>, the <fr:link href="/forest/dt-0023/" title="The split function" uri="https://liamoc.net/forest/dt-0023/" display-uri="dt-0023" type="local">split function</fr:link> <fr:tex display="inline"><![CDATA[\langle  f, g \rangle ]]></fr:tex> is <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link>.</html:p>


<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Proof</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Using the <fr:link href="/forest/dt-001O/" title="Alternative characterisation of continuity" uri="https://liamoc.net/forest/dt-001O/" display-uri="dt-001O" type="local">alternative characterisation of continuity</fr:link>:</html:p>
  <html:ul><html:li><html:em><fr:tex display="inline"><![CDATA[\langle  f, g \rangle ]]></fr:tex> is <fr:link href="/forest/dt-000J/" title="Monotonicity" uri="https://liamoc.net/forest/dt-000J/" display-uri="dt-000J" type="local">monotonic</fr:link></html:em>. Let <fr:tex display="inline"><![CDATA[x \sqsubseteq  y \in  A]]></fr:tex>. Then: <fr:tex display="block"><![CDATA[\begin {array}{lclr}  
          \langle  f , g \rangle \ x & = & (f(x), g(x)) & \text {(def)}\\
           & \sqsubseteq  & (f(y), g(y)) & \text {(monotonicity of $f$,$g$)}\\
           & = & \langle  f , g \rangle \ y & \text {(def)}
              \end {array}]]></fr:tex></html:li>
  <html:li><html:em><fr:tex display="inline"><![CDATA[\langle  f , g \rangle ]]></fr:tex> preserves <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lubs</fr:link> of <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link> sets</html:em>. Let <fr:tex display="inline"><![CDATA[X \subseteq  A]]></fr:tex> be <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link>. Then:</html:li>
   <fr:tex display="block"><![CDATA[\begin {array}{lclr}  
          \langle  f , g \rangle \ (\bigsqcup  X) & = & (f(\bigsqcup  X), g(\bigsqcup  X)) & \text {(def)}\\
           & = & (\bigsqcup  \{ f(x) \mid  x \in  X \}, \bigsqcup  \{ g(x) \mid  x \in  X \}) & \text {(continuity of $f$,$g$)}\\
           & = & \bigsqcup  \{ \langle  f , g \rangle \ x \mid  x \in  X \} & \text {(def)}
              \end {array}]]></fr:tex></html:ul>
</fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><html:p>These building blocks can be used to make many functions on <fr:link href="/forest/dt-0021/" title="Product of cpos" uri="https://liamoc.net/forest/dt-0021/" display-uri="dt-0021" type="local">products</fr:link> (thereby ensuring <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuity</fr:link>):
</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0025/</fr:uri><fr:display-uri>dt-0025</fr:display-uri><fr:route>/forest/dt-0025/</fr:route><fr:title text="The \mathit {swap} function">The <fr:tex display="inline"><![CDATA[\mathit {swap}]]></fr:tex> function</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter>
  <html:table>
	
  <html:tr>
		
  <html:td><fr:resource hash="c1484d638c8097af445fbbc16cc7d1a8"><fr:resource-content><html:img src="/forest/c1484d638c8097af445fbbc16cc7d1a8.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {string-diagrams}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[\begin {tikzpicture}
			\node [box, box ports west = 2, box ports east = 2, minimum width=3cm, minimum height=3cm] (ZZ) at (-9cm,0) {};
			\draw [thick] (ZZ.west.1) -- (ZZ.east.2);
			\draw [thick] (ZZ.west.2) -- (ZZ.east.1);
			\node [dot] at (ZZ.east.1) {};
			\node [dot] at (ZZ.east.2) {};
			\node [dot] at (ZZ.west.1) {};
			\node [dot] at (ZZ.west.2) {};
			\node  at (-6.3cm,0) {\Large  $=$};
		\end {tikzpicture} ]]></fr:resource-source></fr:resource></html:td>

		
  <html:td>
			<fr:resource hash="404edd4a4a765c7b0728de5201244e79"><fr:resource-content><html:img src="/forest/404edd4a4a765c7b0728de5201244e79.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {string-diagrams}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
		\begin {tikzpicture}		
		\node [box, box ports west = 1, box ports east = 2, minimum width=3cm, minimum height=3cm] (A) {};
		\node [dot] (ae) at ([yshift=-0.2cm]A.east.1) {};
		\node [dot] (ae2) at ([yshift=0.2cm]A.east.2) {};
		\node [dot] (aw) at ([yshift=0.15cm]A.west.1) {};
			\node [dot] (aw2) at ([yshift=-0.15cm]A.west.1) {};
		\node [dot] (X) at ([xshift=1cm,yshift=0.15cm]A.west.1) {};
		\node [dot] (Y) at ([xshift=0.7cm,yshift=-0.15cm]A.west.1) {};
		\node [box,thick, box ports west=2, box ports east=2] (f) at ([xshift=-1cm]A.east.1) {};
		\node [box,thick, box ports west=2, box ports east=2] (g) at ([xshift=-1cm]A.east.2) {};
		\wires [thick]{
			f = { west.1 = X.north, west.2 = Y.north,  east.2=ae.west},
			g = { west.1 = X.south, west.2 = Y.south, east.1=ae2.west},
			X = { west = aw.east },
			Y = { west = aw2.east },
		}{};
		\draw [thick] (f.west.2) -- (f.east.2); 
		\draw [thick,-|] (f.west.1) -- ([xshift=0.4cm]f.west.1); 
		\draw [thick] (g.west.1) -- (g.east.1); 
		\draw [thick,-|] (g.west.2) -- ([xshift=0.4cm]g.west.2); 	
		\end {tikzpicture}]]></fr:resource-source></fr:resource>
</html:td>

  <html:td><fr:tex display="inline"><![CDATA[\begin {array}{l}\mathit {swap} : A \times  B \rightarrow  B \times  A \\ \mathit {swap} = \langle  \pi _1 , \pi _0 \rangle  \end {array}]]></fr:tex></html:td>

</html:tr>
</html:table>
</fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0026/</fr:uri><fr:display-uri>dt-0026</fr:display-uri><fr:route>/forest/dt-0026/</fr:route><fr:title text="Product of functions">Product of functions</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Given <fr:tex display="inline"><![CDATA[f : A \rightarrow  C]]></fr:tex> and <fr:tex display="inline"><![CDATA[g : B \rightarrow  D]]></fr:tex>, we overload the <fr:tex display="inline"><![CDATA[\times ]]></fr:tex> operator for <fr:link href="/forest/dm-0005/" title="Cartesian product" uri="https://liamoc.net/forest/dm-0005/" display-uri="dm-0005" type="local">products</fr:link> to denote the combined function <fr:tex display="inline"><![CDATA[f \times  g : A \times  B \rightarrow  C \times  D]]></fr:tex>, given below:</html:p>
  <html:table>
  <html:tr>
  <html:td>
			 <fr:resource hash="bb11f3cb5be2ec8fa99bcb6bf627d93c"><fr:resource-content><html:img src="/forest/bb11f3cb5be2ec8fa99bcb6bf627d93c.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {string-diagrams}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
			 \begin {tikzpicture}
			\node [box, box ports west = 2, box ports east = 2, minimum width=3cm, minimum height=3cm] (ZZ) at (-9cm,0) {};
			\node [box,thick, box ports west=1, box ports east=1] (ff) at ([xshift=-1.5cm]ZZ.east.1) {f};
			\node [box,thick, box ports west=1, box ports east=1] (gg) at ([xshift=-1.5cm]ZZ.east.2) {g};	
			
			\draw [thick] (ZZ.east.1) -- (ff.east.1);
			\draw [thick] (ZZ.east.2) -- (gg.east.1);
			\draw [thick] (ZZ.west.1) -- (ff.west.1);
			\draw [thick] (ZZ.west.2) -- (gg.west.1);
			\node [dot] at (ZZ.east.1) {};
			\node [dot] at (ZZ.east.2) {};
			\node [dot] at (ZZ.west.1) {};
			\node [dot] at (ZZ.west.2) {};
			\node  at (-6.3cm,0) {\Large  $=$};
		\end {tikzpicture} 
	]]></fr:resource-source></fr:resource></html:td>

  <html:td>
<fr:resource hash="58c0c3d35d58c46fbc1158208e93582d"><fr:resource-content><html:img src="/forest/58c0c3d35d58c46fbc1158208e93582d.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {string-diagrams}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
	\begin {tikzpicture}
		\node [box, box ports west = 1, box ports east = 2, minimum width=4cm, minimum height=3cm] (A) at (0.5cm,0) {};
		\node [dot] (ae) at ([yshift=-0.0cm]A.east.1) {};
		\node [dot] (ae2) at ([yshift=0.0cm]A.east.2) {};
		\node [dot] (aw) at ([yshift=0.15cm]A.west.1) {};
			\node [dot] (aw2) at ([yshift=-0.15cm]A.west.1) {};
		\node [dot] (X) at ([xshift=1cm,yshift=0.15cm]A.west.1) {};
		\node [dot] (Y) at ([xshift=0.7cm,yshift=-0.15cm]A.west.1) {};
		\node [box,thick, box ports west=2, box ports east=2] (f) at ([xshift=-2cm]A.east.1) {};
		\node [box,thick, box ports west=2, box ports east=2] (g) at ([xshift=-2cm]A.east.2) {};
		\node [box,thick, box ports west=2, box ports east=1] (fff) at ([xshift=-0.75cm]A.east.1) {f};
		\node [box,thick, box ports west=2, box ports east=1] (ggg) at ([xshift=-0.75cm]A.east.2) {g};	
		\wires [thick]{
			f = { west.1 = X.north, west.2 = Y.north,  east.1=fff.west.1},
			g = { west.1 = X.south, west.2 = Y.south, east.2=ggg.west.2},
			X = { west = aw.east },
			Y = { west = aw2.east },
			fff = { east = A.east.1 },
			ggg = { east = A.east.2 },		
		}{};
		\draw [thick] (f.west.1) -- (f.east.1); 
		\draw [thick,-|] (f.west.2) -- ([xshift=0.4cm]f.west.2); 
		\draw [thick] (g.west.2) -- (g.east.2); 
		\draw [thick,-|] (g.west.1) -- ([xshift=0.4cm]g.west.1);
		\end {tikzpicture}
	]]></fr:resource-source></fr:resource></html:td>

  <html:td>
<html:p><fr:tex display="block"><![CDATA[\begin {array}{l} f \times  g : A \times  B \rightarrow  C \times  D \\ f \times  g = \langle  f \circ  \pi _0 , g \circ  \pi _1 \rangle  \end {array}]]></fr:tex></html:p>
</html:td>
</html:tr>
</html:table>
</fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-002G/</fr:uri><fr:display-uri>dt-002G</fr:display-uri><fr:route>/forest/dt-002G/</fr:route><fr:taxon>Exercise</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Express the function <fr:tex display="inline"><![CDATA[\mathit {juggle} (a, (b,c)) = ((a,b),c)]]></fr:tex> using just our primitive combinators for <fr:link href="/forest/dt-0020/" title="Projection operators for products" uri="https://liamoc.net/forest/dt-0020/" display-uri="dt-0020" type="local">projection</fr:link> and <fr:link href="/forest/dt-0023/" title="The split function" uri="https://liamoc.net/forest/dt-0023/" display-uri="dt-0023" type="local">split</fr:link>.</html:p>



<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter><html:p><fr:tex display="block"><![CDATA[\mathit {juggle} \triangleq  \langle  \langle  \pi _0 , \pi _0 \circ  \pi _1 \rangle  , \pi _1 \circ  \pi _1 \rangle ]]></fr:tex></html:p></fr:mainmatter></fr:tree>
</fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0027/</fr:uri><fr:display-uri>dt-0027</fr:display-uri><fr:route>/forest/dt-0027/</fr:route><fr:title text="Pictorial Properties">Pictorial Properties</fr:title></fr:frontmatter><fr:mainmatter><html:p>The following properties of our <fr:link href="/forest/dt-0020/" title="Projection operators for products" uri="https://liamoc.net/forest/dt-0020/" display-uri="dt-0020" type="local">projection</fr:link> and <fr:link href="/forest/dt-0023/" title="The split function" uri="https://liamoc.net/forest/dt-0023/" display-uri="dt-0023" type="local">split</fr:link> functions follow from the pictorial reasoning we see on the right:</html:p>
  <html:table>

  <html:tr>
  <html:td>
	 <fr:tex display="block"><![CDATA[\pi _0 \circ  \langle  f , g \rangle  = f]]></fr:tex></html:td>

	 
  <html:td><fr:resource hash="f30ee9bf85668a24b80d76c380143014"><fr:resource-content><html:img src="/forest/f30ee9bf85668a24b80d76c380143014.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {string-diagrams}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
 \begin {tikzpicture}
	\node [box, box ports west = 1, box ports east = 1, minimum width=3cm, minimum height=3cm] (ZZ) at (6cm,8cm) {};
	\node [box, box ports west = 1, box ports east = 2, minimum width=4cm, minimum height=3cm] (A) at (0.5cm,8cm) {};
	\node [dot] (ae) at ([yshift=-0.25cm]A.east.1) {};
\node [dot] (aw) at ([yshift=0cm]A.west.1) {};
	\node [dot] (aw2) at ([yshift=-0cm]A.west.1) {};
	\node [dot] (X) at ([xshift=1cm]A.west.1) {};
	\node [box,thick, box ports west=1, box ports east=1] (fff) at ([xshift=-2cm]A.east.1) { f };
	\node [box,thick, box ports west=1, box ports east=1] (ggg) at ([xshift=-2cm]A.east.2) { g };
	\node [box,thick, box ports west=2, box ports east=2, minimum height=2cm] (f) at ([xshift=3.25cm]A.west.1) {};
\wires [thick]{
		fff = { west.1 = X.north,  east.1=f.west.1},
		ggg = { west.1 = X.south }, X = { west = aw.east, north = fff.west.1, south = ggg.west.1 },
		fff = { east.1 = f.west.1 },
		ggg = { east.1 = f.west.2 },
		f = { east.1 = ae.west },
}{};
	\draw [thick] (f.west.1) -- (f.east.1); 
	\draw [thick,-|] (f.west.2) -- ([xshift=0.4cm]f.west.2); 

	\node [box,thick, box ports west=1, box ports east=1] (ff) at ([xshift=-1.5cm]ZZ.east.1) {f};
	\node  at (3.35cm,8cm) {\Large  $=$};
	\draw [thick] (ZZ.east.1) -- (ff.east);
	\draw [thick] (ZZ.west.1) -- (ff.west.1);
	\node [dot] at (ZZ.east.1) {};
	\node [dot] at (ZZ.west.1) {};  
\end {tikzpicture} ]]></fr:resource-source></fr:resource></html:td>
</html:tr>


  <html:tr>
  <html:td>
	<fr:tex display="block"><![CDATA[\pi _1 \circ  \langle  f , g \rangle  = g]]></fr:tex></html:td>

	
  <html:td><fr:resource hash="c07c932988a2fdc1bdd5366a4a654482"><fr:resource-content><html:img src="/forest/c07c932988a2fdc1bdd5366a4a654482.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {string-diagrams}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
	\begin {tikzpicture}
	\node [box, box ports west = 1, box ports east = 1, minimum width=3cm, minimum height=3cm] (ZZ) at (6cm,4cm) {};
	\node [box, box ports west = 1, box ports east = 2, minimum width=4cm, minimum height=3cm] (A) at (0.5cm,4cm) {};
\node [dot] (ae2) at ([yshift=0.25cm]A.east.2) {};
	\node [dot] (aw) at ([yshift=0cm]A.west.1) {};
\node [dot] (X) at ([xshift=1cm]A.west.1) {};
	\node [box,thick, box ports west=1, box ports east=1] (fff) at ([xshift=-2cm]A.east.1) { f };
	\node [box,thick, box ports west=1, box ports east=1] (ggg) at ([xshift=-2cm]A.east.2) { g };
	\node [box,thick, box ports west=2, box ports east=2, minimum height=2cm] (f) at ([xshift=3.25cm]A.west.1) {};
\wires [thick]{
		fff = { west.1 = X.north,  east.1=f.west.1},
		ggg = { west.1 = X.south }, X = { west = aw.east, north = fff.west.1, south = ggg.west.1 },
		fff = { east.1 = f.west.1 },
		ggg = { east.1 = f.west.2 },
		f = { east.2 = ae2.west },
}{};
	\draw [thick] (f.west.2) -- (f.east.2); 
	\draw [thick,-|] (f.west.1) -- ([xshift=0.4cm]f.west.1); 

	\node [box,thick, box ports west=1, box ports east=1] (ff) at ([xshift=-1.5cm]ZZ.east.1) {g};
	\node  at (3.35cm,4cm) {\Large  $=$};
	\draw [thick] (ZZ.east.1) -- (ff.east);
	\draw [thick] (ZZ.west.1) -- (ff.west.1);
	\node [dot] at (ZZ.east.1) {};
	\node [dot] at (ZZ.west.1) {};
 \end {tikzpicture}]]></fr:resource-source></fr:resource></html:td>
</html:tr>

 
  <html:tr>
  <html:td>
	 <fr:tex display="block"><![CDATA[\langle  \pi _0 \circ  h , \pi _1 \circ  h \rangle  = h]]></fr:tex>
 </html:td>

  <html:td>
 <fr:resource hash="99c2653faaf5f8ae55e9cc9e2c64e4d7"><fr:resource-content><html:img src="/forest/99c2653faaf5f8ae55e9cc9e2c64e4d7.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {string-diagrams}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
 \begin {tikzpicture}
	 \node [box, box ports west = 1, box ports east = 1, minimum width=3cm, minimum height=3cm] (ZZ) at (6cm,0) {};
	 \node [box, box ports west = 1, box ports east = 2, minimum width=4cm, minimum height=3cm] (A) at (0.5cm,0) {};
	 \node [dot] (ae) at ([yshift=0.2cm]A.east.1) {};
	 \node [dot] (ae2) at ([yshift=-0.2cm]A.east.2) {};
	 \node [dot] (aw) at ([yshift=0cm]A.west.1) {};
	 \node [dot] (aw2) at ([yshift=-0cm]A.west.1) {};
	 \node [dot] (X) at ([xshift=1cm]A.west.1) {};
	 \node [box,thick, box ports west=1, box ports east=2] (fff) at ([xshift=-2cm]A.east.1) { h };
	 \node [box,thick, box ports west=1, box ports east=2] (ggg) at ([xshift=-2cm]A.east.2) { h };
	 \node [box,thick, box ports west=2, box ports east=2] (f) at ([xshift=-0.75cm]A.east.1) {};
	 \node [box,thick, box ports west=2, box ports east=2] (g) at ([xshift=-0.75cm]A.east.2) {};	
	 \wires [thick]{
		 fff = { west.1 = X.north,  east.1=f.west.1},
		 ggg = { west.1 = X.south, east.2=g.west.2},
		 X = { west = aw.east, north = fff.west.1, south = ggg.west.1 },
		 fff = { east.1 = f.west.1, east.2 = f.west.2 },
		 ggg = { east.1 = g.west.1, east.2 = g.west.2 },
		 f = { east.1 = ae.west },
		 g = { east.2 = ae2.west },		
	 }{};
	 \draw [thick] (f.west.1) -- (f.east.1); 
	 \draw [thick,-|] (f.west.2) -- ([xshift=0.4cm]f.west.2); 
	 \draw [thick] (g.west.2) -- (g.east.2); 
	 \draw [thick,-|] (g.west.1) -- ([xshift=0.4cm]g.west.1); 	
	 
	 \node [box,thick, box ports west=1, box ports east=2] (ff) at ([xshift=-1.5cm]ZZ.east.1) {h};
	 \node  at (3.35cm,0) {\Large  $=$};
	 \draw [thick] ([yshift=0.2cm]ZZ.east.1) -- (ff.east.1);
	 \draw [thick] ([yshift=-0.2cm]ZZ.east.1) -- (ff.east.2);
	 \draw [thick] (ZZ.west.1) -- (ff.west.1);
	 \node [dot] at ([yshift=0.2cm]ZZ.east.1) {};
	 \node [dot] at ([yshift=-0.2cm]ZZ.east.1) {};
	 \node [dot] at (ZZ.west.1) {};
	 \end {tikzpicture}
 ]]></fr:resource-source></fr:resource></html:td>
</html:tr>

</html:table>
</fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0028/</fr:uri><fr:display-uri>dt-0028</fr:display-uri><fr:route>/forest/dt-0028/</fr:route><fr:taxon>Exercise</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Prove that the three properties in <fr:link href="/forest/dt-0027/" title="Pictorial Properties" uri="https://liamoc.net/forest/dt-0027/" display-uri="dt-0027" type="local">§ <fr:contextual-number uri="https://liamoc.net/forest/dt-0027/" display-uri="dt-0027" /></fr:link> are equivalent to the <fr:link href="/forest/dt-0029/" title="Universal property for cpo products" uri="https://liamoc.net/forest/dt-0029/" display-uri="dt-0029" type="local">universal property for products</fr:link></html:p><fr:tex display="block"><![CDATA[(\pi _0 \circ  h = f \land  \pi _1 \circ  h = g)\ \text {iff}\ h = \langle  f , g \rangle ]]></fr:tex>



<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter><html:p> Showing in both directions:
	<html:ol><html:li><html:em>The three properties follow from the universal property:</html:em>
	The first two properties follow from the universal property where <fr:tex display="inline"><![CDATA[h]]></fr:tex> is  set to <fr:tex display="inline"><![CDATA[\langle  f , g \rangle ]]></fr:tex>. The third property follows from the universal property where <fr:tex display="inline"><![CDATA[f]]></fr:tex> is set to <fr:tex display="inline"><![CDATA[\pi _0\circ  h]]></fr:tex> and <fr:tex display="inline"><![CDATA[g]]></fr:tex> is set to <fr:tex display="inline"><![CDATA[\pi _1\circ  h]]></fr:tex>.</html:li>
<html:li><html:em>The universal property follows from the universal property:</html:em>
In the <fr:tex display="inline"><![CDATA[\Rightarrow ]]></fr:tex> direction of the universal property follows from the third property, and the <fr:tex display="inline"><![CDATA[\Leftarrow ]]></fr:tex> direction follows from the first two.
</html:li></html:ol></html:p></fr:mainmatter></fr:tree>
</fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0029/</fr:uri><fr:display-uri>dt-0029</fr:display-uri><fr:route>/forest/dt-0029/</fr:route><fr:title text="Universal property for cpo products">Universal property for <fr:link href="/forest/dt-0021/" title="Product of cpos" uri="https://liamoc.net/forest/dt-0021/" display-uri="dt-0021" type="local">cpo products</fr:link></fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><fr:tex display="block"><![CDATA[ (\pi _0 \circ  h = f \land  \pi _1 \circ  h = g)\ \text {iff}\ h = \langle  f , g \rangle ]]></fr:tex><html:p>As <fr:link href="/forest/dm-000L/" title="Commutative diagrams" uri="https://liamoc.net/forest/dm-000L/" display-uri="dm-000L" type="local">commuting diagram</fr:link> on the <fr:link href="/forest/dm-000G/" title="Category" uri="https://liamoc.net/forest/dm-000G/" display-uri="dm-000G" type="local">category</fr:link> <fr:tex display="inline"><![CDATA[\mathbf {Cpo}]]></fr:tex>:</html:p><html:figure><fr:resource hash="c9023f3d8a7c9136f9b78261eaae3884"><fr:resource-content><html:img src="/forest/c9023f3d8a7c9136f9b78261eaae3884.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz-cd}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
	\begin {tikzcd}[row sep=large]
		& A  \arrow [dl, "f",labels=above left]\arrow [dr,"g"]\arrow [d,"{\langle  f, g \rangle }", dashed, labels=description] & \\
	B & B \times  C \ar [l, "{\pi _0}",labels=below] \ar [r, "{\pi _1}",labels=below]& C 	
	\end {tikzcd}
	]]></fr:resource-source></fr:resource></html:figure></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-002A/</fr:uri><fr:display-uri>dt-002A</fr:display-uri><fr:route>/forest/dt-002A/</fr:route><fr:title text="Category theory">Category theory</fr:title><fr:taxon>Aside</fr:taxon></fr:frontmatter><fr:mainmatter><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dm-000G/</fr:uri><fr:display-uri>dm-000G</fr:display-uri><fr:route>/forest/dm-000G/</fr:route><fr:title text="Category">Category</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>A <html:em>category</html:em> <fr:tex display="inline"><![CDATA[C]]></fr:tex>consists of a collection of things (<html:em>objects</html:em>) and a collection of arrows between these things (<html:em>morphisms</html:em>). If there is a morphism <fr:tex display="inline"><![CDATA[A \xrightarrow {f} B]]></fr:tex> and a morphism <fr:tex display="inline"><![CDATA[B \xrightarrow {g} C]]></fr:tex>, we also have the composed morphism <fr:tex display="inline"><![CDATA[A \xrightarrow {g \circ  f} C]]></fr:tex>. This composition operator must be <fr:link href="/forest/dm-000F/" title="Associativity" uri="https://liamoc.net/forest/dm-000F/" display-uri="dm-000F" type="local">associative</fr:link>. Additionally each object <fr:tex display="inline"><![CDATA[X]]></fr:tex> has an <html:em>identity</html:em> morphism <fr:tex display="inline"><![CDATA[X \xrightarrow {\mathsf {id}_X} X]]></fr:tex>, such that for an arrow <fr:tex display="inline"><![CDATA[X \xrightarrow {a} Y]]></fr:tex>, <fr:tex display="inline"><![CDATA[a \circ  \mathsf {id}_X = \mathsf {id}_Y \circ  a = a]]></fr:tex>. </html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dm-000H/</fr:uri><fr:display-uri>dm-000H</fr:display-uri><fr:route>/forest/dm-000H/</fr:route><fr:title text="The category \mathbf {Set}">The <fr:link href="/forest/dm-000G/" title="Category" uri="https://liamoc.net/forest/dm-000G/" display-uri="dm-000G" type="local">category</fr:link> <fr:tex display="inline"><![CDATA[\mathbf {Set}]]></fr:tex></fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
	The <fr:link href="/forest/dm-000G/" title="Category" uri="https://liamoc.net/forest/dm-000G/" display-uri="dm-000G" type="local">category</fr:link> <fr:tex display="inline"><![CDATA[\mathbf {Set}]]></fr:tex> is the <fr:link href="/forest/dm-000G/" title="Category" uri="https://liamoc.net/forest/dm-000G/" display-uri="dm-000G" type="local">category</fr:link> where the objects are (small) <html:em>sets</html:em>, the morphisms are functions between these sets, composition is function composition (<fr:tex display="inline"><![CDATA[(g \circ  f)(x) \triangleq  g(f(x))]]></fr:tex>) and identity is just the identity function <fr:tex display="inline"><![CDATA[\lambda  x. x]]></fr:tex>.
</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dm-000I/</fr:uri><fr:display-uri>dm-000I</fr:display-uri><fr:route>/forest/dm-000I/</fr:route><fr:title text="The category \mathbf {Rel}">The <fr:link href="/forest/dm-000G/" title="Category" uri="https://liamoc.net/forest/dm-000G/" display-uri="dm-000G" type="local">category</fr:link> <fr:tex display="inline"><![CDATA[\mathbf {Rel}]]></fr:tex></fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
	The <fr:link href="/forest/dm-000G/" title="Category" uri="https://liamoc.net/forest/dm-000G/" display-uri="dm-000G" type="local">category</fr:link> <fr:tex display="inline"><![CDATA[\mathbf {Rel}]]></fr:tex> is the <fr:link href="/forest/dm-000G/" title="Category" uri="https://liamoc.net/forest/dm-000G/" display-uri="dm-000G" type="local">category</fr:link> where the objects are (small) <html:em>sets</html:em>, the morphisms are <html:em>relations</html:em> between these sets, composition is relational composition: <fr:tex display="block"><![CDATA[g \circ  f \triangleq  \{ (a,b) \mid  \exists  i.\ (a,i) \in  f \land  (i,b) \in  g \}]]></fr:tex> and identity is the diagonal relation (equality).
</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-002B/</fr:uri><fr:display-uri>dt-002B</fr:display-uri><fr:route>/forest/dt-002B/</fr:route><fr:title text="The category \mathbf {Cpo}">The <fr:link href="/forest/dm-000G/" title="Category" uri="https://liamoc.net/forest/dm-000G/" display-uri="dm-000G" type="local">category</fr:link> <fr:tex display="inline"><![CDATA[\mathbf {Cpo}]]></fr:tex></fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
	The <fr:link href="/forest/dm-000G/" title="Category" uri="https://liamoc.net/forest/dm-000G/" display-uri="dm-000G" type="local">category</fr:link> <fr:tex display="inline"><![CDATA[\mathbf {Cpo}]]></fr:tex> is the <fr:link href="/forest/dm-000G/" title="Category" uri="https://liamoc.net/forest/dm-000G/" display-uri="dm-000G" type="local">category</fr:link> where the objects are <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link>, the morphisms are <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous functions</fr:link> between these <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link>, composition is function composition (<fr:tex display="inline"><![CDATA[(g \circ  f)(x) \triangleq  g(f(x))]]></fr:tex>) and identity is just the identity function <fr:tex display="inline"><![CDATA[\lambda  x. x]]></fr:tex>.
</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dm-000J/</fr:uri><fr:display-uri>dm-000J</fr:display-uri><fr:route>/forest/dm-000J/</fr:route><fr:title text="Functor">Functor</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
A <html:em>functor</html:em> <fr:tex display="inline"><![CDATA[F]]></fr:tex> from a <fr:link href="/forest/dm-000G/" title="Category" uri="https://liamoc.net/forest/dm-000G/" display-uri="dm-000G" type="local">category</fr:link> <fr:tex display="inline"><![CDATA[\mathbf {C}]]></fr:tex> to a <fr:link href="/forest/dm-000G/" title="Category" uri="https://liamoc.net/forest/dm-000G/" display-uri="dm-000G" type="local">category</fr:link> <fr:tex display="inline"><![CDATA[\mathbf {D}]]></fr:tex> consists of an <html:em>object mapping</html:em> that maps objects of <fr:tex display="inline"><![CDATA[\mathbf {C}]]></fr:tex> to objects of <fr:tex display="inline"><![CDATA[\mathbf {D}]]></fr:tex>, and a <html:em>morphism mapping</html:em> that maps morphisms of <fr:tex display="inline"><![CDATA[\mathbf {C}]]></fr:tex> to morphisms of <fr:tex display="inline"><![CDATA[\mathbf {D}]]></fr:tex> such that:
<html:ul><html:li>For each <fr:tex display="inline"><![CDATA[A \xrightarrow {m} B]]></fr:tex> in <fr:tex display="inline"><![CDATA[\mathbf {C}]]></fr:tex>, we have a morphism <fr:tex display="inline"><![CDATA[F(A) \xrightarrow {F(m)} F(B)]]></fr:tex> in <fr:tex display="inline"><![CDATA[\mathbf {D}]]></fr:tex>.</html:li>
<html:li> For each object <fr:tex display="inline"><![CDATA[A]]></fr:tex> in <fr:tex display="inline"><![CDATA[\mathbf {C}]]></fr:tex>, the equation <fr:tex display="inline"><![CDATA[F(\mathsf {id}_A) = \mathsf {id}_{F(A)}]]></fr:tex> holds in <fr:tex display="inline"><![CDATA[\mathbf {D}]]></fr:tex>. </html:li>
<html:li> For a pair of morphism <fr:tex display="inline"><![CDATA[A \xrightarrow {f} B \xrightarrow {g} C]]></fr:tex> in <fr:tex display="inline"><![CDATA[\mathbf {C}]]></fr:tex>, the equation <fr:tex display="inline"><![CDATA[F (g \circ  f) = F(g) \circ  F(f)]]></fr:tex> holds in <fr:tex display="inline"><![CDATA[\mathbf {D}]]></fr:tex>. </html:li></html:ul></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dm-000K/</fr:uri><fr:display-uri>dm-000K</fr:display-uri><fr:route>/forest/dm-000K/</fr:route><fr:title text="The category \mathbf {Cat}">The <fr:link href="/forest/dm-000G/" title="Category" uri="https://liamoc.net/forest/dm-000G/" display-uri="dm-000G" type="local">category</fr:link> <fr:tex display="inline"><![CDATA[\mathbf {Cat}]]></fr:tex></fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
	The <fr:link href="/forest/dm-000G/" title="Category" uri="https://liamoc.net/forest/dm-000G/" display-uri="dm-000G" type="local">category</fr:link> <fr:tex display="inline"><![CDATA[\mathbf {Cat}]]></fr:tex> is the <fr:link href="/forest/dm-000G/" title="Category" uri="https://liamoc.net/forest/dm-000G/" display-uri="dm-000G" type="local">category</fr:link> where the objects are themselves (small) <fr:link href="/forest/dm-000G/" title="Category" uri="https://liamoc.net/forest/dm-000G/" display-uri="dm-000G" type="local">categories</fr:link>, the morphisms are structure-preserving maps between these categories, i.e., <fr:link href="/forest/dm-000J/" title="Functor" uri="https://liamoc.net/forest/dm-000J/" display-uri="dm-000J" type="local">functors</fr:link>.
</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dm-000L/</fr:uri><fr:display-uri>dm-000L</fr:display-uri><fr:route>/forest/dm-000L/</fr:route><fr:title text="Commutative diagrams">Commutative diagrams</fr:title></fr:frontmatter><fr:mainmatter><html:p>When working in a <fr:link href="/forest/dm-000G/" title="Category" uri="https://liamoc.net/forest/dm-000G/" display-uri="dm-000G" type="local">category</fr:link>, we can state many theorems compactly using <html:em>commutative diagrams</html:em>, such as this diagram for products:
<html:figure><fr:resource hash="c9023f3d8a7c9136f9b78261eaae3884"><fr:resource-content><html:img src="/forest/c9023f3d8a7c9136f9b78261eaae3884.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz-cd}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
	\begin {tikzcd}[row sep=large]
		& A  \arrow [dl, "f",labels=above left]\arrow [dr,"g"]\arrow [d,"{\langle  f, g \rangle }", dashed, labels=description] & \\
	B & B \times  C \ar [l, "{\pi _0}",labels=below] \ar [r, "{\pi _1}",labels=below]& C 	
	\end {tikzcd}
	]]></fr:resource-source></fr:resource></html:figure>
 In these diagrams, the objects are <html:em>vertices</html:em> in the diagram, and the morphisms are the <html:em>arrows</html:em> in the diagram (we typically omit identity morphisms and morphisms that are just compositions of other morphisms). Looking at the above diagram, we can equate the two paths from <fr:tex display="inline"><![CDATA[A]]></fr:tex> to <fr:tex display="inline"><![CDATA[B]]></fr:tex> and the two paths from <fr:tex display="inline"><![CDATA[A]]></fr:tex> to <fr:tex display="inline"><![CDATA[C]]></fr:tex>, and produce the equations <fr:tex display="inline"><![CDATA[\pi _0 \circ  \langle  f, g \rangle  = f]]></fr:tex> and <fr:tex display="inline"><![CDATA[\pi _1 \circ  \langle  f, g \rangle  = g]]></fr:tex>. We adopt the convention that dotted lines indicate uniqueness, meaning that, from the diagram above, we can also infer the law: <fr:tex display="block"><![CDATA[\pi _0 \circ  h = f \land  \pi _1 \circ  h = g \implies   h = \langle  f , g \rangle ]]></fr:tex></html:p></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-002C/</fr:uri><fr:display-uri>dt-002C</fr:display-uri><fr:route>/forest/dt-002C/</fr:route><fr:title text="Derived properties of cpo products">Derived properties of <fr:link href="/forest/dt-0021/" title="Product of cpos" uri="https://liamoc.net/forest/dt-0021/" display-uri="dt-0021" type="local">cpo products</fr:link></fr:title><fr:taxon>Corollary</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
 The <fr:link href="/forest/dt-0029/" title="Universal property for cpo products" uri="https://liamoc.net/forest/dt-0029/" display-uri="dt-0029" type="local">universal property</fr:link> is called such because <html:em>all</html:em> the familiar properties of <fr:link href="/forest/dt-0021/" title="Product of cpos" uri="https://liamoc.net/forest/dt-0021/" display-uri="dt-0021" type="local">products</fr:link> follow from it – thinking in pictures helps to see how (Indeed, the  <fr:link href="/forest/dt-0029/" title="Universal property for cpo products" uri="https://liamoc.net/forest/dt-0029/" display-uri="dt-0029" type="local">universal property</fr:link> <html:em>characterises</html:em> products up to isomorphism):</html:p><html:ol><html:li><fr:tex display="inline"><![CDATA[\pi _0 \circ  (f \times  g) = f \circ  \pi _0]]></fr:tex></html:li>
<html:li><fr:tex display="inline"><![CDATA[\pi _1 \circ  (f \times  g) = g \circ  \pi _1]]></fr:tex></html:li>
<html:li><fr:tex display="inline"><![CDATA[(f \times  g) \circ  \langle  h , i \rangle  = \langle  f \circ  h, g \circ  i \rangle ]]></fr:tex></html:li>
<html:li><fr:tex display="inline"><![CDATA[\langle  f , g \rangle  \circ  h = \langle  f \circ  h, g \circ  h \rangle ]]></fr:tex></html:li>
<html:li><fr:tex display="inline"><![CDATA[\mathsf {id}_A \times  \mathsf {id}_B = \mathsf {id}_{A \times  B} \quad  (*)]]></fr:tex></html:li>
<html:li><fr:tex display="inline"><![CDATA[(f \circ  g) \times  (h \circ  i) = (f \times  h) \circ  (g \times  i) \quad  (**)]]></fr:tex></html:li></html:ol><html:p>
These last two statements <fr:tex display="inline"><![CDATA[(*)]]></fr:tex> and <fr:tex display="inline"><![CDATA[(**)]]></fr:tex> show that <fr:tex display="inline"><![CDATA[\times ]]></fr:tex> is a <fr:link href="/forest/dm-000M/" title="Bifunctor" uri="https://liamoc.net/forest/dm-000M/" display-uri="dm-000M" type="local">bifunctor</fr:link> on the <fr:link href="/forest/dt-002B/" title="The category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-002B/" display-uri="dt-002B" type="local">category <fr:tex display="inline"><![CDATA[\textbf {Cpo}]]></fr:tex></fr:link>, i.e., a <fr:link href="/forest/dm-000J/" title="Functor" uri="https://liamoc.net/forest/dm-000J/" display-uri="dm-000J" type="local">functor</fr:link> <fr:tex display="inline"><![CDATA[\textbf {Cpo} \times  \textbf {Cpo} \rightarrow  \textbf {Cpo}]]></fr:tex>.
</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-002I/</fr:uri><fr:display-uri>dt-002I</fr:display-uri><fr:route>/forest/dt-002I/</fr:route><fr:taxon>Exercise</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Show using the <fr:link href="/forest/dt-0029/" title="Universal property for cpo products" uri="https://liamoc.net/forest/dt-0029/" display-uri="dt-0029" type="local">universal property</fr:link> that <fr:tex display="inline"><![CDATA[\langle  f, g \rangle  \circ  h = \langle  f \circ  h , g \circ  h \rangle ]]></fr:tex></html:p>



<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>
	Instantiating the <fr:link href="/forest/dt-0029/" title="Universal property for cpo products" uri="https://liamoc.net/forest/dt-0029/" display-uri="dt-0029" type="local">universal property</fr:link> where <fr:tex display="inline"><![CDATA[h := \langle  f, g \rangle  \circ  h]]></fr:tex>, <fr:tex display="inline"><![CDATA[f := f \circ  h]]></fr:tex>, and <fr:tex display="inline"><![CDATA[g := g \circ  h]]></fr:tex>:
	<fr:tex display="block"><![CDATA[\pi _0 \circ  \langle  f, g \rangle  \circ  h = f \circ  h \land 
	\pi _1 \circ  \langle  f, g \rangle  \circ  h = g \circ  h\ \text {iff}\ \langle  f, g \rangle  \circ  h = \langle  f \circ  h , g \circ  h \rangle ]]></fr:tex>
	Simplifying using the pictorial properties in <fr:link href="/forest/dt-0027/" title="Pictorial Properties" uri="https://liamoc.net/forest/dt-0027/" display-uri="dt-0027" type="local">§ <fr:contextual-number uri="https://liamoc.net/forest/dt-0027/" display-uri="dt-0027" /></fr:link> (shown equivalent to the <fr:link href="/forest/dt-0029/" title="Universal property for cpo products" uri="https://liamoc.net/forest/dt-0029/" display-uri="dt-0029" type="local">universal property</fr:link> in <fr:link href="/forest/dt-0028/" title="https://liamoc.net/forest/dt-0028/" uri="https://liamoc.net/forest/dt-0028/" display-uri="dt-0028" type="local">Exercise <fr:contextual-number uri="https://liamoc.net/forest/dt-0028/" display-uri="dt-0028" /></fr:link>):
	<fr:tex display="block"><![CDATA[f \circ  h = f \circ  h \land 
	g \circ  h = g \circ  h\ \text {iff}\ \langle  f, g \rangle  \circ  h = \langle  f \circ  h , g \circ  h \rangle ]]></fr:tex>
	By logical simplifications, we arrive at
	<fr:tex display="block"><![CDATA[\langle  f, g \rangle  \circ  h = \langle  f \circ  h , g \circ  h \rangle ]]></fr:tex>
	as required.
</fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-002D/</fr:uri><fr:display-uri>dt-002D</fr:display-uri><fr:route>/forest/dt-002D/</fr:route><fr:title text="Isomorphisms for cpo products">Isomorphisms for <fr:link href="/forest/dt-0021/" title="Product of cpos" uri="https://liamoc.net/forest/dt-0021/" display-uri="dt-0021" type="local">cpo products</fr:link></fr:title></fr:frontmatter><fr:mainmatter><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-002E/</fr:uri><fr:display-uri>dt-002E</fr:display-uri><fr:route>/forest/dt-002E/</fr:route><fr:title text="Cpo isomorphism"><fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">Cpo</fr:link> isomorphism</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>An <html:em>isomorphism</html:em> between two <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> <fr:tex display="inline"><![CDATA[A]]></fr:tex> and <fr:tex display="inline"><![CDATA[B]]></fr:tex> is a <fr:link href="/forest/dm-000A/" title="Set bijection" uri="https://liamoc.net/forest/dm-000A/" display-uri="dm-000A" type="local">bijection</fr:link> <fr:tex display="inline"><![CDATA[f]]></fr:tex> between <fr:tex display="inline"><![CDATA[A]]></fr:tex> and <fr:tex display="inline"><![CDATA[B]]></fr:tex> such that <fr:tex display="inline"><![CDATA[f]]></fr:tex> preserves the <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> structure, i.e., that <fr:tex display="inline"><![CDATA[f]]></fr:tex> and <fr:tex display="inline"><![CDATA[f^{-1}]]></fr:tex> are <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link>.
</html:p><html:p>We say two <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> <fr:tex display="inline"><![CDATA[A]]></fr:tex> and <fr:tex display="inline"><![CDATA[B]]></fr:tex> are <html:em>isomorphic</html:em>, written <fr:tex display="inline"><![CDATA[A \simeq  B]]></fr:tex>, iff an <html:em>isomorphism</html:em> exists between them.</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-002H/</fr:uri><fr:display-uri>dt-002H</fr:display-uri><fr:route>/forest/dt-002H/</fr:route><fr:title text="Commutative monoid structure for cpos">Commutative monoid structure for <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link></fr:title><fr:taxon>Theorem</fr:taxon></fr:frontmatter><fr:mainmatter><html:p><fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">Cpos</fr:link> form a <fr:link href="/forest/dm-000P/" title="Commutative monoid" uri="https://liamoc.net/forest/dm-000P/" display-uri="dm-000P" type="local">commutative monoid</fr:link> "up to <fr:link href="/forest/dt-002E/" title="Cpo isomorphism" uri="https://liamoc.net/forest/dt-002E/" display-uri="dt-002E" type="local">isomorphism</fr:link>" under <fr:tex display="inline"><![CDATA[\times ]]></fr:tex> and <fr:tex display="inline"><![CDATA[\mathbf {1}]]></fr:tex> (the <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> consisting of only one element <fr:tex display="inline"><![CDATA[\bot ]]></fr:tex>). That is, for all <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> <fr:tex display="inline"><![CDATA[A, B]]></fr:tex> and <fr:tex display="inline"><![CDATA[C]]></fr:tex>:
<html:ol><html:li><fr:tex display="inline"><![CDATA[A \times  \mathbf {1} \simeq  A]]></fr:tex></html:li>
<html:li><fr:tex display="inline"><![CDATA[A \times  (B \times  C) \simeq  (A \times  B) \times  C]]></fr:tex></html:li>
<html:li><fr:tex display="inline"><![CDATA[A \times  B \simeq  B \times  A]]></fr:tex></html:li></html:ol>



<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Proof</fr:taxon></fr:frontmatter><fr:mainmatter>
<html:p>The <fr:link href="/forest/dt-002E/" title="Cpo isomorphism" uri="https://liamoc.net/forest/dt-002E/" display-uri="dt-002E" type="local">isomorphisms</fr:link> required are the <fr:link href="/forest/dt-0020/" title="Projection operators for products" uri="https://liamoc.net/forest/dt-0020/" display-uri="dt-0020" type="local">projection</fr:link> <fr:tex display="inline"><![CDATA[\pi _0]]></fr:tex>, the <fr:tex display="inline"><![CDATA[\mathit {juggle}]]></fr:tex> function from <fr:link href="/forest/dt-002G/" title="https://liamoc.net/forest/dt-002G/" uri="https://liamoc.net/forest/dt-002G/" display-uri="dt-002G" type="local">Exercise <fr:contextual-number uri="https://liamoc.net/forest/dt-002G/" display-uri="dt-002G" /></fr:link>, and <fr:link href="/forest/dt-0025/" title="The \mathit {swap} function" uri="https://liamoc.net/forest/dt-0025/" display-uri="dt-0025" type="local">the swap function</fr:link>.</html:p>
</fr:mainmatter></fr:tree></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-002F/</fr:uri><fr:display-uri>dt-002F</fr:display-uri><fr:route>/forest/dt-002F/</fr:route><fr:title text="The set of continuous functions">The set of continuous functions</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
Let <fr:tex display="inline"><![CDATA[A \twoheadrightarrow  B]]></fr:tex> denote just the <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous functions</fr:link> from <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> <fr:tex display="inline"><![CDATA[A]]></fr:tex> to <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> <fr:tex display="inline"><![CDATA[B]]></fr:tex>:
<fr:tex display="block"><![CDATA[A \twoheadrightarrow  B\; \triangleq \; \{ f : A \rightarrow  B \mid  f\ \text {is continuous} \}]]></fr:tex></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-002J/</fr:uri><fr:display-uri>dt-002J</fr:display-uri><fr:route>/forest/dt-002J/</fr:route><fr:taxon>Theorem</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>There is an <fr:link href="/forest/dt-002E/" title="Cpo isomorphism" uri="https://liamoc.net/forest/dt-002E/" display-uri="dt-002E" type="local">isomorphism</fr:link> between <fr:link href="/forest/dt-0021/" title="Product of cpos" uri="https://liamoc.net/forest/dt-0021/" display-uri="dt-0021" type="local">pairs</fr:link> of <fr:link href="/forest/dt-002F/" title="The set of continuous functions" uri="https://liamoc.net/forest/dt-002F/" display-uri="dt-002F" type="local">continuous functions</fr:link> and continuous functions that output pairs: <fr:tex display="block"><![CDATA[(A \twoheadrightarrow  B) \times  (A \twoheadrightarrow  C)\; \simeq \; (A \twoheadrightarrow  (B \times  C))]]></fr:tex>



<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Proof</fr:taxon></fr:frontmatter><fr:mainmatter>
Proof follows from the <fr:link href="/forest/dt-0029/" title="Universal property for cpo products" uri="https://liamoc.net/forest/dt-0029/" display-uri="dt-0029" type="local">universal property</fr:link> after setting up the <fr:link href="/forest/dt-002E/" title="Cpo isomorphism" uri="https://liamoc.net/forest/dt-002E/" display-uri="dt-002E" type="local">isomorphism</fr:link> with functions <fr:tex display="inline"><![CDATA[f(g_0,g_1) = \langle  g_0 , g_1 \rangle ]]></fr:tex> and <fr:tex display="inline"><![CDATA[f^{-1}(h) = (\pi _0 \circ  h, \pi _1 \circ  h)]]></fr:tex>.</fr:mainmatter></fr:tree></html:p></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree>


<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Upshot</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
	Because we have the <fr:link href="/forest/dm-000J/" title="Functor" uri="https://liamoc.net/forest/dm-000J/" display-uri="dm-000J" type="local">functor</fr:link> <fr:tex display="inline"><![CDATA[\times ]]></fr:tex> on <fr:tex display="inline"><![CDATA[\textbf {Cpo}]]></fr:tex> that satisfies the properties of products described above, the <fr:link href="/forest/dt-002B/" title="The category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-002B/" display-uri="dt-002B" type="local">category <fr:tex display="inline"><![CDATA[\textbf {Cpo}]]></fr:tex></fr:link> therefore has <html:em>binary products</html:em>.</html:p></fr:mainmatter></fr:tree>
</fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-002Z/</fr:uri><fr:display-uri>dt-002Z</fr:display-uri><fr:route>/forest/dt-002Z/</fr:route><fr:title text="Functions">Functions</fr:title></fr:frontmatter><fr:mainmatter><html:p>Previously, such as in <fr:link href="/forest/dt-001U/" title="Semantics of recursive functions" uri="https://liamoc.net/forest/dt-001U/" display-uri="dt-001U" type="local">Example <fr:contextual-number uri="https://liamoc.net/forest/dt-001U/" display-uri="dt-001U" /></fr:link>, we already implicitly assumed that the set of <fr:link href="/forest/dt-002F/" title="The set of continuous functions" uri="https://liamoc.net/forest/dt-002F/" display-uri="dt-002F" type="local">continuous functions</fr:link> on <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> <fr:tex display="inline"><![CDATA[A \twoheadrightarrow  B]]></fr:tex> is itself a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link>. In this section, we will formalise this construction.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-002L/</fr:uri><fr:display-uri>dt-002L</fr:display-uri><fr:route>/forest/dt-002L/</fr:route><fr:title text="The cpo of functions">The cpo of functions</fr:title><fr:taxon>Construction</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>If <fr:tex display="inline"><![CDATA[A]]></fr:tex> and <fr:tex display="inline"><![CDATA[B]]></fr:tex> are <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link>, the set of <fr:link href="/forest/dt-002F/" title="The set of continuous functions" uri="https://liamoc.net/forest/dt-002F/" display-uri="dt-002F" type="local">continuous functions</fr:link> <fr:tex display="inline"><![CDATA[A \twoheadrightarrow  B]]></fr:tex> is a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> under the <html:em>pointwise</html:em> ordering:
<fr:tex display="block"><![CDATA[
f \sqsubseteq  g\;\; \text {iff}\;\; \forall  a \in  A.\ f(a) \sqsubseteq  g(a)
]]></fr:tex>
The intuition of this ordering in terms of information is that we increase the information content of a function overall by increasing the information content of any (or many) argument values. To prove this, we must show:
<html:ol><html:li><html:em><fr:tex display="inline"><![CDATA[A \twoheadrightarrow  B]]></fr:tex> has a <fr:link href="/forest/dt-000A/" title="The bottom value" uri="https://liamoc.net/forest/dt-000A/" display-uri="dt-000A" type="local">least element</fr:link>.</html:em> <fr:tex display="inline"><![CDATA[\bot _{A \twoheadrightarrow  B}]]></fr:tex> is the constant function that returns <fr:tex display="inline"><![CDATA[\bot _B]]></fr:tex>, i.e. <fr:tex display="inline"><![CDATA[\lambda  a.\ \bot _B]]></fr:tex>.</html:li>
	<html:li><html:em><fr:tex display="inline"><![CDATA[\bigsqcup  X]]></fr:tex> exists for all <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link> <fr:tex display="inline"><![CDATA[X \subseteq  A \twoheadrightarrow  B]]></fr:tex></html:em>. Our <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link> of a set of continuous functions <fr:tex display="inline"><![CDATA[\bigsqcup  X]]></fr:tex> is the function <fr:tex display="inline"><![CDATA[\Phi ]]></fr:tex> where: <fr:tex display="block"><![CDATA[\Phi (a) = \bigsqcup  \{ f(a) \mid  f \in  X\}]]></fr:tex>
	We must show a number of properties of this <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link> <fr:tex display="inline"><![CDATA[\Phi ]]></fr:tex>. Specifically:
	<html:ol><html:li><html:em><fr:tex display="inline"><![CDATA[\bigsqcup  \{ f(a) \mid  f \in  X\}]]></fr:tex> exists in <fr:tex display="inline"><![CDATA[B]]></fr:tex></html:em>. 


<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Proof</fr:taxon></fr:frontmatter><fr:mainmatter>We want to show that the set <fr:tex display="inline"><![CDATA[\{ f(a) \mid  f \in  X\}]]></fr:tex> is <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link>. Take two values <fr:tex display="inline"><![CDATA[g(a), h(a)  \in  \{ f(a) \mid  f \in  X\}]]></fr:tex>. Since <fr:tex display="inline"><![CDATA[X]]></fr:tex> is <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link>, there exists a function <fr:tex display="inline"><![CDATA[k \in  X]]></fr:tex> such that <fr:tex display="inline"><![CDATA[g \sqsubseteq  k]]></fr:tex> and <fr:tex display="inline"><![CDATA[h \sqsubseteq  k]]></fr:tex>. By applying the definition of <fr:tex display="inline"><![CDATA[\sqsubseteq ]]></fr:tex> for functions above, we have <fr:tex display="inline"><![CDATA[g(a) \sqsubseteq  k(a)]]></fr:tex> and <fr:tex display="inline"><![CDATA[h(a) \sqsubseteq  k(a)]]></fr:tex>. Thus <fr:tex display="inline"><![CDATA[k(a)]]></fr:tex> is an <fr:link href="/forest/dm-000C/" title="Upper bound" uri="https://liamoc.net/forest/dm-000C/" display-uri="dm-000C" type="local">upper bound</fr:link> of these two values <fr:tex display="inline"><![CDATA[g(a), h(a)]]></fr:tex>, and thus <fr:tex display="inline"><![CDATA[\{ f(a) \mid  f \in  X\}]]></fr:tex> is <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link>, and thus its <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link> exists since <fr:tex display="inline"><![CDATA[B]]></fr:tex> is a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link>.</fr:mainmatter></fr:tree></html:li>
	<html:li><html:em><fr:tex display="inline"><![CDATA[ \Phi (a) = \bigsqcup  \{ f(a) \mid  f \in  X \} ]]></fr:tex> is continuous</html:em>. 


<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Proof</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Using the <fr:link href="/forest/dt-001O/" title="Alternative characterisation of continuity" uri="https://liamoc.net/forest/dt-001O/" display-uri="dt-001O" type="local">alternative characterisation of continuity</fr:link></html:p>
<fr:tex display="block"><![CDATA[
\begin {array}{lclr}
	\Phi (\bigsqcup  Y) &=& \bigsqcup \{ f(\bigsqcup  Y) \mid  f \in  X \} & \text {(defn. $\Phi $)}\\
	& = & \bigsqcup  \{\bigsqcup  \{ f(y) \mid  y \in  Y \} \mid  f \in  X \} & \text {($f$ is continuous)}\\
	& = & \bigsqcup  \{\bigsqcup  \{ f(y) \mid  f \in  X \} \mid  y \in  Y \} & \text {(swap lubs)}\\
	& = & \bigsqcup  \{ \Phi (y) \mid  y \in  Y \} & \text {(defn. $\Phi $)}\\	
\end {array}
]]></fr:tex>
Monotonicity is similar to prove.</fr:mainmatter></fr:tree></html:li>
<html:li><html:em><fr:tex display="inline"><![CDATA[\Phi ]]></fr:tex> is an <fr:link href="/forest/dm-000C/" title="Upper bound" uri="https://liamoc.net/forest/dm-000C/" display-uri="dm-000C" type="local">upper bound</fr:link> for <fr:tex display="inline"><![CDATA[X \subseteq  A \twoheadrightarrow  B]]></fr:tex></html:em>. 


<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Proof</fr:taxon></fr:frontmatter><fr:mainmatter>
 Let <fr:tex display="inline"><![CDATA[g \in  X]]></fr:tex>. Then for any <fr:tex display="inline"><![CDATA[a \in  A]]></fr:tex> we have <fr:tex display="inline"><![CDATA[g(a) \in  \{ f(a) \mid  f \in  X\}]]></fr:tex>. Now, by 2a and lubs, we have <fr:tex display="inline"><![CDATA[g(a) \sqsubseteq  \bigsqcup  \{ f(a) \mid  f \in  X \}]]></fr:tex>, which by the definition of <fr:tex display="inline"><![CDATA[\Phi ]]></fr:tex> gives <fr:tex display="inline"><![CDATA[g(a) \sqsubseteq  \Phi (a)]]></fr:tex>. Hence, by the definition of <fr:tex display="inline"><![CDATA[\sqsubseteq ]]></fr:tex> on functions, we can conclude <fr:tex display="inline"><![CDATA[g \sqsubseteq  \Phi ]]></fr:tex>.</fr:mainmatter></fr:tree></html:li>
	<html:li><html:em><fr:tex display="inline"><![CDATA[\Phi ]]></fr:tex> is the <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">least upper bound</fr:link> for <fr:tex display="inline"><![CDATA[X]]></fr:tex></html:em>. 


<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Proof</fr:taxon></fr:frontmatter><fr:mainmatter> Let <fr:tex display="inline"><![CDATA[g \in  A \twoheadrightarrow  B]]></fr:tex> be an <fr:link href="/forest/dm-000C/" title="Upper bound" uri="https://liamoc.net/forest/dm-000C/" display-uri="dm-000C" type="local">upper bound</fr:link> for <fr:tex display="inline"><![CDATA[X \subseteq  A \twoheadrightarrow  B]]></fr:tex>. Then (using <fr:tex display="inline"><![CDATA[\sqsubseteq ]]></fr:tex> on functions) <fr:tex display="inline"><![CDATA[g(a)]]></fr:tex> is an <fr:link href="/forest/dm-000C/" title="Upper bound" uri="https://liamoc.net/forest/dm-000C/" display-uri="dm-000C" type="local">upper bound</fr:link> for <fr:tex display="inline"><![CDATA[\{f(a) \mid  f \in  X\}]]></fr:tex> for all <fr:tex display="inline"><![CDATA[a \in  A]]></fr:tex>. Now, by 2a and lubs, we have <fr:tex display="inline"><![CDATA[\bigsqcup \{f(a) \mid  f \in  X\} \sqsubseteq  g(a)]]></fr:tex>, i.e. <fr:tex display="inline"><![CDATA[\Phi (a) \sqsubseteq  g(a)]]></fr:tex>, which, by the definition of <fr:tex display="inline"><![CDATA[\sqsubseteq ]]></fr:tex> on functions, allows us to conclude <fr:tex display="inline"><![CDATA[\Phi  \sqsubseteq  g]]></fr:tex>.</fr:mainmatter></fr:tree></html:li></html:ol></html:li></html:ol></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-002M/</fr:uri><fr:display-uri>dt-002M</fr:display-uri><fr:route>/forest/dt-002M/</fr:route><fr:title text="The space \mathbb {B}_\bot  \twoheadrightarrow  \mathbb {B}_\bot ">The space <fr:tex display="inline"><![CDATA[\mathbb {B}_\bot  \twoheadrightarrow  \mathbb {B}_\bot ]]></fr:tex></fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter><html:p><fr:resource hash="b00efde88505fe988df0bceb2371d56c"><fr:resource-content><html:img src="/forest/b00efde88505fe988df0bceb2371d56c.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz-cd}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[	
	\begin {tikzcd}[column sep=1em]
	{\begin {tikzpicture}
			\draw [rounded corners, thick, fill=white] (-0.8,-0.7) rectangle (0.8,1.39);	
			\node  (tr) at (0.5,0.5) {$\bullet $};
			\node  (tl) at (-0.5,0.5) {$\bullet $};
			\node  (b) at (0,-0.5) {$\bullet $};
			\draw [thick] (b) -- (tr) (b) -- (tl);
			\draw [thick,draw=blue,->] (b) edge[bend right] (tl)
								   (tl) edge[loop above] (tl)
								   (tr) edge[bend right=1.3em] (tl);
		 \end {tikzpicture}
		}
		&&
		&&
		&&
		{\begin {tikzpicture}
			\draw [rounded corners, thick, fill=white] (-0.8,-0.7) rectangle (0.8,1.39);	
			\node  (tr) at (0.5,0.5) {$\bullet $};
			\node  (tl) at (-0.5,0.5) {$\bullet $};
			\node  (b) at (0,-0.5) {$\bullet $};
			\draw [thick] (b) -- (tr) (b) -- (tl);
			\draw [thick,draw=blue,->] (b) edge[bend right] (tr)
								   (tl) edge[bend left=1.3em] (tr)
								   (tr) edge[loop above] (tr);
		 \end {tikzpicture}
		}
	\\		
	{\begin {tikzpicture}
			\draw [rounded corners, thick, fill=white] (-0.8,-1.2) rectangle (0.8,0.9);	
			\node  (tr) at (0.5,0.5) {$\bullet $};
			\node  (tl) at (-0.5,0.5) {$\bullet $};
			\node  (b) at (0,-0.5) {$\bullet $};
			\draw [thick] (b) -- (tr) (b) -- (tl);
			\draw [thick,draw=blue,->] (b) edge[loop below] (b)
								   (tl) edge[loop below] (tl)
								   (tr) edge[bend right=1.3em] (tl);
		 \end {tikzpicture}
		}\ar [u,ultra thick,-]
		&&
		{\begin {tikzpicture}
			\draw [rounded corners, thick, fill=white] (-0.8,-1.2) rectangle (0.8,0.9);
			\node  (tr) at (0.5,0.5) {$\bullet $};
			\node  (tl) at (-0.5,0.5) {$\bullet $};
			\node  (b) at (0,-0.5) {$\bullet $};
			\draw [thick] (b) -- (tr) (b) -- (tl);
			\draw [thick,draw=blue] (b) edge[loop below,->] (b)
								   (tl) edge[loop below,->] (tl)
								   (tr) edge[loop below] (tr);
		 \end {tikzpicture}
		}
		&&
		{\begin {tikzpicture}
			\draw [rounded corners, thick, fill=white] (-0.8,-1.2) rectangle (0.8,0.9);
			\node  (tr) at (0.5,0.5) {$\bullet $};
			\node  (tl) at (-0.5,0.5) {$\bullet $};
			\node  (b) at (0,-0.5) {$\bullet $};
			\draw [thick] (b) -- (tr) (b) -- (tl);
			\draw [thick,draw=blue,->] (b) edge[loop below] (b)
								   (tr) edge[bend left=1.3em] (tl)
								   (tl) edge[bend left=1.3em] (tr);
		 \end {tikzpicture}
		}
		&&
		{\begin {tikzpicture}
			\draw [rounded corners, thick, fill=white] (-0.8,-1.2) rectangle (0.8,0.9);
			\node  (tr) at (0.5,0.5) {$\bullet $};
			\node  (tl) at (-0.5,0.5) {$\bullet $};
			\node  (b) at (0,-0.5) {$\bullet $};
			\draw [thick] (b) -- (tr) (b) -- (tl);
			\draw [thick,draw=blue,->] (b) edge[loop below] (b)
								   (tl) edge[bend left=1.3em] (tr)
								   (tr) edge[loop below] (tr);
		 \end {tikzpicture}
		}\ar [u,ultra thick,-]
	\\	
	{\begin {tikzpicture}
			\draw [rounded corners, thick, fill=white] (-0.8,-1.2) rectangle (0.8,0.9);	
			\node  (tr) at (0.5,0.5) {$\bullet $};
			\node  (tl) at (-0.5,0.5) {$\bullet $};
			\node  (b) at (0,-0.5) {$\bullet $};
			\draw [thick] (b) -- (tr) (b) -- (tl);
			\draw [thick,draw=blue,->] (b) edge[loop below] (b)
								   (tl) edge[loop right] (tl)
								   (tr) edge[bend left] (b);
		 \end {tikzpicture}
		}\ar [u,ultra thick,-]\ar [urr,ultra thick,-]
		&&
		{\begin {tikzpicture}
			\draw [rounded corners, thick, fill=white] (-0.8,-1.2) rectangle (0.8,0.9);
			\node  (tr) at (0.5,0.5) {$\bullet $};
			\node  (tl) at (-0.5,0.5) {$\bullet $};
			\node  (b) at (0,-0.5) {$\bullet $};
			\draw [thick] (b) -- (tr) (b) -- (tl);
			\draw [thick,draw=blue,->] (b) edge[loop below] (b)
								   (tl) edge[bend right] (b)
								   (tr) edge[bend right=1.3em] (tl);
		 \end {tikzpicture}
		}\ar [ull,ultra thick,-]\ar [urr,ultra thick,-]
		&&
		{\begin {tikzpicture}
			\draw [rounded corners, thick, fill=white] (-0.8,-1.2) rectangle (0.8,0.9);
			\node  (tr) at (0.5,0.5) {$\bullet $};
			\node  (tl) at (-0.5,0.5) {$\bullet $};
			\node  (b) at (0,-0.5) {$\bullet $};
			\draw [thick] (b) -- (tr) (b) -- (tl);
			\draw [thick,draw=blue,->] (b) edge[loop below] (b)
								   (tr) edge[bend left] (b)
								   (tl) edge[bend left=1.3em] (tr);
		 \end {tikzpicture}
		}\ar [u,ultra thick,-]\ar [urr,ultra thick,-]
		&&
		{\begin {tikzpicture}
			\draw [rounded corners, thick, fill=white] (-0.8,-1.2) rectangle (0.8,0.9);
			\node  (tr) at (0.5,0.5) {$\bullet $};
			\node  (tl) at (-0.5,0.5) {$\bullet $};
			\node  (b) at (0,-0.5) {$\bullet $};
			\draw [thick] (b) -- (tr) (b) -- (tl);
			\draw [thick,draw=blue,->] (b) edge[loop below] (b)
								   (tl) edge[bend right] (b)
								   (tr) edge[loop left] (tr);
		 \end {tikzpicture}
		}\ar [u,ultra thick,-]\ar [ullll,ultra thick,-]
	\\
		&\qquad  &&{\begin {tikzpicture}
			\draw [rounded corners, thick, fill=white] (-0.8,-1.2) rectangle (0.8,0.9);
			\node  (tr) at (0.5,0.5) {$\bullet $};
			\node  (tl) at (-0.5,0.5) {$\bullet $};
			\node  (b) at (0,-0.5) {$\bullet $};
			\draw [thick] (b) -- (tr) (b) -- (tl);
			\draw [thick,draw=blue,->] (b) edge[loop below] (b)
								   (tl) edge[bend right] (b)
								   (tr) edge[bend left] (b);
		 \end {tikzpicture}
		}\ar [ul, ultra thick,-] \ar [ur, ultra thick,-] \ar [ulll, ultra thick,-] \ar [urrr, ultra thick,-] &&\qquad  
	\end {tikzcd}
]]></fr:resource-source></fr:resource>	
At each step "upwards" on this <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link>, one arrow that ends in <fr:tex display="inline"><![CDATA[\bot ]]></fr:tex> now points to a non-<fr:tex display="inline"><![CDATA[\bot ]]></fr:tex> value (moving up the <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> <fr:tex display="inline"><![CDATA[\mathbb {B}_\bot ]]></fr:tex>).</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-002P/</fr:uri><fr:display-uri>dt-002P</fr:display-uri><fr:route>/forest/dt-002P/</fr:route><fr:title text="Primitive functions for functions">Primitive functions for functions</fr:title></fr:frontmatter><fr:mainmatter><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-002N/</fr:uri><fr:display-uri>dt-002N</fr:display-uri><fr:route>/forest/dt-002N/</fr:route><fr:title text="The \mathit {apply} function">The <fr:tex display="inline"><![CDATA[\mathit {apply}]]></fr:tex> function</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>The <fr:tex display="inline"><![CDATA[\mathit {apply}]]></fr:tex> function simply applies a given function to a given argument:
<fr:tex display="block"><![CDATA[
\begin {array}{l}
\mathit {apply} : ((A \twoheadrightarrow  B) \times  A) \twoheadrightarrow  B\\
\mathit {apply} (f, a) = f(a)
\end {array}
]]></fr:tex></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-002Q/</fr:uri><fr:display-uri>dt-002Q</fr:display-uri><fr:route>/forest/dt-002Q/</fr:route><fr:taxon>Exercise</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Show that <fr:tex display="inline"><![CDATA[\mathit {apply}]]></fr:tex> is <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link>.</html:p><html:p><html:em>Hint:</html:em> A function <fr:tex display="inline"><![CDATA[f : A \times  B \rightarrow  C]]></fr:tex> is <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link> iff it is <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link> in each argument separately, i.e., iff <fr:tex display="inline"><![CDATA[\forall  a \in  A.\ f(a,\cdot ) : B \rightarrow  C]]></fr:tex> is continuous, and  <fr:tex display="inline"><![CDATA[\forall  b \in  B.\ f(\cdot ,b) : A \rightarrow  C]]></fr:tex> is continuous.</html:p>



<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>
<html:p>
First showing <fr:tex display="inline"><![CDATA[\mathit {apply}(f,\cdot )]]></fr:tex> is continuous for some continuous <fr:tex display="inline"><![CDATA[f : A \twoheadrightarrow  B]]></fr:tex>, using the <fr:link href="/forest/dt-001O/" title="Alternative characterisation of continuity" uri="https://liamoc.net/forest/dt-001O/" display-uri="dt-001O" type="local">alternative characterisation</fr:link>
<html:ol><html:li><html:em><fr:tex display="inline"><![CDATA[\mathit {apply}(f,\cdot )]]></fr:tex> is monotonic</html:em>: Given <fr:tex display="inline"><![CDATA[a, b \in  A]]></fr:tex> where <fr:tex display="inline"><![CDATA[a \sqsubseteq  b]]></fr:tex>, we can see that <fr:tex display="inline"><![CDATA[\mathit {apply}(f,a) = f(a) \sqsubseteq  f(b) = \mathit {apply}(f,b)]]></fr:tex> by the <fr:link href="/forest/dt-000J/" title="Monotonicity" uri="https://liamoc.net/forest/dt-000J/" display-uri="dt-000J" type="local">monotonicity</fr:link> of <fr:tex display="inline"><![CDATA[f]]></fr:tex>.
</html:li>
<html:li><html:em><fr:tex display="inline"><![CDATA[\mathit {apply}(f,\cdot )]]></fr:tex> preserves lubs</html:em>: Given a <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link> <fr:tex display="inline"><![CDATA[X \subseteq  A]]></fr:tex>, we can see that <fr:tex display="inline"><![CDATA[\mathit {apply}(f,\bigsqcup  X) = f(\bigsqcup  X) = \bigsqcup  \{f(x) \mid  x \in  X\} = \bigsqcup  \{\mathit {apply}(f,x) \mid  x \in  X\}]]></fr:tex> follows from the continuity of <fr:tex display="inline"><![CDATA[f]]></fr:tex>.
</html:li></html:ol>
Next, showing <fr:tex display="inline"><![CDATA[\mathit {apply}(\cdot ,a)]]></fr:tex> is continuous for some fixed <fr:tex display="inline"><![CDATA[a \in  A]]></fr:tex>:
<html:ol><html:li><html:em><fr:tex display="inline"><![CDATA[\mathit {apply}(\cdot ,a)]]></fr:tex> is monotonic</html:em>: Given <fr:tex display="inline"><![CDATA[f, g \in  A \twoheadrightarrow  B]]></fr:tex> where <fr:tex display="inline"><![CDATA[f \sqsubseteq  g]]></fr:tex>, we can see that <fr:tex display="inline"><![CDATA[\mathit {apply}(f,a) = f(a) \sqsubseteq  g(a) = \mathit {apply}(g,a)]]></fr:tex> by the <fr:link href="/forest/dt-002L/" title="The cpo of functions" uri="https://liamoc.net/forest/dt-002L/" display-uri="dt-002L" type="local">pointwise ordering of functions</fr:link>.
</html:li>
<html:li><html:em><fr:tex display="inline"><![CDATA[\mathit {apply}(\cdot ,a)]]></fr:tex> preserves lubs</html:em>: Given a <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link> <fr:tex display="inline"><![CDATA[X \subseteq  A \twoheadrightarrow  B]]></fr:tex>, we can see that <fr:tex display="inline"><![CDATA[\mathit {apply}(\bigsqcup  X, a) = \left (\bigsqcup  X\right )(a) = \bigsqcup  \{f(a) \mid  f \in  X\} = \bigsqcup  \{\mathit {apply}(f,a) \mid  f \in  X\}]]></fr:tex> follows from the <fr:link href="/forest/dt-002L/" title="The cpo of functions" uri="https://liamoc.net/forest/dt-002L/" display-uri="dt-002L" type="local">lub definition for functions</fr:link>.
</html:li></html:ol></html:p></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-002O/</fr:uri><fr:display-uri>dt-002O</fr:display-uri><fr:route>/forest/dt-002O/</fr:route><fr:title text="The \mathit {curry} function">The <fr:tex display="inline"><![CDATA[\mathit {curry}]]></fr:tex> function</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>The function <fr:tex display="inline"><![CDATA[\mathit {curry}]]></fr:tex> transforms a function that takes two arguments all at once (as a <fr:link href="/forest/dm-0005/" title="Cartesian product" uri="https://liamoc.net/forest/dm-0005/" display-uri="dm-0005" type="local">product</fr:link>) into a function that takes the arguments one at a time. That is, if <fr:tex display="inline"><![CDATA[f : A \times  B \twoheadrightarrow  C]]></fr:tex> then:
<fr:tex display="block"><![CDATA[
\begin {array}{l}
\mathit {curry}(f) : A \twoheadrightarrow  (B \twoheadrightarrow  C)\\
\mathit {curry}(f)(a)(b) = f(a, b)
\end {array}
]]></fr:tex></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-002S/</fr:uri><fr:display-uri>dt-002S</fr:display-uri><fr:route>/forest/dt-002S/</fr:route><fr:title text="Continuity of \mathit {curry}">Continuity of <fr:tex display="inline"><![CDATA[\mathit {curry}]]></fr:tex></fr:title><fr:taxon>Theorem</fr:taxon></fr:frontmatter><fr:mainmatter><html:ol><html:li><fr:tex display="inline"><![CDATA[\mathit {curry}]]></fr:tex> is <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link> on <fr:tex display="inline"><![CDATA[A \times  B \twoheadrightarrow  C]]></fr:tex>.</html:li>
<html:li><fr:tex display="inline"><![CDATA[\mathit {curry}(f)]]></fr:tex>, given <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link> <fr:tex display="inline"><![CDATA[f : A \times  B \twoheadrightarrow  C]]></fr:tex>, is <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link> on <fr:tex display="inline"><![CDATA[A]]></fr:tex>.</html:li>
<html:li><fr:tex display="inline"><![CDATA[\mathit {curry}(f)(a)]]></fr:tex>, given <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link> <fr:tex display="inline"><![CDATA[f : A \times  B \twoheadrightarrow  C]]></fr:tex> and <fr:tex display="inline"><![CDATA[a \in  A]]></fr:tex>, is <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link> on <fr:tex display="inline"><![CDATA[B]]></fr:tex>.</html:li></html:ol></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-002R/</fr:uri><fr:display-uri>dt-002R</fr:display-uri><fr:route>/forest/dt-002R/</fr:route><fr:taxon>Exercise</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
	What is the common (functional programming) name for <fr:tex display="inline"><![CDATA[\mathit {apply} \circ  (f \times  \mathsf {id})]]></fr:tex>?
	



<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter><html:p><fr:tex display="inline"><![CDATA[\mathit {uncurry}]]></fr:tex></html:p></fr:mainmatter></fr:tree></html:p></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-002T/</fr:uri><fr:display-uri>dt-002T</fr:display-uri><fr:route>/forest/dt-002T/</fr:route><fr:title text="Universal property for functions">Universal property for functions</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:figure><fr:resource hash="ec65a286c98c1f710cfc5a0c02857af9"><fr:resource-content><html:img src="/forest/ec65a286c98c1f710cfc5a0c02857af9.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz-cd}\usepackage {amssymb}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}[row sep=4em]
A \times  B \ar [d,dashed,labels=description,"\mathit {curry}(f)\times  \mathsf {id}_B"] \ar [r,"f"] & C \\
(B \twoheadrightarrow  C) \times  B \ar [ur, labels=below right,"\mathit {apply}"]	
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure><fr:tex display="block"><![CDATA[
	\mathit {apply} \circ  h = f\; \text {iff}\; h = \mathit {curry}(f)\times \mathsf {id}_B
]]></fr:tex></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-002U/</fr:uri><fr:display-uri>dt-002U</fr:display-uri><fr:route>/forest/dt-002U/</fr:route><fr:title text="The currying isomorphism">The currying isomorphism</fr:title><fr:taxon>Theorem</fr:taxon></fr:frontmatter><fr:mainmatter><fr:tex display="block"><![CDATA[
(A \times  B)\twoheadrightarrow  C \;\;\simeq  \;\; A\twoheadrightarrow  (B\twoheadrightarrow  C)
]]></fr:tex>


<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Proof</fr:taxon></fr:frontmatter><fr:mainmatter>
<html:p>Follows from the <fr:link href="/forest/dt-002T/" title="Universal property for functions" uri="https://liamoc.net/forest/dt-002T/" display-uri="dt-002T" type="local">universal property for functions</fr:link> when set up with the <fr:link href="/forest/dt-002E/" title="Cpo isomorphism" uri="https://liamoc.net/forest/dt-002E/" display-uri="dt-002E" type="local">isomorphism</fr:link> from <fr:link href="/forest/dt-002O/" title="The \mathit {curry} function" uri="https://liamoc.net/forest/dt-002O/" display-uri="dt-002O" type="local">curry</fr:link> and its inverse, the function in <fr:link href="/forest/dt-002R/" title="https://liamoc.net/forest/dt-002R/" uri="https://liamoc.net/forest/dt-002R/" display-uri="dt-002R" type="local">Exercise <fr:contextual-number uri="https://liamoc.net/forest/dt-002R/" display-uri="dt-002R" /></fr:link>.</html:p>	
</fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-002V/</fr:uri><fr:display-uri>dt-002V</fr:display-uri><fr:route>/forest/dt-002V/</fr:route><fr:title text="Why the function arrow is not a covariant bifunctor">Why the function arrow is not a covariant <fr:link href="/forest/dm-000M/" title="Bifunctor" uri="https://liamoc.net/forest/dm-000M/" display-uri="dm-000M" type="local">bifunctor</fr:link></fr:title><fr:taxon>Remark</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
	For the <fr:tex display="inline"><![CDATA[\twoheadrightarrow ]]></fr:tex> operator on <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> (<fr:link href="/forest/dt-002F/" title="The set of continuous functions" uri="https://liamoc.net/forest/dt-002F/" display-uri="dt-002F" type="local">Definition <fr:contextual-number uri="https://liamoc.net/forest/dt-002F/" display-uri="dt-002F" /></fr:link>) to be the object mapping for a <fr:link href="/forest/dm-000M/" title="Bifunctor" uri="https://liamoc.net/forest/dm-000M/" display-uri="dm-000M" type="local">bifunctor</fr:link> <fr:tex display="inline"><![CDATA[\textbf {Cpo} \times  \textbf {Cpo} \rightarrow  \textbf {Cpo}]]></fr:tex> like <fr:tex display="inline"><![CDATA[\times ]]></fr:tex> is (see <fr:link href="/forest/dt-002C/" title="Derived properties of cpo products" uri="https://liamoc.net/forest/dt-002C/" display-uri="dt-002C" type="local">Corollary <fr:contextual-number uri="https://liamoc.net/forest/dt-002C/" display-uri="dt-002C" /></fr:link>), we would need to define a morphism mapping <fr:tex display="inline"><![CDATA[f \twoheadrightarrow  g]]></fr:tex> that, given two functions <fr:tex display="inline"><![CDATA[f : A \twoheadrightarrow  B]]></fr:tex> and <fr:tex display="inline"><![CDATA[g : C \twoheadrightarrow  D]]></fr:tex>, gives a function <fr:tex display="inline"><![CDATA[(A \twoheadrightarrow  C) \twoheadrightarrow  (B \twoheadrightarrow  D)]]></fr:tex>. But such a function is <html:em>not implementable</html:em>:
	<fr:tex display="block"><![CDATA[
\begin {array}{l}
	f \twoheadrightarrow  g : (A \twoheadrightarrow  C) \twoheadrightarrow  (B \twoheadrightarrow  D) \\
	(f \twoheadrightarrow  g)(h)(b) =\ \textcolor {red}{???}\\
	\end {array}
	]]></fr:tex>
	In the above hole <fr:tex display="inline"><![CDATA[\textcolor {red}{???}]]></fr:tex>, <fr:tex display="inline"><![CDATA[h : A \twoheadrightarrow  C]]></fr:tex> and <fr:tex display="inline"><![CDATA[b \in  B]]></fr:tex>. Given the value <fr:tex display="inline"><![CDATA[b \in  B]]></fr:tex>, none of our functions <fr:tex display="inline"><![CDATA[f, g]]></fr:tex> or <fr:tex display="inline"><![CDATA[h]]></fr:tex> take elements of <fr:tex display="inline"><![CDATA[B]]></fr:tex>, so there would be no way to produce the <fr:tex display="inline"><![CDATA[D]]></fr:tex> value required. This is because our function <fr:tex display="inline"><![CDATA[f : A \twoheadrightarrow  B]]></fr:tex> goes <html:em>the wrong way</html:em>. If <fr:tex display="inline"><![CDATA[f]]></fr:tex> were a function <fr:tex display="inline"><![CDATA[B \twoheadrightarrow  A]]></fr:tex>, things would be a lot easier.
</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dm-000Q/</fr:uri><fr:display-uri>dm-000Q</fr:display-uri><fr:route>/forest/dm-000Q/</fr:route><fr:title text="Dual category">Dual category</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>The <html:em>dual</html:em> of a <fr:link href="/forest/dm-000G/" title="Category" uri="https://liamoc.net/forest/dm-000G/" display-uri="dm-000G" type="local">category</fr:link> <fr:tex display="inline"><![CDATA[\mathbf {C}]]></fr:tex>, written <fr:tex display="inline"><![CDATA[\mathbf {C}^\mathsf {op}]]></fr:tex>, is a <fr:link href="/forest/dm-000G/" title="Category" uri="https://liamoc.net/forest/dm-000G/" display-uri="dm-000G" type="local">category</fr:link> with the same objects as <fr:tex display="inline"><![CDATA[\mathbf {C}]]></fr:tex> but the arrows are reversed, that is, for each morphism <fr:tex display="inline"><![CDATA[A \xrightarrow {m} B]]></fr:tex> in <fr:tex display="inline"><![CDATA[\mathbf {C}]]></fr:tex>, there is a morphism <fr:tex display="inline"><![CDATA[B \xrightarrow {m} A]]></fr:tex> in <fr:tex display="inline"><![CDATA[\mathbf {C}^\mathsf {op}]]></fr:tex>.</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-002W/</fr:uri><fr:display-uri>dt-002W</fr:display-uri><fr:route>/forest/dt-002W/</fr:route><fr:title text="The function arrow is a bifunctor">The function arrow is a bifunctor</fr:title></fr:frontmatter><fr:mainmatter><html:p>The operator <fr:tex display="inline"><![CDATA[\twoheadrightarrow ]]></fr:tex> introduced in <fr:link href="/forest/dt-002F/" title="The set of continuous functions" uri="https://liamoc.net/forest/dt-002F/" display-uri="dt-002F" type="local">Definition <fr:contextual-number uri="https://liamoc.net/forest/dt-002F/" display-uri="dt-002F" /></fr:link> is is the object mapping for a <fr:link href="/forest/dm-000M/" title="Bifunctor" uri="https://liamoc.net/forest/dm-000M/" display-uri="dm-000M" type="local">binary functor</fr:link>: <fr:tex display="block"><![CDATA[(\twoheadrightarrow ) : \mathbf {Cpo}^\mathsf {op} \times  \mathbf {Cpo} \rightarrow  \mathbf {Cpo}]]></fr:tex> The <fr:link href="/forest/dm-000G/" title="Category" uri="https://liamoc.net/forest/dm-000G/" display-uri="dm-000G" type="local">category</fr:link> <fr:tex display="inline"><![CDATA[\mathbf {Cpo}^\mathsf {op}]]></fr:tex> is the <fr:link href="/forest/dm-000Q/" title="Dual category" uri="https://liamoc.net/forest/dm-000Q/" display-uri="dm-000Q" type="local">dual category</fr:link> to <fr:tex display="inline"><![CDATA[\mathbf {Cpo}]]></fr:tex>.</html:p><html:p>
Thus, a morphism <fr:tex display="inline"><![CDATA[A \xrightarrow {m} B]]></fr:tex> in the <fr:link href="/forest/dm-000G/" title="Category" uri="https://liamoc.net/forest/dm-000G/" display-uri="dm-000G" type="local">category</fr:link>  <fr:tex display="inline"><![CDATA[\mathbf {Cpo}^\mathsf {op}]]></fr:tex> is a <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link> function <fr:tex display="inline"><![CDATA[m : B \twoheadrightarrow  A]]></fr:tex>. Thus, the morphism mapping for our <fr:link href="/forest/dm-000J/" title="Functor" uri="https://liamoc.net/forest/dm-000J/" display-uri="dm-000J" type="local">functor</fr:link> must take two functions <fr:tex display="inline"><![CDATA[f : B \twoheadrightarrow  A]]></fr:tex> (the morphism from <fr:tex display="inline"><![CDATA[\mathbf {Cpo}^\mathsf {op}]]></fr:tex>) and <fr:tex display="inline"><![CDATA[g : C \twoheadrightarrow  D]]></fr:tex> (the morphism from <fr:tex display="inline"><![CDATA[\mathbf {Cpo}]]></fr:tex>), and produce <fr:tex display="inline"><![CDATA[(A \twoheadrightarrow  C) \twoheadrightarrow  (B \twoheadrightarrow  D)]]></fr:tex>. As with <fr:link href="/forest/dt-0026/" title="Product of functions" uri="https://liamoc.net/forest/dt-0026/" display-uri="dt-0026" type="local">products</fr:link>, we will overload the <fr:tex display="inline"><![CDATA[\twoheadrightarrow ]]></fr:tex> notation for this mapping as well. </html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-002X/</fr:uri><fr:display-uri>dt-002X</fr:display-uri><fr:route>/forest/dt-002X/</fr:route><fr:title text="Morphism mapping for \twoheadrightarrow ">Morphism mapping for <fr:tex display="inline"><![CDATA[\twoheadrightarrow ]]></fr:tex></fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
Given <fr:tex display="inline"><![CDATA[f : B \twoheadrightarrow  A]]></fr:tex> and <fr:tex display="inline"><![CDATA[g : C \twoheadrightarrow  D]]></fr:tex>, we have:
<fr:tex display="block"><![CDATA[
\begin {array}{l}
f \twoheadrightarrow  g : (A \twoheadrightarrow  C) \twoheadrightarrow  (B \twoheadrightarrow  D)\\
f \twoheadrightarrow  g = \mathit {curry}\ (g \circ  \mathit {apply} \circ  (\mathsf {id} \times  f))\\[2em]
\text {(or, operationally:)}\\
(f \twoheadrightarrow  g)(h) = g \circ  h \circ  f\\
\end {array}]]></fr:tex></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-002Y/</fr:uri><fr:display-uri>dt-002Y</fr:display-uri><fr:route>/forest/dt-002Y/</fr:route><fr:taxon>Theorem</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
The two <fr:link href="/forest/dm-000J/" title="Functor" uri="https://liamoc.net/forest/dm-000J/" display-uri="dm-000J" type="local">functor</fr:link> laws follow as a consequence of the <fr:link href="/forest/dt-002T/" title="Universal property for functions" uri="https://liamoc.net/forest/dt-002T/" display-uri="dt-002T" type="local">universal property</fr:link> for functions:
<html:ol><html:li><fr:tex display="inline"><![CDATA[\mathsf {id}_A \twoheadrightarrow  \mathsf {id}_B = \mathsf {id}_{A \twoheadrightarrow  B}]]></fr:tex></html:li>
<html:li><fr:tex display="inline"><![CDATA[(f \circ  g) \twoheadrightarrow  (h \circ  i) = (g \twoheadrightarrow  h) \circ  (f \twoheadrightarrow  i)]]></fr:tex></html:li></html:ol></html:p></fr:mainmatter></fr:tree>


<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Upshot</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Our <fr:link href="/forest/dt-002B/" title="The category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-002B/" display-uri="dt-002B" type="local">category <fr:tex display="inline"><![CDATA[\textbf {Cpo}]]></fr:tex></fr:link> has <html:em>exponentials</html:em>.</html:p></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0030/</fr:uri><fr:display-uri>dt-0030</fr:display-uri><fr:route>/forest/dt-0030/</fr:route><fr:title text="Sums">Sums</fr:title></fr:frontmatter><fr:mainmatter><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0031/</fr:uri><fr:display-uri>dt-0031</fr:display-uri><fr:route>/forest/dt-0031/</fr:route><fr:title text="Sum of cpos">Sum of <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link></fr:title><fr:taxon>Construction</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
The <html:em>sum</html:em> construct on <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> <fr:tex display="inline"><![CDATA[A + B]]></fr:tex> denotes a disjoint union of two <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> with a new, dedicated <fr:link href="/forest/dt-000A/" title="The bottom value" uri="https://liamoc.net/forest/dt-000A/" display-uri="dt-000A" type="local"><fr:tex display="inline"><![CDATA[\bot ]]></fr:tex> value</fr:link>:
<fr:tex display="block"><![CDATA[
A + B = \{ (0, a) \mid  a \in  A \} \cup  \{ (1, b) \mid  b \in  B \} \cup  \{ \bot _{A+B} \}
]]></fr:tex>
This construct is a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> under the <fr:link href="/forest/dm-0000/" title="Partial order" uri="https://liamoc.net/forest/dm-0000/" display-uri="dm-0000" type="local">ordering</fr:link>:
<fr:tex display="block"><![CDATA[
x \sqsubseteq  y\;\;\text {iff}\;\;\begin {cases} \text {true} & \text {if}\ x=\bot _{A+B}\\ a \sqsubseteq  a' & \text {if}\ x = (0,a)\ \text {and}\ y = (0, a') \\ b \sqsubseteq  b' & \text {if}\ x = (1,b)\ \text {and}\ y = (1, b') \\ 
\text {false} & \text {otherwise} \end {cases}
]]></fr:tex>
Intuitively, this says that the <fr:link href="/forest/dm-0000/" title="Partial order" uri="https://liamoc.net/forest/dm-0000/" display-uri="dm-0000" type="local">ordering</fr:link> on <fr:tex display="inline"><![CDATA[A + B]]></fr:tex> is the same as <fr:tex display="inline"><![CDATA[A]]></fr:tex> and <fr:tex display="inline"><![CDATA[B]]></fr:tex> separately, except that <fr:tex display="inline"><![CDATA[\bot _{A+B}]]></fr:tex> is less than anything.</html:p><html:p> The only <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed sets</fr:link> are those that do <html:em>not</html:em> contain a mixture of elements from both <fr:tex display="inline"><![CDATA[A]]></fr:tex> and from <fr:tex display="inline"><![CDATA[B]]></fr:tex>, so the <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">least upper bound</fr:link> operator is essentially the same as the <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">least upper bounds</fr:link> for <fr:tex display="inline"><![CDATA[A]]></fr:tex> and for <fr:tex display="inline"><![CDATA[B]]></fr:tex>. Formally:
<fr:tex display="block"><![CDATA[
\bigsqcup  X \;\; = \;\; \begin {cases}
(0,\bigsqcup  \{ a \mid  (0,a) \in  X \}) & \text {if}\ \{ a \mid  (0,a) \in  X \} \neq  \emptyset  \\
(1,\bigsqcup  \{ b \mid  (1,b) \in  X \}) & \text {if}\ \{ b \mid  (1,b) \in  X \} \neq  \emptyset \\
\bot _{A+B} & \text {otherwise}\\
\end {cases}
]]></fr:tex></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-003D/</fr:uri><fr:display-uri>dt-003D</fr:display-uri><fr:route>/forest/dt-003D/</fr:route><fr:title text="Primitive functions for sums">Primitive functions for sums</fr:title></fr:frontmatter><fr:mainmatter><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0032/</fr:uri><fr:display-uri>dt-0032</fr:display-uri><fr:route>/forest/dt-0032/</fr:route><fr:title text="Constructors for sums">Constructors for sums</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>For <html:em>constructing</html:em> sums, we use two primitive constructor functions, <fr:tex display="inline"><![CDATA[\mathit {inl}]]></fr:tex> and <fr:tex display="inline"><![CDATA[\mathit {inr}]]></fr:tex>:
<fr:tex display="block"><![CDATA[
\begin {array}{l}
  \mathit {inl} : A \twoheadrightarrow  (A + B)\\
  \mathit {inl}(x) = (0,x)\\[1em]
  \mathit {inr} : B \twoheadrightarrow  (A + B)\\
  \mathit {inr}(y) = (1,y)
\end {array}
]]></fr:tex></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0033/</fr:uri><fr:display-uri>dt-0033</fr:display-uri><fr:route>/forest/dt-0033/</fr:route><fr:title text="Continuity of sum constructors">Continuity of sum constructors</fr:title><fr:taxon>Theorem</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>The <fr:link href="/forest/dt-0032/" title="Constructors for sums" uri="https://liamoc.net/forest/dt-0032/" display-uri="dt-0032" type="local">constructor functions</fr:link> <fr:tex display="inline"><![CDATA[\mathit {inl}]]></fr:tex> and <fr:tex display="inline"><![CDATA[\mathit {inr}]]></fr:tex> are <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link>.</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0034/</fr:uri><fr:display-uri>dt-0034</fr:display-uri><fr:route>/forest/dt-0034/</fr:route><fr:title text="The case function">The case function</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Elimination of <fr:link href="/forest/dt-0031/" title="Sum of cpos" uri="https://liamoc.net/forest/dt-0031/" display-uri="dt-0031" type="local">sums</fr:link> is captured by the <html:em>case</html:em> function <fr:tex display="inline"><![CDATA[[f,g] : (A + B) \twoheadrightarrow  C]]></fr:tex>, made from functions <fr:tex display="inline"><![CDATA[f : A \twoheadrightarrow  C]]></fr:tex> and <fr:tex display="inline"><![CDATA[g : B \twoheadrightarrow  C]]></fr:tex>. This function is defined by:
<fr:tex display="block"><![CDATA[
\begin {array}{l}
 [f,g] : (A + B) \twoheadrightarrow  C\\
 [f,g](x) = \begin {cases} f(a) & \text {if}\ x = (0,a) \\
								  g(b) & \text {if}\ x = (1,b) \\
								  \bot _C & \text {if}\ x = \bot _{A+B}\end {cases}
\end {array}
]]></fr:tex></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0035/</fr:uri><fr:display-uri>dt-0035</fr:display-uri><fr:route>/forest/dt-0035/</fr:route><fr:taxon>Exercise</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
	Prove that the <fr:link href="/forest/dt-0034/" title="The case function" uri="https://liamoc.net/forest/dt-0034/" display-uri="dt-0034" type="local">case function</fr:link> <fr:tex display="inline"><![CDATA[[f,g](x)]]></fr:tex> is, given <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link> functions <fr:tex display="inline"><![CDATA[f : A \twoheadrightarrow  C]]></fr:tex> and <fr:tex display="inline"><![CDATA[g : B \twoheadrightarrow  C]]></fr:tex>, <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link> on its argument <fr:tex display="inline"><![CDATA[x]]></fr:tex>.




<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>
<html:p>
	As mentioned in <fr:link href="/forest/dt-0031/" title="Sum of cpos" uri="https://liamoc.net/forest/dt-0031/" display-uri="dt-0031" type="local">Construction <fr:contextual-number uri="https://liamoc.net/forest/dt-0031/" display-uri="dt-0031" /></fr:link>, the only <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link> subsets of <fr:tex display="inline"><![CDATA[A + B]]></fr:tex> are those that contain entirely values of the format <fr:tex display="inline"><![CDATA[(0,\_)]]></fr:tex> and optionally <fr:tex display="inline"><![CDATA[\bot _{A+B}]]></fr:tex>, <html:em>or</html:em> those that contain entirely values of the format <fr:tex display="inline"><![CDATA[(1,\_)]]></fr:tex> and optionally <fr:tex display="inline"><![CDATA[\bot _{A+B}]]></fr:tex>. Call this <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link> subset <fr:tex display="inline"><![CDATA[X]]></fr:tex>.
</html:p>
	<html:ul><html:li><html:em>When  <fr:tex display="inline"><![CDATA[\bigsqcup  X = \bot _{A+B}]]></fr:tex></html:em>: This means that <fr:tex display="inline"><![CDATA[X = \{\bot _{A+B}\}]]></fr:tex> as <fr:tex display="inline"><![CDATA[\bot ]]></fr:tex> is always the least element. From <fr:link href="/forest/dt-0034/" title="The case function" uri="https://liamoc.net/forest/dt-0034/" display-uri="dt-0034" type="local">Definition <fr:contextual-number uri="https://liamoc.net/forest/dt-0034/" display-uri="dt-0034" /></fr:link>, we have: <fr:tex display="block"><![CDATA[\begin {array}{lcl} [f,g](\bigsqcup  X) &=& [f,g](\bot _{A+B}) \\ &=& \bot _C \\ &=& \bigsqcup  \{\bot _C\} \\ &=& \bigsqcup \{[f,g](\bot _{A+B})\} \\ &=& \bigsqcup  \{[f,g](x) \mid  x \in  X\}\end {array} ]]></fr:tex>  This discharges both requirements in <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">Definition <fr:contextual-number uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" /></fr:link> for this case.</html:li>
		<html:li><html:em>When <fr:tex display="inline"><![CDATA[\bigsqcup  X = (0,\_)]]></fr:tex></html:em>: This means that <fr:tex display="inline"><![CDATA[X]]></fr:tex> consists of at least one <fr:tex display="inline"><![CDATA[(0,\_)]]></fr:tex> value plus possibly <fr:tex display="inline"><![CDATA[\bot _{A+B}]]></fr:tex>, that is <fr:tex display="inline"><![CDATA[X \setminus  \{\bot _{A+B}\} = \{ (0,a) \mid  a \in  Y\} ]]></fr:tex> for some nonempty <fr:tex display="inline"><![CDATA[Y \subseteq  A]]></fr:tex>.  We have the following, using the <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuity</fr:link> of <fr:tex display="inline"><![CDATA[f]]></fr:tex>: 
		<fr:tex display="block"><![CDATA[\begin {array}{lcl} 
			[f,g](\bigsqcup  X) &=& [f,g](\bigsqcup  (X \setminus  \{\bot _{A+B}\})) \\
			&=& [f,g](\bigsqcup  \{ (0,a) \mid  a \in  Y\} )\\
			&=& [f,g](0,\bigsqcup  Y) \\
			&=& f(\bigsqcup  Y) \\
			&=& \bigsqcup  \{ f(a) \mid  a \in  Y \} \\
			&=& \bigsqcup  \{ [f,g](0,a) \mid  a \in  Y\} \\
			&=& \bigsqcup  \{ [f,g](x) \mid  x \in  X \setminus  \{\bot _{A+B}\} \} \\
			&=& \bigsqcup  (\{ [f,g](x) \mid  x \in  X \setminus  \{\bot _{A+B}\} \} \cup  \{\bot _C\}) \\
			&=& \bigsqcup  \{ [f,g](x) \mid  x \in  X \} \\
		\end {array}]]></fr:tex></html:li>
	<html:li><html:em>When <fr:tex display="inline"><![CDATA[\bigsqcup  X = (1,\_)]]></fr:tex></html:em>: Similar to the <fr:tex display="inline"><![CDATA[(0,\_)]]></fr:tex> case but using <fr:tex display="inline"><![CDATA[g]]></fr:tex> rather than <fr:tex display="inline"><![CDATA[f]]></fr:tex>.
	</html:li></html:ul>
</fr:mainmatter></fr:tree></html:p></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0039/</fr:uri><fr:display-uri>dt-0039</fr:display-uri><fr:route>/forest/dt-0039/</fr:route><fr:title text="Locality of sums">Locality of sums</fr:title></fr:frontmatter><fr:mainmatter><html:p>We can see by the definitions of <fr:link href="/forest/dt-0034/" title="The case function" uri="https://liamoc.net/forest/dt-0034/" display-uri="dt-0034" type="local">case</fr:link> and our <fr:link href="/forest/dt-0032/" title="Constructors for sums" uri="https://liamoc.net/forest/dt-0032/" display-uri="dt-0032" type="local">constructors</fr:link> that <fr:tex display="inline"><![CDATA[[f,g] \circ  \mathit {inl} = f]]></fr:tex> and <fr:tex display="inline"><![CDATA[[f,g] \circ  \mathit {inr} = g]]></fr:tex>, or, in a <fr:link href="/forest/dm-000L/" title="Commutative diagrams" uri="https://liamoc.net/forest/dm-000L/" display-uri="dm-000L" type="local">commutative diagram</fr:link>:</html:p><html:figure><fr:resource hash="a47d3938eb2a1314323abfbcd0cb841f"><fr:resource-content><html:img src="/forest/a47d3938eb2a1314323abfbcd0cb841f.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz-cd}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}[row sep=large]
	& C  \arrow [dl, "f",<-,labels=above left]\arrow [dr,<-,"g"]\arrow [d,"{[ f, g ]}", <-, labels=description] & \\
A & A + B \ar [l, "{\mathit {inl}}",<-,labels=below] \ar [r, "{\mathit {inr}}",<-,labels=below]& B 	
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure><html:p>Note that this diagram is like the <fr:link href="/forest/dm-000Q/" title="Dual category" uri="https://liamoc.net/forest/dm-000Q/" display-uri="dm-000Q" type="local">dual</fr:link> of the diagram seen in the <fr:link href="/forest/dt-0029/" title="Universal property for cpo products" uri="https://liamoc.net/forest/dt-0029/" display-uri="dt-0029" type="local">universal property for products</fr:link> — the arrows are reversed. That is because, generally speaking, sums are dual to products. However, because of our additional <fr:tex display="inline"><![CDATA[\bot ]]></fr:tex> value, our <fr:link href="/forest/dt-0031/" title="Sum of cpos" uri="https://liamoc.net/forest/dt-0031/" display-uri="dt-0031" type="local">cpo sums</fr:link> are only <html:em>weakly</html:em> universal — the <fr:tex display="inline"><![CDATA[h]]></fr:tex> arrow is <html:em>not</html:em> unique.
</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-003A/</fr:uri><fr:display-uri>dt-003A</fr:display-uri><fr:route>/forest/dt-003A/</fr:route><fr:title text="Weak universality of cpo sums">Weak universality of cpo sums</fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
Consider this scenario with the <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> <fr:tex display="inline"><![CDATA[\textbf {2} = \{ \top , \bot  \}]]></fr:tex> and <fr:tex display="inline"><![CDATA[\textbf {1} = \{\bot  \}]]></fr:tex>:
<html:figure><fr:resource hash="5556442547d1d6d040626d41e699845e"><fr:resource-content><html:img src="/forest/5556442547d1d6d040626d41e699845e.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz-cd}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}[row sep=large]
	& \mathbf {2}  \arrow [dl, "\lambda  x.\ \top ",<-,labels=above left]\arrow [dr,<-,"\lambda  x.\ \top "]\arrow [d,"{h}", <-, labels=description] & \\
\mathbf {1} & \mathbf {1} + \mathbf {1} \ar [l, "{\mathit {inl}}",<-,labels=below] \ar [r, "{\mathit {inr}}",<-,labels=below]& \mathbf {1}
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>
In this case, setting the function <fr:tex display="inline"><![CDATA[h = \lambda  x.\ \top ]]></fr:tex> makes the diagram commute, but <fr:tex display="inline"><![CDATA[(\lambda  x.\ \top ) \neq  [\lambda  x.\ \top , \lambda  x.\ \top ]]]></fr:tex> due to the different handling of <fr:tex display="inline"><![CDATA[\bot _{\textbf {1}+\textbf {1}}]]></fr:tex>. 
</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-003B/</fr:uri><fr:display-uri>dt-003B</fr:display-uri><fr:route>/forest/dt-003B/</fr:route><fr:title text="Weak universal property for cpo sums">Weak universal property for <fr:link href="/forest/dt-0031/" title="Sum of cpos" uri="https://liamoc.net/forest/dt-0031/" display-uri="dt-0031" type="local">cpo sums</fr:link></fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><fr:tex display="block"><![CDATA[
(h \circ  \mathit {inl} = f \land  h \circ  \mathit {inr} = g)\;\; \text {iff}\;\; [f,g] \sqsubseteq  h
]]></fr:tex><html:p>This property is called <html:em>weak</html:em> because it uses only the <fr:link href="/forest/dt-000B/" title="Information ordering" uri="https://liamoc.net/forest/dt-000B/" display-uri="dt-000B" type="local">information ordering</fr:link> rather than equality on the right hand side.</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-003C/</fr:uri><fr:display-uri>dt-003C</fr:display-uri><fr:route>/forest/dt-003C/</fr:route><fr:title text="Failure of sum isomorphisms">Failure of sum isomorphisms</fr:title><fr:taxon>Warning</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
The weakness of the <fr:link href="/forest/dt-0038/" title="https://liamoc.net/forest/dt-0038/" uri="https://liamoc.net/forest/dt-0038/" display-uri="dt-0038" type="local">universal property for sums</fr:link> means that many common <fr:link href="/forest/dt-002E/" title="Cpo isomorphism" uri="https://liamoc.net/forest/dt-002E/" display-uri="dt-002E" type="local">isomorphisms</fr:link> for sums in other contexts do not hold:
<html:ul><html:li><fr:tex display="inline"><![CDATA[A + (B + C) \not \simeq  (A + B) + C]]></fr:tex></html:li>
<html:li><fr:tex display="inline"><![CDATA[(A \twoheadrightarrow  C) \times  (B \twoheadrightarrow  C) \not \simeq  (A+B) \twoheadrightarrow  C]]></fr:tex></html:li></html:ul></html:p></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0036/</fr:uri><fr:display-uri>dt-0036</fr:display-uri><fr:route>/forest/dt-0036/</fr:route><fr:title text="Sums form a bifunctor">Sums form a bifunctor</fr:title></fr:frontmatter><fr:mainmatter><html:p>With these, we can define the morphism mapping for the <fr:link href="/forest/dt-0031/" title="Sum of cpos" uri="https://liamoc.net/forest/dt-0031/" display-uri="dt-0031" type="local">sum</fr:link> <fr:link href="/forest/dm-000M/" title="Bifunctor" uri="https://liamoc.net/forest/dm-000M/" display-uri="dm-000M" type="local">bifunctor</fr:link> <fr:tex display="inline"><![CDATA[(+) : \textbf {Cpo} \times  \textbf {Cpo} \rightarrow  \textbf {Cpo}]]></fr:tex>. Just as with <fr:link href="/forest/dt-0026/" title="Product of functions" uri="https://liamoc.net/forest/dt-0026/" display-uri="dt-0026" type="local">products</fr:link> and <fr:link href="/forest/dt-002W/" title="The function arrow is a bifunctor" uri="https://liamoc.net/forest/dt-002W/" display-uri="dt-002W" type="local">functions</fr:link>, we will overload the <fr:tex display="inline"><![CDATA[+]]></fr:tex> notation for <html:em>morphisms</html:em> as well as objects in <fr:link href="/forest/dt-002B/" title="The category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-002B/" display-uri="dt-002B" type="local">the category <fr:tex display="inline"><![CDATA[\mathbf {Cpo}]]></fr:tex></fr:link>.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0037/</fr:uri><fr:display-uri>dt-0037</fr:display-uri><fr:route>/forest/dt-0037/</fr:route><fr:title text="Sum of functions">Sum of functions</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p> Given functions <fr:tex display="inline"><![CDATA[f : A \twoheadrightarrow  C]]></fr:tex> and <fr:tex display="inline"><![CDATA[g : B \twoheadrightarrow  D]]></fr:tex>, we have: <fr:tex display="block"><![CDATA[\begin {array}{l} f+g : (A + B)\twoheadrightarrow  (C + D) \\ f+g = [\mathit {inl} \circ  f, \mathit {inr} \circ  g] \end {array} ]]></fr:tex></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0038/</fr:uri><fr:display-uri>dt-0038</fr:display-uri><fr:route>/forest/dt-0038/</fr:route><fr:taxon>Theorem</fr:taxon></fr:frontmatter><fr:mainmatter><html:p><fr:tex display="inline"><![CDATA[+ : \mathbf {Cpo} \times  \mathbf {Cpo} \rightarrow  \mathbf {Cpo}]]></fr:tex> is a lawful <fr:link href="/forest/dm-000M/" title="Bifunctor" uri="https://liamoc.net/forest/dm-000M/" display-uri="dm-000M" type="local">bifunctor</fr:link>, that is:
<html:ol><html:li><fr:tex display="inline"><![CDATA[ (\lambda  a. a) \times  (\lambda  b. b) = (\lambda  x.x)]]></fr:tex></html:li>
<html:li><fr:tex display="inline"><![CDATA[ (f_1 \circ  g_1) \times  (f_2 \circ  g_2) = (f_1 \times  f_2) \circ  (g_1 \times  g_2)]]></fr:tex></html:li></html:ol></html:p></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree>


<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Upshot</fr:taxon></fr:frontmatter><fr:mainmatter>
	<html:p>Our <fr:link href="/forest/dt-002B/" title="The category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-002B/" display-uri="dt-002B" type="local">category <fr:tex display="inline"><![CDATA[\mathbf {Cpo}]]></fr:tex></fr:link> has only <fr:link href="/forest/dt-0039/" title="Locality of sums" uri="https://liamoc.net/forest/dt-0039/" display-uri="dt-0039" type="local">local</fr:link> sums.</html:p>
</fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-003E/</fr:uri><fr:display-uri>dt-003E</fr:display-uri><fr:route>/forest/dt-003E/</fr:route><fr:title text="Strict Constructions">Strict Constructions</fr:title></fr:frontmatter><fr:mainmatter><html:p>When giving a semantics to a call-by-name (or "lazy") language, the constructions <fr:link href="/forest/dt-002F/" title="The set of continuous functions" uri="https://liamoc.net/forest/dt-002F/" display-uri="dt-002F" type="local"><fr:tex display="inline"><![CDATA[\twoheadrightarrow ]]></fr:tex> for functions</fr:link>, <fr:link href="/forest/dt-0021/" title="Product of cpos" uri="https://liamoc.net/forest/dt-0021/" display-uri="dt-0021" type="local"><fr:tex display="inline"><![CDATA[\times ]]></fr:tex> for products</fr:link> and <fr:link href="/forest/dt-0031/" title="Sum of cpos" uri="https://liamoc.net/forest/dt-0031/" display-uri="dt-0031" type="local"><fr:tex display="inline"><![CDATA[+]]></fr:tex> for sums</fr:link> are exactly what we want. To properly capture call-by-value (or "strict") languages, however, we also need <fr:link href="/forest/dt-000K/" title="Strictness" uri="https://liamoc.net/forest/dt-000K/" display-uri="dt-000K" type="local">strict</fr:link> versions of these constructions.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-003F/</fr:uri><fr:display-uri>dt-003F</fr:display-uri><fr:route>/forest/dt-003F/</fr:route><fr:title text="The cpo of strict continuous functions">The <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> of <fr:link href="/forest/dt-000K/" title="Strictness" uri="https://liamoc.net/forest/dt-000K/" display-uri="dt-000K" type="local">strict</fr:link> <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link> functions</fr:title><fr:taxon>Construction</fr:taxon></fr:frontmatter><fr:mainmatter><fr:tex display="block"><![CDATA[A \mathbin {\circ \hspace{-0.4em}\twoheadrightarrow } B = \{ f \in  A \twoheadrightarrow  B \mid  f(\bot ) = \bot  \}]]></fr:tex><html:p>The <fr:link href="/forest/dm-0000/" title="Partial order" uri="https://liamoc.net/forest/dm-0000/" display-uri="dm-0000" type="local">ordering</fr:link> and <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lubs</fr:link> are, <html:em>mutatis mutandis</html:em>, as with the non-strict <fr:link href="/forest/dt-002L/" title="The cpo of functions" uri="https://liamoc.net/forest/dt-002L/" display-uri="dt-002L" type="local">Construction <fr:contextual-number uri="https://liamoc.net/forest/dt-002L/" display-uri="dt-002L" /></fr:link>.</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-003G/</fr:uri><fr:display-uri>dt-003G</fr:display-uri><fr:route>/forest/dt-003G/</fr:route><fr:title text="Smash products of cpos">Smash products of <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link></fr:title><fr:taxon>Construction</fr:taxon></fr:frontmatter><fr:mainmatter><fr:tex display="block"><![CDATA[A \otimes  B = \{ (a,b) \in  A \times  B \mid  a \neq  \bot  \land  b \neq  \bot  \} \cup  \{ \bot _{A\otimes  B}\}]]></fr:tex><html:p>The <fr:link href="/forest/dm-0000/" title="Partial order" uri="https://liamoc.net/forest/dm-0000/" display-uri="dm-0000" type="local">ordering</fr:link> and <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lubs</fr:link> are, <html:em>mutatis mutandis</html:em>, as with the non-strict <fr:link href="/forest/dt-0021/" title="Product of cpos" uri="https://liamoc.net/forest/dt-0021/" display-uri="dt-0021" type="local">Construction <fr:contextual-number uri="https://liamoc.net/forest/dt-0021/" display-uri="dt-0021" /></fr:link>. This operator is called a <html:em>smash product</html:em> because the two <fr:tex display="inline"><![CDATA[\bot ]]></fr:tex> values from <fr:tex display="inline"><![CDATA[A]]></fr:tex> and <fr:tex display="inline"><![CDATA[B]]></fr:tex> are "smashed" into one <fr:tex display="inline"><![CDATA[\bot ]]></fr:tex> value.</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-003H/</fr:uri><fr:display-uri>dt-003H</fr:display-uri><fr:route>/forest/dt-003H/</fr:route><fr:title text="Smash sums of cpos">Smash sums of <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link></fr:title><fr:taxon>Construction</fr:taxon></fr:frontmatter><fr:mainmatter><fr:tex display="block"><![CDATA[A \oplus  B = \{ (t,x) \in  A + B \mid  x \neq  \bot  \} \cup  \{ \bot _{A\oplus  B} \}]]></fr:tex><html:p>The <fr:link href="/forest/dm-0000/" title="Partial order" uri="https://liamoc.net/forest/dm-0000/" display-uri="dm-0000" type="local">ordering</fr:link> and <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lubs</fr:link> are, <html:em>mutatis mutandis</html:em>, as with the non-strict <fr:link href="/forest/dt-0031/" title="Sum of cpos" uri="https://liamoc.net/forest/dt-0031/" display-uri="dt-0031" type="local">Construction <fr:contextual-number uri="https://liamoc.net/forest/dt-0031/" display-uri="dt-0031" /></fr:link>. This operator is called a <html:em>smash sum</html:em> because the two <fr:tex display="inline"><![CDATA[\bot ]]></fr:tex> values from <fr:tex display="inline"><![CDATA[A]]></fr:tex> and <fr:tex display="inline"><![CDATA[B]]></fr:tex> are "smashed" into one <fr:tex display="inline"><![CDATA[\bot ]]></fr:tex> value.</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-003J/</fr:uri><fr:display-uri>dt-003J</fr:display-uri><fr:route>/forest/dt-003J/</fr:route><fr:title text="Isomorphisms with strict constructions">Isomorphisms with strict constructions</fr:title><fr:taxon>Theorem</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
The <fr:link href="/forest/dt-003E/" title="Strict Constructions" uri="https://liamoc.net/forest/dt-003E/" display-uri="dt-003E" type="local">strict cpo constructions</fr:link> satisfy <html:em>all</html:em> the usual <fr:link href="/forest/dt-002E/" title="Cpo isomorphism" uri="https://liamoc.net/forest/dt-002E/" display-uri="dt-002E" type="local">isomorphisms</fr:link>, including:
<html:ul><html:li><fr:tex display="inline"><![CDATA[(A \mathbin {\circ \hspace{-0.4em}\twoheadrightarrow } B) \times  (A \mathbin {\circ \hspace{-0.4em}\twoheadrightarrow } C)\;\; \simeq \;\; A \mathbin {\circ \hspace{-0.4em}\twoheadrightarrow } (B\otimes  C)]]></fr:tex></html:li>
<html:li><fr:tex display="inline"><![CDATA[(A \otimes  B \mathbin {\circ \hspace{-0.4em}\twoheadrightarrow } C) \;\; \simeq \;\; A \mathbin {\circ \hspace{-0.4em}\twoheadrightarrow } (B \mathbin {\circ \hspace{-0.4em}\twoheadrightarrow } C)]]></fr:tex></html:li>
<html:li><fr:tex display="inline"><![CDATA[(A \mathbin {\circ \hspace{-0.4em}\twoheadrightarrow } C) \times  (B \mathbin {\circ \hspace{-0.4em}\twoheadrightarrow } C)\;\; \simeq \;\; (A\oplus  B) \mathbin {\circ \hspace{-0.4em}\twoheadrightarrow } C]]></fr:tex></html:li></html:ul></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-003I/</fr:uri><fr:display-uri>dt-003I</fr:display-uri><fr:route>/forest/dt-003I/</fr:route><fr:title text="The category \mathbf {Cpo_\bot }">The <fr:link href="/forest/dm-000G/" title="Category" uri="https://liamoc.net/forest/dm-000G/" display-uri="dm-000G" type="local">category</fr:link> <fr:tex display="inline"><![CDATA[\mathbf {Cpo_\bot }]]></fr:tex></fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
	The <fr:link href="/forest/dm-000G/" title="Category" uri="https://liamoc.net/forest/dm-000G/" display-uri="dm-000G" type="local">category</fr:link> <fr:tex display="inline"><![CDATA[\mathbf {Cpo_\bot }]]></fr:tex> is the <fr:link href="/forest/dm-000G/" title="Category" uri="https://liamoc.net/forest/dm-000G/" display-uri="dm-000G" type="local">category</fr:link> where the objects are <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link>, the morphisms are <fr:link href="/forest/dt-003F/" title="The cpo of strict continuous functions" uri="https://liamoc.net/forest/dt-003F/" display-uri="dt-003F" type="local"><html:em>strict</html:em> continuous functions</fr:link> between these <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link>, and composition and identity are <fr:link href="/forest/dt-002B/" title="The category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-002B/" display-uri="dt-002B" type="local">as in <fr:tex display="inline"><![CDATA[\mathbf {Cpo}]]></fr:tex></fr:link>.
</html:p></fr:mainmatter></fr:tree>


<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Upshot</fr:taxon></fr:frontmatter><fr:mainmatter>
	<fr:link href="/forest/dt-003I/" title="The category \mathbf {Cpo_\bot }" uri="https://liamoc.net/forest/dt-003I/" display-uri="dt-003I" type="local">The <fr:link href="/forest/dm-000G/" title="Category" uri="https://liamoc.net/forest/dm-000G/" display-uri="dm-000G" type="local">category</fr:link> <fr:tex display="inline"><![CDATA[\mathbf {Cpo_\bot }]]></fr:tex></fr:link> has products, exponentials, <html:em>and sums</html:em> (as it doesn't suffer from the <fr:link href="/forest/dt-0039/" title="Locality of sums" uri="https://liamoc.net/forest/dt-0039/" display-uri="dt-0039" type="local">problem</fr:link> that <fr:tex display="inline"><![CDATA[\textbf {Cpo}]]></fr:tex> does).
</fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-003K/</fr:uri><fr:display-uri>dt-003K</fr:display-uri><fr:route>/forest/dt-003K/</fr:route><fr:title text="The lifting operator for cpos">The lifting operator for <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link></fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
	The <html:em>lifting operator</html:em> <fr:tex display="inline"><![CDATA[(\cdot )_\bot ]]></fr:tex> adds a new <fr:tex display="inline"><![CDATA[\bot ]]></fr:tex> value to a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link>. That is, for a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> <fr:tex display="inline"><![CDATA[X]]></fr:tex>:
	<fr:tex display="block"><![CDATA[ X_\bot  = X \cup  \{\bot \} \quad  \text {(where $\bot  \notin  X$)}]]></fr:tex>
	For all <fr:tex display="inline"><![CDATA[x \in  X]]></fr:tex> (including <fr:tex display="inline"><![CDATA[\bot _X]]></fr:tex>), our new bottom value <fr:tex display="inline"><![CDATA[\bot  \sqsubseteq  x]]></fr:tex>.
</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-003L/</fr:uri><fr:display-uri>dt-003L</fr:display-uri><fr:route>/forest/dt-003L/</fr:route><fr:title text="Isomorphisms with lifting">Isomorphisms with lifting</fr:title><fr:taxon>Theorem</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>With <fr:link href="/forest/dt-003K/" title="The lifting operator for cpos" uri="https://liamoc.net/forest/dt-003K/" display-uri="dt-003K" type="local">the lifting operator</fr:link>, we can relate the lazy constructions like <fr:link href="/forest/dt-0021/" title="Product of cpos" uri="https://liamoc.net/forest/dt-0021/" display-uri="dt-0021" type="local">product</fr:link> and <fr:link href="/forest/dt-0031/" title="Sum of cpos" uri="https://liamoc.net/forest/dt-0031/" display-uri="dt-0031" type="local">sum</fr:link> with <fr:link href="/forest/dt-000K/" title="Strictness" uri="https://liamoc.net/forest/dt-000K/" display-uri="dt-000K" type="local">strict</fr:link> constructions like <fr:link href="/forest/dt-003G/" title="Smash products of cpos" uri="https://liamoc.net/forest/dt-003G/" display-uri="dt-003G" type="local">smash product</fr:link> and <fr:link href="/forest/dt-003H/" title="Smash sums of cpos" uri="https://liamoc.net/forest/dt-003H/" display-uri="dt-003H" type="local">sum</fr:link> via <fr:link href="/forest/dt-002E/" title="Cpo isomorphism" uri="https://liamoc.net/forest/dt-002E/" display-uri="dt-002E" type="local">isomorphism</fr:link>:
<html:ul><html:li><fr:tex display="inline"><![CDATA[A\twoheadrightarrow  B \simeq   A_\bot  \mathbin {\circ \hspace{-0.4em}\twoheadrightarrow } B]]></fr:tex></html:li>
<html:li><fr:tex display="inline"><![CDATA[A + B \simeq  A_\bot  \oplus  B_\bot ]]></fr:tex></html:li>
<html:li><fr:tex display="inline"><![CDATA[(A \times  B)_\bot   \simeq  A_\bot  \otimes  B_\bot  ]]></fr:tex></html:li></html:ul></html:p></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-003T/</fr:uri><fr:display-uri>dt-003T</fr:display-uri><fr:route>/forest/dt-003T/</fr:route><fr:title text="PCF">PCF</fr:title></fr:frontmatter><fr:mainmatter><html:p>For most purposes in <fr:link href="/forest/dt-0001/" title="Denotational semantics" uri="https://liamoc.net/forest/dt-0001/" display-uri="dt-0001" type="local">semantics</fr:link>, describing semantics in terms of (<fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link> functions on) <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> is enough. To demonstrate, we will give semantics to PCF: a Turing-complete, higher order functional programming language. We will then extend PCF to include more features, namely pairs (product types) and sum types.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-003M/</fr:uri><fr:display-uri>dt-003M</fr:display-uri><fr:route>/forest/dt-003M/</fr:route><fr:title text="The language PCF">The language PCF</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
  The language for <html:strong>P</html:strong>rogramming <html:strong>C</html:strong>omputable <html:strong>F</html:strong>unctions (PCF) is a variant of typed <fr:tex display="inline"><![CDATA[\lambda ]]></fr:tex>-calculus with minimal extensions to be Turing-complete.
  <fr:tex display="block"><![CDATA[
  \begin {array}{lcl}
     e & \Coloneqq  & n \mid  x \mid  \lambda  x : \tau .\ e \mid  e_1\ e_2\mid \mathsf {succ} \mid  \mathsf {pred} \mid  \mathsf {ifz}\ e_1\ \mathsf {then}\ e_2\ \mathsf {else}\ e_3 \mid  \mathsf {fix}\ x : \tau .\ e \\
    \tau  & \Coloneqq  & \mathsf {nat} \mid  \tau _1 \rightarrow  \tau _2	 	
   \end {array}
  ]]></fr:tex></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-003N/</fr:uri><fr:display-uri>dt-003N</fr:display-uri><fr:route>/forest/dt-003N/</fr:route><fr:title text="Typing rules for PCF">Typing rules for <fr:link href="/forest/dt-003M/" title="The language PCF" uri="https://liamoc.net/forest/dt-003M/" display-uri="dt-003M" type="local">PCF</fr:link></fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p><fr:tex display="block"><![CDATA[
  \dfrac {n \in  \mathbb {N}}{\Gamma  \vdash  n : \mathsf {nat}}\quad 
  \dfrac {x : \tau  \in  \Gamma }{\Gamma  \vdash  x : \tau }\quad 
  \dfrac {\Gamma , x : \tau _1 \vdash  e : \tau _2  }{ \Gamma  \vdash  \lambda  x : \tau _1.\ e : \tau _1 \rightarrow  \tau _2}\quad  
  \dfrac {\Gamma  \vdash  e_1 : \tau _1 \rightarrow  \tau _2 \quad  \Gamma  \vdash  e_2 : \tau _1}{\Gamma  \vdash  e_1\ e_2 : \tau _2}\\[2em]
  \dfrac { }{ \Gamma  \vdash  \mathsf {succ} : \mathsf {nat} \rightarrow  \mathsf {nat}}\quad  
  \dfrac { }{ \Gamma  \vdash  \mathsf {pred} : \mathsf {nat} \rightarrow  \mathsf {nat}}\quad 
  \dfrac { \Gamma  \vdash  e_1 : \mathsf {nat} \quad  \Gamma  \vdash  e_2 : \tau  \quad  \Gamma  \vdash  e_3 : \tau  }{ \Gamma  \vdash  \mathsf {ifz}\ e_1\ \mathsf {then}\ e_2\ \mathsf {else}\ e_3 : \tau }\quad 
  \dfrac { \Gamma , x : \tau  \vdash  e : \tau  }{\Gamma  \vdash  \mathsf {fix}\ x : \tau .\ e : \tau }
  ]]></fr:tex></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-003O/</fr:uri><fr:display-uri>dt-003O</fr:display-uri><fr:route>/forest/dt-003O/</fr:route><fr:title text="Type-dependent denotations">Type-dependent denotations</fr:title></fr:frontmatter><fr:mainmatter><html:p>
Because <fr:link href="/forest/dt-003M/" title="The language PCF" uri="https://liamoc.net/forest/dt-003M/" display-uri="dt-003M" type="local">PCF</fr:link> is <fr:link href="/forest/dt-003N/" title="Typing rules for PCF" uri="https://liamoc.net/forest/dt-003N/" display-uri="dt-003N" type="local">typed</fr:link>, we shall assign denotations only to well-typed expressions. 
The range of our <fr:link href="/forest/dt-0001/" title="Denotational semantics" uri="https://liamoc.net/forest/dt-0001/" display-uri="dt-0001" type="local">denotation function</fr:link> for expressions is determined by the <html:em>type</html:em> of its input expression. That is, the denotation of a type <fr:tex display="inline"><![CDATA[\tau ]]></fr:tex> <html:em>is</html:em> the <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> whose elements will be the denotations of expressions of type <fr:tex display="inline"><![CDATA[\tau ]]></fr:tex>. 

The denotation of the type <fr:tex display="inline"><![CDATA[\mathsf {nat}]]></fr:tex>, then, is merely the <fr:link href="/forest/dt-0008/" title="Flat domain" uri="https://liamoc.net/forest/dt-0008/" display-uri="dt-0008" type="local">flat domain</fr:link> of the natural numbers <fr:tex display="inline"><![CDATA[\mathbb {N}_\bot ]]></fr:tex>:
<fr:tex display="block"><![CDATA[
\llbracket  \mathsf {nat} \rrbracket  = \mathbb {N}_\bot 
]]></fr:tex>
And, the denotation of the function type is the domain of <fr:link href="/forest/dt-002F/" title="The set of continuous functions" uri="https://liamoc.net/forest/dt-002F/" display-uri="dt-002F" type="local">continuous functions</fr:link> on cpos:
<fr:tex display="block"><![CDATA[
\llbracket  \tau _1 \rightarrow  \tau _2 \rrbracket  = \llbracket  \tau _1 \rrbracket  \twoheadrightarrow  \llbracket  \tau _2 \rrbracket 
]]></fr:tex>
A <html:em>closed</html:em> term <fr:tex display="inline"><![CDATA[e : \tau ]]></fr:tex> with no free variables denotes an element of <fr:tex display="inline"><![CDATA[\llbracket  \tau  \rrbracket ]]></fr:tex>, so we might be tempted to define our denotation function for expressions <fr:tex display="inline"><![CDATA[e : \tau ]]></fr:tex> like so: <fr:tex display="block"><![CDATA[\llbracket  e \rrbracket  : \llbracket  \tau  \rrbracket ]]></fr:tex>
However, if <fr:tex display="inline"><![CDATA[e : \tau ]]></fr:tex> involves free variables from our context <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex>, the valuation of <fr:tex display="inline"><![CDATA[e]]></fr:tex> will depend on the values assigned to all the variables. Thus, the denotation of a typed expression <fr:tex display="inline"><![CDATA[\Gamma  \vdash  e : \tau ]]></fr:tex> is defined instead as a <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link> function:
<fr:tex display="block"><![CDATA[\llbracket  e \rrbracket _\Gamma  : \llbracket  \Gamma  \rrbracket  \twoheadrightarrow  \llbracket  \tau  \rrbracket ]]></fr:tex>
where the meaning of a context <fr:tex display="inline"><![CDATA[\Gamma  = (x_0 : \tau _0, x_1 : \tau _1,\dots , x_n : \tau _n)]]></fr:tex> will be a a big <fr:tex display="inline"><![CDATA[n]]></fr:tex>-tuple of the values assigned to each variable:
<fr:tex display="block"><![CDATA[\llbracket  \Gamma  \rrbracket  = \llbracket  \tau _0 \rrbracket  \times  \llbracket  \tau _1 \rrbracket  \times  \cdots  \times  \llbracket  \tau _n \rrbracket ]]></fr:tex></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-003Q/</fr:uri><fr:display-uri>dt-003Q</fr:display-uri><fr:route>/forest/dt-003Q/</fr:route><fr:title text="Notation for n-tuples">Notation for <fr:tex display="inline"><![CDATA[n]]></fr:tex>-tuples</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Given an <fr:tex display="inline"><![CDATA[n]]></fr:tex>-tuple, i.e. elements of the <fr:tex display="inline"><![CDATA[n]]></fr:tex>-ary <fr:link href="/forest/dm-0005/" title="Cartesian product" uri="https://liamoc.net/forest/dm-0005/" display-uri="dm-0005" type="local">product</fr:link> <fr:tex display="inline"><![CDATA[X_0 \times  X_1 \times  X_2 \times  \dots  \times  X_n]]></fr:tex>, we typically denote the entire <fr:tex display="inline"><![CDATA[n]]></fr:tex>-tuple as in vector notation: <fr:tex display="block"><![CDATA[\vec {x} : X_0 \times  X_1 \times  X_2 \times  \dots  \times  X_n]]></fr:tex>
And individual elements of the tuple are accessed with numeric subscripts:
<fr:tex display="block"><![CDATA[x_0 : X_0 \quad  x_2 : X_2 \quad  \cdots ]]></fr:tex></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-003P/</fr:uri><fr:display-uri>dt-003P</fr:display-uri><fr:route>/forest/dt-003P/</fr:route><fr:title text="Semantics of PCF">Semantics of <fr:link href="/forest/dt-003M/" title="The language PCF" uri="https://liamoc.net/forest/dt-003M/" display-uri="dt-003M" type="local">PCF</fr:link></fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter>


<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:title text="Types">Types</fr:title></fr:frontmatter><fr:mainmatter>
<fr:tex display="block"><![CDATA[
  \begin {array}{lcl}
  \llbracket  \mathsf {nat} \rrbracket  &=& \mathbb {N}_\bot \\  
  \llbracket  \tau _1 \rightarrow  \tau _2 \rrbracket  &=& \llbracket  \tau _1 \rrbracket  \twoheadrightarrow  \llbracket  \tau _2 \rrbracket  
  \end {array}
]]></fr:tex></fr:mainmatter></fr:tree>


<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:title text="Expressions">Expressions</fr:title></fr:frontmatter><fr:mainmatter>
  For <fr:tex display="inline"><![CDATA[\Gamma  \vdash  e : \tau ]]></fr:tex>, we have <fr:tex display="inline"><![CDATA[\llbracket  e \rrbracket _\Gamma  : \llbracket  \tau  \rrbracket  ]]></fr:tex> defined as follows:
<fr:tex display="block"><![CDATA[
\begin {array}{lcl}
  \llbracket  n \rrbracket _\Gamma (\vec {z}) & =&  n\\
  \llbracket  x \rrbracket _\Gamma (\vec {z}) & = & z_j\ \text {where}\ j\ \text {is largest}\ j\ \text {s.t.}\ x = x_j \\
\llbracket  \lambda  x : \tau _1.\ e \rrbracket _\Gamma (\vec {z}) & = & (\boldsymbol {\lambda } v \in  \llbracket  \tau _1 \rrbracket .\ \llbracket  e\rrbracket _{\Gamma , x : \tau _1}(\vec {z}, v))\\
\llbracket  e_1\ e_2 \rrbracket _\Gamma (\vec {z}) & = & \llbracket  e_1 \rrbracket _\Gamma (\vec {z})(\llbracket  e_2 \rrbracket _\Gamma (\vec {z}))\\
\llbracket  \mathsf {succ} \rrbracket _\Gamma (\vec {z}) & = & (\boldsymbol {\lambda } v \in  \mathbb {N}_\bot .\ v + 1)\\
\llbracket  \mathsf {pred} \rrbracket _\Gamma (\vec {z}) & = & (\boldsymbol {\lambda } v \in  \mathbb {N}_\bot .\ v - 1)\\
\llbracket  \mathsf {ifz}\ e_1\ \mathsf {then}\ e_2\ \mathsf {else}\ e_3 \rrbracket _\Gamma (\vec {z}) & = &  \begin {cases}
    \llbracket  e_2 \rrbracket _\Gamma (\vec {z}) & \text {if}\ 		\llbracket  e_1 \rrbracket _\Gamma (\vec {z}) > 0 \\
    \llbracket  e_3 \rrbracket _\Gamma (\vec {z}) & \text {if}\ 		\llbracket  e_1 \rrbracket _\Gamma (\vec {z}) = 0 \\
    \bot  & \text {if}\ \llbracket  e_1 \rrbracket _\Gamma (\vec {z}) = \bot 
  \end {cases}\\
\llbracket  \mathsf {fix}\ x : \tau .\ e \rrbracket _\Gamma (\vec {z}) &= & \mathbf {fix}(\boldsymbol {\lambda } v \in  \llbracket  \tau  \rrbracket .\ \llbracket  e\rrbracket _{\Gamma , x : \tau }(\vec {z}, v))
\end {array}
]]></fr:tex>
In the above definitions a boldface lambda <fr:tex display="inline"><![CDATA[\boldsymbol {\lambda }]]></fr:tex> is used for an anonymous <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous function</fr:link> — boldface to distinguish it from the lambda in the <fr:link href="/forest/dt-003M/" title="The language PCF" uri="https://liamoc.net/forest/dt-003M/" display-uri="dt-003M" type="local">syntax of PCF</fr:link>. Verifying that these functions are indeed <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link> is straightforward, but is necessary to justify the use of <fr:link href="/forest/dt-001Q/" title="The \textbf {fix} operator" uri="https://liamoc.net/forest/dt-001Q/" display-uri="dt-001Q" type="local">the <fr:tex display="inline"><![CDATA[\mathbf {fix}]]></fr:tex> operator</fr:link>. 
</fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-003R/</fr:uri><fr:display-uri>dt-003R</fr:display-uri><fr:route>/forest/dt-003R/</fr:route><fr:title text="Extending PCF with product types">Extending <fr:link href="/forest/dt-003M/" title="The language PCF" uri="https://liamoc.net/forest/dt-003M/" display-uri="dt-003M" type="local">PCF</fr:link> with product types</fr:title></fr:frontmatter><fr:mainmatter><html:p>We shall extend <fr:link href="/forest/dt-003M/" title="The language PCF" uri="https://liamoc.net/forest/dt-003M/" display-uri="dt-003M" type="local">the syntax of PCF</fr:link> with a new type former, <fr:tex display="inline"><![CDATA[\tau _1 \times  \tau _2]]></fr:tex> and three expression-level constructs for constructing and deconstructing pairs:
<fr:tex display="block"><![CDATA[
  \begin {array}{lcl}
     e & \Coloneqq  & \cdots  \mid  (e_1,e_2) \mid  \mathsf {fst}\ e \mid  \mathsf {snd}\ e \\
    \tau  & \Coloneqq  & \cdots  \mid  \tau _1 \times  \tau _2
   \end {array}
]]></fr:tex>
Adding to our <fr:link href="/forest/dt-003N/" title="Typing rules for PCF" uri="https://liamoc.net/forest/dt-003N/" display-uri="dt-003N" type="local">typing rules</fr:link> similarly:
<fr:tex display="block"><![CDATA[
  \dfrac {\Gamma  \vdash  e_1 : \tau _1 \quad  e_2 : \tau _2}{(e_1,e_2) : \tau _1 \times  \tau _2}\\[2em]
  \dfrac {\Gamma  \vdash  e : \tau _1 \times  \tau _2}{\Gamma  \vdash  \mathsf {fst}\ e : \tau _1}\quad 
  \dfrac {\Gamma  \vdash  e : \tau _1 \times  \tau _2}{\Gamma  \vdash  \mathsf {snd}\ e : \tau _2}
]]></fr:tex>
To extend our <fr:link href="/forest/dt-003P/" title="Semantics of PCF" uri="https://liamoc.net/forest/dt-003P/" display-uri="dt-003P" type="local">semantics</fr:link>, we make the product type <fr:tex display="inline"><![CDATA[\tau _1 \times  \tau _2]]></fr:tex> denote the <fr:link href="/forest/dt-0021/" title="Product of cpos" uri="https://liamoc.net/forest/dt-0021/" display-uri="dt-0021" type="local">product cpo</fr:link> <fr:tex display="inline"><![CDATA[\llbracket  \tau _1 \rrbracket  \times  \llbracket  \tau _2 \rrbracket ]]></fr:tex>, and our expression semantics are expressed straightforwardly using our <fr:link href="/forest/dt-0020/" title="Projection operators for products" uri="https://liamoc.net/forest/dt-0020/" display-uri="dt-0020" type="local">projection</fr:link> and <fr:link href="/forest/dt-0023/" title="The split function" uri="https://liamoc.net/forest/dt-0023/" display-uri="dt-0023" type="local">split</fr:link> operations for <fr:link href="/forest/dt-002K/" title="Products" uri="https://liamoc.net/forest/dt-002K/" display-uri="dt-002K" type="local">products</fr:link>:
<fr:tex display="block"><![CDATA[
  \begin {array}{lcl}
  \llbracket  (e_1, e_2) \rrbracket _\Gamma  &=& \langle  \llbracket  e_1 \rrbracket _\Gamma , \llbracket  e_2 \rrbracket _\Gamma  \rangle  \\
  \llbracket  \mathsf {fst}\ e \rrbracket _\Gamma  & = & \pi _0 \circ  \llbracket  e \rrbracket _\Gamma  \\
  \llbracket  \mathsf {snd}\ e \rrbracket _\Gamma  & = & \pi _1 \circ  \llbracket  e \rrbracket _\Gamma  \\
  \end {array}
]]></fr:tex></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-003S/</fr:uri><fr:display-uri>dt-003S</fr:display-uri><fr:route>/forest/dt-003S/</fr:route><fr:title text="Extending PCF with sum types">Extending <fr:link href="/forest/dt-003M/" title="The language PCF" uri="https://liamoc.net/forest/dt-003M/" display-uri="dt-003M" type="local">PCF</fr:link> with sum types</fr:title></fr:frontmatter><fr:mainmatter><html:p>We shall extend <fr:link href="/forest/dt-003M/" title="The language PCF" uri="https://liamoc.net/forest/dt-003M/" display-uri="dt-003M" type="local">the syntax of PCF</fr:link> with a new type former, <fr:tex display="inline"><![CDATA[\tau _1 + \tau _2]]></fr:tex> and three expression-level constructs for constructing and deconstructing sums:
<fr:tex display="block"><![CDATA[
  \begin {array}{lcl}
     e & \Coloneqq  & \cdots  \mid  \mathsf {inl}\ e \mid  \mathsf {inr}\ e \mid  \mathsf {case}\ e_0\ \mathsf {of}\ \mathsf {inl}\ x \rightarrow  e_1 ; \mathsf {inr}\ y \rightarrow  e_2 \\
    \tau  & \Coloneqq  & \cdots  \mid  \tau _1 + \tau _2
   \end {array}
]]></fr:tex>
Adding to our <fr:link href="/forest/dt-003N/" title="Typing rules for PCF" uri="https://liamoc.net/forest/dt-003N/" display-uri="dt-003N" type="local">typing rules</fr:link> similarly:
<fr:tex display="block"><![CDATA[
  \dfrac {\Gamma  \vdash  e : \tau _1}{\Gamma  \vdash  \mathsf {inl}\ e : \tau _1 + \tau _2}\quad 
  \dfrac {\Gamma  \vdash  e : \tau _2}{\Gamma  \vdash  \mathsf {inr}\ e : \tau _1 + \tau _2}\\[2em]
  \dfrac {\Gamma  \vdash  e_0 : \tau _1 + \tau _2 \quad  \Gamma , x : \tau _1 \vdash  e_1 : \tau  \quad  \Gamma , y : \tau _2 \vdash  e_2 : \tau }{ \Gamma  \vdash  \mathsf {case}\ e_0\ \mathsf {of}\ \mathsf {inl}\ x \rightarrow  e_1 ; \mathsf {inr}\ y \rightarrow  e_2 : \tau }
]]></fr:tex>
To extend our <fr:link href="/forest/dt-003P/" title="Semantics of PCF" uri="https://liamoc.net/forest/dt-003P/" display-uri="dt-003P" type="local">semantics</fr:link>, we make the sum type <fr:tex display="inline"><![CDATA[\tau _1 + \tau _2]]></fr:tex> denote the <fr:link href="/forest/dt-0031/" title="Sum of cpos" uri="https://liamoc.net/forest/dt-0031/" display-uri="dt-0031" type="local">sum cpo</fr:link> <fr:tex display="inline"><![CDATA[\llbracket  \tau _1 \rrbracket  + \llbracket  \tau _2 \rrbracket ]]></fr:tex>, and our expression semantics are expressed using our <fr:link href="/forest/dt-003D/" title="Primitive functions for sums" uri="https://liamoc.net/forest/dt-003D/" display-uri="dt-003D" type="local">primitive functions for sums</fr:link>.
<fr:tex display="block"><![CDATA[
  \begin {array}{lcl}
  \llbracket  \mathsf {inl}\ e \rrbracket _\Gamma  & = & \mathit {inl} \circ  \llbracket  e \rrbracket _\Gamma  \\
  \llbracket  \mathsf {inr}\ e \rrbracket _\Gamma  & = & \mathit {inr} \circ  \llbracket  e \rrbracket _\Gamma 
  \end {array}
]]></fr:tex>
<fr:tex display="block"><![CDATA[
  \begin {array}{l}\llbracket  \mathsf {case}\ e_0\ \mathsf {of}\ \mathsf {inl}\ x \rightarrow  e_1 ; \mathsf {inr}\ y \rightarrow  e_2  \rrbracket _\Gamma (\vec {z}) \\
  \quad  = 
  [ \boldsymbol {\lambda }v. \llbracket  e_1 \rrbracket _{\Gamma ,x:\tau _1}(\vec {z},v), \boldsymbol {\lambda }v. \llbracket  e_2 \rrbracket _{\Gamma ,y:\tau _2}(\vec {z},v)] (\llbracket  e_0 \rrbracket _\Gamma (\vec {z}))\end {array}
]]></fr:tex></html:p></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree>
<fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-004Z/</fr:uri><fr:display-uri>dt-004Z</fr:display-uri><fr:route>/forest/dt-004Z/</fr:route><fr:title text="Recursively defined domains and \lambda -calculus">Recursively defined domains and <fr:tex display="inline"><![CDATA[\lambda ]]></fr:tex>-calculus</fr:title><fr:taxon>Lecture</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>This lecture is based on material from <fr:link href="/forest/haskellhutt/" title="Graham Hutton" uri="https://liamoc.net/forest/haskellhutt/" display-uri="haskellhutt" type="local">Graham Hutton</fr:link>, <fr:link href="/forest/jlongley/" title="John Longley" uri="https://liamoc.net/forest/jlongley/" display-uri="jlongley" type="local">John Longley</fr:link>, <fr:link href="/forest/danascott/" title="Dana Scott" uri="https://liamoc.net/forest/danascott/" display-uri="danascott" type="local">Dana Scott</fr:link>, <fr:link href="/forest/jstoy/" title="Joseph Stoy" uri="https://liamoc.net/forest/jstoy/" display-uri="jstoy" type="local">Joseph Stoy</fr:link>, <fr:link href="/forest/cgunter/" title="Carl Gunter" uri="https://liamoc.net/forest/cgunter/" display-uri="cgunter" type="local">Carl Gunter</fr:link>, and <fr:link href="/forest/gwinskel/" title="Glynn Winskel" uri="https://liamoc.net/forest/gwinskel/" display-uri="gwinskel" type="local">Glynn Winskel</fr:link>.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-004J/</fr:uri><fr:display-uri>dt-004J</fr:display-uri><fr:route>/forest/dt-004J/</fr:route><fr:title text="Why we need recursively defined domains">Why we need recursively defined domains</fr:title></fr:frontmatter><fr:mainmatter><html:p> We saw recursive domain equations with higher-order procedures in <fr:link href="/forest/dt-0007/" title="Recursively defined semantic domains" uri="https://liamoc.net/forest/dt-0007/" display-uri="dt-0007" type="local">§ <fr:contextual-number uri="https://liamoc.net/forest/dt-0007/" display-uri="dt-0007" /></fr:link>, but there are numerous other examples where they come up. </html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-004L/</fr:uri><fr:display-uri>dt-004L</fr:display-uri><fr:route>/forest/dt-004L/</fr:route><fr:title text="Recursive algebraic data types">Recursive algebraic data types</fr:title></fr:frontmatter><fr:mainmatter><html:p>Suppose we have a language with recursive data types, such as this <fr:tex display="inline"><![CDATA[\mathit {List}]]></fr:tex> type in Haskell-style syntax:
<fr:tex display="block"><![CDATA[
\textbf {data}\ \mathit {List} = \mathsf {Nil} \mid  \mathsf {Cons}\ (\mathit {Int} \times  \mathit {List}) ]]></fr:tex>
As in <fr:link href="/forest/dt-003T/" title="PCF" uri="https://liamoc.net/forest/dt-003T/" display-uri="dt-003T" type="local">PCF</fr:link>, the denotation of a type <fr:tex display="inline"><![CDATA[\tau ]]></fr:tex> is the domain which contains all the denotations of all closed expressions of type <fr:tex display="inline"><![CDATA[\tau ]]></fr:tex>. What, then, is the domain that corresponds to <fr:tex display="inline"><![CDATA[\mathit {List}\ a]]></fr:tex>? We need a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> <fr:tex display="inline"><![CDATA[L]]></fr:tex> that satisfies the below equation (where <fr:tex display="inline"><![CDATA[\mathbf {1}]]></fr:tex> is the <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> containing just one element <fr:tex display="inline"><![CDATA[\bot ]]></fr:tex>):
<fr:tex display="block"><![CDATA[
L \simeq  \mathbf {1} + (\mathbb {Z}_\bot  \times  L)
]]></fr:tex></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-004M/</fr:uri><fr:display-uri>dt-004M</fr:display-uri><fr:route>/forest/dt-004M/</fr:route><fr:title text="Untyped higher-order languages">Untyped higher-order languages</fr:title></fr:frontmatter><fr:mainmatter><html:p>
	If we take <fr:link href="/forest/dt-003T/" title="PCF" uri="https://liamoc.net/forest/dt-003T/" display-uri="dt-003T" type="local">PCF</fr:link>, <html:em>discard</html:em> the type system, <fr:link href="/forest/dt-001Q/" title="The \textbf {fix} operator" uri="https://liamoc.net/forest/dt-001Q/" display-uri="dt-001Q" type="local"><fr:tex display="inline"><![CDATA[\textbf {fix}]]></fr:tex></fr:link>, natural number primitives and any other superfluous features, and just boil our language down to a minimal, Turing-complete subset, we end up with the <fr:link href="/forest/dt-004K/" title="Untyped \lambda -calculus" uri="https://liamoc.net/forest/dt-004K/" display-uri="dt-004K" type="local">untyped <fr:tex display="inline"><![CDATA[\lambda ]]></fr:tex>-calculus</fr:link> — a language consisting only of untyped functions.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-004K/</fr:uri><fr:display-uri>dt-004K</fr:display-uri><fr:route>/forest/dt-004K/</fr:route><fr:title text="Untyped \lambda -calculus">Untyped <fr:tex display="inline"><![CDATA[\lambda ]]></fr:tex>-calculus</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
	Untyped <fr:tex display="inline"><![CDATA[\lambda ]]></fr:tex>-calculus consists only of untyped (higher-order) functions:
	<fr:tex display="block"><![CDATA[
	e \; \Coloneqq  \; x \mid  \lambda  x. e \mid  e_1\ e_2
]]></fr:tex></html:p></fr:mainmatter></fr:tree><html:p>Trying to give a semantics to the <fr:link href="/forest/dt-004K/" title="Untyped \lambda -calculus" uri="https://liamoc.net/forest/dt-004K/" display-uri="dt-004K" type="local">untyped <fr:tex display="inline"><![CDATA[\lambda ]]></fr:tex> calculus</fr:link> poses an issue: we can no longer rely on the type of an expression to select an appropriate semantic domain. Instead, we we must pick a <html:em>single</html:em> domain <fr:tex display="inline"><![CDATA[D]]></fr:tex> which, since functions can be applied to themselves, must apparently include the set of functions <fr:tex display="inline"><![CDATA[D \twoheadrightarrow   D]]></fr:tex>:
<fr:tex display="block"><![CDATA[
D \simeq  D\twoheadrightarrow  D
]]></fr:tex></html:p></fr:mainmatter></fr:tree><html:p>How can we find solutions to such recursive equations? How can we guarantee the existence of a (least) solution?
</html:p><html:p>We can start by generalising <fr:link href="/forest/dt-001I/" title="Continuity and Fixed Points" uri="https://liamoc.net/forest/dt-001I/" display-uri="dt-001I" type="local">the fixed point approach</fr:link> we used for values (i.e. elements of <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link>) to domains (i.e. <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> themselves).</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-004N/</fr:uri><fr:display-uri>dt-004N</fr:display-uri><fr:route>/forest/dt-004N/</fr:route><fr:title text="Recursive domain equations as endofunctors">Recursive domain equations as endofunctors</fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>This recursive equation for lists:
<fr:tex display="block"><![CDATA[
L \simeq  \mathbf {1} + (\mathbb {Z}_\bot  \times  L)
]]></fr:tex>
Can be expressed as the least fixed point of this mapping (specifically an <fr:link href="/forest/dt-004T/" title="Endofunctors on \textbf {Cpo}" uri="https://liamoc.net/forest/dt-004T/" display-uri="dt-004T" type="local">endofunctor</fr:link>) <fr:tex display="inline"><![CDATA[\mathcal {F}]]></fr:tex> on <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link>:
<fr:tex display="block"><![CDATA[
\mathcal {F}(A) \triangleq  \mathbf {1} + (\mathbb {Z}_\bot  \times  A)
]]></fr:tex></html:p></fr:mainmatter></fr:tree><html:p>
To ensure that least fixed points exist, and to give us a means of finding them, we must now generalise all of the concepts we used  for least fixed points on values (<fr:link href="/forest/dt-000B/" title="Information ordering" uri="https://liamoc.net/forest/dt-000B/" display-uri="dt-000B" type="local">information ordering</fr:link>, <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">least upper bounds</fr:link>, <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuity</fr:link> etc.) to domains themselves.
</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-004O/</fr:uri><fr:display-uri>dt-004O</fr:display-uri><fr:route>/forest/dt-004O/</fr:route><fr:title text="From a cpo to the category \mathbf {Cpo}">From a cpo to the <fr:link href="/forest/dt-002B/" title="The category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-002B/" display-uri="dt-002B" type="local">category <fr:tex display="inline"><![CDATA[\mathbf {Cpo}]]></fr:tex></fr:link></fr:title></fr:frontmatter><fr:mainmatter>


<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Problem</fr:taxon></fr:frontmatter><fr:mainmatter>
	<html:p>The following definitions are <html:strong>insufficient</html:strong> when using <fr:link href="/forest/dt-002L/" title="The cpo of functions" uri="https://liamoc.net/forest/dt-002L/" display-uri="dt-002L" type="local">function</fr:link> constructions in our domain equations (<fr:tex display="inline"><![CDATA[\twoheadrightarrow ]]></fr:tex> and <fr:tex display="inline"><![CDATA[\mathbin {\circ \hspace{-0.4em}\twoheadrightarrow }]]></fr:tex>), but it will suffice for our purposes for now.</html:p>
</fr:mainmatter></fr:tree><html:p>Let us say (for now) that a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> <fr:tex display="inline"><![CDATA[A]]></fr:tex> <html:em>approximates</html:em> a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> <fr:tex display="inline"><![CDATA[B]]></fr:tex> (i.e. <fr:tex display="inline"><![CDATA[A \sqsubseteq  B]]></fr:tex>) iff there is a <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous function</fr:link> <fr:tex display="inline"><![CDATA[f : A\twoheadrightarrow  B]]></fr:tex>. Then, there is a least element for this ordering: the one-element <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> <fr:tex display="inline"><![CDATA[\mathbf {1} = \{ \bot  \}]]></fr:tex>, as the <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous function</fr:link> <fr:tex display="inline"><![CDATA[(\lambda  x. \bot ) : \mathbf {1} \twoheadrightarrow  A]]></fr:tex> exists for any <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> <fr:tex display="inline"><![CDATA[A]]></fr:tex>.</html:p>


<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:title text="Initiality">Initiality</fr:title><fr:taxon>Categorical Aside</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>The <fr:link href="/forest/dt-002B/" title="The category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-002B/" display-uri="dt-002B" type="local">category <fr:tex display="inline"><![CDATA[\mathbf {Cpo}]]></fr:tex></fr:link> has no initial object. The <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> <fr:tex display="inline"><![CDATA[\mathbf {1}]]></fr:tex> is terminal; but also serves as a "pseudo" initial object due to the above.</html:p></fr:mainmatter></fr:tree>
<fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-004P/</fr:uri><fr:display-uri>dt-004P</fr:display-uri><fr:route>/forest/dt-004P/</fr:route><fr:title text="Colimits in the category \mathbf {Cpo}">Colimits in the <fr:link href="/forest/dt-002B/" title="The category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-002B/" display-uri="dt-002B" type="local">category <fr:tex display="inline"><![CDATA[\mathbf {Cpo}]]></fr:tex></fr:link></fr:title></fr:frontmatter><fr:mainmatter><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-004Q/</fr:uri><fr:display-uri>dt-004Q</fr:display-uri><fr:route>/forest/dt-004Q/</fr:route><fr:title text="\omega -chains of cpos in the category \mathbf {Cpo}"><fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-chains of cpos in the category <fr:tex display="inline"><![CDATA[\mathbf {Cpo}]]></fr:tex></fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>An <fr:link href="/forest/dt-000W/" title="\omega -chain" uri="https://liamoc.net/forest/dt-000W/" display-uri="dt-000W" type="local"><fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-chain</fr:link> of <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> in the <fr:link href="/forest/dt-002B/" title="The category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-002B/" display-uri="dt-002B" type="local">category <fr:tex display="inline"><![CDATA[\mathbf {Cpo}]]></fr:tex></fr:link> consists of a family of <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> <fr:tex display="inline"><![CDATA[\{A_i \mid  i \in  \mathbb {N} \}]]></fr:tex>, together with a family of <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous functions</fr:link> <fr:tex display="inline"><![CDATA[\{ f_i : A_i\twoheadrightarrow  A_{i+1} \mid  i \in  \mathbb {N}\}]]></fr:tex>, shown below:</html:p><html:figure><fr:resource hash="78a899ab99955f86fb9f60d5e97fec73"><fr:resource-content><html:img src="/forest/78a899ab99955f86fb9f60d5e97fec73.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz-cd}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	A_0 \ar [r,thick,"f_0"'] & A_1 \ar [r,thick,"f_1"'] & A_2 \ar [r,thick,"f_2"'] & A_3 \ar [r,thick,-,dotted] & \quad 
\end {tikzcd}	
]]></fr:resource-source></fr:resource></html:figure></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors /><fr:uri>https://liamoc.net/forest/dt-004R/</fr:uri><fr:display-uri>dt-004R</fr:display-uri><fr:route>/forest/dt-004R/</fr:route><fr:title text="Upper bounds in the category \mathbf {Cpo}">Upper bounds in the category <fr:tex display="inline"><![CDATA[\mathbf {Cpo}]]></fr:tex></fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>A <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> <fr:tex display="inline"><![CDATA[A]]></fr:tex> is an <fr:link href="/forest/dm-000C/" title="Upper bound" uri="https://liamoc.net/forest/dm-000C/" display-uri="dm-000C" type="local">upper bound</fr:link> of an <fr:link href="/forest/dt-004Q/" title="\omega -chains of cpos in the category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-004Q/" display-uri="dt-004Q" type="local"><fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-chain of cpos</fr:link>  in <fr:link href="/forest/dt-002B/" title="The category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-002B/" display-uri="dt-002B" type="local">the category <fr:tex display="inline"><![CDATA[\mathbf {Cpo}]]></fr:tex></fr:link> if there is a family of <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous functions</fr:link> <fr:tex display="inline"><![CDATA[\{g_i : A_i \twoheadrightarrow  A \mid  i \in  \mathbb {N}\}]]></fr:tex> such that the following diagram commutes (i.e. <fr:tex display="inline"><![CDATA[g_i = g_{i+1} \circ  f_i]]></fr:tex> for all <fr:tex display="inline"><![CDATA[i \in  \mathbb {N}]]></fr:tex>):</html:p><html:figure><fr:resource hash="ff68cfcf28f0fb6477a302a7995eec1b"><fr:resource-content><html:img src="/forest/ff68cfcf28f0fb6477a302a7995eec1b.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz-cd}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
& & & A & \\
& & & & \cdots \\
	A_0 \ar [r,thick,"f_0"'] \ar [uurrr,"g_0"near start] & A_1 \ar [r,thick,"f_1"']\ar [uurr,"g_1"near start] & A_2 \ar [r,thick,"f_2"'] \ar [uur,"g_2"near start]  & A_3 \ar [uu,"g_3"near start] \ar [r,thick,-,dotted] & \quad 
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-004S/</fr:uri><fr:display-uri>dt-004S</fr:display-uri><fr:route>/forest/dt-004S/</fr:route><fr:title text="Least upper bounds in the category \mathbf {Cpo}">Least upper bounds in the category <fr:tex display="inline"><![CDATA[\mathbf {Cpo}]]></fr:tex></fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>A <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> <fr:tex display="inline"><![CDATA[A]]></fr:tex> is the <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local"><html:em>least</html:em> upper bound</fr:link> of an <fr:link href="/forest/dt-004Q/" title="\omega -chains of cpos in the category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-004Q/" display-uri="dt-004Q" type="local"><fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-chain of cpos</fr:link> if is both an <fr:link href="/forest/dt-004R/" title="Upper bounds in the category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-004R/" display-uri="dt-004R" type="local">upper bound</fr:link> and if there exists a <html:em>unique</html:em> <fr:tex display="inline"><![CDATA[k]]></fr:tex> for any other <fr:link href="/forest/dt-004R/" title="Upper bounds in the category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-004R/" display-uri="dt-004R" type="local">upper bound</fr:link> <fr:tex display="inline"><![CDATA[B]]></fr:tex> such that the following diagram commutes (i.e. <fr:tex display="inline"><![CDATA[h_i = k \circ  g_i]]></fr:tex> for all <fr:tex display="inline"><![CDATA[i \in  \mathbb {N}]]></fr:tex>):</html:p><html:figure><fr:resource hash="81f2ace2fc98e6ede0a2aef1331dd458"><fr:resource-content><html:img src="/forest/81f2ace2fc98e6ede0a2aef1331dd458.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz-cd}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
& & & B & \\
& & & & \cdots \\
& & & A \ar [uu,thick,dashed,"k"] & \\
& & & & \cdots \\
	A_0 \ar [r,thick,"f_0"'] \ar [uuuurrr,"h_0", bend left] \ar [uurrr,"g_0"near start] & A_1 \ar [r,thick,"f_1"']\ar [uurr,"g_1"near start]\ar [uuuurr,"h_1", bend left] & A_2 \ar [r,thick,"f_2"'] \ar [uur,"g_2"near start] \ar [uuuur,"h_2", bend left]  & A_3 \ar [uu,"g_3"near start] \ar [r,thick,-,dotted] \ar [uuuu,"h_3", bend left=3.5em]  & \quad 
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure><html:p>The least upper bound of such an <fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-chain is also called its <html:em>colimit</html:em>.</html:p><html:p><html:strong>Note</html:strong>: Uniqueness of lubs is up to isomorphism. That is, if <fr:tex display="inline"><![CDATA[A]]></fr:tex> and <fr:tex display="inline"><![CDATA[B]]></fr:tex> are both colimits of our <fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-chain, then <fr:tex display="inline"><![CDATA[A \simeq  B]]></fr:tex>.</html:p></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-004T/</fr:uri><fr:display-uri>dt-004T</fr:display-uri><fr:route>/forest/dt-004T/</fr:route><fr:title text="Endofunctors on \textbf {Cpo}">Endofunctors on <fr:tex display="inline"><![CDATA[\textbf {Cpo}]]></fr:tex></fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>An <html:em>endofunctor</html:em> on <fr:link href="/forest/dt-002B/" title="The category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-002B/" display-uri="dt-002B" type="local">the category <fr:tex display="inline"><![CDATA[\textbf {Cpo}]]></fr:tex></fr:link> is a <fr:link href="/forest/dm-000J/" title="Functor" uri="https://liamoc.net/forest/dm-000J/" display-uri="dm-000J" type="local">functor</fr:link> <fr:tex display="inline"><![CDATA[\textbf {Cpo} \rightarrow  \textbf {Cpo}]]></fr:tex>, i.e. a mapping <fr:tex display="inline"><![CDATA[\mathcal {F}]]></fr:tex> on <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> together with a mapping <fr:tex display="inline"><![CDATA[\mathcal {F}]]></fr:tex> on <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous functions</fr:link>, such that:</html:p><html:ol><html:li>If <fr:tex display="inline"><![CDATA[f : A \twoheadrightarrow  B]]></fr:tex> then <fr:tex display="inline"><![CDATA[\mathcal {F}(f) : \mathcal {F}(A)\twoheadrightarrow  \mathcal {F}(B)]]></fr:tex></html:li>
<html:li><fr:tex display="inline"><![CDATA[\mathcal {F}(\mathsf {id}_A : A\twoheadrightarrow  A) = \mathsf {id}_{\mathcal {F}(A)} : \mathcal {F}(A)\twoheadrightarrow  \mathcal {F}(A)]]></fr:tex></html:li>
<html:li><fr:tex display="inline"><![CDATA[\mathcal {F}(f \circ  g) = \mathcal {F}(f) \circ  \mathcal {F}(g)]]></fr:tex></html:li></html:ol></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-004U/</fr:uri><fr:display-uri>dt-004U</fr:display-uri><fr:route>/forest/dt-004U/</fr:route><fr:taxon>Remark</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
Observe that, given the <fr:link href="/forest/dt-004O/" title="From a cpo to the category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-004O/" display-uri="dt-004O" type="local">information ordering for cpos</fr:link> where <fr:tex display="inline"><![CDATA[A \sqsubseteq  B]]></fr:tex> if there exists a continuous function <fr:tex display="inline"><![CDATA[A \twoheadrightarrow  B]]></fr:tex>, the <fr:link href="/forest/dm-000J/" title="Functor" uri="https://liamoc.net/forest/dm-000J/" display-uri="dm-000J" type="local">functor</fr:link> laws necessarily imply <fr:link href="/forest/dt-000J/" title="Monotonicity" uri="https://liamoc.net/forest/dt-000J/" display-uri="dt-000J" type="local">monotonicity</fr:link> for all <fr:link href="/forest/dt-004T/" title="Endofunctors on \textbf {Cpo}" uri="https://liamoc.net/forest/dt-004T/" display-uri="dt-004T" type="local">endofunctors</fr:link> <fr:tex display="inline"><![CDATA[\mathcal {F}]]></fr:tex>.
</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors /><fr:uri>https://liamoc.net/forest/dt-004V/</fr:uri><fr:display-uri>dt-004V</fr:display-uri><fr:route>/forest/dt-004V/</fr:route><fr:title text="Cocontinuous endofunctors">Cocontinuous endofunctors</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>An <fr:link href="/forest/dt-004T/" title="Endofunctors on \textbf {Cpo}" uri="https://liamoc.net/forest/dt-004T/" display-uri="dt-004T" type="local">endofunctor</fr:link> <fr:tex display="inline"><![CDATA[\mathcal {F}]]></fr:tex> is <html:em>cocontinuous</html:em> iff it preserves <fr:link href="/forest/dt-004S/" title="Least upper bounds in the category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-004S/" display-uri="dt-004S" type="local">colimits</fr:link> of <fr:link href="/forest/dt-004Q/" title="\omega -chains of cpos in the category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-004Q/" display-uri="dt-004Q" type="local"><fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-chains of cpos</fr:link>. That is, given a <fr:link href="/forest/dt-004Q/" title="\omega -chains of cpos in the category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-004Q/" display-uri="dt-004Q" type="local">chain</fr:link> where <fr:tex display="inline"><![CDATA[A]]></fr:tex> is a <fr:link href="/forest/dt-004S/" title="Least upper bounds in the category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-004S/" display-uri="dt-004S" type="local">colimit</fr:link>:
<html:figure><fr:resource hash="ff68cfcf28f0fb6477a302a7995eec1b"><fr:resource-content><html:img src="/forest/ff68cfcf28f0fb6477a302a7995eec1b.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz-cd}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
& & & A & \\
& & & & \cdots \\
	A_0 \ar [r,thick,"f_0"'] \ar [uurrr,"g_0"near start] & A_1 \ar [r,thick,"f_1"']\ar [uurr,"g_1"near start] & A_2 \ar [r,thick,"f_2"'] \ar [uur,"g_2"near start]  & A_3 \ar [uu,"g_3"near start] \ar [r,thick,-,dotted] & \quad 
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>
Then <fr:tex display="inline"><![CDATA[\mathcal {F}(A)]]></fr:tex> is a <fr:link href="/forest/dt-004S/" title="Least upper bounds in the category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-004S/" display-uri="dt-004S" type="local">colimit</fr:link> for the following <fr:link href="/forest/dt-004Q/" title="\omega -chains of cpos in the category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-004Q/" display-uri="dt-004Q" type="local">chain</fr:link>:
<html:figure><fr:resource hash="fed3f4f14bfe86896eb58565f2e66572"><fr:resource-content><html:img src="/forest/fed3f4f14bfe86896eb58565f2e66572.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz-cd}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}[row sep=3.6em]
& & & \mathcal {F}(A) & \\
& & & & \cdots \\
	\mathcal {F}(A_0) \ar [r,thick,"\mathcal {F}(f_0)"',->] \ar [uurrr,"\mathcal {F}(g_0)"near start] & \mathcal {F}(A_1) \ar [r,thick,"\mathcal {F}(f_1)"',->]\ar [uurr,"\mathcal {F}(g_1)"near start] & \mathcal {F}(A_2) \ar [r,thick,"\mathcal {F}(f_2)"',->] \ar [uur,"\mathcal {F}(g_2)"near start]  & \mathcal {F}(A_3) \ar [uu,"\mathcal {F}(g_3)"near start] \ar [r,thick,-,dotted] & \quad 
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-004W/</fr:uri><fr:display-uri>dt-004W</fr:display-uri><fr:route>/forest/dt-004W/</fr:route><fr:title text="Fixed points of endofunctors on \mathbf {Cpo}">Fixed points of <fr:link href="/forest/dt-004T/" title="Endofunctors on \textbf {Cpo}" uri="https://liamoc.net/forest/dt-004T/" display-uri="dt-004T" type="local">endofunctors on <fr:tex display="inline"><![CDATA[\mathbf {Cpo}]]></fr:tex></fr:link></fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>A <fr:link href="/forest/dt-000S/" title="Fixed point" uri="https://liamoc.net/forest/dt-000S/" display-uri="dt-000S" type="local">fixed point</fr:link> of an <fr:link href="/forest/dt-004T/" title="Endofunctors on \textbf {Cpo}" uri="https://liamoc.net/forest/dt-004T/" display-uri="dt-004T" type="local">endofunctor on cpos</fr:link> <fr:tex display="inline"><![CDATA[\mathcal {F}]]></fr:tex> is a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> <fr:tex display="inline"><![CDATA[\mathcal {F}]]></fr:tex> such that <fr:tex display="inline"><![CDATA[\mathcal {F}(A) \simeq  A]]></fr:tex>. </html:p>


<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Note</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>In Scott's approach, which we follow here, our fixed points are up to <fr:link href="/forest/dt-002E/" title="Cpo isomorphism" uri="https://liamoc.net/forest/dt-002E/" display-uri="dt-002E" type="local">isomorphism</fr:link> (suitable for languages with <html:em>isorecursive</html:em> types), but there are other approaches where they are equalities (suitable for languages with <html:em>equirecursive</html:em> types).
</html:p></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-004X/</fr:uri><fr:display-uri>dt-004X</fr:display-uri><fr:route>/forest/dt-004X/</fr:route><fr:title text="Fixed point theorem for endofunctors on \mathbf {Cpo}">Fixed point theorem for endofunctors on <fr:tex display="inline"><![CDATA[\mathbf {Cpo}]]></fr:tex></fr:title><fr:taxon>Theorem</fr:taxon></fr:frontmatter><fr:mainmatter><html:p> Every <fr:link href="/forest/dt-004V/" title="Cocontinuous endofunctors" uri="https://liamoc.net/forest/dt-004V/" display-uri="dt-004V" type="local">cocontinuous endofunctor</fr:link> <fr:tex display="inline"><![CDATA[\mathcal {F}]]></fr:tex> on <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> has a <fr:link href="/forest/dt-004W/" title="Fixed points of endofunctors on \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-004W/" display-uri="dt-004W" type="local">least fixed point</fr:link>, given by the <fr:link href="/forest/dt-004S/" title="Least upper bounds in the category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-004S/" display-uri="dt-004S" type="local">colimit</fr:link> of the <fr:link href="/forest/dt-004Q/" title="\omega -chains of cpos in the category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-004Q/" display-uri="dt-004Q" type="local"><fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-chain</fr:link>:</html:p><html:figure><fr:resource hash="6691a4b0973ac84c6fb2d0f3bf33e8f9"><fr:resource-content><html:img src="/forest/6691a4b0973ac84c6fb2d0f3bf33e8f9.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz-cd}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[\begin {tikzcd}[column sep=5.2em]
	\mathbf {1} \ar [r,"\lambda  x.\bot "] & 
	\mathcal {F}(\mathbf {1}) \ar [r,"\mathcal {F}(\lambda  x.\bot )"] & 
	\mathcal {F}(\mathcal {F}(\mathbf {1})) \ar [r,"\mathcal {F}(\mathcal {F}(\lambda  x.\bot ))"] & 
		\mathcal {F}(\mathcal {F}(\mathcal {F}(\mathbf {1}))) \ar [r,thick,-,dotted] & \quad 
\end {tikzcd}	
]]></fr:resource-source></fr:resource></html:figure></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-004Y/</fr:uri><fr:display-uri>dt-004Y</fr:display-uri><fr:route>/forest/dt-004Y/</fr:route><fr:title text="Binary Numbers">Binary Numbers</fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
Consider the Haskell-style data type:
<fr:tex display="block"><![CDATA[
\textbf {data}\ \mathit {Bin} = \mathsf {Zero}\ \mathit {Bin} \mid  \mathsf {Empty} \mid  \mathsf {One}\ \mathit {Bin}
]]></fr:tex>
So, e.g. <fr:tex display="inline"><![CDATA[\mathsf {One}\ (\mathsf {Zero}\ (\mathsf {One}\ \mathsf {Empty})) : \mathit {Bin}]]></fr:tex>.</html:p><html:p> The recursive domain equation is, expressed as a fixed point:
<fr:tex display="block"><![CDATA[
B \simeq  \mathcal {F}(B)\quad \text {where}\ \mathcal {F}(X) = X + \mathbf {1} + X
]]></fr:tex>
We wish to show that <fr:tex display="inline"><![CDATA[\mathcal {F}]]></fr:tex> is a <fr:link href="/forest/dt-004V/" title="Cocontinuous endofunctors" uri="https://liamoc.net/forest/dt-004V/" display-uri="dt-004V" type="local">cocontinuous endofunctor</fr:link>.</html:p><html:p>We have a mapping <fr:tex display="inline"><![CDATA[\mathcal {F}]]></fr:tex> on <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> (objects of <fr:link href="/forest/dt-002B/" title="The category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-002B/" display-uri="dt-002B" type="local">the category <fr:tex display="inline"><![CDATA[\textbf {Cpo}]]></fr:tex></fr:link>), but for it to be a <fr:link href="/forest/dm-000J/" title="Functor" uri="https://liamoc.net/forest/dm-000J/" display-uri="dm-000J" type="local">functor</fr:link> we additionally need a mapping <fr:tex display="inline"><![CDATA[\mathcal {F}]]></fr:tex> on <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous functions</fr:link> (morphisms of <fr:link href="/forest/dt-002B/" title="The category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-002B/" display-uri="dt-002B" type="local">the category <fr:tex display="inline"><![CDATA[\textbf {Cpo}]]></fr:tex></fr:link>). </html:p><html:p>Recalling <fr:link href="/forest/dt-0031/" title="Sum of cpos" uri="https://liamoc.net/forest/dt-0031/" display-uri="dt-0031" type="local">our sum construction</fr:link>, we may remember that sums are already a <fr:link href="/forest/dm-000M/" title="Bifunctor" uri="https://liamoc.net/forest/dm-000M/" display-uri="dm-000M" type="local">bifunctor</fr:link> <fr:tex display="inline"><![CDATA[\textbf {Cpo} \times  \textbf {Cpo} \rightarrow  \textbf {Cpo}]]></fr:tex> (<fr:link href="/forest/dt-0038/" title="https://liamoc.net/forest/dt-0038/" uri="https://liamoc.net/forest/dt-0038/" display-uri="dt-0038" type="local">Theorem <fr:contextual-number uri="https://liamoc.net/forest/dt-0038/" display-uri="dt-0038" /></fr:link>). Thus, our mapping on <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous functions</fr:link> <fr:tex display="inline"><![CDATA[\mathcal {F}]]></fr:tex> can be <html:em>derived</html:em> from our mapping on <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> <fr:tex display="inline"><![CDATA[\mathcal {F}]]></fr:tex> by using the morphism mapping from the sum construction (<fr:link href="/forest/dt-0037/" title="Sum of functions" uri="https://liamoc.net/forest/dt-0037/" display-uri="dt-0037" type="local">Definition <fr:contextual-number uri="https://liamoc.net/forest/dt-0037/" display-uri="dt-0037" /></fr:link>). Given a continuous function <fr:tex display="inline"><![CDATA[f : A \twoheadrightarrow  B]]></fr:tex>, our morphism mapping is:</html:p><fr:tex display="block"><![CDATA[
\begin {array}{l}
\mathcal {F}(f) : \mathcal {F}(A)\twoheadrightarrow  \mathcal {F}(B)\\	
\mathcal {F}(f) \triangleq  f + \mathsf {id}_\textbf {1} + f
\end {array}
]]></fr:tex><html:p>Proof that this <fr:link href="/forest/dt-004T/" title="Endofunctors on \textbf {Cpo}" uri="https://liamoc.net/forest/dt-004T/" display-uri="dt-004T" type="local">endofunctor</fr:link> is <fr:link href="/forest/dt-004V/" title="Cocontinuous endofunctors" uri="https://liamoc.net/forest/dt-004V/" display-uri="dt-004V" type="local">cocontinuous</fr:link> is left for the reader. Hence the semantics of the type <fr:tex display="inline"><![CDATA[\mathit {Bin}]]></fr:tex>, i.e. <fr:tex display="inline"><![CDATA[\llbracket  \mathit {Bin} \rrbracket  : \textbf {Cpo}]]></fr:tex> is the least fixed point of <fr:tex display="inline"><![CDATA[\mathcal {F}]]></fr:tex>, i.e. the <fr:link href="/forest/dt-004S/" title="Least upper bounds in the category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-004S/" display-uri="dt-004S" type="local">colimit</fr:link> of the <fr:link href="/forest/dt-004Q/" title="\omega -chains of cpos in the category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-004Q/" display-uri="dt-004Q" type="local"><fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-chain</fr:link>:</html:p><html:figure><fr:resource hash="e36a1490f739ed86d1cfb9dbc04f7c52"><fr:resource-content><html:img src="/forest/e36a1490f739ed86d1cfb9dbc04f7c52.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz-cd}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}[column sep=5.2em]
	\mathbf {1} \ar [r,"\lambda  x.\bot "] & 
	\mathcal {F}(\mathbf {1}) \ar [r,"\mathcal {F}(\lambda  x.\bot )"] & 
	\mathcal {F}(\mathcal {F}(\mathbf {1})) \ar [r,"\mathcal {F}(\mathcal {F}(\lambda  x.\bot ))"] & 
		\mathcal {F}(\mathcal {F}(\mathcal {F}(\mathbf {1}))) \ar [r,thick,-,dotted] & \quad 
\end {tikzcd}	
]]></fr:resource-source></fr:resource></html:figure><html:p>Let us visualise this chain. Here the sum injections have been written as <fr:tex display="inline"><![CDATA[\textsf {Z, E, O}]]></fr:tex> rather than (combinations of) <fr:tex display="inline"><![CDATA[\textsf {inl}]]></fr:tex> and <fr:tex display="inline"><![CDATA[\textsf {inr}]]></fr:tex> to keep the connection with the Haskell data type clear. </html:p><html:figure><fr:resource hash="58530ca2482c6afbac010346191a18b5"><fr:resource-content><html:img src="/forest/58530ca2482c6afbac010346191a18b5.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzpicture}
	\node [draw, fill=white, rounded corners] (b1) at (0,0) {$\bot $};
	\draw [->,ultra thick,dotted] (6,1.5) -- (10.5,1.5);	
	\draw [fill=white!95!black, rounded corners=2em] (6,-1) -- (10,3.5) -- (2,3.5) -- cycle;	
	\draw [fill=white!97!black, rounded corners=2em,dashed] (6,-0.8) -- (8.1,1.5) -- (3.9,1.5) -- cycle;
	\draw [->,ultra thick] (2,0.5) -- (4.8,0.5);
	\draw [fill=white!97!black, rounded corners=2em] (2,-0.8) -- (3.8,1.5) -- (0.2,1.5) -- cycle;
	\node [draw, fill=white, dashed, rounded corners] (b2) at (2,0) {$\bot $};	
	\draw [->,ultra thick] (b1) -- (b2);
	\node  (a1) at (1.2,1) {$\mathsf {Z}(\bot )$};
	\node  (a2) at (2,1.04) {$\mathsf {E}$};	
	\node  (a3) at (2.8,1) {$\mathsf {O}(\bot )$};		
	\draw [-] (b2) -- (a2);
		\draw [-] (b2) -- (a3);
		\draw [-] (b2) -- (a1);	
	\node  (b2) at (6,0) {$\bot $};
	\node  (a1) at (5,1) {$\mathsf {Z}(\bot )$};
	\node  (a2) at (6,1.04) {$\mathsf {E}$};	
	\node  (a3) at (7,1) {$\mathsf {O}(\bot )$};
	\draw [-] (b2) -- (a2);
		\draw [-] (b2) -- (a3);
		\draw [-] (b2) -- (a1);
	\node  (c1) at (3.3,3) {\footnotesize  $\mathsf {Z}(\mathsf {Z}(\bot ))$};
	\node  (c2) at (4.3,3) {\footnotesize  $\mathsf {Z}(\mathsf {E})$};	
	\node  (c3) at (5.3,3) {\footnotesize  $\mathsf {Z}(\mathsf {O}(\bot ))$};
	\draw [-] (a1) -- (c2);
		\draw [-] (a1) -- (c3);
		\draw [-] (a1) -- (c1);
	\node  (c1) at (6.7,3) {\footnotesize  $\mathsf {O}(\mathsf {Z}(\bot ))$};
	\node  (c2) at (7.7,3) {\footnotesize  $\mathsf {O}(\mathsf {E})$};	
	\node  (c3) at (8.7,3) {\footnotesize  $\mathsf {O}(\mathsf {O}(\bot ))$};		\draw [-] (a3) -- (c2);
		\draw [-] (a3) -- (c3);
		\draw [-] (a3) -- (c1);
\end {tikzpicture}
]]></fr:resource-source></fr:resource></html:figure><html:p>Thus, the <fr:tex display="inline"><![CDATA[n]]></fr:tex>th cpo in the chain contains binary numbers with at most <fr:tex display="inline"><![CDATA[n]]></fr:tex> defined digits. The <fr:link href="/forest/dt-004S/" title="Least upper bounds in the category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-004S/" display-uri="dt-004S" type="local">colimit</fr:link> of the chain contains all binary numbers (finite, partial, and infinite!).
</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-005M/</fr:uri><fr:display-uri>dt-005M</fr:display-uri><fr:route>/forest/dt-005M/</fr:route><fr:taxon>Exercise</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
Show that <fr:tex display="inline"><![CDATA[\mathcal {F}(X) \triangleq  \mathbf {1} + X]]></fr:tex> and <fr:tex display="inline"><![CDATA[\mathcal {F}(f) \triangleq  \mathsf {id}_\mathbf {1} + f]]></fr:tex> (using our <fr:link href="/forest/dt-0037/" title="Sum of functions" uri="https://liamoc.net/forest/dt-0037/" display-uri="dt-0037" type="local"><fr:tex display="inline"><![CDATA[+]]></fr:tex> operator for functions</fr:link>) define an <fr:link href="/forest/dt-004T/" title="Endofunctors on \textbf {Cpo}" uri="https://liamoc.net/forest/dt-004T/" display-uri="dt-004T" type="local">endofunctor</fr:link> <fr:tex display="inline"><![CDATA[\mathbf {Cpo} \rightarrow  \mathbf {Cpo}]]></fr:tex>, i.e. that they satisfy the functor laws.</html:p>



<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>
<html:ol><html:li>
		We must show <fr:tex display="inline"><![CDATA[\mathcal {F}(\mathsf {id}_A : A \twoheadrightarrow  A) = \mathsf {id}_{\mathcal {F}(A)} : \mathcal {F}(A) \twoheadrightarrow  \mathcal {F}(A)]]></fr:tex>. 
		<fr:tex display="block"><![CDATA[\begin {array}{lcl}
		\mathcal {F}(\mathsf {id}_A)& =& \mathsf {id}_\mathbf {1} + \mathsf {id}_A\\
		                           &=& \mathsf {id}_{\mathbf {1} + A}\\
								   &=& \mathsf {id}_{\mathcal {F}(A)}
								  \end {array}]]></fr:tex></html:li>
	<html:li>
		We must show <fr:tex display="inline"><![CDATA[\mathcal {F}(f \circ  g) = \mathcal {F}(f) \circ  \mathcal {F}(g)]]></fr:tex>.
		<fr:tex display="block"><![CDATA[\begin {array}{lcl}
	\mathcal {F}(f \circ  g) &=& \mathsf {id}_\mathbf {1} + (f \circ  g) \\
	                        &=& (\mathsf {id}_\mathbf {1} + f) \circ  (\mathsf {id}_\mathbf {1} + g) \\
							& = & \mathcal {F}(f) \circ  \mathcal {F}(g)
								  \end {array}]]></fr:tex></html:li></html:ol>
</fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0050/</fr:uri><fr:display-uri>dt-0050</fr:display-uri><fr:route>/forest/dt-0050/</fr:route><fr:title text="Constructing endofunctors">Constructing endofunctors</fr:title></fr:frontmatter><fr:mainmatter><html:p>If we have a mapping on <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> <fr:tex display="inline"><![CDATA[\mathcal {F} : \textbf {Cpo} \rightarrow  \textbf {Cpo}]]></fr:tex> that is made up of the primitives <fr:tex display="inline"><![CDATA[\times ]]></fr:tex>, <fr:tex display="inline"><![CDATA[+]]></fr:tex>, <fr:tex display="inline"><![CDATA[\otimes ]]></fr:tex>, <fr:tex display="inline"><![CDATA[\oplus ]]></fr:tex>, <fr:tex display="inline"><![CDATA[\mathbf {1}]]></fr:tex> and <fr:tex display="inline"><![CDATA[(\cdot )_\bot ]]></fr:tex>, we can generate a corresponding <html:em>morphism mapping</html:em> on continuous functions <fr:tex display="inline"><![CDATA[\mathcal {F} : (A\twoheadrightarrow  B) \rightarrow  (\mathcal {F}(A)\twoheadrightarrow  \mathcal {F}(B))]]></fr:tex> by using the corresponding morphism mappings of each of these operators. Thus any such mapping can be turned into an <fr:link href="/forest/dt-004T/" title="Endofunctors on \textbf {Cpo}" uri="https://liamoc.net/forest/dt-004T/" display-uri="dt-004T" type="local">endofunctor</fr:link>.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0051/</fr:uri><fr:display-uri>dt-0051</fr:display-uri><fr:route>/forest/dt-0051/</fr:route><fr:title text="Making endofunctors for algebraic data types">Making endofunctors for algebraic data types</fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter><html:p><fr:tex display="block"><![CDATA[
  \begin {array}{llr}
    \textsf {Object mapping} & \textsf {Morphism mapping}\\[0.2em]
    \mathcal {F}(X) = X + \mathbf {1} &  \mathcal {F}(f) = f + \mathsf {id}_\mathbf {1} & \quad \quad \text {((co)-natural numbers)} \\
    \mathcal {F}(X) = \mathbf {1} + (\mathbb {Z}_\bot  \times  X) & \mathcal {F}(f) = \mathsf {id}_\mathbf {1} + (\mathsf {id}_{\mathbb {Z}_\bot } \times  f) & \text {((co)-lists of integers)}\\		
  \end {array}
]]></fr:tex></html:p></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-005N/</fr:uri><fr:display-uri>dt-005N</fr:display-uri><fr:route>/forest/dt-005N/</fr:route><fr:taxon>Exercise</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
The lazy natural numbers, also called conats, are defined as the least solution to the equation <fr:tex display="inline"><![CDATA[X \simeq  \mathbf {1} + X]]></fr:tex>. 
<html:ol><html:li>Sketch the first four approximations to the least fixed point. Call the two sum injections <fr:tex display="inline"><![CDATA[\mathsf {zero}]]></fr:tex> and <fr:tex display="inline"><![CDATA[\mathsf {succ}]]></fr:tex>.




<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>
<fr:tex display="block"><![CDATA[
\begin {array}{lcl}
A_0 & = & \{\bot \} \\
A_1 & = & \{\mathsf {zero}\ \bot , \mathsf {succ}\ \bot , \bot \} \\
A_2 & = & \{\mathsf {zero}\ \bot , \mathsf {succ}\ \bot , \mathsf {succ}\ (\mathsf {zero}\ \bot ), \mathsf {succ}\ (\mathsf {succ}\ \bot ), \bot \} \\
A_3 & = & \{\mathsf {zero}\ \bot , \mathsf {succ}\ \bot , \mathsf {succ}\ (\mathsf {zero}\ \bot ), \mathsf {succ}\ (\mathsf {succ}\ \bot ), \mathsf {succ}\ (\mathsf {succ}\ (\mathsf {zero}\ \bot )), \mathsf {succ}\ (\mathsf {succ}\ (\mathsf {succ}\ \bot )), \bot \} \\
\end {array}
]]></fr:tex>
</fr:mainmatter></fr:tree></html:li>
<html:li>Repeat this exercise assuming:
<html:ol><html:li><fr:tex display="inline"><![CDATA[\mathsf {zero}]]></fr:tex> is strict (i.e. <fr:tex display="inline"><![CDATA[\mathsf {zero}\ \bot  = \bot ]]></fr:tex>)




<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>
	<fr:tex display="block"><![CDATA[
	\begin {array}{lcl}
	A_0 & = & \{\bot \} \\
	A_1 & = & \{\mathsf {succ}\ \bot , \bot \} \\
	A_2 & = & \{\mathsf {succ}\ \bot , \mathsf {succ}\ (\mathsf {succ}\ \bot ), \bot \} \\
	A_3 & = & \{\mathsf {succ}\ \bot , \mathsf {succ}\ (\mathsf {succ}\ \bot ), \mathsf {succ}\ (\mathsf {succ}\ (\mathsf {succ}\ \bot )), \bot \} \\
	\end {array}
	]]></fr:tex>
	</fr:mainmatter></fr:tree></html:li>
	<html:li><fr:tex display="inline"><![CDATA[\mathsf {succ}]]></fr:tex> is strict (i.e. <fr:tex display="inline"><![CDATA[\mathsf {succ}\ \bot  = \bot ]]></fr:tex>)




<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>
	<fr:tex display="block"><![CDATA[
	\begin {array}{lcl}
	A_0 & = & \{\bot \} \\
	A_1 & = & \{\mathsf {zero}\ \bot , \bot \} \\
	A_2 & = & \{\mathsf {zero}\ \bot , \mathsf {succ}\ (\mathsf {zero}\ \bot ), \bot \} \\
	A_3 & = & \{\mathsf {zero}\ \bot , \mathsf {succ}\ (\mathsf {zero}\ \bot ),  \mathsf {succ}\ (\mathsf {succ}\ (\mathsf {zero}\ \bot )), \bot \} \\
	\end {array}
	]]></fr:tex>
	</fr:mainmatter></fr:tree></html:li></html:ol></html:li></html:ol></html:p></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0052/</fr:uri><fr:display-uri>dt-0052</fr:display-uri><fr:route>/forest/dt-0052/</fr:route><fr:title text="From \textbf {Cpo} to \textbf {Cpo}^{\textbf {R}}">From <fr:tex display="inline"><![CDATA[\textbf {Cpo}]]></fr:tex> to <fr:tex display="inline"><![CDATA[\textbf {Cpo}^{\textbf {R}}]]></fr:tex></fr:title></fr:frontmatter><fr:mainmatter><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0053/</fr:uri><fr:display-uri>dt-0053</fr:display-uri><fr:route>/forest/dt-0053/</fr:route><fr:title text="Contravariance in the function arrow">Contravariance in the function arrow</fr:title><fr:taxon>Problem</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>We cannot get morphism mappings in <fr:link href="/forest/dt-002B/" title="The category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-002B/" display-uri="dt-002B" type="local">the category <fr:tex display="inline"><![CDATA[\textbf {Cpo}]]></fr:tex></fr:link> as easily as <fr:link href="/forest/dt-0050/" title="Constructing endofunctors" uri="https://liamoc.net/forest/dt-0050/" display-uri="dt-0050" type="local">§ <fr:contextual-number uri="https://liamoc.net/forest/dt-0050/" display-uri="dt-0050" /></fr:link> when our object mapping makes use of the function operators <fr:tex display="inline"><![CDATA[\mathbin {\circ \hspace{-0.4em}\twoheadrightarrow }]]></fr:tex> and <fr:tex display="inline"><![CDATA[\twoheadrightarrow ]]></fr:tex>, as they are <fr:link href="/forest/dm-000S/" title="Contravariant functor" uri="https://liamoc.net/forest/dm-000S/" display-uri="dm-000S" type="local">contravariant</fr:link> in their first argument. This means the <fr:link href="/forest/dm-000J/" title="Functor" uri="https://liamoc.net/forest/dm-000J/" display-uri="dm-000J" type="local">functor</fr:link> that they extend to is not <fr:tex display="inline"><![CDATA[\textbf {Cpo} \rightarrow  \textbf {Cpo}]]></fr:tex> but <fr:tex display="inline"><![CDATA[\textbf {Cpo}^\textsf {op} \rightarrow  \textbf {Cpo}]]></fr:tex>, where <fr:tex display="inline"><![CDATA[\textbf {Cpo}^\textsf {op} ]]></fr:tex> is the <fr:link href="/forest/dm-000Q/" title="Dual category" uri="https://liamoc.net/forest/dm-000Q/" display-uri="dm-000Q" type="local">dual category</fr:link> of <fr:tex display="inline"><![CDATA[\textbf {Cpo}]]></fr:tex>. The morphisms end up the wrong way around. </html:p><html:p>As an example, consider <fr:tex display="inline"><![CDATA[\mathcal {F}(X) = X\twoheadrightarrow \mathbb {Z}_\bot ]]></fr:tex>. Then, recalling <fr:link href="/forest/dt-002X/" title="Morphism mapping for \twoheadrightarrow " uri="https://liamoc.net/forest/dt-002X/" display-uri="dt-002X" type="local">the morphism mapping of the <fr:tex display="inline"><![CDATA[\twoheadrightarrow ]]></fr:tex> functor</fr:link>:
<fr:tex display="block"><![CDATA[
\dfrac {f : A \twoheadrightarrow  B \quad  g : C\twoheadrightarrow  D}{f\twoheadrightarrow  g : (B\twoheadrightarrow  C)\twoheadrightarrow  (A\twoheadrightarrow  D)}
]]></fr:tex>
We can generate a morphism mapping for <fr:tex display="inline"><![CDATA[\mathcal {F}]]></fr:tex>: <fr:tex display="block"><![CDATA[\mathcal {F}(f)\; =\; f\twoheadrightarrow \mathsf {id}_{\mathbb {Z}_\bot }\; =\; (\lambda  h.\ \mathsf {id}_{\mathbb {Z}_\bot }\circ  h \circ  f)\; = \;(\lambda  h.\ h \circ  f)  ]]></fr:tex>
However, this mapping has the wrong type. For <fr:tex display="inline"><![CDATA[f : A\twoheadrightarrow  B]]></fr:tex>, then <fr:tex display="inline"><![CDATA[\mathcal {F}(f) : (B\twoheadrightarrow  \mathbb {Z}_\bot ) \rightarrow  (A\twoheadrightarrow  \mathbb {Z}_\bot )]]></fr:tex>, which is <fr:tex display="inline"><![CDATA[\mathcal {F}(B)\twoheadrightarrow \mathcal {F}(A)]]></fr:tex>, not the required <fr:tex display="inline"><![CDATA[\mathcal {F}(A)\twoheadrightarrow  \mathcal {F}(B)]]></fr:tex>. This is because the generated functor is <fr:link href="/forest/dm-000S/" title="Contravariant functor" uri="https://liamoc.net/forest/dm-000S/" display-uri="dm-000S" type="local">contravariant</fr:link>, not <fr:link href="/forest/dm-000J/" title="Functor" uri="https://liamoc.net/forest/dm-000J/" display-uri="dm-000J" type="local">covariant</fr:link>.
</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-005O/</fr:uri><fr:display-uri>dt-005O</fr:display-uri><fr:route>/forest/dt-005O/</fr:route><fr:taxon>Exercise</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
Show that, in contrast to <fr:tex display="inline"><![CDATA[\mathcal {F}(X) = X\twoheadrightarrow  \mathbb {Z}_\bot ]]></fr:tex> from <fr:link href="/forest/dt-0053/" title="Contravariance in the function arrow" uri="https://liamoc.net/forest/dt-0053/" display-uri="dt-0053" type="local">Problem <fr:contextual-number uri="https://liamoc.net/forest/dt-0053/" display-uri="dt-0053" /></fr:link>, the mapping <fr:tex display="inline"><![CDATA[\mathcal {G}(X) = \mathbb {Z}_\bot \twoheadrightarrow  X]]></fr:tex> <html:em>can</html:em> be extended to <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link> functions giving a <html:em>covariant</html:em> <fr:link href="/forest/dt-004T/" title="Endofunctors on \textbf {Cpo}" uri="https://liamoc.net/forest/dt-004T/" display-uri="dt-004T" type="local">endofunctor</fr:link> on <fr:tex display="inline"><![CDATA[\textbf {Cpo}]]></fr:tex>.




<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>
<html:p>Given a continuous function <fr:tex display="inline"><![CDATA[f : A \twoheadrightarrow  B]]></fr:tex>, we must produce a continuous function <fr:tex display="inline"><![CDATA[\mathcal {F}(f) : (\mathbb {Z}_\bot  \twoheadrightarrow  A) \twoheadrightarrow  (\mathbb {Z}_\bot  \twoheadrightarrow  B)]]></fr:tex>, defined as follows:
<fr:tex display="block"><![CDATA[\mathcal {F}(f)(g)(x) = f \circ  g(x)]]></fr:tex>
Composition of continuous functions preserves continuity. The <fr:link href="/forest/dt-004T/" title="Endofunctors on \textbf {Cpo}" uri="https://liamoc.net/forest/dt-004T/" display-uri="dt-004T" type="local">functor laws</fr:link> can be shown straightforwardly.
</html:p>
</fr:mainmatter></fr:tree></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0054/</fr:uri><fr:display-uri>dt-0054</fr:display-uri><fr:route>/forest/dt-0054/</fr:route><fr:title text="Retraction pair">Retraction pair</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>A <html:em>retraction pair</html:em> <fr:tex display="inline"><![CDATA[(f,g)]]></fr:tex> on <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> <fr:tex display="inline"><![CDATA[A]]></fr:tex> to <fr:tex display="inline"><![CDATA[B]]></fr:tex> consists of two <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link> functions <fr:tex display="inline"><![CDATA[A \xtofrom [g]{f} B]]></fr:tex> 
 such that:
<html:ol><html:li><fr:tex display="inline"><![CDATA[g \circ  f = \mathsf {id}_A\quad ]]></fr:tex>  (i.e. <fr:tex display="inline"><![CDATA[\forall  x \in  A.\ g(f(x)) = x ]]></fr:tex>)</html:li>
<html:li><fr:tex display="inline"><![CDATA[f \circ  g \sqsubseteq  \mathsf {id}_B\quad ]]></fr:tex>  (i.e. <fr:tex display="inline"><![CDATA[\forall  y \in  B.\ f(g(y)) \sqsubseteq  y ]]></fr:tex>)</html:li></html:ol>
In this retraction pair, <fr:tex display="inline"><![CDATA[f]]></fr:tex> is called a <html:em>embedding</html:em> and <fr:tex display="inline"><![CDATA[g]]></fr:tex> is called a <html:em>projection</html:em>.
</html:p><html:p>
Retraction pairs are weakenings of <fr:link href="/forest/dt-002E/" title="Cpo isomorphism" uri="https://liamoc.net/forest/dt-002E/" display-uri="dt-002E" type="local">isomorphisms</fr:link>. Intuitively, going <fr:tex display="inline"><![CDATA[A \twoheadrightarrow  B\twoheadrightarrow  A]]></fr:tex>, all information is <html:em>preserved</html:em> due to requirement 1, but going <fr:tex display="inline"><![CDATA[B\twoheadrightarrow  A\twoheadrightarrow  B]]></fr:tex>, we <html:em>may lose</html:em> some information (hence the use of <fr:tex display="inline"><![CDATA[\sqsubseteq ]]></fr:tex> in requirement 2). </html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0055/</fr:uri><fr:display-uri>dt-0055</fr:display-uri><fr:route>/forest/dt-0055/</fr:route><fr:title text="Examples and counterexamples of retraction pairs">Examples and counterexamples of retraction pairs</fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Here are two examples of <fr:link href="/forest/dt-0054/" title="Retraction pair" uri="https://liamoc.net/forest/dt-0054/" display-uri="dt-0054" type="local">retraction pairs</fr:link>:
<html:figure><fr:resource hash="33a9313298c67003803bde4f80fd2a9c"><fr:resource-content><html:img src="/forest/33a9313298c67003803bde4f80fd2a9c.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz-cd}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
 & z \ar [dl, thick,->] \\
 b \ar [r,thick,<->] & y \ar [u,-] \\
 a\ar [u,-]\ar [r,thick,<->] & x \ar [u,-]	
\end {tikzcd}
$\quad \qquad \qquad $
\begin {tikzcd}
 & z \ar [dl, thick,<->] \\
 b & y \ar [dl, thick,->] \ar [u,-] \\
 a\ar [u,-]\ar [r,thick,<->] & x \ar [u,-]	
\end {tikzcd}]]></fr:resource-source></fr:resource></html:figure>
(this demonstrates that there can be <html:em>many</html:em> <fr:link href="/forest/dt-0054/" title="Retraction pair" uri="https://liamoc.net/forest/dt-0054/" display-uri="dt-0054" type="local">retraction pairs</fr:link> <fr:tex display="inline"><![CDATA[A \xtofrom [g]{f} B]]></fr:tex>)</html:p><html:p>The following, however, are <html:em>not</html:em> <fr:link href="/forest/dt-0054/" title="Retraction pair" uri="https://liamoc.net/forest/dt-0054/" display-uri="dt-0054" type="local">retraction pairs</fr:link> <fr:tex display="inline"><![CDATA[A \xtofrom [g]{f} B]]></fr:tex>:
<html:figure><html:table width="100%">
  <html:tr>
  <html:td>
<fr:resource hash="17feb279f8fbd5bc513cce06df978f77"><fr:resource-content><html:img src="/forest/17feb279f8fbd5bc513cce06df978f77.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz-cd}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
 & z \ar [dl, thick,<->] \\
 b \ar [r,thick,<-] & y \ar [u,-] \\
 a\ar [u,-]\ar [r,thick,<->] & x \ar [u,-]	
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:td>

  <html:td>
<fr:resource hash="aacc00116e7b53d007528b167c4e5ee4"><fr:resource-content><html:img src="/forest/aacc00116e7b53d007528b167c4e5ee4.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz-cd}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
 & z \ar [dl, thick,->] \\
 b \ar [dr, thick,->] & y \ar [l, thick,->] \ar [u,-] \\
 a\ar [u,-]\ar [r,thick,<->] & x \ar [u,-]	
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:td>
</html:tr>


  <html:tr>
  
  <html:td>
    (<fr:tex display="inline"><![CDATA[y \mapsto  b \mapsto  z]]></fr:tex> but <fr:tex display="inline"><![CDATA[z \not \sqsubseteq  y]]></fr:tex>)
  </html:td>

  
  <html:td>
    (<fr:tex display="inline"><![CDATA[b \mapsto  x \mapsto  a]]></fr:tex> but <fr:tex display="inline"><![CDATA[a \neq  b]]></fr:tex>)
  </html:td>

</html:tr>

</html:table></html:figure></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0056/</fr:uri><fr:display-uri>dt-0056</fr:display-uri><fr:route>/forest/dt-0056/</fr:route><fr:title text="Composition of retraction pairs">Composition of retraction pairs</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>We can compose <fr:link href="/forest/dt-0054/" title="Retraction pair" uri="https://liamoc.net/forest/dt-0054/" display-uri="dt-0054" type="local">retraction pairs</fr:link> by composing their <html:em>embedding</html:em> and <html:em>projection</html:em>:</html:p><html:figure><fr:resource hash="f9e1b1eaa3a00be59ac172e80eb09343"><fr:resource-content><html:img src="/forest/f9e1b1eaa3a00be59ac172e80eb09343.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz-cd}\usepackage {amsmath}\usepackage {amssymb}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
    \begin {tikzcd}
      A \ar [r,"f",yshift=0.2em] & B \ar [l,"g", ,yshift=-0.2em] 
        \ar [r,"h",yshift=0.2em] & C \ar [l,"i", ,yshift=-0.2em] &\leadsto  & 
      A \ar [r,"h \circ  f",yshift=0.2em] & C \ar [l,"g \circ  i",yshift=-0.2em] &\quad 
     \end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors /><fr:uri>https://liamoc.net/forest/dt-0057/</fr:uri><fr:display-uri>dt-0057</fr:display-uri><fr:route>/forest/dt-0057/</fr:route><fr:title text="Derived products of retraction pairs">Derived products of retraction pairs</fr:title><fr:taxon>Corollary</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>It follows from the definition of <fr:link href="/forest/dt-0054/" title="Retraction pair" uri="https://liamoc.net/forest/dt-0054/" display-uri="dt-0054" type="local">retraction pairs</fr:link> that, for a pair <fr:tex display="inline"><![CDATA[\xtofrom [g]{f}]]></fr:tex>:
<html:ol><html:li><fr:tex display="inline"><![CDATA[f]]></fr:tex> and <fr:tex display="inline"><![CDATA[g]]></fr:tex> are <fr:link href="/forest/dt-000K/" title="Strictness" uri="https://liamoc.net/forest/dt-000K/" display-uri="dt-000K" type="local">strict</fr:link>, i.e. <fr:tex display="inline"><![CDATA[f(\bot ) = \bot ]]></fr:tex> and <fr:tex display="inline"><![CDATA[g(\bot ) = \bot ]]></fr:tex>.</html:li>
<html:li><fr:tex display="inline"><![CDATA[g]]></fr:tex> is <html:em>uniquely determined</html:em> by <fr:tex display="inline"><![CDATA[f]]></fr:tex> and vice-versa, so if another <fr:link href="/forest/dt-0054/" title="Retraction pair" uri="https://liamoc.net/forest/dt-0054/" display-uri="dt-0054" type="local">retraction pair</fr:link> <fr:tex display="inline"><![CDATA[\xtofrom [g']{f}]]></fr:tex> exists, then <fr:tex display="inline"><![CDATA[g = g']]></fr:tex>. To see why, remember that <fr:tex display="inline"><![CDATA[f]]></fr:tex> and <fr:tex display="inline"><![CDATA[g]]></fr:tex> must be <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link> and therefore <fr:link href="/forest/dt-000J/" title="Monotonicity" uri="https://liamoc.net/forest/dt-000J/" display-uri="dt-000J" type="local">monotonic</fr:link>.</html:li>
<html:li><fr:tex display="inline"><![CDATA[A]]></fr:tex> is <fr:link href="/forest/dt-002E/" title="Cpo isomorphism" uri="https://liamoc.net/forest/dt-002E/" display-uri="dt-002E" type="local">isomorphic</fr:link> to the range of <fr:tex display="inline"><![CDATA[f]]></fr:tex>, i.e. <fr:tex display="inline"><![CDATA[A \simeq  \{ f(x) \mid  x \in  A\} \subseteq  B]]></fr:tex>.</html:li></html:ol></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0058/</fr:uri><fr:display-uri>dt-0058</fr:display-uri><fr:route>/forest/dt-0058/</fr:route><fr:title text="The category \textbf {Cpo}^\textbf {R}">The category <fr:tex display="inline"><![CDATA[\textbf {Cpo}^\textbf {R}]]></fr:tex></fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>The category <fr:tex display="inline"><![CDATA[\textbf {Cpo}^\textbf {R}]]></fr:tex> is the <fr:link href="/forest/dm-000G/" title="Category" uri="https://liamoc.net/forest/dm-000G/" display-uri="dm-000G" type="local">category</fr:link> where the objects are <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link>, the morphisms are <fr:link href="/forest/dt-0054/" title="Retraction pair" uri="https://liamoc.net/forest/dt-0054/" display-uri="dt-0054" type="local">retraction pairs</fr:link>, composition is as in <fr:link href="/forest/dt-0056/" title="Composition of retraction pairs" uri="https://liamoc.net/forest/dt-0056/" display-uri="dt-0056" type="local">Definition <fr:contextual-number uri="https://liamoc.net/forest/dt-0056/" display-uri="dt-0056" /></fr:link> and identity is just the <fr:link href="/forest/dt-0054/" title="Retraction pair" uri="https://liamoc.net/forest/dt-0054/" display-uri="dt-0054" type="local">retraction pair</fr:link> <fr:tex display="inline"><![CDATA[A \xtofrom [\lambda  x. x]{\lambda  x. x} A]]></fr:tex>.  </html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0059/</fr:uri><fr:display-uri>dt-0059</fr:display-uri><fr:route>/forest/dt-0059/</fr:route><fr:title text="Information ordering in \textbf {Cpo}^\textbf {R}">Information ordering in <fr:tex display="inline"><![CDATA[\textbf {Cpo}^\textbf {R}]]></fr:tex></fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
The third point in <fr:link href="/forest/dt-0057/" title="Derived products of retraction pairs" uri="https://liamoc.net/forest/dt-0057/" display-uri="dt-0057" type="local">Corollary <fr:contextual-number uri="https://liamoc.net/forest/dt-0057/" display-uri="dt-0057" /></fr:link> suggests a notion of approximation, or <fr:link href="/forest/dt-000B/" title="Information ordering" uri="https://liamoc.net/forest/dt-000B/" display-uri="dt-000B" type="local">information ordering</fr:link>, for <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link>. Rather than say, as we did in <fr:link href="/forest/dt-004O/" title="From a cpo to the category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-004O/" display-uri="dt-004O" type="local">§ <fr:contextual-number uri="https://liamoc.net/forest/dt-004O/" display-uri="dt-004O" /></fr:link>, that for <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> <fr:tex display="inline"><![CDATA[A]]></fr:tex> and <fr:tex display="inline"><![CDATA[B]]></fr:tex>, <fr:tex display="inline"><![CDATA[A \sqsubseteq  B]]></fr:tex> iff there exists a <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous function</fr:link> <fr:tex display="inline"><![CDATA[A\twoheadrightarrow  B]]></fr:tex>, we now say:
<html:figure><fr:tex display="inline"><![CDATA[A \sqsubseteq  B]]></fr:tex> iff there exists a <fr:link href="/forest/dt-0054/" title="Retraction pair" uri="https://liamoc.net/forest/dt-0054/" display-uri="dt-0054" type="local">retraction pair</fr:link> <fr:tex display="inline"><![CDATA[A \xtofrom [g]{f} B]]></fr:tex></html:figure></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-005A/</fr:uri><fr:display-uri>dt-005A</fr:display-uri><fr:route>/forest/dt-005A/</fr:route><fr:title text="Generalising to \textbf {Cpo}^\textbf {R}">Generalising to <fr:tex display="inline"><![CDATA[\textbf {Cpo}^\textbf {R}]]></fr:tex></fr:title></fr:frontmatter><fr:mainmatter><html:p>All of our other notions for <fr:tex display="inline"><![CDATA[\textbf {Cpo}]]></fr:tex> naturally generalise to a setting with  <fr:link href="/forest/dt-0054/" title="Retraction pair" uri="https://liamoc.net/forest/dt-0054/" display-uri="dt-0054" type="local">retraction pairs</fr:link> <fr:tex display="inline"><![CDATA[\textbf {Cpo}^\textbf {R}]]></fr:tex>: least elements, <fr:link href="/forest/dt-004Q/" title="\omega -chains of cpos in the category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-004Q/" display-uri="dt-004Q" type="local"><fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-chains</fr:link>, <fr:link href="/forest/dt-004R/" title="Upper bounds in the category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-004R/" display-uri="dt-004R" type="local">upper bounds</fr:link>, <fr:link href="/forest/dt-004S/" title="Least upper bounds in the category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-004S/" display-uri="dt-004S" type="local">colimits</fr:link>, <fr:link href="/forest/dt-004V/" title="Cocontinuous endofunctors" uri="https://liamoc.net/forest/dt-004V/" display-uri="dt-004V" type="local">cocontinuous endofunctors</fr:link> and so on.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-005C/</fr:uri><fr:display-uri>dt-005C</fr:display-uri><fr:route>/forest/dt-005C/</fr:route><fr:title text="\omega -chains of cpos in the category \mathbf {Cpo}^\textbf {R}"><fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-chains of cpos in the category <fr:tex display="inline"><![CDATA[\mathbf {Cpo}^\textbf {R}]]></fr:tex></fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>An <fr:link href="/forest/dt-000W/" title="\omega -chain" uri="https://liamoc.net/forest/dt-000W/" display-uri="dt-000W" type="local"><fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-chain</fr:link> of <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> in the <fr:link href="/forest/dt-0058/" title="The category \textbf {Cpo}^\textbf {R}" uri="https://liamoc.net/forest/dt-0058/" display-uri="dt-0058" type="local">category <fr:tex display="inline"><![CDATA[\mathbf {Cpo}^\textbf {R}]]></fr:tex></fr:link> consists of a family of <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> <fr:tex display="inline"><![CDATA[\{D_i \mid  i \in  \mathbb {N} \}]]></fr:tex>, together with a family of <fr:link href="/forest/dt-0054/" title="Retraction pair" uri="https://liamoc.net/forest/dt-0054/" display-uri="dt-0054" type="local">retraction pairs</fr:link> <fr:tex display="inline"><![CDATA[ D_i \xtofrom [g_i]{f_i} D_{i+1}]]></fr:tex>, shown below:</html:p><html:figure><fr:resource hash="329176f23eb6f439327234bd5c64135e"><fr:resource-content><html:img src="/forest/329176f23eb6f439327234bd5c64135e.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz-cd}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
  D_0 \ar [r,"f_0",->,yshift=0.2em]\ar [r,"g_0"', <-,yshift=-0.2em]  &
  D_1 \ar [r,"f_1",->,yshift=0.2em]\ar [r,"g_1"', <-,yshift=-0.2em]  &
  D_2 \ar [r,"f_2",->,yshift=0.2em]\ar [r,"g_2"', <-,yshift=-0.2em]  &
  D_3 \ar [r,-,dashed,yshift=0.2em]\ar [r,dashed,-,yshift=-0.2em]  &
  \cdots 
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-005D/</fr:uri><fr:display-uri>dt-005D</fr:display-uri><fr:route>/forest/dt-005D/</fr:route><fr:title text="Endofunctors on \textbf {Cpo}^\textbf {R}">Endofunctors on <fr:tex display="inline"><![CDATA[\textbf {Cpo}^\textbf {R}]]></fr:tex></fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>An <html:em>endofunctor</html:em> on <fr:link href="/forest/dt-0058/" title="The category \textbf {Cpo}^\textbf {R}" uri="https://liamoc.net/forest/dt-0058/" display-uri="dt-0058" type="local">the category <fr:tex display="inline"><![CDATA[\textbf {Cpo}^\textbf {R}]]></fr:tex></fr:link> is a <fr:link href="/forest/dm-000J/" title="Functor" uri="https://liamoc.net/forest/dm-000J/" display-uri="dm-000J" type="local">functor</fr:link> <fr:tex display="inline"><![CDATA[\textbf {Cpo}^\textbf {R} \rightarrow  \textbf {Cpo}^\textbf {R}]]></fr:tex>, i.e. a mapping <fr:tex display="inline"><![CDATA[\mathcal {F}]]></fr:tex> on <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> together with a mapping <fr:tex display="inline"><![CDATA[\mathcal {F}]]></fr:tex> on <fr:link href="/forest/dt-0054/" title="Retraction pair" uri="https://liamoc.net/forest/dt-0054/" display-uri="dt-0054" type="local">retraction pairs</fr:link>, such that:</html:p><html:ol><html:li>If <fr:tex display="inline"><![CDATA[(f,g)]]></fr:tex> is a <fr:link href="/forest/dt-0054/" title="Retraction pair" uri="https://liamoc.net/forest/dt-0054/" display-uri="dt-0054" type="local">retraction pair</fr:link> <fr:tex display="inline"><![CDATA[A \xtofrom [g]{f} B]]></fr:tex> then <fr:tex display="inline"><![CDATA[\mathcal {F}(f,g)]]></fr:tex> is a <fr:link href="/forest/dt-0054/" title="Retraction pair" uri="https://liamoc.net/forest/dt-0054/" display-uri="dt-0054" type="local">retraction pair</fr:link> <fr:tex display="inline"><![CDATA[\mathcal {F}(A)\xtofrom []{} \mathcal {F}(B)]]></fr:tex></html:li>
<html:li><fr:tex display="inline"><![CDATA[\mathcal {F}(\mathsf {id}_A : A\xtofrom []{} A) = \mathsf {id}_{\mathcal {F}(A)} : \mathcal {F}(A)\xtofrom []{} \mathcal {F}(A)]]></fr:tex></html:li>
<html:li><fr:tex display="inline"><![CDATA[\mathcal {F}(f \circ  g) = \mathcal {F}(f) \circ  \mathcal {F}(g)]]></fr:tex></html:li> (where <fr:tex display="inline"><![CDATA[\circ ]]></fr:tex> is <fr:link href="/forest/dt-0056/" title="Composition of retraction pairs" uri="https://liamoc.net/forest/dt-0056/" display-uri="dt-0056" type="local">composition of retraction pairs</fr:link>)
</html:ol></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors /><fr:uri>https://liamoc.net/forest/dt-005G/</fr:uri><fr:display-uri>dt-005G</fr:display-uri><fr:route>/forest/dt-005G/</fr:route><fr:title text="Upper bounds in the category \mathbf {Cpo}^\mathbf {R}">Upper bounds in the category <fr:tex display="inline"><![CDATA[\mathbf {Cpo}^\mathbf {R}]]></fr:tex></fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>A <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> <fr:tex display="inline"><![CDATA[A]]></fr:tex> is an <fr:link href="/forest/dm-000C/" title="Upper bound" uri="https://liamoc.net/forest/dm-000C/" display-uri="dm-000C" type="local">upper bound</fr:link> of an <fr:link href="/forest/dt-005C/" title="\omega -chains of cpos in the category \mathbf {Cpo}^\textbf {R}" uri="https://liamoc.net/forest/dt-005C/" display-uri="dt-005C" type="local"><fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-chain of cpos</fr:link> <fr:tex display="inline"><![CDATA[A_i]]></fr:tex> in <fr:link href="/forest/dt-0058/" title="The category \textbf {Cpo}^\textbf {R}" uri="https://liamoc.net/forest/dt-0058/" display-uri="dt-0058" type="local">the category <fr:tex display="inline"><![CDATA[\mathbf {Cpo}^\textbf {R}]]></fr:tex></fr:link> if there is a family of <fr:link href="/forest/dt-0054/" title="Retraction pair" uri="https://liamoc.net/forest/dt-0054/" display-uri="dt-0054" type="local">retraction pairs</fr:link> <fr:tex display="inline"><![CDATA[A_i \xtofrom [g_i]{f_i} A]]></fr:tex> such that the following diagram commutes (i.e. for all <fr:tex display="inline"><![CDATA[i \in  \mathbb {N}]]></fr:tex>, <fr:tex display="inline"><![CDATA[(f_i, g_i) = (f_{i+1},g_{i+1}) \circ  (s_i,t_i)]]></fr:tex>, where <fr:tex display="inline"><![CDATA[\circ ]]></fr:tex> is <fr:link href="/forest/dt-0056/" title="Composition of retraction pairs" uri="https://liamoc.net/forest/dt-0056/" display-uri="dt-0056" type="local">composition of retraction pairs</fr:link>):</html:p><html:figure><fr:resource hash="680d3227d7ba6fb97b2319dbc2d71483"><fr:resource-content><html:img src="/forest/680d3227d7ba6fb97b2319dbc2d71483.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz-cd}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
&&A\ar [ddll,<-,xshift=-0.8em,"f_0"']\ar [ddll,->,"g_0",xshift=-0.2em] 
\ar [ddl,<-,"g_1",xshift=-0.35em]\ar [ddl,->,"f_1"',xshift=0.1em] 
\ar [dd,<-,"f_2"',xshift=-0.1em]\ar [dd,->,"g_2",xshift=0.3em]  \\
&&&\cdots  \\
  A_0 \ar [r,"s_0",->,yshift=0.2em]\ar [r,"t_0"', <-,yshift=-0.2em]  &
  A_1 \ar [r,"s_1",->,yshift=0.2em]\ar [r,"t_1"', <-,yshift=-0.2em]  &
  A_2  \ar [r,-,dotted,yshift=0.2em]\ar [r,dotted,-,yshift=-0.2em]&
  \cdots 
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-005F/</fr:uri><fr:display-uri>dt-005F</fr:display-uri><fr:route>/forest/dt-005F/</fr:route><fr:title text="Colimits in the category \mathbf {Cpo}^\mathbf {R}">Colimits in the category <fr:tex display="inline"><![CDATA[\mathbf {Cpo}^\mathbf {R}]]></fr:tex></fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>A <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> <fr:tex display="inline"><![CDATA[A]]></fr:tex> is the <html:em>colimit</html:em> of an <fr:link href="/forest/dt-005C/" title="\omega -chains of cpos in the category \mathbf {Cpo}^\textbf {R}" uri="https://liamoc.net/forest/dt-005C/" display-uri="dt-005C" type="local"><fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-chain of cpos</fr:link> <fr:tex display="inline"><![CDATA[A_i]]></fr:tex> if is both an <fr:link href="/forest/dt-005G/" title="Upper bounds in the category \mathbf {Cpo}^\mathbf {R}" uri="https://liamoc.net/forest/dt-005G/" display-uri="dt-005G" type="local">upper bound</fr:link>, i.e. there exists <fr:link href="/forest/dt-0054/" title="Retraction pair" uri="https://liamoc.net/forest/dt-0054/" display-uri="dt-0054" type="local">retraction pairs</fr:link> <fr:tex display="inline"><![CDATA[(f_i,g_i) : A_i \xtofrom []{} A]]></fr:tex>, and for any other <fr:link href="/forest/dt-005G/" title="Upper bounds in the category \mathbf {Cpo}^\mathbf {R}" uri="https://liamoc.net/forest/dt-005G/" display-uri="dt-005G" type="local">upper bound</fr:link> <fr:tex display="inline"><![CDATA[B]]></fr:tex>, for which there will exist <fr:link href="/forest/dt-0054/" title="Retraction pair" uri="https://liamoc.net/forest/dt-0054/" display-uri="dt-0054" type="local">retraction pairs</fr:link> <fr:tex display="inline"><![CDATA[(m_i,n_i) : A_i \xtofrom []{} B]]></fr:tex>, there exists a <html:em>unique</html:em> <fr:link href="/forest/dt-0054/" title="Retraction pair" uri="https://liamoc.net/forest/dt-0054/" display-uri="dt-0054" type="local">retraction pair</fr:link> <fr:tex display="inline"><![CDATA[A \xtofrom [k']{k} B]]></fr:tex>  such that <fr:tex display="inline"><![CDATA[(m_i,n_i) = (k,k') \circ (f_i,g_i) ]]></fr:tex> for all <fr:tex display="inline"><![CDATA[i \in  \mathbb {N}]]></fr:tex>, where <fr:tex display="inline"><![CDATA[\circ ]]></fr:tex> is <fr:link href="/forest/dt-0056/" title="Composition of retraction pairs" uri="https://liamoc.net/forest/dt-0056/" display-uri="dt-0056" type="local">composition of retraction pairs</fr:link>. Viewed diagramatically, it is the same as <fr:link href="/forest/dt-004S/" title="Least upper bounds in the category \mathbf {Cpo}" uri="https://liamoc.net/forest/dt-004S/" display-uri="dt-004S" type="local">Definition <fr:contextual-number uri="https://liamoc.net/forest/dt-004S/" display-uri="dt-004S" /></fr:link> where <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous functions</fr:link> are replaced by <fr:link href="/forest/dt-0054/" title="Retraction pair" uri="https://liamoc.net/forest/dt-0054/" display-uri="dt-0054" type="local">retraction pairs</fr:link>.</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors /><fr:uri>https://liamoc.net/forest/dt-005E/</fr:uri><fr:display-uri>dt-005E</fr:display-uri><fr:route>/forest/dt-005E/</fr:route><fr:title text="Cocontinuous endofunctors on \textbf {Cpo}^\textbf {R}">Cocontinuous endofunctors on <fr:tex display="inline"><![CDATA[\textbf {Cpo}^\textbf {R}]]></fr:tex></fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>An <fr:link href="/forest/dt-005D/" title="Endofunctors on \textbf {Cpo}^\textbf {R}" uri="https://liamoc.net/forest/dt-005D/" display-uri="dt-005D" type="local">endofunctor</fr:link> <fr:tex display="inline"><![CDATA[\mathcal {F}]]></fr:tex> is <html:em>cocontinuous</html:em> iff it preserves <fr:link href="/forest/dt-005F/" title="Colimits in the category \mathbf {Cpo}^\mathbf {R}" uri="https://liamoc.net/forest/dt-005F/" display-uri="dt-005F" type="local">colimits</fr:link> of <fr:link href="/forest/dt-005C/" title="\omega -chains of cpos in the category \mathbf {Cpo}^\textbf {R}" uri="https://liamoc.net/forest/dt-005C/" display-uri="dt-005C" type="local"><fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-chains of cpos</fr:link>. That is, given a <fr:link href="/forest/dt-005C/" title="\omega -chains of cpos in the category \mathbf {Cpo}^\textbf {R}" uri="https://liamoc.net/forest/dt-005C/" display-uri="dt-005C" type="local">chain</fr:link> where <fr:tex display="inline"><![CDATA[A]]></fr:tex> is a <fr:link href="/forest/dt-005F/" title="Colimits in the category \mathbf {Cpo}^\mathbf {R}" uri="https://liamoc.net/forest/dt-005F/" display-uri="dt-005F" type="local">colimit</fr:link>:
<html:figure><fr:resource hash="98f291cae6dd7e791460991a3ad2bd54"><fr:resource-content><html:img src="/forest/98f291cae6dd7e791460991a3ad2bd54.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz-cd}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
&&A\ar [ddll,<-,xshift=-0.8em]\ar [ddll,->,xshift=-0.2em] 
\ar [ddl,<-,xshift=-0.35em]\ar [ddl,->,xshift=0.1em] 
\ar [dd,<-,xshift=-0.1em]\ar [dd,->,xshift=0.3em]  \\
&&&\cdots  \\
  D_0 \ar [r,"f_0",->,yshift=0.2em]\ar [r,"g_0"', <-,yshift=-0.2em]  &
  D_1 \ar [r,"f_1",->,yshift=0.2em]\ar [r,"g_1"', <-,yshift=-0.2em]  &
  D_2  \ar [r,-,dotted,yshift=0.2em]\ar [r,dotted,-,yshift=-0.2em]&
  \cdots 
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>
Then <fr:tex display="inline"><![CDATA[\mathcal {F}(A)]]></fr:tex> is a <fr:link href="/forest/dt-005F/" title="Colimits in the category \mathbf {Cpo}^\mathbf {R}" uri="https://liamoc.net/forest/dt-005F/" display-uri="dt-005F" type="local">colimit</fr:link> for the following <fr:link href="/forest/dt-005C/" title="\omega -chains of cpos in the category \mathbf {Cpo}^\textbf {R}" uri="https://liamoc.net/forest/dt-005C/" display-uri="dt-005C" type="local">chain</fr:link>:
<html:figure><fr:resource hash="8448d2191e4d4a79fcd5cf5d9dbb5ffd"><fr:resource-content><html:img src="/forest/8448d2191e4d4a79fcd5cf5d9dbb5ffd.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz-cd}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
&&\mathcal {F}(A)\ar [ddll,<-,xshift=-0.8em]\ar [ddll,->,xshift=-0.2em] 
\ar [ddl,<-,xshift=-0.35em]\ar [ddl,->,xshift=0.1em] 
\ar [dd,<-,xshift=-0.1em]\ar [dd,->,xshift=0.3em]  \\
&&&\cdots  \\
  \mathcal {F}(D_0) \ar [r,"\mathcal {F}(f_0)",->,yshift=0.2em]\ar [r,"\mathcal {F}(g_0)"', <-,yshift=-0.2em]  &
  \mathcal {F}(D_1) \ar [r,"\mathcal {F}(f_1)",->,yshift=0.2em]\ar [r,"\mathcal {F}(g_1)"', <-,yshift=-0.2em]  &
  \mathcal {F}(D_2)  \ar [r,-,dotted,yshift=0.2em]\ar [r,dotted,-,yshift=-0.2em]&
  \cdots 
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure></html:p></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-005I/</fr:uri><fr:display-uri>dt-005I</fr:display-uri><fr:route>/forest/dt-005I/</fr:route><fr:title text="Extending cpo Mappings to endofunctors on \textbf {Cpo}^\mathbf {R}">Extending cpo Mappings to endofunctors on <fr:tex display="inline"><![CDATA[\textbf {Cpo}^\mathbf {R}]]></fr:tex></fr:title></fr:frontmatter><fr:mainmatter><html:p>If <fr:tex display="inline"><![CDATA[\mathcal {F}]]></fr:tex> is a mapping on <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> built up from basic cpos using the constructions <fr:tex display="inline"><![CDATA[\times ]]></fr:tex>, <fr:tex display="inline"><![CDATA[\otimes ]]></fr:tex>, <fr:tex display="inline"><![CDATA[+]]></fr:tex>, <fr:tex display="inline"><![CDATA[\oplus ]]></fr:tex>, <fr:tex display="inline"><![CDATA[(\cdot )_\bot ]]></fr:tex>, <html:em>as well as</html:em> <fr:tex display="inline"><![CDATA[\twoheadrightarrow ]]></fr:tex> and <fr:tex display="inline"><![CDATA[\mathbin {\circ \hspace{-0.4em}\twoheadrightarrow }]]></fr:tex>, then <fr:tex display="inline"><![CDATA[\mathcal {F}]]></fr:tex> extends to a (<html:em>covariant</html:em>!) <fr:link href="/forest/dt-005E/" title="Cocontinuous endofunctors on \textbf {Cpo}^\textbf {R}" uri="https://liamoc.net/forest/dt-005E/" display-uri="dt-005E" type="local">cocontinuous functor</fr:link> on <fr:tex display="inline"><![CDATA[\textbf {Cpo}^\mathbf {R}]]></fr:tex>. 
We shall detail the construction for products and functions here, but the other constructions are all similar.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-005J/</fr:uri><fr:display-uri>dt-005J</fr:display-uri><fr:route>/forest/dt-005J/</fr:route><fr:title text="\times  operation for retraction pairs"><fr:tex display="inline"><![CDATA[\times ]]></fr:tex> operation for retraction pairs</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
Given two <fr:link href="/forest/dt-0054/" title="Retraction pair" uri="https://liamoc.net/forest/dt-0054/" display-uri="dt-0054" type="local">retraction pairs</fr:link> <fr:tex display="inline"><![CDATA[(f,g)]]></fr:tex> and <fr:tex display="inline"><![CDATA[(h,i)]]></fr:tex>, our <fr:link href="/forest/dt-0054/" title="Retraction pair" uri="https://liamoc.net/forest/dt-0054/" display-uri="dt-0054" type="local">retraction pair</fr:link> for their <fr:link href="/forest/dt-0021/" title="Product of cpos" uri="https://liamoc.net/forest/dt-0021/" display-uri="dt-0021" type="local">product</fr:link> is just the product of their <html:em>embedding</html:em> and <html:em>projection</html:em>, i.e. <fr:tex display="inline"><![CDATA[(f \times  h, g \times  i)]]></fr:tex>, using our <fr:link href="/forest/dt-0026/" title="Product of functions" uri="https://liamoc.net/forest/dt-0026/" display-uri="dt-0026" type="local">product operation on continuous functions</fr:link>:
<fr:tex display="block"><![CDATA[
\dfrac {A \xtofrom [g]{f} B\quad  C \xtofrom [i]{h} D}{A\times  C \xtofrom [g \times  i]{f \times  h} B \times  D}
]]></fr:tex></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-005K/</fr:uri><fr:display-uri>dt-005K</fr:display-uri><fr:route>/forest/dt-005K/</fr:route><fr:title text="\twoheadrightarrow  operation for retraction pairs"><fr:tex display="inline"><![CDATA[\twoheadrightarrow ]]></fr:tex> operation for retraction pairs</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
We are given two <fr:link href="/forest/dt-0054/" title="Retraction pair" uri="https://liamoc.net/forest/dt-0054/" display-uri="dt-0054" type="local">retraction pairs</fr:link> <fr:tex display="inline"><![CDATA[A \xtofrom [g]{f} B]]></fr:tex> and
 <fr:tex display="inline"><![CDATA[C \xtofrom [i]{h} D]]></fr:tex>. To define a suitable <html:em>covariant</html:em> <fr:link href="/forest/dt-005E/" title="Cocontinuous endofunctors on \textbf {Cpo}^\textbf {R}" uri="https://liamoc.net/forest/dt-005E/" display-uri="dt-005E" type="local">functor</fr:link>, we define our morphism mapping in terms of our <fr:tex display="inline"><![CDATA[\twoheadrightarrow ]]></fr:tex> <fr:link href="/forest/dt-002X/" title="Morphism mapping for \twoheadrightarrow " uri="https://liamoc.net/forest/dt-002X/" display-uri="dt-002X" type="local">operation on continuous functions</fr:link>: <fr:tex display="block"><![CDATA[ (f,g) \twoheadrightarrow  (h,i) \; \triangleq  \; (g\twoheadrightarrow  h, f \twoheadrightarrow  i)]]></fr:tex>
Note that the positions of <fr:tex display="inline"><![CDATA[f]]></fr:tex> and <fr:tex display="inline"><![CDATA[g]]></fr:tex> are swapped in the above definition.
<fr:tex display="block"><![CDATA[
\dfrac {A \xtofrom [g]{f} B \quad  C \xtofrom [i]{h} D}{A \twoheadrightarrow  C \xtofrom [f \twoheadrightarrow  i]{g \twoheadrightarrow  h} B \twoheadrightarrow  D}
]]></fr:tex>
Unlike <fr:link href="/forest/dt-0053/" title="Contravariance in the function arrow" uri="https://liamoc.net/forest/dt-0053/" display-uri="dt-0053" type="local">with the category <fr:tex display="inline"><![CDATA[\textbf {Cpo}]]></fr:tex></fr:link>, this functor is not <fr:link href="/forest/dm-000S/" title="Contravariant functor" uri="https://liamoc.net/forest/dm-000S/" display-uri="dm-000S" type="local">contravariant</fr:link> but <html:em>covariant</html:em>: Note the positions of <fr:tex display="inline"><![CDATA[A]]></fr:tex> and <fr:tex display="inline"><![CDATA[B]]></fr:tex> are not swapped!
</html:p></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors /><fr:uri>https://liamoc.net/forest/dt-005B/</fr:uri><fr:display-uri>dt-005B</fr:display-uri><fr:route>/forest/dt-005B/</fr:route><fr:title text="Fixed point theorem for endofunctors on \textbf {Cpo}^\textbf {R}">Fixed point theorem for endofunctors on <fr:tex display="inline"><![CDATA[\textbf {Cpo}^\textbf {R}]]></fr:tex></fr:title><fr:taxon>Theorem</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Every <fr:link href="/forest/dt-005E/" title="Cocontinuous endofunctors on \textbf {Cpo}^\textbf {R}" uri="https://liamoc.net/forest/dt-005E/" display-uri="dt-005E" type="local">cocontinuous endofunctor</fr:link> <fr:tex display="inline"><![CDATA[\mathcal {F}]]></fr:tex> on <fr:tex display="inline"><![CDATA[\mathbf {Cpo}^\textbf {R}]]></fr:tex> has a least fixed point, given by the <fr:link href="/forest/dt-005F/" title="Colimits in the category \mathbf {Cpo}^\mathbf {R}" uri="https://liamoc.net/forest/dt-005F/" display-uri="dt-005F" type="local">colimit</fr:link> of the ascending <fr:link href="/forest/dt-005C/" title="\omega -chains of cpos in the category \mathbf {Cpo}^\textbf {R}" uri="https://liamoc.net/forest/dt-005C/" display-uri="dt-005C" type="local"><fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-chain</fr:link>:
<html:figure><fr:resource hash="8463a6dec8616189757b2f9a50b02411"><fr:resource-content><html:img src="/forest/8463a6dec8616189757b2f9a50b02411.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz-cd}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[\begin {tikzcd}
  \mathbf {1} \ar [r,"f_0",->,yshift=0.2em]\ar [r,"g_0"', <-,yshift=-0.2em]  &
  \mathcal {F}(\mathbf {1}) \ar [r,"f_1",->,yshift=0.2em]\ar [r,"g_1"', <-,yshift=-0.2em]  &
  \mathcal {F}(\mathcal {F}(\mathbf {1})) \ar [r,"f_2",->,yshift=0.2em]\ar [r,"g_2"', <-,yshift=-0.2em]  &
  \mathcal {F}(\mathcal {F}(\mathcal {F}(\mathbf {1}))) \ar [r,-,dashed,yshift=0.2em]\ar [r,dashed,-,yshift=-0.2em]  &
  \cdots 
\end {tikzcd}]]></fr:resource-source></fr:resource></html:figure>
Where the <fr:link href="/forest/dt-0054/" title="Retraction pair" uri="https://liamoc.net/forest/dt-0054/" display-uri="dt-0054" type="local">retraction pairs</fr:link> <fr:tex display="inline"><![CDATA[(f_i, g_i)]]></fr:tex> are defined by:
<fr:tex display="block"><![CDATA[
\begin {array}{lcl}
(f_0,g_0) & \triangleq  & (\lambda  x. \bot , \lambda  x. \bot )\\
(f_{i+1},g_{i+1}) & \triangleq  & \mathcal {F}(f_i,g_i) \\
\end {array}
]]></fr:tex></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-005H/</fr:uri><fr:display-uri>dt-005H</fr:display-uri><fr:route>/forest/dt-005H/</fr:route><fr:title text="The colimit D^\infty ">The colimit <fr:tex display="inline"><![CDATA[D^\infty ]]></fr:tex></fr:title><fr:taxon>Construction</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Given an <fr:link href="/forest/dt-005C/" title="\omega -chains of cpos in the category \mathbf {Cpo}^\textbf {R}" uri="https://liamoc.net/forest/dt-005C/" display-uri="dt-005C" type="local"><fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-chain</fr:link>:</html:p><html:figure><fr:resource hash="329176f23eb6f439327234bd5c64135e"><fr:resource-content><html:img src="/forest/329176f23eb6f439327234bd5c64135e.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz-cd}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
  D_0 \ar [r,"f_0",->,yshift=0.2em]\ar [r,"g_0"', <-,yshift=-0.2em]  &
  D_1 \ar [r,"f_1",->,yshift=0.2em]\ar [r,"g_1"', <-,yshift=-0.2em]  &
  D_2 \ar [r,"f_2",->,yshift=0.2em]\ar [r,"g_2"', <-,yshift=-0.2em]  &
  D_3 \ar [r,-,dashed,yshift=0.2em]\ar [r,dashed,-,yshift=-0.2em]  &
  \cdots 
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure><html:p>The <fr:link href="/forest/dt-005F/" title="Colimits in the category \mathbf {Cpo}^\mathbf {R}" uri="https://liamoc.net/forest/dt-005F/" display-uri="dt-005F" type="local">colimit</fr:link> (or inverse limit) is the <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> of <fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-tuples:
<fr:tex display="block"><![CDATA[
D_\infty \; \triangleq \; \left \{ (x_0, x_1, \dots  ) \mid  x_i \in  D_i \land  x_i = g_i(x_{i+1}) \right \}
]]></fr:tex>
That is, it is countable sequence of elements, one for each domain <fr:tex display="inline"><![CDATA[D_i]]></fr:tex>, where each element is consistent with earlier elements.</html:p><html:p><html:strong>Ordering:</html:strong> The ordering is the pointwise ordering of products, naturally generalised to <fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-tuples. Under this ordering, <fr:tex display="inline"><![CDATA[D_\infty ]]></fr:tex> is a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link>. In fact if each <fr:tex display="inline"><![CDATA[D_i]]></fr:tex> is a <fr:link href="/forest/dt-004G/" title="Scott domain" uri="https://liamoc.net/forest/dt-004G/" display-uri="dt-004G" type="local">Scott domain</fr:link>, so is <fr:tex display="inline"><![CDATA[D_\infty ]]></fr:tex>.



<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Proof</fr:taxon></fr:frontmatter><fr:mainmatter>
<html:p>We shall prove that <fr:tex display="inline"><![CDATA[D_\infty ]]></fr:tex> is an <fr:link href="/forest/dt-005G/" title="Upper bounds in the category \mathbf {Cpo}^\mathbf {R}" uri="https://liamoc.net/forest/dt-005G/" display-uri="dt-005G" type="local">upper bound</fr:link> of the <fr:link href="/forest/dt-005C/" title="\omega -chains of cpos in the category \mathbf {Cpo}^\textbf {R}" uri="https://liamoc.net/forest/dt-005C/" display-uri="dt-005C" type="local"><fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-chain</fr:link>. Proof that it is the <fr:link href="/forest/dt-005F/" title="Colimits in the category \mathbf {Cpo}^\mathbf {R}" uri="https://liamoc.net/forest/dt-005F/" display-uri="dt-005F" type="local">least upper bound</fr:link> is straightforward but tedious, and is omitted.</html:p>
<html:p>We must construct a family of <fr:link href="/forest/dt-0054/" title="Retraction pair" uri="https://liamoc.net/forest/dt-0054/" display-uri="dt-0054" type="local">retraction pairs</fr:link>:
<fr:tex display="block"><![CDATA[\left \{ D_i \xtofrom [\theta _{\infty ,i}]{\theta _{i,\infty }} D_\infty  \middle |\;\; i \in  \mathbb {N}\;\; \right \}]]></fr:tex>
 such that the following diagram commutes:
<html:figure><fr:resource hash="9b35a32b28e6e62700508d065d4079f9"><fr:resource-content><html:img src="/forest/9b35a32b28e6e62700508d065d4079f9.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz-cd}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[\begin {tikzcd}
&&D_\infty \ar [ddll,<-,xshift=-0.8em]\ar [ddll,->,xshift=-0.2em] 
\ar [ddl,<-,xshift=-0.35em]\ar [ddl,->,xshift=0.1em] 
\ar [dd,<-,xshift=-0.1em]\ar [dd,->,xshift=0.3em]  \\
&&&\cdots  \\
  D_0 \ar [r,"f_0",->,yshift=0.2em]\ar [r,"g_0"', <-,yshift=-0.2em]  &
  D_1 \ar [r,"f_1",->,yshift=0.2em]\ar [r,"g_1"', <-,yshift=-0.2em]  &
  D_2  \ar [r,-,dotted,yshift=0.2em]\ar [r,dotted,-,yshift=-0.2em]&
  \cdots 
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>
Defining the projection of the <fr:link href="/forest/dt-0054/" title="Retraction pair" uri="https://liamoc.net/forest/dt-0054/" display-uri="dt-0054" type="local">retraction pair</fr:link> <fr:tex display="inline"><![CDATA[D_i \xtofrom [\theta _{\infty ,i}]{\theta _{i,\infty }} D_\infty ]]></fr:tex> is straightforward:
<fr:tex display="block"><![CDATA[
\theta _{\infty ,i}(x_0,x_1,\dots ) \; \triangleq  \; x_i
]]></fr:tex>
However, to define the <html:em>embedding</html:em> <fr:tex display="inline"><![CDATA[\theta _{i,\infty }]]></fr:tex> requires us to, for a given value <fr:tex display="inline"><![CDATA[x \in  D_i]]></fr:tex>, produce an <fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-tuple of values consistent with <fr:tex display="inline"><![CDATA[x]]></fr:tex> in every domain <fr:tex display="inline"><![CDATA[D_k]]></fr:tex>. We do this by defining <fr:tex display="inline"><![CDATA[\theta _{i,\infty }]]></fr:tex> in terms of helper functions <fr:tex display="inline"><![CDATA[\theta _{i,j}]]></fr:tex>:
<fr:tex display="block"><![CDATA[
\theta _{i,\infty }(x) \; \triangleq  \; (\theta _{i,0}(x),\theta _{i,1}(x),\theta _{i,2}(x),\dots )
]]></fr:tex>
The helper functions <fr:tex display="inline"><![CDATA[\theta _{i,j}]]></fr:tex> are defined by composing sequences of <html:em>embeddings</html:em> (<fr:tex display="inline"><![CDATA[f]]></fr:tex>s) or <html:em>projections</html:em> (<fr:tex display="inline"><![CDATA[g]]></fr:tex>s), depending on whether <fr:tex display="inline"><![CDATA[i < j]]></fr:tex> or <fr:tex display="inline"><![CDATA[j < i]]></fr:tex>. For example, when <fr:tex display="inline"><![CDATA[i = 2]]></fr:tex>:
<fr:tex display="block"><![CDATA[
\begin {array}{lcl} \theta _{2,\infty }(x) &=&  (\theta _{i,0}(x),\theta _{i,1}(x),\theta _{i,2}(x),\theta _{i,3}(x),\theta _{i,4}(x),\dots ) \\[1em]
&=&	(\underbrace {g_0(g_1(x))), g_1(x)}_{\text {\emph {approximations} to}\ x}, x, \underbrace {f_2(x), f_3(f_2(x)),\dots }_{\text {\emph {equivalent} to}\ x})
\end {array}
]]></fr:tex></html:p></fr:mainmatter></fr:tree></html:p></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-005L/</fr:uri><fr:display-uri>dt-005L</fr:display-uri><fr:route>/forest/dt-005L/</fr:route><fr:title text="Semantics of untyped \lambda -calculus">Semantics of untyped <fr:tex display="inline"><![CDATA[\lambda ]]></fr:tex>-calculus</fr:title></fr:frontmatter><fr:mainmatter><html:p>
Recall the untyped <fr:tex display="inline"><![CDATA[\lambda ]]></fr:tex> calculus:
<fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-004K/</fr:uri><fr:display-uri>dt-004K</fr:display-uri><fr:route>/forest/dt-004K/</fr:route><fr:title text="Untyped \lambda -calculus">Untyped <fr:tex display="inline"><![CDATA[\lambda ]]></fr:tex>-calculus</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
	Untyped <fr:tex display="inline"><![CDATA[\lambda ]]></fr:tex>-calculus consists only of untyped (higher-order) functions:
	<fr:tex display="block"><![CDATA[
	e \; \Coloneqq  \; x \mid  \lambda  x. e \mid  e_1\ e_2
]]></fr:tex></html:p></fr:mainmatter></fr:tree>
We mentioned before that the semantic domain of this language must be a cpo <fr:tex display="inline"><![CDATA[D]]></fr:tex> such that <fr:tex display="block"><![CDATA[D \simeq  D\twoheadrightarrow  D]]></fr:tex> In other words, solutions  to this equation are fixed points of <fr:tex display="inline"><![CDATA[\mathcal {F}(X) = X\twoheadrightarrow  X]]></fr:tex>. The least such fixed point can expressed, by <fr:link href="/forest/dt-005B/" title="Fixed point theorem for endofunctors on \textbf {Cpo}^\textbf {R}" uri="https://liamoc.net/forest/dt-005B/" display-uri="dt-005B" type="local">Theorem <fr:contextual-number uri="https://liamoc.net/forest/dt-005B/" display-uri="dt-005B" /></fr:link>, as the <fr:link href="/forest/dt-005H/" title="The colimit D^\infty " uri="https://liamoc.net/forest/dt-005H/" display-uri="dt-005H" type="local">colimit</fr:link> of the <fr:link href="/forest/dt-005C/" title="\omega -chains of cpos in the category \mathbf {Cpo}^\textbf {R}" uri="https://liamoc.net/forest/dt-005C/" display-uri="dt-005C" type="local"><fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-chain</fr:link>:
<html:figure><fr:resource hash="2419a6a3458fc803553ea7529368925f"><fr:resource-content><html:img src="/forest/2419a6a3458fc803553ea7529368925f.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz-cd}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	\mathbf {1} \ar [r,"f_0",->,yshift=0.2em]\ar [r,"g_0"', <-,yshift=-0.2em]  &
	\mathcal {F}(\mathbf {1}) \ar [r,"f_1",->,yshift=0.2em]\ar [r,"g_1"', <-,yshift=-0.2em]  &
	\mathcal {F}(\mathcal {F}(\mathbf {1})) \ar [r,"f_2",->,yshift=0.2em]\ar [r,"g_2"', <-,yshift=-0.2em]  &
	\mathcal {F}(\mathcal {F}(\mathcal {F}(\mathbf {1}))) \ar [r,-,dashed,yshift=0.2em]\ar [r,dashed,-,yshift=-0.2em]  &
	\cdots 
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>
But, the least solution to this equation is <html:em>trivial</html:em>: <fr:tex display="inline"><![CDATA[D_\infty  \simeq  \mathbf {1}]]></fr:tex>, because <fr:tex display="inline"><![CDATA[\mathbf {1} \simeq  \mathbf {1}\twoheadrightarrow  \mathbf {1}]]></fr:tex>. A non-trivial solution is obtained by starting the chain at <fr:tex display="inline"><![CDATA[\mathbf {2}]]></fr:tex>, the <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> containing just <fr:tex display="inline"><![CDATA[\{\top ,\bot \}]]></fr:tex>, rather than <fr:tex display="inline"><![CDATA[\mathbf {1}]]></fr:tex>.
<html:figure><fr:resource hash="52ed1b9206dd4ce15ef64507f1662811"><fr:resource-content><html:img src="/forest/52ed1b9206dd4ce15ef64507f1662811.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz-cd}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	\mathbf {2} \ar [r,"f_0",->,yshift=0.2em]\ar [r,"g_0"', <-,yshift=-0.2em]  &
	\mathcal {F}(\mathbf {2}) \ar [r,"f_1",->,yshift=0.2em]\ar [r,"g_1"', <-,yshift=-0.2em]  &
	\mathcal {F}(\mathcal {F}(\mathbf {2})) \ar [r,"f_2",->,yshift=0.2em]\ar [r,"g_2"', <-,yshift=-0.2em]  &
	\mathcal {F}(\mathcal {F}(\mathcal {F}(\mathbf {2}))) \ar [r,-,dashed,yshift=0.2em]\ar [r,dashed,-,yshift=-0.2em]  &
	\cdots 
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure></html:p><html:p>
We will now sketch a proof of the <fr:link href="/forest/dt-0054/" title="Retraction pair" uri="https://liamoc.net/forest/dt-0054/" display-uri="dt-0054" type="local">retraction pair</fr:link> between <fr:tex display="inline"><![CDATA[D_\infty ]]></fr:tex> and <fr:tex display="inline"><![CDATA[D_\infty  \twoheadrightarrow  D_\infty ]]></fr:tex>, by providing two functions, <fr:tex display="inline"><![CDATA[\textbf {\textsf {up}} : D_\infty  \rightarrow  (D_\infty \twoheadrightarrow  D_\infty )]]></fr:tex> and its inverse <fr:tex display="inline"><![CDATA[\textbf {\textsf {down}} : (D_\infty \twoheadrightarrow  D_\infty ) \rightarrow  D_\infty ]]></fr:tex>. </html:p><html:p>
Observe that each element of <fr:tex display="inline"><![CDATA[D_i]]></fr:tex> (for <fr:tex display="inline"><![CDATA[i > 0]]></fr:tex>) is a <html:em>function</html:em> <fr:tex display="inline"><![CDATA[D_{i-1} \twoheadrightarrow  D_{i-1}]]></fr:tex>. Therefore, an element of <fr:link href="/forest/dt-005H/" title="The colimit D^\infty " uri="https://liamoc.net/forest/dt-005H/" display-uri="dt-005H" type="local">the colimit <fr:tex display="inline"><![CDATA[D_\infty ]]></fr:tex></fr:link> is an <fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-tuple of such functions. To define <fr:tex display="inline"><![CDATA[\textbf {\textsf {up}}(d)(x)]]></fr:tex>, we must essentially "apply" each function in the element <fr:tex display="inline"><![CDATA[d \in  D_\infty ]]></fr:tex> (viewed as an <fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-tuple of functions) to the element <fr:tex display="inline"><![CDATA[x \in  D_\infty ]]></fr:tex> (viewed as an <fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-tuple of values). More specifically, we say that <fr:tex display="inline"><![CDATA[\textbf {\textsf {up}}(d)(x)]]></fr:tex> is an <fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-tuple <fr:tex display="inline"><![CDATA[(y_m \mid  y \in  \mathbb {N})]]></fr:tex>, as follows:
<fr:tex display="block"><![CDATA[
y_m = \bigsqcup _{k \in  \mathbb {N}} \theta _{m+k,m}(d_{m+k+1}(x_{m+k}))
]]></fr:tex>
To define <fr:tex display="inline"><![CDATA[\textbf {\textsf {down}}(f)]]></fr:tex>, we are given a (<fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link>) function <fr:tex display="inline"><![CDATA[f : D_\infty \twoheadrightarrow  D_\infty ]]></fr:tex> and must construct the <fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-tuple of approximations at every <fr:tex display="inline"><![CDATA[D_n]]></fr:tex>. We do this by projecting the action of <fr:tex display="inline"><![CDATA[f]]></fr:tex> down to <fr:tex display="inline"><![CDATA[D_n]]></fr:tex>. We say that <fr:tex display="inline"><![CDATA[\textbf {\textsf {down}}(f)]]></fr:tex> is an <fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-tuple <fr:tex display="inline"><![CDATA[(v_n \mid  n \in  \mathbb {N})]]></fr:tex> where:
<fr:tex display="block"><![CDATA[
\begin {array}{lcl}
	v_0 & \triangleq  & \theta _{\infty ,0}(f(\theta _{0,\infty }(\bot _{D_0})))\\
	v_{n+1} & \triangleq  & \theta _{\infty ,n} \circ  f \circ  \theta _{n,\infty }
\end {array}
]]></fr:tex></html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:title text="Denotations for untyped \lambda -calculus">Denotations for untyped <fr:tex display="inline"><![CDATA[\lambda ]]></fr:tex>-calculus</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
Using the new functions <fr:tex display="inline"><![CDATA[\textbf {\textsf {up}}]]></fr:tex> and <fr:tex display="inline"><![CDATA[\textbf {\textsf {down}}]]></fr:tex>, it is now straightforward to define a semantics for untyped <fr:tex display="inline"><![CDATA[\lambda ]]></fr:tex>-calculus, where <fr:tex display="inline"><![CDATA[\sigma ]]></fr:tex> is an environment <fr:tex display="inline"><![CDATA[\mathsf {Var} \rightarrow  D_\infty ]]></fr:tex>:
<fr:tex display="block"><![CDATA[\llbracket  \cdot  \rrbracket  : (\mathsf {Var} \rightarrow  D_\infty )\twoheadrightarrow  D_\infty ]]></fr:tex>
<fr:tex display="block"><![CDATA[
\begin {array}{lcl}
\llbracket  x \rrbracket  \sigma  	& = & \sigma  (x) \\
\llbracket  e_0\ e_1 \rrbracket  \sigma  & = & \textbf {\textsf {up}}(\llbracket  e_0 \rrbracket  \sigma ) (\llbracket  e_1 \rrbracket  \sigma )\\
\llbracket  \lambda  x.\ e \rrbracket  \sigma  & = & \textbf {\textsf {down}}(\boldsymbol {\lambda } v \in  D_{\infty }.\ \llbracket  e \rrbracket \ \sigma (x \mapsto  v) )
\end {array}
]]></fr:tex>
This semantics does not distinguish non-terminating computations from terminating ones. To model call-by-value more faithfully, we could use the equation <fr:tex display="inline"><![CDATA[D \simeq  D\twoheadrightarrow  D_\bot ]]></fr:tex> instead, and for call-by-name we could use <fr:tex display="inline"><![CDATA[D \simeq  D_\bot \twoheadrightarrow  D_\bot ]]></fr:tex>. The constructions are very similar.
</html:p></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree>
<fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-005V/</fr:uri><fr:display-uri>dt-005V</fr:display-uri><fr:route>/forest/dt-005V/</fr:route><fr:title text="Monadic semantics, Scott domains and nondeterminism">Monadic semantics, Scott domains and nondeterminism</fr:title><fr:taxon>Lecture</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>This lecture is based on material from <fr:link href="/forest/cgunter/" title="Carl Gunter" uri="https://liamoc.net/forest/cgunter/" display-uri="cgunter" type="local">Carl Gunter</fr:link>, <fr:link href="/forest/gwinskel/" title="Glynn Winskel" uri="https://liamoc.net/forest/gwinskel/" display-uri="gwinskel" type="local">Glynn Winskel</fr:link>, <fr:link href="/forest/haskellhutt/" title="Graham Hutton" uri="https://liamoc.net/forest/haskellhutt/" display-uri="haskellhutt" type="local">Graham Hutton</fr:link>, <fr:link href="/forest/kaie/" title="Kai Engelhardt" uri="https://liamoc.net/forest/kaie/" display-uri="kaie" type="local">Kai Engelhardt</fr:link>, <fr:link href="/forest/dexterkozen/" title="Dexter Kozen" uri="https://liamoc.net/forest/dexterkozen/" display-uri="dexterkozen" type="local">Dexter Kozen</fr:link>, <fr:link href="/forest/andrewmyers/" title="Andrew Myers" uri="https://liamoc.net/forest/andrewmyers/" display-uri="andrewmyers" type="local">Andrew Myers</fr:link>, <fr:link href="/forest/jlongley/" title="John Longley" uri="https://liamoc.net/forest/jlongley/" display-uri="jlongley" type="local">John Longley</fr:link>, <fr:link href="/forest/danascott/" title="Dana Scott" uri="https://liamoc.net/forest/danascott/" display-uri="danascott" type="local">Dana Scott</fr:link>, and <fr:link href="/forest/jstoy/" title="Joseph Stoy" uri="https://liamoc.net/forest/jstoy/" display-uri="jstoy" type="local">Joseph Stoy</fr:link>.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-005Z/</fr:uri><fr:display-uri>dt-005Z</fr:display-uri><fr:route>/forest/dt-005Z/</fr:route><fr:title text="Generalising our semantics">Generalising our semantics</fr:title></fr:frontmatter><fr:mainmatter><html:p>We return to <fr:link href="/forest/dt-005R/" title="The \mathcal {C} Language" uri="https://liamoc.net/forest/dt-005R/" display-uri="dt-005R" type="local">the <fr:tex display="inline"><![CDATA[\mathcal {C}]]></fr:tex> language</fr:link> we saw <fr:link href="/forest/dt-0000/" title="The \mathcal {C} Language (without loops)" uri="https://liamoc.net/forest/dt-0000/" display-uri="dt-0000" type="local">previously</fr:link>:</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-005R/</fr:uri><fr:display-uri>dt-005R</fr:display-uri><fr:route>/forest/dt-005R/</fr:route><fr:title text="The \mathcal {C} Language">The <fr:tex display="inline"><![CDATA[\mathcal {C}]]></fr:tex> Language</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p> Using notation similar to <html:em>Backus-Naur Form</html:em> (BNF):
<fr:tex display="block"><![CDATA[
\begin {array}{lcl}
\mathcal {E} & \Coloneqq  & n \mid  x \mid  \mathcal {E}_1 + \mathcal {E}_2 \mid  \mathcal {E}_1 - \mathcal {E}_2\\
\mathcal {B} & \Coloneqq  & \mathsf {false} \mid  \mathsf {true} \mid  \neg  \mathcal {B} \mid  \mathcal {E}_1 = \mathcal {E}_2\\
\mathcal {C} & \Coloneqq  & \mathsf {skip} \mid  x := \mathcal {E} \mid  \mathcal {C}_1 ; \mathcal {C}_2 \mid  \mathsf {if}\ \mathcal {B}\ \mathsf {then}\ \mathcal {C}_1\ \mathsf {else}\ \mathcal {C}_2 \mid  \mathsf {while}\ \mathcal {B}\ \mathsf {do}\ \mathcal {C}\ \mathsf {od}\\
x & \in  & \mathcal {V}\; \textit {(variables)}\\
n & \in  & \mathbb {N}
\end {array}
]]></fr:tex></html:p></fr:mainmatter></fr:tree><html:p>If we wish to add other kinds of effects (beyond mutation of state) to our language, this will necessarily affect the semantic domain. Rather than rewrite the entire semantics for each possible setting, we will generalise the semantics to work over any instance of an algebraic structure, called a <fr:link href="/forest/dm-000U/" title="Monad" uri="https://liamoc.net/forest/dm-000U/" display-uri="dm-000U" type="local">monad</fr:link>.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dm-000U/</fr:uri><fr:display-uri>dm-000U</fr:display-uri><fr:route>/forest/dm-000U/</fr:route><fr:title text="Monad">Monad</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
A <html:em>monad</html:em> on the <fr:link href="/forest/dm-000G/" title="Category" uri="https://liamoc.net/forest/dm-000G/" display-uri="dm-000G" type="local">category</fr:link> <fr:tex display="inline"><![CDATA[\textbf {C}]]></fr:tex> consists of an <fr:link href="/forest/dm-000J/" title="Functor" uri="https://liamoc.net/forest/dm-000J/" display-uri="dm-000J" type="local">endofunctor</fr:link> <fr:tex display="inline"><![CDATA[\mathcal {M} : \textbf {C} \rightarrow  \textbf {C}]]></fr:tex> and two operations (<html:em>natural transformations</html:em>) for all <fr:tex display="inline"><![CDATA[\mathbf {C}]]></fr:tex>-objects <fr:tex display="inline"><![CDATA[X]]></fr:tex>: <fr:tex display="inline"><![CDATA[\mu _X : \mathcal {M}(\mathcal {M}(X)) \rightarrow  \mathcal {M}(X)]]></fr:tex> and <fr:tex display="inline"><![CDATA[\eta _X : X \rightarrow  \mathcal {M}(X)]]></fr:tex>, such that the following <fr:link href="/forest/dm-000L/" title="Commutative diagrams" uri="https://liamoc.net/forest/dm-000L/" display-uri="dm-000L" type="local">diagrams</fr:link> commute:
<html:figure><html:table>
  <html:tr>
	
  <html:td>
	<fr:resource hash="54e7ccef95b13f7bf969ced99a704f53"><fr:resource-content><html:img src="/forest/54e7ccef95b13f7bf969ced99a704f53.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz-cd}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
	\begin {tikzcd}
	\mathcal {M}(\mathcal {M}(\mathcal {M}(X))) \ar [r,"\mathcal {M}(\mu _X)"]
	 \ar [d,"\mu _{\mathcal {M}(X)}"'] & \mathcal {M}(\mathcal {M}(X)) \ar [d,"\mu _X"] \\
	\mathcal {M}(\mathcal {M}(X)) \ar [r,"\mu _X"]& \mathcal {M}(X)
	\end {tikzcd}	
	]]></fr:resource-source></fr:resource>	
	</html:td>

	
  <html:td>
		<fr:resource hash="0b2b8722a4eeb5b140a0c36a8a818fa6"><fr:resource-content><html:img src="/forest/0b2b8722a4eeb5b140a0c36a8a818fa6.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz-cd}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[\begin {tikzcd}
		\mathcal {M}(X) \ar [r,"\eta _{\mathcal {M}(X)}"]
			 \ar [d,"\mathcal {M}(\eta _X)"']\ar [dr,equal] & \mathcal {M}(\mathcal {M}(X)) \ar [d,"\mu _X"] \\
			\mathcal {M}(\mathcal {M}(X)) \ar [r,"\mu _X"]& \mathcal {M}(X)
			\end {tikzcd}]]></fr:resource-source></fr:resource>
	</html:td>
	
	</html:tr>
</html:table></html:figure>
In equational form, these laws are 
<html:ol><html:li><fr:tex display="inline"><![CDATA[\mu _X \circ  \mathcal {M}(\mu _X) = \mu _X \circ  \mu _{\mathcal {M}(X)}]]></fr:tex></html:li>
<html:li><fr:tex display="inline"><![CDATA[\mu _X \circ  \mathcal {M}(\eta _X) =  \mu _X \circ  \eta _{\mathcal {M}(X)} = \mathsf {id}_{\mathcal {M}(X)}]]></fr:tex></html:li></html:ol>
 In computer science, <fr:tex display="inline"><![CDATA[\eta _X]]></fr:tex> is sometimes called <html:em>unit, pure,</html:em> or <html:em>return</html:em>, and <fr:tex display="inline"><![CDATA[\mu _X]]></fr:tex> is usually called <html:em>join</html:em>. 
 </html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-005P/</fr:uri><fr:display-uri>dt-005P</fr:display-uri><fr:route>/forest/dt-005P/</fr:route><fr:title text="Flat domains as monads">Flat domains as monads</fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>The <fr:link href="/forest/dt-0008/" title="Flat domain" uri="https://liamoc.net/forest/dt-0008/" display-uri="dt-0008" type="local">flat domain</fr:link> <fr:link href="/forest/dt-003K/" title="The lifting operator for cpos" uri="https://liamoc.net/forest/dt-003K/" display-uri="dt-003K" type="local">lifting operation</fr:link> <fr:tex display="inline"><![CDATA[(\cdot )_\bot ]]></fr:tex> forms a <fr:link href="/forest/dm-000U/" title="Monad" uri="https://liamoc.net/forest/dm-000U/" display-uri="dm-000U" type="local">monad</fr:link>, where the endofunctor <fr:tex display="inline"><![CDATA[\mathcal {M}(X) = X_\bot ]]></fr:tex>, the operation <fr:tex display="inline"><![CDATA[\mu _X : (X_\bot )_\bot  \rightarrow  X_\bot ]]></fr:tex> collapses the two <fr:tex display="inline"><![CDATA[\bot ]]></fr:tex> values, and <fr:tex display="inline"><![CDATA[\eta _X : X \rightarrow  X_\bot ]]></fr:tex> is simply <fr:tex display="inline"><![CDATA[\eta _X(x) = x]]></fr:tex>.</html:p></fr:mainmatter></fr:tree><html:p>Sometimes it is more convenient to work with the <fr:link href="/forest/dm-000T/" title="Kleisli category" uri="https://liamoc.net/forest/dm-000T/" display-uri="dm-000T" type="local">Kleisli composition</fr:link> operator, rather than the operations <fr:tex display="inline"><![CDATA[\mu ]]></fr:tex> and <fr:tex display="inline"><![CDATA[\eta ]]></fr:tex> directly.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dm-000T/</fr:uri><fr:display-uri>dm-000T</fr:display-uri><fr:route>/forest/dm-000T/</fr:route><fr:title text="Kleisli category">Kleisli category</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>For a <fr:link href="/forest/dm-000U/" title="Monad" uri="https://liamoc.net/forest/dm-000U/" display-uri="dm-000U" type="local">monad</fr:link> <fr:tex display="inline"><![CDATA[(\mathcal {M}, \mu , \eta ) ]]></fr:tex> over the <fr:link href="/forest/dm-000G/" title="Category" uri="https://liamoc.net/forest/dm-000G/" display-uri="dm-000G" type="local">category</fr:link> <fr:tex display="inline"><![CDATA[\mathbf {C}]]></fr:tex>, the <html:em>Kleisli category</html:em> has the same objects as <fr:tex display="inline"><![CDATA[\mathbf {C}]]></fr:tex>, but the morphisms <fr:tex display="inline"><![CDATA[A \xrightarrow {h} B]]></fr:tex> are those morphisms <fr:tex display="inline"><![CDATA[h]]></fr:tex> of <fr:tex display="inline"><![CDATA[\mathbf {C}]]></fr:tex> that have the form <fr:tex display="inline"><![CDATA[A \xrightarrow {h} \mathcal {M}(B)]]></fr:tex>. Composition is defined as follows, for morphisms <fr:tex display="inline"><![CDATA[A \xrightarrow {f} \mathcal {M}(B)]]></fr:tex> and <fr:tex display="inline"><![CDATA[B \xrightarrow {g} \mathcal {M}(C)]]></fr:tex>:
 <fr:tex display="block"><![CDATA[
	 g \circ _K f = \mu _C \circ  \mathcal {M}(g) \circ  f 
 ]]></fr:tex>
 Identity morphisms for this category are just <fr:tex display="inline"><![CDATA[\eta ]]></fr:tex>.
 </html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-005Q/</fr:uri><fr:display-uri>dt-005Q</fr:display-uri><fr:route>/forest/dt-005Q/</fr:route><fr:title text="Monadic semantics for \mathcal {C}">Monadic semantics for <fr:tex display="inline"><![CDATA[\mathcal {C}]]></fr:tex></fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>We define our semantics generically in terms of a <fr:link href="/forest/dm-000U/" title="Monad" uri="https://liamoc.net/forest/dm-000U/" display-uri="dm-000U" type="local">monad</fr:link> <fr:tex display="inline"><![CDATA[(\mathcal {M},\mu ,\eta )]]></fr:tex>, using the <fr:link href="/forest/dm-000T/" title="Kleisli category" uri="https://liamoc.net/forest/dm-000T/" display-uri="dm-000T" type="local">Kleisli composition operator</fr:link> for <fr:tex display="inline"><![CDATA[\mathcal {M}]]></fr:tex>: 
<fr:tex display="block"><![CDATA[
\begin {array}{l}
\mathsf {ite} : (\Sigma  \rightarrow  \mathbb {B}) \times  (\Sigma  \rightarrow  \mathcal {M}(\Sigma )) \times  (\Sigma  \rightarrow  \mathcal {M}(\Sigma )) \rightarrow  (\Sigma  \rightarrow  \mathcal {M}(\Sigma ))\\
\mathsf {ite}(b,t,e)(\sigma ) =  \begin {cases}t(\sigma ) & \text {if}\ b(\sigma ) = T \\ 
			  e(\sigma ) & \text {otherwise}
 \end {cases}
\end {array}
]]></fr:tex>

<fr:tex display="block"><![CDATA[
\begin {array}{lcl}
\llbracket \cdot \rrbracket _\mathcal {C} : \mathcal {C} \rightarrow  \Sigma  \rightarrow  \mathcal {M}(\Sigma )\\[0.4em]
	\llbracket  \mathsf {skip} \rrbracket _\mathcal {C} & = & \eta _\Sigma  \\ 
	\llbracket  x := e \rrbracket _\mathcal {C} & = & \boldsymbol {\lambda } \sigma .\ \eta _\Sigma  (\sigma \left (x \mapsto  \llbracket  e \rrbracket _\mathcal {E}\right )) \\
	\llbracket  c_1 ; c_2 \rrbracket _\mathcal {C} & = & \llbracket  c_2 \rrbracket _\mathcal {C} \circ _K \llbracket  c_1 \rrbracket _\mathcal {C} \\[0.3em]
	\llbracket  \textsf {if}\ b\ \textsf {then}\ c_1\ \textsf {else}\ c_2 \rrbracket _\mathcal {C} & = & \mathsf {ite}(\llbracket  b \rrbracket _\mathcal {B},\llbracket  c_1 \rrbracket _\mathcal {C},\llbracket  c_2 \rrbracket _\mathcal {C})\\
	\llbracket  \textsf {while}\ b\ \textsf {do}\ c\ \textsf {od} \rrbracket _\mathcal {C} & = & \mathbf {\mathbf {fix}}(\boldsymbol {\lambda } f.\ \mathsf {ite}(\llbracket  b \rrbracket _\mathcal {B}, f \circ _K \llbracket  c \rrbracket _\mathcal {C}, \eta _\Sigma ) )
\end {array}
]]></fr:tex></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-005S/</fr:uri><fr:display-uri>dt-005S</fr:display-uri><fr:route>/forest/dt-005S/</fr:route><fr:title text="Instantiating \mathcal {C} with the lifting monad">Instantiating <fr:tex display="inline"><![CDATA[\mathcal {C}]]></fr:tex> with the lifting monad</fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
Instantiating our <fr:link href="/forest/dt-005Q/" title="Monadic semantics for \mathcal {C}" uri="https://liamoc.net/forest/dt-005Q/" display-uri="dt-005Q" type="local">monadic semantics</fr:link> where the <fr:link href="/forest/dm-000U/" title="Monad" uri="https://liamoc.net/forest/dm-000U/" display-uri="dm-000U" type="local">monad</fr:link> <fr:tex display="inline"><![CDATA[\mathcal {M}]]></fr:tex> is <fr:link href="/forest/dt-005P/" title="Flat domains as monads" uri="https://liamoc.net/forest/dt-005P/" display-uri="dt-005P" type="local">flat domain lifting</fr:link>, we recover our <fr:link href="/forest/dt-0004/" title="Denotational semantics for the \mathcal {C} language (without loops)" uri="https://liamoc.net/forest/dt-0004/" display-uri="dt-0004" type="local">original semantics</fr:link> of <fr:tex display="inline"><![CDATA[\mathcal {C}]]></fr:tex>.
</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-005T/</fr:uri><fr:display-uri>dt-005T</fr:display-uri><fr:route>/forest/dt-005T/</fr:route><fr:title text="Instantiating \mathcal {C} with exceptions">Instantiating <fr:tex display="inline"><![CDATA[\mathcal {C}]]></fr:tex> with exceptions</fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
	Let us instantiate our <fr:link href="/forest/dt-005Q/" title="Monadic semantics for \mathcal {C}" uri="https://liamoc.net/forest/dt-005Q/" display-uri="dt-005Q" type="local">monadic semantics</fr:link> with the <fr:link href="/forest/dm-000U/" title="Monad" uri="https://liamoc.net/forest/dm-000U/" display-uri="dm-000U" type="local">monad</fr:link> <fr:tex display="inline"><![CDATA[\mathcal {M}(X) = X_\bot  \oplus  \mathbf {1}]]></fr:tex>, where the added value (from <fr:tex display="inline"><![CDATA[\mathbf {1}]]></fr:tex>) is called <fr:tex display="inline"><![CDATA[\mathsf {fail}]]></fr:tex>. The operation <fr:tex display="inline"><![CDATA[\mu _X : (X_\bot  \oplus  \mathbf {1})_\bot  \oplus  \mathbf {1} \rightarrow  X_\bot  \oplus  \mathbf {1}]]></fr:tex> collapses the two possible <fr:tex display="inline"><![CDATA[\bot ]]></fr:tex> values to <fr:tex display="inline"><![CDATA[\bot ]]></fr:tex> and the two possible <fr:tex display="inline"><![CDATA[\mathsf {fail}]]></fr:tex> values to <fr:tex display="inline"><![CDATA[\mathsf {fail}]]></fr:tex>, and the operation <fr:tex display="inline"><![CDATA[\eta _X : X \rightarrow  X_\bot  \oplus  \mathbf {1}]]></fr:tex> is the straightforward injection.</html:p><html:p>Then we may extend our <fr:link href="/forest/dt-005R/" title="The \mathcal {C} Language" uri="https://liamoc.net/forest/dt-005R/" display-uri="dt-005R" type="local">language</fr:link> with lightweight exception constructs:
	<fr:tex display="block"><![CDATA[\mathcal {C} ::= \dots  \mid  \mathsf {throw} \mid  \mathsf {try}\ \mathcal {C}_1\ \mathsf {catch}\ \mathcal {C}_2]]></fr:tex>
and define their semantics, leaving our <fr:link href="/forest/dt-005Q/" title="Monadic semantics for \mathcal {C}" uri="https://liamoc.net/forest/dt-005Q/" display-uri="dt-005Q" type="local">existing semantics</fr:link> unchanged:	
	<fr:tex display="block"><![CDATA[
\begin {array}{lcl}
\llbracket  \mathsf {throw} \rrbracket \ \sigma  &=& \mathsf {fail} \\
\llbracket  \mathsf {try}\ c_1\ \mathsf {catch}\ c_2 \rrbracket \ \sigma  &=& \begin {cases} \llbracket  c_2 \rrbracket \ \sigma   & \text {if}\ \llbracket  c_1 \rrbracket \ \sigma  = \mathsf {fail} \\
               \llbracket  c_1 \rrbracket \ \sigma  & \text {otherwise}\end {cases}
\end {array}
	]]></fr:tex></html:p></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:title text="Nondeterminism">Nondeterminism</fr:title></fr:frontmatter><fr:mainmatter><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-005U/</fr:uri><fr:display-uri>dt-005U</fr:display-uri><fr:route>/forest/dt-005U/</fr:route><fr:title text="Introduction to nondeterminism">Introduction to nondeterminism</fr:title></fr:frontmatter><fr:mainmatter><html:p>When modelling programming languages we sometimes require a way to be imprecise about some aspects of a program — usually, this takes the form of non-determinism. Non-determinism can be hard for beginners to grasp, but it typically has to be employed when modelling real programs. For example, suppose we had a greeting program that differed depending on the physical location of the computer:
<fr:tex display="block"><![CDATA[
 \begin {array}{l} \textsf {\textbf {if}}\ \mathit {currentLocation}() = \text {Korea}\ \textsf {\textbf {then}} \\ \quad  \textsf {\textbf {say}}\ \text {``안녕하세요''} \\ \textsf {\textbf {else}} \\ \quad  \textsf {\textbf {say}}\ \text {``Hello!''}\\ \textsf {\textbf {fi}}  \end {array}]]></fr:tex>
If we wanted to mathematically model the behaviour of this program, it would be frightfully inconvenient to include the geography of Earth and the computer's physical location in our model. That's where non-determinism comes in. If we abstract away from the geographical details, and instead regard the program as choosing between the two options based on some unspecified criteria, then we can get away with modelling less, at the cost of some detail:
<fr:tex display="block"><![CDATA[
 \begin {array}{l} \textsf {\textbf {if}}\ \mathit {???}\ \textsf {\textbf {then}} \\ \quad  \textsf {\textbf {say}}\ \text {``안녕하세요''} \\ \textsf {\textbf {else}} \\ \quad  \textsf {\textbf {say}}\ \text {``Hello!''}\\ \textsf {\textbf {fi}}  \end {array} ]]></fr:tex>
Such underspecified conditionals are usually called <html:em>non-deterministic choice</html:em>, where our conditional <fr:tex display="inline"><![CDATA[\textsf {\textbf {if}}\ \mathit {???}\ \textsf {\textbf {then}}\ P\ \textsf {\textbf {else}}\ Q\ \textsf {\textbf {fi}}]]></fr:tex> is written simply as <fr:tex display="inline"><![CDATA[P + Q]]></fr:tex>.</html:p><html:p>While we tend to view our physical machines as deterministic automata, the state upon which each decision is deterministically made includes a number of external things which are tedious to model mathematically. We can also use non-determinism to ignore details that we don't care about for our particular domain — a common example is memory allocation, where it is very convenient (for some programs) to think of memory as infinite, and allocation as an operation that can potentially fail, without specifying exactly when and how this failure can occur. This is normally modelled as a choice between successful allocation and a failure state.
</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0060/</fr:uri><fr:display-uri>dt-0060</fr:display-uri><fr:route>/forest/dt-0060/</fr:route><fr:title text="Instantiating our semantics for nondeterminism">Instantiating our semantics for nondeterminism</fr:title></fr:frontmatter><fr:mainmatter><html:p>
Our <fr:link href="/forest/dt-0004/" title="Denotational semantics for the \mathcal {C} language (without loops)" uri="https://liamoc.net/forest/dt-0004/" display-uri="dt-0004" type="local">initial semantics</fr:link> for <fr:tex display="inline"><![CDATA[\mathcal {C}]]></fr:tex> (without loops) was functions on states <fr:tex display="inline"><![CDATA[\Sigma  \rightarrow  \Sigma ]]></fr:tex>. When adding loops, we used a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> <fr:tex display="inline"><![CDATA[\Sigma  \twoheadrightarrow  \Sigma _\bot ]]></fr:tex> for our semantic domain. Since <html:em>non-deterministic</html:em> programs can have more than one outcome, a natural choice of semantic domain would be <fr:tex display="inline"><![CDATA[\Sigma  \twoheadrightarrow  \mathcal {P}(\Sigma _\bot ) \setminus  \emptyset ]]></fr:tex>, i.e., functions from an initial state to a non-empty set of possible outcomes. </html:p><html:p>We can provide <fr:tex display="inline"><![CDATA[\eta ]]></fr:tex> and <fr:tex display="inline"><![CDATA[\mu ]]></fr:tex> operations for our proposed <fr:link href="/forest/dm-000U/" title="Monad" uri="https://liamoc.net/forest/dm-000U/" display-uri="dm-000U" type="local">monad</fr:link> for non-determinism <fr:tex display="inline"><![CDATA[\mathcal {M}(X) = \mathcal {P}(X_\bot ) \setminus  \emptyset ]]></fr:tex>:
<fr:tex display="block"><![CDATA[
\begin {array}{l}
\eta  : X \rightarrow  \mathcal {P}(X_\bot ) \setminus  \emptyset \\
\eta (x) = \{ x \}\\
\mu  : \mathcal {P}{((\mathcal {P}(X_\bot ) \setminus  \emptyset )_\bot )}\rightarrow  \mathcal {P}(X_\bot ) \setminus  \emptyset \\
\mu (S) = (\bigcup _{X \neq  \bot  \in  S} X) \cup  (S \cap  \{ \bot  \})
\end {array}
]]></fr:tex>
And, with this semantics, we can easily add a denotation for a non-deterministic choice operator, in terms of union:
<fr:tex display="block"><![CDATA[
\llbracket  c_1 + c_2 \rrbracket _\mathcal {C} = \lambda  \sigma . \llbracket  c_1 \rrbracket _\mathcal {C} \sigma  \cup   \llbracket  c_2 \rrbracket _\mathcal {C} \sigma  
]]></fr:tex>
Unfortunately this is only the beginning of our troubles. While we have given a valuation function above, its definition uses <fr:tex display="inline"><![CDATA[\textbf {fix}]]></fr:tex>, and therefore our domain <fr:tex display="inline"><![CDATA[\Sigma  \rightarrow  \mathcal {M}(\Sigma )]]></fr:tex> must be a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link>, and all our operations <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link>. It is not clear how to order elements of <fr:tex display="inline"><![CDATA[\mathcal {P}(X_\bot ) \setminus  \emptyset ]]></fr:tex>. A natural choice of ordering would be subset inclusion <fr:tex display="inline"><![CDATA[\subseteq ]]></fr:tex>. However, as we lack <fr:tex display="inline"><![CDATA[\emptyset ]]></fr:tex>, there is no least element for this ordering. Furthermore, simply using <fr:tex display="inline"><![CDATA[\subseteq ]]></fr:tex> as our ordering would mean that the deterministic, terminating program that always returns a single state <fr:tex display="inline"><![CDATA[\{ \sigma  \}]]></fr:tex> would be considered <html:em>less</html:em> informative than the program that may diverge <fr:tex display="inline"><![CDATA[\{ \bot , \sigma  \}]]></fr:tex>. This would make most of our operations non-<fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link>.</html:p><html:p>
Instead, we shall examine three separate orderings on this set, each of which carries a different view of non-determinism. More generally, we wish to come up with a construction analogous to the powerset operator <fr:tex display="inline"><![CDATA[\mathcal {P}]]></fr:tex>, but for our semantic domains — a <html:em>powerdomain</html:em>. However, for these orderings to produce valid <fr:link href="/forest/dm-0000/" title="Partial order" uri="https://liamoc.net/forest/dm-0000/" display-uri="dm-0000" type="local">partial orders</fr:link>, we require a certain  <fr:link href="/forest/dt-0049/" title="Representation theorem for algebraic cpos" uri="https://liamoc.net/forest/dt-0049/" display-uri="dt-0049" type="local">theorem</fr:link> that only applies to a certain class of <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link>, called "<fr:link href="/forest/dt-0041/" title="Algebraicity" uri="https://liamoc.net/forest/dt-0041/" display-uri="dt-0041" type="local">algebraic</fr:link>" cpos. Thus, we will first introduce a richer class of cpos, called <html:em>Scott domains</html:em>, and then return to the problem of non-determinism.</html:p></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-005W/</fr:uri><fr:display-uri>dt-005W</fr:display-uri><fr:route>/forest/dt-005W/</fr:route><fr:title text="Scott domains">Scott domains</fr:title></fr:frontmatter><fr:mainmatter><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0040/</fr:uri><fr:display-uri>dt-0040</fr:display-uri><fr:route>/forest/dt-0040/</fr:route><fr:title text="Compactness and Finiteness">Compactness and Finiteness</fr:title></fr:frontmatter><fr:mainmatter><html:p>We begin by formalising the notion of an element in a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> representing a <html:em>finite</html:em> amount of information. </html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-003W/</fr:uri><fr:display-uri>dt-003W</fr:display-uri><fr:route>/forest/dt-003W/</fr:route><fr:title text="Boring and interesting sets">Boring and interesting sets</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
There are two kinds of <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed sets</fr:link>:
<html:ol><html:li><html:em>Boring</html:em> sets contain their <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link>. <html:br /> <html:strong>Example</html:strong>: Finite directed sets are boring (but boring sets aren't all finite!). </html:li>
  <html:li><html:em>Interesting</html:em> sets don't contain their <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link>. <html:br /> <html:strong>Example</html:strong>: <fr:tex display="inline"><![CDATA[\mathbb {N}]]></fr:tex> in the chain <fr:tex display="inline"><![CDATA[\mathbb {N} \cup  \{ \infty  \}]]></fr:tex> is interesting.</html:li></html:ol></html:p></fr:mainmatter></fr:tree><html:p>
Following the above intuition, we might be tempted to say that the <html:em>"infinite"</html:em> elements of a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> are those which are the <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link> of an <fr:link href="/forest/dt-003W/" title="Boring and interesting sets" uri="https://liamoc.net/forest/dt-003W/" display-uri="dt-003W" type="local">interesting</fr:link> set, but this notion is too weak. Consider this <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> <fr:tex display="inline"><![CDATA[X]]></fr:tex>:
<html:figure><fr:resource hash="2c7c020843b32f423a60f20dbc0d849a"><fr:resource-content><html:img src="/forest/2c7c020843b32f423a60f20dbc0d849a.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz-cd,amsmath,amssymb}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
\infty \\
2\ar [u,thick,-,dotted]\\
1\ar [u,thick,-] & & x\ar [uull,thick,-]\\
0\ar [u,thick,-] \\
& \bot  \ar [ul,thick,-]\ar [uur,thick,-]	
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>
By the above definition, the only infinite element would be <fr:tex display="inline"><![CDATA[\infty ]]></fr:tex>, but if we consider the following isomorphic <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link>, ordered by subset inclusion:
<html:figure><fr:resource hash="f30f0f74982da66df150e7869d312316"><fr:resource-content><html:img src="/forest/f30f0f74982da66df150e7869d312316.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz-cd,amsmath,amssymb}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
\mathbb {N}\\
\{0,1,2\}\ar [u,thick,-,dotted]\\
\{0,1\}\ar [u,thick,-] & & x\ar [uull,thick,-]\\
\{0\}\ar [u,thick,-] \\
& \emptyset  \ar [ul,thick,-]\ar [uur,thick,-]	
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>
Then the set <fr:tex display="inline"><![CDATA[x]]></fr:tex> cannot be a finite set, as any finite set would be a subset of one of the finite sets in the chain <fr:tex display="inline"><![CDATA[\emptyset  \sqsubseteq  \Set { 0 } \sqsubseteq  \Set {0,1} \sqsubseteq  \cdots ]]></fr:tex>. Thus, it makes more sense for us to call <fr:tex display="inline"><![CDATA[x]]></fr:tex> an <html:em>"infinite"</html:em> element as well.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-003U/</fr:uri><fr:display-uri>dt-003U</fr:display-uri><fr:route>/forest/dt-003U/</fr:route><fr:title text="Compactness">Compactness</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
Let <fr:tex display="inline"><![CDATA[A]]></fr:tex> be a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link>. Then <fr:tex display="inline"><![CDATA[x \in  A]]></fr:tex> is <html:em>compact</html:em> (a.k.a. <html:em>finite</html:em>) iff for all <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link> <fr:tex display="inline"><![CDATA[X \subseteq  A]]></fr:tex>:
<fr:tex display="block"><![CDATA[
x \sqsubseteq  \bigsqcup  X \implies  \exists  y \in  X.\ x \sqsubseteq  y 
]]></fr:tex>
In English: A compact element will approximate some element of a <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link> set if it approximates the <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link>. We write <fr:tex display="inline"><![CDATA[\mathsf {K}(A)]]></fr:tex> for the set of compact elements of <fr:tex display="inline"><![CDATA[A]]></fr:tex>, i.e.:
<fr:tex display="block"><![CDATA[\mathsf {K}(A) = \{x \in  A \mid  x\ \text {is compact} \}]]></fr:tex></html:p></fr:mainmatter></fr:tree><html:p>In the example cpo <fr:tex display="inline"><![CDATA[X]]></fr:tex> above, all the elements except <fr:tex display="inline"><![CDATA[\infty ]]></fr:tex> and <fr:tex display="inline"><![CDATA[x]]></fr:tex> would be <fr:link href="/forest/dt-003U/" title="Compactness" uri="https://liamoc.net/forest/dt-003U/" display-uri="dt-003U" type="local">compact</fr:link>. Thus, compactness better captures our notion of an element representing a finite amount of information. This understanding of <fr:link href="/forest/dt-003U/" title="Compactness" uri="https://liamoc.net/forest/dt-003U/" display-uri="dt-003U" type="local">compact</fr:link> elements is a generalisation of the notion of a finite element from the theory of algebraic lattices.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-003V/</fr:uri><fr:display-uri>dt-003V</fr:display-uri><fr:route>/forest/dt-003V/</fr:route><fr:title text="Compact elements">Compact elements</fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter><html:ul><html:li>Every element in a finite <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> is <fr:link href="/forest/dt-003U/" title="Compactness" uri="https://liamoc.net/forest/dt-003U/" display-uri="dt-003U" type="local">compact</fr:link>. More generally, every element of a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> of finite <html:em>height</html:em> (e.g. <fr:tex display="inline"><![CDATA[\mathbb {Z}_\bot ]]></fr:tex>) is <fr:link href="/forest/dt-003U/" title="Compactness" uri="https://liamoc.net/forest/dt-003U/" display-uri="dt-003U" type="local">compact</fr:link>. This is because finite <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed sets</fr:link> are always <fr:link href="/forest/dt-003W/" title="Boring and interesting sets" uri="https://liamoc.net/forest/dt-003W/" display-uri="dt-003W" type="local">boring</fr:link>.</html:li>
<html:li> Take the <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link>  <fr:tex display="inline"><![CDATA[\mathcal {P}(X)]]></fr:tex> of subsets of <fr:tex display="inline"><![CDATA[X]]></fr:tex> ordered by inclusion <fr:tex display="inline"><![CDATA[\subseteq ]]></fr:tex>, as seen in <fr:link href="/forest/dt-001G/" title="https://liamoc.net/forest/dt-001G/" uri="https://liamoc.net/forest/dt-001G/" display-uri="dt-001G" type="local">Exercise <fr:contextual-number uri="https://liamoc.net/forest/dt-001G/" display-uri="dt-001G" /></fr:link>. The <fr:link href="/forest/dt-003U/" title="Compactness" uri="https://liamoc.net/forest/dt-003U/" display-uri="dt-003U" type="local">compact</fr:link> elements of <fr:tex display="inline"><![CDATA[\mathcal {P}(X)]]></fr:tex> are those of finite cardinality. </html:li>
<html:li> Take the <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> <fr:tex display="inline"><![CDATA[\mathbb {N} \nrightarrow  \mathbb {N}]]></fr:tex> of partial functions on the natural numbers, ordered by inclusion of graphs. The <fr:link href="/forest/dt-003U/" title="Compactness" uri="https://liamoc.net/forest/dt-003U/" display-uri="dt-003U" type="local">compact</fr:link> elements of  <fr:tex display="inline"><![CDATA[\mathbb {N} \nrightarrow  \mathbb {N}]]></fr:tex> are the functions which are defined only for finite domains. </html:li></html:ul></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-003X/</fr:uri><fr:display-uri>dt-003X</fr:display-uri><fr:route>/forest/dt-003X/</fr:route><fr:title text="Compact elements with infinitely many approximations ">Compact elements with infinitely many approximations </fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter><html:div class="sidefigure">
<fr:resource hash="b3fb1a494d7e6f1162b2f2c3e2d27d68"><fr:resource-content><html:img src="/forest/b3fb1a494d7e6f1162b2f2c3e2d27d68.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz-cd}\usetikzlibrary {decorations.pathreplacing}\usepackage {amsmath}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[\begin {tikzcd}
  \infty  + 1& \ar [l,thick]\text {\scriptsize  compact}\\
  \infty \ar [u,-,thick] & \ar [l,thick]\text {\scriptsize  non-compact}\\
  2\ar [u,-,thick, dotted] & \quad \arrow [dd, start anchor=north, end anchor=south, no head, xshift=-1em, decorate, decoration={brace,amplitude=10pt,raise=-15pt}, thick,"\text {compact}" right=0pt]\\
  1\ar [u,-,thick]\\
  0\ar [u,-,thick] & \quad 
\end {tikzcd}]]></fr:resource-source></fr:resource>
</html:div><html:p><fr:link href="/forest/dt-003U/" title="Compactness" uri="https://liamoc.net/forest/dt-003U/" display-uri="dt-003U" type="local">Compact</fr:link> elements may still have an infinite number of approximations. Consider the <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> <fr:tex display="inline"><![CDATA[\mathbb {N} \cup  \{ \infty , \infty  + 1 \}]]></fr:tex>, where we have tacked on an additional top element  <fr:tex display="inline"><![CDATA[\infty  + 1]]></fr:tex> to our normal <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> of natural numbers extended with infinity. Then, while <fr:tex display="inline"><![CDATA[\infty ]]></fr:tex> is not <fr:link href="/forest/dt-003U/" title="Compactness" uri="https://liamoc.net/forest/dt-003U/" display-uri="dt-003U" type="local">compact</fr:link>, <fr:tex display="inline"><![CDATA[\infty  + 1]]></fr:tex> <html:em>is</html:em> <fr:link href="/forest/dt-003U/" title="Compactness" uri="https://liamoc.net/forest/dt-003U/" display-uri="dt-003U" type="local">compact</fr:link> — it is not the <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link> of an <fr:link href="/forest/dt-003W/" title="Boring and interesting sets" uri="https://liamoc.net/forest/dt-003W/" display-uri="dt-003W" type="local">interesting</fr:link> <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed set</fr:link>. If <fr:tex display="inline"><![CDATA[\infty  + 1]]></fr:tex> is the <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link> of a set <fr:tex display="inline"><![CDATA[X]]></fr:tex> then <fr:tex display="inline"><![CDATA[\infty  + 1]]></fr:tex> must be in the set <fr:tex display="inline"><![CDATA[X]]></fr:tex>. Nonetheless, there are an infinite number  of <html:em>approximations</html:em> to <fr:tex display="inline"><![CDATA[\infty  + 1]]></fr:tex>, i.e., elements <fr:tex display="inline"><![CDATA[x]]></fr:tex> such that <fr:tex display="inline"><![CDATA[x \sqsubseteq  \infty  + 1]]></fr:tex>.</html:p><html:p>As an aside, requiring that our <fr:link href="/forest/dt-003U/" title="Compactness" uri="https://liamoc.net/forest/dt-003U/" display-uri="dt-003U" type="local">compact</fr:link> elements have a <html:em>truly</html:em> finite number of approximations is the basis for the theory of <html:em>Berry domains and stable functions</html:em>.</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-003Y/</fr:uri><fr:display-uri>dt-003Y</fr:display-uri><fr:route>/forest/dt-003Y/</fr:route><fr:title text="Submonoids as a cpo">Submonoids as a cpo</fr:title><fr:taxon>Theorem</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>The <fr:link href="/forest/dm-000R/" title="Submonoid" uri="https://liamoc.net/forest/dm-000R/" display-uri="dm-000R" type="local">submonoids</fr:link> of a <fr:link href="/forest/dm-000O/" title="Monoid" uri="https://liamoc.net/forest/dm-000O/" display-uri="dm-000O" type="local">monoid</fr:link> <fr:tex display="inline"><![CDATA[(X, \iota , \bullet )]]></fr:tex> form a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> under <fr:tex display="inline"><![CDATA[\subseteq ]]></fr:tex>, where union gives the <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link>.</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-003Z/</fr:uri><fr:display-uri>dt-003Z</fr:display-uri><fr:route>/forest/dt-003Z/</fr:route><fr:title text="Both infinite and compact">Both infinite and compact</fr:title><fr:taxon>Exercise</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Find a set in the <fr:link href="/forest/dt-003Y/" title="Submonoids as a cpo" uri="https://liamoc.net/forest/dt-003Y/" display-uri="dt-003Y" type="local">cpo of submonoids</fr:link> of <fr:tex display="inline"><![CDATA[(\mathbb {N},0,+)]]></fr:tex> that is <html:em>both</html:em> infinite and <fr:link href="/forest/dt-003U/" title="Compactness" uri="https://liamoc.net/forest/dt-003U/" display-uri="dt-003U" type="local">compact</fr:link>.</html:p>



<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>
<html:p>Take <fr:tex display="inline"><![CDATA[E \triangleq  \{ n \in  \mathbb {N} \mid  n\ \text {is even}\}]]></fr:tex>. Let <fr:tex display="inline"><![CDATA[Y \subseteq  \mathcal {P}(\mathbb {N})]]></fr:tex> be directed and <fr:tex display="inline"><![CDATA[E \subseteq  \bigcup  Y]]></fr:tex>. Since <fr:tex display="inline"><![CDATA[2 \in  E]]></fr:tex> there must exist <fr:tex display="inline"><![CDATA[y \in  Y]]></fr:tex> such that <fr:tex display="inline"><![CDATA[2 \in  Y]]></fr:tex>. Since <fr:tex display="inline"><![CDATA[(y,0,+)]]></fr:tex> is a <fr:link href="/forest/dm-000O/" title="Monoid" uri="https://liamoc.net/forest/dm-000O/" display-uri="dm-000O" type="local">monoid</fr:link>, every positive multiple of <fr:tex display="inline"><![CDATA[2]]></fr:tex> is also in <fr:tex display="inline"><![CDATA[y]]></fr:tex>, thus <fr:tex display="inline"><![CDATA[E \subseteq  y]]></fr:tex> and therefore <fr:tex display="inline"><![CDATA[E]]></fr:tex> is <fr:link href="/forest/dt-003U/" title="Compactness" uri="https://liamoc.net/forest/dt-003U/" display-uri="dt-003U" type="local">compact</fr:link>.</html:p>
<html:p>Seeing as <fr:link href="/forest/dt-003U/" title="Compactness" uri="https://liamoc.net/forest/dt-003U/" display-uri="dt-003U" type="local">compact</fr:link> elements are also sometimes called <html:em>finite</html:em>, this is surprising as <fr:tex display="inline"><![CDATA[E]]></fr:tex> is an infinite set. The reason it is nonetheless <fr:link href="/forest/dt-003U/" title="Compactness" uri="https://liamoc.net/forest/dt-003U/" display-uri="dt-003U" type="local">compact</fr:link> is that <fr:tex display="inline"><![CDATA[E]]></fr:tex> is <html:em>finitely generated</html:em> — it is the smallest <fr:link href="/forest/dm-000R/" title="Submonoid" uri="https://liamoc.net/forest/dm-000R/" display-uri="dm-000R" type="local">submonoid</fr:link> of <fr:tex display="inline"><![CDATA[(\mathbb {N},0,+)]]></fr:tex> such that the <html:em>finite</html:em> set <fr:tex display="inline"><![CDATA[\{ 2 \} \subseteq  E]]></fr:tex>. In fact, the <fr:link href="/forest/dt-003U/" title="Compactness" uri="https://liamoc.net/forest/dt-003U/" display-uri="dt-003U" type="local">compact</fr:link> <fr:link href="/forest/dm-000R/" title="Submonoid" uri="https://liamoc.net/forest/dm-000R/" display-uri="dm-000R" type="local">submonoids</fr:link> of <fr:tex display="inline"><![CDATA[(\mathbb {N},0,+)]]></fr:tex> are precisely the finitely generated ones.
</html:p>
</fr:mainmatter></fr:tree></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-005X/</fr:uri><fr:display-uri>dt-005X</fr:display-uri><fr:route>/forest/dt-005X/</fr:route><fr:title text="Algebraicity and ideals">Algebraicity and ideals</fr:title></fr:frontmatter><fr:mainmatter><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0041/</fr:uri><fr:display-uri>dt-0041</fr:display-uri><fr:route>/forest/dt-0041/</fr:route><fr:title text="Algebraicity">Algebraicity</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>A <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> is <html:em>algebraic</html:em> iff every element is the <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link> of its <fr:link href="/forest/dt-003U/" title="Compactness" uri="https://liamoc.net/forest/dt-003U/" display-uri="dt-003U" type="local">compact</fr:link> approximations. That is, a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> <fr:tex display="inline"><![CDATA[D]]></fr:tex> is <html:em>algebraic</html:em> iff for all <fr:tex display="inline"><![CDATA[x \in  D]]></fr:tex>,
<html:ol><html:li><fr:tex display="inline"><![CDATA[\mathop {\downarrow }(x) = \{ y \in  \mathsf {K}(D) \mid  y \sqsubseteq  x \}]]></fr:tex> is <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link>;</html:li>
<html:li><fr:tex display="inline"><![CDATA[x = \bigsqcup \mathop {\downarrow }(x)]]></fr:tex></html:li></html:ol>
<html:strong>Note</html:strong>: It's common in semantics to consider only algebraic <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> with a <html:em>countable</html:em> set of <fr:link href="/forest/dt-003U/" title="Compactness" uri="https://liamoc.net/forest/dt-003U/" display-uri="dt-003U" type="local">compact</fr:link> elements. Such <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> are called <html:em><fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-algebraic</html:em>.</html:p><html:p><html:strong>Aside</html:strong>: Plotkin provides an equivalent definition of <fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-algebraic <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> in which <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed sets</fr:link> are replaced with <fr:link href="/forest/dt-000W/" title="\omega -chain" uri="https://liamoc.net/forest/dt-000W/" display-uri="dt-000W" type="local"><fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-chains</fr:link> throughout. <fr:link href="/forest/haskellhutt/" title="Graham Hutton" uri="https://liamoc.net/forest/haskellhutt/" display-uri="haskellhutt" type="local">Hutton</fr:link> claims this is less appealing, as the definition speaks of <html:em>an</html:em> <fr:link href="/forest/dt-000W/" title="\omega -chain" uri="https://liamoc.net/forest/dt-000W/" display-uri="dt-000W" type="local"><fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-chain</fr:link> of <fr:link href="/forest/dt-003U/" title="Compactness" uri="https://liamoc.net/forest/dt-003U/" display-uri="dt-003U" type="local">compact</fr:link> approximations, rather than <html:em>the</html:em> <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed set</fr:link> of such.</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0042/</fr:uri><fr:display-uri>dt-0042</fr:display-uri><fr:route>/forest/dt-0042/</fr:route><fr:title text="\omega -algebraic cpos"><fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-algebraic cpos</fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
Many standard examples of <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> are <fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-<fr:link href="/forest/dt-0041/" title="Algebraicity" uri="https://liamoc.net/forest/dt-0041/" display-uri="dt-0041" type="local">algebraic</fr:link> <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link>: finite cpos, subsets <fr:tex display="inline"><![CDATA[\mathcal {P}(X)]]></fr:tex> of a set <fr:tex display="inline"><![CDATA[X]]></fr:tex>, partial functions <fr:tex display="inline"><![CDATA[\mathbb {N} \nrightarrow  \mathbb {N}]]></fr:tex> and <fr:link href="/forest/dt-003Y/" title="Submonoids as a cpo" uri="https://liamoc.net/forest/dt-003Y/" display-uri="dt-003Y" type="local">submonoids of a monoid</fr:link>. In general, any <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> of subalgebras (e.g. subgroups of a group, subrings of a ring etc.) is <fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-<fr:link href="/forest/dt-0041/" title="Algebraicity" uri="https://liamoc.net/forest/dt-0041/" display-uri="dt-0041" type="local">algebraic</fr:link>. This is the origin of the terminology.
</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0043/</fr:uri><fr:display-uri>dt-0043</fr:display-uri><fr:route>/forest/dt-0043/</fr:route><fr:title text="Non-algebraic cpo">Non-algebraic cpo</fr:title><fr:taxon>Counterexample</fr:taxon></fr:frontmatter><fr:mainmatter><html:div class="sidefigure">
<fr:resource hash="32e2a4c71315c035e2bfc254c257d071"><fr:resource-content><html:img src="/forest/32e2a4c71315c035e2bfc254c257d071.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz-cd}\usetikzlibrary {decorations.pathreplacing}\usepackage {amsmath}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
	\begin {tikzcd}
	\infty \\
	1\ar [u,thick,-,dotted] & & x\ar [ull,thick,-]\\
	0\ar [u,thick,-] \\
	& \bot  \ar [ul,thick,-]\ar [uur,thick,-]	
	\end {tikzcd}
]]></fr:resource-source></fr:resource>
</html:div><html:p>In the <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> on the right (seen also in <fr:link href="/forest/dt-0040/" title="Compactness and Finiteness" uri="https://liamoc.net/forest/dt-0040/" display-uri="dt-0040" type="local">§ <fr:contextual-number uri="https://liamoc.net/forest/dt-0040/" display-uri="dt-0040" /></fr:link>), the element <fr:tex display="inline"><![CDATA[x]]></fr:tex> is not the <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link> of its <fr:link href="/forest/dt-003U/" title="Compactness" uri="https://liamoc.net/forest/dt-003U/" display-uri="dt-003U" type="local">compact</fr:link> approximations. The only <fr:link href="/forest/dt-003U/" title="Compactness" uri="https://liamoc.net/forest/dt-003U/" display-uri="dt-003U" type="local">compact</fr:link> element that approximates <fr:tex display="inline"><![CDATA[x]]></fr:tex> is <fr:tex display="inline"><![CDATA[\bot ]]></fr:tex>, and the <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">least upper bound</fr:link> of the set <fr:tex display="inline"><![CDATA[\{\bot \}]]></fr:tex> is just <fr:tex display="inline"><![CDATA[\bot ]]></fr:tex>, not <fr:tex display="inline"><![CDATA[x]]></fr:tex>. That is:
<fr:tex display="block"><![CDATA[\mathop {\downarrow }(x) = \{\bot \}]]></fr:tex>
but:
<fr:tex display="block"><![CDATA[x \neq  \bigsqcup \{\bot \}]]></fr:tex></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0045/</fr:uri><fr:display-uri>dt-0045</fr:display-uri><fr:route>/forest/dt-0045/</fr:route><fr:title text="Nothing suddenly invented at infinity">Nothing suddenly invented at infinity</fr:title><fr:taxon>Theorem</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Let <fr:tex display="inline"><![CDATA[D]]></fr:tex> and <fr:tex display="inline"><![CDATA[E]]></fr:tex> be <fr:link href="/forest/dt-0041/" title="Algebraicity" uri="https://liamoc.net/forest/dt-0041/" display-uri="dt-0041" type="local">algebraic</fr:link> <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link>. Then a function <fr:tex display="inline"><![CDATA[f : D \rightarrow  E]]></fr:tex> is <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link> iff, for all <fr:tex display="inline"><![CDATA[x \in  D]]></fr:tex>: <fr:tex display="block"><![CDATA[f(x) = \bigsqcup \ \{ f(a) \mid  a \in  \mathop {\downarrow }(x) \}]]></fr:tex>
In other words, in an <fr:link href="/forest/dt-0041/" title="Algebraicity" uri="https://liamoc.net/forest/dt-0041/" display-uri="dt-0041" type="local">algebraic</fr:link> <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link>, <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous functions</fr:link> are completely defined by their behaviour for <fr:link href="/forest/dt-003U/" title="Compactness" uri="https://liamoc.net/forest/dt-003U/" display-uri="dt-003U" type="local">compact</fr:link> arguments.</html:p><html:p>This makes precise our earlier slogan in <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">Definition <fr:contextual-number uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" /></fr:link>, that <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous functions</fr:link> don't suddenly behave differently for infinite (i.e. non-<fr:link href="/forest/dt-003U/" title="Compactness" uri="https://liamoc.net/forest/dt-003U/" display-uri="dt-003U" type="local">compact</fr:link>) elements.</html:p>


<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Proof</fr:taxon></fr:frontmatter><fr:mainmatter>
First, assuming <fr:tex display="inline"><![CDATA[f]]></fr:tex> is <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link>, we show that <fr:tex display="inline"><![CDATA[f(x) = \bigsqcup \ \{ f(a) \mid  a \in  \mathop {\downarrow }(x) \}]]></fr:tex>:
<fr:tex display="block"><![CDATA[
\begin {array}{lclr}
f(x) & = & f(\bigsqcup  \mathop {\downarrow }(x)) & \text {($D$ is {algebraic})}\\
&=&\bigsqcup \ \{ f(a) \mid  a \in  \mathop {\downarrow }(x) \} & \text {($f$ is continuous)}\\
\end {array}
]]></fr:tex>	
It remains to show that if <fr:tex display="inline"><![CDATA[f(x) = \bigsqcup \ \{ f(a) \mid  a \in  \mathop {\downarrow }(x) \}]]></fr:tex>, then <fr:tex display="inline"><![CDATA[f]]></fr:tex> is <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link>. Using the <fr:link href="/forest/dt-001O/" title="Alternative characterisation of continuity" uri="https://liamoc.net/forest/dt-001O/" display-uri="dt-001O" type="local">alternative definition</fr:link>, we shall first show that <fr:tex display="inline"><![CDATA[f]]></fr:tex> is <fr:link href="/forest/dt-000J/" title="Monotonicity" uri="https://liamoc.net/forest/dt-000J/" display-uri="dt-000J" type="local">monotone</fr:link>. Let <fr:tex display="inline"><![CDATA[a \sqsubseteq  b]]></fr:tex> for <fr:tex display="inline"><![CDATA[a,b \in  D]]></fr:tex>. Then <fr:tex display="inline"><![CDATA[\mathop {\downarrow }(a) \subseteq  \mathop {\downarrow }(b)]]></fr:tex> and thus <fr:tex display="inline"><![CDATA[\{f(x) \mid  x \in  \mathop {\downarrow }(a)\} \subseteq  \{f(x) \mid  x \in  \mathop {\downarrow }(b)\}]]></fr:tex>, therefore:
<fr:tex display="block"><![CDATA[
\begin {array}{lclr}
f(a) &=&\bigsqcup \ \{ f(x) \mid  x \in  \mathop {\downarrow }(a) \} & \text {(assumption)}\\
     & \sqsubseteq  &\bigsqcup \ \{ f(x) \mid  x \in  \mathop {\downarrow }(b) \} & \text {(from above)}\\
	 & = & f(b) & \text {(assumption)}\\
\end {array}
]]></fr:tex>
Next, let <fr:tex display="inline"><![CDATA[X \subseteq  D]]></fr:tex> be <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link>.
<fr:tex display="block"><![CDATA[\begin {array}{lclr}
f(\bigsqcup  X) &=&\bigsqcup \ \{ f(x) \mid  x \in  \mathop {\downarrow }(\bigsqcup  X) \} & \text {(assumption)}\\
&=&\bigsqcup \ \{ f(x) \mid  x \in  \mathsf {K}(X) \land  x \sqsubseteq  \bigsqcup  X \} & \text {(defn.~of $\downarrow $)}\\
&=&\bigsqcup \ \{ f(x) \mid  \exists  y \in  X.\  x \in  \mathsf {K}(X) \land  x \sqsubseteq  y \} & \text {(compactness)}\\
&=&\bigsqcup \ \{ f(x) \mid  \exists  y \in  X.\  x \in  \mathop {\downarrow }(y)\} & \text {(defn.~of $\downarrow $)}\\
&=&\bigsqcup \ \{ f(x) \mid  x \in  X\} & \text {(algebraicity)}\\
\end {array}]]></fr:tex>
</fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0044/</fr:uri><fr:display-uri>dt-0044</fr:display-uri><fr:route>/forest/dt-0044/</fr:route><fr:taxon>Exercise</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Let <fr:tex display="inline"><![CDATA[f : D \twoheadrightarrow  E]]></fr:tex> be a <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link> function between <fr:link href="/forest/dt-0041/" title="Algebraicity" uri="https://liamoc.net/forest/dt-0041/" display-uri="dt-0041" type="local">algebraic</fr:link> <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link>. Define:
<fr:tex display="block"><![CDATA[G_f = \{ (a,b) \in  \mathsf {K}(D) \times  \mathsf {K}(E) \mid  b \sqsubseteq  f(a) \}]]></fr:tex>
Then for all <fr:tex display="inline"><![CDATA[x \in  D]]></fr:tex>, prove that:
<fr:tex display="block"><![CDATA[
f(x) = \bigsqcup \ \{ b \mid  (a,b) \in  G_f  \land  a \sqsubseteq  x \}
]]></fr:tex></html:p>



<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>
<fr:tex display="block"><![CDATA[
\begin {array}{lclr}
f(x) & = & f(\bigsqcup  \mathop {\downarrow }(x)) & \text {($D$ is {algebraic})}\\
&=&\bigsqcup \ \{ f(a) \mid  a \in  \mathop {\downarrow }(x) \} & \text {($f$ is continuous)}\\
&=&\bigsqcup \ \left \{ \bigsqcup  \mathop {\downarrow }(f(a)) \mid  a \in  \mathop {\downarrow }(x) \right \} & \text {($E$ is {algebraic})}\\
&=&\bigsqcup \ \{ b \in  \mathsf {K}(E) \mid  b \sqsubseteq  f(a) \land  a \in  \mathop {\downarrow }(x)\} & \text {(lubs and defn of $\downarrow $)}\\
&=&\bigsqcup \ \{ b \mid  (a,b) \in  G_f \land  a \sqsubseteq  x \}&\text {(defn of $G_f$)}
\end {array}
]]></fr:tex>	
</fr:mainmatter></fr:tree><html:p>This is powerful. For example, the <fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link> function <fr:tex display="inline"><![CDATA[f : \mathcal {P}(\mathbb {N}) \twoheadrightarrow  \mathcal {P}(\mathbb {N})]]></fr:tex> on an <html:em>uncountable</html:em> <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> <fr:tex display="inline"><![CDATA[\mathcal {P}(\mathbb {N})]]></fr:tex> is completely determined by the <html:em>countable</html:em> relation <fr:tex display="inline"><![CDATA[G_f]]></fr:tex>.</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0047/</fr:uri><fr:display-uri>dt-0047</fr:display-uri><fr:route>/forest/dt-0047/</fr:route><fr:title text="Down-closure">Down-closure</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p> Given a <fr:link href="/forest/dm-0004/" title="Poset" uri="https://liamoc.net/forest/dm-0004/" display-uri="dm-0004" type="local">poset</fr:link> <fr:tex display="inline"><![CDATA[Y]]></fr:tex>, a set <fr:tex display="inline"><![CDATA[X \subseteq  Y]]></fr:tex> is <html:em>down-closed</html:em> iff, for all <fr:tex display="inline"><![CDATA[x \in  X]]></fr:tex>, any <fr:tex display="inline"><![CDATA[y \sqsubseteq  x]]></fr:tex> is in <fr:tex display="inline"><![CDATA[X]]></fr:tex>.</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0048/</fr:uri><fr:display-uri>dt-0048</fr:display-uri><fr:route>/forest/dt-0048/</fr:route><fr:title text="Ideal">Ideal</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p> A set is <html:em>ideal</html:em> iff it is both <fr:link href="/forest/dt-0047/" title="Down-closure" uri="https://liamoc.net/forest/dt-0047/" display-uri="dt-0047" type="local">down-closed</fr:link> and <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link>.</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0046/</fr:uri><fr:display-uri>dt-0046</fr:display-uri><fr:route>/forest/dt-0046/</fr:route><fr:title text="Ideal completion">Ideal completion</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>The <html:em>ideal completion</html:em> of a set <fr:tex display="inline"><![CDATA[A]]></fr:tex>, written sometimes as <fr:tex display="inline"><![CDATA[\mathsf {Id}(A)]]></fr:tex>, is the set of all <fr:link href="/forest/dt-0048/" title="Ideal" uri="https://liamoc.net/forest/dt-0048/" display-uri="dt-0048" type="local">ideal</fr:link> subsets of <fr:tex display="inline"><![CDATA[A]]></fr:tex>, i.e.:
<fr:tex display="block"><![CDATA[
\mathsf {Id}(A) = \{ X \subseteq  A \mid  X\ \text {is ideal}\}
]]></fr:tex></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0049/</fr:uri><fr:display-uri>dt-0049</fr:display-uri><fr:route>/forest/dt-0049/</fr:route><fr:title text="Representation theorem for algebraic cpos">Representation theorem for <fr:link href="/forest/dt-0041/" title="Algebraicity" uri="https://liamoc.net/forest/dt-0041/" display-uri="dt-0041" type="local">algebraic</fr:link> <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link></fr:title><fr:taxon>Theorem</fr:taxon></fr:frontmatter><fr:mainmatter><html:p> Every <fr:link href="/forest/dt-0041/" title="Algebraicity" uri="https://liamoc.net/forest/dt-0041/" display-uri="dt-0041" type="local">algebraic</fr:link> <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> <fr:tex display="inline"><![CDATA[D]]></fr:tex> is <fr:link href="/forest/dt-002E/" title="Cpo isomorphism" uri="https://liamoc.net/forest/dt-002E/" display-uri="dt-002E" type="local">isomorphic</fr:link> to the <fr:link href="/forest/dt-0046/" title="Ideal completion" uri="https://liamoc.net/forest/dt-0046/" display-uri="dt-0046" type="local">ideal completion</fr:link> of its <fr:link href="/forest/dt-003U/" title="Compactness" uri="https://liamoc.net/forest/dt-003U/" display-uri="dt-003U" type="local">compact</fr:link> elements, ordered by subset inclusion. That is, <fr:tex display="inline"><![CDATA[\mathsf {Id}(K(D))]]></fr:tex> is an <fr:link href="/forest/dt-0041/" title="Algebraicity" uri="https://liamoc.net/forest/dt-0041/" display-uri="dt-0041" type="local">algebraic</fr:link> <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> such that <fr:tex display="inline"><![CDATA[D \simeq  \mathsf {Id}(K(D))
]]></fr:tex>.
</html:p></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-005Y/</fr:uri><fr:display-uri>dt-005Y</fr:display-uri><fr:route>/forest/dt-005Y/</fr:route><fr:title text="Getting closure">Getting closure</fr:title></fr:frontmatter><fr:mainmatter><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-004A/</fr:uri><fr:display-uri>dt-004A</fr:display-uri><fr:route>/forest/dt-004A/</fr:route><fr:title text="Basis">Basis</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>A set of <fr:link href="/forest/dt-003U/" title="Compactness" uri="https://liamoc.net/forest/dt-003U/" display-uri="dt-003U" type="local">compact</fr:link> elements <fr:tex display="inline"><![CDATA[X \subseteq  \mathsf {K}(A)]]></fr:tex> is a <html:em>basis</html:em> for a <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> <fr:tex display="inline"><![CDATA[A]]></fr:tex> iff for all <fr:tex display="inline"><![CDATA[x\in  A]]></fr:tex>, <fr:tex display="inline"><![CDATA[x= \bigsqcup \{a \in  X \mid  a \sqsubseteq  x\}]]></fr:tex>.
</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-004B/</fr:uri><fr:display-uri>dt-004B</fr:display-uri><fr:route>/forest/dt-004B/</fr:route><fr:title text="Compact basis for algebraic cpos">Compact basis for algebraic cpos</fr:title><fr:taxon>Theorem</fr:taxon></fr:frontmatter><fr:mainmatter><html:p> If <fr:tex display="inline"><![CDATA[X]]></fr:tex> is a <fr:link href="/forest/dt-004A/" title="Basis" uri="https://liamoc.net/forest/dt-004A/" display-uri="dt-004A" type="local">basis</fr:link> for <fr:tex display="inline"><![CDATA[A]]></fr:tex>, then <fr:tex display="inline"><![CDATA[A]]></fr:tex> is <fr:link href="/forest/dt-0041/" title="Algebraicity" uri="https://liamoc.net/forest/dt-0041/" display-uri="dt-0041" type="local">algebraic</fr:link> and <fr:tex display="inline"><![CDATA[\mathsf {K}(A) = X]]></fr:tex>.
</html:p>


<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Proof</fr:taxon></fr:frontmatter><fr:mainmatter>
<html:p>If <fr:tex display="inline"><![CDATA[a \in  \mathsf {K}(A)]]></fr:tex>, then <fr:tex display="inline"><![CDATA[\bigsqcup  M = a]]></fr:tex> where <fr:tex display="inline"><![CDATA[M = \{ x \in  X \mid  x \sqsubseteq  a \}]]></fr:tex>, as <fr:tex display="inline"><![CDATA[X]]></fr:tex> is a <fr:link href="/forest/dt-004A/" title="Basis" uri="https://liamoc.net/forest/dt-004A/" display-uri="dt-004A" type="local">basis</fr:link>. Since <fr:tex display="inline"><![CDATA[a]]></fr:tex> is <fr:link href="/forest/dt-003U/" title="Compactness" uri="https://liamoc.net/forest/dt-003U/" display-uri="dt-003U" type="local">compact</fr:link>, <fr:tex display="inline"><![CDATA[a \sqsubseteq  b]]></fr:tex>  for some <fr:tex display="inline"><![CDATA[b \in  M]]></fr:tex>. But since <fr:tex display="inline"><![CDATA[a]]></fr:tex> is the <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link> of <fr:tex display="inline"><![CDATA[M]]></fr:tex>, <fr:tex display="inline"><![CDATA[b \sqsubseteq  a]]></fr:tex> as well. By <fr:link href="/forest/dm-0003/" title="Antisymmetry" uri="https://liamoc.net/forest/dm-0003/" display-uri="dm-0003" type="local">antisymmetry</fr:link> <fr:tex display="inline"><![CDATA[a = b]]></fr:tex>, hence <fr:tex display="inline"><![CDATA[a \in  X]]></fr:tex>. Thus <fr:tex display="inline"><![CDATA[\mathsf {K}(A) \subseteq  X]]></fr:tex>, so <fr:tex display="inline"><![CDATA[\mathsf {K}(A) = X]]></fr:tex> and <fr:tex display="inline"><![CDATA[A]]></fr:tex> is <fr:link href="/forest/dt-0041/" title="Algebraicity" uri="https://liamoc.net/forest/dt-0041/" display-uri="dt-0041" type="local">algebraic</fr:link>.
</html:p></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-004C/</fr:uri><fr:display-uri>dt-004C</fr:display-uri><fr:route>/forest/dt-004C/</fr:route><fr:title text="Closure of algebraic cpos under product">Closure of algebraic cpos under product</fr:title><fr:taxon>Theorem</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>If <fr:tex display="inline"><![CDATA[D]]></fr:tex> and <fr:tex display="inline"><![CDATA[E]]></fr:tex> are <fr:link href="/forest/dt-0041/" title="Algebraicity" uri="https://liamoc.net/forest/dt-0041/" display-uri="dt-0041" type="local">algebraic</fr:link> <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link>, then so is their product construction <fr:tex display="inline"><![CDATA[D \times  E]]></fr:tex>.</html:p>


<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Proof</fr:taxon></fr:frontmatter><fr:mainmatter>
<html:p>In the following proof, we show that <fr:tex display="inline"><![CDATA[\mathsf {K}(D) \times  \mathsf {K}(E)]]></fr:tex> is a <fr:link href="/forest/dt-004A/" title="Basis" uri="https://liamoc.net/forest/dt-004A/" display-uri="dt-004A" type="local">basis</fr:link> for the <fr:link href="/forest/dt-0021/" title="Product of cpos" uri="https://liamoc.net/forest/dt-0021/" display-uri="dt-0021" type="local">product</fr:link> <fr:tex display="inline"><![CDATA[D \times  E]]></fr:tex> and thereby show via <fr:link href="/forest/dt-004B/" title="Compact basis for algebraic cpos" uri="https://liamoc.net/forest/dt-004B/" display-uri="dt-004B" type="local">Theorem <fr:contextual-number uri="https://liamoc.net/forest/dt-004B/" display-uri="dt-004B" /></fr:link> that <fr:tex display="inline"><![CDATA[D \times  E]]></fr:tex> is <fr:link href="/forest/dt-0041/" title="Algebraicity" uri="https://liamoc.net/forest/dt-0041/" display-uri="dt-0041" type="local">algebraic</fr:link> if <fr:tex display="inline"><![CDATA[D]]></fr:tex> and <fr:tex display="inline"><![CDATA[E]]></fr:tex> are.</html:p>
<html:ol><html:li><fr:tex display="inline"><![CDATA[\mathsf {K}(D) \times  \mathsf {K}(E) \subseteq  \mathsf {K}(D \times  E)]]></fr:tex>: Let <fr:tex display="inline"><![CDATA[(x,y) \in  \mathsf {K}(D) \times  \mathsf {K}(E)]]></fr:tex>. To show that <fr:tex display="inline"><![CDATA[(x,y)]]></fr:tex> is <fr:link href="/forest/dt-003U/" title="Compactness" uri="https://liamoc.net/forest/dt-003U/" display-uri="dt-003U" type="local">compact</fr:link>, let us assume that <fr:tex display="inline"><![CDATA[(x,y) \in  \bigsqcup  X]]></fr:tex> where <fr:tex display="inline"><![CDATA[X \subseteq  D \times  E]]></fr:tex> is <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link>. We must show that there exists some element <fr:tex display="inline"><![CDATA[e]]></fr:tex> of <fr:tex display="inline"><![CDATA[X]]></fr:tex> such that our <fr:tex display="inline"><![CDATA[(x,y) \sqsubseteq  e]]></fr:tex>. As <fr:tex display="inline"><![CDATA[(x,y) \in  \bigsqcup  X]]></fr:tex>, by the definition of <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link> on <fr:link href="/forest/dt-0021/" title="Product of cpos" uri="https://liamoc.net/forest/dt-0021/" display-uri="dt-0021" type="local">products</fr:link> we can conclude that:	
	<fr:tex display="block"><![CDATA[\begin {array}{lcl}
		x & \sqsubseteq  & \bigsqcup  \pi _0[ X] \\
		y & \sqsubseteq  & \bigsqcup  \pi _1[X]
	\end {array}]]></fr:tex>
	Here we use the notation <fr:tex display="inline"><![CDATA[f[X]]]></fr:tex> to indicate the image of a function on a set, i.e. <fr:tex display="inline"><![CDATA[\{ f(v) \mid  v \in  X \}]]></fr:tex>.<html:br />
	
	Since <fr:tex display="inline"><![CDATA[x]]></fr:tex> and <fr:tex display="inline"><![CDATA[y]]></fr:tex> are both <fr:link href="/forest/dt-003U/" title="Compactness" uri="https://liamoc.net/forest/dt-003U/" display-uri="dt-003U" type="local">compact</fr:link>, there must exist <fr:tex display="inline"><![CDATA[x' \in  \pi _0[ X]]]></fr:tex> and <fr:tex display="inline"><![CDATA[y' \in  \pi _1[ X]]]></fr:tex> such that <fr:tex display="inline"><![CDATA[x \sqsubseteq  x']]></fr:tex> and <fr:tex display="inline"><![CDATA[y \sqsubseteq  y']]></fr:tex>. While it does not follow that <fr:tex display="inline"><![CDATA[(x', y') \in  X]]></fr:tex>, we know that there must exist a pair <fr:tex display="inline"><![CDATA[(a,b) \in  X]]></fr:tex> such that <fr:tex display="inline"><![CDATA[x' \sqsubseteq  a]]></fr:tex> and <fr:tex display="inline"><![CDATA[y' \sqsubseteq  b]]></fr:tex> as <fr:tex display="inline"><![CDATA[X]]></fr:tex> is <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link>. Hence <fr:tex display="inline"><![CDATA[(a,b)]]></fr:tex> can be our element <fr:tex display="inline"><![CDATA[e \in  X]]></fr:tex> that is approximated by <fr:tex display="inline"><![CDATA[(x,y)]]></fr:tex>, i.e. <fr:tex display="inline"><![CDATA[(x,y) \sqsubseteq  (a,b)]]></fr:tex>.
</html:li>
<html:li><fr:tex display="inline"><![CDATA[\mathop {\downarrow }(x,y)]]></fr:tex> is directed for all <fr:tex display="inline"><![CDATA[(x,y) \in  D \times  E]]></fr:tex>:
<fr:tex display="block"><![CDATA[\begin {array}{lcl}
		\mathop {\downarrow }(x,y) &= & \{ (a,b) \in  \mathsf {K}(D) \times  \mathsf {K}(E) \mid  (a,b) \sqsubseteq  (x,y) \} \\
		& = & \{ a \in  \mathsf {K}(D) \mid  a \sqsubseteq  x \} \times  \{ b \in  \mathsf {K}(E) \mid  b \sqsubseteq  y \}\\
		& = & \mathop {\downarrow }(x) \times  \mathop {\downarrow }(y)
	\end {array}]]></fr:tex>
	Because <fr:tex display="inline"><![CDATA[D]]></fr:tex> and <fr:tex display="inline"><![CDATA[E]]></fr:tex> are <fr:link href="/forest/dt-0041/" title="Algebraicity" uri="https://liamoc.net/forest/dt-0041/" display-uri="dt-0041" type="local">algebraic</fr:link>, <fr:tex display="inline"><![CDATA[\mathop {\downarrow }(x)]]></fr:tex> and <fr:tex display="inline"><![CDATA[\mathop {\downarrow }(y)]]></fr:tex> are <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link>. As directedness is closed under <fr:link href="/forest/dt-002K/" title="Products" uri="https://liamoc.net/forest/dt-002K/" display-uri="dt-002K" type="local">product</fr:link>, <fr:tex display="inline"><![CDATA[\mathop {\downarrow }(x,y)]]></fr:tex> is <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link> too.
</html:li>
<html:li><fr:tex display="inline"><![CDATA[(x,y) = \bigsqcup \mathop {\downarrow }(x,y)]]></fr:tex>
Starting from the right hand side:
<fr:tex display="block"><![CDATA[\begin {array}{lclr}
\bigsqcup  \mathop {\downarrow }(x,y) & = & \bigsqcup (\mathop {\downarrow }(x) \times  \mathop {\downarrow }(y)) & \text {(part 2)}\\
   & = & (\bigsqcup (\mathop {\downarrow }(x), \bigsqcup \mathop {\downarrow }(y))) & \text {(lub on products)}\\
   & = & (x,y) & \text {($D$, $E$ are {algebraic})}
\end {array}]]></fr:tex></html:li></html:ol>
</fr:mainmatter></fr:tree></fr:mainmatter></fr:tree>


<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Problem</fr:taxon></fr:frontmatter><fr:mainmatter>
<fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-<fr:link href="/forest/dt-0041/" title="Algebraicity" uri="https://liamoc.net/forest/dt-0041/" display-uri="dt-0041" type="local">algebraic</fr:link> <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> are closed under all of our constructions (<fr:link href="/forest/dt-0021/" title="Product of cpos" uri="https://liamoc.net/forest/dt-0021/" display-uri="dt-0021" type="local">products</fr:link> and <fr:link href="/forest/dt-0031/" title="Sum of cpos" uri="https://liamoc.net/forest/dt-0031/" display-uri="dt-0031" type="local">sums</fr:link>, including <fr:link href="/forest/dt-003E/" title="Strict Constructions" uri="https://liamoc.net/forest/dt-003E/" display-uri="dt-003E" type="local">strict versions of these</fr:link>) <html:strong>except</html:strong> functions <fr:tex display="inline"><![CDATA[\twoheadrightarrow ]]></fr:tex> and strict functions <fr:tex display="inline"><![CDATA[\mathbin {\circ \hspace{-0.4em}\twoheadrightarrow }]]></fr:tex>!
</fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-004D/</fr:uri><fr:display-uri>dt-004D</fr:display-uri><fr:route>/forest/dt-004D/</fr:route><fr:title text="Scott's original solution: using complete lattices">Scott's original solution: using complete lattices</fr:title><fr:taxon>Aside</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>The lack of closure of <fr:link href="/forest/dt-0041/" title="Algebraicity" uri="https://liamoc.net/forest/dt-0041/" display-uri="dt-0041" type="local">algebraicity</fr:link> under the (<fr:link href="/forest/dt-001J/" title="Continuity" uri="https://liamoc.net/forest/dt-001J/" display-uri="dt-001J" type="local">continuous</fr:link>) function arrow, <fr:link href="/forest/dt-000K/" title="Strictness" uri="https://liamoc.net/forest/dt-000K/" display-uri="dt-000K" type="local">strict</fr:link> or non-<fr:link href="/forest/dt-000K/" title="Strictness" uri="https://liamoc.net/forest/dt-000K/" display-uri="dt-000K" type="local">strict</fr:link>, is not satisfying as it means that our semantic domains are not guaranteed to be <fr:link href="/forest/dt-0041/" title="Algebraicity" uri="https://liamoc.net/forest/dt-0041/" display-uri="dt-0041" type="local">algebraic</fr:link> even if they are composed from <fr:link href="/forest/dt-0041/" title="Algebraicity" uri="https://liamoc.net/forest/dt-0041/" display-uri="dt-0041" type="local">algebraic</fr:link> <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link>. Instead, we must replace <fr:link href="/forest/dt-0041/" title="Algebraicity" uri="https://liamoc.net/forest/dt-0041/" display-uri="dt-0041" type="local">algebraic</fr:link> <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> with something stronger still.</html:p><html:p>Scott's original solution to this lack of closure was to use a <html:em>complete lattice</html:em> instead of <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link>, i.e. requiring <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lubs</fr:link> for all subsets, not just <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link> ones. This solves the problem with <fr:tex display="inline"><![CDATA[\twoheadrightarrow ]]></fr:tex> but introduces new problems:
<html:ol><html:li> Complete lattices need a <html:em>top</html:em> element <fr:tex display="inline"><![CDATA[\top ]]></fr:tex>, but adding a fictitious top (representing inconsistent information) to <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpos</fr:link> like <fr:tex display="inline"><![CDATA[\mathbb {B}_\bot ]]></fr:tex> is strange.</html:li>
<html:li> Extending the functions that capture our primitive semantic operations to complete lattices can spoil nice algebraic properties. Consider these two possible implementations of <fr:tex display="inline"><![CDATA[\mathsf {ite}]]></fr:tex>, the function for the semantics of an <fr:tex display="inline"><![CDATA[\mathsf {if}]]></fr:tex> expression:
<fr:tex display="block"><![CDATA[
\mathsf {ite}(\top ,x,y) = x \sqcup  y\quad \quad \quad  \quad \quad  \mathsf {ite}(\top ,x,y) = \top 
]]></fr:tex>
Either of these solutions results in the failure of useful and expected laws for <fr:tex display="inline"><![CDATA[\mathsf {if}]]></fr:tex> expressions. For example, the left definition above results in the failure of the common equation to eliminate unreachable cases: <fr:tex display="block"><![CDATA[\mathsf {ite}(b, \mathsf {ite}(b,x,y),z) = \mathsf {ite}(b,x,z) ]]></fr:tex>
And the second definition above results in the failure of this equation that removes redundant checks:
<fr:tex display="block"><![CDATA[\mathsf {ite}(b,x,x) = x]]></fr:tex></html:li>
<html:li> The <fr:link href="/forest/dt-0061/" title="The Hoare powerdomain" uri="https://liamoc.net/forest/dt-0061/" display-uri="dt-0061" type="local">powerdomain construction</fr:link> does not generalise to complete lattices, so semantics for <fr:link href="/forest/dt-005U/" title="Introduction to nondeterminism" uri="https://liamoc.net/forest/dt-005U/" display-uri="dt-005U" type="local">non-deterministic</fr:link> programs are difficult in this setting. </html:li></html:ol></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-004E/</fr:uri><fr:display-uri>dt-004E</fr:display-uri><fr:route>/forest/dt-004E/</fr:route><fr:title text="Consistent completeness">Consistent completeness</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>A <fr:link href="/forest/dm-0004/" title="Poset" uri="https://liamoc.net/forest/dm-0004/" display-uri="dm-0004" type="local">poset</fr:link> <fr:tex display="inline"><![CDATA[A]]></fr:tex> is <html:em>consistent complete</html:em> (or <html:em>bounded complete</html:em>) iff <fr:tex display="inline"><![CDATA[\bigsqcup  X]]></fr:tex> exists for all <fr:link href="/forest/dt-0013/" title="Consistent subset" uri="https://liamoc.net/forest/dt-0013/" display-uri="dt-0013" type="local">consistent</fr:link> <fr:tex display="inline"><![CDATA[X \subseteq  A]]></fr:tex>. That is, any set with <html:em>an</html:em> <fr:link href="/forest/dm-000C/" title="Upper bound" uri="https://liamoc.net/forest/dm-000C/" display-uri="dm-000C" type="local">upper bound</fr:link> (a <fr:link href="/forest/dt-0013/" title="Consistent subset" uri="https://liamoc.net/forest/dt-0013/" display-uri="dt-0013" type="local">consistent</fr:link> set) has a <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local"><html:em>least</html:em> upper bound</fr:link>.</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-004F/</fr:uri><fr:display-uri>dt-004F</fr:display-uri><fr:route>/forest/dt-004F/</fr:route><fr:title text="Consistent completeness vs directed completeness">Consistent completeness vs directed completeness</fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter><html:figure><html:table width="100%">
	
  <html:tr>
		
  <html:td>
			<fr:resource hash="3be337c19699cb393704fbd2a8ebd628"><fr:resource-content><html:img src="/forest/3be337c19699cb393704fbd2a8ebd628.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz-cd}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[\begin {tikzcd}[column sep=1em]
			    \quad  \\
				2 \ar [u,-,thick,dotted] \\ 
				1 \ar [u,-,thick] \\
				0 \ar [u,-,thick] \\
				\end {tikzcd}]]></fr:resource-source></fr:resource>
		</html:td>

		
  <html:td>
			<fr:resource hash="e3693052780db91d481afbe49a9ba622"><fr:resource-content><html:img src="/forest/e3693052780db91d481afbe49a9ba622.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz-cd}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[\begin {tikzcd}[column sep=1em]
			\quad \\
			\bullet  && \bullet  \\
			\bullet  \ar [u,-,thick]\ar [urr,-,thick] && \bullet  \ar [ull,-,thick]\ar [u,-,thick] \\
			&\bullet   \ar [ul,-,thick]\ar [ur,-,thick] \\
			\end {tikzcd}
		]]></fr:resource-source></fr:resource></html:td>

	</html:tr>

	
  <html:tr>
		
  <html:td>
			<fr:link href="/forest/dt-004E/" title="Consistent completeness" uri="https://liamoc.net/forest/dt-004E/" display-uri="dt-004E" type="local">consistent complete</fr:link>
		</html:td>

		
  <html:td>
			not <fr:link href="/forest/dt-004E/" title="Consistent completeness" uri="https://liamoc.net/forest/dt-004E/" display-uri="dt-004E" type="local">consistent complete</fr:link>
		</html:td>

	</html:tr>

	
  <html:tr>
		
  <html:td>
			not <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">directed complete</fr:link>
		</html:td>

		
  <html:td>
			<fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">directed complete</fr:link>
		</html:td>

	</html:tr>

</html:table></html:figure></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-004G/</fr:uri><fr:display-uri>dt-004G</fr:display-uri><fr:route>/forest/dt-004G/</fr:route><fr:title text="Scott domain">Scott domain</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:img class="sidefigure" src="/forest/bafkrmihb7kj5nhppgommasu6jecpsrqx4yrdlz37gkq4jejl2teihgy3aa.png" /><html:p>A <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> <fr:tex display="inline"><![CDATA[D]]></fr:tex> is a <html:em>Scott domain</html:em> iff:
<html:ol><html:li><fr:tex display="inline"><![CDATA[D]]></fr:tex> is <fr:link href="/forest/dt-0041/" title="Algebraicity" uri="https://liamoc.net/forest/dt-0041/" display-uri="dt-0041" type="local"><fr:tex display="inline"><![CDATA[\omega ]]></fr:tex>-algebraic</fr:link>, </html:li>
	<html:li><fr:tex display="inline"><![CDATA[D]]></fr:tex> is <fr:link href="/forest/dt-004E/" title="Consistent completeness" uri="https://liamoc.net/forest/dt-004E/" display-uri="dt-004E" type="local">consistent complete</fr:link>, </html:li></html:ol>
	In other words, <html:em>Scott domains</html:em> can be summed up by the acronym:
</html:p><html:div class="constrainfigure">
<fr:resource hash="0532f5e70eede85553d2d3567356b226"><fr:resource-content><html:img src="/forest/0532f5e70eede85553d2d3567356b226.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {tikz}\usepackage {amsmath}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzpicture}
\node  (a) at (5,3) {\Large  $\text {ac}^3\text {po}$};
\node  (b1) at (0,-1) {\Large  $\omega $-\textbf {\textcolor {orange}{a}}lgebraic };
\node  (b2) at (4,-1) {\Large  \textbf {\textcolor {orange}{c}}onsistent-\textbf {\textcolor {orange}{c}}omplete };
\node  (b3) at (9.2,-1) {\Large  \textbf {\textcolor {orange}{c}}omplete \textbf {\textcolor {orange}{p}}artial \textbf {\textcolor {orange}{o}}rder };
\draw [thick,-] (b1) -- (a) (b2) -- (a) (b3) -- (a);
\end {tikzpicture}
]]></fr:resource-source></fr:resource>
</html:div></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-004H/</fr:uri><fr:display-uri>dt-004H</fr:display-uri><fr:route>/forest/dt-004H/</fr:route><fr:taxon>Remark</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>The second requirement in <fr:link href="/forest/dt-004G/" title="Scott domain" uri="https://liamoc.net/forest/dt-004G/" display-uri="dt-004G" type="local">Definition <fr:contextual-number uri="https://liamoc.net/forest/dt-004G/" display-uri="dt-004G" /></fr:link> can, in light of the first, be expressed equivalently as: <fr:tex display="inline"><![CDATA[x \sqcup  y]]></fr:tex> exists for all <fr:link href="/forest/dt-0013/" title="Consistent subset" uri="https://liamoc.net/forest/dt-0013/" display-uri="dt-0013" type="local">consistent</fr:link> <fr:tex display="inline"><![CDATA[x,y \in  D]]></fr:tex>. This is useful when needing to show that a given <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> is a <fr:link href="/forest/dt-004G/" title="Scott domain" uri="https://liamoc.net/forest/dt-004G/" display-uri="dt-004G" type="local">Scott domain</fr:link>.</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-004I/</fr:uri><fr:display-uri>dt-004I</fr:display-uri><fr:route>/forest/dt-004I/</fr:route><fr:title text="Closure of Scott domains">Closure of Scott domains</fr:title><fr:taxon>Theorem</fr:taxon></fr:frontmatter><fr:mainmatter><html:p><fr:link href="/forest/dt-004G/" title="Scott domain" uri="https://liamoc.net/forest/dt-004G/" display-uri="dt-004G" type="local">Scott domains</fr:link> are closed under all our <fr:link href="/forest/dt-001D/" title="Complete partial order" uri="https://liamoc.net/forest/dt-001D/" display-uri="dt-001D" type="local">cpo</fr:link> constructions, including <fr:link href="/forest/dt-0031/" title="Sum of cpos" uri="https://liamoc.net/forest/dt-0031/" display-uri="dt-0031" type="local">sums</fr:link> <fr:tex display="inline"><![CDATA[+]]></fr:tex>, <fr:link href="/forest/dt-0021/" title="Product of cpos" uri="https://liamoc.net/forest/dt-0021/" display-uri="dt-0021" type="local">products</fr:link> <fr:tex display="inline"><![CDATA[\times ]]></fr:tex>, <fr:link href="/forest/dt-002L/" title="The cpo of functions" uri="https://liamoc.net/forest/dt-002L/" display-uri="dt-002L" type="local">continuous functions</fr:link> <fr:tex display="inline"><![CDATA[\twoheadrightarrow ]]></fr:tex>, <fr:link href="/forest/dt-003H/" title="Smash sums of cpos" uri="https://liamoc.net/forest/dt-003H/" display-uri="dt-003H" type="local">smash sums</fr:link> <fr:tex display="inline"><![CDATA[\oplus ]]></fr:tex>, <fr:link href="/forest/dt-003G/" title="Smash products of cpos" uri="https://liamoc.net/forest/dt-003G/" display-uri="dt-003G" type="local">smash products</fr:link> <fr:tex display="inline"><![CDATA[\otimes ]]></fr:tex> and <fr:link href="/forest/dt-003F/" title="The cpo of strict continuous functions" uri="https://liamoc.net/forest/dt-003F/" display-uri="dt-003F" type="local">strict functions</fr:link> <fr:tex display="inline"><![CDATA[\mathbin {\circ \hspace{-0.4em}\twoheadrightarrow }]]></fr:tex>.
</html:p></fr:mainmatter></fr:tree>


<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Thesis</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Our semantic domains are <fr:link href="/forest/dt-004G/" title="Scott domain" uri="https://liamoc.net/forest/dt-004G/" display-uri="dt-004G" type="local">Scott domains</fr:link>.</html:p></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0061/</fr:uri><fr:display-uri>dt-0061</fr:display-uri><fr:route>/forest/dt-0061/</fr:route><fr:title text="The Hoare powerdomain">The Hoare powerdomain</fr:title></fr:frontmatter><fr:mainmatter><html:p>We write <fr:tex display="inline"><![CDATA[\mathcal {P}_f^\ast (S)]]></fr:tex> to denote finite non-empty subsets of <fr:tex display="inline"><![CDATA[S]]></fr:tex>. Let <fr:tex display="inline"><![CDATA[X, Y \in  \mathcal {P}_f^\ast (\mathsf {K}(A))]]></fr:tex> be finite, non-empty sets of compact elements of a Scott domain <fr:tex display="inline"><![CDATA[A]]></fr:tex>. The <html:em>Hoare powerdomain</html:em> construction is based on the following ordering:
<fr:tex display="block"><![CDATA[
X \preceq _H Y\quad  \text {iff}\quad  (\forall  x \in  X.\ \exists  y \in  Y.\ x \sqsubseteq _A y)
]]></fr:tex>
The intuition behind this is that "Anything <fr:tex display="inline"><![CDATA[X]]></fr:tex> can do, <fr:tex display="inline"><![CDATA[Y]]></fr:tex> can do better". This ordering has some desirable properties: The least element is <fr:tex display="inline"><![CDATA[\{\bot  \}]]></fr:tex>, as we might expect. It also satisfies the equation <fr:tex display="inline"><![CDATA[X \preceq _H X \cup  Y]]></fr:tex>, which intuitively means that a non-deterministic choice is considered to have <html:em>more</html:em> information than any of its components. When specialised to the case where <fr:tex display="inline"><![CDATA[A]]></fr:tex> is a <fr:link href="/forest/dt-0008/" title="Flat domain" uri="https://liamoc.net/forest/dt-0008/" display-uri="dt-0008" type="local">flat domain</fr:link> like <fr:tex display="inline"><![CDATA[\Sigma _\bot ]]></fr:tex>, it simplifies to:
<fr:tex display="block"><![CDATA[
X \preceq _H Y\quad  \text {iff}\quad  X \setminus  \{\bot  \} \subseteq  Y
]]></fr:tex>
This is, however, not a proper order, but a <fr:link href="/forest/dm-000V/" title="Preorder" uri="https://liamoc.net/forest/dm-000V/" display-uri="dm-000V" type="local">preorder</fr:link>, as it fails <fr:link href="/forest/dm-0003/" title="Antisymmetry" uri="https://liamoc.net/forest/dm-0003/" display-uri="dm-0003" type="local">antisymmetry</fr:link>. Even in the <fr:link href="/forest/dt-0008/" title="Flat domain" uri="https://liamoc.net/forest/dt-0008/" display-uri="dt-0008" type="local">flat domain</fr:link> case, <fr:tex display="inline"><![CDATA[\{ x, \bot  \} \preceq _H \{x \}]]></fr:tex> and <fr:tex display="inline"><![CDATA[\{ x \} \preceq _H \{x, \bot  \}]]></fr:tex> but they are not equal. However, any <fr:link href="/forest/dm-000V/" title="Preorder" uri="https://liamoc.net/forest/dm-000V/" display-uri="dm-000V" type="local">preorder</fr:link> <html:em>does</html:em> induce an <fr:link href="/forest/dm-000W/" title="Equivalence relation" uri="https://liamoc.net/forest/dm-000W/" display-uri="dm-000W" type="local">equivalence relation</fr:link>, where <fr:tex display="inline"><![CDATA[X \approx _H Y]]></fr:tex> iff <fr:tex display="inline"><![CDATA[X \preceq _H Y]]></fr:tex> and <fr:tex display="inline"><![CDATA[Y \preceq _H X]]></fr:tex>. Furthermore, if we take the <fr:link href="/forest/dt-0046/" title="Ideal completion" uri="https://liamoc.net/forest/dt-0046/" display-uri="dt-0046" type="local">ideal completion</fr:link> of <fr:tex display="inline"><![CDATA[\mathcal {P}_f^\ast (K(A))]]></fr:tex> with respect to the <fr:link href="/forest/dm-000V/" title="Preorder" uri="https://liamoc.net/forest/dm-000V/" display-uri="dm-000V" type="local">preorder</fr:link> <fr:tex display="inline"><![CDATA[\preceq _H]]></fr:tex> (i.e., the set of all <fr:tex display="inline"><![CDATA[\preceq _H]]></fr:tex>-<fr:link href="/forest/dt-0047/" title="Down-closure" uri="https://liamoc.net/forest/dt-0047/" display-uri="dt-0047" type="local">downwards-closed</fr:link> <fr:link href="/forest/dt-0010/" title="Directed set" uri="https://liamoc.net/forest/dt-0010/" display-uri="dt-0010" type="local">directed</fr:link> subsets of <fr:tex display="inline"><![CDATA[\mathcal {P}_f^\ast (\mathsf {K}(A))]]></fr:tex>), we can order them by inclusion to obtain an <fr:link href="/forest/dt-0041/" title="Algebraicity" uri="https://liamoc.net/forest/dt-0041/" display-uri="dt-0041" type="local">algebraic</fr:link> domain with <fr:link href="/forest/dt-003U/" title="Compactness" uri="https://liamoc.net/forest/dt-003U/" display-uri="dt-003U" type="local">compact</fr:link> elements which correspond to <fr:link href="/forest/dm-000X/" title="Equivalence class" uri="https://liamoc.net/forest/dm-000X/" display-uri="dm-000X" type="local">equivalence classes</fr:link> of elements under <fr:tex display="inline"><![CDATA[\approx _H]]></fr:tex>. We have a <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link> operation for these <fr:link href="/forest/dt-0048/" title="Ideal" uri="https://liamoc.net/forest/dt-0048/" display-uri="dt-0048" type="local">ideals</fr:link>:
<fr:tex display="block"><![CDATA[
A \sqcup _H B = \{ X \cup  Y \mid  X \in  A \land  Y \in  B \}
]]></fr:tex></html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0062/</fr:uri><fr:display-uri>dt-0062</fr:display-uri><fr:route>/forest/dt-0062/</fr:route><fr:title text="Hoare powerdomain of \mathbb {N}_\bot ">Hoare powerdomain of <fr:tex display="inline"><![CDATA[\mathbb {N}_\bot ]]></fr:tex></fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
	Let us find the <fr:link href="/forest/dt-0061/" title="The Hoare powerdomain" uri="https://liamoc.net/forest/dt-0061/" display-uri="dt-0061" type="local">Hoare powerdomain</fr:link> of <fr:tex display="inline"><![CDATA[\mathbb {N}_\bot ]]></fr:tex>. Note that <fr:tex display="inline"><![CDATA[\mathbb {N}_\bot ]]></fr:tex> is a <fr:link href="/forest/dt-0008/" title="Flat domain" uri="https://liamoc.net/forest/dt-0008/" display-uri="dt-0008" type="local">flat domain</fr:link> so all elements are <fr:link href="/forest/dt-003U/" title="Compactness" uri="https://liamoc.net/forest/dt-003U/" display-uri="dt-003U" type="local">compact</fr:link>, i.e. <fr:tex display="inline"><![CDATA[\mathsf {K}(\mathbb {N}_\bot ) = \mathbb {N}_\bot ]]></fr:tex>. Let us find examine the <fr:tex display="inline"><![CDATA[\preceq _H]]></fr:tex>-ideal subsets of <fr:tex display="inline"><![CDATA[\mathcal {P}_f^\ast (\mathbb {N}_\bot )]]></fr:tex>. If <fr:tex display="inline"><![CDATA[v]]></fr:tex> and <fr:tex display="inline"><![CDATA[u]]></fr:tex> both contain <fr:tex display="inline"><![CDATA[\bot ]]></fr:tex>, then <fr:tex display="inline"><![CDATA[v \preceq _H u]]></fr:tex> iff <fr:tex display="inline"><![CDATA[v \subseteq  u]]></fr:tex>. As <fr:link href="/forest/dt-0048/" title="Ideal" uri="https://liamoc.net/forest/dt-0048/" display-uri="dt-0048" type="local">ideal</fr:link> subsets are <fr:link href="/forest/dt-0047/" title="Down-closure" uri="https://liamoc.net/forest/dt-0047/" display-uri="dt-0047" type="local">downwards closed</fr:link>, we can identify an <fr:link href="/forest/dt-0048/" title="Ideal" uri="https://liamoc.net/forest/dt-0048/" display-uri="dt-0048" type="local">ideal</fr:link> <fr:tex display="inline"><![CDATA[I \in  \mathsf {Id}({\mathcal {P}_f^\ast (\mathbb {N}_\bot )})]]></fr:tex> with its union <fr:tex display="inline"><![CDATA[\bigcup  I]]></fr:tex>. The <fr:link href="/forest/dt-0048/" title="Ideal" uri="https://liamoc.net/forest/dt-0048/" display-uri="dt-0048" type="local">ideals</fr:link> of <fr:tex display="inline"><![CDATA[\mathcal {P}^\ast _f(\mathbb {N}_\bot )]]></fr:tex> are then <fr:link href="/forest/dt-002E/" title="Cpo isomorphism" uri="https://liamoc.net/forest/dt-002E/" display-uri="dt-002E" type="local">isomorphic</fr:link> to domain <fr:tex display="inline"><![CDATA[\mathcal {P}(\mathbb {N})]]></fr:tex> of all subsets of <fr:tex display="inline"><![CDATA[\mathbb {N}]]></fr:tex> under subset inclusion.
</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0063/</fr:uri><fr:display-uri>dt-0063</fr:display-uri><fr:route>/forest/dt-0063/</fr:route><fr:title text="Angelic nondeterminism">Angelic nondeterminism</fr:title><fr:taxon>Remark</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
Consider the following three programs:
<html:ol><html:li><fr:tex display="inline"><![CDATA[ x := 1]]></fr:tex></html:li>
<html:li><fr:tex display="inline"><![CDATA[\textsf {while}\ \textsf {true}\ \textsf {do}\ \textsf {skip}]]></fr:tex></html:li>
<html:li><fr:tex display="inline"><![CDATA[ \textsf {while}\ \textsf {true}\ \textsf {do}\ \textsf {skip}\ \textsf {od} + x := 1 ]]></fr:tex></html:li></html:ol>
Given a state <fr:tex display="inline"><![CDATA[\sigma ]]></fr:tex>, let <fr:tex display="inline"><![CDATA[\sigma ' = \sigma (x \mapsto  1)]]></fr:tex>. Then, the possible results of these programs are <fr:tex display="inline"><![CDATA[\{ \sigma ' \}]]></fr:tex>, <fr:tex display="inline"><![CDATA[\{ \bot  \}]]></fr:tex>, and <fr:tex display="inline"><![CDATA[\{\sigma ', \bot  \}]]></fr:tex> respectively. Because the <fr:link href="/forest/dt-0061/" title="The Hoare powerdomain" uri="https://liamoc.net/forest/dt-0061/" display-uri="dt-0061" type="local">Hoare construction</fr:link> identifies <fr:tex display="inline"><![CDATA[\approx _H]]></fr:tex>-equivalent sets, the Hoare powerdomain semantics will consider programs 1 and 3 to be the same. That is, the non-determinism is <html:em>angelic</html:em>. The bad outcome (<fr:tex display="inline"><![CDATA[\bot ]]></fr:tex>) is only said to happen if it is <html:em>inevitable</html:em>. 
</html:p></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0064/</fr:uri><fr:display-uri>dt-0064</fr:display-uri><fr:route>/forest/dt-0064/</fr:route><fr:title text="The Smyth powerdomain">The Smyth powerdomain</fr:title></fr:frontmatter><fr:mainmatter><html:p>As before, let <fr:tex display="inline"><![CDATA[X, Y \in  \mathcal {P}_f^\ast (\mathsf {K}(A))]]></fr:tex> be finite, non-empty sets of <fr:link href="/forest/dt-003U/" title="Compactness" uri="https://liamoc.net/forest/dt-003U/" display-uri="dt-003U" type="local">compact</fr:link> elements of a <fr:link href="/forest/dt-004G/" title="Scott domain" uri="https://liamoc.net/forest/dt-004G/" display-uri="dt-004G" type="local">Scott domain</fr:link> <fr:tex display="inline"><![CDATA[A]]></fr:tex>. The <html:em>Smyth powerdomain</html:em> construction is based on the following <fr:link href="/forest/dm-000V/" title="Preorder" uri="https://liamoc.net/forest/dm-000V/" display-uri="dm-000V" type="local">preorder</fr:link>:
<fr:tex display="block"><![CDATA[
X \preceq _S Y\quad  \text {iff}\quad  (\forall  y \in  Y.\ \exists  x \in  X.\ x \sqsubseteq _A y)
]]></fr:tex>
The intuition here is "Everything <fr:tex display="inline"><![CDATA[Y]]></fr:tex> can do, <fr:tex display="inline"><![CDATA[X]]></fr:tex> can do worse". It satisfies the equation <fr:tex display="inline"><![CDATA[X \cup  Y \preceq _S X]]></fr:tex>, which intuitively means that a non-deterministic choice is considered to have <html:em>less</html:em> information than any of its components. When applied to a <fr:link href="/forest/dt-0008/" title="Flat domain" uri="https://liamoc.net/forest/dt-0008/" display-uri="dt-0008" type="local">flat domain</fr:link>, it simplifies to:
<fr:tex display="block"><![CDATA[
X \preceq _S Y\quad \text {iff}\quad  \bot  \in  X \lor  Y \subseteq  X
]]></fr:tex>
As with the <fr:link href="/forest/dt-0061/" title="The Hoare powerdomain" uri="https://liamoc.net/forest/dt-0061/" display-uri="dt-0061" type="local">Hoare powerdomain</fr:link>, this fails to be a <fr:link href="/forest/dm-0000/" title="Partial order" uri="https://liamoc.net/forest/dm-0000/" display-uri="dm-0000" type="local">partial order</fr:link>, but we can use the same <fr:link href="/forest/dt-0046/" title="Ideal completion" uri="https://liamoc.net/forest/dt-0046/" display-uri="dt-0046" type="local">ideal completion</fr:link> trick to induce an <fr:link href="/forest/dt-0041/" title="Algebraicity" uri="https://liamoc.net/forest/dt-0041/" display-uri="dt-0041" type="local">algebraic</fr:link> domain where <fr:link href="/forest/dt-003U/" title="Compactness" uri="https://liamoc.net/forest/dt-003U/" display-uri="dt-003U" type="local">compact elements</fr:link> correspond to <fr:link href="/forest/dm-000X/" title="Equivalence class" uri="https://liamoc.net/forest/dm-000X/" display-uri="dm-000X" type="local">equivalence classes</fr:link> of elements under <fr:tex display="inline"><![CDATA[\approx _S]]></fr:tex> (where <fr:tex display="inline"><![CDATA[X \approx _S Y]]></fr:tex> is, as with <fr:tex display="inline"><![CDATA[\approx _H]]></fr:tex>, just defined as <fr:tex display="inline"><![CDATA[X \preceq _S Y \land  Y \preceq _S X]]></fr:tex>). </html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0065/</fr:uri><fr:display-uri>dt-0065</fr:display-uri><fr:route>/forest/dt-0065/</fr:route><fr:title text="Smyth powerdomain of \mathbb {N}_\bot ">Smyth powerdomain of <fr:tex display="inline"><![CDATA[\mathbb {N}_\bot ]]></fr:tex></fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Firstly note that, as <fr:link href="/forest/dt-0048/" title="Ideal" uri="https://liamoc.net/forest/dt-0048/" display-uri="dt-0048" type="local">ideals</fr:link> are <fr:link href="/forest/dt-0047/" title="Down-closure" uri="https://liamoc.net/forest/dt-0047/" display-uri="dt-0047" type="local">downwards-closed</fr:link>, any <fr:tex display="inline"><![CDATA[\preceq _S]]></fr:tex>-<fr:link href="/forest/dt-0048/" title="Ideal" uri="https://liamoc.net/forest/dt-0048/" display-uri="dt-0048" type="local">ideal</fr:link> subsets of <fr:tex display="inline"><![CDATA[\mathcal {P}^\ast _f(\mathbb {N}_\bot )]]></fr:tex> will contain <html:em>all</html:em> finite subsets of <fr:tex display="inline"><![CDATA[\mathbb {N}_\bot ]]></fr:tex> that contain <fr:tex display="inline"><![CDATA[\bot ]]></fr:tex>.  Let us call those sets <html:em>trivial</html:em>. So, a set in <fr:tex display="inline"><![CDATA[\mathcal {P}^\ast _f(\mathbb {N}_\bot )]]></fr:tex> is <html:em>non-trivial</html:em> if it does not contain <fr:tex display="inline"><![CDATA[\bot ]]></fr:tex> and an ideal subset of <fr:tex display="inline"><![CDATA[\mathcal {P}^\ast _f(\mathbb {N}_\bot )]]></fr:tex> is <html:em>non-trivial</html:em> if it contains a non-trivial set. Observe that for non-trivial sets <fr:tex display="inline"><![CDATA[X]]></fr:tex> and <fr:tex display="inline"><![CDATA[Y]]></fr:tex>, <fr:tex display="inline"><![CDATA[X \preceq _S Y]]></fr:tex> iff <fr:tex display="inline"><![CDATA[X \supseteq  Y]]></fr:tex>.  Thus, we can identify an <fr:link href="/forest/dt-0048/" title="Ideal" uri="https://liamoc.net/forest/dt-0048/" display-uri="dt-0048" type="local">ideal</fr:link> <fr:tex display="inline"><![CDATA[I \in  \mathsf {Id}({\mathcal {P}_f^\ast (\mathbb {N}_\bot )})]]></fr:tex> with the <fr:link href="/forest/dt-0047/" title="Down-closure" uri="https://liamoc.net/forest/dt-0047/" display-uri="dt-0047" type="local">down-closure</fr:link> of the <html:em>intersection</html:em> of its non-trivial elements. The smaller this set is, the larger the ideal <fr:tex display="inline"><![CDATA[I]]></fr:tex>. Hence, and confusingly, the non-trivial <fr:link href="/forest/dt-0048/" title="Ideal" uri="https://liamoc.net/forest/dt-0048/" display-uri="dt-0048" type="local">ideals</fr:link> in the powerdomain (ordered by subset inclusion) correspond to finite subsets of <fr:tex display="inline"><![CDATA[\mathbb {N}]]></fr:tex> ordered by <html:em>superset</html:em> inclusion. As all <html:em>trivial</html:em> sets are identified, we just need to throw in the unique trivial <fr:link href="/forest/dt-0048/" title="Ideal" uri="https://liamoc.net/forest/dt-0048/" display-uri="dt-0048" type="local">ideal</fr:link>, and we can see that the <html:em>Smyth</html:em> powerdomain of <fr:tex display="inline"><![CDATA[\mathbb {N}]]></fr:tex> is <fr:link href="/forest/dt-002E/" title="Cpo isomorphism" uri="https://liamoc.net/forest/dt-002E/" display-uri="dt-002E" type="local">isomorphic</fr:link> to the domain of sets <fr:tex display="inline"><![CDATA[\{ \mathbb {N} \} \cup  \mathcal {P}_f^\ast (\mathbb {N})]]></fr:tex> ordered by subset inclusion.</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0066/</fr:uri><fr:display-uri>dt-0066</fr:display-uri><fr:route>/forest/dt-0066/</fr:route><fr:title text="Demonic nondeterminism">Demonic nondeterminism</fr:title><fr:taxon>Remark</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Note that all sets that contain <fr:tex display="inline"><![CDATA[\bot ]]></fr:tex> are considered equivalent by the <fr:link href="/forest/dt-0064/" title="The Smyth powerdomain" uri="https://liamoc.net/forest/dt-0064/" display-uri="dt-0064" type="local">Smyth</fr:link> construction <fr:tex display="inline"><![CDATA[\approx _S]]></fr:tex>. Thus, this models <html:em>demonic</html:em> non-determinism: Of the three programs in <fr:link href="/forest/dt-0063/" title="Angelic nondeterminism" uri="https://liamoc.net/forest/dt-0063/" display-uri="dt-0063" type="local">Remark <fr:contextual-number uri="https://liamoc.net/forest/dt-0063/" display-uri="dt-0063" /></fr:link>, the <fr:link href="/forest/dt-0064/" title="The Smyth powerdomain" uri="https://liamoc.net/forest/dt-0064/" display-uri="dt-0064" type="local">Smyth</fr:link> semantics considers 2 and 3 to be the same. Thus, the <html:em>possibility</html:em> of divergence <fr:tex display="inline"><![CDATA[\bot ]]></fr:tex> is no different from <html:em>inevitable</html:em> divergence.
</html:p></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:uri>https://liamoc.net/forest/dt-0067/</fr:uri><fr:display-uri>dt-0067</fr:display-uri><fr:route>/forest/dt-0067/</fr:route><fr:title text="The Plotkin powerdomain">The Plotkin powerdomain</fr:title></fr:frontmatter><fr:mainmatter><html:p>As before, let <fr:tex display="inline"><![CDATA[X, Y \in  \mathcal {P}_f^\ast (\mathsf {K}(A))]]></fr:tex> be finite, non-empty sets of <fr:link href="/forest/dt-003U/" title="Compactness" uri="https://liamoc.net/forest/dt-003U/" display-uri="dt-003U" type="local">compact elements</fr:link> of a <fr:link href="/forest/dt-004G/" title="Scott domain" uri="https://liamoc.net/forest/dt-004G/" display-uri="dt-004G" type="local">Scott domain</fr:link> <fr:tex display="inline"><![CDATA[A]]></fr:tex>. The <html:em>Plotkin powerdomain</html:em> construction is based on the following <fr:link href="/forest/dm-000V/" title="Preorder" uri="https://liamoc.net/forest/dm-000V/" display-uri="dm-000V" type="local">preorder</fr:link>, simply combining the orderings from the <fr:link href="/forest/dt-0061/" title="The Hoare powerdomain" uri="https://liamoc.net/forest/dt-0061/" display-uri="dt-0061" type="local">Hoare</fr:link> and <fr:link href="/forest/dt-0064/" title="The Smyth powerdomain" uri="https://liamoc.net/forest/dt-0064/" display-uri="dt-0064" type="local">Smyth</fr:link> constructions:
<fr:tex display="block"><![CDATA[
X \preceq _P Y\quad  \text {iff}\quad  X \preceq _H Y \land  X \preceq _S Y
]]></fr:tex>
This ordering is also called the <html:em>Egli-Milner</html:em> ordering.  On a <fr:link href="/forest/dt-0008/" title="Flat domain" uri="https://liamoc.net/forest/dt-0008/" display-uri="dt-0008" type="local">flat domain</fr:link>, it simplifies to:
<fr:tex display="block"><![CDATA[A\sqsubseteq  B\quad \text {iff}\quad  A = B \lor  (\bot  \in  A \land  (A \setminus  \{\bot \})\subseteq  B)]]></fr:tex>
Note that this <html:em>is</html:em> <fr:link href="/forest/dm-0003/" title="Antisymmetry" uri="https://liamoc.net/forest/dm-0003/" display-uri="dm-0003" type="local">antisymmetric</fr:link> in the case of a <fr:link href="/forest/dt-0008/" title="Flat domain" uri="https://liamoc.net/forest/dt-0008/" display-uri="dt-0008" type="local">flat domain</fr:link>, and the <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">lub</fr:link> of a <fr:link href="/forest/dt-000V/" title="Chain" uri="https://liamoc.net/forest/dt-000V/" display-uri="dt-000V" type="local">chain</fr:link> of sets can be found by taking the union of all elements of the chain if all elements contain <fr:tex display="inline"><![CDATA[\bot ]]></fr:tex> If not, then the element without <fr:tex display="inline"><![CDATA[\bot ]]></fr:tex> will be the <fr:link href="/forest/dt-0017/" title="Least upper bound" uri="https://liamoc.net/forest/dt-0017/" display-uri="dt-0017" type="local">least upper bound</fr:link>.</html:p><html:p>
The failures of <fr:link href="/forest/dm-0003/" title="Antisymmetry" uri="https://liamoc.net/forest/dm-0003/" display-uri="dm-0003" type="local">antisymmetry</fr:link> can only be observed in domains of height higher than one. Consider a set <fr:tex display="inline"><![CDATA[\{x,y\}]]></fr:tex> containing two elements. According to the induced equivalence from this <fr:link href="/forest/dm-000V/" title="Preorder" uri="https://liamoc.net/forest/dm-000V/" display-uri="dm-000V" type="local">preorder</fr:link> <fr:tex display="inline"><![CDATA[\approx _P]]></fr:tex>, this set would be considered equal to the set that contains those two elements <html:em>plus</html:em> any elements that lie between them on the <fr:link href="/forest/dt-000B/" title="Information ordering" uri="https://liamoc.net/forest/dt-000B/" display-uri="dt-000B" type="local">information ordering</fr:link>: <fr:tex display="block"><![CDATA[\{x,y\} \approx _P \{ z \mid  x \sqsubseteq  z \sqsubseteq  y \}]]></fr:tex>
The <html:em>Plotkin powerdomain</html:em> is sometimes called the <html:em>convex powerdomain</html:em>, due to the similarity of this to the geometric definition of convexity.  Thus, we use the <fr:link href="/forest/dt-0046/" title="Ideal completion" uri="https://liamoc.net/forest/dt-0046/" display-uri="dt-0046" type="local">ideal completion</fr:link> trick (as with the <fr:link href="/forest/dt-0061/" title="The Hoare powerdomain" uri="https://liamoc.net/forest/dt-0061/" display-uri="dt-0061" type="local">Hoare</fr:link> and <fr:link href="/forest/dt-0064/" title="The Smyth powerdomain" uri="https://liamoc.net/forest/dt-0064/" display-uri="dt-0064" type="local">Smyth</fr:link> constructions) here to arrive at a definition of powerdomain that distinguishes between all three programs outlined in <fr:link href="/forest/dt-0063/" title="Angelic nondeterminism" uri="https://liamoc.net/forest/dt-0063/" display-uri="dt-0063" type="local">Remark <fr:contextual-number uri="https://liamoc.net/forest/dt-0063/" display-uri="dt-0063" /></fr:link>.</html:p>


<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:taxon>Aside</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
There is a beautiful algebraic characterisation of Plotkin powerdomains in <fr:link href="/forest/mhennessy/" title="Matthew Hennessy" uri="https://liamoc.net/forest/mhennessy/" display-uri="mhennessy" type="local">Matthew Hennessy</fr:link> <fr:link href="/forest/plotkin/" title="Gordon Plotkin" uri="https://liamoc.net/forest/plotkin/" display-uri="plotkin" type="local">Gordon Plotkin</fr:link>'s paper, <fr:link href="/forest/hennessy-plotkin-1979/" title="Full abstraction for a simple parallel programming language" uri="https://liamoc.net/forest/hennessy-plotkin-1979/" display-uri="hennessy-plotkin-1979" type="local">Full abstraction for a simple parallel programming language</fr:link>.
</html:p></fr:mainmatter></fr:tree>
</fr:mainmatter></fr:tree></fr:mainmatter></fr:tree>
</fr:mainmatter>
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
              </fr:author>
            </fr:authors>
            <fr:uri>https://liamoc.net/forest/isa-0001/</fr:uri>
            <fr:display-uri>isa-0001</fr:display-uri>
            <fr:route>/forest/isa-0001/</fr:route>
            <fr:title text="Interactive theorem proving">Interactive theorem proving</fr:title>
            <fr:taxon>Lecture Notes</fr:taxon>
          </fr:frontmatter>
          <fr:mainmatter>
            <html:p>These notes are the basis of my short course at the <fr:link href="/forest/anu/" title="Australian National University" uri="https://liamoc.net/forest/anu/" display-uri="anu" type="local">ANU</fr:link> <fr:link href="/forest/loc-001W/" title="ANU Logic Summer School 2025" uri="https://liamoc.net/forest/loc-001W/" display-uri="loc-001W" type="local">Logic Summer School 2025</fr:link>.</html:p>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>11</fr:month>
                  <fr:day>25</fr:day>
                </fr:date>
                <fr:uri>https://liamoc.net/forest/isa-0002/</fr:uri>
                <fr:display-uri>isa-0002</fr:display-uri>
                <fr:route>/forest/isa-0002/</fr:route>
                <fr:title text="Building up HOL">Building up HOL</fr:title>
                <fr:taxon>Lecture</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>25</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-0003/</fr:uri>
                    <fr:display-uri>isa-0003</fr:display-uri>
                    <fr:route>/forest/isa-0003/</fr:route>
                    <fr:title text="Isabelle and HOL">Isabelle and HOL</fr:title>
                  </fr:frontmatter>
                  <fr:mainmatter>
                    <html:img width="250px" class="portrait" style="border:0px" src="/forest/bafkrmid5qssnct3jgc4wfnpvtmh47rq2mu7if6slhne45uwj5r7clgnufu.svg" />
                    <html:p>These lectures introduce theorem proving using the proof assistant <fr:link href="https://isabelle.in.tum.de/" type="external">Isabelle</fr:link>. Isabelle supports many logics, but by far the most popular is <html:strong>H</html:strong>igher <html:strong>O</html:strong>rder <html:strong>L</html:strong>ogic, the focus of these notes. Isabelle comes pre-packaged with its HOL libraries, as well as a proof editor (based on jEdit) and various other tools. </html:p>
                    <html:p>The proof developments shown in these notes are all developed with Isabelle 2024, but Isabelle 2025 (the latest version at time of writing) is largely backwards compatible with it. I have not upgraded due to some proof automation regressions in Isabelle 2025 that do not affect the content of these notes.</html:p>
                    <fr:tree show-metadata="false">
                      <fr:frontmatter>
                        <fr:authors>
                          <fr:author>
                            <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                          </fr:author>
                        </fr:authors>
                        <fr:date>
                          <fr:year>2025</fr:year>
                          <fr:month>11</fr:month>
                          <fr:day>30</fr:day>
                        </fr:date>
                        <fr:uri>https://liamoc.net/forest/isa-0013/</fr:uri>
                        <fr:display-uri>isa-0013</fr:display-uri>
                        <fr:route>/forest/isa-0013/</fr:route>
                        <fr:title text="Installing Isabelle">Installing Isabelle</fr:title>
                      </fr:frontmatter>
                      <fr:mainmatter>
                        <html:p>See dedicated instructions for <fr:link href="/forest/isa-0012/" title="Installing Isabelle/HOL on Windows" uri="https://liamoc.net/forest/isa-0012/" display-uri="isa-0012" type="local">Windows</fr:link>, <fr:link href="/forest/isa-0014/" title="Installing Isabelle/HOL on macOS" uri="https://liamoc.net/forest/isa-0014/" display-uri="isa-0014" type="local">Mac</fr:link> and <fr:link href="/forest/isa-0015/" title="Installing Isabelle/HOL on Linux" uri="https://liamoc.net/forest/isa-0015/" display-uri="isa-0015" type="local">Linux</fr:link></html:p>
                      </fr:mainmatter>
                    </fr:tree>
                  </fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>12</fr:month>
                      <fr:day>2</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-0016/</fr:uri>
                    <fr:display-uri>isa-0016</fr:display-uri>
                    <fr:route>/forest/isa-0016/</fr:route>
                    <fr:title text="Definining Theories">Definining Theories</fr:title>
                  </fr:frontmatter>
                  <fr:mainmatter><html:p>An Isabelle file is called a <html:em>theory</html:em>, and they consist of mathematical definitions (of types and terms), lemmas and proofs. Isabelle theories start with a theory name and a declaration of all the theories on which it depends. The theory name must match the file name, so the code from this lecture should be saved into a file called <html:code>HOLFromScratch.thy</html:code>. </html:p>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">theory HOLFromScratch
  imports Pure
begin
</html:shiki-block>

<html:p>We imported the theory <html:code>Pure</html:code>, which contains only the very basic built-in structures that define Isabelle's logic.  </html:p></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>12</fr:month>
                      <fr:day>2</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-0017/</fr:uri>
                    <fr:display-uri>isa-0017</fr:display-uri>
                    <fr:route>/forest/isa-0017/</fr:route>
                    <fr:title text="HHFs and Isabelle/Pure">HHFs and Isabelle/Pure</fr:title>
                  </fr:frontmatter>
                  <fr:mainmatter><html:p>Isabelle's logical framework consists of <html:em>terms</html:em> (<fr:tex display="inline"><![CDATA[t]]></fr:tex>), <html:em>types</html:em> (<fr:tex display="inline"><![CDATA[\tau ]]></fr:tex>) and <html:em>formulae</html:em> (<fr:tex display="inline"><![CDATA[\varphi ]]></fr:tex>). Each term <fr:tex display="inline"><![CDATA[t]]></fr:tex> must have a type <fr:tex display="inline"><![CDATA[\tau ]]></fr:tex>, written <fr:tex display="inline"><![CDATA[t :: \tau ]]></fr:tex>.  </html:p><html:p>In the below code, we define a new type called <html:code>bool</html:code>, and we declare that terms of type <html:code>bool</html:code> can be used as judgments in our formulae. The details of the <html:code>judgment</html:code> command are not important for now.</html:p>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">typedecl bool
judgment Trueprop :: "bool ⇒ prop"  (‹(_)› 5)
</html:shiki-block>

<html:p>Formulae in Isabelle are <html:em>hereditary Harrop formulae</html:em>, defined as:</html:p><fr:tex display="block"><![CDATA[\begin {array}{lclll}
\varphi  & ::=  & \bigwedge  x.\ \varphi   & & \textit {(meta-forall)} \\
        & \mid  & \varphi  \implies  \varphi  & & \textit {(meta-implication)}\\
        & \mid  & t & \text {where}\ t\ \text {:: \texttt {bool}} & \textit {(judgments)}
\end {array}]]></fr:tex><html:p>In Isabelle's syntax, formulae, terms, and types are typically surrounded by quote marks <html:code>""</html:code> or cartouches <html:code>‹›</html:code> — the two are equivalent.</html:p></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>12</fr:month>
                      <fr:day>2</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-0018/</fr:uri>
                    <fr:display-uri>isa-0018</fr:display-uri>
                    <fr:route>/forest/isa-0018/</fr:route>
                    <fr:title text="Isabelle's Syntax for HHFs">Isabelle's Syntax for HHFs</fr:title>
                    <fr:taxon>Example</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>
                    <html:p>Consider the following rule: <fr:tex display="block"><![CDATA[\dfrac {A \quad  B}{A \land  B}{\text {\small  conjI}}]]></fr:tex>
This is encoded as an Isabelle formula as follows:
<fr:tex display="block"><![CDATA[\bigwedge  A. \left (\bigwedge  B. (A \implies  (B \implies  (A \land  B)))\right ) ]]></fr:tex></html:p>
                    <html:p>Because <fr:tex display="inline"><![CDATA[\implies ]]></fr:tex> is right-associative, we can remove some parentheses:</html:p>
                    <fr:tex display="block"><![CDATA[\bigwedge  A. \left (\bigwedge  B. (A \implies  B \implies  A \land  B)\right ) ]]></fr:tex>
                    <html:p>We can also combine the meta-quantifiers:</html:p>
                    <fr:tex display="block"><![CDATA[\bigwedge  A\ B.\;\; A \implies  B \implies  A \land  B ]]></fr:tex>
                    <html:p>Isabelle includes special syntax <fr:tex display="inline"><![CDATA[\llbracket  A_0; A_1, \dots , A_n \rrbracket  \implies  C]]></fr:tex> which is equivalent to <fr:tex display="inline"><![CDATA[A_0 \implies  A_1 \implies  \dots  \implies  A_n \implies  C]]></fr:tex>.</html:p>
                    <fr:tex display="block"><![CDATA[\bigwedge  A\ B.\;\; \llbracket  A; B\rrbracket  \implies  A \land  B ]]></fr:tex>
                    <html:p>Isabelle will also automatically add quantifiers to unknown variables, so we can drop the meta-quantifiers from the outermost part of the formula:</html:p>
                    <fr:tex display="block"><![CDATA[\llbracket  A; B\rrbracket  \implies  A \land  B ]]></fr:tex>
                  </fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>25</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-0005/</fr:uri>
                    <fr:display-uri>isa-0005</fr:display-uri>
                    <fr:route>/forest/isa-0005/</fr:route>
                    <fr:title text="Conjunction">Conjunction</fr:title>
                    <fr:taxon>Definition</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter><fr:tex display="block"><![CDATA[\dfrac {A\quad  B}{A \land  B}\text {\small  conjI}\quad 
\dfrac {A\land  B}{A}\text {\small  conjunct1}\quad 
\dfrac {A\land  B}{B}\text {\small  conjunct2} ]]></fr:tex>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">axiomatization
  conj :: "bool ⇒ bool ⇒ bool" (infixr "∧" 35)
where
  conjI  : "⟦ A ; B ⟧ ⟹ (A ∧ B)" and
  conjunct1 : "A ∧ B ⟹ A" and
  conjunct2 : "A ∧ B ⟹ B"  
</html:shiki-block>

</fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>12</fr:month>
                      <fr:day>2</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-0019/</fr:uri>
                    <fr:display-uri>isa-0019</fr:display-uri>
                    <fr:route>/forest/isa-0019/</fr:route>
                    <fr:title text="Isabelle axiomatizations">Isabelle <html:code>axiomatization</html:code>s</fr:title>
                  </fr:frontmatter>
                  <fr:mainmatter><html:p>Isabelle's basic mechanism to define new things is the <html:code>axiomatization</html:code> command.</html:p>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">axiomatization 
  (* constants *) 
where 
  (* axioms *)</html:shiki-block>

<html:p>This defines the constants (with their types) in the <html:code>constants</html:code> section, and assumes the formulae stated in the <html:code>axioms</html:code> section. </html:p>


<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>2</fr:day></fr:date><fr:taxon>Problem</fr:taxon></fr:frontmatter><fr:mainmatter>
  <html:p>
  Isabelle does nothing to stop you from assuming false theorems as axioms in <html:code>axiomatization</html:code> commands, which can easily render the logic unsound. We shall later see safer ways to define new constants, which should be preferred over <html:code>axiomatization</html:code> in most cases.
</html:p>
</fr:mainmatter></fr:tree></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>12</fr:month>
                      <fr:day>2</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-001C/</fr:uri>
                    <fr:display-uri>isa-001C</fr:display-uri>
                    <fr:route>/forest/isa-001C/</fr:route>
                    <fr:title text="Isabelle Terms">Isabelle Terms</fr:title>
                  </fr:frontmatter>
                  <fr:mainmatter><html:p>Terms in Isabelle are essentially terms of the (polymorphic) <html:em>typed lambda calculus</html:em>. When we declare a constant like: </html:p>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">conj :: "bool ⇒ bool ⇒ bool" (infixr "∧" 35)</html:shiki-block>

<html:p>We are introducing a new constant called <html:code>conj</html:code> that has type <html:code>bool ⇒ bool ⇒ bool</html:code> — that is, a function that takes two values of type <html:code>bool</html:code> and produces another <html:code>bool</html:code>. The <html:code>infixr</html:code> annotation on the right hand side lets us use familiar notation <html:code>A ∧ B</html:code> instead of writing <html:code>conj A B</html:code>, but the meaning of <html:code>A ∧ B</html:code> is identical to <html:code>conj A B</html:code>.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>2</fr:day></fr:date><fr:title text="Currying">Currying</fr:title><fr:taxon>Aside</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Functions of multiple parameters in Isabelle are typically <html:em>curried</html:em>, meaning that a function of type <html:code>bool ⇒ bool ⇒ bool</html:code> is actually a function of type <html:code>bool ⇒ (bool ⇒ bool)</html:code> — a function that, given a <html:code>bool</html:code> value, produces a <html:em>function</html:em> of type <html:code>bool ⇒ bool</html:code>. </html:p></fr:mainmatter></fr:tree></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>28</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-000Z/</fr:uri>
                    <fr:display-uri>isa-000Z</fr:display-uri>
                    <fr:route>/forest/isa-000Z/</fr:route>
                    <fr:title text="rule">
                      <html:code>rule</html:code>
                    </fr:title>
                    <fr:taxon>Proof Method</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter><html:p>Given a goal <fr:tex display="inline"><![CDATA[\llbracket  A_1 \dots  A_n \rrbracket  \implies  G]]></fr:tex> and a theorem <html:code>r</html:code><fr:tex display="inline"><![CDATA[: \llbracket  P_1 \dots  P_n \rrbracket  \implies  G]]></fr:tex> (commonly an introduction rule),
<html:code>apply (rule r)</html:code> replaces the goal with subgoals:
<html:ul><html:li><fr:tex display="inline"><![CDATA[\llbracket  A_1 \dots  A_n \rrbracket  \implies  P_1 ]]></fr:tex></html:li><html:li><fr:tex display="inline"><![CDATA[\dots ]]></fr:tex></html:li><html:li><fr:tex display="inline"><![CDATA[\llbracket  A_1 \dots  A_n \rrbracket  \implies  P_n ]]></fr:tex></html:li></html:ul></html:p>

<fr:tree show-metadata="false" toc="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>11</fr:month><fr:day>28</fr:day></fr:date><fr:taxon>Aside</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Technically, the conclusion of the rule and the goal do not have to be exactly equal, but they must be <html:em>unifiable</html:em> – that is, there must be some substitution to schematic variables that makes the conclusion of the rule and the goal equal.</html:p></fr:mainmatter></fr:tree></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>28</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-0010/</fr:uri>
                    <fr:display-uri>isa-0010</fr:display-uri>
                    <fr:route>/forest/isa-0010/</fr:route>
                    <fr:title text="frule and drule"><html:code>frule</html:code> and <html:code>drule</html:code></fr:title>
                    <fr:taxon>Proof Method</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>
                    <html:p>Given a goal <fr:tex display="inline"><![CDATA[\llbracket  X; A_1 \dots  A_n \rrbracket  \implies  G]]></fr:tex> and a theorem <html:code>r</html:code><fr:tex display="inline"><![CDATA[: \llbracket  X; P_1 \dots  P_n \rrbracket  \implies  Y]]></fr:tex>,
<html:code>apply (frule r)</html:code> replaces the goal with subgoals:
<html:ul><html:li><fr:tex display="inline"><![CDATA[\llbracket  X; A_1 \dots  A_n \rrbracket  \implies  P_1 ]]></fr:tex></html:li><html:li><fr:tex display="inline"><![CDATA[\dots ]]></fr:tex></html:li><html:li><fr:tex display="inline"><![CDATA[\llbracket  X; A_1 \dots  A_n \rrbracket  \implies  P_n ]]></fr:tex></html:li>
<html:li><fr:tex display="inline"><![CDATA[\llbracket  X; Y; A_1 \dots  A_n \rrbracket  \implies  G]]></fr:tex></html:li></html:ul></html:p>
                    <html:p>The method <html:code>drule</html:code> is the same as <html:code>frule</html:code> except that it also deletes the assumption <fr:tex display="inline"><![CDATA[X]]></fr:tex> from the last subgoal.</html:p>
                  </fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>25</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-000C/</fr:uri>
                    <fr:display-uri>isa-000C</fr:display-uri>
                    <fr:route>/forest/isa-000C/</fr:route>
                    <fr:title text="Conjunction Elimination">Conjunction Elimination</fr:title>
                    <fr:taxon>Theorem</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma conjE : ‹⟦ A ∧ B ; ⟦ A ; B ⟧ ⟹ C ⟧ ⟹ C›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>11</fr:month><fr:day>25</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (rule impI)
apply (frule conjunct1)
apply (drule conjunct2)
apply (assumption)
done</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>25</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-0006/</fr:uri>
                    <fr:display-uri>isa-0006</fr:display-uri>
                    <fr:route>/forest/isa-0006/</fr:route>
                    <fr:title text="Implication">Implication</fr:title>
                    <fr:taxon>Definition</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter><fr:tex display="block"><![CDATA[
  \dfrac {\begin {array}{c}A\\ \vdots  \\ B \end {array}}{A \rightarrow  B}\text {\small  impI} \quad 
  \dfrac {A \rightarrow  B \quad  A}{B}\text {\small  mp}
]]></fr:tex>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">axiomatization
  implies :: "bool ⇒ bool ⇒ bool" (infixr "⟶" 25)
where
  impI : "(A ⟹ B) ⟹ (A ⟶ B)" and
  mp : "⟦ A ⟶ B ; A ⟧ ⟹ B" 
</html:shiki-block>

</fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>25</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-000D/</fr:uri>
                    <fr:display-uri>isa-000D</fr:display-uri>
                    <fr:route>/forest/isa-000D/</fr:route>
                    <fr:title text="Implication Elimination">Implication Elimination</fr:title>
                    <fr:taxon>Theorem</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma impE: ‹⟦ P ⟶ Q; P ; Q ⟹ R ⟧ ⟹ R›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>11</fr:month><fr:day>25</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (drule mp)
apply assumption
apply assumption
done</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>28</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-0011/</fr:uri>
                    <fr:display-uri>isa-0011</fr:display-uri>
                    <fr:route>/forest/isa-0011/</fr:route>
                    <fr:title text="erule">
                      <html:code>erule</html:code>
                    </fr:title>
                    <fr:taxon>Proof Method</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>
                    <html:p>Given a goal <fr:tex display="inline"><![CDATA[\llbracket  X; A_1 \dots  A_n \rrbracket  \implies  G]]></fr:tex> and a theorem <html:code>r</html:code><fr:tex display="inline"><![CDATA[: \llbracket  X; P_1 \dots  P_n \rrbracket  \implies  G]]></fr:tex> (typically an elimination rule where the conclusion is just a variable, easily unified with <fr:tex display="inline"><![CDATA[G]]></fr:tex>),
<html:code>apply (erule r)</html:code> replaces the goal with subgoals:
<html:ul><html:li><fr:tex display="inline"><![CDATA[\llbracket  A_1 \dots  A_n \rrbracket  \implies  P_1 ]]></fr:tex></html:li><html:li><fr:tex display="inline"><![CDATA[\dots ]]></fr:tex></html:li><html:li><fr:tex display="inline"><![CDATA[\llbracket   A_1 \dots  A_n \rrbracket  \implies  P_n ]]></fr:tex></html:li></html:ul></html:p>
                  </fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>25</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-0009/</fr:uri>
                    <fr:display-uri>isa-0009</fr:display-uri>
                    <fr:route>/forest/isa-0009/</fr:route>
                    <fr:taxon>Example</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma ‹A ∧ B ⟶ B ∧ A›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>11</fr:month><fr:day>25</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (rule impI)
apply (erule conjE)
apply (rule conjI)
 apply assumption
apply assumption
done</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>25</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-0007/</fr:uri>
                    <fr:display-uri>isa-0007</fr:display-uri>
                    <fr:route>/forest/isa-0007/</fr:route>
                    <fr:title text="False and True">False and True</fr:title>
                    <fr:taxon>Definition</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter><fr:tex display="block"><![CDATA[
  \dfrac {\quad }{\textsf {True}}\text {\small  TrueI} \quad 
  \dfrac {\textsf {False}}{P}\text {\small  FalseE}
]]></fr:tex>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">axiomatization
  False :: "bool" and
  True :: "bool"
where
  FalseE : "False ⟹ C" and
  TrueI  : "True"
</html:shiki-block>

</fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>25</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-0008/</fr:uri>
                    <fr:display-uri>isa-0008</fr:display-uri>
                    <fr:route>/forest/isa-0008/</fr:route>
                    <fr:title text="Negation">Negation</fr:title>
                    <fr:taxon>Definition</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter><fr:tex display="block"><![CDATA[
  \dfrac {\begin {array}{c} A \\ \vdots  \\ \textsf {False}\end {array}}{\neg  A}\text {\small  notI} \quad 
  \dfrac {\neg  A\quad  A}{R}\text {\small  notE}
]]></fr:tex>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">axiomatization
  not :: "bool ⇒ bool" ("¬ _" [40] 40)
where
  notI : "(A ⟹ False) ⟹ ¬ A" and
  notE : "⟦ ¬ A ; A ⟧ ⟹ R"
</html:shiki-block>

</fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>25</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-000A/</fr:uri>
                    <fr:display-uri>isa-000A</fr:display-uri>
                    <fr:route>/forest/isa-000A/</fr:route>
                    <fr:taxon>Example</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma ‹X ⟶ ¬ ¬ X›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>11</fr:month><fr:day>25</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (rule impI)
apply (rule notI)
apply (erule notE)
apply assumption
done</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>25</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-0004/</fr:uri>
                    <fr:display-uri>isa-0004</fr:display-uri>
                    <fr:route>/forest/isa-0004/</fr:route>
                    <fr:title text="Disjunction">Disjunction</fr:title>
                    <fr:taxon>Definition</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter><fr:tex display="block"><![CDATA[\dfrac {A}{A \lor  B}\text {\small  disjI1}\quad 
\dfrac {B}{A \lor  B}\text {\small  disjI2}\quad 
\dfrac {\begin {array}{lcc}&A & B\\ & \vdots  & \vdots  \\A \lor  B & C & C\end {array}}{C}\text {\small  disjE} ]]></fr:tex>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">axiomatization
  disj :: "bool ⇒ bool ⇒ bool" (infixr "∨" 30)
where
  disjI1 : "A ⟹ (A ∨ B)" and
  disjI2 : "B ⟹ (A ∨ B)" and
  disjE  : "⟦ A ∨ B ; A ⟹ C ; B ⟹ C ⟧ ⟹ C"
</html:shiki-block>

</fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>27</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-000M/</fr:uri>
                    <fr:display-uri>isa-000M</fr:display-uri>
                    <fr:route>/forest/isa-000M/</fr:route>
                    <fr:taxon>Example</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma disjCI: "¬ A ⟶ B ⟹ A ∨ B" </html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>11</fr:month><fr:day>27</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (rule ccontr)
apply (erule impE)
 apply (rule notI)
 apply (erule notE)
 apply (rule disjI1)
 apply assumption
apply (erule notE)
apply (rule disjI2)
apply assumption
done</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>25</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-000B/</fr:uri>
                    <fr:display-uri>isa-000B</fr:display-uri>
                    <fr:route>/forest/isa-000B/</fr:route>
                    <fr:taxon>Exercise</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma ‹(X ⟶ Y ⟶ ¬ X) ⟶ X ⟶ ¬ Y›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>11</fr:month><fr:day>25</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (rule impI)
apply (rule impI)
apply (erule impE)
apply assumption
 apply (rule notI)
 apply (erule impE)
 apply assumption
apply (erule notE)
apply assumption
done</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>27</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-000E/</fr:uri>
                    <fr:display-uri>isa-000E</fr:display-uri>
                    <fr:route>/forest/isa-000E/</fr:route>
                    <fr:title text="Classical Axiom">Classical Axiom</fr:title>
                    <fr:taxon>Definition</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter><fr:tex display="block"><![CDATA[\dfrac {\begin {array}{c}\neg  P \\ \vdots  \\ P \end {array}}{P}]]></fr:tex>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">axiomatization where
  classical: ‹⟦ ¬ P ⟹ P ⟧ ⟹ P›</html:shiki-block>

</fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>27</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-000F/</fr:uri>
                    <fr:display-uri>isa-000F</fr:display-uri>
                    <fr:route>/forest/isa-000F/</fr:route>
                    <fr:title text="Proof by Contradiction">Proof by Contradiction</fr:title>
                    <fr:taxon>Theorem</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma ccontr: "⟦ ¬ P ⟹ False ⟧ ⟹ P"</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>11</fr:month><fr:day>27</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (rule classical)
apply (rule FalseE)
by (assumption)</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>27</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-000G/</fr:uri>
                    <fr:display-uri>isa-000G</fr:display-uri>
                    <fr:route>/forest/isa-000G/</fr:route>
                    <fr:taxon>Example</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma ‹¬ ¬ X ⟶ X›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>11</fr:month><fr:day>27</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (rule impI)
apply (rule ccontr)
apply (erule notE)
apply assumption
done</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>27</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-000H/</fr:uri>
                    <fr:display-uri>isa-000H</fr:display-uri>
                    <fr:route>/forest/isa-000H/</fr:route>
                    <fr:taxon>Example</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma ‹¬ (A ⟶ B) ⟶ A›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>11</fr:month><fr:day>27</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (rule impI)
apply (rule ccontr)
apply (erule notE)
apply (rule impI)
apply (erule notE)
apply assumption
done</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>27</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-000I/</fr:uri>
                    <fr:display-uri>isa-000I</fr:display-uri>
                    <fr:route>/forest/isa-000I/</fr:route>
                    <fr:taxon>Exercise</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma ‹¬ (A ∧ B) ⟶ ¬ A ∨ ¬ B›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>11</fr:month><fr:day>27</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (rule impI)
apply (rule ccontr)
apply (erule notE)
apply (rule conjI)
 apply (rule ccontr)
 apply (erule notE)
 apply (rule disjI1)
 apply assumption
apply (rule ccontr)
apply (erule notE)
apply (rule disjI2)
apply assumption
done</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>27</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-000J/</fr:uri>
                    <fr:display-uri>isa-000J</fr:display-uri>
                    <fr:route>/forest/isa-000J/</fr:route>
                    <fr:taxon>Exercise</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma ‹¬ A ∧ ¬ B ⟶ ¬ (A ∨ B)›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>11</fr:month><fr:day>27</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (rule impI)
apply (erule conjE)
apply (rule notI)
apply (erule disjE)
 apply (erule notE, assumption)
apply (erule notE, assumption)
done</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>27</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-000K/</fr:uri>
                    <fr:display-uri>isa-000K</fr:display-uri>
                    <fr:route>/forest/isa-000K/</fr:route>
                    <fr:taxon>Exercise</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma ‹¬ (A ∨ B) ⟶ ¬ A ∧ ¬ B›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>11</fr:month><fr:day>27</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (rule impI)
apply (rule conjI)
 apply (rule notI)
 apply (erule notE)
 apply (rule disjI1)
 apply (assumption)
apply (rule notI)
 apply (erule notE)
 apply (rule disjI2)
 apply (assumption)
done</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>27</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-000L/</fr:uri>
                    <fr:display-uri>isa-000L</fr:display-uri>
                    <fr:route>/forest/isa-000L/</fr:route>
                    <fr:taxon>Exercise</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma ‹(A ⟶ B) ⟶ ((B ⟶ C) ⟶ A) ⟶ B›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>11</fr:month><fr:day>27</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (intro impI)
apply (rule ccontr)
apply (erule impE)
apply (drule mp)
 apply (rule impI)
 apply (erule notE)
apply assumption
 apply assumption
apply (erule notE)
apply assumption
done</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>25</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-000N/</fr:uri>
                    <fr:display-uri>isa-000N</fr:display-uri>
                    <fr:route>/forest/isa-000N/</fr:route>
                    <fr:title text="Universal Quantifiers">Universal Quantifiers</fr:title>
                    <fr:taxon>Definition</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">axiomatization
  All :: ‹('a ⇒ bool) ⇒ bool›  (binder "∀" 10)
where
  allI : ‹⟦ ⋀x. P x ⟧ ⟹ ∀ x. P x› and
  spec : ‹∀ a. P a ⟹ P x›
</html:shiki-block>

</fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>28</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-001A/</fr:uri>
                    <fr:display-uri>isa-001A</fr:display-uri>
                    <fr:route>/forest/isa-001A/</fr:route>
                    <fr:title text="rule_tac, erule_tac, drule_tac, frule_tac"><html:code>rule_tac</html:code>, <html:code>erule_tac</html:code>, <html:code>drule_tac</html:code>, <html:code>frule_tac</html:code></fr:title>
                    <fr:taxon>Proof Method</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter><html:p>The typical <html:code>rule</html:code>, <html:code>erule</html:code>, <html:code>drule</html:code>, <html:code>frule</html:code> methods rely entirely on unification to determine how to instantiate the variables in the provided rule. Sometimes, it is useful to state explicitly how to instantiate some variables in the rule, particularly when dealing with quantifiers, or when there are multiple possible candidates.</html:p>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (rule_tac x = "term" in exI)</html:shiki-block>

</fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>27</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-000P/</fr:uri>
                    <fr:display-uri>isa-000P</fr:display-uri>
                    <fr:route>/forest/isa-000P/</fr:route>
                    <fr:title text="Universal Quantifier Elimination">Universal Quantifier Elimination</fr:title>
                    <fr:taxon>Theorem</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma allE : ‹⟦ ∀a. P a; P x ⟹ R ⟧ ⟹ R›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>11</fr:month><fr:day>27</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (drule_tac x = x in spec)
  apply assumption
  done</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>25</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-000O/</fr:uri>
                    <fr:display-uri>isa-000O</fr:display-uri>
                    <fr:route>/forest/isa-000O/</fr:route>
                    <fr:title text="Existential Quantifiers">Existential Quantifiers</fr:title>
                    <fr:taxon>Definition</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">axiomatization
  Ex :: ‹('a ⇒ bool) ⇒ bool›  (binder "∃" 10)
where
  exI : ‹⟦ P x ⟧ ⟹ ∃a. P a› and 
  exE : ‹⟦ ∃ x. P x ; ⋀a. P a ⟹ R ⟧ ⟹ R›
</html:shiki-block>

</fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>27</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-000Q/</fr:uri>
                    <fr:display-uri>isa-000Q</fr:display-uri>
                    <fr:route>/forest/isa-000Q/</fr:route>
                    <fr:taxon>Example</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma ‹∀x. ¬ P x ⟹ ¬ (∃x. P x)›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>11</fr:month><fr:day>27</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (rule notI)
apply (erule exE)
apply (erule_tac x = a in allE)
apply (erule notE)
apply assumption
done</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>27</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-000R/</fr:uri>
                    <fr:display-uri>isa-000R</fr:display-uri>
                    <fr:route>/forest/isa-000R/</fr:route>
                    <fr:taxon>Example</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma ‹¬ (∃x. P x) ⟹ ∀x. ¬ P x›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>11</fr:month><fr:day>27</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (intro allI notI)
apply (erule notE)
apply (rule exI)
apply assumption
done</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>27</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-000S/</fr:uri>
                    <fr:display-uri>isa-000S</fr:display-uri>
                    <fr:route>/forest/isa-000S/</fr:route>
                    <fr:taxon>Example</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma ‹∃ x y. P x y ⟹ ∃ y x. P x y›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>11</fr:month><fr:day>27</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (elim exE)
apply (intro exI)
apply assumption
done</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>27</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-000T/</fr:uri>
                    <fr:display-uri>isa-000T</fr:display-uri>
                    <fr:route>/forest/isa-000T/</fr:route>
                    <fr:taxon>Exercise</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma ‹∃ x. P x ⟶ Q ⟹ (∀ x. P x) ⟶ Q›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>11</fr:month><fr:day>27</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (intro impI)
apply (elim exE)
apply (drule_tac x = a in spec)
apply (drule mp, assumption)
apply assumption
done</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>27</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-000U/</fr:uri>
                    <fr:display-uri>isa-000U</fr:display-uri>
                    <fr:route>/forest/isa-000U/</fr:route>
                    <fr:taxon>Exercise</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma ‹(∀ x. P x) ⟶ Q ⟹ ∃ x. P x ⟶ Q›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>11</fr:month><fr:day>27</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (rule ccontr)
apply (elim impE)
 apply (intro allI)
 apply (rule ccontr)
 apply (erule notE)
 apply (rule_tac x = x in exI)
 apply (rule impI)
 apply (erule notE)
 apply assumption
apply (erule notE)
apply (intro exI)
apply (rule impI)
apply assumption
done</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>27</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-000V/</fr:uri>
                    <fr:display-uri>isa-000V</fr:display-uri>
                    <fr:route>/forest/isa-000V/</fr:route>
                    <fr:taxon>Exercise</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma ‹(∀ x. P x) ⟶ (∃ x. Q x) ⟹ ∃ x. P x ⟶ Q x›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>11</fr:month><fr:day>27</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (rule ccontr)
apply (elim impE)
 apply (intro allI)
 apply (rule ccontr)
 apply (erule notE)
 apply (rule_tac x = x in exI)
 apply (rule impI)
 apply (erule notE)
 apply assumption
apply (erule notE)
apply (erule exE)
apply (intro exI)
apply (rule impI)
apply assumption
done</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>27</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-000W/</fr:uri>
                    <fr:display-uri>isa-000W</fr:display-uri>
                    <fr:route>/forest/isa-000W/</fr:route>
                    <fr:taxon>Exercise</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma ‹ ∃ x. P x ⟶ Q x ⟹ (∀ x. P x) ⟶ (∃ x. Q x)›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>11</fr:month><fr:day>27</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (rule impI)
apply (elim exE)
apply (drule_tac x = a in spec)
apply (drule mp, assumption)
apply (rule exI)
apply assumption
done</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>27</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-000X/</fr:uri>
                    <fr:display-uri>isa-000X</fr:display-uri>
                    <fr:route>/forest/isa-000X/</fr:route>
                    <fr:taxon>Exercise</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma ‹∀ x. ¬ R x ⟶ R (M x) ⟹ ∀ x. R x ∨ R (M x)›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>11</fr:month><fr:day>27</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (intro allI)
apply (erule_tac x = x in allE)
apply (rule ccontr)
apply (erule impE)
 apply (rule notI)
 apply (erule notE)
 apply (rule disjI1)
 apply assumption
apply (erule notE)
apply (rule disjI2)
apply assumption
done</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>11</fr:month>
                      <fr:day>27</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-000Y/</fr:uri>
                    <fr:display-uri>isa-000Y</fr:display-uri>
                    <fr:route>/forest/isa-000Y/</fr:route>
                    <fr:taxon>Exercise</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma ‹⟦∀ x. ¬ R x ⟶ R (M x); ∃ x. R x ⟧ ⟹ ∃ x. R x ∧ R (M (M x))›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>11</fr:month><fr:day>27</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (erule exE)
apply (rename_tac a)
apply (frule_tac x = a in spec)
apply (frule_tac x = "M a" in spec)
apply (drule_tac x = "M (M a)" in spec)
apply (drule disjCI)
apply (drule disjCI)
apply (drule disjCI)
apply (elim disjE;rule exI; rule conjI; assumption)
done</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter>
                </fr:tree>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>12</fr:month>
                  <fr:day>2</fr:day>
                </fr:date>
                <fr:uri>https://liamoc.net/forest/isa-001B/</fr:uri>
                <fr:display-uri>isa-001B</fr:display-uri>
                <fr:route>/forest/isa-001B/</fr:route>
                <fr:title text="Definitions, Datatypes, Induction, Functions">Definitions, Datatypes, Induction, Functions</fr:title>
                <fr:taxon>Lecture</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">theory Definitions
  imports Main
begin
</html:shiki-block>

<html:p>Unlike in <fr:link href="/forest/isa-0002/" title="Building up HOL" uri="https://liamoc.net/forest/isa-0002/" display-uri="isa-0002" type="local">Lecture <fr:contextual-number uri="https://liamoc.net/forest/isa-0002/" display-uri="isa-0002" /></fr:link>, we import <html:code>Main</html:code> here rather than <html:code>Pure</html:code>. Almost all theories developed in Isabelle/HOL import <html:code>Main</html:code>, which contains all of the axioms and connectives introduced in <fr:link href="/forest/isa-0002/" title="Building up HOL" uri="https://liamoc.net/forest/isa-0002/" display-uri="isa-0002" type="local">Lecture <fr:contextual-number uri="https://liamoc.net/forest/isa-0002/" display-uri="isa-0002" /></fr:link>, as well as a host of other theories, including:</html:p><html:ul><html:li>Axioms for defining <html:em>equality</html:em>. Try the following: 

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">thm refl
thm sym
thm trans
thm iffI
thm ssubst</html:shiki-block></html:li>
<html:li>A theory of <fr:link href="https://isabelle.in.tum.de/library/HOL/HOL/Set.html" type="external">sets</fr:link>.</html:li>
<html:li>A theory of <fr:link href="https://isabelle.in.tum.de/library/HOL/HOL/Nat.html" type="external">natural numbers</fr:link></html:li>
<html:li>A theory of <fr:link href="https://isabelle.in.tum.de/library/HOL/HOL/List.html" type="external">lists</fr:link></html:li>
<html:li>And much more!</html:li></html:ul><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>2</fr:day></fr:date><fr:uri>https://liamoc.net/forest/isa-001G/</fr:uri><fr:display-uri>isa-001G</fr:display-uri><fr:route>/forest/isa-001G/</fr:route><fr:title text="Isabelle definitions">Isabelle <html:code>definition</html:code>s</fr:title></fr:frontmatter><fr:mainmatter><html:p>The Isabelle <html:code>definition</html:code> command is a safer way to define constants than <fr:link href="/forest/isa-0019/" title="Isabelle axiomatizations" uri="https://liamoc.net/forest/isa-0019/" display-uri="isa-0019" type="local">the <html:code>axiomatization</html:code></fr:link> command. The syntax is similiar:  </html:p>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">definition 
  my_const :: "type"
where 
  (* equation *)</html:shiki-block>

<html:p>However, there are several differences:</html:p><html:ul><html:li>Only one constant (<html:code>my_const</html:code> above) can be defined.</html:li>
<html:li>Only one axiom can be defined, and it must be an equation of the format <html:code>my_const ... = ...</html:code>, describing the meaning of <html:code>my_const</html:code> in terms of other, already-defined constants.</html:li></html:ul><html:p>If no name is given to the defining equation, the default name produced by appending <html:code>_def</html:code> to the name of the constant is used (e.g. <html:code>my_const_def</html:code>)</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>2</fr:day></fr:date><fr:uri>https://liamoc.net/forest/isa-001D/</fr:uri><fr:display-uri>isa-001D</fr:display-uri><fr:route>/forest/isa-001D/</fr:route><fr:title text="A nand connective">A <html:code>nand</html:code> connective</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">definition nand :: ‹bool ⇒ bool ⇒ bool› where
  ‹nand a b = (¬ (a ∧ b))›</html:shiki-block>

</fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>2</fr:day></fr:date><fr:uri>https://liamoc.net/forest/isa-001F/</fr:uri><fr:display-uri>isa-001F</fr:display-uri><fr:route>/forest/isa-001F/</fr:route><fr:title text="unfold"><html:code>unfold</html:code></fr:title><fr:taxon>Proof Method</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Given a theorem <html:code>r</html:code><fr:tex display="inline"><![CDATA[: A = B]]></fr:tex> (typically a defining equation given by  <fr:link href="/forest/isa-001G/" title="Isabelle definitions" uri="https://liamoc.net/forest/isa-001G/" display-uri="isa-001G" type="local">the <html:code>definition</html:code> command</fr:link>), <html:code>apply (unfold r)</html:code> replaces every occurrence of <fr:tex display="inline"><![CDATA[A]]></fr:tex> in the current goal with <fr:tex display="inline"><![CDATA[B]]></fr:tex>.</html:p><html:p>If the theorem <html:code>r</html:code> has premises, then all of those premises must be directly satisfied by assumptions in the current goal for <html:code>unfold</html:code> to succeed.</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>2</fr:day></fr:date><fr:uri>https://liamoc.net/forest/isa-001E/</fr:uri><fr:display-uri>isa-001E</fr:display-uri><fr:route>/forest/isa-001E/</fr:route><fr:title text="Proving the axioms for nand">Proving the axioms for <html:code>nand</html:code></fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>We use the <fr:link href="/forest/isa-001F/" title="unfold" uri="https://liamoc.net/forest/isa-001F/" display-uri="isa-001F" type="local"><html:code>unfold</html:code></fr:link> method with the lemma generated by <fr:link href="/forest/isa-001D/" title="Definitions, Datatypes, Induction, Functions › A nand connective" uri="https://liamoc.net/forest/isa-001D/" display-uri="isa-001D" type="local">Definition <fr:contextual-number uri="https://liamoc.net/forest/isa-001D/" display-uri="isa-001D" /></fr:link> to replace <html:code>nand</html:code> with its definition in our goal:</html:p>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma nandI1: ‹¬A ⟹ nand A B›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>2</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>


<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (unfold nand_def)
apply (rule notI)
apply (erule conjE)
apply (erule notE)
apply assumption
done</html:shiki-block>

</fr:mainmatter></fr:tree><html:p />

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma nandI2: ‹¬B ⟹ nand A B›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>2</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>


<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (unfold nand_def)
apply (rule notI)
apply (erule conjE)
apply (erule notE)
apply assumption
done</html:shiki-block>

</fr:mainmatter></fr:tree><html:p />

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma nandE: ‹⟦ nand A B; ¬ A ⟹ C; ¬ B ⟹ C ⟧ ⟹ C›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>2</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>


<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (unfold nand_def)
apply (rule ccontr)
apply (erule notE)
apply (rule conjI)
 apply (rule ccontr)
 apply (erule notE)
 apply assumption
apply (rule ccontr)
apply (erule notE)
apply assumption
done</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>2</fr:day></fr:date><fr:uri>https://liamoc.net/forest/isa-001H/</fr:uri><fr:display-uri>isa-001H</fr:display-uri><fr:route>/forest/isa-001H/</fr:route><fr:title text="simp"><html:code>simp</html:code></fr:title><fr:taxon>Proof Method</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>The Isabelle simplifier, or <html:code>simp</html:code>, is one of the most powerful proof automation features in Isabelle, but it is a very simple idea. Given a set of equations, <html:code>apply (simp)</html:code> will (almost) blindly rewrite the goal by all of those equations (as well as any equations that are local assumptions in the goal) left-to-right. Given a sufficiently expressive set of equations, this allows the simplifier to solve many goals (including all of the theorems in <fr:link href="/forest/isa-001E/" title="Definitions, Datatypes, Induction, Functions › Proving the axioms for nand" uri="https://liamoc.net/forest/isa-001E/" display-uri="isa-001E" type="local">Example <fr:contextual-number uri="https://liamoc.net/forest/isa-001E/" display-uri="isa-001E" /></fr:link>) on its own.</html:p><html:p>The default set of equations that <html:code>simp</html:code> uses is called the <html:em>simpset</html:em>. We can add theorems to the <html:em>simpset</html:em> by attaching the <html:code>[simp]</html:code> attribute to them.   </html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors /><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>2</fr:day></fr:date><fr:uri>https://liamoc.net/forest/isa-001I/</fr:uri><fr:display-uri>isa-001I</fr:display-uri><fr:route>/forest/isa-001I/</fr:route><fr:title text="Simplifier rules for nand">Simplifier rules for <html:code>nand</html:code></fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>
    Continuing our <fr:link href="/forest/isa-001D/" title="Definitions, Datatypes, Induction, Functions › A nand connective" uri="https://liamoc.net/forest/isa-001D/" display-uri="isa-001D" type="local"><html:code>nand</html:code> example</fr:link>, we can prove theorems and attach the <html:code>[simp]</html:code> attribute simultaneously:


<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma nand_t[simp]: ‹nand True A = (¬ A)›
  apply (unfold nand_def)
  apply simp
  done</html:shiki-block>


  Alternatively, we can add theorems after-the-fact like so:


<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma nand_f: ‹nand False A = True›
  apply (unfold nand_def)
  apply simp
  done
(* ... *)
declare nand_f[simp]
</html:shiki-block>


Occasionally it becomes useful to remove a theorem from the simp set. This can be achieved by using the <html:code>declare</html:code> command and the <html:code>[simp del]</html:code> attribute:</html:p>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">declare nand_f[simp del]</html:shiki-block>

</fr:mainmatter></fr:tree><html:p>We can also adjust the simpset locally when we invoke the <html:code>simp</html:code> method:</html:p>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma nand_xt[simp]: ‹nand A True = (¬ A)›
by (simp add: nand_def)</html:shiki-block>




<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>2</fr:day></fr:date><fr:taxon>Problem</fr:taxon></fr:frontmatter><fr:mainmatter>
  <html:p>
  Isabelle does nothing to guarantee that <html:code>simp</html:code> will terminate, nor that it will be <html:em>confluent</html:em> (i.e. the results can depend on the order in which rewrites are applied). In particular, problems with non-termination can arise if there is a cycle in the equations used for rewriting. In such cases, it can be useful to remove certain lemmas from the simpset locally:</html:p>
  

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (simp del: nand_t)</html:shiki-block>


  <html:p>Or explicitly list all the theorems to use:</html:p>
  

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (simp only: nant_t nand_f)</html:shiki-block>


  <html:p>Or disable the simplification and use of local assumptions:</html:p>
  

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (simp (no_asm))</html:shiki-block>


  <html:p>Or disable the simplification of (but still use) local assumptions:</html:p>
  

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (simp (no_asm_simp))</html:shiki-block>


  <html:p>Or disable the use of (but still simplify) local assumptions:</html:p>
  

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (simp (no_asm_use))</html:shiki-block>


</fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>2</fr:day></fr:date><fr:uri>https://liamoc.net/forest/isa-001K/</fr:uri><fr:display-uri>isa-001K</fr:display-uri><fr:route>/forest/isa-001K/</fr:route><fr:title text="The datatype command">The <html:code>datatype</html:code> command</fr:title></fr:frontmatter><fr:mainmatter><html:p>The <html:code>datatype</html:code> defines a new type (like <html:code>typedecl</html:code>) but also defines some special constants, called <html:em>constructors</html:em>, which make values of that type. Constructors may optionally take arguments, and these data types may be recursive. </html:p>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">datatype type_name = Constructor1 "arg_type1" "arg_type2" (* ... *)
                   | Constructor2 (* ... *)
                   (* ... *)
</html:shiki-block>

<html:p>These datatypes are analogous to the algebraic data types found in many functional programming languages.</html:p><html:p>The <html:code>datatype</html:code> command automatically proves many lemmas about these types for you, chiefly:</html:p><html:ul><html:li>Disjointness: Values made with one constructor are not equal to values made with another constructor.</html:li>
<html:li>Exhaustivity: The only values of this type are those made by the listed constructors.</html:li>
<html:li>Injectivity: Two values of the same constructor are equal iff their arguments are equal.</html:li></html:ul></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors /><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>2</fr:day></fr:date><fr:uri>https://liamoc.net/forest/isa-001J/</fr:uri><fr:display-uri>isa-001J</fr:display-uri><fr:route>/forest/isa-001J/</fr:route><fr:title text="The oot type">The <html:code>oot</html:code> type</fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">datatype oot = ONE | TWO
print_theorems
</html:shiki-block>

<html:p>This defines a type called <html:code>oot</html:code> with two values, <html:code>ONE : oot</html:code> and <html:code>TWO : oot</html:code>. The <html:code>print_theorems</html:code> command here allows us to see all of the theorems automatically created by the <html:code>datatype</html:code> command, chiefly that the constants <html:code>ONE</html:code> and <html:code>TWO</html:code> are <html:em>disjoint</html:em> (i.e. <html:code>ONE ≠ TWO</html:code>) and <html:em>exhaustive</html:em> (i.e. that there are no other values of type <html:code>oot</html:code> apart from <html:code>ONE</html:code> and <html:code>TWO</html:code>) </html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>2</fr:day></fr:date><fr:uri>https://liamoc.net/forest/isa-001L/</fr:uri><fr:display-uri>isa-001L</fr:display-uri><fr:route>/forest/isa-001L/</fr:route><fr:title text="case_tac"><html:code>case_tac</html:code></fr:title><fr:taxon>Proof Method</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>The <html:code>case_tac</html:code> method splits the current goal into multiple cases. Given a term <html:code>t</html:code> of type <fr:tex display="inline"><![CDATA[\tau ]]></fr:tex>, <html:code>apply (case_tac t)</html:code> will produce a new goal for each possible case of <html:code>t</html:code> according to the <html:code>.cases</html:code> theorem for the type <fr:tex display="inline"><![CDATA[\tau ]]></fr:tex>.</html:p><html:p>This works for all types defined with <html:code>datatype</html:code>, as well as for natural numbers (type <html:code>nat</html:code>) and <html:code>bool</html:code>s — often an easier way to do classical reasoning than using <html:code>rule ccontr</html:code>. </html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>2</fr:day></fr:date><fr:uri>https://liamoc.net/forest/isa-001M/</fr:uri><fr:display-uri>isa-001M</fr:display-uri><fr:route>/forest/isa-001M/</fr:route><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma lm001M: ‹f (f (f (b::oot))) = f b›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>2</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>


<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (case_tac b)
 apply simp
 apply (case_tac "(f ONE)")
  apply simp
 apply simp
 apply (case_tac "(f TWO)")
  apply simp
 apply simp
apply (case_tac "(f ONE)")
 apply simp
 apply (case_tac "(f TWO)")
  apply simp
 apply simp
apply simp
apply (case_tac "(f TWO)")
 apply simp
apply simp
done</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:uri>https://liamoc.net/forest/isa-001N/</fr:uri><fr:display-uri>isa-001N</fr:display-uri><fr:route>/forest/isa-001N/</fr:route><fr:title text="Natural numbers in Isabelle">Natural numbers in Isabelle</fr:title></fr:frontmatter><fr:mainmatter><html:p>Isabelle/HOL's <fr:link href="https://isabelle.in.tum.de/library/HOL/HOL/Nat.html" type="external">theory of natural numbers</fr:link> defines natural numbers in a different way, but they behave much as if they were defined with <fr:link href="/forest/isa-001K/" title="The datatype command" uri="https://liamoc.net/forest/isa-001K/" display-uri="isa-001K" type="local">the <html:code>datatype</html:code> command</fr:link>. </html:p>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">datatype nat = 0 | Suc "nat"</html:shiki-block>

</fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:contributor><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:contributor></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:uri>https://liamoc.net/forest/isa-001O/</fr:uri><fr:display-uri>isa-001O</fr:display-uri><fr:route>/forest/isa-001O/</fr:route><fr:title text="Defining functions in Isabelle">Defining functions in Isabelle</fr:title></fr:frontmatter><fr:mainmatter><html:p>The <html:code>fun</html:code> command can be used to define functions in Isabelle. Unlike <fr:link href="/forest/isa-001G/" title="Isabelle definitions" uri="https://liamoc.net/forest/isa-001G/" display-uri="isa-001G" type="local"><html:code>definition</html:code>s</fr:link>, functions can be defined by <html:em>multiple</html:em> pattern-matching equations, they may be recursive, and their equations are automatically added to <fr:link href="/forest/isa-001H/" title="simp" uri="https://liamoc.net/forest/isa-001H/" display-uri="isa-001H" type="local">the simpset</fr:link>.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:title text="Fibonacci as a fun">Fibonacci as a <html:code>fun</html:code></fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">fun fib :: "nat ⇒ nat" where
  "fib 0 = 0"
| "fib (Suc 0) = Suc 0"
| "fib (Suc (Suc n)) = fib n + fib (Suc n)"
print_theorems</html:shiki-block>

</fr:mainmatter></fr:tree><html:p>The <html:code>print_theorems</html:code> command allows us to see all of the lemmas generated by this command.
</html:p>


<fr:tree show-metadata="false" toc="false" numbered="false"><fr:frontmatter><fr:authors /><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:taxon>Problem</fr:taxon></fr:frontmatter><fr:mainmatter>
  <html:p>Isabelle functions must provably terminate. The problem with non-terminating functions can be illustrated by a definition like:</html:p>
  

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">fun bad :: "nat ⇒ bool" where "bad x = ¬ (bad x)"</html:shiki-block>


  <html:p>If such a non-terminating definition were allowed, this would render our logic inconsistent (as <html:code>bad x</html:code> is equal to its own negation). Therefore, Isabelle requires that all functions be accompanied by a proof of termination.</html:p>
  <html:p>The <html:code>fun</html:code> command attempts to prove termination automatically. If it does not succeed, it will give an error message and fail to define the function. Manual proofs of termination can be supplied if the <html:code>function</html:code> command is used instead, but the <html:code>function</html:code> command is beyond the scope of this course. </html:p>
</fr:mainmatter></fr:tree><html:p>In cases where the recursion and pattern matching follows exactly the structure of the datatype in one argument, <html:code>primrec</html:code> can be used instead of <html:code>fun</html:code>, which is a bit more efficient:</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:uri>https://liamoc.net/forest/isa-001R/</fr:uri><fr:display-uri>isa-001R</fr:display-uri><fr:route>/forest/isa-001R/</fr:route><fr:title text="Factorial as a primrec">Factorial as a <html:code>primrec</html:code></fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">primrec factorial :: "nat ⇒ nat" where
  "factorial 0 = Suc 0"
| "factorial (Suc n) = Suc n * factorial n"
print_theorems</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:uri>https://liamoc.net/forest/isa-001P/</fr:uri><fr:display-uri>isa-001P</fr:display-uri><fr:route>/forest/isa-001P/</fr:route><fr:title text="induct (for structural induction)"><html:code>induct</html:code> (for structural induction)</fr:title><fr:taxon>Proof Method</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>While it is possible to use <html:code>rule</html:code> or <html:code>erule</html:code> with the generated <html:code>.induct</html:code> theorem from a <fr:link href="/forest/isa-001K/" title="The datatype command" uri="https://liamoc.net/forest/isa-001K/" display-uri="isa-001K" type="local"><html:code>datatype</html:code></fr:link>, it is usually much simpler and more convenient to use the <html:code>induct</html:code> proof method. Similar to the <fr:link href="/forest/isa-001L/" title="case_tac" uri="https://liamoc.net/forest/isa-001L/" display-uri="isa-001L" type="local"><html:code>case_tac</html:code></fr:link> method, <html:code>apply (induct t)</html:code> splits the goal into various cases, one for each constructor of the type of <html:code>t</html:code>. The difference is that for recursive cases of the datatype, we also get an <html:em>inductive hypothesis</html:em> added to our assumptions.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:uri>https://liamoc.net/forest/isa-001Q/</fr:uri><fr:display-uri>isa-001Q</fr:display-uri><fr:route>/forest/isa-001Q/</fr:route><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>We can prove a theorem about our <fr:link href="/forest/isa-001R/" title="Factorial as a primrec" uri="https://liamoc.net/forest/isa-001R/" display-uri="isa-001R" type="local">factorial definition</fr:link>:</html:p>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">theorem factorial_mult: "factorial n * factorial m ≤ factorial (n + m)"</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>


<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (induct n)
 apply simp
apply (simp only: factorial.simps add_Suc mult.assoc)
apply (rule mult_le_mono)
 apply simp
apply simp
done</html:shiki-block>


</fr:mainmatter></fr:tree></fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:uri>https://liamoc.net/forest/isa-001S/</fr:uri><fr:display-uri>isa-001S</fr:display-uri><fr:route>/forest/isa-001S/</fr:route><fr:title text="Higher-order functions">Higher-order functions</fr:title><fr:taxon>Example</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">primrec rpt :: ‹('a ⇒ 'a) ⇒ nat ⇒ 'a ⇒ 'a› where
  ‹rpt f 0 x = x ›
| ‹rpt f (Suc n) x = f (rpt f n x)›</html:shiki-block>

<html:p>The above function is given <html:em>another function</html:em> as an input.</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:uri>https://liamoc.net/forest/isa-001T/</fr:uri><fr:display-uri>isa-001T</fr:display-uri><fr:route>/forest/isa-001T/</fr:route><fr:taxon>Exercise</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">definition twice :: ‹('a ⇒ 'a) ⇒ 'a ⇒ 'a› where
‹twice f x  = f (f x)›</html:shiki-block>



<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma ‹rpt (twice f) n (f (x::oot)) = f x›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>


<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (unfold twice_def)
apply (induct n)
 apply simp
apply simp
apply (rule lm001M)
done</html:shiki-block>


<html:p>Using the lemma from <fr:link href="/forest/isa-001M/" title="Definitions, Datatypes, Induction, Functions › https://liamoc.net/forest/isa-001M/" uri="https://liamoc.net/forest/isa-001M/" display-uri="isa-001M" type="local">Example <fr:contextual-number uri="https://liamoc.net/forest/isa-001M/" display-uri="isa-001M" /></fr:link>.</html:p>
</fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:uri>https://liamoc.net/forest/isa-001U/</fr:uri><fr:display-uri>isa-001U</fr:display-uri><fr:route>/forest/isa-001U/</fr:route><fr:title text="The oots type">The <html:code>oots</html:code> type</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">datatype oots =
   ONEs "nat" "oots" 
 | TWOs "nat" "oots" 
 | Empty</html:shiki-block>

<html:p>This type encodes a sequence of <fr:link href="/forest/isa-001J/" title="Definitions, Datatypes, Induction, Functions › The oot type" uri="https://liamoc.net/forest/isa-001J/" display-uri="isa-001J" type="local"><html:code>oot</html:code></fr:link> values. For example, the value <html:code>ONEs 3 (TWOs 2 (ONEs 1 Empty))</html:code> encodes the sequence <html:code>[ONE, ONE, ONE, TWO, TWO, ONE]</html:code>. </html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:uri>https://liamoc.net/forest/isa-001V/</fr:uri><fr:display-uri>isa-001V</fr:display-uri><fr:route>/forest/isa-001V/</fr:route><fr:title text="The prepend function">The <html:code>prepend</html:code> function</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">fun prepend :: ‹oot ⇒ nat ⇒ oots ⇒ oots› where
  ‹prepend ONE n Empty = ONEs n Empty›
| ‹prepend TWO n Empty = TWOs n Empty›
| ‹prepend ONE n (TWOs m r) = ONEs n (TWOs m r)›
| ‹prepend TWO n (ONEs m r) = TWOs n (ONEs m r)›
| ‹prepend ONE n (ONEs m r) = ONEs (n+m) r›
| ‹prepend TWO n (TWOs m r) = TWOs (n+m) r›</html:shiki-block>

</fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:uri>https://liamoc.net/forest/isa-001W/</fr:uri><fr:display-uri>isa-001W</fr:display-uri><fr:route>/forest/isa-001W/</fr:route><fr:title text="prepend_prepend"><html:code>prepend_prepend</html:code></fr:title><fr:taxon>Theorem</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma prepend_prepend: ‹prepend s n (prepend s m r) = prepend s (n + m) r›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>


<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (case_tac s)
 apply simp
 apply (case_tac r)
   apply simp
  apply simp
 apply simp
 apply (case_tac r)
  apply simp
 apply simp
apply simp
done</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:uri>https://liamoc.net/forest/isa-001X/</fr:uri><fr:display-uri>isa-001X</fr:display-uri><fr:route>/forest/isa-001X/</fr:route><fr:title text="Combining methods with semicolons">Combining methods with semicolons</fr:title></fr:frontmatter><fr:mainmatter><html:p>Methods can be combined using the <html:code>;</html:code> operator:</html:p>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (m1; m2)</html:shiki-block>

<html:p>This applies <html:code>m2</html:code> to <html:em>every subgoal</html:em> that results from applying <html:code>m1</html:code> to the current goal. It can be chained together multiple times. For example, the entire proof of <fr:link href="/forest/isa-001W/" title="Definitions, Datatypes, Induction, Functions › prepend_prepend" uri="https://liamoc.net/forest/isa-001W/" display-uri="isa-001W" type="local">Theorem <fr:contextual-number uri="https://liamoc.net/forest/isa-001W/" display-uri="isa-001W" /></fr:link> can be much more succinctly expressed as one line:</html:p>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">by (case_tac s; case_tac r; simp)</html:shiki-block>

</fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:uri>https://liamoc.net/forest/isa-001Y/</fr:uri><fr:display-uri>isa-001Y</fr:display-uri><fr:route>/forest/isa-001Y/</fr:route><fr:title text="The cat function">The <html:code>cat</html:code> function</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">fun cat :: ‹oots ⇒ oots ⇒ oots› where
  ‹cat (ONEs n xs) ys = prepend ONE n (cat xs ys)›
| ‹cat (TWOs n xs) ys = prepend TWO n (cat xs ys)›
| ‹cat Empty ys = ys›
</html:shiki-block>

<html:p>This function uses <fr:link href="/forest/isa-001V/" title="Definitions, Datatypes, Induction, Functions › The prepend function" uri="https://liamoc.net/forest/isa-001V/" display-uri="isa-001V" type="local">the <html:code>prepend</html:code> function</fr:link> to concatenate two <html:code>oots</html:code> sequences together.</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:uri>https://liamoc.net/forest/isa-001Z/</fr:uri><fr:display-uri>isa-001Z</fr:display-uri><fr:route>/forest/isa-001Z/</fr:route><fr:title text="cat_prepend"><html:code>cat_prepend</html:code></fr:title><fr:taxon>Theorem</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma cat_prepend: ‹cat (prepend s n x) y = prepend s n (cat x y)›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>
  

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">by (case_tac s; case_tac x; simp add: prepend_prepend)</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:uri>https://liamoc.net/forest/isa-0021/</fr:uri><fr:display-uri>isa-0021</fr:display-uri><fr:route>/forest/isa-0021/</fr:route><fr:title text="Lists in Isabelle">Lists in Isabelle</fr:title></fr:frontmatter><fr:mainmatter><html:p>The Isabelle/HOL <fr:link href="https://isabelle.in.tum.de/library/HOL/HOL/List.html" type="external">theory of Lists</fr:link> defines lists as follows:</html:p>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">datatype 'a list = Nil | Cons "'a" "'a list" </html:shiki-block>

<html:p>This is an example of a <html:em>polymorphic</html:em> data type, where the type variable <html:code>'a</html:code> stands for a type. For example, the type <html:code>nat list</html:code> is the type of lists of <html:code>nat</html:code>, and <html:code>oot list</html:code> is the type of a list of <fr:link href="/forest/isa-001J/" title="Definitions, Datatypes, Induction, Functions › The oot type" uri="https://liamoc.net/forest/isa-001J/" display-uri="isa-001J" type="local"><html:code>oot</html:code>s</fr:link>. </html:p><html:p>The notation <html:code>x#xs</html:code> is syntax sugar for <html:code>Cons x xs</html:code> and <html:code>[]</html:code> is syntax sugar for <html:code>Nil</html:code>. Lists can also be written in square brackets, so:</html:p>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">[1,2,3]</html:shiki-block>

<html:p>is equivalent to:</html:p>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">1 # 2 # 3 # []</html:shiki-block>

<html:p>which is equivalent to:</html:p>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">Cons 1 (Cons 2 (Cons 3 Nil))</html:shiki-block>

<html:p>Some provided functions are useful, including <html:code>replicate :: nat ⇒ 'a ⇒ 'a list</html:code>, which produces a list of <fr:tex display="inline"><![CDATA[n]]></fr:tex> copies of the given value, and <html:code>append :: 'a list ⇒ 'a list ⇒ 'a list</html:code> which joins two lists together into one. The <html:code>append</html:code> function also has special notation, so <html:code>a @ b</html:code> is equivalent to <html:code>append a b</html:code></html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:uri>https://liamoc.net/forest/isa-0022/</fr:uri><fr:display-uri>isa-0022</fr:display-uri><fr:route>/forest/isa-0022/</fr:route><fr:title text="The expand function">The <html:code>expand</html:code> function</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">primrec expand :: ‹oots ⇒ oot list› where
  ‹expand (ONEs n r) = replicate n ONE @ expand r›
| ‹expand (TWOs n r) = replicate n TWO @ expand r›
| ‹expand Empty = []›</html:shiki-block>

</fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:uri>https://liamoc.net/forest/isa-0024/</fr:uri><fr:display-uri>isa-0024</fr:display-uri><fr:route>/forest/isa-0024/</fr:route><fr:title text="expand_prepend"><html:code>expand_prepend</html:code></fr:title><fr:taxon>Theorem</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma expand_prepend: ‹expand (prepend x n r) = replicate n x @ expand r›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">by (case_tac r; case_tac x; simp add: replicate_add)</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:uri>https://liamoc.net/forest/isa-0023/</fr:uri><fr:display-uri>isa-0023</fr:display-uri><fr:route>/forest/isa-0023/</fr:route><fr:title text="The compress function">The <html:code>compress</html:code> function</fr:title><fr:taxon>Definition</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">primrec compress :: ‹oot list ⇒ oots› where
  ‹compress [] = Empty›
| ‹compress (x#xs) = prepend x 1 (compress xs)›</html:shiki-block>

</fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:uri>https://liamoc.net/forest/isa-0025/</fr:uri><fr:display-uri>isa-0025</fr:display-uri><fr:route>/forest/isa-0025/</fr:route><fr:title text="expand_compress"><html:code>expand_compress</html:code></fr:title><fr:taxon>Theorem</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma expand_compress: ‹expand (compress xs) = xs›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">by (induct xs;simp add: expand_prepend)</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:uri>https://liamoc.net/forest/isa-0026/</fr:uri><fr:display-uri>isa-0026</fr:display-uri><fr:route>/forest/isa-0026/</fr:route><fr:title text="compress_append"><html:code>compress_append</html:code></fr:title><fr:taxon>Theorem</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma compress_append: ‹compress (xs @ ys) = cat (compress xs) (compress ys)›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">by (induct xs; simp add: cat_prepend)</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:uri>https://liamoc.net/forest/isa-0027/</fr:uri><fr:display-uri>isa-0027</fr:display-uri><fr:route>/forest/isa-0027/</fr:route><fr:title text="compress_replicate lemmas"><html:code>compress_replicate</html:code> lemmas</fr:title><fr:taxon>Theorem</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma compress_replicate_ONE: ‹n &gt; 0 ⟹ compress (replicate n ONE) = ONEs n Empty›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (induct n; simp)
apply (case_tac "n &gt; 0"; simp)
done</html:shiki-block>

</fr:mainmatter></fr:tree><html:p />

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma compress_replicate_TWO: ‹n &gt; 0 ⟹ compress (replicate n TWO) = TWOs n Empty›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (induct n; simp)
apply (case_tac "n &gt; 0"; simp)
done</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter></fr:tree></fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>12</fr:month>
                  <fr:day>3</fr:day>
                </fr:date>
                <fr:uri>https://liamoc.net/forest/isa-002N/</fr:uri>
                <fr:display-uri>isa-002N</fr:display-uri>
                <fr:route>/forest/isa-002N/</fr:route>
                <fr:title text="Rule Induction, Automation, Structured Proofs">Rule Induction, Automation, Structured Proofs</fr:title>
                <fr:taxon>Lecture</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>This lecture continues the theory file begun in <fr:link href="/forest/isa-001B/" title="Definitions, Datatypes, Induction, Functions" uri="https://liamoc.net/forest/isa-001B/" display-uri="isa-001B" type="local">Lecture <fr:contextual-number uri="https://liamoc.net/forest/isa-001B/" display-uri="isa-001B" /></fr:link>.</html:p>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>12</fr:month>
                      <fr:day>3</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-0028/</fr:uri>
                    <fr:display-uri>isa-0028</fr:display-uri>
                    <fr:route>/forest/isa-0028/</fr:route>
                    <fr:title text="inductive predicates"><html:code>inductive</html:code> predicates</fr:title>
                  </fr:frontmatter>
                  <fr:mainmatter>
                    <html:p>With the <html:code>inductive</html:code> command, we define a predicate by specifying a collection of inference rules, and the inductive predicate is the smallest predicate closed under those rules.</html:p>
                    <html:p>In other words: An element satisfies the predicate exactly if it can be derived using the given rules.</html:p>
                    <html:p>From the given rules, Isabelle automatically generates an induction principle (<html:code>.induct</html:code>) which can be used with the <html:code>induct</html:code> method (see <fr:link href="/forest/isa-0029/" title="induct (for rule induction)" uri="https://liamoc.net/forest/isa-0029/" display-uri="isa-0029" type="local">Proof Method <fr:contextual-number uri="https://liamoc.net/forest/isa-0029/" display-uri="isa-0029" /></fr:link>) and a cases theorem (<html:code>.cases</html:code>) for use with the <fr:link href="/forest/isa-001L/" title="case_tac" uri="https://liamoc.net/forest/isa-001L/" display-uri="isa-001L" type="local"><html:code>case_tac</html:code></fr:link> method. </html:p>
                  </fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>12</fr:month>
                      <fr:day>3</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-002K/</fr:uri>
                    <fr:display-uri>isa-002K</fr:display-uri>
                    <fr:route>/forest/isa-002K/</fr:route>
                    <fr:title text="Even numbers as an inductive">Even numbers as an <html:code>inductive</html:code></fr:title>
                    <fr:taxon>Example</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">inductive even :: "nat ⇒ bool" where
  even0:  "even 0"
| evenSS: "even n ⟹ even (Suc (Suc n))"</html:shiki-block>

</fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>12</fr:month>
                      <fr:day>3</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-0029/</fr:uri>
                    <fr:display-uri>isa-0029</fr:display-uri>
                    <fr:route>/forest/isa-0029/</fr:route>
                    <fr:title text="induct (for rule induction)"><html:code>induct</html:code> (for rule induction)</fr:title>
                    <fr:taxon>Proof Method</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter><html:p>You’ve already seen <fr:link href="/forest/isa-001P/" title="induct (for structural induction)" uri="https://liamoc.net/forest/isa-001P/" display-uri="isa-001P" type="local">how to use <html:code>induct</html:code></fr:link> for structural induction. Exactly the same <html:code>induct</html:code> method can also be used for rule induction, when your induction is over an <html:code>inductive</html:code>ly defined predicate, not over the structure of some <html:code>datatype</html:code>.</html:p><html:p>When you define a predicate <html:code>p</html:code> with the <fr:link href="/forest/isa-0028/" title="inductive predicates" uri="https://liamoc.net/forest/isa-0028/" display-uri="isa-0028" type="local"><html:code>inductive</html:code> command</fr:link>, Isabelle automatically produces an induction rule named <html:code>p.induct</html:code>. This rule expresses how to perform induction over derivations of <html:code>p x</html:code>, one case for each introduction rule of the predicate.</html:p><html:p>Although you could apply the raw rule with <html:code>rule</html:code> or <html:code>erule</html:code>, it is almost always easier to use:</html:p>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (induct rule: p.induct)</html:shiki-block>

<html:p>This behaves just like structural induction:
The goal is split into one subgoal per introduction rule of the predicate, and recursive premises of the rules give rise to induction hypotheses, added to your assumptions.</html:p></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>12</fr:month>
                      <fr:day>3</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-002L/</fr:uri>
                    <fr:display-uri>isa-002L</fr:display-uri>
                    <fr:route>/forest/isa-002L/</fr:route>
                    <fr:title text="Even numbers are multiples of two">Even numbers are multiples of two</fr:title>
                    <fr:taxon>Exercise</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma "even n ⟹ ∃m. (m * 2 = n)"</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>
  

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (induct rule: even.induct)
 apply simp
apply (erule exE)
apply (rule_tac x = ‹Suc m› in exI)
apply simp
done</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>12</fr:month>
                      <fr:day>3</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-002A/</fr:uri>
                    <fr:display-uri>isa-002A</fr:display-uri>
                    <fr:route>/forest/isa-002A/</fr:route>
                    <fr:title text="Wellformedness for oots">Wellformedness for <html:code>oots</html:code></fr:title>
                    <fr:taxon>Example</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter><html:p>We define <html:code>well</html:code>, an inductive wellformedness predicate for <html:code>oots</html:code> sequences, that state there are no segments of zero length, and that no two adjacent segments have the same <html:code>oot</html:code> value.</html:p>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">inductive well :: ‹oots ⇒ bool› where
  ‹well Empty›
| ‹n &gt; 0 ⟹ well (ONEs n Empty)›
| ‹n &gt; 0 ⟹ well (TWOs n Empty)›
| ‹n &gt; 0 ⟹ well (ONEs m r) ⟹ well (TWOs n (ONEs m r))›
| ‹n &gt; 0 ⟹ well (TWOs m r) ⟹ well (ONEs n (TWOs m r))›</html:shiki-block>

</fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>12</fr:month>
                      <fr:day>3</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-002B/</fr:uri>
                    <fr:display-uri>isa-002B</fr:display-uri>
                    <fr:route>/forest/isa-002B/</fr:route>
                    <fr:title text="compress_expand">
                      <html:code>compress_expand</html:code>
                    </fr:title>
                    <fr:taxon>Theorem</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma compress_expand:‹well s ⟹ compress (expand s) = s›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (induct rule: well.induct)
    apply simp
   apply (simp add: compress_replicate_ONE)
  apply (simp add: compress_replicate_TWO)
 apply (simp add: compress_replicate_ONE
                  compress_replicate_TWO 
                  compress_app)
apply (simp add: compress_replicate_ONE 
                 compress_replicate_TWO 
                 compress_app)
done</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>12</fr:month>
                      <fr:day>3</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-002C/</fr:uri>
                    <fr:display-uri>isa-002C</fr:display-uri>
                    <fr:route>/forest/isa-002C/</fr:route>
                    <fr:title text="List subsequence relation">List subsequence relation</fr:title>
                    <fr:taxon>Definition</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">inductive subsequence :: ‹'a list ⇒ 'a list ⇒ bool› where
  ss_empty: ‹subsequence [] []› 
| ss_keep: ‹subsequence xs ys ⟹ subsequence (x#xs) (x#ys)›
| ss_drop: ‹subsequence xs ys ⟹ subsequence xs (y#ys)›</html:shiki-block>

</fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>12</fr:month>
                      <fr:day>3</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-002D/</fr:uri>
                    <fr:display-uri>isa-002D</fr:display-uri>
                    <fr:route>/forest/isa-002D/</fr:route>
                    <fr:title text="Reflexivity of subsequence">Reflexivity of <html:code>subsequence</html:code></fr:title>
                    <fr:taxon>Theorem</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma ss_refl: ‹subsequence ls ls›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (induct ls)
 apply (rule ss_empty)
apply (rule ss_keep)
apply assumption
done</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>12</fr:month>
                      <fr:day>3</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-002E/</fr:uri>
                    <fr:display-uri>isa-002E</fr:display-uri>
                    <fr:route>/forest/isa-002E/</fr:route>
                    <fr:title text="Length of subsequence">Length of <html:code>subsequence</html:code></fr:title>
                    <fr:taxon>Theorem</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma ss_length : ‹subsequence xs ys ⟹ length xs ≤ length ys›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (induct rule: subsequence.induct)
  apply simp
 apply simp
apply simp
done</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>12</fr:month>
                      <fr:day>3</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-002F/</fr:uri>
                    <fr:display-uri>isa-002F</fr:display-uri>
                    <fr:route>/forest/isa-002F/</fr:route>
                    <fr:title text="Controlling backtracking, chaining methods with comma">Controlling backtracking, chaining methods with comma</fr:title>
                  </fr:frontmatter>
                  <fr:mainmatter><html:p>Some methods (like <fr:link href="/forest/isa-0011/" title="erule" uri="https://liamoc.net/forest/isa-0011/" display-uri="isa-0011" type="local"><html:code>erule</html:code></fr:link> when there are multiple matching assumptions) are <html:em>nondeterministic</html:em>, producing multiple alternative proof states.</html:p><html:p>The <html:code>back</html:code> command interactively explores a different alternative branch produced by the previous step.</html:p>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma "C ∧ D ⟹ A ∧ B ⟹ A"
apply (erule conjE) (* could apply to either assumption *)
back
apply assumption
done</html:shiki-block>

<html:p>This is useful for interactive exploration, but is <html:em>very brittle</html:em> and considered poor style.</html:p><html:p>Instead, we can combine methods with the <html:em>comma</html:em> operator <html:code>,</html:code>: The command <html:code>apply (m1, m2)</html:code> first runs <html:code>m1</html:code>, and then runs <html:code>m2</html:code>, accepting only the nondeterministic branches where the second method <html:code>m2</html:code> succeeds. This avoids the need for back:</html:p>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma "C ∧ D ⟹ A ∧ B ⟹ A"
apply (erule conjE, assumption)
done</html:shiki-block>

</fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>12</fr:month>
                      <fr:day>3</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-002G/</fr:uri>
                    <fr:display-uri>isa-002G</fr:display-uri>
                    <fr:route>/forest/isa-002G/</fr:route>
                    <fr:title text="Repeating methods with +">Repeating methods with <html:code>+</html:code></fr:title>
                  </fr:frontmatter>
                  <fr:mainmatter><html:p>For a method <html:code>m</html:code>:</html:p>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (m)+</html:shiki-block>

<html:p>Repeatedly applies the <html:code>m</html:code> as many times as possible until it fails. It stops automatically when <html:code>m</html:code> can no longer make progress; and does not backtrack.</html:p></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>12</fr:month>
                      <fr:day>3</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-002H/</fr:uri>
                    <fr:display-uri>isa-002H</fr:display-uri>
                    <fr:route>/forest/isa-002H/</fr:route>
                    <fr:title text="Antisymmetry of subsequence">Antisymmetry of <html:code>subsequence</html:code></fr:title>
                    <fr:taxon>Theorem</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma ss_antisym: ‹subsequence ys xs ⟹ subsequence xs ys ⟹ xs = ys›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (induct rule: subsequence.induct)
  apply simp
 apply simp
 apply (erule subsequence.cases, simp, simp, simp)
 apply (drule ss_length)+
apply (drule sym, simp)
 apply (drule ss_length)+
apply simp
done</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>12</fr:month>
                      <fr:day>3</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-002I/</fr:uri>
                    <fr:display-uri>isa-002I</fr:display-uri>
                    <fr:route>/forest/isa-002I/</fr:route>
                    <fr:title text="Generalising the induction hypothesis with arbitrary">Generalising the induction hypothesis with <html:code>arbitrary</html:code></fr:title>
                  </fr:frontmatter>
                  <fr:mainmatter>
                    <html:p>By default, <fr:link href="/forest/isa-001P/" title="induct (for structural induction)" uri="https://liamoc.net/forest/isa-001P/" display-uri="isa-001P" type="local">structural induction</fr:link> <html:code>induct t</html:code> produces an induction hypothesis for the variables directly mentioned in <html:code>t</html:code>, and <fr:link href="/forest/isa-0029/" title="induct (for rule induction)" uri="https://liamoc.net/forest/isa-0029/" display-uri="isa-0029" type="local">rule induction</fr:link> <html:code>induct rule: p.induct</html:code> produces a hypothesis for the variables directly mentioned by the eliminated <html:code>p</html:code> assumption.</html:p>
                    <html:p>Sometimes you need a stronger hypothesis that generalises across additional variables in the goal. The <html:code>arbitrary</html:code> option tells the <html:code>induct</html:code> method to generalise certain variables, so the induction hypothesis assumes the property holds for all values of those variables.</html:p>
                    <fr:tree show-metadata="false">
                      <fr:frontmatter>
                        <fr:authors>
                          <fr:author>
                            <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                          </fr:author>
                        </fr:authors>
                        <fr:date>
                          <fr:year>2025</fr:year>
                          <fr:month>12</fr:month>
                          <fr:day>3</fr:day>
                        </fr:date>
                        <fr:uri>https://liamoc.net/forest/isa-002M/</fr:uri>
                        <fr:display-uri>isa-002M</fr:display-uri>
                        <fr:route>/forest/isa-002M/</fr:route>
                        <fr:title text="Inequality as an inductive">Inequality as an <html:code>inductive</html:code></fr:title>
                        <fr:taxon>Example</fr:taxon>
                      </fr:frontmatter>
                      <fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">inductive myLE :: "nat ⇒ nat ⇒ bool" where
  base: "myLE 0 n"
| step: "myLE m n ⟹ myLE (Suc m) (n+1)"</html:shiki-block>

<html:p>Proving that this implies the normal inequality relation requires the use of <fr:link href="/forest/isa-002I/" title="Generalising the induction hypothesis with arbitrary" uri="https://liamoc.net/forest/isa-002I/" display-uri="isa-002I" type="local">variable generalising</fr:link>:</html:p>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma "myLE m n ⟹ m ≤ n"
apply (induct m arbitrary: n)
 apply simp
apply (erule myLE.cases; simp)
done</html:shiki-block>

</fr:mainmatter>
                    </fr:tree>
                  </fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>12</fr:month>
                      <fr:day>3</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-002J/</fr:uri>
                    <fr:display-uri>isa-002J</fr:display-uri>
                    <fr:route>/forest/isa-002J/</fr:route>
                    <fr:title text="Transitivity of subsequence">Transitivity of <html:code>subsequence</html:code></fr:title>
                    <fr:taxon>Theorem</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">lemma ss_trans: ‹subsequence ys zs ⟹ subsequence xs ys ⟹ subsequence xs zs›</html:shiki-block>





<fr:tree show-metadata="false" expanded="false" toc="false" numbered="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>12</fr:month><fr:day>3</fr:day></fr:date><fr:taxon>Solution</fr:taxon></fr:frontmatter><fr:mainmatter>

<html:shiki-block language="Isabelle Theory" load-languages="c,javascript" root-path="/forest">apply (induct ys zs arbitrary: xs rule: subsequence.induct)
  apply simp
 apply (erule subsequence.cases)
   apply simp
  apply clarsimp

  apply (erule subsequence.cases)
    apply simp
   apply clarsimp
   apply (rule ss_keep)
   apply simp
  apply simp
  apply clarsimp
  apply (rule ss_drop)
  apply simp
 apply simp
 apply clarsimp

 apply (erule subsequence.cases)
   apply clarsimp
  apply clarsimp
  apply (rule ss_keep)
  apply clarsimp
 apply clarsimp
 apply (rule ss_drop)
 apply clarsimp
apply (rule ss_drop)
apply simp
done</html:shiki-block>

</fr:mainmatter></fr:tree></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>12</fr:month>
                      <fr:day>5</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-002P/</fr:uri>
                    <fr:display-uri>isa-002P</fr:display-uri>
                    <fr:route>/forest/isa-002P/</fr:route>
                    <fr:title text="blast, fast, slow, and best"><html:code>blast</html:code>, <html:code>fast</html:code>, <html:code>slow</html:code>, and <html:code>best</html:code></fr:title>
                    <fr:taxon>Proof Method</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>
                    <html:p><html:code>blast</html:code> is a method for <html:em>automatic</html:em> classical first-order reasoning, based on a tableaux prover. <html:code>apply blast</html:code> attempts a thorough search using sets of <html:code>intro</html:code> and <html:code>elim</html:code> rules. Like <fr:link href="/forest/isa-001H/" title="simp" uri="https://liamoc.net/forest/isa-001H/" display-uri="isa-001H" type="local"><html:code>simp</html:code></fr:link>, rules can be annotated with   <html:code> [intro] </html:code> and <html:code>[elim]</html:code> annotations, or they can be passed locally to <html:code>blast</html:code> (i.e. <html:code>apply (blast intro: nandI1 nandI2 elim: nandE)</html:code>)
 </html:p>
                    <html:p> The methods <html:code>fast</html:code>, <html:code>slow</html:code>, and <html:code>best</html:code> use a different classical proof search engine than <html:code>blast</html:code>, each with a different proof search strategy. <html:code>fast</html:code> performs a quick, depth-bounded search, and is generally faster. <html:code>slow</html:code> is a more exhaustive search and more backtracking, and <html:code>best</html:code> performs a best-first search strategy using a heuristic based on the size of the goal. In general, if <html:code>fast</html:code> or <html:code>blast</html:code> can solve your goal, it will be the most efficient at solving it, whereas <html:code>slow</html:code> and <html:code>best</html:code> are only used if no other automated technique works.</html:p>
                  </fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>12</fr:month>
                      <fr:day>5</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-002O/</fr:uri>
                    <fr:display-uri>isa-002O</fr:display-uri>
                    <fr:route>/forest/isa-002O/</fr:route>
                    <fr:title text="Safe vs Unsafe Rules">Safe vs Unsafe Rules</fr:title>
                  </fr:frontmatter>
                  <fr:mainmatter>
                    <html:p>Rules such as <html:code>conjI</html:code>, <html:code>impI</html:code>, or <html:code>disjE</html:code> that cannot change a <html:em>provable</html:em> goal into <html:em>unprovable</html:em> goal(s) are called <html:em>safe</html:em>. Isabelle's automation strategies like safe rules because they can apply them without fear, or the need for backtracking. You can mark a rule as safe by marking it <html:code>[intro!]</html:code> or <html:code>[elim!]</html:code>. This can also be done locally when invoking methods like <fr:link href="/forest/isa-002P/" title="blast, fast, slow, and best" uri="https://liamoc.net/forest/isa-002P/" display-uri="isa-002P" type="local"><html:code>blast</html:code>, <html:code>fast</html:code>, <html:code>slow</html:code>, and <html:code>best</html:code></fr:link>.</html:p>
                  </fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>12</fr:month>
                      <fr:day>5</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-002Q/</fr:uri>
                    <fr:display-uri>isa-002Q</fr:display-uri>
                    <fr:route>/forest/isa-002Q/</fr:route>
                    <fr:title text="safe and clarify"><html:code>safe</html:code> and <html:code>clarify</html:code></fr:title>
                    <fr:taxon>Proof Method</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>
                    <html:p>The method <html:code>safe</html:code> applies only <fr:link href="/forest/isa-002O/" title="Safe vs Unsafe Rules" uri="https://liamoc.net/forest/isa-002O/" display-uri="isa-002O" type="local"><html:em>safe</html:em></fr:link> rules to the current goal. The method <html:code>clarify</html:code> is similar, but it only applies <fr:link href="/forest/isa-002O/" title="Safe vs Unsafe Rules" uri="https://liamoc.net/forest/isa-002O/" display-uri="isa-002O" type="local"><html:em>safe</html:em></fr:link> rules that <html:em>do not split the goal into multiple subgoals</html:em>. Like <fr:link href="/forest/isa-002P/" title="blast, fast, slow, and best" uri="https://liamoc.net/forest/isa-002P/" display-uri="isa-002P" type="local"><html:code>blast</html:code> etc.</fr:link>, rules can be added to these methods with <html:code>intro!:</html:code> etc.</html:p>
                  </fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>12</fr:month>
                      <fr:day>5</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-002R/</fr:uri>
                    <fr:display-uri>isa-002R</fr:display-uri>
                    <fr:route>/forest/isa-002R/</fr:route>
                    <fr:title text="clarsimp, slowsimp, bestsimp and fastforce"><html:code>clarsimp</html:code>, <html:code>slowsimp</html:code>, <html:code>bestsimp</html:code> and <html:code>fastforce</html:code></fr:title>
                    <fr:taxon>Proof Method</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>
                    <html:p><html:code>clarsimp</html:code> the combination of <fr:link href="/forest/isa-002Q/" title="safe and clarify" uri="https://liamoc.net/forest/isa-002Q/" display-uri="isa-002Q" type="local">clarify</fr:link> and <fr:link href="/forest/isa-001H/" title="simp" uri="https://liamoc.net/forest/isa-001H/" display-uri="isa-001H" type="local">simp</fr:link>, and is very useful when doing exploratory proving. <html:code>slowsimp</html:code> is the combination of <fr:link href="/forest/isa-002P/" title="blast, fast, slow, and best" uri="https://liamoc.net/forest/isa-002P/" display-uri="isa-002P" type="local">slow</fr:link> and <fr:link href="/forest/isa-001H/" title="simp" uri="https://liamoc.net/forest/isa-001H/" display-uri="isa-001H" type="local">simp</fr:link>. <html:code>bestsimp</html:code> is the combination of <fr:link href="/forest/isa-002P/" title="blast, fast, slow, and best" uri="https://liamoc.net/forest/isa-002P/" display-uri="isa-002P" type="local">best</fr:link> and <fr:link href="/forest/isa-001H/" title="simp" uri="https://liamoc.net/forest/isa-001H/" display-uri="isa-001H" type="local">simp</fr:link>. The combination of  <fr:link href="/forest/isa-002P/" title="blast, fast, slow, and best" uri="https://liamoc.net/forest/isa-002P/" display-uri="isa-002P" type="local">fast</fr:link> and <fr:link href="/forest/isa-001H/" title="simp" uri="https://liamoc.net/forest/isa-001H/" display-uri="isa-001H" type="local">simp</fr:link> is, for inexplicable reasons, called <html:code>fastforce</html:code>.</html:p>
                  </fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>12</fr:month>
                      <fr:day>5</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-002S/</fr:uri>
                    <fr:display-uri>isa-002S</fr:display-uri>
                    <fr:route>/forest/isa-002S/</fr:route>
                    <fr:title text="force and auto"><html:code>force</html:code> and <html:code>auto</html:code></fr:title>
                    <fr:taxon>Proof Method</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>
                    <html:p><html:code>force</html:code> is a very thorough proof search that can often solve goals other methods can't. It can be thought of as a very thorough version of <fr:link href="/forest/isa-002P/" title="blast, fast, slow, and best" uri="https://liamoc.net/forest/isa-002P/" display-uri="isa-002P" type="local"><html:code>blast</html:code></fr:link> combined with <fr:link href="/forest/isa-001H/" title="simp" uri="https://liamoc.net/forest/isa-001H/" display-uri="isa-001H" type="local"><html:code>simp</html:code></fr:link>. The method <html:code>auto</html:code>, by contrast, is a more lightweight search that attempts to simulateneously solve <html:em>all</html:em> goals, rather than just the first one. Unlike the other automated methods, <html:code>auto</html:code> will leave behind goals that it is unable to prove.</html:p>
                    <html:p>Because the behaviour of <html:code>auto</html:code> differs greatly between Isabelle versions and is very sensitive to what theories are loaded, it's considered bad style to use <html:code>auto</html:code> as anything but the <html:em>final</html:em> step in a proof, but it can nonetheless be useful to see what goals <html:code>auto</html:code> outputs to see where it's getting stuck.</html:p>
                  </fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/forest/liamoc/" title="Liam O'Connor" uri="https://liamoc.net/forest/liamoc/" display-uri="liamoc" type="local">Liam O'Connor</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>12</fr:month>
                      <fr:day>5</fr:day>
                    </fr:date>
                    <fr:uri>https://liamoc.net/forest/isa-002T/</fr:uri>
                    <fr:display-uri>isa-002T</fr:display-uri>
                    <fr:route>/forest/isa-002T/</fr:route>
                    <fr:title text="try and the famous Isabelle sledgehammer."><html:code>try</html:code> and the famous Isabelle sledgehammer.</fr:title>
                  </fr:frontmatter>
                  <fr:mainmatter>
                    <html:p>Isabelle includes a feature called the <html:em>sledgehammer</html:em> that invokes external proof search procedures (such as SMT solvers) and provides them with lemmas that appear to be relevant. If the tools find a proof, it can often replay them in Isabelle's proof kernel, giving an Isabelle proof that matches what the external proof tool found. </html:p>
                    <html:p>To invoke this procedure on a goal, searching automatically for related lemmas, type the word <html:code>try</html:code> in an open subgoal.</html:p>
                  </fr:mainmatter>
                </fr:tree>
              </fr:mainmatter>
            </fr:tree>
          </fr:mainmatter>
        </fr:tree>
      </fr:mainmatter>
    </fr:tree>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="Contributions">Contributions</fr:title>
      </fr:frontmatter>
      <fr:mainmatter />
    </fr:tree>
  </fr:backmatter>
</fr:tree>
