875 lines
231 KiB
HTML
875 lines
231 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en"><head>
|
||
<meta charset="utf-8">
|
||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
<title>Adequacy: Adequacy of denotational semantics with respect to operational semantics 🚧 | Programming Language Foundations in Agda
|
||
</title><!-- Begin Jekyll SEO tag v2.6.1 -->
|
||
<meta name="generator" content="Jekyll v3.9.0" />
|
||
<meta property="og:title" content="Adequacy: Adequacy of denotational semantics with respect to operational semantics 🚧" />
|
||
<meta property="og:locale" content="en_US" />
|
||
<meta name="description" content="Programming Language Foundations in Agda" />
|
||
<meta property="og:description" content="Programming Language Foundations in Agda" />
|
||
<link rel="canonical" href="https://plfa.github.io/20.07/Adequacy/" />
|
||
<meta property="og:url" content="https://plfa.github.io/20.07/Adequacy/" />
|
||
<meta property="og:site_name" content="Programming Language Foundations in Agda" />
|
||
<script type="application/ld+json">
|
||
{"url":"https://plfa.github.io/20.07/Adequacy/","headline":"Adequacy: Adequacy of denotational semantics with respect to operational semantics 🚧","description":"Programming Language Foundations in Agda","@type":"WebPage","@context":"https://schema.org"}</script>
|
||
<!-- End Jekyll SEO tag -->
|
||
<link rel="stylesheet" href="/20.07/assets/main.css"></head>
|
||
<body><header class="site-header" role="banner">
|
||
|
||
<div class="wrapper">
|
||
|
||
<a class="site-title" href="/20.07/">Programming Language Foundations in Agda
|
||
</a>
|
||
|
||
<nav class="site-nav">
|
||
<span class="menu-icon">
|
||
<svg viewBox="0 0 18 15" width="18px" height="15px">
|
||
<path fill="#424242" d="M18,1.484c0,0.82-0.665,1.484-1.484,1.484H1.484C0.665,2.969,0,2.304,0,1.484l0,0C0,0.665,0.665,0,1.484,0 h15.031C17.335,0,18,0.665,18,1.484L18,1.484z"/>
|
||
<path fill="#424242" d="M18,7.516C18,8.335,17.335,9,16.516,9H1.484C0.665,9,0,8.335,0,7.516l0,0c0-0.82,0.665-1.484,1.484-1.484 h15.031C17.335,6.031,18,6.696,18,7.516L18,7.516z"/>
|
||
<path fill="#424242" d="M18,13.516C18,14.335,17.335,15,16.516,15H1.484C0.665,15,0,14.335,0,13.516l0,0 c0-0.82,0.665-1.484,1.484-1.484h15.031C17.335,12.031,18,12.696,18,13.516L18,13.516z"/>
|
||
</svg>
|
||
</span>
|
||
|
||
<div class="trigger">
|
||
<a class="page-link" href="/20.07/">The Book</a>
|
||
<a class="page-link" href="/20.07/Announcements/">Announcements</a>
|
||
<a class="page-link" href="/20.07/GettingStarted/">Getting Started</a>
|
||
<a class="page-link" href="/20.07/Citing/">Citing</a>
|
||
<a class="page-link" href="https://agda-zh.github.io/PLFA-zh/">中文</a>
|
||
</div>
|
||
</nav>
|
||
|
||
</div>
|
||
|
||
</header>
|
||
<main class="page-content" aria-label="Content">
|
||
<div class="wrapper">
|
||
<article class="post">
|
||
|
||
<header class="post-header">
|
||
<h1 class="post-title">Adequacy: Adequacy of denotational semantics with respect to operational semantics 🚧</h1>
|
||
</header>
|
||
|
||
<p style="text-align:center;">
|
||
|
||
<a alt="Previous chapter" href="/20.07/Soundness/">Prev</a>
|
||
|
||
|
||
•
|
||
|
||
|
||
<a alt="Source code" href="https://github.com/plfa/plfa.github.io/blob/dev-20.07/src/plfa/part3/Adequacy.lagda.md">Source</a>
|
||
|
||
|
||
•
|
||
|
||
|
||
<a alt="Next chapter" href="/20.07/ContextualEquivalence/">Next</a>
|
||
|
||
</p>
|
||
|
||
|
||
<div class="post-content">
|
||
<pre class="Agda"><a id="213" class="Keyword">module</a> <a id="220" href="/20.07/Adequacy/" class="Module">plfa.part3.Adequacy</a> <a id="240" class="Keyword">where</a>
|
||
</pre>
|
||
<h2 id="introduction">Introduction</h2>
|
||
|
||
<p>Having proved a preservation property in the last chapter, a natural
|
||
next step would be to prove progress. That is, to prove a property
|
||
of the form</p>
|
||
|
||
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>If γ ⊢ M ↓ v, then either M is a lambda abstraction or M —→ N for some N.
|
||
</code></pre></div></div>
|
||
|
||
<p>Such a property would tell us that having a denotation implies either
|
||
reduction to normal form or divergence. This is indeed true, but we
|
||
can prove a much stronger property! In fact, having a denotation that
|
||
is a function value (not <code class="language-plaintext highlighter-rouge">⊥</code>) implies reduction to a lambda
|
||
abstraction.</p>
|
||
|
||
<p>This stronger property, reformulated a bit, is known as <em>adequacy</em>.
|
||
That is, if a term <code class="language-plaintext highlighter-rouge">M</code> is denotationally equal to a lambda abstraction,
|
||
then <code class="language-plaintext highlighter-rouge">M</code> reduces to a lambda abstraction.</p>
|
||
|
||
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ℰ M ≃ ℰ (ƛ N) implies M —↠ ƛ N' for some N'
|
||
</code></pre></div></div>
|
||
|
||
<p>Recall that <code class="language-plaintext highlighter-rouge">ℰ M ≃ ℰ (ƛ N)</code> is equivalent to saying that <code class="language-plaintext highlighter-rouge">γ ⊢ M ↓ (v ↦
|
||
w)</code> for some <code class="language-plaintext highlighter-rouge">v</code> and <code class="language-plaintext highlighter-rouge">w</code>. We will show that <code class="language-plaintext highlighter-rouge">γ ⊢ M ↓ (v ↦ w)</code> implies
|
||
multi-step reduction a lambda abstraction. The recursive structure of
|
||
the derivations for <code class="language-plaintext highlighter-rouge">γ ⊢ M ↓ (v ↦ w)</code> are completely different from
|
||
the structure of multi-step reductions, so a direct proof would be
|
||
challenging. However, The structure of <code class="language-plaintext highlighter-rouge">γ ⊢ M ↓ (v ↦ w)</code> closer to
|
||
that of <a href="/20.07/BigStep/">BigStep</a> call-by-name
|
||
evaluation. Further, we already proved that big-step evaluation
|
||
implies multi-step reduction to a lambda (<code class="language-plaintext highlighter-rouge">cbn→reduce</code>). So we shall
|
||
prove that <code class="language-plaintext highlighter-rouge">γ ⊢ M ↓ (v ↦ w)</code> implies that <code class="language-plaintext highlighter-rouge">γ' ⊢ M ⇓ c</code>, where <code class="language-plaintext highlighter-rouge">c</code> is a
|
||
closure (a term paired with an environment), <code class="language-plaintext highlighter-rouge">γ'</code> is an environment
|
||
that maps variables to closures, and <code class="language-plaintext highlighter-rouge">γ</code> and <code class="language-plaintext highlighter-rouge">γ'</code> are appropriate
|
||
related. The proof will be an induction on the derivation of
|
||
<code class="language-plaintext highlighter-rouge">γ ⊢ M ↓ v</code>, and to strengthen the induction hypothesis, we will relate
|
||
semantic values to closures using a <em>logical relation</em> <code class="language-plaintext highlighter-rouge">𝕍</code>.</p>
|
||
|
||
<p>The rest of this chapter is organized as follows.</p>
|
||
|
||
<ul>
|
||
<li>
|
||
<p>To make the <code class="language-plaintext highlighter-rouge">𝕍</code> relation down-closed with respect to <code class="language-plaintext highlighter-rouge">⊑</code>,
|
||
we must loosen the requirement that <code class="language-plaintext highlighter-rouge">M</code> result in a function value and
|
||
instead require that <code class="language-plaintext highlighter-rouge">M</code> result in a value that is greater than or
|
||
equal to a function value. We establish several properties about
|
||
being ``greater than a function’’.</p>
|
||
</li>
|
||
<li>
|
||
<p>We define the logical relation <code class="language-plaintext highlighter-rouge">𝕍</code> that relates values and closures,
|
||
and extend it to a relation on terms <code class="language-plaintext highlighter-rouge">𝔼</code> and environments <code class="language-plaintext highlighter-rouge">𝔾</code>.
|
||
We prove several lemmas that culminate in the property that
|
||
if <code class="language-plaintext highlighter-rouge">𝕍 v c</code> and <code class="language-plaintext highlighter-rouge">v′ ⊑ v</code>, then <code class="language-plaintext highlighter-rouge">𝕍 v′ c</code>.</p>
|
||
</li>
|
||
<li>
|
||
<p>We prove the main lemma,
|
||
that if <code class="language-plaintext highlighter-rouge">𝔾 γ γ'</code> and <code class="language-plaintext highlighter-rouge">γ ⊢ M ↓ v</code>, then <code class="language-plaintext highlighter-rouge">𝔼 v (clos M γ')</code>.</p>
|
||
</li>
|
||
<li>
|
||
<p>We prove adequacy as a corollary to the main lemma.</p>
|
||
</li>
|
||
</ul>
|
||
|
||
<h2 id="imports">Imports</h2>
|
||
|
||
<pre class="Agda"><a id="2777" class="Keyword">import</a> <a id="2784" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Binary.PropositionalEquality.html" class="Module">Relation.Binary.PropositionalEquality</a> <a id="2822" class="Symbol">as</a> <a id="2825" class="Module">Eq</a>
|
||
<a id="2828" class="Keyword">open</a> <a id="2833" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Binary.PropositionalEquality.html" class="Module">Eq</a> <a id="2836" class="Keyword">using</a> <a id="2842" class="Symbol">(</a><a id="2843" href="Agda.Builtin.Equality.html#125" class="Datatype Operator">_≡_</a><a id="2846" class="Symbol">;</a> <a id="2848" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Binary.PropositionalEquality.Core.html#799" class="Function Operator">_≢_</a><a id="2851" class="Symbol">;</a> <a id="2853" href="Agda.Builtin.Equality.html#182" class="InductiveConstructor">refl</a><a id="2857" class="Symbol">;</a> <a id="2859" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Binary.PropositionalEquality.Core.html#984" class="Function">trans</a><a id="2864" class="Symbol">;</a> <a id="2866" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Binary.PropositionalEquality.Core.html#939" class="Function">sym</a><a id="2869" class="Symbol">;</a> <a id="2871" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Binary.PropositionalEquality.Core.html#1090" class="Function">cong</a><a id="2875" class="Symbol">;</a> <a id="2877" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Binary.PropositionalEquality.html#1436" class="Function">cong₂</a><a id="2882" class="Symbol">;</a> <a id="2884" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Binary.PropositionalEquality.html#1308" class="Function">cong-app</a><a id="2892" class="Symbol">)</a>
|
||
<a id="2894" class="Keyword">open</a> <a id="2899" class="Keyword">import</a> <a id="2906" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html" class="Module">Data.Product</a> <a id="2919" class="Keyword">using</a> <a id="2925" class="Symbol">(</a><a id="2926" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#1162" class="Function Operator">_×_</a><a id="2929" class="Symbol">;</a> <a id="2931" href="Agda.Builtin.Sigma.html#139" class="Record">Σ</a><a id="2932" class="Symbol">;</a> <a id="2934" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">Σ-syntax</a><a id="2942" class="Symbol">;</a> <a id="2944" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#1364" class="Function">∃</a><a id="2945" class="Symbol">;</a> <a id="2947" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#1783" class="Function">∃-syntax</a><a id="2955" class="Symbol">;</a> <a id="2957" href="Agda.Builtin.Sigma.html#225" class="Field">proj₁</a><a id="2962" class="Symbol">;</a> <a id="2964" href="Agda.Builtin.Sigma.html#237" class="Field">proj₂</a><a id="2969" class="Symbol">)</a>
|
||
<a id="2973" class="Keyword">renaming</a> <a id="2982" class="Symbol">(</a><a id="2983" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">_,_</a> <a id="2987" class="Symbol">to</a> <a id="2990" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨_,_⟩</a><a id="2995" class="Symbol">)</a>
|
||
<a id="2997" class="Keyword">open</a> <a id="3002" class="Keyword">import</a> <a id="3009" href="https://agda.github.io/agda-stdlib/v1.1/Data.Sum.html" class="Module">Data.Sum</a>
|
||
<a id="3018" class="Keyword">open</a> <a id="3023" class="Keyword">import</a> <a id="3030" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html" class="Module">Relation.Nullary</a> <a id="3047" class="Keyword">using</a> <a id="3053" class="Symbol">(</a><a id="3054" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#535" class="Function Operator">¬_</a><a id="3056" class="Symbol">)</a>
|
||
<a id="3058" class="Keyword">open</a> <a id="3063" class="Keyword">import</a> <a id="3070" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.Negation.html" class="Module">Relation.Nullary.Negation</a> <a id="3096" class="Keyword">using</a> <a id="3102" class="Symbol">(</a><a id="3103" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.Negation.html#809" class="Function">contradiction</a><a id="3116" class="Symbol">)</a>
|
||
<a id="3118" class="Keyword">open</a> <a id="3123" class="Keyword">import</a> <a id="3130" href="https://agda.github.io/agda-stdlib/v1.1/Data.Empty.html" class="Module">Data.Empty</a> <a id="3141" class="Keyword">using</a> <a id="3147" class="Symbol">(</a><a id="3148" href="https://agda.github.io/agda-stdlib/v1.1/Data.Empty.html#294" class="Function">⊥-elim</a><a id="3154" class="Symbol">)</a> <a id="3156" class="Keyword">renaming</a> <a id="3165" class="Symbol">(</a><a id="3166" href="https://agda.github.io/agda-stdlib/v1.1/Data.Empty.html#279" class="Datatype">⊥</a> <a id="3168" class="Symbol">to</a> <a id="3171" href="https://agda.github.io/agda-stdlib/v1.1/Data.Empty.html#279" class="Datatype">Bot</a><a id="3174" class="Symbol">)</a>
|
||
<a id="3176" class="Keyword">open</a> <a id="3181" class="Keyword">import</a> <a id="3188" href="https://agda.github.io/agda-stdlib/v1.1/Data.Unit.html" class="Module">Data.Unit</a>
|
||
<a id="3198" class="Keyword">open</a> <a id="3203" class="Keyword">import</a> <a id="3210" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html" class="Module">Relation.Nullary</a> <a id="3227" class="Keyword">using</a> <a id="3233" class="Symbol">(</a><a id="3234" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#605" class="Datatype">Dec</a><a id="3237" class="Symbol">;</a> <a id="3239" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a><a id="3242" class="Symbol">;</a> <a id="3244" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a><a id="3246" class="Symbol">)</a>
|
||
<a id="3248" class="Keyword">open</a> <a id="3253" class="Keyword">import</a> <a id="3260" href="https://agda.github.io/agda-stdlib/v1.1/Function.html" class="Module">Function</a> <a id="3269" class="Keyword">using</a> <a id="3275" class="Symbol">(</a><a id="3276" href="https://agda.github.io/agda-stdlib/v1.1/Function.html#1099" class="Function Operator">_∘_</a><a id="3279" class="Symbol">)</a>
|
||
<a id="3281" class="Keyword">open</a> <a id="3286" class="Keyword">import</a> <a id="3293" href="/20.07/Untyped/" class="Module">plfa.part2.Untyped</a>
|
||
<a id="3317" class="Keyword">using</a> <a id="3323" class="Symbol">(</a><a id="3324" href="/20.07/Untyped/#3153" class="Datatype">Context</a><a id="3331" class="Symbol">;</a> <a id="3333" href="/20.07/Untyped/#4294" class="Datatype Operator">_⊢_</a><a id="3336" class="Symbol">;</a> <a id="3338" href="/20.07/Untyped/#2888" class="InductiveConstructor">★</a><a id="3339" class="Symbol">;</a> <a id="3341" href="/20.07/Untyped/#3521" class="Datatype Operator">_∋_</a><a id="3344" class="Symbol">;</a> <a id="3346" href="/20.07/Untyped/#3175" class="InductiveConstructor">∅</a><a id="3347" class="Symbol">;</a> <a id="3349" href="/20.07/Untyped/#3191" class="InductiveConstructor Operator">_,_</a><a id="3352" class="Symbol">;</a> <a id="3354" href="/20.07/Untyped/#3557" class="InductiveConstructor">Z</a><a id="3355" class="Symbol">;</a> <a id="3357" href="/20.07/Untyped/#3602" class="InductiveConstructor Operator">S_</a><a id="3359" class="Symbol">;</a> <a id="3361" href="/20.07/Untyped/#4330" class="InductiveConstructor Operator">`_</a><a id="3363" class="Symbol">;</a> <a id="3365" href="/20.07/Untyped/#4382" class="InductiveConstructor Operator">ƛ_</a><a id="3367" class="Symbol">;</a> <a id="3369" href="/20.07/Untyped/#4442" class="InductiveConstructor Operator">_·_</a><a id="3372" class="Symbol">;</a>
|
||
<a id="3386" href="/20.07/Untyped/#6235" class="Function">rename</a><a id="3392" class="Symbol">;</a> <a id="3394" href="/20.07/Untyped/#6963" class="Function">subst</a><a id="3399" class="Symbol">;</a> <a id="3401" href="/20.07/Untyped/#5925" class="Function">ext</a><a id="3404" class="Symbol">;</a> <a id="3406" href="/20.07/Untyped/#6671" class="Function">exts</a><a id="3410" class="Symbol">;</a> <a id="3412" href="/20.07/Untyped/#7491" class="Function Operator">_[_]</a><a id="3416" class="Symbol">;</a> <a id="3418" href="/20.07/Untyped/#7375" class="Function">subst-zero</a><a id="3428" class="Symbol">;</a>
|
||
<a id="3442" href="/20.07/Untyped/#11068" class="Datatype Operator">_—↠_</a><a id="3446" class="Symbol">;</a> <a id="3448" href="/20.07/Untyped/#11174" class="InductiveConstructor Operator">_—→⟨_⟩_</a><a id="3455" class="Symbol">;</a> <a id="3457" href="/20.07/Untyped/#11118" class="InductiveConstructor Operator">_∎</a><a id="3459" class="Symbol">;</a> <a id="3461" href="/20.07/Untyped/#9948" class="Datatype Operator">_—→_</a><a id="3465" class="Symbol">;</a> <a id="3467" href="/20.07/Untyped/#9998" class="InductiveConstructor">ξ₁</a><a id="3469" class="Symbol">;</a> <a id="3471" href="/20.07/Untyped/#10088" class="InductiveConstructor">ξ₂</a><a id="3473" class="Symbol">;</a> <a id="3475" href="/20.07/Untyped/#10178" class="InductiveConstructor">β</a><a id="3476" class="Symbol">;</a> <a id="3478" href="/20.07/Untyped/#10286" class="InductiveConstructor">ζ</a><a id="3479" class="Symbol">)</a>
|
||
<a id="3481" class="Keyword">open</a> <a id="3486" class="Keyword">import</a> <a id="3493" href="/20.07/Substitution/" class="Module">plfa.part2.Substitution</a> <a id="3517" class="Keyword">using</a> <a id="3523" class="Symbol">(</a><a id="3524" href="/20.07/Substitution/#3046" class="Function">ids</a><a id="3527" class="Symbol">;</a> <a id="3529" href="/20.07/Substitution/#16936" class="Function">sub-id</a><a id="3535" class="Symbol">)</a>
|
||
<a id="3537" class="Keyword">open</a> <a id="3542" class="Keyword">import</a> <a id="3549" href="/20.07/BigStep/" class="Module">plfa.part2.BigStep</a>
|
||
<a id="3573" class="Keyword">using</a> <a id="3579" class="Symbol">(</a><a id="3580" href="/20.07/BigStep/#2467" class="Datatype">Clos</a><a id="3584" class="Symbol">;</a> <a id="3586" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a><a id="3590" class="Symbol">;</a> <a id="3592" href="/20.07/BigStep/#2437" class="Function">ClosEnv</a><a id="3599" class="Symbol">;</a> <a id="3601" href="/20.07/BigStep/#2650" class="Function">∅'</a><a id="3603" class="Symbol">;</a> <a id="3605" href="/20.07/BigStep/#2672" class="Function Operator">_,'_</a><a id="3609" class="Symbol">;</a> <a id="3611" href="/20.07/BigStep/#3021" class="Datatype Operator">_⊢_⇓_</a><a id="3616" class="Symbol">;</a> <a id="3618" href="/20.07/BigStep/#3078" class="InductiveConstructor">⇓-var</a><a id="3623" class="Symbol">;</a> <a id="3625" href="/20.07/BigStep/#3225" class="InductiveConstructor">⇓-lam</a><a id="3630" class="Symbol">;</a> <a id="3632" href="/20.07/BigStep/#3300" class="InductiveConstructor">⇓-app</a><a id="3637" class="Symbol">;</a> <a id="3639" href="/20.07/BigStep/#4586" class="Function">⇓-determ</a><a id="3647" class="Symbol">;</a>
|
||
<a id="3661" href="/20.07/BigStep/#12205" class="Function">cbn→reduce</a><a id="3671" class="Symbol">)</a>
|
||
<a id="3673" class="Keyword">open</a> <a id="3678" class="Keyword">import</a> <a id="3685" href="/20.07/Denotational/" class="Module">plfa.part3.Denotational</a>
|
||
<a id="3714" class="Keyword">using</a> <a id="3720" class="Symbol">(</a><a id="3721" href="/20.07/Denotational/#4151" class="Datatype">Value</a><a id="3726" class="Symbol">;</a> <a id="3728" href="/20.07/Denotational/#7288" class="Function">Env</a><a id="3731" class="Symbol">;</a> <a id="3733" href="/20.07/Denotational/#7412" class="Function">`∅</a><a id="3735" class="Symbol">;</a> <a id="3737" href="/20.07/Denotational/#7445" class="Function Operator">_`,_</a><a id="3741" class="Symbol">;</a> <a id="3743" href="/20.07/Denotational/#4183" class="InductiveConstructor Operator">_↦_</a><a id="3746" class="Symbol">;</a> <a id="3748" href="/20.07/Denotational/#4508" class="Datatype Operator">_⊑_</a><a id="3751" class="Symbol">;</a> <a id="3753" href="/20.07/Denotational/#9346" class="Datatype Operator">_⊢_↓_</a><a id="3758" class="Symbol">;</a> <a id="3760" href="/20.07/Denotational/#4171" class="InductiveConstructor">⊥</a><a id="3761" class="Symbol">;</a> <a id="3763" href="/20.07/Denotational/#32285" class="Function">all-funs∈</a><a id="3772" class="Symbol">;</a> <a id="3774" href="/20.07/Denotational/#4213" class="InductiveConstructor Operator">_⊔_</a><a id="3777" class="Symbol">;</a> <a id="3779" href="/20.07/Denotational/#30578" class="Function">∈→⊑</a><a id="3782" class="Symbol">;</a>
|
||
<a id="3796" href="/20.07/Denotational/#9400" class="InductiveConstructor">var</a><a id="3799" class="Symbol">;</a> <a id="3801" href="/20.07/Denotational/#9475" class="InductiveConstructor">↦-elim</a><a id="3807" class="Symbol">;</a> <a id="3809" href="/20.07/Denotational/#9597" class="InductiveConstructor">↦-intro</a><a id="3816" class="Symbol">;</a> <a id="3818" href="/20.07/Denotational/#9776" class="InductiveConstructor">⊔-intro</a><a id="3825" class="Symbol">;</a> <a id="3827" href="/20.07/Denotational/#9709" class="InductiveConstructor">⊥-intro</a><a id="3834" class="Symbol">;</a> <a id="3836" href="/20.07/Denotational/#9891" class="InductiveConstructor">sub</a><a id="3839" class="Symbol">;</a> <a id="3841" href="/20.07/Denotational/#17486" class="Function">ℰ</a><a id="3842" class="Symbol">;</a> <a id="3844" href="/20.07/Denotational/#17668" class="Function Operator">_≃_</a><a id="3847" class="Symbol">;</a> <a id="3849" href="/20.07/Denotational/#17007" class="Function Operator">_iff_</a><a id="3854" class="Symbol">;</a>
|
||
<a id="3868" href="/20.07/Denotational/#4798" class="InductiveConstructor">⊑-trans</a><a id="3875" class="Symbol">;</a> <a id="3877" href="/20.07/Denotational/#4652" class="InductiveConstructor">⊑-conj-R1</a><a id="3886" class="Symbol">;</a> <a id="3888" href="/20.07/Denotational/#4725" class="InductiveConstructor">⊑-conj-R2</a><a id="3897" class="Symbol">;</a> <a id="3899" href="/20.07/Denotational/#4568" class="InductiveConstructor">⊑-conj-L</a><a id="3907" class="Symbol">;</a> <a id="3909" href="/20.07/Denotational/#5638" class="Function">⊑-refl</a><a id="3915" class="Symbol">;</a> <a id="3917" href="/20.07/Denotational/#4869" class="InductiveConstructor">⊑-fun</a><a id="3922" class="Symbol">;</a> <a id="3924" href="/20.07/Denotational/#4543" class="InductiveConstructor">⊑-bot</a><a id="3929" class="Symbol">;</a> <a id="3931" href="/20.07/Denotational/#4972" class="InductiveConstructor">⊑-dist</a><a id="3937" class="Symbol">;</a>
|
||
<a id="3951" href="/20.07/Denotational/#43092" class="Function">sub-inv-fun</a><a id="3962" class="Symbol">)</a>
|
||
<a id="3964" class="Keyword">open</a> <a id="3969" class="Keyword">import</a> <a id="3976" href="/20.07/Soundness/" class="Module">plfa.part3.Soundness</a> <a id="3997" class="Keyword">using</a> <a id="4003" class="Symbol">(</a><a id="4004" href="/20.07/Soundness/#23358" class="Function">soundness</a><a id="4013" class="Symbol">)</a>
|
||
|
||
</pre>
|
||
|
||
<h2 id="the-property-of-being-greater-or-equal-to-a-function">The property of being greater or equal to a function</h2>
|
||
|
||
<p>We define the following short-hand for saying that a value is
|
||
greather-than or equal to a function value.</p>
|
||
|
||
<pre class="Agda"><a id="above-fun"></a><a id="4190" href="/20.07/Adequacy/#4190" class="Function">above-fun</a> <a id="4200" class="Symbol">:</a> <a id="4202" href="/20.07/Denotational/#4151" class="Datatype">Value</a> <a id="4208" class="Symbol">→</a> <a id="4210" class="PrimitiveType">Set</a>
|
||
<a id="4214" href="/20.07/Adequacy/#4190" class="Function">above-fun</a> <a id="4224" href="/20.07/Adequacy/#4224" class="Bound">u</a> <a id="4226" class="Symbol">=</a> <a id="4228" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">Σ[</a> <a id="4231" href="/20.07/Adequacy/#4231" class="Bound">v</a> <a id="4233" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">∈</a> <a id="4235" href="/20.07/Denotational/#4151" class="Datatype">Value</a> <a id="4241" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">]</a> <a id="4243" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">Σ[</a> <a id="4246" href="/20.07/Adequacy/#4246" class="Bound">w</a> <a id="4248" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">∈</a> <a id="4250" href="/20.07/Denotational/#4151" class="Datatype">Value</a> <a id="4256" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">]</a> <a id="4258" href="/20.07/Adequacy/#4231" class="Bound">v</a> <a id="4260" href="/20.07/Denotational/#4183" class="InductiveConstructor Operator">↦</a> <a id="4262" href="/20.07/Adequacy/#4246" class="Bound">w</a> <a id="4264" href="/20.07/Denotational/#4508" class="Datatype Operator">⊑</a> <a id="4266" href="/20.07/Adequacy/#4224" class="Bound">u</a>
|
||
</pre>
|
||
<p>If a value <code class="language-plaintext highlighter-rouge">u</code> is greater than a function, then an even greater value <code class="language-plaintext highlighter-rouge">u'</code>
|
||
is too.</p>
|
||
|
||
<pre class="Agda"><a id="above-fun-⊑"></a><a id="4361" href="/20.07/Adequacy/#4361" class="Function">above-fun-⊑</a> <a id="4373" class="Symbol">:</a> <a id="4375" class="Symbol">∀{</a><a id="4377" href="/20.07/Adequacy/#4377" class="Bound">u</a> <a id="4379" href="/20.07/Adequacy/#4379" class="Bound">u'</a> <a id="4382" class="Symbol">:</a> <a id="4384" href="/20.07/Denotational/#4151" class="Datatype">Value</a><a id="4389" class="Symbol">}</a>
|
||
<a id="4397" class="Symbol">→</a> <a id="4399" href="/20.07/Adequacy/#4190" class="Function">above-fun</a> <a id="4409" href="/20.07/Adequacy/#4377" class="Bound">u</a> <a id="4411" class="Symbol">→</a> <a id="4413" href="/20.07/Adequacy/#4377" class="Bound">u</a> <a id="4415" href="/20.07/Denotational/#4508" class="Datatype Operator">⊑</a> <a id="4417" href="/20.07/Adequacy/#4379" class="Bound">u'</a>
|
||
<a id="4428" class="Comment">-------------------</a>
|
||
<a id="4454" class="Symbol">→</a> <a id="4456" href="/20.07/Adequacy/#4190" class="Function">above-fun</a> <a id="4466" href="/20.07/Adequacy/#4379" class="Bound">u'</a>
|
||
<a id="4469" href="/20.07/Adequacy/#4361" class="Function">above-fun-⊑</a> <a id="4481" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="4483" href="/20.07/Adequacy/#4483" class="Bound">v</a> <a id="4485" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="4487" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="4489" href="/20.07/Adequacy/#4489" class="Bound">w</a> <a id="4491" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="4493" href="/20.07/Adequacy/#4493" class="Bound">lt'</a> <a id="4497" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="4499" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="4501" href="/20.07/Adequacy/#4501" class="Bound">lt</a> <a id="4504" class="Symbol">=</a> <a id="4506" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="4508" href="/20.07/Adequacy/#4483" class="Bound">v</a> <a id="4510" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="4512" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="4514" href="/20.07/Adequacy/#4489" class="Bound">w</a> <a id="4516" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="4518" href="/20.07/Denotational/#4798" class="InductiveConstructor">⊑-trans</a> <a id="4526" href="/20.07/Adequacy/#4493" class="Bound">lt'</a> <a id="4530" href="/20.07/Adequacy/#4501" class="Bound">lt</a> <a id="4533" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="4535" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
</pre>
|
||
<p>The bottom value <code class="language-plaintext highlighter-rouge">⊥</code> is not greater than a function.</p>
|
||
|
||
<pre class="Agda"><a id="above-fun⊥"></a><a id="4600" href="/20.07/Adequacy/#4600" class="Function">above-fun⊥</a> <a id="4611" class="Symbol">:</a> <a id="4613" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#535" class="Function Operator">¬</a> <a id="4615" href="/20.07/Adequacy/#4190" class="Function">above-fun</a> <a id="4625" href="/20.07/Denotational/#4171" class="InductiveConstructor">⊥</a>
|
||
<a id="4627" href="/20.07/Adequacy/#4600" class="Function">above-fun⊥</a> <a id="4638" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="4640" href="/20.07/Adequacy/#4640" class="Bound">v</a> <a id="4642" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="4644" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="4646" href="/20.07/Adequacy/#4646" class="Bound">w</a> <a id="4648" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="4650" href="/20.07/Adequacy/#4650" class="Bound">lt</a> <a id="4653" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="4655" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="4661" class="Keyword">with</a> <a id="4666" href="/20.07/Denotational/#43092" class="Function">sub-inv-fun</a> <a id="4678" href="/20.07/Adequacy/#4650" class="Bound">lt</a>
|
||
<a id="4681" class="Symbol">...</a> <a id="4685" class="Symbol">|</a> <a id="4687" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="4689" href="/20.07/Adequacy/#4689" class="Bound">Γ</a> <a id="4691" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="4693" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="4695" href="/20.07/Adequacy/#4695" class="Bound">f</a> <a id="4697" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="4699" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="4701" href="/20.07/Adequacy/#4701" class="Bound">Γ⊆⊥</a> <a id="4705" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="4707" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="4709" href="/20.07/Adequacy/#4709" class="Bound">lt1</a> <a id="4713" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="4715" href="/20.07/Adequacy/#4715" class="Bound">lt2</a> <a id="4719" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="4721" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="4723" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="4725" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="4731" class="Keyword">with</a> <a id="4736" href="/20.07/Denotational/#32285" class="Function">all-funs∈</a> <a id="4746" href="/20.07/Adequacy/#4695" class="Bound">f</a>
|
||
<a id="4748" class="Symbol">...</a> <a id="4752" class="Symbol">|</a> <a id="4754" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="4756" href="/20.07/Adequacy/#4756" class="Bound">A</a> <a id="4758" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="4760" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="4762" href="/20.07/Adequacy/#4762" class="Bound">B</a> <a id="4764" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="4766" href="/20.07/Adequacy/#4766" class="Bound">m</a> <a id="4768" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="4770" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="4776" class="Keyword">with</a> <a id="4781" class="Bound">Γ⊆⊥</a> <a id="4785" href="/20.07/Adequacy/#4766" class="Bound">m</a>
|
||
<a id="4787" class="Symbol">...</a> <a id="4791" class="Symbol">|</a> <a id="4793" class="Symbol">()</a>
|
||
</pre>
|
||
<p>If the join of two values <code class="language-plaintext highlighter-rouge">u</code> and <code class="language-plaintext highlighter-rouge">u'</code> is greater than a function, then
|
||
at least one of them is too.</p>
|
||
|
||
<pre class="Agda"><a id="above-fun-⊔"></a><a id="4907" href="/20.07/Adequacy/#4907" class="Function">above-fun-⊔</a> <a id="4919" class="Symbol">:</a> <a id="4921" class="Symbol">∀{</a><a id="4923" href="/20.07/Adequacy/#4923" class="Bound">u</a> <a id="4925" href="/20.07/Adequacy/#4925" class="Bound">u'</a><a id="4927" class="Symbol">}</a>
|
||
<a id="4940" class="Symbol">→</a> <a id="4942" href="/20.07/Adequacy/#4190" class="Function">above-fun</a> <a id="4952" class="Symbol">(</a><a id="4953" href="/20.07/Adequacy/#4923" class="Bound">u</a> <a id="4955" href="/20.07/Denotational/#4213" class="InductiveConstructor Operator">⊔</a> <a id="4957" href="/20.07/Adequacy/#4925" class="Bound">u'</a><a id="4959" class="Symbol">)</a>
|
||
<a id="4972" class="Symbol">→</a> <a id="4974" href="/20.07/Adequacy/#4190" class="Function">above-fun</a> <a id="4984" href="/20.07/Adequacy/#4923" class="Bound">u</a> <a id="4986" href="https://agda.github.io/agda-stdlib/v1.1/Data.Sum.Base.html#612" class="Datatype Operator">⊎</a> <a id="4988" href="/20.07/Adequacy/#4190" class="Function">above-fun</a> <a id="4998" href="/20.07/Adequacy/#4925" class="Bound">u'</a>
|
||
<a id="5001" href="/20.07/Adequacy/#4907" class="Function">above-fun-⊔</a><a id="5012" class="Symbol">{</a><a id="5013" href="/20.07/Adequacy/#5013" class="Bound">u</a><a id="5014" class="Symbol">}{</a><a id="5016" href="/20.07/Adequacy/#5016" class="Bound">u'</a><a id="5018" class="Symbol">}</a> <a id="5020" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="5022" href="/20.07/Adequacy/#5022" class="Bound">v</a> <a id="5024" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="5026" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="5028" href="/20.07/Adequacy/#5028" class="Bound">w</a> <a id="5030" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="5032" href="/20.07/Adequacy/#5032" class="Bound">v↦w⊑u⊔u'</a> <a id="5041" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="5043" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="5049" class="Keyword">with</a> <a id="5054" href="/20.07/Denotational/#43092" class="Function">sub-inv-fun</a> <a id="5066" href="/20.07/Adequacy/#5032" class="Bound">v↦w⊑u⊔u'</a>
|
||
<a id="5075" class="Symbol">...</a> <a id="5079" class="Symbol">|</a> <a id="5081" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="5083" href="/20.07/Adequacy/#5083" class="Bound">Γ</a> <a id="5085" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="5087" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="5089" href="/20.07/Adequacy/#5089" class="Bound">f</a> <a id="5091" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="5093" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="5095" href="/20.07/Adequacy/#5095" class="Bound">Γ⊆u⊔u'</a> <a id="5102" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="5104" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="5106" href="/20.07/Adequacy/#5106" class="Bound">lt1</a> <a id="5110" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="5112" href="/20.07/Adequacy/#5112" class="Bound">lt2</a> <a id="5116" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="5118" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="5120" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="5122" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="5128" class="Keyword">with</a> <a id="5133" href="/20.07/Denotational/#32285" class="Function">all-funs∈</a> <a id="5143" href="/20.07/Adequacy/#5089" class="Bound">f</a>
|
||
<a id="5145" class="Symbol">...</a> <a id="5149" class="Symbol">|</a> <a id="5151" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="5153" href="/20.07/Adequacy/#5153" class="Bound">A</a> <a id="5155" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="5157" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="5159" href="/20.07/Adequacy/#5159" class="Bound">B</a> <a id="5161" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="5163" href="/20.07/Adequacy/#5163" class="Bound">m</a> <a id="5165" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="5167" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="5173" class="Keyword">with</a> <a id="5178" class="Bound">Γ⊆u⊔u'</a> <a id="5185" href="/20.07/Adequacy/#5163" class="Bound">m</a>
|
||
<a id="5187" class="Symbol">...</a> <a id="5191" class="Symbol">|</a> <a id="5193" href="https://agda.github.io/agda-stdlib/v1.1/Data.Sum.Base.html#662" class="InductiveConstructor">inj₁</a> <a id="5198" href="/20.07/Adequacy/#5198" class="Bound">x</a> <a id="5200" class="Symbol">=</a> <a id="5202" href="https://agda.github.io/agda-stdlib/v1.1/Data.Sum.Base.html#662" class="InductiveConstructor">inj₁</a> <a id="5207" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="5209" class="Bound">A</a> <a id="5211" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="5213" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="5215" class="Bound">B</a> <a id="5217" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="5219" class="Symbol">(</a><a id="5220" href="/20.07/Denotational/#30578" class="Function">∈→⊑</a> <a id="5224" href="/20.07/Adequacy/#5198" class="Bound">x</a><a id="5225" class="Symbol">)</a> <a id="5227" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="5229" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="5231" class="Symbol">...</a> <a id="5235" class="Symbol">|</a> <a id="5237" href="https://agda.github.io/agda-stdlib/v1.1/Data.Sum.Base.html#687" class="InductiveConstructor">inj₂</a> <a id="5242" href="/20.07/Adequacy/#5242" class="Bound">x</a> <a id="5244" class="Symbol">=</a> <a id="5246" href="https://agda.github.io/agda-stdlib/v1.1/Data.Sum.Base.html#687" class="InductiveConstructor">inj₂</a> <a id="5251" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="5253" class="Bound">A</a> <a id="5255" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="5257" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="5259" class="Bound">B</a> <a id="5261" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="5263" class="Symbol">(</a><a id="5264" href="/20.07/Denotational/#30578" class="Function">∈→⊑</a> <a id="5268" href="/20.07/Adequacy/#5242" class="Bound">x</a><a id="5269" class="Symbol">)</a> <a id="5271" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="5273" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
</pre>
|
||
<p>On the other hand, if neither of <code class="language-plaintext highlighter-rouge">u</code> and <code class="language-plaintext highlighter-rouge">u'</code> is greater than a function,
|
||
then their join is also not greater than a function.</p>
|
||
|
||
<pre class="Agda"><a id="not-above-fun-⊔"></a><a id="5412" href="/20.07/Adequacy/#5412" class="Function">not-above-fun-⊔</a> <a id="5428" class="Symbol">:</a> <a id="5430" class="Symbol">∀{</a><a id="5432" href="/20.07/Adequacy/#5432" class="Bound">u</a> <a id="5434" href="/20.07/Adequacy/#5434" class="Bound">u'</a> <a id="5437" class="Symbol">:</a> <a id="5439" href="/20.07/Denotational/#4151" class="Datatype">Value</a><a id="5444" class="Symbol">}</a>
|
||
<a id="5461" class="Symbol">→</a> <a id="5463" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#535" class="Function Operator">¬</a> <a id="5465" href="/20.07/Adequacy/#4190" class="Function">above-fun</a> <a id="5475" href="/20.07/Adequacy/#5432" class="Bound">u</a> <a id="5477" class="Symbol">→</a> <a id="5479" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#535" class="Function Operator">¬</a> <a id="5481" href="/20.07/Adequacy/#4190" class="Function">above-fun</a> <a id="5491" href="/20.07/Adequacy/#5434" class="Bound">u'</a>
|
||
<a id="5509" class="Symbol">→</a> <a id="5511" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#535" class="Function Operator">¬</a> <a id="5513" href="/20.07/Adequacy/#4190" class="Function">above-fun</a> <a id="5523" class="Symbol">(</a><a id="5524" href="/20.07/Adequacy/#5432" class="Bound">u</a> <a id="5526" href="/20.07/Denotational/#4213" class="InductiveConstructor Operator">⊔</a> <a id="5528" href="/20.07/Adequacy/#5434" class="Bound">u'</a><a id="5530" class="Symbol">)</a>
|
||
<a id="5532" href="/20.07/Adequacy/#5412" class="Function">not-above-fun-⊔</a> <a id="5548" href="/20.07/Adequacy/#5548" class="Bound">naf1</a> <a id="5553" href="/20.07/Adequacy/#5553" class="Bound">naf2</a> <a id="5558" href="/20.07/Adequacy/#5558" class="Bound">af12</a>
|
||
<a id="5567" class="Keyword">with</a> <a id="5572" href="/20.07/Adequacy/#4907" class="Function">above-fun-⊔</a> <a id="5584" href="/20.07/Adequacy/#5558" class="Bound">af12</a>
|
||
<a id="5589" class="Symbol">...</a> <a id="5593" class="Symbol">|</a> <a id="5595" href="https://agda.github.io/agda-stdlib/v1.1/Data.Sum.Base.html#662" class="InductiveConstructor">inj₁</a> <a id="5600" href="/20.07/Adequacy/#5600" class="Bound">af1</a> <a id="5604" class="Symbol">=</a> <a id="5606" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.Negation.html#809" class="Function">contradiction</a> <a id="5620" href="/20.07/Adequacy/#5600" class="Bound">af1</a> <a id="5624" class="Bound">naf1</a>
|
||
<a id="5629" class="Symbol">...</a> <a id="5633" class="Symbol">|</a> <a id="5635" href="https://agda.github.io/agda-stdlib/v1.1/Data.Sum.Base.html#687" class="InductiveConstructor">inj₂</a> <a id="5640" href="/20.07/Adequacy/#5640" class="Bound">af2</a> <a id="5644" class="Symbol">=</a> <a id="5646" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.Negation.html#809" class="Function">contradiction</a> <a id="5660" href="/20.07/Adequacy/#5640" class="Bound">af2</a> <a id="5664" class="Bound">naf2</a>
|
||
</pre>
|
||
<p>The converse is also true. If the join of two values is not above a
|
||
function, then neither of them is individually.</p>
|
||
|
||
<pre class="Agda"><a id="not-above-fun-⊔-inv"></a><a id="5795" href="/20.07/Adequacy/#5795" class="Function">not-above-fun-⊔-inv</a> <a id="5815" class="Symbol">:</a> <a id="5817" class="Symbol">∀{</a><a id="5819" href="/20.07/Adequacy/#5819" class="Bound">u</a> <a id="5821" href="/20.07/Adequacy/#5821" class="Bound">u'</a> <a id="5824" class="Symbol">:</a> <a id="5826" href="/20.07/Denotational/#4151" class="Datatype">Value</a><a id="5831" class="Symbol">}</a> <a id="5833" class="Symbol">→</a> <a id="5835" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#535" class="Function Operator">¬</a> <a id="5837" href="/20.07/Adequacy/#4190" class="Function">above-fun</a> <a id="5847" class="Symbol">(</a><a id="5848" href="/20.07/Adequacy/#5819" class="Bound">u</a> <a id="5850" href="/20.07/Denotational/#4213" class="InductiveConstructor Operator">⊔</a> <a id="5852" href="/20.07/Adequacy/#5821" class="Bound">u'</a><a id="5854" class="Symbol">)</a>
|
||
<a id="5870" class="Symbol">→</a> <a id="5872" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#535" class="Function Operator">¬</a> <a id="5874" href="/20.07/Adequacy/#4190" class="Function">above-fun</a> <a id="5884" href="/20.07/Adequacy/#5819" class="Bound">u</a> <a id="5886" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#1162" class="Function Operator">×</a> <a id="5888" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#535" class="Function Operator">¬</a> <a id="5890" href="/20.07/Adequacy/#4190" class="Function">above-fun</a> <a id="5900" href="/20.07/Adequacy/#5821" class="Bound">u'</a>
|
||
<a id="5903" href="/20.07/Adequacy/#5795" class="Function">not-above-fun-⊔-inv</a> <a id="5923" href="/20.07/Adequacy/#5923" class="Bound">af</a> <a id="5926" class="Symbol">=</a> <a id="5928" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="5930" href="/20.07/Adequacy/#5956" class="Function">f</a> <a id="5932" href="/20.07/Adequacy/#5923" class="Bound">af</a> <a id="5935" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="5937" href="/20.07/Adequacy/#6114" class="Function">g</a> <a id="5939" href="/20.07/Adequacy/#5923" class="Bound">af</a> <a id="5942" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="5946" class="Keyword">where</a>
|
||
<a id="5956" href="/20.07/Adequacy/#5956" class="Function">f</a> <a id="5958" class="Symbol">:</a> <a id="5960" class="Symbol">∀{</a><a id="5962" href="/20.07/Adequacy/#5962" class="Bound">u</a> <a id="5964" href="/20.07/Adequacy/#5964" class="Bound">u'</a> <a id="5967" class="Symbol">:</a> <a id="5969" href="/20.07/Denotational/#4151" class="Datatype">Value</a><a id="5974" class="Symbol">}</a> <a id="5976" class="Symbol">→</a> <a id="5978" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#535" class="Function Operator">¬</a> <a id="5980" href="/20.07/Adequacy/#4190" class="Function">above-fun</a> <a id="5990" class="Symbol">(</a><a id="5991" href="/20.07/Adequacy/#5962" class="Bound">u</a> <a id="5993" href="/20.07/Denotational/#4213" class="InductiveConstructor Operator">⊔</a> <a id="5995" href="/20.07/Adequacy/#5964" class="Bound">u'</a><a id="5997" class="Symbol">)</a> <a id="5999" class="Symbol">→</a> <a id="6001" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#535" class="Function Operator">¬</a> <a id="6003" href="/20.07/Adequacy/#4190" class="Function">above-fun</a> <a id="6013" href="/20.07/Adequacy/#5962" class="Bound">u</a>
|
||
<a id="6019" href="/20.07/Adequacy/#5956" class="Function">f</a><a id="6020" class="Symbol">{</a><a id="6021" href="/20.07/Adequacy/#6021" class="Bound">u</a><a id="6022" class="Symbol">}{</a><a id="6024" href="/20.07/Adequacy/#6024" class="Bound">u'</a><a id="6026" class="Symbol">}</a> <a id="6028" href="/20.07/Adequacy/#6028" class="Bound">af12</a> <a id="6033" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="6035" href="/20.07/Adequacy/#6035" class="Bound">v</a> <a id="6037" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="6039" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="6041" href="/20.07/Adequacy/#6041" class="Bound">w</a> <a id="6043" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="6045" href="/20.07/Adequacy/#6045" class="Bound">lt</a> <a id="6048" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="6050" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="6052" class="Symbol">=</a>
|
||
<a id="6062" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.Negation.html#809" class="Function">contradiction</a> <a id="6076" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="6078" href="/20.07/Adequacy/#6035" class="Bound">v</a> <a id="6080" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="6082" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="6084" href="/20.07/Adequacy/#6041" class="Bound">w</a> <a id="6086" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="6088" href="/20.07/Denotational/#4652" class="InductiveConstructor">⊑-conj-R1</a> <a id="6098" href="/20.07/Adequacy/#6045" class="Bound">lt</a> <a id="6101" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="6103" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="6105" href="/20.07/Adequacy/#6028" class="Bound">af12</a>
|
||
<a id="6114" href="/20.07/Adequacy/#6114" class="Function">g</a> <a id="6116" class="Symbol">:</a> <a id="6118" class="Symbol">∀{</a><a id="6120" href="/20.07/Adequacy/#6120" class="Bound">u</a> <a id="6122" href="/20.07/Adequacy/#6122" class="Bound">u'</a> <a id="6125" class="Symbol">:</a> <a id="6127" href="/20.07/Denotational/#4151" class="Datatype">Value</a><a id="6132" class="Symbol">}</a> <a id="6134" class="Symbol">→</a> <a id="6136" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#535" class="Function Operator">¬</a> <a id="6138" href="/20.07/Adequacy/#4190" class="Function">above-fun</a> <a id="6148" class="Symbol">(</a><a id="6149" href="/20.07/Adequacy/#6120" class="Bound">u</a> <a id="6151" href="/20.07/Denotational/#4213" class="InductiveConstructor Operator">⊔</a> <a id="6153" href="/20.07/Adequacy/#6122" class="Bound">u'</a><a id="6155" class="Symbol">)</a> <a id="6157" class="Symbol">→</a> <a id="6159" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#535" class="Function Operator">¬</a> <a id="6161" href="/20.07/Adequacy/#4190" class="Function">above-fun</a> <a id="6171" href="/20.07/Adequacy/#6122" class="Bound">u'</a>
|
||
<a id="6178" href="/20.07/Adequacy/#6114" class="Function">g</a><a id="6179" class="Symbol">{</a><a id="6180" href="/20.07/Adequacy/#6180" class="Bound">u</a><a id="6181" class="Symbol">}{</a><a id="6183" href="/20.07/Adequacy/#6183" class="Bound">u'</a><a id="6185" class="Symbol">}</a> <a id="6187" href="/20.07/Adequacy/#6187" class="Bound">af12</a> <a id="6192" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="6194" href="/20.07/Adequacy/#6194" class="Bound">v</a> <a id="6196" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="6198" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="6200" href="/20.07/Adequacy/#6200" class="Bound">w</a> <a id="6202" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="6204" href="/20.07/Adequacy/#6204" class="Bound">lt</a> <a id="6207" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="6209" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="6211" class="Symbol">=</a>
|
||
<a id="6221" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.Negation.html#809" class="Function">contradiction</a> <a id="6235" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="6237" href="/20.07/Adequacy/#6194" class="Bound">v</a> <a id="6239" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="6241" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="6243" href="/20.07/Adequacy/#6200" class="Bound">w</a> <a id="6245" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="6247" href="/20.07/Denotational/#4725" class="InductiveConstructor">⊑-conj-R2</a> <a id="6257" href="/20.07/Adequacy/#6204" class="Bound">lt</a> <a id="6260" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="6262" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="6264" href="/20.07/Adequacy/#6187" class="Bound">af12</a>
|
||
</pre>
|
||
<p>The property of being greater than a function value is decidable, as
|
||
exhibited by the following function.</p>
|
||
|
||
<pre class="Agda"><a id="above-fun?"></a><a id="6385" href="/20.07/Adequacy/#6385" class="Function">above-fun?</a> <a id="6396" class="Symbol">:</a> <a id="6398" class="Symbol">(</a><a id="6399" href="/20.07/Adequacy/#6399" class="Bound">v</a> <a id="6401" class="Symbol">:</a> <a id="6403" href="/20.07/Denotational/#4151" class="Datatype">Value</a><a id="6408" class="Symbol">)</a> <a id="6410" class="Symbol">→</a> <a id="6412" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#605" class="Datatype">Dec</a> <a id="6416" class="Symbol">(</a><a id="6417" href="/20.07/Adequacy/#4190" class="Function">above-fun</a> <a id="6427" href="/20.07/Adequacy/#6399" class="Bound">v</a><a id="6428" class="Symbol">)</a>
|
||
<a id="6430" href="/20.07/Adequacy/#6385" class="Function">above-fun?</a> <a id="6441" href="/20.07/Denotational/#4171" class="InductiveConstructor">⊥</a> <a id="6443" class="Symbol">=</a> <a id="6445" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="6448" href="/20.07/Adequacy/#4600" class="Function">above-fun⊥</a>
|
||
<a id="6459" href="/20.07/Adequacy/#6385" class="Function">above-fun?</a> <a id="6470" class="Symbol">(</a><a id="6471" href="/20.07/Adequacy/#6471" class="Bound">v</a> <a id="6473" href="/20.07/Denotational/#4183" class="InductiveConstructor Operator">↦</a> <a id="6475" href="/20.07/Adequacy/#6475" class="Bound">w</a><a id="6476" class="Symbol">)</a> <a id="6478" class="Symbol">=</a> <a id="6480" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="6484" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="6486" href="/20.07/Adequacy/#6471" class="Bound">v</a> <a id="6488" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="6490" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="6492" href="/20.07/Adequacy/#6475" class="Bound">w</a> <a id="6494" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="6496" href="/20.07/Denotational/#5638" class="Function">⊑-refl</a> <a id="6503" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="6505" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="6507" href="/20.07/Adequacy/#6385" class="Function">above-fun?</a> <a id="6518" class="Symbol">(</a><a id="6519" href="/20.07/Adequacy/#6519" class="Bound">u</a> <a id="6521" href="/20.07/Denotational/#4213" class="InductiveConstructor Operator">⊔</a> <a id="6523" href="/20.07/Adequacy/#6523" class="Bound">u'</a><a id="6525" class="Symbol">)</a>
|
||
<a id="6531" class="Keyword">with</a> <a id="6536" href="/20.07/Adequacy/#6385" class="Function">above-fun?</a> <a id="6547" href="/20.07/Adequacy/#6519" class="Bound">u</a> <a id="6549" class="Symbol">|</a> <a id="6551" href="/20.07/Adequacy/#6385" class="Function">above-fun?</a> <a id="6562" href="/20.07/Adequacy/#6523" class="Bound">u'</a>
|
||
<a id="6565" class="Symbol">...</a> <a id="6569" class="Symbol">|</a> <a id="6571" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="6575" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="6577" href="/20.07/Adequacy/#6577" class="Bound">v</a> <a id="6579" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="6581" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="6583" href="/20.07/Adequacy/#6583" class="Bound">w</a> <a id="6585" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="6587" href="/20.07/Adequacy/#6587" class="Bound">lt</a> <a id="6590" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="6592" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="6594" class="Symbol">|</a> <a id="6596" class="Symbol">_</a> <a id="6598" class="Symbol">=</a> <a id="6600" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="6604" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="6606" href="/20.07/Adequacy/#6577" class="Bound">v</a> <a id="6608" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="6610" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="6612" href="/20.07/Adequacy/#6583" class="Bound">w</a> <a id="6614" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="6616" class="Symbol">(</a><a id="6617" href="/20.07/Denotational/#4652" class="InductiveConstructor">⊑-conj-R1</a> <a id="6627" href="/20.07/Adequacy/#6587" class="Bound">lt</a><a id="6629" class="Symbol">)</a> <a id="6631" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="6633" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="6635" class="Symbol">...</a> <a id="6639" class="Symbol">|</a> <a id="6641" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="6644" class="Symbol">_</a> <a id="6646" class="Symbol">|</a> <a id="6648" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="6652" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="6654" href="/20.07/Adequacy/#6654" class="Bound">v</a> <a id="6656" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="6658" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="6660" href="/20.07/Adequacy/#6660" class="Bound">w</a> <a id="6662" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="6664" href="/20.07/Adequacy/#6664" class="Bound">lt</a> <a id="6667" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="6669" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="6671" class="Symbol">=</a> <a id="6673" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="6677" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="6679" href="/20.07/Adequacy/#6654" class="Bound">v</a> <a id="6681" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="6683" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="6685" href="/20.07/Adequacy/#6660" class="Bound">w</a> <a id="6687" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="6689" class="Symbol">(</a><a id="6690" href="/20.07/Denotational/#4725" class="InductiveConstructor">⊑-conj-R2</a> <a id="6700" href="/20.07/Adequacy/#6664" class="Bound">lt</a><a id="6702" class="Symbol">)</a> <a id="6704" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="6706" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="6708" class="Symbol">...</a> <a id="6712" class="Symbol">|</a> <a id="6714" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="6717" href="/20.07/Adequacy/#6717" class="Bound">x</a> <a id="6719" class="Symbol">|</a> <a id="6721" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="6724" href="/20.07/Adequacy/#6724" class="Bound">y</a> <a id="6726" class="Symbol">=</a> <a id="6728" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="6731" class="Symbol">(</a><a id="6732" href="/20.07/Adequacy/#5412" class="Function">not-above-fun-⊔</a> <a id="6748" href="/20.07/Adequacy/#6717" class="Bound">x</a> <a id="6750" href="/20.07/Adequacy/#6724" class="Bound">y</a><a id="6751" class="Symbol">)</a>
|
||
</pre>
|
||
|
||
<h2 id="relating-values-to-closures">Relating values to closures</h2>
|
||
|
||
<p>Next we relate semantic values to closures. The relation <code class="language-plaintext highlighter-rouge">𝕍</code> is for
|
||
closures whose term is a lambda abstraction, i.e., in weak-head normal
|
||
form (WHNF). The relation 𝔼 is for any closure. Roughly speaking,
|
||
<code class="language-plaintext highlighter-rouge">𝔼 v c</code> will hold if, when <code class="language-plaintext highlighter-rouge">v</code> is greater than a function value, <code class="language-plaintext highlighter-rouge">c</code> evaluates
|
||
to a closure <code class="language-plaintext highlighter-rouge">c'</code> in WHNF and <code class="language-plaintext highlighter-rouge">𝕍 v c'</code>. Regarding <code class="language-plaintext highlighter-rouge">𝕍 v c</code>, it will hold when
|
||
<code class="language-plaintext highlighter-rouge">c</code> is in WHNF, and if <code class="language-plaintext highlighter-rouge">v</code> is a function, the body of <code class="language-plaintext highlighter-rouge">c</code> evaluates
|
||
according to <code class="language-plaintext highlighter-rouge">v</code>.</p>
|
||
|
||
<pre class="Agda"><a id="𝕍"></a><a id="7244" href="/20.07/Adequacy/#7244" class="Function">𝕍</a> <a id="7246" class="Symbol">:</a> <a id="7248" href="/20.07/Denotational/#4151" class="Datatype">Value</a> <a id="7254" class="Symbol">→</a> <a id="7256" href="/20.07/BigStep/#2467" class="Datatype">Clos</a> <a id="7261" class="Symbol">→</a> <a id="7263" class="PrimitiveType">Set</a>
|
||
<a id="𝔼"></a><a id="7267" href="/20.07/Adequacy/#7267" class="Function">𝔼</a> <a id="7269" class="Symbol">:</a> <a id="7271" href="/20.07/Denotational/#4151" class="Datatype">Value</a> <a id="7277" class="Symbol">→</a> <a id="7279" href="/20.07/BigStep/#2467" class="Datatype">Clos</a> <a id="7284" class="Symbol">→</a> <a id="7286" class="PrimitiveType">Set</a>
|
||
</pre>
|
||
<p>We define <code class="language-plaintext highlighter-rouge">𝕍</code> as a function from values and closures to <code class="language-plaintext highlighter-rouge">Set</code> and not as a
|
||
data type because it is mutually recursive with <code class="language-plaintext highlighter-rouge">𝔼</code> in a negative
|
||
position (to the left of an implication). We first perform case
|
||
analysis on the term in the closure. If the term is a variable or
|
||
application, then <code class="language-plaintext highlighter-rouge">𝕍</code> is false (<code class="language-plaintext highlighter-rouge">Bot</code>). If the term is a lambda
|
||
abstraction, we define <code class="language-plaintext highlighter-rouge">𝕍</code> by recursion on the value, which we
|
||
describe below.</p>
|
||
|
||
<pre class="Agda"><a id="7715" href="/20.07/Adequacy/#7244" class="Function">𝕍</a> <a id="7717" href="/20.07/Adequacy/#7717" class="Bound">v</a> <a id="7719" class="Symbol">(</a><a id="7720" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="7725" class="Symbol">(</a><a id="7726" href="/20.07/Untyped/#4330" class="InductiveConstructor Operator">`</a> <a id="7728" href="/20.07/Adequacy/#7728" class="Bound">x₁</a><a id="7730" class="Symbol">)</a> <a id="7732" href="/20.07/Adequacy/#7732" class="Bound">γ</a><a id="7733" class="Symbol">)</a> <a id="7735" class="Symbol">=</a> <a id="7737" href="https://agda.github.io/agda-stdlib/v1.1/Data.Empty.html#279" class="Datatype">Bot</a>
|
||
<a id="7741" href="/20.07/Adequacy/#7244" class="Function">𝕍</a> <a id="7743" href="/20.07/Adequacy/#7743" class="Bound">v</a> <a id="7745" class="Symbol">(</a><a id="7746" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="7751" class="Symbol">(</a><a id="7752" href="/20.07/Adequacy/#7752" class="Bound">M</a> <a id="7754" href="/20.07/Untyped/#4442" class="InductiveConstructor Operator">·</a> <a id="7756" href="/20.07/Adequacy/#7756" class="Bound">M₁</a><a id="7758" class="Symbol">)</a> <a id="7760" href="/20.07/Adequacy/#7760" class="Bound">γ</a><a id="7761" class="Symbol">)</a> <a id="7763" class="Symbol">=</a> <a id="7765" href="https://agda.github.io/agda-stdlib/v1.1/Data.Empty.html#279" class="Datatype">Bot</a>
|
||
<a id="7769" href="/20.07/Adequacy/#7244" class="Function">𝕍</a> <a id="7771" href="/20.07/Denotational/#4171" class="InductiveConstructor">⊥</a> <a id="7773" class="Symbol">(</a><a id="7774" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="7779" class="Symbol">(</a><a id="7780" href="/20.07/Untyped/#4382" class="InductiveConstructor Operator">ƛ</a> <a id="7782" href="/20.07/Adequacy/#7782" class="Bound">M</a><a id="7783" class="Symbol">)</a> <a id="7785" href="/20.07/Adequacy/#7785" class="Bound">γ</a><a id="7786" class="Symbol">)</a> <a id="7788" class="Symbol">=</a> <a id="7790" href="Agda.Builtin.Unit.html#137" class="Record">⊤</a>
|
||
<a id="7792" href="/20.07/Adequacy/#7244" class="Function">𝕍</a> <a id="7794" class="Symbol">(</a><a id="7795" href="/20.07/Adequacy/#7795" class="Bound">v</a> <a id="7797" href="/20.07/Denotational/#4183" class="InductiveConstructor Operator">↦</a> <a id="7799" href="/20.07/Adequacy/#7799" class="Bound">w</a><a id="7800" class="Symbol">)</a> <a id="7802" class="Symbol">(</a><a id="7803" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="7808" class="Symbol">(</a><a id="7809" href="/20.07/Untyped/#4382" class="InductiveConstructor Operator">ƛ</a> <a id="7811" href="/20.07/Adequacy/#7811" class="Bound">N</a><a id="7812" class="Symbol">)</a> <a id="7814" href="/20.07/Adequacy/#7814" class="Bound">γ</a><a id="7815" class="Symbol">)</a> <a id="7817" class="Symbol">=</a>
|
||
<a id="7823" class="Symbol">(∀{</a><a id="7826" href="/20.07/Adequacy/#7826" class="Bound">c</a> <a id="7828" class="Symbol">:</a> <a id="7830" href="/20.07/BigStep/#2467" class="Datatype">Clos</a><a id="7834" class="Symbol">}</a> <a id="7836" class="Symbol">→</a> <a id="7838" href="/20.07/Adequacy/#7267" class="Function">𝔼</a> <a id="7840" href="/20.07/Adequacy/#7795" class="Bound">v</a> <a id="7842" href="/20.07/Adequacy/#7826" class="Bound">c</a> <a id="7844" class="Symbol">→</a> <a id="7846" href="/20.07/Adequacy/#4190" class="Function">above-fun</a> <a id="7856" href="/20.07/Adequacy/#7799" class="Bound">w</a> <a id="7858" class="Symbol">→</a> <a id="7860" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">Σ[</a> <a id="7863" href="/20.07/Adequacy/#7863" class="Bound">c'</a> <a id="7866" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">∈</a> <a id="7868" href="/20.07/BigStep/#2467" class="Datatype">Clos</a> <a id="7873" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">]</a>
|
||
<a id="7883" class="Symbol">(</a><a id="7884" href="/20.07/Adequacy/#7814" class="Bound">γ</a> <a id="7886" href="/20.07/BigStep/#2672" class="Function Operator">,'</a> <a id="7889" href="/20.07/Adequacy/#7826" class="Bound">c</a><a id="7890" class="Symbol">)</a> <a id="7892" href="/20.07/BigStep/#3021" class="Datatype Operator">⊢</a> <a id="7894" href="/20.07/Adequacy/#7811" class="Bound">N</a> <a id="7896" href="/20.07/BigStep/#3021" class="Datatype Operator">⇓</a> <a id="7898" href="/20.07/Adequacy/#7863" class="Bound">c'</a> <a id="7902" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#1162" class="Function Operator">×</a> <a id="7905" href="/20.07/Adequacy/#7244" class="Function">𝕍</a> <a id="7907" href="/20.07/Adequacy/#7799" class="Bound">w</a> <a id="7909" href="/20.07/Adequacy/#7863" class="Bound">c'</a><a id="7911" class="Symbol">)</a>
|
||
<a id="7913" href="/20.07/Adequacy/#7244" class="Function">𝕍</a> <a id="7915" class="Symbol">(</a><a id="7916" href="/20.07/Adequacy/#7916" class="Bound">u</a> <a id="7918" href="/20.07/Denotational/#4213" class="InductiveConstructor Operator">⊔</a> <a id="7920" href="/20.07/Adequacy/#7920" class="Bound">v</a><a id="7921" class="Symbol">)</a> <a id="7923" class="Symbol">(</a><a id="7924" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="7929" class="Symbol">(</a><a id="7930" href="/20.07/Untyped/#4382" class="InductiveConstructor Operator">ƛ</a> <a id="7932" href="/20.07/Adequacy/#7932" class="Bound">N</a><a id="7933" class="Symbol">)</a> <a id="7935" href="/20.07/Adequacy/#7935" class="Bound">γ</a><a id="7936" class="Symbol">)</a> <a id="7938" class="Symbol">=</a> <a id="7940" href="/20.07/Adequacy/#7244" class="Function">𝕍</a> <a id="7942" href="/20.07/Adequacy/#7916" class="Bound">u</a> <a id="7944" class="Symbol">(</a><a id="7945" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="7950" class="Symbol">(</a><a id="7951" href="/20.07/Untyped/#4382" class="InductiveConstructor Operator">ƛ</a> <a id="7953" href="/20.07/Adequacy/#7932" class="Bound">N</a><a id="7954" class="Symbol">)</a> <a id="7956" href="/20.07/Adequacy/#7935" class="Bound">γ</a><a id="7957" class="Symbol">)</a> <a id="7959" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#1162" class="Function Operator">×</a> <a id="7961" href="/20.07/Adequacy/#7244" class="Function">𝕍</a> <a id="7963" href="/20.07/Adequacy/#7920" class="Bound">v</a> <a id="7965" class="Symbol">(</a><a id="7966" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="7971" class="Symbol">(</a><a id="7972" href="/20.07/Untyped/#4382" class="InductiveConstructor Operator">ƛ</a> <a id="7974" href="/20.07/Adequacy/#7932" class="Bound">N</a><a id="7975" class="Symbol">)</a> <a id="7977" href="/20.07/Adequacy/#7935" class="Bound">γ</a><a id="7978" class="Symbol">)</a>
|
||
</pre>
|
||
<ul>
|
||
<li>
|
||
<p>If the value is <code class="language-plaintext highlighter-rouge">⊥</code>, then the result is true (<code class="language-plaintext highlighter-rouge">⊤</code>).</p>
|
||
</li>
|
||
<li>
|
||
<p>If the value is a join (u ⊔ v), then the result is the pair
|
||
(conjunction) of 𝕍 is true for both u and v.</p>
|
||
</li>
|
||
<li>
|
||
<p>The important case is for a function value <code class="language-plaintext highlighter-rouge">v ↦ w</code> and closure
|
||
<code class="language-plaintext highlighter-rouge">clos (ƛ N) γ</code>. Given any closure <code class="language-plaintext highlighter-rouge">c</code> such that <code class="language-plaintext highlighter-rouge">𝔼 v c</code>, if <code class="language-plaintext highlighter-rouge">w</code> is
|
||
greater than a function, then <code class="language-plaintext highlighter-rouge">N</code> evaluates (with <code class="language-plaintext highlighter-rouge">γ</code> extended with <code class="language-plaintext highlighter-rouge">c</code>)
|
||
to some closure <code class="language-plaintext highlighter-rouge">c'</code> and we have <code class="language-plaintext highlighter-rouge">𝕍 w c'</code>.</p>
|
||
</li>
|
||
</ul>
|
||
|
||
<p>The definition of <code class="language-plaintext highlighter-rouge">𝔼</code> is straightforward. If <code class="language-plaintext highlighter-rouge">v</code> is a greater than a
|
||
function, then <code class="language-plaintext highlighter-rouge">M</code> evaluates to a closure related to <code class="language-plaintext highlighter-rouge">v</code>.</p>
|
||
|
||
<pre class="Agda"><a id="8538" href="/20.07/Adequacy/#7267" class="Function">𝔼</a> <a id="8540" href="/20.07/Adequacy/#8540" class="Bound">v</a> <a id="8542" class="Symbol">(</a><a id="8543" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="8548" href="/20.07/Adequacy/#8548" class="Bound">M</a> <a id="8550" href="/20.07/Adequacy/#8550" class="Bound">γ'</a><a id="8552" class="Symbol">)</a> <a id="8554" class="Symbol">=</a> <a id="8556" href="/20.07/Adequacy/#4190" class="Function">above-fun</a> <a id="8566" href="/20.07/Adequacy/#8540" class="Bound">v</a> <a id="8568" class="Symbol">→</a> <a id="8570" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">Σ[</a> <a id="8573" href="/20.07/Adequacy/#8573" class="Bound">c</a> <a id="8575" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">∈</a> <a id="8577" href="/20.07/BigStep/#2467" class="Datatype">Clos</a> <a id="8582" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">]</a> <a id="8584" href="/20.07/Adequacy/#8550" class="Bound">γ'</a> <a id="8587" href="/20.07/BigStep/#3021" class="Datatype Operator">⊢</a> <a id="8589" href="/20.07/Adequacy/#8548" class="Bound">M</a> <a id="8591" href="/20.07/BigStep/#3021" class="Datatype Operator">⇓</a> <a id="8593" href="/20.07/Adequacy/#8573" class="Bound">c</a> <a id="8595" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#1162" class="Function Operator">×</a> <a id="8597" href="/20.07/Adequacy/#7244" class="Function">𝕍</a> <a id="8599" href="/20.07/Adequacy/#8540" class="Bound">v</a> <a id="8601" href="/20.07/Adequacy/#8573" class="Bound">c</a>
|
||
</pre>
|
||
<p>The proof of the main lemma is by induction on <code class="language-plaintext highlighter-rouge">γ ⊢ M ↓ v</code>, so it goes
|
||
underneath lambda abstractions and must therefore reason about open
|
||
terms (terms with variables). So we must relate environments of
|
||
semantic values to environments of closures. In the following, <code class="language-plaintext highlighter-rouge">𝔾</code>
|
||
relates <code class="language-plaintext highlighter-rouge">γ</code> to <code class="language-plaintext highlighter-rouge">γ'</code> if the corresponding values and closures are related
|
||
by <code class="language-plaintext highlighter-rouge">𝔼</code>.</p>
|
||
|
||
<pre class="Agda"><a id="𝔾"></a><a id="8965" href="/20.07/Adequacy/#8965" class="Function">𝔾</a> <a id="8967" class="Symbol">:</a> <a id="8969" class="Symbol">∀{</a><a id="8971" href="/20.07/Adequacy/#8971" class="Bound">Γ</a><a id="8972" class="Symbol">}</a> <a id="8974" class="Symbol">→</a> <a id="8976" href="/20.07/Denotational/#7288" class="Function">Env</a> <a id="8980" href="/20.07/Adequacy/#8971" class="Bound">Γ</a> <a id="8982" class="Symbol">→</a> <a id="8984" href="/20.07/BigStep/#2437" class="Function">ClosEnv</a> <a id="8992" href="/20.07/Adequacy/#8971" class="Bound">Γ</a> <a id="8994" class="Symbol">→</a> <a id="8996" class="PrimitiveType">Set</a>
|
||
<a id="9000" href="/20.07/Adequacy/#8965" class="Function">𝔾</a> <a id="9002" class="Symbol">{</a><a id="9003" href="/20.07/Adequacy/#9003" class="Bound">Γ</a><a id="9004" class="Symbol">}</a> <a id="9006" href="/20.07/Adequacy/#9006" class="Bound">γ</a> <a id="9008" href="/20.07/Adequacy/#9008" class="Bound">γ'</a> <a id="9011" class="Symbol">=</a> <a id="9013" class="Symbol">∀{</a><a id="9015" href="/20.07/Adequacy/#9015" class="Bound">x</a> <a id="9017" class="Symbol">:</a> <a id="9019" href="/20.07/Adequacy/#9003" class="Bound">Γ</a> <a id="9021" href="/20.07/Untyped/#3521" class="Datatype Operator">∋</a> <a id="9023" href="/20.07/Untyped/#2888" class="InductiveConstructor">★</a><a id="9024" class="Symbol">}</a> <a id="9026" class="Symbol">→</a> <a id="9028" href="/20.07/Adequacy/#7267" class="Function">𝔼</a> <a id="9030" class="Symbol">(</a><a id="9031" href="/20.07/Adequacy/#9006" class="Bound">γ</a> <a id="9033" href="/20.07/Adequacy/#9015" class="Bound">x</a><a id="9034" class="Symbol">)</a> <a id="9036" class="Symbol">(</a><a id="9037" href="/20.07/Adequacy/#9008" class="Bound">γ'</a> <a id="9040" href="/20.07/Adequacy/#9015" class="Bound">x</a><a id="9041" class="Symbol">)</a>
|
||
|
||
<a id="𝔾-∅"></a><a id="9044" href="/20.07/Adequacy/#9044" class="Function">𝔾-∅</a> <a id="9048" class="Symbol">:</a> <a id="9050" href="/20.07/Adequacy/#8965" class="Function">𝔾</a> <a id="9052" href="/20.07/Denotational/#7412" class="Function">`∅</a> <a id="9055" href="/20.07/BigStep/#2650" class="Function">∅'</a>
|
||
<a id="9058" href="/20.07/Adequacy/#9044" class="Function">𝔾-∅</a> <a id="9062" class="Symbol">{()}</a>
|
||
|
||
<a id="𝔾-ext"></a><a id="9068" href="/20.07/Adequacy/#9068" class="Function">𝔾-ext</a> <a id="9074" class="Symbol">:</a> <a id="9076" class="Symbol">∀{</a><a id="9078" href="/20.07/Adequacy/#9078" class="Bound">Γ</a><a id="9079" class="Symbol">}{</a><a id="9081" href="/20.07/Adequacy/#9081" class="Bound">γ</a> <a id="9083" class="Symbol">:</a> <a id="9085" href="/20.07/Denotational/#7288" class="Function">Env</a> <a id="9089" href="/20.07/Adequacy/#9078" class="Bound">Γ</a><a id="9090" class="Symbol">}{</a><a id="9092" href="/20.07/Adequacy/#9092" class="Bound">γ'</a> <a id="9095" class="Symbol">:</a> <a id="9097" href="/20.07/BigStep/#2437" class="Function">ClosEnv</a> <a id="9105" href="/20.07/Adequacy/#9078" class="Bound">Γ</a><a id="9106" class="Symbol">}{</a><a id="9108" href="/20.07/Adequacy/#9108" class="Bound">v</a> <a id="9110" href="/20.07/Adequacy/#9110" class="Bound">c</a><a id="9111" class="Symbol">}</a>
|
||
<a id="9119" class="Symbol">→</a> <a id="9121" href="/20.07/Adequacy/#8965" class="Function">𝔾</a> <a id="9123" href="/20.07/Adequacy/#9081" class="Bound">γ</a> <a id="9125" href="/20.07/Adequacy/#9092" class="Bound">γ'</a> <a id="9128" class="Symbol">→</a> <a id="9130" href="/20.07/Adequacy/#7267" class="Function">𝔼</a> <a id="9132" href="/20.07/Adequacy/#9108" class="Bound">v</a> <a id="9134" href="/20.07/Adequacy/#9110" class="Bound">c</a> <a id="9136" class="Symbol">→</a> <a id="9138" href="/20.07/Adequacy/#8965" class="Function">𝔾</a> <a id="9140" class="Symbol">(</a><a id="9141" href="/20.07/Adequacy/#9081" class="Bound">γ</a> <a id="9143" href="/20.07/Denotational/#7445" class="Function Operator">`,</a> <a id="9146" href="/20.07/Adequacy/#9108" class="Bound">v</a><a id="9147" class="Symbol">)</a> <a id="9149" class="Symbol">(</a><a id="9150" href="/20.07/Adequacy/#9092" class="Bound">γ'</a> <a id="9153" href="/20.07/BigStep/#2672" class="Function Operator">,'</a> <a id="9156" href="/20.07/Adequacy/#9110" class="Bound">c</a><a id="9157" class="Symbol">)</a>
|
||
<a id="9159" href="/20.07/Adequacy/#9068" class="Function">𝔾-ext</a> <a id="9165" class="Symbol">{</a><a id="9166" href="/20.07/Adequacy/#9166" class="Bound">Γ</a><a id="9167" class="Symbol">}</a> <a id="9169" class="Symbol">{</a><a id="9170" href="/20.07/Adequacy/#9170" class="Bound">γ</a><a id="9171" class="Symbol">}</a> <a id="9173" class="Symbol">{</a><a id="9174" href="/20.07/Adequacy/#9174" class="Bound">γ'</a><a id="9176" class="Symbol">}</a> <a id="9178" href="/20.07/Adequacy/#9178" class="Bound">g</a> <a id="9180" href="/20.07/Adequacy/#9180" class="Bound">e</a> <a id="9182" class="Symbol">{</a><a id="9183" href="/20.07/Untyped/#3557" class="InductiveConstructor">Z</a><a id="9184" class="Symbol">}</a> <a id="9186" class="Symbol">=</a> <a id="9188" href="/20.07/Adequacy/#9180" class="Bound">e</a>
|
||
<a id="9190" href="/20.07/Adequacy/#9068" class="Function">𝔾-ext</a> <a id="9196" class="Symbol">{</a><a id="9197" href="/20.07/Adequacy/#9197" class="Bound">Γ</a><a id="9198" class="Symbol">}</a> <a id="9200" class="Symbol">{</a><a id="9201" href="/20.07/Adequacy/#9201" class="Bound">γ</a><a id="9202" class="Symbol">}</a> <a id="9204" class="Symbol">{</a><a id="9205" href="/20.07/Adequacy/#9205" class="Bound">γ'</a><a id="9207" class="Symbol">}</a> <a id="9209" href="/20.07/Adequacy/#9209" class="Bound">g</a> <a id="9211" href="/20.07/Adequacy/#9211" class="Bound">e</a> <a id="9213" class="Symbol">{</a><a id="9214" href="/20.07/Untyped/#3602" class="InductiveConstructor Operator">S</a> <a id="9216" href="/20.07/Adequacy/#9216" class="Bound">x</a><a id="9217" class="Symbol">}</a> <a id="9219" class="Symbol">=</a> <a id="9221" href="/20.07/Adequacy/#9209" class="Bound">g</a>
|
||
</pre>
|
||
<p>We need a few properties of the <code class="language-plaintext highlighter-rouge">𝕍</code> and <code class="language-plaintext highlighter-rouge">𝔼</code> relations. The first is that
|
||
a closure in the <code class="language-plaintext highlighter-rouge">𝕍</code> relation must be in weak-head normal form. We
|
||
define WHNF has follows.</p>
|
||
|
||
<pre class="Agda"><a id="9400" class="Keyword">data</a> <a id="WHNF"></a><a id="9405" href="/20.07/Adequacy/#9405" class="Datatype">WHNF</a> <a id="9410" class="Symbol">:</a> <a id="9412" class="Symbol">∀</a> <a id="9414" class="Symbol">{</a><a id="9415" href="/20.07/Adequacy/#9415" class="Bound">Γ</a> <a id="9417" href="/20.07/Adequacy/#9417" class="Bound">A</a><a id="9418" class="Symbol">}</a> <a id="9420" class="Symbol">→</a> <a id="9422" href="/20.07/Adequacy/#9415" class="Bound">Γ</a> <a id="9424" href="/20.07/Untyped/#4294" class="Datatype Operator">⊢</a> <a id="9426" href="/20.07/Adequacy/#9417" class="Bound">A</a> <a id="9428" class="Symbol">→</a> <a id="9430" class="PrimitiveType">Set</a> <a id="9434" class="Keyword">where</a>
|
||
<a id="WHNF.ƛ_"></a><a id="9442" href="/20.07/Adequacy/#9442" class="InductiveConstructor Operator">ƛ_</a> <a id="9445" class="Symbol">:</a> <a id="9447" class="Symbol">∀</a> <a id="9449" class="Symbol">{</a><a id="9450" href="/20.07/Adequacy/#9450" class="Bound">Γ</a><a id="9451" class="Symbol">}</a> <a id="9453" class="Symbol">{</a><a id="9454" href="/20.07/Adequacy/#9454" class="Bound">N</a> <a id="9456" class="Symbol">:</a> <a id="9458" href="/20.07/Adequacy/#9450" class="Bound">Γ</a> <a id="9460" href="/20.07/Untyped/#3191" class="InductiveConstructor Operator">,</a> <a id="9462" href="/20.07/Untyped/#2888" class="InductiveConstructor">★</a> <a id="9464" href="/20.07/Untyped/#4294" class="Datatype Operator">⊢</a> <a id="9466" href="/20.07/Untyped/#2888" class="InductiveConstructor">★</a><a id="9467" class="Symbol">}</a>
|
||
<a id="9474" class="Symbol">→</a> <a id="9476" href="/20.07/Adequacy/#9405" class="Datatype">WHNF</a> <a id="9481" class="Symbol">(</a><a id="9482" href="/20.07/Untyped/#4382" class="InductiveConstructor Operator">ƛ</a> <a id="9484" href="/20.07/Adequacy/#9454" class="Bound">N</a><a id="9485" class="Symbol">)</a>
|
||
</pre>
|
||
<p>The proof goes by cases on the term in the closure.</p>
|
||
|
||
<pre class="Agda"><a id="𝕍→WHNF"></a><a id="9549" href="/20.07/Adequacy/#9549" class="Function">𝕍→WHNF</a> <a id="9556" class="Symbol">:</a> <a id="9558" class="Symbol">∀{</a><a id="9560" href="/20.07/Adequacy/#9560" class="Bound">Γ</a><a id="9561" class="Symbol">}{</a><a id="9563" href="/20.07/Adequacy/#9563" class="Bound">γ</a> <a id="9565" class="Symbol">:</a> <a id="9567" href="/20.07/BigStep/#2437" class="Function">ClosEnv</a> <a id="9575" href="/20.07/Adequacy/#9560" class="Bound">Γ</a><a id="9576" class="Symbol">}{</a><a id="9578" href="/20.07/Adequacy/#9578" class="Bound">M</a> <a id="9580" class="Symbol">:</a> <a id="9582" href="/20.07/Adequacy/#9560" class="Bound">Γ</a> <a id="9584" href="/20.07/Untyped/#4294" class="Datatype Operator">⊢</a> <a id="9586" href="/20.07/Untyped/#2888" class="InductiveConstructor">★</a><a id="9587" class="Symbol">}{</a><a id="9589" href="/20.07/Adequacy/#9589" class="Bound">v</a><a id="9590" class="Symbol">}</a>
|
||
<a id="9599" class="Symbol">→</a> <a id="9601" href="/20.07/Adequacy/#7244" class="Function">𝕍</a> <a id="9603" href="/20.07/Adequacy/#9589" class="Bound">v</a> <a id="9605" class="Symbol">(</a><a id="9606" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="9611" href="/20.07/Adequacy/#9578" class="Bound">M</a> <a id="9613" href="/20.07/Adequacy/#9563" class="Bound">γ</a><a id="9614" class="Symbol">)</a> <a id="9616" class="Symbol">→</a> <a id="9618" href="/20.07/Adequacy/#9405" class="Datatype">WHNF</a> <a id="9623" href="/20.07/Adequacy/#9578" class="Bound">M</a>
|
||
<a id="9625" href="/20.07/Adequacy/#9549" class="Function">𝕍→WHNF</a> <a id="9632" class="Symbol">{</a><a id="9633" class="Argument">M</a> <a id="9635" class="Symbol">=</a> <a id="9637" href="/20.07/Untyped/#4330" class="InductiveConstructor Operator">`</a> <a id="9639" href="/20.07/Adequacy/#9639" class="Bound">x</a><a id="9640" class="Symbol">}</a> <a id="9642" class="Symbol">{</a><a id="9643" href="/20.07/Adequacy/#9643" class="Bound">v</a><a id="9644" class="Symbol">}</a> <a id="9646" class="Symbol">()</a>
|
||
<a id="9649" href="/20.07/Adequacy/#9549" class="Function">𝕍→WHNF</a> <a id="9656" class="Symbol">{</a><a id="9657" class="Argument">M</a> <a id="9659" class="Symbol">=</a> <a id="9661" href="/20.07/Untyped/#4382" class="InductiveConstructor Operator">ƛ</a> <a id="9663" href="/20.07/Adequacy/#9663" class="Bound">N</a><a id="9664" class="Symbol">}</a> <a id="9666" class="Symbol">{</a><a id="9667" href="/20.07/Adequacy/#9667" class="Bound">v</a><a id="9668" class="Symbol">}</a> <a id="9670" href="/20.07/Adequacy/#9670" class="Bound">vc</a> <a id="9673" class="Symbol">=</a> <a id="9675" href="/20.07/Adequacy/#9442" class="InductiveConstructor Operator">ƛ_</a>
|
||
<a id="9678" href="/20.07/Adequacy/#9549" class="Function">𝕍→WHNF</a> <a id="9685" class="Symbol">{</a><a id="9686" class="Argument">M</a> <a id="9688" class="Symbol">=</a> <a id="9690" href="/20.07/Adequacy/#9690" class="Bound">L</a> <a id="9692" href="/20.07/Untyped/#4442" class="InductiveConstructor Operator">·</a> <a id="9694" href="/20.07/Adequacy/#9694" class="Bound">M</a><a id="9695" class="Symbol">}</a> <a id="9697" class="Symbol">{</a><a id="9698" href="/20.07/Adequacy/#9698" class="Bound">v</a><a id="9699" class="Symbol">}</a> <a id="9701" class="Symbol">()</a>
|
||
</pre>
|
||
<p>Next we have an introduction rule for <code class="language-plaintext highlighter-rouge">𝕍</code> that mimics the <code class="language-plaintext highlighter-rouge">⊔-intro</code>
|
||
rule. If both <code class="language-plaintext highlighter-rouge">u</code> and <code class="language-plaintext highlighter-rouge">v</code> are related to a closure <code class="language-plaintext highlighter-rouge">c</code>, then their join is
|
||
too.</p>
|
||
|
||
<pre class="Agda"><a id="𝕍⊔-intro"></a><a id="9862" href="/20.07/Adequacy/#9862" class="Function">𝕍⊔-intro</a> <a id="9871" class="Symbol">:</a> <a id="9873" class="Symbol">∀{</a><a id="9875" href="/20.07/Adequacy/#9875" class="Bound">c</a> <a id="9877" href="/20.07/Adequacy/#9877" class="Bound">u</a> <a id="9879" href="/20.07/Adequacy/#9879" class="Bound">v</a><a id="9880" class="Symbol">}</a>
|
||
<a id="9891" class="Symbol">→</a> <a id="9893" href="/20.07/Adequacy/#7244" class="Function">𝕍</a> <a id="9895" href="/20.07/Adequacy/#9877" class="Bound">u</a> <a id="9897" href="/20.07/Adequacy/#9875" class="Bound">c</a> <a id="9899" class="Symbol">→</a> <a id="9901" href="/20.07/Adequacy/#7244" class="Function">𝕍</a> <a id="9903" href="/20.07/Adequacy/#9879" class="Bound">v</a> <a id="9905" href="/20.07/Adequacy/#9875" class="Bound">c</a>
|
||
<a id="9918" class="Comment">---------------</a>
|
||
<a id="9943" class="Symbol">→</a> <a id="9945" href="/20.07/Adequacy/#7244" class="Function">𝕍</a> <a id="9947" class="Symbol">(</a><a id="9948" href="/20.07/Adequacy/#9877" class="Bound">u</a> <a id="9950" href="/20.07/Denotational/#4213" class="InductiveConstructor Operator">⊔</a> <a id="9952" href="/20.07/Adequacy/#9879" class="Bound">v</a><a id="9953" class="Symbol">)</a> <a id="9955" href="/20.07/Adequacy/#9875" class="Bound">c</a>
|
||
<a id="9957" href="/20.07/Adequacy/#9862" class="Function">𝕍⊔-intro</a> <a id="9966" class="Symbol">{</a><a id="9967" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="9972" class="Symbol">(</a><a id="9973" href="/20.07/Untyped/#4330" class="InductiveConstructor Operator">`</a> <a id="9975" href="/20.07/Adequacy/#9975" class="Bound">x</a><a id="9976" class="Symbol">)</a> <a id="9978" href="/20.07/Adequacy/#9978" class="Bound">γ</a><a id="9979" class="Symbol">}</a> <a id="9981" class="Symbol">()</a> <a id="9984" href="/20.07/Adequacy/#9984" class="Bound">vc</a>
|
||
<a id="9987" href="/20.07/Adequacy/#9862" class="Function">𝕍⊔-intro</a> <a id="9996" class="Symbol">{</a><a id="9997" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="10002" class="Symbol">(</a><a id="10003" href="/20.07/Untyped/#4382" class="InductiveConstructor Operator">ƛ</a> <a id="10005" href="/20.07/Adequacy/#10005" class="Bound">N</a><a id="10006" class="Symbol">)</a> <a id="10008" href="/20.07/Adequacy/#10008" class="Bound">γ</a><a id="10009" class="Symbol">}</a> <a id="10011" href="/20.07/Adequacy/#10011" class="Bound">uc</a> <a id="10014" href="/20.07/Adequacy/#10014" class="Bound">vc</a> <a id="10017" class="Symbol">=</a> <a id="10019" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="10021" href="/20.07/Adequacy/#10011" class="Bound">uc</a> <a id="10024" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="10026" href="/20.07/Adequacy/#10014" class="Bound">vc</a> <a id="10029" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="10031" href="/20.07/Adequacy/#9862" class="Function">𝕍⊔-intro</a> <a id="10040" class="Symbol">{</a><a id="10041" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="10046" class="Symbol">(</a><a id="10047" href="/20.07/Adequacy/#10047" class="Bound">L</a> <a id="10049" href="/20.07/Untyped/#4442" class="InductiveConstructor Operator">·</a> <a id="10051" href="/20.07/Adequacy/#10051" class="Bound">M</a><a id="10052" class="Symbol">)</a> <a id="10054" href="/20.07/Adequacy/#10054" class="Bound">γ</a><a id="10055" class="Symbol">}</a> <a id="10057" class="Symbol">()</a> <a id="10060" href="/20.07/Adequacy/#10060" class="Bound">vc</a>
|
||
</pre>
|
||
<p>In a moment we prove that <code class="language-plaintext highlighter-rouge">𝕍</code> is preserved when going from a greater
|
||
value to a lesser value: if <code class="language-plaintext highlighter-rouge">𝕍 v c</code> and <code class="language-plaintext highlighter-rouge">v' ⊑ v</code>, then <code class="language-plaintext highlighter-rouge">𝕍 v' c</code>.
|
||
This property, named <code class="language-plaintext highlighter-rouge">𝕍-sub</code>, is needed by the main lemma in
|
||
the case for the <code class="language-plaintext highlighter-rouge">sub</code> rule.</p>
|
||
|
||
<p>To prove <code class="language-plaintext highlighter-rouge">𝕍-sub</code>, we in turn need the following property concerning
|
||
values that are not greater than a function, that is, values that are
|
||
equivalent to <code class="language-plaintext highlighter-rouge">⊥</code>. In such cases, <code class="language-plaintext highlighter-rouge">𝕍 v (clos (ƛ N) γ')</code> is trivially true.</p>
|
||
|
||
<pre class="Agda"><a id="not-above-fun-𝕍"></a><a id="10511" href="/20.07/Adequacy/#10511" class="Function">not-above-fun-𝕍</a> <a id="10527" class="Symbol">:</a> <a id="10529" class="Symbol">∀{</a><a id="10531" href="/20.07/Adequacy/#10531" class="Bound">v</a> <a id="10533" class="Symbol">:</a> <a id="10535" href="/20.07/Denotational/#4151" class="Datatype">Value</a><a id="10540" class="Symbol">}{</a><a id="10542" href="/20.07/Adequacy/#10542" class="Bound">Γ</a><a id="10543" class="Symbol">}{</a><a id="10545" href="/20.07/Adequacy/#10545" class="Bound">γ'</a> <a id="10548" class="Symbol">:</a> <a id="10550" href="/20.07/BigStep/#2437" class="Function">ClosEnv</a> <a id="10558" href="/20.07/Adequacy/#10542" class="Bound">Γ</a><a id="10559" class="Symbol">}{</a><a id="10561" href="/20.07/Adequacy/#10561" class="Bound">N</a> <a id="10563" class="Symbol">:</a> <a id="10565" href="/20.07/Adequacy/#10542" class="Bound">Γ</a> <a id="10567" href="/20.07/Untyped/#3191" class="InductiveConstructor Operator">,</a> <a id="10569" href="/20.07/Untyped/#2888" class="InductiveConstructor">★</a> <a id="10571" href="/20.07/Untyped/#4294" class="Datatype Operator">⊢</a> <a id="10573" href="/20.07/Untyped/#2888" class="InductiveConstructor">★</a> <a id="10575" class="Symbol">}</a>
|
||
<a id="10581" class="Symbol">→</a> <a id="10583" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#535" class="Function Operator">¬</a> <a id="10585" href="/20.07/Adequacy/#4190" class="Function">above-fun</a> <a id="10595" href="/20.07/Adequacy/#10531" class="Bound">v</a>
|
||
<a id="10603" class="Comment">-------------------</a>
|
||
<a id="10627" class="Symbol">→</a> <a id="10629" href="/20.07/Adequacy/#7244" class="Function">𝕍</a> <a id="10631" href="/20.07/Adequacy/#10531" class="Bound">v</a> <a id="10633" class="Symbol">(</a><a id="10634" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="10639" class="Symbol">(</a><a id="10640" href="/20.07/Untyped/#4382" class="InductiveConstructor Operator">ƛ</a> <a id="10642" href="/20.07/Adequacy/#10561" class="Bound">N</a><a id="10643" class="Symbol">)</a> <a id="10645" href="/20.07/Adequacy/#10545" class="Bound">γ'</a><a id="10647" class="Symbol">)</a>
|
||
<a id="10649" href="/20.07/Adequacy/#10511" class="Function">not-above-fun-𝕍</a> <a id="10665" class="Symbol">{</a><a id="10666" href="/20.07/Denotational/#4171" class="InductiveConstructor">⊥</a><a id="10667" class="Symbol">}</a> <a id="10669" href="/20.07/Adequacy/#10669" class="Bound">af</a> <a id="10672" class="Symbol">=</a> <a id="10674" href="Agda.Builtin.Unit.html#174" class="InductiveConstructor">tt</a>
|
||
<a id="10677" href="/20.07/Adequacy/#10511" class="Function">not-above-fun-𝕍</a> <a id="10693" class="Symbol">{</a><a id="10694" href="/20.07/Adequacy/#10694" class="Bound">v</a> <a id="10696" href="/20.07/Denotational/#4183" class="InductiveConstructor Operator">↦</a> <a id="10698" href="/20.07/Adequacy/#10698" class="Bound">v'</a><a id="10700" class="Symbol">}</a> <a id="10702" href="/20.07/Adequacy/#10702" class="Bound">af</a> <a id="10705" class="Symbol">=</a> <a id="10707" href="https://agda.github.io/agda-stdlib/v1.1/Data.Empty.html#294" class="Function">⊥-elim</a> <a id="10714" class="Symbol">(</a><a id="10715" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.Negation.html#809" class="Function">contradiction</a> <a id="10729" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="10731" href="/20.07/Adequacy/#10694" class="Bound">v</a> <a id="10733" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="10735" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="10737" href="/20.07/Adequacy/#10698" class="Bound">v'</a> <a id="10740" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="10742" href="/20.07/Denotational/#5638" class="Function">⊑-refl</a> <a id="10749" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="10751" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="10753" href="/20.07/Adequacy/#10702" class="Bound">af</a><a id="10755" class="Symbol">)</a>
|
||
<a id="10757" href="/20.07/Adequacy/#10511" class="Function">not-above-fun-𝕍</a> <a id="10773" class="Symbol">{</a><a id="10774" href="/20.07/Adequacy/#10774" class="Bound">v₁</a> <a id="10777" href="/20.07/Denotational/#4213" class="InductiveConstructor Operator">⊔</a> <a id="10779" href="/20.07/Adequacy/#10779" class="Bound">v₂</a><a id="10781" class="Symbol">}</a> <a id="10783" href="/20.07/Adequacy/#10783" class="Bound">af</a>
|
||
<a id="10790" class="Keyword">with</a> <a id="10795" href="/20.07/Adequacy/#5795" class="Function">not-above-fun-⊔-inv</a> <a id="10815" href="/20.07/Adequacy/#10783" class="Bound">af</a>
|
||
<a id="10818" class="Symbol">...</a> <a id="10822" class="Symbol">|</a> <a id="10824" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="10826" href="/20.07/Adequacy/#10826" class="Bound">af1</a> <a id="10830" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="10832" href="/20.07/Adequacy/#10832" class="Bound">af2</a> <a id="10836" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="10838" class="Symbol">=</a> <a id="10840" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="10842" href="/20.07/Adequacy/#10511" class="Function">not-above-fun-𝕍</a> <a id="10858" href="/20.07/Adequacy/#10826" class="Bound">af1</a> <a id="10862" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="10864" href="/20.07/Adequacy/#10511" class="Function">not-above-fun-𝕍</a> <a id="10880" href="/20.07/Adequacy/#10832" class="Bound">af2</a> <a id="10884" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
</pre>
|
||
<p>The proofs of <code class="language-plaintext highlighter-rouge">𝕍-sub</code> and <code class="language-plaintext highlighter-rouge">𝔼-sub</code> are intertwined.</p>
|
||
|
||
<pre class="Agda"><a id="sub-𝕍"></a><a id="10947" href="/20.07/Adequacy/#10947" class="Function">sub-𝕍</a> <a id="10953" class="Symbol">:</a> <a id="10955" class="Symbol">∀{</a><a id="10957" href="/20.07/Adequacy/#10957" class="Bound">c</a> <a id="10959" class="Symbol">:</a> <a id="10961" href="/20.07/BigStep/#2467" class="Datatype">Clos</a><a id="10965" class="Symbol">}{</a><a id="10967" href="/20.07/Adequacy/#10967" class="Bound">v</a> <a id="10969" href="/20.07/Adequacy/#10969" class="Bound">v'</a><a id="10971" class="Symbol">}</a> <a id="10973" class="Symbol">→</a> <a id="10975" href="/20.07/Adequacy/#7244" class="Function">𝕍</a> <a id="10977" href="/20.07/Adequacy/#10967" class="Bound">v</a> <a id="10979" href="/20.07/Adequacy/#10957" class="Bound">c</a> <a id="10981" class="Symbol">→</a> <a id="10983" href="/20.07/Adequacy/#10969" class="Bound">v'</a> <a id="10986" href="/20.07/Denotational/#4508" class="Datatype Operator">⊑</a> <a id="10988" href="/20.07/Adequacy/#10967" class="Bound">v</a> <a id="10990" class="Symbol">→</a> <a id="10992" href="/20.07/Adequacy/#7244" class="Function">𝕍</a> <a id="10994" href="/20.07/Adequacy/#10969" class="Bound">v'</a> <a id="10997" href="/20.07/Adequacy/#10957" class="Bound">c</a>
|
||
<a id="sub-𝔼"></a><a id="10999" href="/20.07/Adequacy/#10999" class="Function">sub-𝔼</a> <a id="11005" class="Symbol">:</a> <a id="11007" class="Symbol">∀{</a><a id="11009" href="/20.07/Adequacy/#11009" class="Bound">c</a> <a id="11011" class="Symbol">:</a> <a id="11013" href="/20.07/BigStep/#2467" class="Datatype">Clos</a><a id="11017" class="Symbol">}{</a><a id="11019" href="/20.07/Adequacy/#11019" class="Bound">v</a> <a id="11021" href="/20.07/Adequacy/#11021" class="Bound">v'</a><a id="11023" class="Symbol">}</a> <a id="11025" class="Symbol">→</a> <a id="11027" href="/20.07/Adequacy/#7267" class="Function">𝔼</a> <a id="11029" href="/20.07/Adequacy/#11019" class="Bound">v</a> <a id="11031" href="/20.07/Adequacy/#11009" class="Bound">c</a> <a id="11033" class="Symbol">→</a> <a id="11035" href="/20.07/Adequacy/#11021" class="Bound">v'</a> <a id="11038" href="/20.07/Denotational/#4508" class="Datatype Operator">⊑</a> <a id="11040" href="/20.07/Adequacy/#11019" class="Bound">v</a> <a id="11042" class="Symbol">→</a> <a id="11044" href="/20.07/Adequacy/#7267" class="Function">𝔼</a> <a id="11046" href="/20.07/Adequacy/#11021" class="Bound">v'</a> <a id="11049" href="/20.07/Adequacy/#11009" class="Bound">c</a>
|
||
</pre>
|
||
<p>We prove <code class="language-plaintext highlighter-rouge">𝕍-sub</code> by case analysis on the closure’s term, to dispatch the
|
||
cases for variables and application. We then proceed by induction on
|
||
<code class="language-plaintext highlighter-rouge">v' ⊑ v</code>. We describe each case below.</p>
|
||
|
||
<pre class="Agda"><a id="11242" href="/20.07/Adequacy/#10947" class="Function">sub-𝕍</a> <a id="11248" class="Symbol">{</a><a id="11249" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="11254" class="Symbol">(</a><a id="11255" href="/20.07/Untyped/#4330" class="InductiveConstructor Operator">`</a> <a id="11257" href="/20.07/Adequacy/#11257" class="Bound">x</a><a id="11258" class="Symbol">)</a> <a id="11260" href="/20.07/Adequacy/#11260" class="Bound">γ</a><a id="11261" class="Symbol">}</a> <a id="11263" class="Symbol">{</a><a id="11264" href="/20.07/Adequacy/#11264" class="Bound">v</a><a id="11265" class="Symbol">}</a> <a id="11267" class="Symbol">()</a> <a id="11270" href="/20.07/Adequacy/#11270" class="Bound">lt</a>
|
||
<a id="11273" href="/20.07/Adequacy/#10947" class="Function">sub-𝕍</a> <a id="11279" class="Symbol">{</a><a id="11280" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="11285" class="Symbol">(</a><a id="11286" href="/20.07/Adequacy/#11286" class="Bound">L</a> <a id="11288" href="/20.07/Untyped/#4442" class="InductiveConstructor Operator">·</a> <a id="11290" href="/20.07/Adequacy/#11290" class="Bound">M</a><a id="11291" class="Symbol">)</a> <a id="11293" href="/20.07/Adequacy/#11293" class="Bound">γ</a><a id="11294" class="Symbol">}</a> <a id="11296" class="Symbol">()</a> <a id="11299" href="/20.07/Adequacy/#11299" class="Bound">lt</a>
|
||
<a id="11302" href="/20.07/Adequacy/#10947" class="Function">sub-𝕍</a> <a id="11308" class="Symbol">{</a><a id="11309" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="11314" class="Symbol">(</a><a id="11315" href="/20.07/Untyped/#4382" class="InductiveConstructor Operator">ƛ</a> <a id="11317" href="/20.07/Adequacy/#11317" class="Bound">N</a><a id="11318" class="Symbol">)</a> <a id="11320" href="/20.07/Adequacy/#11320" class="Bound">γ</a><a id="11321" class="Symbol">}</a> <a id="11323" href="/20.07/Adequacy/#11323" class="Bound">vc</a> <a id="11326" href="/20.07/Denotational/#4543" class="InductiveConstructor">⊑-bot</a> <a id="11332" class="Symbol">=</a> <a id="11334" href="Agda.Builtin.Unit.html#174" class="InductiveConstructor">tt</a>
|
||
<a id="11337" href="/20.07/Adequacy/#10947" class="Function">sub-𝕍</a> <a id="11343" class="Symbol">{</a><a id="11344" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="11349" class="Symbol">(</a><a id="11350" href="/20.07/Untyped/#4382" class="InductiveConstructor Operator">ƛ</a> <a id="11352" href="/20.07/Adequacy/#11352" class="Bound">N</a><a id="11353" class="Symbol">)</a> <a id="11355" href="/20.07/Adequacy/#11355" class="Bound">γ</a><a id="11356" class="Symbol">}</a> <a id="11358" href="/20.07/Adequacy/#11358" class="Bound">vc</a> <a id="11361" class="Symbol">(</a><a id="11362" href="/20.07/Denotational/#4568" class="InductiveConstructor">⊑-conj-L</a> <a id="11371" href="/20.07/Adequacy/#11371" class="Bound">lt1</a> <a id="11375" href="/20.07/Adequacy/#11375" class="Bound">lt2</a><a id="11378" class="Symbol">)</a> <a id="11380" class="Symbol">=</a> <a id="11382" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="11384" class="Symbol">(</a><a id="11385" href="/20.07/Adequacy/#10947" class="Function">sub-𝕍</a> <a id="11391" href="/20.07/Adequacy/#11358" class="Bound">vc</a> <a id="11394" href="/20.07/Adequacy/#11371" class="Bound">lt1</a><a id="11397" class="Symbol">)</a> <a id="11399" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="11401" href="/20.07/Adequacy/#10947" class="Function">sub-𝕍</a> <a id="11407" href="/20.07/Adequacy/#11358" class="Bound">vc</a> <a id="11410" href="/20.07/Adequacy/#11375" class="Bound">lt2</a> <a id="11414" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="11416" href="/20.07/Adequacy/#10947" class="Function">sub-𝕍</a> <a id="11422" class="Symbol">{</a><a id="11423" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="11428" class="Symbol">(</a><a id="11429" href="/20.07/Untyped/#4382" class="InductiveConstructor Operator">ƛ</a> <a id="11431" href="/20.07/Adequacy/#11431" class="Bound">N</a><a id="11432" class="Symbol">)</a> <a id="11434" href="/20.07/Adequacy/#11434" class="Bound">γ</a><a id="11435" class="Symbol">}</a> <a id="11437" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="11439" href="/20.07/Adequacy/#11439" class="Bound">vv1</a> <a id="11443" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="11445" href="/20.07/Adequacy/#11445" class="Bound">vv2</a> <a id="11449" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="11451" class="Symbol">(</a><a id="11452" href="/20.07/Denotational/#4652" class="InductiveConstructor">⊑-conj-R1</a> <a id="11462" href="/20.07/Adequacy/#11462" class="Bound">lt</a><a id="11464" class="Symbol">)</a> <a id="11466" class="Symbol">=</a> <a id="11468" href="/20.07/Adequacy/#10947" class="Function">sub-𝕍</a> <a id="11474" href="/20.07/Adequacy/#11439" class="Bound">vv1</a> <a id="11478" href="/20.07/Adequacy/#11462" class="Bound">lt</a>
|
||
<a id="11481" href="/20.07/Adequacy/#10947" class="Function">sub-𝕍</a> <a id="11487" class="Symbol">{</a><a id="11488" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="11493" class="Symbol">(</a><a id="11494" href="/20.07/Untyped/#4382" class="InductiveConstructor Operator">ƛ</a> <a id="11496" href="/20.07/Adequacy/#11496" class="Bound">N</a><a id="11497" class="Symbol">)</a> <a id="11499" href="/20.07/Adequacy/#11499" class="Bound">γ</a><a id="11500" class="Symbol">}</a> <a id="11502" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="11504" href="/20.07/Adequacy/#11504" class="Bound">vv1</a> <a id="11508" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="11510" href="/20.07/Adequacy/#11510" class="Bound">vv2</a> <a id="11514" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="11516" class="Symbol">(</a><a id="11517" href="/20.07/Denotational/#4725" class="InductiveConstructor">⊑-conj-R2</a> <a id="11527" href="/20.07/Adequacy/#11527" class="Bound">lt</a><a id="11529" class="Symbol">)</a> <a id="11531" class="Symbol">=</a> <a id="11533" href="/20.07/Adequacy/#10947" class="Function">sub-𝕍</a> <a id="11539" href="/20.07/Adequacy/#11510" class="Bound">vv2</a> <a id="11543" href="/20.07/Adequacy/#11527" class="Bound">lt</a>
|
||
<a id="11546" href="/20.07/Adequacy/#10947" class="Function">sub-𝕍</a> <a id="11552" class="Symbol">{</a><a id="11553" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="11558" class="Symbol">(</a><a id="11559" href="/20.07/Untyped/#4382" class="InductiveConstructor Operator">ƛ</a> <a id="11561" href="/20.07/Adequacy/#11561" class="Bound">N</a><a id="11562" class="Symbol">)</a> <a id="11564" href="/20.07/Adequacy/#11564" class="Bound">γ</a><a id="11565" class="Symbol">}</a> <a id="11567" href="/20.07/Adequacy/#11567" class="Bound">vc</a> <a id="11570" class="Symbol">(</a><a id="11571" href="/20.07/Denotational/#4798" class="InductiveConstructor">⊑-trans</a><a id="11578" class="Symbol">{</a><a id="11579" class="Argument">v</a> <a id="11581" class="Symbol">=</a> <a id="11583" href="/20.07/Adequacy/#11583" class="Bound">v₂</a><a id="11585" class="Symbol">}</a> <a id="11587" href="/20.07/Adequacy/#11587" class="Bound">lt1</a> <a id="11591" href="/20.07/Adequacy/#11591" class="Bound">lt2</a><a id="11594" class="Symbol">)</a> <a id="11596" class="Symbol">=</a> <a id="11598" href="/20.07/Adequacy/#10947" class="Function">sub-𝕍</a> <a id="11604" class="Symbol">(</a><a id="11605" href="/20.07/Adequacy/#10947" class="Function">sub-𝕍</a> <a id="11611" href="/20.07/Adequacy/#11567" class="Bound">vc</a> <a id="11614" href="/20.07/Adequacy/#11591" class="Bound">lt2</a><a id="11617" class="Symbol">)</a> <a id="11619" href="/20.07/Adequacy/#11587" class="Bound">lt1</a>
|
||
<a id="11623" href="/20.07/Adequacy/#10947" class="Function">sub-𝕍</a> <a id="11629" class="Symbol">{</a><a id="11630" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="11635" class="Symbol">(</a><a id="11636" href="/20.07/Untyped/#4382" class="InductiveConstructor Operator">ƛ</a> <a id="11638" href="/20.07/Adequacy/#11638" class="Bound">N</a><a id="11639" class="Symbol">)</a> <a id="11641" href="/20.07/Adequacy/#11641" class="Bound">γ</a><a id="11642" class="Symbol">}</a> <a id="11644" href="/20.07/Adequacy/#11644" class="Bound">vc</a> <a id="11647" class="Symbol">(</a><a id="11648" href="/20.07/Denotational/#4869" class="InductiveConstructor">⊑-fun</a> <a id="11654" href="/20.07/Adequacy/#11654" class="Bound">lt1</a> <a id="11658" href="/20.07/Adequacy/#11658" class="Bound">lt2</a><a id="11661" class="Symbol">)</a> <a id="11663" href="/20.07/Adequacy/#11663" class="Bound">ev1</a> <a id="11667" href="/20.07/Adequacy/#11667" class="Bound">sf</a>
|
||
<a id="11674" class="Keyword">with</a> <a id="11679" href="/20.07/Adequacy/#11644" class="Bound">vc</a> <a id="11682" class="Symbol">(</a><a id="11683" href="/20.07/Adequacy/#10999" class="Function">sub-𝔼</a> <a id="11689" href="/20.07/Adequacy/#11663" class="Bound">ev1</a> <a id="11693" href="/20.07/Adequacy/#11654" class="Bound">lt1</a><a id="11696" class="Symbol">)</a> <a id="11698" class="Symbol">(</a><a id="11699" href="/20.07/Adequacy/#4361" class="Function">above-fun-⊑</a> <a id="11711" href="/20.07/Adequacy/#11667" class="Bound">sf</a> <a id="11714" href="/20.07/Adequacy/#11658" class="Bound">lt2</a><a id="11717" class="Symbol">)</a>
|
||
<a id="11719" class="Symbol">...</a> <a id="11723" class="Symbol">|</a> <a id="11725" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="11727" href="/20.07/Adequacy/#11727" class="Bound">c</a> <a id="11729" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="11731" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="11733" href="/20.07/Adequacy/#11733" class="Bound">Nc</a> <a id="11736" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="11738" href="/20.07/Adequacy/#11738" class="Bound">v4</a> <a id="11741" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="11743" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="11745" class="Symbol">=</a> <a id="11747" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="11749" href="/20.07/Adequacy/#11727" class="Bound">c</a> <a id="11751" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="11753" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="11755" href="/20.07/Adequacy/#11733" class="Bound">Nc</a> <a id="11758" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="11760" href="/20.07/Adequacy/#10947" class="Function">sub-𝕍</a> <a id="11766" href="/20.07/Adequacy/#11738" class="Bound">v4</a> <a id="11769" class="Bound">lt2</a> <a id="11773" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="11775" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="11777" href="/20.07/Adequacy/#10947" class="Function">sub-𝕍</a> <a id="11783" class="Symbol">{</a><a id="11784" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="11789" class="Symbol">(</a><a id="11790" href="/20.07/Untyped/#4382" class="InductiveConstructor Operator">ƛ</a> <a id="11792" href="/20.07/Adequacy/#11792" class="Bound">N</a><a id="11793" class="Symbol">)</a> <a id="11795" href="/20.07/Adequacy/#11795" class="Bound">γ</a><a id="11796" class="Symbol">}</a> <a id="11798" class="Symbol">{</a><a id="11799" href="/20.07/Adequacy/#11799" class="Bound">v</a> <a id="11801" href="/20.07/Denotational/#4183" class="InductiveConstructor Operator">↦</a> <a id="11803" href="/20.07/Adequacy/#11803" class="Bound">w</a> <a id="11805" href="/20.07/Denotational/#4213" class="InductiveConstructor Operator">⊔</a> <a id="11807" href="/20.07/Adequacy/#11799" class="Bound">v</a> <a id="11809" href="/20.07/Denotational/#4183" class="InductiveConstructor Operator">↦</a> <a id="11811" href="/20.07/Adequacy/#11811" class="Bound">w'</a><a id="11813" class="Symbol">}</a> <a id="11815" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="11817" href="/20.07/Adequacy/#11817" class="Bound">vcw</a> <a id="11821" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="11823" href="/20.07/Adequacy/#11823" class="Bound">vcw'</a> <a id="11828" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="11830" href="/20.07/Denotational/#4972" class="InductiveConstructor">⊑-dist</a> <a id="11837" href="/20.07/Adequacy/#11837" class="Bound">ev1c</a> <a id="11842" href="/20.07/Adequacy/#11842" class="Bound">sf</a>
|
||
<a id="11849" class="Keyword">with</a> <a id="11854" href="/20.07/Adequacy/#6385" class="Function">above-fun?</a> <a id="11865" href="/20.07/Adequacy/#11803" class="Bound">w</a> <a id="11867" class="Symbol">|</a> <a id="11869" href="/20.07/Adequacy/#6385" class="Function">above-fun?</a> <a id="11880" href="/20.07/Adequacy/#11811" class="Bound">w'</a>
|
||
<a id="11883" class="Symbol">...</a> <a id="11887" class="Symbol">|</a> <a id="11889" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="11893" href="/20.07/Adequacy/#11893" class="Bound">af2</a> <a id="11897" class="Symbol">|</a> <a id="11899" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="11903" href="/20.07/Adequacy/#11903" class="Bound">af3</a>
|
||
<a id="11911" class="Keyword">with</a> <a id="11916" class="Bound">vcw</a> <a id="11920" class="Bound">ev1c</a> <a id="11925" href="/20.07/Adequacy/#11893" class="Bound">af2</a> <a id="11929" class="Symbol">|</a> <a id="11931" class="Bound">vcw'</a> <a id="11936" class="Bound">ev1c</a> <a id="11941" href="/20.07/Adequacy/#11903" class="Bound">af3</a>
|
||
<a id="11945" class="Symbol">...</a> <a id="11949" class="Symbol">|</a> <a id="11951" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="11953" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="11958" href="/20.07/Adequacy/#11958" class="Bound">L</a> <a id="11960" href="/20.07/Adequacy/#11960" class="Bound">δ</a> <a id="11962" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="11964" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="11966" href="/20.07/Adequacy/#11966" class="Bound">L⇓c₂</a> <a id="11971" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="11973" href="/20.07/Adequacy/#11973" class="Bound">𝕍w</a> <a id="11976" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="11978" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="11984" class="Symbol">|</a> <a id="11986" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="11988" href="/20.07/Adequacy/#11988" class="Bound">c₃</a> <a id="11991" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="11993" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="11995" href="/20.07/Adequacy/#11995" class="Bound">L⇓c₃</a> <a id="12000" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="12002" href="/20.07/Adequacy/#12002" class="Bound">𝕍w'</a> <a id="12006" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="12008" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="12010" class="Keyword">rewrite</a> <a id="12018" href="/20.07/BigStep/#4586" class="Function">⇓-determ</a> <a id="12027" href="/20.07/Adequacy/#11995" class="Bound">L⇓c₃</a> <a id="12032" href="/20.07/Adequacy/#11966" class="Bound">L⇓c₂</a> <a id="12037" class="Keyword">with</a> <a id="12042" href="/20.07/Adequacy/#9549" class="Function">𝕍→WHNF</a> <a id="12049" href="/20.07/Adequacy/#11973" class="Bound">𝕍w</a>
|
||
<a id="12052" class="Symbol">...</a> <a id="12056" class="Symbol">|</a> <a id="12058" href="/20.07/Adequacy/#9442" class="InductiveConstructor Operator">ƛ_</a> <a id="12061" class="Symbol">=</a>
|
||
<a id="12069" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="12071" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="12076" class="Bound">L</a> <a id="12078" class="Bound">δ</a> <a id="12080" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="12082" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="12084" class="Bound">L⇓c₂</a> <a id="12089" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="12091" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="12093" class="Bound">𝕍w</a> <a id="12096" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="12098" class="Bound">𝕍w'</a> <a id="12102" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="12104" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="12106" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="12108" href="/20.07/Adequacy/#10947" class="Function">sub-𝕍</a> <a id="12114" class="Symbol">{</a><a id="12115" href="/20.07/Adequacy/#12115" class="Bound">c</a><a id="12116" class="Symbol">}</a> <a id="12118" class="Symbol">{</a><a id="12119" href="/20.07/Adequacy/#12119" class="Bound">v</a> <a id="12121" href="/20.07/Denotational/#4183" class="InductiveConstructor Operator">↦</a> <a id="12123" href="/20.07/Adequacy/#12123" class="Bound">w</a> <a id="12125" href="/20.07/Denotational/#4213" class="InductiveConstructor Operator">⊔</a> <a id="12127" href="/20.07/Adequacy/#12119" class="Bound">v</a> <a id="12129" href="/20.07/Denotational/#4183" class="InductiveConstructor Operator">↦</a> <a id="12131" href="/20.07/Adequacy/#12131" class="Bound">w'</a><a id="12133" class="Symbol">}</a> <a id="12135" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="12137" href="/20.07/Adequacy/#12137" class="Bound">vcw</a> <a id="12141" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="12143" href="/20.07/Adequacy/#12143" class="Bound">vcw'</a> <a id="12148" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="12151" href="/20.07/Denotational/#4972" class="InductiveConstructor">⊑-dist</a> <a id="12158" href="/20.07/Adequacy/#12158" class="Bound">ev1c</a> <a id="12163" href="/20.07/Adequacy/#12163" class="Bound">sf</a>
|
||
<a id="12170" class="Symbol">|</a> <a id="12172" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="12176" href="/20.07/Adequacy/#12176" class="Bound">af2</a> <a id="12180" class="Symbol">|</a> <a id="12182" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="12185" href="/20.07/Adequacy/#12185" class="Bound">naf3</a>
|
||
<a id="12194" class="Keyword">with</a> <a id="12199" href="/20.07/Adequacy/#12137" class="Bound">vcw</a> <a id="12203" href="/20.07/Adequacy/#12158" class="Bound">ev1c</a> <a id="12208" href="/20.07/Adequacy/#12176" class="Bound">af2</a>
|
||
<a id="12212" class="Symbol">...</a> <a id="12216" class="Symbol">|</a> <a id="12218" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="12220" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="12225" class="Symbol">{</a><a id="12226" href="/20.07/Adequacy/#12226" class="Bound">Γ'</a><a id="12228" class="Symbol">}</a> <a id="12230" href="/20.07/Adequacy/#12230" class="Bound">L</a> <a id="12232" href="/20.07/Adequacy/#12232" class="Bound">γ₁</a> <a id="12235" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="12237" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="12239" href="/20.07/Adequacy/#12239" class="Bound">L⇓c2</a> <a id="12244" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="12246" href="/20.07/Adequacy/#12246" class="Bound">𝕍w</a> <a id="12249" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="12251" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="12257" class="Keyword">with</a> <a id="12262" href="/20.07/Adequacy/#9549" class="Function">𝕍→WHNF</a> <a id="12269" href="/20.07/Adequacy/#12246" class="Bound">𝕍w</a>
|
||
<a id="12272" class="Symbol">...</a> <a id="12276" class="Symbol">|</a> <a id="12278" href="/20.07/Adequacy/#9442" class="InductiveConstructor Operator">ƛ_</a> <a id="12281" class="Symbol">{</a><a id="12282" class="Argument">N</a> <a id="12284" class="Symbol">=</a> <a id="12286" href="/20.07/Adequacy/#12286" class="Bound">N'</a><a id="12288" class="Symbol">}</a> <a id="12290" class="Symbol">=</a>
|
||
<a id="12298" class="Keyword">let</a> <a id="12302" href="/20.07/Adequacy/#12302" class="Bound">𝕍w'</a> <a id="12306" class="Symbol">=</a> <a id="12308" href="/20.07/Adequacy/#10511" class="Function">not-above-fun-𝕍</a><a id="12323" class="Symbol">{</a><a id="12324" class="Bound">w'</a><a id="12326" class="Symbol">}{</a><a id="12328" class="Bound">Γ'</a><a id="12330" class="Symbol">}{</a><a id="12332" class="Bound">γ₁</a><a id="12334" class="Symbol">}{</a><a id="12336" href="/20.07/Adequacy/#12286" class="Bound">N'</a><a id="12338" class="Symbol">}</a> <a id="12340" class="Bound">naf3</a> <a id="12345" class="Keyword">in</a>
|
||
<a id="12354" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="12356" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="12361" class="Symbol">(</a><a id="12362" href="/20.07/Untyped/#4382" class="InductiveConstructor Operator">ƛ</a> <a id="12364" href="/20.07/Adequacy/#12286" class="Bound">N'</a><a id="12366" class="Symbol">)</a> <a id="12368" class="Bound">γ₁</a> <a id="12371" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="12373" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="12375" class="Bound">L⇓c2</a> <a id="12380" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="12382" href="/20.07/Adequacy/#9862" class="Function">𝕍⊔-intro</a> <a id="12391" class="Bound">𝕍w</a> <a id="12394" href="/20.07/Adequacy/#12302" class="Bound">𝕍w'</a> <a id="12398" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="12400" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="12402" href="/20.07/Adequacy/#10947" class="Function">sub-𝕍</a> <a id="12408" class="Symbol">{</a><a id="12409" href="/20.07/Adequacy/#12409" class="Bound">c</a><a id="12410" class="Symbol">}</a> <a id="12412" class="Symbol">{</a><a id="12413" href="/20.07/Adequacy/#12413" class="Bound">v</a> <a id="12415" href="/20.07/Denotational/#4183" class="InductiveConstructor Operator">↦</a> <a id="12417" href="/20.07/Adequacy/#12417" class="Bound">w</a> <a id="12419" href="/20.07/Denotational/#4213" class="InductiveConstructor Operator">⊔</a> <a id="12421" href="/20.07/Adequacy/#12413" class="Bound">v</a> <a id="12423" href="/20.07/Denotational/#4183" class="InductiveConstructor Operator">↦</a> <a id="12425" href="/20.07/Adequacy/#12425" class="Bound">w'</a><a id="12427" class="Symbol">}</a> <a id="12429" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="12431" href="/20.07/Adequacy/#12431" class="Bound">vcw</a> <a id="12435" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="12437" href="/20.07/Adequacy/#12437" class="Bound">vcw'</a> <a id="12442" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="12444" href="/20.07/Denotational/#4972" class="InductiveConstructor">⊑-dist</a> <a id="12451" href="/20.07/Adequacy/#12451" class="Bound">ev1c</a> <a id="12456" href="/20.07/Adequacy/#12456" class="Bound">sf</a>
|
||
<a id="12463" class="Symbol">|</a> <a id="12465" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="12468" href="/20.07/Adequacy/#12468" class="Bound">naf2</a> <a id="12473" class="Symbol">|</a> <a id="12475" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="12479" href="/20.07/Adequacy/#12479" class="Bound">af3</a>
|
||
<a id="12487" class="Keyword">with</a> <a id="12492" href="/20.07/Adequacy/#12437" class="Bound">vcw'</a> <a id="12497" href="/20.07/Adequacy/#12451" class="Bound">ev1c</a> <a id="12502" href="/20.07/Adequacy/#12479" class="Bound">af3</a>
|
||
<a id="12506" class="Symbol">...</a> <a id="12510" class="Symbol">|</a> <a id="12512" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="12514" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="12519" class="Symbol">{</a><a id="12520" href="/20.07/Adequacy/#12520" class="Bound">Γ'</a><a id="12522" class="Symbol">}</a> <a id="12524" href="/20.07/Adequacy/#12524" class="Bound">L</a> <a id="12526" href="/20.07/Adequacy/#12526" class="Bound">γ₁</a> <a id="12529" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="12531" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="12533" href="/20.07/Adequacy/#12533" class="Bound">L⇓c3</a> <a id="12538" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="12540" href="/20.07/Adequacy/#12540" class="Bound">𝕍w'c</a> <a id="12545" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="12547" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="12553" class="Keyword">with</a> <a id="12558" href="/20.07/Adequacy/#9549" class="Function">𝕍→WHNF</a> <a id="12565" href="/20.07/Adequacy/#12540" class="Bound">𝕍w'c</a>
|
||
<a id="12570" class="Symbol">...</a> <a id="12574" class="Symbol">|</a> <a id="12576" href="/20.07/Adequacy/#9442" class="InductiveConstructor Operator">ƛ_</a> <a id="12579" class="Symbol">{</a><a id="12580" class="Argument">N</a> <a id="12582" class="Symbol">=</a> <a id="12584" href="/20.07/Adequacy/#12584" class="Bound">N'</a><a id="12586" class="Symbol">}</a> <a id="12588" class="Symbol">=</a>
|
||
<a id="12596" class="Keyword">let</a> <a id="12600" href="/20.07/Adequacy/#12600" class="Bound">𝕍wc</a> <a id="12604" class="Symbol">=</a> <a id="12606" href="/20.07/Adequacy/#10511" class="Function">not-above-fun-𝕍</a><a id="12621" class="Symbol">{</a><a id="12622" class="Bound">w</a><a id="12623" class="Symbol">}{</a><a id="12625" class="Bound">Γ'</a><a id="12627" class="Symbol">}{</a><a id="12629" class="Bound">γ₁</a><a id="12631" class="Symbol">}{</a><a id="12633" href="/20.07/Adequacy/#12584" class="Bound">N'</a><a id="12635" class="Symbol">}</a> <a id="12637" class="Bound">naf2</a> <a id="12642" class="Keyword">in</a>
|
||
<a id="12651" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="12653" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="12658" class="Symbol">(</a><a id="12659" href="/20.07/Untyped/#4382" class="InductiveConstructor Operator">ƛ</a> <a id="12661" href="/20.07/Adequacy/#12584" class="Bound">N'</a><a id="12663" class="Symbol">)</a> <a id="12665" class="Bound">γ₁</a> <a id="12668" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="12670" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="12672" class="Bound">L⇓c3</a> <a id="12677" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="12679" href="/20.07/Adequacy/#9862" class="Function">𝕍⊔-intro</a> <a id="12688" href="/20.07/Adequacy/#12600" class="Bound">𝕍wc</a> <a id="12692" class="Bound">𝕍w'c</a> <a id="12697" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="12699" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="12701" href="/20.07/Adequacy/#10947" class="Function">sub-𝕍</a> <a id="12707" class="Symbol">{</a><a id="12708" href="/20.07/Adequacy/#12708" class="Bound">c</a><a id="12709" class="Symbol">}</a> <a id="12711" class="Symbol">{</a><a id="12712" href="/20.07/Adequacy/#12712" class="Bound">v</a> <a id="12714" href="/20.07/Denotational/#4183" class="InductiveConstructor Operator">↦</a> <a id="12716" href="/20.07/Adequacy/#12716" class="Bound">w</a> <a id="12718" href="/20.07/Denotational/#4213" class="InductiveConstructor Operator">⊔</a> <a id="12720" href="/20.07/Adequacy/#12712" class="Bound">v</a> <a id="12722" href="/20.07/Denotational/#4183" class="InductiveConstructor Operator">↦</a> <a id="12724" href="/20.07/Adequacy/#12724" class="Bound">w'</a><a id="12726" class="Symbol">}</a> <a id="12728" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="12730" href="/20.07/Adequacy/#12730" class="Bound">vcw</a> <a id="12734" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="12736" href="/20.07/Adequacy/#12736" class="Bound">vcw'</a> <a id="12741" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="12743" href="/20.07/Denotational/#4972" class="InductiveConstructor">⊑-dist</a> <a id="12750" href="/20.07/Adequacy/#12750" class="Bound">ev1c</a> <a id="12755" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="12757" href="/20.07/Adequacy/#12757" class="Bound">v'</a> <a id="12760" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="12762" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="12764" href="/20.07/Adequacy/#12764" class="Bound">w''</a> <a id="12768" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="12770" href="/20.07/Adequacy/#12770" class="Bound">lt</a> <a id="12773" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="12775" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="12781" class="Symbol">|</a> <a id="12783" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="12786" href="/20.07/Adequacy/#12786" class="Bound">naf2</a> <a id="12791" class="Symbol">|</a> <a id="12793" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="12796" href="/20.07/Adequacy/#12796" class="Bound">naf3</a>
|
||
<a id="12805" class="Keyword">with</a> <a id="12810" href="/20.07/Adequacy/#4907" class="Function">above-fun-⊔</a> <a id="12822" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="12824" href="/20.07/Adequacy/#12757" class="Bound">v'</a> <a id="12827" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="12829" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="12831" href="/20.07/Adequacy/#12764" class="Bound">w''</a> <a id="12835" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="12837" href="/20.07/Adequacy/#12770" class="Bound">lt</a> <a id="12840" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="12842" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="12844" class="Symbol">...</a> <a id="12848" class="Symbol">|</a> <a id="12850" href="https://agda.github.io/agda-stdlib/v1.1/Data.Sum.Base.html#662" class="InductiveConstructor">inj₁</a> <a id="12855" href="/20.07/Adequacy/#12855" class="Bound">af2</a> <a id="12859" class="Symbol">=</a> <a id="12861" href="https://agda.github.io/agda-stdlib/v1.1/Data.Empty.html#294" class="Function">⊥-elim</a> <a id="12868" class="Symbol">(</a><a id="12869" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.Negation.html#809" class="Function">contradiction</a> <a id="12883" href="/20.07/Adequacy/#12855" class="Bound">af2</a> <a id="12887" class="Bound">naf2</a><a id="12891" class="Symbol">)</a>
|
||
<a id="12893" class="Symbol">...</a> <a id="12897" class="Symbol">|</a> <a id="12899" href="https://agda.github.io/agda-stdlib/v1.1/Data.Sum.Base.html#687" class="InductiveConstructor">inj₂</a> <a id="12904" href="/20.07/Adequacy/#12904" class="Bound">af3</a> <a id="12908" class="Symbol">=</a> <a id="12910" href="https://agda.github.io/agda-stdlib/v1.1/Data.Empty.html#294" class="Function">⊥-elim</a> <a id="12917" class="Symbol">(</a><a id="12918" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.Negation.html#809" class="Function">contradiction</a> <a id="12932" href="/20.07/Adequacy/#12904" class="Bound">af3</a> <a id="12936" class="Bound">naf3</a><a id="12940" class="Symbol">)</a>
|
||
</pre>
|
||
<ul>
|
||
<li>
|
||
<p>Case <code class="language-plaintext highlighter-rouge">⊑-bot</code>. We immediately have <code class="language-plaintext highlighter-rouge">𝕍 ⊥ (clos (ƛ N) γ)</code>.</p>
|
||
</li>
|
||
<li>
|
||
<p>Case <code class="language-plaintext highlighter-rouge">⊑-conj-L</code>.</p>
|
||
|
||
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> v₁' ⊑ v v₂' ⊑ v
|
||
-------------------
|
||
(v₁' ⊔ v₂') ⊑ v
|
||
</code></pre></div> </div>
|
||
|
||
<p>The induction hypotheses gives us <code class="language-plaintext highlighter-rouge">𝕍 v₁' (clos (ƛ N) γ)</code>
|
||
and <code class="language-plaintext highlighter-rouge">𝕍 v₂' (clos (ƛ N) γ)</code>, which is all we need for this case.</p>
|
||
</li>
|
||
<li>
|
||
<p>Case <code class="language-plaintext highlighter-rouge">⊑-conj-R1</code>.</p>
|
||
|
||
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> v' ⊑ v₁
|
||
-------------
|
||
v' ⊑ (v₁ ⊔ v₂)
|
||
</code></pre></div> </div>
|
||
|
||
<p>The induction hypothesis gives us <code class="language-plaintext highlighter-rouge">𝕍 v' (clos (ƛ N) γ)</code>.</p>
|
||
</li>
|
||
<li>
|
||
<p>Case <code class="language-plaintext highlighter-rouge">⊑-conj-R2</code>.</p>
|
||
|
||
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> v' ⊑ v₂
|
||
-------------
|
||
v' ⊑ (v₁ ⊔ v₂)
|
||
</code></pre></div> </div>
|
||
|
||
<p>Again, the induction hypothesis gives us <code class="language-plaintext highlighter-rouge">𝕍 v' (clos (ƛ N) γ)</code>.</p>
|
||
</li>
|
||
<li>
|
||
<p>Case <code class="language-plaintext highlighter-rouge">⊑-trans</code>.</p>
|
||
|
||
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> v' ⊑ v₂ v₂ ⊑ v
|
||
-----------------
|
||
v' ⊑ v
|
||
</code></pre></div> </div>
|
||
|
||
<p>The induction hypothesis for <code class="language-plaintext highlighter-rouge">v₂ ⊑ v</code> gives us
|
||
<code class="language-plaintext highlighter-rouge">𝕍 v₂ (clos (ƛ N) γ)</code>. We apply the induction hypothesis
|
||
for <code class="language-plaintext highlighter-rouge">v' ⊑ v₂</code> to conclude that <code class="language-plaintext highlighter-rouge">𝕍 v' (clos (ƛ N) γ)</code>.</p>
|
||
</li>
|
||
<li>
|
||
<p>Case <code class="language-plaintext highlighter-rouge">⊑-dist</code>. This case is the most difficult. We have</p>
|
||
|
||
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> 𝕍 (v ↦ w) (clos (ƛ N) γ)
|
||
𝕍 (v ↦ w') (clos (ƛ N) γ)
|
||
</code></pre></div> </div>
|
||
|
||
<p>and need to show that</p>
|
||
|
||
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> 𝕍 (v ↦ (w ⊔ w')) (clos (ƛ N) γ)
|
||
</code></pre></div> </div>
|
||
|
||
<p>Let <code class="language-plaintext highlighter-rouge">c</code> be an arbtrary closure such that <code class="language-plaintext highlighter-rouge">𝔼 v c</code>.
|
||
Assume <code class="language-plaintext highlighter-rouge">w ⊔ w'</code> is greater than a function.
|
||
Unfortunately, this does not mean that both <code class="language-plaintext highlighter-rouge">w</code> and <code class="language-plaintext highlighter-rouge">w'</code>
|
||
are above functions. But thanks to the lemma <code class="language-plaintext highlighter-rouge">above-fun-⊔</code>,
|
||
we know that at least one of them is greater than a function.</p>
|
||
|
||
<ul>
|
||
<li>
|
||
<p>Suppose both of them are greater than a function. Then we have
|
||
<code class="language-plaintext highlighter-rouge">γ ⊢ N ⇓ clos L δ</code> and <code class="language-plaintext highlighter-rouge">𝕍 w (clos L δ)</code>. We also have <code class="language-plaintext highlighter-rouge">γ ⊢ N ⇓ c₃</code> and
|
||
<code class="language-plaintext highlighter-rouge">𝕍 w' c₃</code>. Because the big-step semantics is deterministic, we have
|
||
<code class="language-plaintext highlighter-rouge">c₃ ≡ clos L δ</code>. Also, from <code class="language-plaintext highlighter-rouge">𝕍 w (clos L δ)</code> we know that <code class="language-plaintext highlighter-rouge">L ≡ ƛ N'</code>
|
||
for some <code class="language-plaintext highlighter-rouge">N'</code>. We conclude that <code class="language-plaintext highlighter-rouge">𝕍 (w ⊔ w') (clos (ƛ N') δ)</code>.</p>
|
||
</li>
|
||
<li>
|
||
<p>Suppose one of them is greater than a function and the other is
|
||
not: say <code class="language-plaintext highlighter-rouge">above-fun w</code> and <code class="language-plaintext highlighter-rouge">¬ above-fun w'</code>. Then from
|
||
<code class="language-plaintext highlighter-rouge">𝕍 (v ↦ w) (clos (ƛ N) γ)</code>
|
||
we have <code class="language-plaintext highlighter-rouge">γ ⊢ N ⇓ clos L γ₁</code> and <code class="language-plaintext highlighter-rouge">𝕍 w (clos L γ₁)</code>. From this we have
|
||
<code class="language-plaintext highlighter-rouge">L ≡ ƛ N'</code> for some <code class="language-plaintext highlighter-rouge">N'</code>. Meanwhile, from <code class="language-plaintext highlighter-rouge">¬ above-fun w'</code> we have
|
||
<code class="language-plaintext highlighter-rouge">𝕍 w' (clos L γ₁)</code>. We conclude that
|
||
<code class="language-plaintext highlighter-rouge">𝕍 (w ⊔ w') (clos (ƛ N') γ₁)</code>.</p>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
|
||
<p>The proof of <code class="language-plaintext highlighter-rouge">sub-𝔼</code> is direct and explained below.</p>
|
||
|
||
<pre class="Agda"><a id="15054" href="/20.07/Adequacy/#10999" class="Function">sub-𝔼</a> <a id="15060" class="Symbol">{</a><a id="15061" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="15066" href="/20.07/Adequacy/#15066" class="Bound">M</a> <a id="15068" href="/20.07/Adequacy/#15068" class="Bound">γ</a><a id="15069" class="Symbol">}</a> <a id="15071" class="Symbol">{</a><a id="15072" href="/20.07/Adequacy/#15072" class="Bound">v</a><a id="15073" class="Symbol">}</a> <a id="15075" class="Symbol">{</a><a id="15076" href="/20.07/Adequacy/#15076" class="Bound">v'</a><a id="15078" class="Symbol">}</a> <a id="15080" href="/20.07/Adequacy/#15080" class="Bound">𝔼v</a> <a id="15083" href="/20.07/Adequacy/#15083" class="Bound">v'⊑v</a> <a id="15088" href="/20.07/Adequacy/#15088" class="Bound">fv'</a>
|
||
<a id="15096" class="Keyword">with</a> <a id="15101" href="/20.07/Adequacy/#15080" class="Bound">𝔼v</a> <a id="15104" class="Symbol">(</a><a id="15105" href="/20.07/Adequacy/#4361" class="Function">above-fun-⊑</a> <a id="15117" href="/20.07/Adequacy/#15088" class="Bound">fv'</a> <a id="15121" href="/20.07/Adequacy/#15083" class="Bound">v'⊑v</a><a id="15125" class="Symbol">)</a>
|
||
<a id="15127" class="Symbol">...</a> <a id="15131" class="Symbol">|</a> <a id="15133" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="15135" href="/20.07/Adequacy/#15135" class="Bound">c</a> <a id="15137" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="15139" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="15141" href="/20.07/Adequacy/#15141" class="Bound">M⇓c</a> <a id="15145" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="15147" href="/20.07/Adequacy/#15147" class="Bound">𝕍v</a> <a id="15150" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="15152" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="15154" class="Symbol">=</a>
|
||
<a id="15162" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="15164" href="/20.07/Adequacy/#15135" class="Bound">c</a> <a id="15166" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="15168" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="15170" href="/20.07/Adequacy/#15141" class="Bound">M⇓c</a> <a id="15174" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="15176" href="/20.07/Adequacy/#10947" class="Function">sub-𝕍</a> <a id="15182" href="/20.07/Adequacy/#15147" class="Bound">𝕍v</a> <a id="15185" class="Bound">v'⊑v</a> <a id="15190" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="15192" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
</pre>
|
||
<p>From <code class="language-plaintext highlighter-rouge">above-fun v'</code> and <code class="language-plaintext highlighter-rouge">v' ⊑ v</code> we have <code class="language-plaintext highlighter-rouge">above-fun v</code>. Then with <code class="language-plaintext highlighter-rouge">𝔼 v c</code> we
|
||
obtain a closure <code class="language-plaintext highlighter-rouge">c</code> such that <code class="language-plaintext highlighter-rouge">γ ⊢ M ⇓ c</code> and <code class="language-plaintext highlighter-rouge">𝕍 v c</code>. We conclude with an
|
||
application of <code class="language-plaintext highlighter-rouge">sub-𝕍</code> with <code class="language-plaintext highlighter-rouge">v' ⊑ v</code> to show <code class="language-plaintext highlighter-rouge">𝕍 v' c</code>.</p>
|
||
|
||
<h2 id="programs-with-function-denotation-terminate-via-call-by-name">Programs with function denotation terminate via call-by-name</h2>
|
||
|
||
<p>The main lemma proves that if a term has a denotation that is above a
|
||
function, then it terminates via call-by-name. More formally, if
|
||
<code class="language-plaintext highlighter-rouge">γ ⊢ M ↓ v</code> and <code class="language-plaintext highlighter-rouge">𝔾 γ γ'</code>, then <code class="language-plaintext highlighter-rouge">𝔼 v (clos M γ')</code>. The proof is by
|
||
induction on the derivation of <code class="language-plaintext highlighter-rouge">γ ⊢ M ↓ v</code> we discuss each case below.</p>
|
||
|
||
<p>The following lemma, kth-x, is used in the case for the <code class="language-plaintext highlighter-rouge">var</code> rule.</p>
|
||
|
||
<pre class="Agda"><a id="kth-x"></a><a id="15821" href="/20.07/Adequacy/#15821" class="Function">kth-x</a> <a id="15827" class="Symbol">:</a> <a id="15829" class="Symbol">∀{</a><a id="15831" href="/20.07/Adequacy/#15831" class="Bound">Γ</a><a id="15832" class="Symbol">}{</a><a id="15834" href="/20.07/Adequacy/#15834" class="Bound">γ'</a> <a id="15837" class="Symbol">:</a> <a id="15839" href="/20.07/BigStep/#2437" class="Function">ClosEnv</a> <a id="15847" href="/20.07/Adequacy/#15831" class="Bound">Γ</a><a id="15848" class="Symbol">}{</a><a id="15850" href="/20.07/Adequacy/#15850" class="Bound">x</a> <a id="15852" class="Symbol">:</a> <a id="15854" href="/20.07/Adequacy/#15831" class="Bound">Γ</a> <a id="15856" href="/20.07/Untyped/#3521" class="Datatype Operator">∋</a> <a id="15858" href="/20.07/Untyped/#2888" class="InductiveConstructor">★</a><a id="15859" class="Symbol">}</a>
|
||
<a id="15866" class="Symbol">→</a> <a id="15868" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">Σ[</a> <a id="15871" href="/20.07/Adequacy/#15871" class="Bound">Δ</a> <a id="15873" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">∈</a> <a id="15875" href="/20.07/Untyped/#3153" class="Datatype">Context</a> <a id="15883" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">]</a> <a id="15885" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">Σ[</a> <a id="15888" href="/20.07/Adequacy/#15888" class="Bound">δ</a> <a id="15890" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">∈</a> <a id="15892" href="/20.07/BigStep/#2437" class="Function">ClosEnv</a> <a id="15900" href="/20.07/Adequacy/#15871" class="Bound">Δ</a> <a id="15902" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">]</a> <a id="15904" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">Σ[</a> <a id="15907" href="/20.07/Adequacy/#15907" class="Bound">M</a> <a id="15909" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">∈</a> <a id="15911" href="/20.07/Adequacy/#15871" class="Bound">Δ</a> <a id="15913" href="/20.07/Untyped/#4294" class="Datatype Operator">⊢</a> <a id="15915" href="/20.07/Untyped/#2888" class="InductiveConstructor">★</a> <a id="15917" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">]</a>
|
||
<a id="15936" href="/20.07/Adequacy/#15834" class="Bound">γ'</a> <a id="15939" href="/20.07/Adequacy/#15850" class="Bound">x</a> <a id="15941" href="Agda.Builtin.Equality.html#125" class="Datatype Operator">≡</a> <a id="15943" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="15948" href="/20.07/Adequacy/#15907" class="Bound">M</a> <a id="15950" href="/20.07/Adequacy/#15888" class="Bound">δ</a>
|
||
<a id="15952" href="/20.07/Adequacy/#15821" class="Function">kth-x</a><a id="15957" class="Symbol">{</a><a id="15958" class="Argument">γ'</a> <a id="15961" class="Symbol">=</a> <a id="15963" href="/20.07/Adequacy/#15963" class="Bound">γ'</a><a id="15965" class="Symbol">}{</a><a id="15967" class="Argument">x</a> <a id="15969" class="Symbol">=</a> <a id="15971" href="/20.07/Adequacy/#15971" class="Bound">x</a><a id="15972" class="Symbol">}</a> <a id="15974" class="Keyword">with</a> <a id="15979" href="/20.07/Adequacy/#15963" class="Bound">γ'</a> <a id="15982" href="/20.07/Adequacy/#15971" class="Bound">x</a>
|
||
<a id="15984" class="Symbol">...</a> <a id="15988" class="Symbol">|</a> <a id="15990" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a><a id="15994" class="Symbol">{</a><a id="15995" class="Argument">Γ</a> <a id="15997" class="Symbol">=</a> <a id="15999" href="/20.07/Adequacy/#15999" class="Bound">Δ</a><a id="16000" class="Symbol">}</a> <a id="16002" href="/20.07/Adequacy/#16002" class="Bound">M</a> <a id="16004" href="/20.07/Adequacy/#16004" class="Bound">δ</a> <a id="16006" class="Symbol">=</a> <a id="16008" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="16010" href="/20.07/Adequacy/#15999" class="Bound">Δ</a> <a id="16012" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="16014" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="16016" href="/20.07/Adequacy/#16004" class="Bound">δ</a> <a id="16018" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="16020" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="16022" href="/20.07/Adequacy/#16002" class="Bound">M</a> <a id="16024" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="16026" href="Agda.Builtin.Equality.html#182" class="InductiveConstructor">refl</a> <a id="16031" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="16033" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="16035" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
</pre>
|
||
<pre class="Agda"><a id="↓→𝔼"></a><a id="16046" href="/20.07/Adequacy/#16046" class="Function">↓→𝔼</a> <a id="16050" class="Symbol">:</a> <a id="16052" class="Symbol">∀{</a><a id="16054" href="/20.07/Adequacy/#16054" class="Bound">Γ</a><a id="16055" class="Symbol">}{</a><a id="16057" href="/20.07/Adequacy/#16057" class="Bound">γ</a> <a id="16059" class="Symbol">:</a> <a id="16061" href="/20.07/Denotational/#7288" class="Function">Env</a> <a id="16065" href="/20.07/Adequacy/#16054" class="Bound">Γ</a><a id="16066" class="Symbol">}{</a><a id="16068" href="/20.07/Adequacy/#16068" class="Bound">γ'</a> <a id="16071" class="Symbol">:</a> <a id="16073" href="/20.07/BigStep/#2437" class="Function">ClosEnv</a> <a id="16081" href="/20.07/Adequacy/#16054" class="Bound">Γ</a><a id="16082" class="Symbol">}{</a><a id="16084" href="/20.07/Adequacy/#16084" class="Bound">M</a> <a id="16086" class="Symbol">:</a> <a id="16088" href="/20.07/Adequacy/#16054" class="Bound">Γ</a> <a id="16090" href="/20.07/Untyped/#4294" class="Datatype Operator">⊢</a> <a id="16092" href="/20.07/Untyped/#2888" class="InductiveConstructor">★</a> <a id="16094" class="Symbol">}{</a><a id="16096" href="/20.07/Adequacy/#16096" class="Bound">v</a><a id="16097" class="Symbol">}</a>
|
||
<a id="16111" class="Symbol">→</a> <a id="16113" href="/20.07/Adequacy/#8965" class="Function">𝔾</a> <a id="16115" href="/20.07/Adequacy/#16057" class="Bound">γ</a> <a id="16117" href="/20.07/Adequacy/#16068" class="Bound">γ'</a> <a id="16120" class="Symbol">→</a> <a id="16122" href="/20.07/Adequacy/#16057" class="Bound">γ</a> <a id="16124" href="/20.07/Denotational/#9346" class="Datatype Operator">⊢</a> <a id="16126" href="/20.07/Adequacy/#16084" class="Bound">M</a> <a id="16128" href="/20.07/Denotational/#9346" class="Datatype Operator">↓</a> <a id="16130" href="/20.07/Adequacy/#16096" class="Bound">v</a> <a id="16132" class="Symbol">→</a> <a id="16134" href="/20.07/Adequacy/#7267" class="Function">𝔼</a> <a id="16136" href="/20.07/Adequacy/#16096" class="Bound">v</a> <a id="16138" class="Symbol">(</a><a id="16139" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="16144" href="/20.07/Adequacy/#16084" class="Bound">M</a> <a id="16146" href="/20.07/Adequacy/#16068" class="Bound">γ'</a><a id="16148" class="Symbol">)</a>
|
||
<a id="16150" href="/20.07/Adequacy/#16046" class="Function">↓→𝔼</a> <a id="16154" class="Symbol">{</a><a id="16155" href="/20.07/Adequacy/#16155" class="Bound">Γ</a><a id="16156" class="Symbol">}</a> <a id="16158" class="Symbol">{</a><a id="16159" href="/20.07/Adequacy/#16159" class="Bound">γ</a><a id="16160" class="Symbol">}</a> <a id="16162" class="Symbol">{</a><a id="16163" href="/20.07/Adequacy/#16163" class="Bound">γ'</a><a id="16165" class="Symbol">}</a> <a id="16167" href="/20.07/Adequacy/#16167" class="Bound">𝔾γγ'</a> <a id="16172" class="Symbol">(</a><a id="16173" href="/20.07/Denotational/#9400" class="InductiveConstructor">var</a><a id="16176" class="Symbol">{</a><a id="16177" class="Argument">x</a> <a id="16179" class="Symbol">=</a> <a id="16181" href="/20.07/Adequacy/#16181" class="Bound">x</a><a id="16182" class="Symbol">})</a> <a id="16185" href="/20.07/Adequacy/#16185" class="Bound">fγx</a>
|
||
<a id="16193" class="Keyword">with</a> <a id="16198" href="/20.07/Adequacy/#15821" class="Function">kth-x</a><a id="16203" class="Symbol">{</a><a id="16204" href="/20.07/Adequacy/#16155" class="Bound">Γ</a><a id="16205" class="Symbol">}{</a><a id="16207" href="/20.07/Adequacy/#16163" class="Bound">γ'</a><a id="16209" class="Symbol">}{</a><a id="16211" href="/20.07/Adequacy/#16181" class="Bound">x</a><a id="16212" class="Symbol">}</a> <a id="16214" class="Symbol">|</a> <a id="16216" href="/20.07/Adequacy/#16167" class="Bound">𝔾γγ'</a><a id="16220" class="Symbol">{</a><a id="16221" class="Argument">x</a> <a id="16223" class="Symbol">=</a> <a id="16225" href="/20.07/Adequacy/#16181" class="Bound">x</a><a id="16226" class="Symbol">}</a>
|
||
<a id="16228" class="Symbol">...</a> <a id="16232" class="Symbol">|</a> <a id="16234" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="16236" href="/20.07/Adequacy/#16236" class="Bound">Δ</a> <a id="16238" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="16240" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="16242" href="/20.07/Adequacy/#16242" class="Bound">δ</a> <a id="16244" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="16246" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="16248" href="/20.07/Adequacy/#16248" class="Bound">M'</a> <a id="16251" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="16253" href="/20.07/Adequacy/#16253" class="Bound">eq</a> <a id="16256" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="16258" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="16260" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="16262" class="Symbol">|</a> <a id="16264" href="/20.07/Adequacy/#16264" class="Bound">𝔾γγ'x</a> <a id="16270" class="Keyword">rewrite</a> <a id="16278" href="/20.07/Adequacy/#16253" class="Bound">eq</a>
|
||
<a id="16285" class="Keyword">with</a> <a id="16290" href="/20.07/Adequacy/#16264" class="Bound">𝔾γγ'x</a> <a id="16296" class="Bound">fγx</a>
|
||
<a id="16300" class="Symbol">...</a> <a id="16304" class="Symbol">|</a> <a id="16306" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="16308" href="/20.07/Adequacy/#16308" class="Bound">c</a> <a id="16310" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="16312" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="16314" href="/20.07/Adequacy/#16314" class="Bound">M'⇓c</a> <a id="16319" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="16321" href="/20.07/Adequacy/#16321" class="Bound">𝕍γx</a> <a id="16325" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="16327" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="16329" class="Symbol">=</a>
|
||
<a id="16337" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="16339" href="/20.07/Adequacy/#16308" class="Bound">c</a> <a id="16341" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="16343" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="16345" class="Symbol">(</a><a id="16346" href="/20.07/BigStep/#3078" class="InductiveConstructor">⇓-var</a> <a id="16352" class="Bound">eq</a> <a id="16355" href="/20.07/Adequacy/#16314" class="Bound">M'⇓c</a><a id="16359" class="Symbol">)</a> <a id="16361" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="16363" href="/20.07/Adequacy/#16321" class="Bound">𝕍γx</a> <a id="16367" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="16369" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="16371" href="/20.07/Adequacy/#16046" class="Function">↓→𝔼</a> <a id="16375" class="Symbol">{</a><a id="16376" href="/20.07/Adequacy/#16376" class="Bound">Γ</a><a id="16377" class="Symbol">}</a> <a id="16379" class="Symbol">{</a><a id="16380" href="/20.07/Adequacy/#16380" class="Bound">γ</a><a id="16381" class="Symbol">}</a> <a id="16383" class="Symbol">{</a><a id="16384" href="/20.07/Adequacy/#16384" class="Bound">γ'</a><a id="16386" class="Symbol">}</a> <a id="16388" href="/20.07/Adequacy/#16388" class="Bound">𝔾γγ'</a> <a id="16393" class="Symbol">(</a><a id="16394" href="/20.07/Denotational/#9475" class="InductiveConstructor">↦-elim</a><a id="16400" class="Symbol">{</a><a id="16401" class="Argument">L</a> <a id="16403" class="Symbol">=</a> <a id="16405" href="/20.07/Adequacy/#16405" class="Bound">L</a><a id="16406" class="Symbol">}{</a><a id="16408" class="Argument">M</a> <a id="16410" class="Symbol">=</a> <a id="16412" href="/20.07/Adequacy/#16412" class="Bound">M</a><a id="16413" class="Symbol">}{</a><a id="16415" class="Argument">v</a> <a id="16417" class="Symbol">=</a> <a id="16419" href="/20.07/Adequacy/#16419" class="Bound">v₁</a><a id="16421" class="Symbol">}{</a><a id="16423" class="Argument">w</a> <a id="16425" class="Symbol">=</a> <a id="16427" href="/20.07/Adequacy/#16427" class="Bound">v</a><a id="16428" class="Symbol">}</a> <a id="16430" href="/20.07/Adequacy/#16430" class="Bound">d₁</a> <a id="16433" href="/20.07/Adequacy/#16433" class="Bound">d₂</a><a id="16435" class="Symbol">)</a> <a id="16437" href="/20.07/Adequacy/#16437" class="Bound">fv</a>
|
||
<a id="16444" class="Keyword">with</a> <a id="16449" href="/20.07/Adequacy/#16046" class="Function">↓→𝔼</a> <a id="16453" href="/20.07/Adequacy/#16388" class="Bound">𝔾γγ'</a> <a id="16458" href="/20.07/Adequacy/#16430" class="Bound">d₁</a> <a id="16461" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="16463" href="/20.07/Adequacy/#16419" class="Bound">v₁</a> <a id="16466" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="16468" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="16470" href="/20.07/Adequacy/#16427" class="Bound">v</a> <a id="16472" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="16474" href="/20.07/Denotational/#5638" class="Function">⊑-refl</a> <a id="16481" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="16483" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="16485" class="Symbol">...</a> <a id="16489" class="Symbol">|</a> <a id="16491" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="16493" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="16498" href="/20.07/Adequacy/#16498" class="Bound">L'</a> <a id="16501" href="/20.07/Adequacy/#16501" class="Bound">δ</a> <a id="16503" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="16505" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="16507" href="/20.07/Adequacy/#16507" class="Bound">L⇓L'</a> <a id="16512" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="16514" href="/20.07/Adequacy/#16514" class="Bound">𝕍v₁↦v</a> <a id="16520" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="16522" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="16528" class="Keyword">with</a> <a id="16533" href="/20.07/Adequacy/#9549" class="Function">𝕍→WHNF</a> <a id="16540" href="/20.07/Adequacy/#16514" class="Bound">𝕍v₁↦v</a>
|
||
<a id="16546" class="Symbol">...</a> <a id="16550" class="Symbol">|</a> <a id="16552" href="/20.07/Adequacy/#9442" class="InductiveConstructor Operator">ƛ_</a> <a id="16555" class="Symbol">{</a><a id="16556" class="Argument">N</a> <a id="16558" class="Symbol">=</a> <a id="16560" href="/20.07/Adequacy/#16560" class="Bound">N</a><a id="16561" class="Symbol">}</a>
|
||
<a id="16567" class="Keyword">with</a> <a id="16572" class="Bound">𝕍v₁↦v</a> <a id="16578" class="Symbol">{</a><a id="16579" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="16584" class="Bound">M</a> <a id="16586" class="Bound">γ'</a><a id="16588" class="Symbol">}</a> <a id="16590" class="Symbol">(</a><a id="16591" href="/20.07/Adequacy/#16046" class="Function">↓→𝔼</a> <a id="16595" class="Bound">𝔾γγ'</a> <a id="16600" class="Bound">d₂</a><a id="16602" class="Symbol">)</a> <a id="16604" class="Bound">fv</a>
|
||
<a id="16607" class="Symbol">...</a> <a id="16611" class="Symbol">|</a> <a id="16613" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="16615" href="/20.07/Adequacy/#16615" class="Bound">c'</a> <a id="16618" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="16620" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="16622" href="/20.07/Adequacy/#16622" class="Bound">N⇓c'</a> <a id="16627" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="16629" href="/20.07/Adequacy/#16629" class="Bound">𝕍v</a> <a id="16632" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="16634" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="16636" class="Symbol">=</a>
|
||
<a id="16642" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="16644" href="/20.07/Adequacy/#16615" class="Bound">c'</a> <a id="16647" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="16649" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="16651" href="/20.07/BigStep/#3300" class="InductiveConstructor">⇓-app</a> <a id="16657" class="Bound">L⇓L'</a> <a id="16662" href="/20.07/Adequacy/#16622" class="Bound">N⇓c'</a> <a id="16667" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="16669" href="/20.07/Adequacy/#16629" class="Bound">𝕍v</a> <a id="16672" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="16674" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="16676" href="/20.07/Adequacy/#16046" class="Function">↓→𝔼</a> <a id="16680" class="Symbol">{</a><a id="16681" href="/20.07/Adequacy/#16681" class="Bound">Γ</a><a id="16682" class="Symbol">}</a> <a id="16684" class="Symbol">{</a><a id="16685" href="/20.07/Adequacy/#16685" class="Bound">γ</a><a id="16686" class="Symbol">}</a> <a id="16688" class="Symbol">{</a><a id="16689" href="/20.07/Adequacy/#16689" class="Bound">γ'</a><a id="16691" class="Symbol">}</a> <a id="16693" href="/20.07/Adequacy/#16693" class="Bound">𝔾γγ'</a> <a id="16698" class="Symbol">(</a><a id="16699" href="/20.07/Denotational/#9597" class="InductiveConstructor">↦-intro</a><a id="16706" class="Symbol">{</a><a id="16707" class="Argument">N</a> <a id="16709" class="Symbol">=</a> <a id="16711" href="/20.07/Adequacy/#16711" class="Bound">N</a><a id="16712" class="Symbol">}{</a><a id="16714" class="Argument">v</a> <a id="16716" class="Symbol">=</a> <a id="16718" href="/20.07/Adequacy/#16718" class="Bound">v</a><a id="16719" class="Symbol">}{</a><a id="16721" class="Argument">w</a> <a id="16723" class="Symbol">=</a> <a id="16725" href="/20.07/Adequacy/#16725" class="Bound">w</a><a id="16726" class="Symbol">}</a> <a id="16728" href="/20.07/Adequacy/#16728" class="Bound">d</a><a id="16729" class="Symbol">)</a> <a id="16731" href="/20.07/Adequacy/#16731" class="Bound">fv↦w</a> <a id="16736" class="Symbol">=</a>
|
||
<a id="16742" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="16744" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="16749" class="Symbol">(</a><a id="16750" href="/20.07/Untyped/#4382" class="InductiveConstructor Operator">ƛ</a> <a id="16752" href="/20.07/Adequacy/#16711" class="Bound">N</a><a id="16753" class="Symbol">)</a> <a id="16755" href="/20.07/Adequacy/#16689" class="Bound">γ'</a> <a id="16758" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="16760" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="16762" href="/20.07/BigStep/#3225" class="InductiveConstructor">⇓-lam</a> <a id="16768" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="16770" href="/20.07/Adequacy/#16786" class="Function">E</a> <a id="16772" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="16774" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="16780" class="Keyword">where</a> <a id="16786" href="/20.07/Adequacy/#16786" class="Function">E</a> <a id="16788" class="Symbol">:</a> <a id="16790" class="Symbol">{</a><a id="16791" href="/20.07/Adequacy/#16791" class="Bound">c</a> <a id="16793" class="Symbol">:</a> <a id="16795" href="/20.07/BigStep/#2467" class="Datatype">Clos</a><a id="16799" class="Symbol">}</a> <a id="16801" class="Symbol">→</a> <a id="16803" href="/20.07/Adequacy/#7267" class="Function">𝔼</a> <a id="16805" href="/20.07/Adequacy/#16718" class="Bound">v</a> <a id="16807" href="/20.07/Adequacy/#16791" class="Bound">c</a> <a id="16809" class="Symbol">→</a> <a id="16811" href="/20.07/Adequacy/#4190" class="Function">above-fun</a> <a id="16821" href="/20.07/Adequacy/#16725" class="Bound">w</a>
|
||
<a id="16835" class="Symbol">→</a> <a id="16837" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">Σ[</a> <a id="16840" href="/20.07/Adequacy/#16840" class="Bound">c'</a> <a id="16843" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">∈</a> <a id="16845" href="/20.07/BigStep/#2467" class="Datatype">Clos</a> <a id="16850" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">]</a> <a id="16852" class="Symbol">(</a><a id="16853" href="/20.07/Adequacy/#16689" class="Bound">γ'</a> <a id="16856" href="/20.07/BigStep/#2672" class="Function Operator">,'</a> <a id="16859" href="/20.07/Adequacy/#16791" class="Bound">c</a><a id="16860" class="Symbol">)</a> <a id="16862" href="/20.07/BigStep/#3021" class="Datatype Operator">⊢</a> <a id="16864" href="/20.07/Adequacy/#16711" class="Bound">N</a> <a id="16866" href="/20.07/BigStep/#3021" class="Datatype Operator">⇓</a> <a id="16868" href="/20.07/Adequacy/#16840" class="Bound">c'</a> <a id="16872" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#1162" class="Function Operator">×</a> <a id="16875" href="/20.07/Adequacy/#7244" class="Function">𝕍</a> <a id="16877" href="/20.07/Adequacy/#16725" class="Bound">w</a> <a id="16879" href="/20.07/Adequacy/#16840" class="Bound">c'</a>
|
||
<a id="16892" href="/20.07/Adequacy/#16786" class="Function">E</a> <a id="16894" class="Symbol">{</a><a id="16895" href="/20.07/Adequacy/#16895" class="Bound">c</a><a id="16896" class="Symbol">}</a> <a id="16898" href="/20.07/Adequacy/#16898" class="Bound">𝔼vc</a> <a id="16902" href="/20.07/Adequacy/#16902" class="Bound">fw</a> <a id="16905" class="Symbol">=</a> <a id="16907" href="/20.07/Adequacy/#16046" class="Function">↓→𝔼</a> <a id="16911" class="Symbol">(λ</a> <a id="16914" class="Symbol">{</a><a id="16915" href="/20.07/Adequacy/#16915" class="Bound">x</a><a id="16916" class="Symbol">}</a> <a id="16918" class="Symbol">→</a> <a id="16920" href="/20.07/Adequacy/#9068" class="Function">𝔾-ext</a><a id="16925" class="Symbol">{</a><a id="16926" href="/20.07/Adequacy/#16681" class="Bound">Γ</a><a id="16927" class="Symbol">}{</a><a id="16929" href="/20.07/Adequacy/#16685" class="Bound">γ</a><a id="16930" class="Symbol">}{</a><a id="16932" href="/20.07/Adequacy/#16689" class="Bound">γ'</a><a id="16934" class="Symbol">}</a> <a id="16936" href="/20.07/Adequacy/#16693" class="Bound">𝔾γγ'</a> <a id="16941" href="/20.07/Adequacy/#16898" class="Bound">𝔼vc</a> <a id="16945" class="Symbol">{</a><a id="16946" href="/20.07/Adequacy/#16915" class="Bound">x</a><a id="16947" class="Symbol">})</a> <a id="16950" href="/20.07/Adequacy/#16728" class="Bound">d</a> <a id="16952" href="/20.07/Adequacy/#16902" class="Bound">fw</a>
|
||
<a id="16955" href="/20.07/Adequacy/#16046" class="Function">↓→𝔼</a> <a id="16959" href="/20.07/Adequacy/#16959" class="Bound">𝔾γγ'</a> <a id="16964" href="/20.07/Denotational/#9709" class="InductiveConstructor">⊥-intro</a> <a id="16972" href="/20.07/Adequacy/#16972" class="Bound">f⊥</a> <a id="16975" class="Symbol">=</a> <a id="16977" href="https://agda.github.io/agda-stdlib/v1.1/Data.Empty.html#294" class="Function">⊥-elim</a> <a id="16984" class="Symbol">(</a><a id="16985" href="/20.07/Adequacy/#4600" class="Function">above-fun⊥</a> <a id="16996" href="/20.07/Adequacy/#16972" class="Bound">f⊥</a><a id="16998" class="Symbol">)</a>
|
||
<a id="17000" href="/20.07/Adequacy/#16046" class="Function">↓→𝔼</a> <a id="17004" href="/20.07/Adequacy/#17004" class="Bound">𝔾γγ'</a> <a id="17009" class="Symbol">(</a><a id="17010" href="/20.07/Denotational/#9776" class="InductiveConstructor">⊔-intro</a><a id="17017" class="Symbol">{</a><a id="17018" class="Argument">v</a> <a id="17020" class="Symbol">=</a> <a id="17022" href="/20.07/Adequacy/#17022" class="Bound">v₁</a><a id="17024" class="Symbol">}{</a><a id="17026" class="Argument">w</a> <a id="17028" class="Symbol">=</a> <a id="17030" href="/20.07/Adequacy/#17030" class="Bound">v₂</a><a id="17032" class="Symbol">}</a> <a id="17034" href="/20.07/Adequacy/#17034" class="Bound">d₁</a> <a id="17037" href="/20.07/Adequacy/#17037" class="Bound">d₂</a><a id="17039" class="Symbol">)</a> <a id="17041" href="/20.07/Adequacy/#17041" class="Bound">fv12</a>
|
||
<a id="17050" class="Keyword">with</a> <a id="17055" href="/20.07/Adequacy/#6385" class="Function">above-fun?</a> <a id="17066" href="/20.07/Adequacy/#17022" class="Bound">v₁</a> <a id="17069" class="Symbol">|</a> <a id="17071" href="/20.07/Adequacy/#6385" class="Function">above-fun?</a> <a id="17082" href="/20.07/Adequacy/#17030" class="Bound">v₂</a>
|
||
<a id="17085" class="Symbol">...</a> <a id="17089" class="Symbol">|</a> <a id="17091" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="17095" href="/20.07/Adequacy/#17095" class="Bound">fv1</a> <a id="17099" class="Symbol">|</a> <a id="17101" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="17105" href="/20.07/Adequacy/#17105" class="Bound">fv2</a>
|
||
<a id="17113" class="Keyword">with</a> <a id="17118" href="/20.07/Adequacy/#16046" class="Function">↓→𝔼</a> <a id="17122" class="Bound">𝔾γγ'</a> <a id="17127" class="Bound">d₁</a> <a id="17130" href="/20.07/Adequacy/#17095" class="Bound">fv1</a> <a id="17134" class="Symbol">|</a> <a id="17136" href="/20.07/Adequacy/#16046" class="Function">↓→𝔼</a> <a id="17140" class="Bound">𝔾γγ'</a> <a id="17145" class="Bound">d₂</a> <a id="17148" href="/20.07/Adequacy/#17105" class="Bound">fv2</a>
|
||
<a id="17152" class="Symbol">...</a> <a id="17156" class="Symbol">|</a> <a id="17158" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="17160" href="/20.07/Adequacy/#17160" class="Bound">c₁</a> <a id="17163" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="17165" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="17167" href="/20.07/Adequacy/#17167" class="Bound">M⇓c₁</a> <a id="17172" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="17174" href="/20.07/Adequacy/#17174" class="Bound">𝕍v₁</a> <a id="17178" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="17180" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="17182" class="Symbol">|</a> <a id="17184" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="17186" href="/20.07/Adequacy/#17186" class="Bound">c₂</a> <a id="17189" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="17191" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="17193" href="/20.07/Adequacy/#17193" class="Bound">M⇓c₂</a> <a id="17198" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="17200" href="/20.07/Adequacy/#17200" class="Bound">𝕍v₂</a> <a id="17204" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="17206" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="17212" class="Keyword">rewrite</a> <a id="17220" href="/20.07/BigStep/#4586" class="Function">⇓-determ</a> <a id="17229" href="/20.07/Adequacy/#17193" class="Bound">M⇓c₂</a> <a id="17234" href="/20.07/Adequacy/#17167" class="Bound">M⇓c₁</a> <a id="17239" class="Symbol">=</a>
|
||
<a id="17245" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="17247" href="/20.07/Adequacy/#17160" class="Bound">c₁</a> <a id="17250" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="17252" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="17254" href="/20.07/Adequacy/#17167" class="Bound">M⇓c₁</a> <a id="17259" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="17261" href="/20.07/Adequacy/#9862" class="Function">𝕍⊔-intro</a> <a id="17270" href="/20.07/Adequacy/#17174" class="Bound">𝕍v₁</a> <a id="17274" href="/20.07/Adequacy/#17200" class="Bound">𝕍v₂</a> <a id="17278" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="17280" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="17282" href="/20.07/Adequacy/#16046" class="Function">↓→𝔼</a> <a id="17286" href="/20.07/Adequacy/#17286" class="Bound">𝔾γγ'</a> <a id="17291" class="Symbol">(</a><a id="17292" href="/20.07/Denotational/#9776" class="InductiveConstructor">⊔-intro</a><a id="17299" class="Symbol">{</a><a id="17300" class="Argument">v</a> <a id="17302" class="Symbol">=</a> <a id="17304" href="/20.07/Adequacy/#17304" class="Bound">v₁</a><a id="17306" class="Symbol">}{</a><a id="17308" class="Argument">w</a> <a id="17310" class="Symbol">=</a> <a id="17312" href="/20.07/Adequacy/#17312" class="Bound">v₂</a><a id="17314" class="Symbol">}</a> <a id="17316" href="/20.07/Adequacy/#17316" class="Bound">d₁</a> <a id="17319" href="/20.07/Adequacy/#17319" class="Bound">d₂</a><a id="17321" class="Symbol">)</a> <a id="17323" href="/20.07/Adequacy/#17323" class="Bound">fv12</a> <a id="17328" class="Symbol">|</a> <a id="17330" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="17334" href="/20.07/Adequacy/#17334" class="Bound">fv1</a> <a id="17338" class="Symbol">|</a> <a id="17340" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="17343" href="/20.07/Adequacy/#17343" class="Bound">nfv2</a>
|
||
<a id="17352" class="Keyword">with</a> <a id="17357" href="/20.07/Adequacy/#16046" class="Function">↓→𝔼</a> <a id="17361" href="/20.07/Adequacy/#17286" class="Bound">𝔾γγ'</a> <a id="17366" href="/20.07/Adequacy/#17316" class="Bound">d₁</a> <a id="17369" href="/20.07/Adequacy/#17334" class="Bound">fv1</a>
|
||
<a id="17373" class="Symbol">...</a> <a id="17377" class="Symbol">|</a> <a id="17379" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="17381" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="17386" class="Symbol">{</a><a id="17387" href="/20.07/Adequacy/#17387" class="Bound">Γ'</a><a id="17389" class="Symbol">}</a> <a id="17391" href="/20.07/Adequacy/#17391" class="Bound">M'</a> <a id="17394" href="/20.07/Adequacy/#17394" class="Bound">γ₁</a> <a id="17397" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="17399" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="17401" href="/20.07/Adequacy/#17401" class="Bound">M⇓c₁</a> <a id="17406" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="17408" href="/20.07/Adequacy/#17408" class="Bound">𝕍v₁</a> <a id="17412" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="17414" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="17420" class="Keyword">with</a> <a id="17425" href="/20.07/Adequacy/#9549" class="Function">𝕍→WHNF</a> <a id="17432" href="/20.07/Adequacy/#17408" class="Bound">𝕍v₁</a>
|
||
<a id="17436" class="Symbol">...</a> <a id="17440" class="Symbol">|</a> <a id="17442" href="/20.07/Adequacy/#9442" class="InductiveConstructor Operator">ƛ_</a> <a id="17445" class="Symbol">{</a><a id="17446" class="Argument">N</a> <a id="17448" class="Symbol">=</a> <a id="17450" href="/20.07/Adequacy/#17450" class="Bound">N</a><a id="17451" class="Symbol">}</a> <a id="17453" class="Symbol">=</a>
|
||
<a id="17459" class="Keyword">let</a> <a id="17463" href="/20.07/Adequacy/#17463" class="Bound">𝕍v₂</a> <a id="17467" class="Symbol">=</a> <a id="17469" href="/20.07/Adequacy/#10511" class="Function">not-above-fun-𝕍</a><a id="17484" class="Symbol">{</a><a id="17485" class="Bound">v₂</a><a id="17487" class="Symbol">}{</a><a id="17489" class="Bound">Γ'</a><a id="17491" class="Symbol">}{</a><a id="17493" class="Bound">γ₁</a><a id="17495" class="Symbol">}{</a><a id="17497" href="/20.07/Adequacy/#17450" class="Bound">N</a><a id="17498" class="Symbol">}</a> <a id="17500" class="Bound">nfv2</a> <a id="17505" class="Keyword">in</a>
|
||
<a id="17512" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="17514" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="17519" class="Symbol">(</a><a id="17520" href="/20.07/Untyped/#4382" class="InductiveConstructor Operator">ƛ</a> <a id="17522" href="/20.07/Adequacy/#17450" class="Bound">N</a><a id="17523" class="Symbol">)</a> <a id="17525" class="Bound">γ₁</a> <a id="17528" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="17530" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="17532" class="Bound">M⇓c₁</a> <a id="17537" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="17539" href="/20.07/Adequacy/#9862" class="Function">𝕍⊔-intro</a> <a id="17548" class="Bound">𝕍v₁</a> <a id="17552" href="/20.07/Adequacy/#17463" class="Bound">𝕍v₂</a> <a id="17556" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="17558" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="17560" href="/20.07/Adequacy/#16046" class="Function">↓→𝔼</a> <a id="17564" href="/20.07/Adequacy/#17564" class="Bound">𝔾γγ'</a> <a id="17569" class="Symbol">(</a><a id="17570" href="/20.07/Denotational/#9776" class="InductiveConstructor">⊔-intro</a><a id="17577" class="Symbol">{</a><a id="17578" class="Argument">v</a> <a id="17580" class="Symbol">=</a> <a id="17582" href="/20.07/Adequacy/#17582" class="Bound">v₁</a><a id="17584" class="Symbol">}{</a><a id="17586" class="Argument">w</a> <a id="17588" class="Symbol">=</a> <a id="17590" href="/20.07/Adequacy/#17590" class="Bound">v₂</a><a id="17592" class="Symbol">}</a> <a id="17594" href="/20.07/Adequacy/#17594" class="Bound">d₁</a> <a id="17597" href="/20.07/Adequacy/#17597" class="Bound">d₂</a><a id="17599" class="Symbol">)</a> <a id="17601" href="/20.07/Adequacy/#17601" class="Bound">fv12</a> <a id="17606" class="Symbol">|</a> <a id="17608" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="17611" href="/20.07/Adequacy/#17611" class="Bound">nfv1</a> <a id="17617" class="Symbol">|</a> <a id="17619" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="17623" href="/20.07/Adequacy/#17623" class="Bound">fv2</a>
|
||
<a id="17631" class="Keyword">with</a> <a id="17636" href="/20.07/Adequacy/#16046" class="Function">↓→𝔼</a> <a id="17640" href="/20.07/Adequacy/#17564" class="Bound">𝔾γγ'</a> <a id="17645" href="/20.07/Adequacy/#17597" class="Bound">d₂</a> <a id="17648" href="/20.07/Adequacy/#17623" class="Bound">fv2</a>
|
||
<a id="17652" class="Symbol">...</a> <a id="17656" class="Symbol">|</a> <a id="17658" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="17660" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="17665" class="Symbol">{</a><a id="17666" href="/20.07/Adequacy/#17666" class="Bound">Γ'</a><a id="17668" class="Symbol">}</a> <a id="17670" href="/20.07/Adequacy/#17670" class="Bound">M'</a> <a id="17673" href="/20.07/Adequacy/#17673" class="Bound">γ₁</a> <a id="17676" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="17678" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="17680" href="/20.07/Adequacy/#17680" class="Bound">M'⇓c₂</a> <a id="17686" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="17688" href="/20.07/Adequacy/#17688" class="Bound">𝕍2c</a> <a id="17692" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="17694" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="17700" class="Keyword">with</a> <a id="17705" href="/20.07/Adequacy/#9549" class="Function">𝕍→WHNF</a> <a id="17712" href="/20.07/Adequacy/#17688" class="Bound">𝕍2c</a>
|
||
<a id="17716" class="Symbol">...</a> <a id="17720" class="Symbol">|</a> <a id="17722" href="/20.07/Adequacy/#9442" class="InductiveConstructor Operator">ƛ_</a> <a id="17725" class="Symbol">{</a><a id="17726" class="Argument">N</a> <a id="17728" class="Symbol">=</a> <a id="17730" href="/20.07/Adequacy/#17730" class="Bound">N</a><a id="17731" class="Symbol">}</a> <a id="17733" class="Symbol">=</a>
|
||
<a id="17739" class="Keyword">let</a> <a id="17743" href="/20.07/Adequacy/#17743" class="Bound">𝕍1c</a> <a id="17747" class="Symbol">=</a> <a id="17749" href="/20.07/Adequacy/#10511" class="Function">not-above-fun-𝕍</a><a id="17764" class="Symbol">{</a><a id="17765" class="Bound">v₁</a><a id="17767" class="Symbol">}{</a><a id="17769" class="Bound">Γ'</a><a id="17771" class="Symbol">}{</a><a id="17773" class="Bound">γ₁</a><a id="17775" class="Symbol">}{</a><a id="17777" href="/20.07/Adequacy/#17730" class="Bound">N</a><a id="17778" class="Symbol">}</a> <a id="17780" class="Bound">nfv1</a> <a id="17785" class="Keyword">in</a>
|
||
<a id="17792" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="17794" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="17799" class="Symbol">(</a><a id="17800" href="/20.07/Untyped/#4382" class="InductiveConstructor Operator">ƛ</a> <a id="17802" href="/20.07/Adequacy/#17730" class="Bound">N</a><a id="17803" class="Symbol">)</a> <a id="17805" class="Bound">γ₁</a> <a id="17808" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="17810" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="17812" class="Bound">M'⇓c₂</a> <a id="17818" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="17820" href="/20.07/Adequacy/#9862" class="Function">𝕍⊔-intro</a> <a id="17829" href="/20.07/Adequacy/#17743" class="Bound">𝕍1c</a> <a id="17833" class="Bound">𝕍2c</a> <a id="17837" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="17839" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="17841" href="/20.07/Adequacy/#16046" class="Function">↓→𝔼</a> <a id="17845" href="/20.07/Adequacy/#17845" class="Bound">𝔾γγ'</a> <a id="17850" class="Symbol">(</a><a id="17851" href="/20.07/Denotational/#9776" class="InductiveConstructor">⊔-intro</a> <a id="17859" href="/20.07/Adequacy/#17859" class="Bound">d₁</a> <a id="17862" href="/20.07/Adequacy/#17862" class="Bound">d₂</a><a id="17864" class="Symbol">)</a> <a id="17866" href="/20.07/Adequacy/#17866" class="Bound">fv12</a> <a id="17871" class="Symbol">|</a> <a id="17873" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="17876" href="/20.07/Adequacy/#17876" class="Bound">nfv1</a> <a id="17882" class="Symbol">|</a> <a id="17884" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="17887" href="/20.07/Adequacy/#17887" class="Bound">nfv2</a>
|
||
<a id="17896" class="Keyword">with</a> <a id="17901" href="/20.07/Adequacy/#4907" class="Function">above-fun-⊔</a> <a id="17913" href="/20.07/Adequacy/#17866" class="Bound">fv12</a>
|
||
<a id="17918" class="Symbol">...</a> <a id="17922" class="Symbol">|</a> <a id="17924" href="https://agda.github.io/agda-stdlib/v1.1/Data.Sum.Base.html#662" class="InductiveConstructor">inj₁</a> <a id="17929" href="/20.07/Adequacy/#17929" class="Bound">fv1</a> <a id="17933" class="Symbol">=</a> <a id="17935" href="https://agda.github.io/agda-stdlib/v1.1/Data.Empty.html#294" class="Function">⊥-elim</a> <a id="17942" class="Symbol">(</a><a id="17943" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.Negation.html#809" class="Function">contradiction</a> <a id="17957" href="/20.07/Adequacy/#17929" class="Bound">fv1</a> <a id="17961" class="Bound">nfv1</a><a id="17965" class="Symbol">)</a>
|
||
<a id="17967" class="Symbol">...</a> <a id="17971" class="Symbol">|</a> <a id="17973" href="https://agda.github.io/agda-stdlib/v1.1/Data.Sum.Base.html#687" class="InductiveConstructor">inj₂</a> <a id="17978" href="/20.07/Adequacy/#17978" class="Bound">fv2</a> <a id="17982" class="Symbol">=</a> <a id="17984" href="https://agda.github.io/agda-stdlib/v1.1/Data.Empty.html#294" class="Function">⊥-elim</a> <a id="17991" class="Symbol">(</a><a id="17992" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.Negation.html#809" class="Function">contradiction</a> <a id="18006" href="/20.07/Adequacy/#17978" class="Bound">fv2</a> <a id="18010" class="Bound">nfv2</a><a id="18014" class="Symbol">)</a>
|
||
<a id="18016" href="/20.07/Adequacy/#16046" class="Function">↓→𝔼</a> <a id="18020" class="Symbol">{</a><a id="18021" href="/20.07/Adequacy/#18021" class="Bound">Γ</a><a id="18022" class="Symbol">}</a> <a id="18024" class="Symbol">{</a><a id="18025" href="/20.07/Adequacy/#18025" class="Bound">γ</a><a id="18026" class="Symbol">}</a> <a id="18028" class="Symbol">{</a><a id="18029" href="/20.07/Adequacy/#18029" class="Bound">γ'</a><a id="18031" class="Symbol">}</a> <a id="18033" class="Symbol">{</a><a id="18034" href="/20.07/Adequacy/#18034" class="Bound">M</a><a id="18035" class="Symbol">}</a> <a id="18037" class="Symbol">{</a><a id="18038" href="/20.07/Adequacy/#18038" class="Bound">v'</a><a id="18040" class="Symbol">}</a> <a id="18042" href="/20.07/Adequacy/#18042" class="Bound">𝔾γγ'</a> <a id="18047" class="Symbol">(</a><a id="18048" href="/20.07/Denotational/#9891" class="InductiveConstructor">sub</a><a id="18051" class="Symbol">{</a><a id="18052" class="Argument">v</a> <a id="18054" class="Symbol">=</a> <a id="18056" href="/20.07/Adequacy/#18056" class="Bound">v</a><a id="18057" class="Symbol">}</a> <a id="18059" href="/20.07/Adequacy/#18059" class="Bound">d</a> <a id="18061" href="/20.07/Adequacy/#18061" class="Bound">v'⊑v</a><a id="18065" class="Symbol">)</a> <a id="18067" href="/20.07/Adequacy/#18067" class="Bound">fv'</a>
|
||
<a id="18075" class="Keyword">with</a> <a id="18080" href="/20.07/Adequacy/#16046" class="Function">↓→𝔼</a> <a id="18084" class="Symbol">{</a><a id="18085" href="/20.07/Adequacy/#18021" class="Bound">Γ</a><a id="18086" class="Symbol">}</a> <a id="18088" class="Symbol">{</a><a id="18089" href="/20.07/Adequacy/#18025" class="Bound">γ</a><a id="18090" class="Symbol">}</a> <a id="18092" class="Symbol">{</a><a id="18093" href="/20.07/Adequacy/#18029" class="Bound">γ'</a><a id="18095" class="Symbol">}</a> <a id="18097" class="Symbol">{</a><a id="18098" href="/20.07/Adequacy/#18034" class="Bound">M</a><a id="18099" class="Symbol">}</a> <a id="18101" href="/20.07/Adequacy/#18042" class="Bound">𝔾γγ'</a> <a id="18106" href="/20.07/Adequacy/#18059" class="Bound">d</a> <a id="18108" class="Symbol">(</a><a id="18109" href="/20.07/Adequacy/#4361" class="Function">above-fun-⊑</a> <a id="18121" href="/20.07/Adequacy/#18067" class="Bound">fv'</a> <a id="18125" href="/20.07/Adequacy/#18061" class="Bound">v'⊑v</a><a id="18129" class="Symbol">)</a>
|
||
<a id="18131" class="Symbol">...</a> <a id="18135" class="Symbol">|</a> <a id="18137" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="18139" href="/20.07/Adequacy/#18139" class="Bound">c</a> <a id="18141" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="18143" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="18145" href="/20.07/Adequacy/#18145" class="Bound">M⇓c</a> <a id="18149" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="18151" href="/20.07/Adequacy/#18151" class="Bound">𝕍v</a> <a id="18154" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="18156" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="18158" class="Symbol">=</a>
|
||
<a id="18166" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="18168" href="/20.07/Adequacy/#18139" class="Bound">c</a> <a id="18170" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="18172" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="18174" href="/20.07/Adequacy/#18145" class="Bound">M⇓c</a> <a id="18178" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="18180" href="/20.07/Adequacy/#10947" class="Function">sub-𝕍</a> <a id="18186" href="/20.07/Adequacy/#18151" class="Bound">𝕍v</a> <a id="18189" class="Bound">v'⊑v</a> <a id="18194" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="18196" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
</pre>
|
||
<ul>
|
||
<li>
|
||
<p>Case <code class="language-plaintext highlighter-rouge">var</code>. Looking up <code class="language-plaintext highlighter-rouge">x</code> in <code class="language-plaintext highlighter-rouge">γ'</code> yields some closure, <code class="language-plaintext highlighter-rouge">clos M' δ</code>,
|
||
and from <code class="language-plaintext highlighter-rouge">𝔾 γ γ'</code> we have <code class="language-plaintext highlighter-rouge">𝔼 (γ x) (clos M' δ)</code>. With the premise
|
||
<code class="language-plaintext highlighter-rouge">above-fun (γ x)</code>, we obtain a closure <code class="language-plaintext highlighter-rouge">c</code> such that <code class="language-plaintext highlighter-rouge">δ ⊢ M' ⇓ c</code>
|
||
and <code class="language-plaintext highlighter-rouge">𝕍 (γ x) c</code>. To conclude <code class="language-plaintext highlighter-rouge">γ' ⊢ x ⇓ c</code> via <code class="language-plaintext highlighter-rouge">⇓-var</code>, we
|
||
need <code class="language-plaintext highlighter-rouge">γ' x ≡ clos M' δ</code>, which is obvious, but it requires some
|
||
Agda shananigans via the <code class="language-plaintext highlighter-rouge">kth-x</code> lemma to get our hands on it.</p>
|
||
</li>
|
||
<li>
|
||
<p>Case <code class="language-plaintext highlighter-rouge">↦-elim</code>. We have <code class="language-plaintext highlighter-rouge">γ ⊢ L · M ↓ v</code>.
|
||
The induction hypothesis for <code class="language-plaintext highlighter-rouge">γ ⊢ L ↓ v₁ ↦ v</code>
|
||
gives us <code class="language-plaintext highlighter-rouge">γ' ⊢ L ⇓ clos L' δ</code> and <code class="language-plaintext highlighter-rouge">𝕍 v (clos L' δ)</code>.
|
||
Of course, <code class="language-plaintext highlighter-rouge">L' ≡ ƛ N</code> for some <code class="language-plaintext highlighter-rouge">N</code>.
|
||
By the induction hypothesis for <code class="language-plaintext highlighter-rouge">γ ⊢ M ↓ v₁</code>,
|
||
we have <code class="language-plaintext highlighter-rouge">𝔼 v₁ (clos M γ')</code>.
|
||
Together with the premise <code class="language-plaintext highlighter-rouge">above-fun v</code> and <code class="language-plaintext highlighter-rouge">𝕍 v (clos L' δ)</code>,
|
||
we obtain a closure <code class="language-plaintext highlighter-rouge">c'</code> such that <code class="language-plaintext highlighter-rouge">δ ⊢ N ⇓ c'</code> and <code class="language-plaintext highlighter-rouge">𝕍 v c'</code>.
|
||
We conclude that <code class="language-plaintext highlighter-rouge">γ' ⊢ L · M ⇓ c'</code> by rule <code class="language-plaintext highlighter-rouge">⇓-app</code>.</p>
|
||
</li>
|
||
<li>
|
||
<p>Case <code class="language-plaintext highlighter-rouge">↦-intro</code>. We have <code class="language-plaintext highlighter-rouge">γ ⊢ ƛ N ↓ v ↦ w</code>.
|
||
We immediately have <code class="language-plaintext highlighter-rouge">γ' ⊢ ƛ M ⇓ clos (ƛ M) γ'</code> by rule <code class="language-plaintext highlighter-rouge">⇓-lam</code>.
|
||
But we also need to prove <code class="language-plaintext highlighter-rouge">𝕍 (v ↦ w) (clos (ƛ N) γ')</code>.
|
||
Let <code class="language-plaintext highlighter-rouge">c</code> by an arbitrary closure such that <code class="language-plaintext highlighter-rouge">𝔼 v c</code>.
|
||
Suppose <code class="language-plaintext highlighter-rouge">v'</code> is greater than a function value.
|
||
We need to show that <code class="language-plaintext highlighter-rouge">γ' , c ⊢ N ⇓ c'</code> and <code class="language-plaintext highlighter-rouge">𝕍 v' c'</code> for some <code class="language-plaintext highlighter-rouge">c'</code>.
|
||
We prove this by the induction hypothesis for <code class="language-plaintext highlighter-rouge">γ , v ⊢ N ↓ v'</code>
|
||
but we must first show that <code class="language-plaintext highlighter-rouge">𝔾 (γ , v) (γ' , c)</code>. We prove
|
||
that by the lemma <code class="language-plaintext highlighter-rouge">𝔾-ext</code>, using facts <code class="language-plaintext highlighter-rouge">𝔾 γ γ'</code> and <code class="language-plaintext highlighter-rouge">𝔼 v c</code>.</p>
|
||
</li>
|
||
<li>
|
||
<p>Case <code class="language-plaintext highlighter-rouge">⊥-intro</code>. We have the premise <code class="language-plaintext highlighter-rouge">above-fun ⊥</code>, but that’s impossible.</p>
|
||
</li>
|
||
<li>
|
||
<p>Case <code class="language-plaintext highlighter-rouge">⊔-intro</code>. We have <code class="language-plaintext highlighter-rouge">γ ⊢ M ↓ (v₁ ⊔ v₂)</code> and <code class="language-plaintext highlighter-rouge">above-fun (v₁ ⊔ v₂)</code>
|
||
and need to show <code class="language-plaintext highlighter-rouge">γ' ⊢ M ↓ c</code> and <code class="language-plaintext highlighter-rouge">𝕍 (v₁ ⊔ v₂) c</code> for some <code class="language-plaintext highlighter-rouge">c</code>.
|
||
Again, by <code class="language-plaintext highlighter-rouge">above-fun-⊔</code>, at least one of <code class="language-plaintext highlighter-rouge">v₁</code> or <code class="language-plaintext highlighter-rouge">v₂</code> is greater than
|
||
a function.</p>
|
||
|
||
<ul>
|
||
<li>
|
||
<p>Suppose both <code class="language-plaintext highlighter-rouge">v₁</code> and <code class="language-plaintext highlighter-rouge">v₂</code> are greater than a function value.
|
||
By the induction hypotheses for <code class="language-plaintext highlighter-rouge">γ ⊢ M ↓ v₁</code> and <code class="language-plaintext highlighter-rouge">γ ⊢ M ↓ v₂</code>
|
||
we have <code class="language-plaintext highlighter-rouge">γ' ⊢ M ⇓ c₁</code>, <code class="language-plaintext highlighter-rouge">𝕍 v₁ c₁</code>, <code class="language-plaintext highlighter-rouge">γ' ⊢ M ⇓ c₂</code>, and <code class="language-plaintext highlighter-rouge">𝕍 v₂ c₂</code>
|
||
for some <code class="language-plaintext highlighter-rouge">c₁</code> and <code class="language-plaintext highlighter-rouge">c₂</code>. Because <code class="language-plaintext highlighter-rouge">⇓</code> is deterministic, we have <code class="language-plaintext highlighter-rouge">c₂ ≡ c₁</code>.
|
||
Then by <code class="language-plaintext highlighter-rouge">𝕍⊔-intro</code> we conclude that <code class="language-plaintext highlighter-rouge">𝕍 (v₁ ⊔ v₂) c₁</code>.</p>
|
||
</li>
|
||
<li>
|
||
<p>Without loss of generality, suppose <code class="language-plaintext highlighter-rouge">v₁</code> is greater than a function
|
||
value but <code class="language-plaintext highlighter-rouge">v₂</code> is not. By the induction hypotheses for <code class="language-plaintext highlighter-rouge">γ ⊢ M ↓ v₁</code>,
|
||
and using <code class="language-plaintext highlighter-rouge">𝕍→WHNF</code>, we have <code class="language-plaintext highlighter-rouge">γ' ⊢ M ⇓ clos (ƛ N) γ₁</code>
|
||
and <code class="language-plaintext highlighter-rouge">𝕍 v₁ (clos (ƛ N) γ₁)</code>.
|
||
Then because <code class="language-plaintext highlighter-rouge">v₂</code> is not greater than a function, we also have
|
||
<code class="language-plaintext highlighter-rouge">𝕍 v₂ (clos (ƛ N) γ₁)</code>. We conclude that <code class="language-plaintext highlighter-rouge">𝕍 (v₁ ⊔ v₂) (clos (ƛ N) γ₁)</code>.</p>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li>
|
||
<p>Case <code class="language-plaintext highlighter-rouge">sub</code>. We have <code class="language-plaintext highlighter-rouge">γ ⊢ M ↓ v</code>, <code class="language-plaintext highlighter-rouge">v' ⊑ v</code>, and <code class="language-plaintext highlighter-rouge">above-fun v'</code>.
|
||
We need to show that <code class="language-plaintext highlighter-rouge">γ' ⊢ M ⇓ c</code> and <code class="language-plaintext highlighter-rouge">𝕍 v' c</code> for some <code class="language-plaintext highlighter-rouge">c</code>.
|
||
We have <code class="language-plaintext highlighter-rouge">above-fun v</code> by <code class="language-plaintext highlighter-rouge">above-fun-⊑</code>,
|
||
so the induction hypothesis for <code class="language-plaintext highlighter-rouge">γ ⊢ M ↓ v</code> gives us a closure <code class="language-plaintext highlighter-rouge">c</code>
|
||
such that <code class="language-plaintext highlighter-rouge">γ' ⊢ M ⇓ c</code> and <code class="language-plaintext highlighter-rouge">𝕍 v c</code>. We conclude that <code class="language-plaintext highlighter-rouge">𝕍 v' c</code> by <code class="language-plaintext highlighter-rouge">sub-𝕍</code>.</p>
|
||
</li>
|
||
</ul>
|
||
|
||
<h2 id="proof-of-denotational-adequacy">Proof of denotational adequacy</h2>
|
||
|
||
<p>From the main lemma we can directly show that <code class="language-plaintext highlighter-rouge">ℰ M ≃ ℰ (ƛ N)</code> implies
|
||
that <code class="language-plaintext highlighter-rouge">M</code> big-steps to a lambda, i.e., <code class="language-plaintext highlighter-rouge">∅ ⊢ M ⇓ clos (ƛ N′) γ</code>.</p>
|
||
|
||
<pre class="Agda"><a id="↓→⇓"></a><a id="21083" href="/20.07/Adequacy/#21083" class="Function">↓→⇓</a> <a id="21087" class="Symbol">:</a> <a id="21089" class="Symbol">∀{</a><a id="21091" href="/20.07/Adequacy/#21091" class="Bound">M</a> <a id="21093" class="Symbol">:</a> <a id="21095" href="/20.07/Untyped/#3175" class="InductiveConstructor">∅</a> <a id="21097" href="/20.07/Untyped/#4294" class="Datatype Operator">⊢</a> <a id="21099" href="/20.07/Untyped/#2888" class="InductiveConstructor">★</a><a id="21100" class="Symbol">}{</a><a id="21102" href="/20.07/Adequacy/#21102" class="Bound">N</a> <a id="21104" class="Symbol">:</a> <a id="21106" href="/20.07/Untyped/#3175" class="InductiveConstructor">∅</a> <a id="21108" href="/20.07/Untyped/#3191" class="InductiveConstructor Operator">,</a> <a id="21110" href="/20.07/Untyped/#2888" class="InductiveConstructor">★</a> <a id="21112" href="/20.07/Untyped/#4294" class="Datatype Operator">⊢</a> <a id="21114" href="/20.07/Untyped/#2888" class="InductiveConstructor">★</a><a id="21115" class="Symbol">}</a> <a id="21118" class="Symbol">→</a> <a id="21121" href="/20.07/Denotational/#17486" class="Function">ℰ</a> <a id="21123" href="/20.07/Adequacy/#21091" class="Bound">M</a> <a id="21125" href="/20.07/Denotational/#17668" class="Function Operator">≃</a> <a id="21127" href="/20.07/Denotational/#17486" class="Function">ℰ</a> <a id="21129" class="Symbol">(</a><a id="21130" href="/20.07/Untyped/#4382" class="InductiveConstructor Operator">ƛ</a> <a id="21132" href="/20.07/Adequacy/#21102" class="Bound">N</a><a id="21133" class="Symbol">)</a>
|
||
<a id="21144" class="Symbol">→</a> <a id="21147" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">Σ[</a> <a id="21150" href="/20.07/Adequacy/#21150" class="Bound">Γ</a> <a id="21152" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">∈</a> <a id="21154" href="/20.07/Untyped/#3153" class="Datatype">Context</a> <a id="21162" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">]</a> <a id="21164" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">Σ[</a> <a id="21167" href="/20.07/Adequacy/#21167" class="Bound">N′</a> <a id="21170" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">∈</a> <a id="21172" class="Symbol">(</a><a id="21173" href="/20.07/Adequacy/#21150" class="Bound">Γ</a> <a id="21175" href="/20.07/Untyped/#3191" class="InductiveConstructor Operator">,</a> <a id="21177" href="/20.07/Untyped/#2888" class="InductiveConstructor">★</a> <a id="21179" href="/20.07/Untyped/#4294" class="Datatype Operator">⊢</a> <a id="21181" href="/20.07/Untyped/#2888" class="InductiveConstructor">★</a><a id="21182" class="Symbol">)</a> <a id="21184" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">]</a> <a id="21186" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">Σ[</a> <a id="21189" href="/20.07/Adequacy/#21189" class="Bound">γ</a> <a id="21191" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">∈</a> <a id="21193" href="/20.07/BigStep/#2437" class="Function">ClosEnv</a> <a id="21201" href="/20.07/Adequacy/#21150" class="Bound">Γ</a> <a id="21203" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">]</a>
|
||
<a id="21217" href="/20.07/BigStep/#2650" class="Function">∅'</a> <a id="21220" href="/20.07/BigStep/#3021" class="Datatype Operator">⊢</a> <a id="21222" href="/20.07/Adequacy/#21091" class="Bound">M</a> <a id="21224" href="/20.07/BigStep/#3021" class="Datatype Operator">⇓</a> <a id="21226" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="21231" class="Symbol">(</a><a id="21232" href="/20.07/Untyped/#4382" class="InductiveConstructor Operator">ƛ</a> <a id="21234" href="/20.07/Adequacy/#21167" class="Bound">N′</a><a id="21236" class="Symbol">)</a> <a id="21238" href="/20.07/Adequacy/#21189" class="Bound">γ</a>
|
||
<a id="21240" href="/20.07/Adequacy/#21083" class="Function">↓→⇓</a><a id="21243" class="Symbol">{</a><a id="21244" href="/20.07/Adequacy/#21244" class="Bound">M</a><a id="21245" class="Symbol">}{</a><a id="21247" href="/20.07/Adequacy/#21247" class="Bound">N</a><a id="21248" class="Symbol">}</a> <a id="21250" href="/20.07/Adequacy/#21250" class="Bound">eq</a>
|
||
<a id="21257" class="Keyword">with</a> <a id="21262" href="/20.07/Adequacy/#16046" class="Function">↓→𝔼</a> <a id="21266" href="/20.07/Adequacy/#9044" class="Function">𝔾-∅</a> <a id="21270" class="Symbol">((</a><a id="21272" href="Agda.Builtin.Sigma.html#237" class="Field">proj₂</a> <a id="21278" class="Symbol">(</a><a id="21279" href="/20.07/Adequacy/#21250" class="Bound">eq</a> <a id="21282" href="/20.07/Denotational/#7412" class="Function">`∅</a> <a id="21285" class="Symbol">(</a><a id="21286" href="/20.07/Denotational/#4171" class="InductiveConstructor">⊥</a> <a id="21288" href="/20.07/Denotational/#4183" class="InductiveConstructor Operator">↦</a> <a id="21290" href="/20.07/Denotational/#4171" class="InductiveConstructor">⊥</a><a id="21291" class="Symbol">)))</a> <a id="21295" class="Symbol">(</a><a id="21296" href="/20.07/Denotational/#9597" class="InductiveConstructor">↦-intro</a> <a id="21304" href="/20.07/Denotational/#9709" class="InductiveConstructor">⊥-intro</a><a id="21311" class="Symbol">))</a>
|
||
<a id="21331" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="21333" href="/20.07/Denotational/#4171" class="InductiveConstructor">⊥</a> <a id="21335" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="21337" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="21339" href="/20.07/Denotational/#4171" class="InductiveConstructor">⊥</a> <a id="21341" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="21343" href="/20.07/Denotational/#5638" class="Function">⊑-refl</a> <a id="21350" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="21352" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="21354" class="Symbol">...</a> <a id="21358" class="Symbol">|</a> <a id="21360" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="21362" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="21367" class="Symbol">{</a><a id="21368" href="/20.07/Adequacy/#21368" class="Bound">Γ</a><a id="21369" class="Symbol">}</a> <a id="21371" href="/20.07/Adequacy/#21371" class="Bound">M′</a> <a id="21374" href="/20.07/Adequacy/#21374" class="Bound">γ</a> <a id="21376" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="21378" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="21380" href="/20.07/Adequacy/#21380" class="Bound">M⇓c</a> <a id="21384" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="21386" href="/20.07/Adequacy/#21386" class="Bound">Vc</a> <a id="21389" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="21391" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="21397" class="Keyword">with</a> <a id="21402" href="/20.07/Adequacy/#9549" class="Function">𝕍→WHNF</a> <a id="21409" href="/20.07/Adequacy/#21386" class="Bound">Vc</a>
|
||
<a id="21412" class="Symbol">...</a> <a id="21416" class="Symbol">|</a> <a id="21418" href="/20.07/Adequacy/#9442" class="InductiveConstructor Operator">ƛ_</a> <a id="21421" class="Symbol">{</a><a id="21422" class="Argument">N</a> <a id="21424" class="Symbol">=</a> <a id="21426" href="/20.07/Adequacy/#21426" class="Bound">N′</a><a id="21428" class="Symbol">}</a> <a id="21430" class="Symbol">=</a>
|
||
<a id="21436" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="21438" class="Bound">Γ</a> <a id="21440" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="21442" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="21444" href="/20.07/Adequacy/#21426" class="Bound">N′</a> <a id="21447" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="21449" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="21451" class="Bound">γ</a> <a id="21453" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="21455" class="Bound">M⇓c</a> <a id="21459" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="21462" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="21464" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
</pre>
|
||
<p>The proof goes as follows. We derive <code class="language-plaintext highlighter-rouge">∅ ⊢ ƛ N ↓ ⊥ ↦ ⊥</code> and
|
||
then <code class="language-plaintext highlighter-rouge">ℰ M ≃ ℰ (ƛ N)</code> gives us <code class="language-plaintext highlighter-rouge">∅ ⊢ M ↓ ⊥ ↦ ⊥</code>. We conclude
|
||
by applying the main lemma to obtain <code class="language-plaintext highlighter-rouge">∅ ⊢ M ⇓ clos (ƛ N′) γ</code>
|
||
for some <code class="language-plaintext highlighter-rouge">N′</code> and <code class="language-plaintext highlighter-rouge">γ</code>.</p>
|
||
|
||
<p>Now to prove the adequacy property. We apply the above
|
||
lemma to obtain <code class="language-plaintext highlighter-rouge">∅ ⊢ M ⇓ clos (ƛ N′) γ</code> and then
|
||
apply <code class="language-plaintext highlighter-rouge">cbn→reduce</code> to conclude.</p>
|
||
|
||
<pre class="Agda"><a id="adequacy"></a><a id="21815" href="/20.07/Adequacy/#21815" class="Function">adequacy</a> <a id="21824" class="Symbol">:</a> <a id="21826" class="Symbol">∀{</a><a id="21828" href="/20.07/Adequacy/#21828" class="Bound">M</a> <a id="21830" class="Symbol">:</a> <a id="21832" href="/20.07/Untyped/#3175" class="InductiveConstructor">∅</a> <a id="21834" href="/20.07/Untyped/#4294" class="Datatype Operator">⊢</a> <a id="21836" href="/20.07/Untyped/#2888" class="InductiveConstructor">★</a><a id="21837" class="Symbol">}{</a><a id="21839" href="/20.07/Adequacy/#21839" class="Bound">N</a> <a id="21841" class="Symbol">:</a> <a id="21843" href="/20.07/Untyped/#3175" class="InductiveConstructor">∅</a> <a id="21845" href="/20.07/Untyped/#3191" class="InductiveConstructor Operator">,</a> <a id="21847" href="/20.07/Untyped/#2888" class="InductiveConstructor">★</a> <a id="21849" href="/20.07/Untyped/#4294" class="Datatype Operator">⊢</a> <a id="21851" href="/20.07/Untyped/#2888" class="InductiveConstructor">★</a><a id="21852" class="Symbol">}</a>
|
||
<a id="21857" class="Symbol">→</a> <a id="21860" href="/20.07/Denotational/#17486" class="Function">ℰ</a> <a id="21862" href="/20.07/Adequacy/#21828" class="Bound">M</a> <a id="21864" href="/20.07/Denotational/#17668" class="Function Operator">≃</a> <a id="21866" href="/20.07/Denotational/#17486" class="Function">ℰ</a> <a id="21868" class="Symbol">(</a><a id="21869" href="/20.07/Untyped/#4382" class="InductiveConstructor Operator">ƛ</a> <a id="21871" href="/20.07/Adequacy/#21839" class="Bound">N</a><a id="21872" class="Symbol">)</a>
|
||
<a id="21877" class="Symbol">→</a> <a id="21879" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">Σ[</a> <a id="21882" href="/20.07/Adequacy/#21882" class="Bound">N′</a> <a id="21885" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">∈</a> <a id="21887" class="Symbol">(</a><a id="21888" href="/20.07/Untyped/#3175" class="InductiveConstructor">∅</a> <a id="21890" href="/20.07/Untyped/#3191" class="InductiveConstructor Operator">,</a> <a id="21892" href="/20.07/Untyped/#2888" class="InductiveConstructor">★</a> <a id="21894" href="/20.07/Untyped/#4294" class="Datatype Operator">⊢</a> <a id="21896" href="/20.07/Untyped/#2888" class="InductiveConstructor">★</a><a id="21897" class="Symbol">)</a> <a id="21899" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">]</a>
|
||
<a id="21906" class="Symbol">(</a><a id="21907" href="/20.07/Adequacy/#21828" class="Bound">M</a> <a id="21909" href="/20.07/Untyped/#11068" class="Datatype Operator">—↠</a> <a id="21912" href="/20.07/Untyped/#4382" class="InductiveConstructor Operator">ƛ</a> <a id="21914" href="/20.07/Adequacy/#21882" class="Bound">N′</a><a id="21916" class="Symbol">)</a>
|
||
<a id="21918" href="/20.07/Adequacy/#21815" class="Function">adequacy</a><a id="21926" class="Symbol">{</a><a id="21927" href="/20.07/Adequacy/#21927" class="Bound">M</a><a id="21928" class="Symbol">}{</a><a id="21930" href="/20.07/Adequacy/#21930" class="Bound">N</a><a id="21931" class="Symbol">}</a> <a id="21933" href="/20.07/Adequacy/#21933" class="Bound">eq</a>
|
||
<a id="21940" class="Keyword">with</a> <a id="21945" href="/20.07/Adequacy/#21083" class="Function">↓→⇓</a> <a id="21949" href="/20.07/Adequacy/#21933" class="Bound">eq</a>
|
||
<a id="21952" class="Symbol">...</a> <a id="21956" class="Symbol">|</a> <a id="21958" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="21960" href="/20.07/Adequacy/#21960" class="Bound">Γ</a> <a id="21962" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="21964" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="21966" href="/20.07/Adequacy/#21966" class="Bound">N′</a> <a id="21969" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="21971" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="21973" href="/20.07/Adequacy/#21973" class="Bound">γ</a> <a id="21975" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="21977" href="/20.07/Adequacy/#21977" class="Bound">M⇓</a> <a id="21980" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="21982" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="21984" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="21986" class="Symbol">=</a>
|
||
<a id="21992" href="/20.07/BigStep/#12205" class="Function">cbn→reduce</a> <a id="22003" href="/20.07/Adequacy/#21977" class="Bound">M⇓</a>
|
||
</pre>
|
||
<h2 id="call-by-name-is-equivalent-to-beta-reduction">Call-by-name is equivalent to beta reduction</h2>
|
||
|
||
<p>As promised, we return to the question of whether call-by-name
|
||
evaluation is equivalent to beta reduction. In chapter
|
||
<a href="/20.07/BigStep/">BigStep</a> we established the forward
|
||
direction: that if call-by-name produces a result, then the program
|
||
beta reduces to a lambda abstraction (<code class="language-plaintext highlighter-rouge">cbn→reduce</code>). We now prove the backward
|
||
direction of the if-and-only-if, leveraging our results about the
|
||
denotational semantics.</p>
|
||
|
||
<pre class="Agda"><a id="reduce→cbn"></a><a id="22487" href="/20.07/Adequacy/#22487" class="Function">reduce→cbn</a> <a id="22498" class="Symbol">:</a> <a id="22500" class="Symbol">∀</a> <a id="22502" class="Symbol">{</a><a id="22503" href="/20.07/Adequacy/#22503" class="Bound">M</a> <a id="22505" class="Symbol">:</a> <a id="22507" href="/20.07/Untyped/#3175" class="InductiveConstructor">∅</a> <a id="22509" href="/20.07/Untyped/#4294" class="Datatype Operator">⊢</a> <a id="22511" href="/20.07/Untyped/#2888" class="InductiveConstructor">★</a><a id="22512" class="Symbol">}</a> <a id="22514" class="Symbol">{</a><a id="22515" href="/20.07/Adequacy/#22515" class="Bound">N</a> <a id="22517" class="Symbol">:</a> <a id="22519" href="/20.07/Untyped/#3175" class="InductiveConstructor">∅</a> <a id="22521" href="/20.07/Untyped/#3191" class="InductiveConstructor Operator">,</a> <a id="22523" href="/20.07/Untyped/#2888" class="InductiveConstructor">★</a> <a id="22525" href="/20.07/Untyped/#4294" class="Datatype Operator">⊢</a> <a id="22527" href="/20.07/Untyped/#2888" class="InductiveConstructor">★</a><a id="22528" class="Symbol">}</a>
|
||
<a id="22541" class="Symbol">→</a> <a id="22543" href="/20.07/Adequacy/#22503" class="Bound">M</a> <a id="22545" href="/20.07/Untyped/#11068" class="Datatype Operator">—↠</a> <a id="22548" href="/20.07/Untyped/#4382" class="InductiveConstructor Operator">ƛ</a> <a id="22550" href="/20.07/Adequacy/#22515" class="Bound">N</a>
|
||
<a id="22563" class="Symbol">→</a> <a id="22565" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">Σ[</a> <a id="22568" href="/20.07/Adequacy/#22568" class="Bound">Δ</a> <a id="22570" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">∈</a> <a id="22572" href="/20.07/Untyped/#3153" class="Datatype">Context</a> <a id="22580" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">]</a> <a id="22582" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">Σ[</a> <a id="22585" href="/20.07/Adequacy/#22585" class="Bound">N′</a> <a id="22588" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">∈</a> <a id="22590" href="/20.07/Adequacy/#22568" class="Bound">Δ</a> <a id="22592" href="/20.07/Untyped/#3191" class="InductiveConstructor Operator">,</a> <a id="22594" href="/20.07/Untyped/#2888" class="InductiveConstructor">★</a> <a id="22596" href="/20.07/Untyped/#4294" class="Datatype Operator">⊢</a> <a id="22598" href="/20.07/Untyped/#2888" class="InductiveConstructor">★</a> <a id="22600" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">]</a> <a id="22602" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">Σ[</a> <a id="22605" href="/20.07/Adequacy/#22605" class="Bound">δ</a> <a id="22607" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">∈</a> <a id="22609" href="/20.07/BigStep/#2437" class="Function">ClosEnv</a> <a id="22617" href="/20.07/Adequacy/#22568" class="Bound">Δ</a> <a id="22619" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">]</a>
|
||
<a id="22634" href="/20.07/BigStep/#2650" class="Function">∅'</a> <a id="22637" href="/20.07/BigStep/#3021" class="Datatype Operator">⊢</a> <a id="22639" href="/20.07/Adequacy/#22503" class="Bound">M</a> <a id="22641" href="/20.07/BigStep/#3021" class="Datatype Operator">⇓</a> <a id="22643" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="22648" class="Symbol">(</a><a id="22649" href="/20.07/Untyped/#4382" class="InductiveConstructor Operator">ƛ</a> <a id="22651" href="/20.07/Adequacy/#22585" class="Bound">N′</a><a id="22653" class="Symbol">)</a> <a id="22655" href="/20.07/Adequacy/#22605" class="Bound">δ</a>
|
||
<a id="22657" href="/20.07/Adequacy/#22487" class="Function">reduce→cbn</a> <a id="22668" href="/20.07/Adequacy/#22668" class="Bound">M—↠ƛN</a> <a id="22674" class="Symbol">=</a> <a id="22676" href="/20.07/Adequacy/#21083" class="Function">↓→⇓</a> <a id="22680" class="Symbol">(</a><a id="22681" href="/20.07/Soundness/#23358" class="Function">soundness</a> <a id="22691" href="/20.07/Adequacy/#22668" class="Bound">M—↠ƛN</a><a id="22696" class="Symbol">)</a>
|
||
</pre>
|
||
<p>Suppose <code class="language-plaintext highlighter-rouge">M —↠ ƛ N</code>. Soundness of the denotational semantics gives us
|
||
<code class="language-plaintext highlighter-rouge">ℰ M ≃ ℰ (ƛ N)</code>. Then by <code class="language-plaintext highlighter-rouge">↓→⇓</code> we conclude that
|
||
<code class="language-plaintext highlighter-rouge">∅' ⊢ M ⇓ clos (ƛ N′) δ</code> for some <code class="language-plaintext highlighter-rouge">N′</code> and <code class="language-plaintext highlighter-rouge">δ</code>.</p>
|
||
|
||
<p>Putting the two directions of the if-and-only-if together, we
|
||
establish that call-by-name evaluation is equivalent to beta reduction
|
||
in the following sense.</p>
|
||
|
||
<pre class="Agda"><a id="cbn↔reduce"></a><a id="23031" href="/20.07/Adequacy/#23031" class="Function">cbn↔reduce</a> <a id="23042" class="Symbol">:</a> <a id="23044" class="Symbol">∀</a> <a id="23046" class="Symbol">{</a><a id="23047" href="/20.07/Adequacy/#23047" class="Bound">M</a> <a id="23049" class="Symbol">:</a> <a id="23051" href="/20.07/Untyped/#3175" class="InductiveConstructor">∅</a> <a id="23053" href="/20.07/Untyped/#4294" class="Datatype Operator">⊢</a> <a id="23055" href="/20.07/Untyped/#2888" class="InductiveConstructor">★</a><a id="23056" class="Symbol">}</a>
|
||
<a id="23069" class="Symbol">→</a> <a id="23071" class="Symbol">(</a><a id="23072" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">Σ[</a> <a id="23075" href="/20.07/Adequacy/#23075" class="Bound">N</a> <a id="23077" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">∈</a> <a id="23079" href="/20.07/Untyped/#3175" class="InductiveConstructor">∅</a> <a id="23081" href="/20.07/Untyped/#3191" class="InductiveConstructor Operator">,</a> <a id="23083" href="/20.07/Untyped/#2888" class="InductiveConstructor">★</a> <a id="23085" href="/20.07/Untyped/#4294" class="Datatype Operator">⊢</a> <a id="23087" href="/20.07/Untyped/#2888" class="InductiveConstructor">★</a> <a id="23089" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">]</a> <a id="23091" class="Symbol">(</a><a id="23092" href="/20.07/Adequacy/#23047" class="Bound">M</a> <a id="23094" href="/20.07/Untyped/#11068" class="Datatype Operator">—↠</a> <a id="23097" href="/20.07/Untyped/#4382" class="InductiveConstructor Operator">ƛ</a> <a id="23099" href="/20.07/Adequacy/#23075" class="Bound">N</a><a id="23100" class="Symbol">))</a>
|
||
<a id="23116" href="/20.07/Denotational/#17007" class="Function Operator">iff</a>
|
||
<a id="23133" class="Symbol">(</a><a id="23134" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">Σ[</a> <a id="23137" href="/20.07/Adequacy/#23137" class="Bound">Δ</a> <a id="23139" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">∈</a> <a id="23141" href="/20.07/Untyped/#3153" class="Datatype">Context</a> <a id="23149" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">]</a> <a id="23151" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">Σ[</a> <a id="23154" href="/20.07/Adequacy/#23154" class="Bound">N′</a> <a id="23157" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">∈</a> <a id="23159" href="/20.07/Adequacy/#23137" class="Bound">Δ</a> <a id="23161" href="/20.07/Untyped/#3191" class="InductiveConstructor Operator">,</a> <a id="23163" href="/20.07/Untyped/#2888" class="InductiveConstructor">★</a> <a id="23165" href="/20.07/Untyped/#4294" class="Datatype Operator">⊢</a> <a id="23167" href="/20.07/Untyped/#2888" class="InductiveConstructor">★</a> <a id="23169" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">]</a> <a id="23171" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">Σ[</a> <a id="23174" href="/20.07/Adequacy/#23174" class="Bound">δ</a> <a id="23176" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">∈</a> <a id="23178" href="/20.07/BigStep/#2437" class="Function">ClosEnv</a> <a id="23186" href="/20.07/Adequacy/#23137" class="Bound">Δ</a> <a id="23188" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#911" class="Function">]</a>
|
||
<a id="23205" href="/20.07/BigStep/#2650" class="Function">∅'</a> <a id="23208" href="/20.07/BigStep/#3021" class="Datatype Operator">⊢</a> <a id="23210" href="/20.07/Adequacy/#23047" class="Bound">M</a> <a id="23212" href="/20.07/BigStep/#3021" class="Datatype Operator">⇓</a> <a id="23214" href="/20.07/BigStep/#2486" class="InductiveConstructor">clos</a> <a id="23219" class="Symbol">(</a><a id="23220" href="/20.07/Untyped/#4382" class="InductiveConstructor Operator">ƛ</a> <a id="23222" href="/20.07/Adequacy/#23154" class="Bound">N′</a><a id="23224" class="Symbol">)</a> <a id="23226" href="/20.07/Adequacy/#23174" class="Bound">δ</a><a id="23227" class="Symbol">)</a>
|
||
<a id="23229" href="/20.07/Adequacy/#23031" class="Function">cbn↔reduce</a> <a id="23240" class="Symbol">{</a><a id="23241" href="/20.07/Adequacy/#23241" class="Bound">M</a><a id="23242" class="Symbol">}</a> <a id="23244" class="Symbol">=</a> <a id="23246" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="23248" class="Symbol">(λ</a> <a id="23251" href="/20.07/Adequacy/#23251" class="Bound">x</a> <a id="23253" class="Symbol">→</a> <a id="23255" href="/20.07/Adequacy/#22487" class="Function">reduce→cbn</a> <a id="23266" class="Symbol">(</a><a id="23267" href="Agda.Builtin.Sigma.html#237" class="Field">proj₂</a> <a id="23273" href="/20.07/Adequacy/#23251" class="Bound">x</a><a id="23274" class="Symbol">))</a> <a id="23277" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a>
|
||
<a id="23298" class="Symbol">(λ</a> <a id="23301" href="/20.07/Adequacy/#23301" class="Bound">x</a> <a id="23303" class="Symbol">→</a> <a id="23305" href="/20.07/BigStep/#12205" class="Function">cbn→reduce</a> <a id="23316" class="Symbol">(</a><a id="23317" href="Agda.Builtin.Sigma.html#237" class="Field">proj₂</a> <a id="23323" class="Symbol">(</a><a id="23324" href="Agda.Builtin.Sigma.html#237" class="Field">proj₂</a> <a id="23330" class="Symbol">(</a><a id="23331" href="Agda.Builtin.Sigma.html#237" class="Field">proj₂</a> <a id="23337" href="/20.07/Adequacy/#23301" class="Bound">x</a><a id="23338" class="Symbol">))))</a> <a id="23343" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
</pre>
|
||
|
||
<h2 id="unicode">Unicode</h2>
|
||
|
||
<p>This chapter uses the following unicode:</p>
|
||
|
||
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>𝔼 U+1D53C MATHEMATICAL DOUBLE-STRUCK CAPITAL E (\bE)
|
||
𝔾 U+1D53E MATHEMATICAL DOUBLE-STRUCK CAPITAL G (\bG)
|
||
𝕍 U+1D53E MATHEMATICAL DOUBLE-STRUCK CAPITAL V (\bV)
|
||
</code></pre></div></div>
|
||
|
||
</div>
|
||
|
||
<p style="text-align:center;">
|
||
|
||
<a alt="Previous chapter" href="/20.07/Soundness/">Prev</a>
|
||
|
||
|
||
•
|
||
|
||
|
||
<a alt="Source code" href="https://github.com/plfa/plfa.github.io/blob/dev-20.07/src/plfa/part3/Adequacy.lagda.md">Source</a>
|
||
|
||
|
||
•
|
||
|
||
|
||
<a alt="Next chapter" href="/20.07/ContextualEquivalence/">Next</a>
|
||
|
||
</p>
|
||
|
||
|
||
</article>
|
||
|
||
</div>
|
||
</main><footer class="site-footer h-card">
|
||
<data class="u-url" href="/20.07/"></data>
|
||
|
||
<div class="wrapper">
|
||
|
||
<h2 class="footer-heading">Programming Language Foundations in Agda
|
||
</h2><div class="footer-col-wrapper">
|
||
<div class="footer-col footer-col-1">
|
||
<ul class="contact-list">
|
||
<li class="p-name">Philip Wadler</li>
|
||
<li><a class="u-email" href="mailto:wadler@inf.ed.ac.uk">wadler@inf.ed.ac.uk</a></li>
|
||
</ul>
|
||
</div>
|
||
|
||
<div class="footer-col footer-col-2"><ul class="social-media-list"><li><a href="https://github.com/wadler"><svg class="svg-icon"><use xlink:href="/20.07/assets/minima-social-icons.svg#github"></use></svg> <span class="username">wadler</span></a></li></ul>
|
||
</div>
|
||
|
||
<div class="footer-col footer-col-3"></div>
|
||
</div><div class="footer-col-wrapper">
|
||
<div class="footer-col footer-col-1">
|
||
<ul class="contact-list">
|
||
<li class="p-name">Wen Kokke</li>
|
||
<li><a class="u-email" href="mailto:wen.kokke@ed.ac.uk">wen.kokke@ed.ac.uk</a></li>
|
||
</ul>
|
||
</div>
|
||
|
||
<div class="footer-col footer-col-2"><ul class="social-media-list"><li><a href="https://github.com/wenkokke"><svg class="svg-icon"><use xlink:href="/20.07/assets/minima-social-icons.svg#github"></use></svg> <span class="username">wenkokke</span></a></li><li><a href="https://www.twitter.com/wenkokke"><svg class="svg-icon"><use xlink:href="/20.07/assets/minima-social-icons.svg#twitter"></use></svg> <span class="username">wenkokke</span></a></li></ul>
|
||
</div>
|
||
|
||
<div class="footer-col footer-col-3"></div>
|
||
</div><div class="footer-col-wrapper">
|
||
<div class="footer-col footer-col-1">
|
||
<ul class="contact-list">
|
||
<li class="p-name">Jeremy G. Siek</li>
|
||
<li><a class="u-email" href="mailto:jsiek@indiana.edu">jsiek@indiana.edu</a></li>
|
||
</ul>
|
||
</div>
|
||
|
||
<div class="footer-col footer-col-2"><ul class="social-media-list"><li><a href="https://github.com/jsiek"><svg class="svg-icon"><use xlink:href="/20.07/assets/minima-social-icons.svg#github"></use></svg> <span class="username">jsiek</span></a></li><li><a href="https://www.twitter.com/jeremysiek"><svg class="svg-icon"><use xlink:href="/20.07/assets/minima-social-icons.svg#twitter"></use></svg> <span class="username">jeremysiek</span></a></li></ul>
|
||
</div>
|
||
|
||
<div class="footer-col footer-col-3"></div>
|
||
</div>This work is licensed under a <a rel="license" href="https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>
|
||
</div>
|
||
</footer>
|
||
<!-- Import jQuery -->
|
||
<script type="text/javascript" src="/20.07/assets/jquery.js"></script>
|
||
|
||
<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/4.2.2/anchor.min.js" integrity="sha256-E4RlfxwyJVmkkk0szw7LYJxuPlp6evtPSBDlWHsYYL8=" crossorigin="anonymous"></script>
|
||
<script type="text/javascript">
|
||
anchors.add();
|
||
</script>
|
||
|
||
<script type="text/javascript">
|
||
|
||
// Makes sandwhich menu works
|
||
$('.menu-icon').click(function(){
|
||
$('.trigger').toggle();
|
||
});
|
||
|
||
// Script which allows for foldable code blocks
|
||
$('div.foldable pre').each(function(){
|
||
var autoHeight = $(this).height();
|
||
var lineHeight = parseFloat($(this).css('line-height'));
|
||
|
||
var plus = $("<div></div>");
|
||
var horLine = $("<div></div>");
|
||
var verLine = $("<div></div>");
|
||
$(this).prepend(plus);
|
||
plus.css({
|
||
'position' : 'relative',
|
||
'float' : 'right',
|
||
'right' : '-' + (0.5 * lineHeight - 1.5) + 'px',
|
||
'width' : lineHeight,
|
||
'height' : lineHeight});
|
||
verLine.css({
|
||
'position' : 'relative',
|
||
'height' : lineHeight,
|
||
'width' : '3px',
|
||
'background-color' : '#C1E0FF'});
|
||
horLine.css({
|
||
'position' : 'relative',
|
||
'top' : '-' + (0.5 * lineHeight + 1.5) + 'px',
|
||
'left' : '-' + (0.5 * lineHeight - 1.5) + 'px',
|
||
'height' : '3px',
|
||
'width' : lineHeight,
|
||
'background-color' : '#C1E0FF'});
|
||
plus.append(verLine);
|
||
plus.append(horLine);
|
||
|
||
$(this).height(2.0 * lineHeight);
|
||
$(this).css('overflow','hidden');
|
||
|
||
$(this).click(function(){
|
||
if ($(this).height() == autoHeight) {
|
||
$(this).height(2.0 * lineHeight);
|
||
plus.show();
|
||
}
|
||
else {
|
||
$(this).height('auto');
|
||
plus.hide();
|
||
}
|
||
});
|
||
});
|
||
</script>
|
||
|
||
<!-- Import KaTeX -->
|
||
<script type="text/javascript" src="/20.07/assets/katex.js"></script>
|
||
|
||
<!-- Script which renders TeX using KaTeX -->
|
||
<script type="text/javascript">
|
||
$("script[type='math/tex']").replaceWith(
|
||
function(){
|
||
var tex = $(this).text();
|
||
return "<span class=\"inline-equation\">" +
|
||
katex.renderToString(tex) +
|
||
"</span>";
|
||
});
|
||
$("script[type='math/tex; mode=display']").replaceWith(
|
||
function(){
|
||
var tex = $(this).text().replace(/%.*?(\n|$)/g,"");
|
||
return "<div class=\"equation\">" +
|
||
katex.renderToString("\\displaystyle "+tex) +
|
||
"</div>";
|
||
});
|
||
</script>
|
||
</body>
|
||
|
||
</html>
|