From 6f1b015820136b58108a049f96d0005c5fbed781 Mon Sep 17 00:00:00 2001 From: KokunoYumeto <208192274+KokunoYumeto@users.noreply.github.com> Date: Mon, 30 Nov 2026 22:30:51 +0100 Subject: [PATCH 1/3] proof-theory/natural-deduction: corrections (50 places) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit grafting.tex: - l. 25: The upper subproof concludes A under B, and the following implication elimination concludes A. The introduced implication must therefore be B -> A, as the preceding prose already states. - l. 51: Formula compatibility alone does not prevent discharge capture. If a substituted open C^y is inserted above an existing y-discharge, that discharge closes it even though the grafting operation intends to retain it. - l. 54: Grafting removes the selected open B^x leaves from delta 1. This follows directly by inspecting the replacement tree. - l. 66: This definition substitutes proofs with labelled sequent contexts into an N2 proof. The inserted proof is also N2; N1 proofs have formula nodes. - l. 68: Merely adjoining Gamma 2 retains the removed x:B dependency, whereas N2 contexts record exactly the remaining open assumptions. - l. 76: Labels must be compatible, and no open label of Γ_2 may be discharged in δ_1. - l. 81: Only delta 1 and delta 2 are quantified. The recursion traverses delta 1, whose selected leaves are replaced by fixed delta 2. The added explanation verifies preservation of inference contexts and both freshness conditions, rather than citing an undefined delta. quantifiers.tex: - l. 32: This lemma introduces a new replacement term and literally replaces constants throughout formulas, unlike a shorthand after a fixed term declaration. - l. 113: The last inference under discussion is binary existential elimination, but the output tree repeats universal introduction with an undefined delta-prime. - l. 119: The tree repeated ∀ introduction; the case is ∃ elimination. - l. 125: The conclusion is the substituted one, and the condition concerns the assumptions that remain open. - l. 133: The chapter requires global label compatibility: any two assumptions with the same label must have the same formula, even if discharged in separate branches. - l. 136: Discharge labels must not be reused, or local substitutions give one label to two formulas. - l. 140: Existential elimination has two immediate subproofs. Its eigenconstant is confined to the minor-premise proof; allowing it in the major-premise proof would not imply the preceding definition of regularity. - l. 145: Renaming an already clean highest inference need not reduce the induction parameter. - l. 158, 182: The selected inference is a highest dirty one: the ones above it are clean. rules-proofs.tex: - l. 68: The first introduction discharges no B assumption. An unused x label is logically permitted, but contradicts the next sentence saying the example omitted that label. - l. 131: Sequent nodes and identity axioms belong to N2 in the next section. Correct the proof-object description to match the explicit definition. - l. 178: The ternary constructor explicitly pairs delta 1,delta 2,delta 3 with premises A1,A2,A3. Its third branch mistakenly repeats the second premise. - l. 191: The general preceding discharge clause and the N1c rule table already entail discharge for classical reductio. The explicit rule-by-rule list is nevertheless incomplete: FalseCl is a unary rule that discharges its indicated negated assumption. - l. 202: These are formula-tree rules N1c/N1i, whereas N2 is introduced in the next section. - l. 221: This height definition is for the N1 formula proofs just defined, whose end object is a formula. Sequents are not their tree nodes. - l. 247: Delta 1 is the single assumption and the text correctly assigns it height zero earlier. Delta 2 and delta 3 each append one conjunction-elimination inference, so both have height one. sequents.tex: - l. 13: This paragraph describes formula conclusions and open assumptions before constructing the N2 sequent notation. Those are the N1 systems from the preceding section; G1 has sequent nodes already. - l. 45: N1 permits vacuous discharge, including classical reductio, so the claimed exact correspondence requires the N2 classical rule to allow absence of its indicated negated assumption too. - l. 137, 139: Induction supplies an N1 proof of the premise C, while delta-prime names the completed implication proof after the B assumptions are discharged. Introduce delta 1-prime and use it consistently in the two output trees. - l. 144, 152: The proof of the premise C has its own name. translation-G2i.tex: - l. 12: A full-source search finds the G2c table but no definition of G2i before its use. - l. 25: In the singleton-succedent case the proposition must identify C with that sole formula; A has not been bound elsewhere in this statement. - l. 31: No G2ci calculus is defined. The proposition and its explicit cut-induction case concern G2i with Cut. - l. 42: Classical N2c subproofs would not establish that result. - l. 67: The displayed inference adds A to the antecedent; its rule name and surrounding case heading must both be left weakening. - l. 86, 89: The G2i source proof pi 1 has unlabelled multiset contexts. The induction-result N2i proof is the object with labelled y:A and x:A, and the proof in which no x-labelled formula is discharged after the initial alpha-renaming convention. - l. 105: Induction first supplies delta 1 of the premise; appending implication introduction produces the desired delta. The original reverses that construction. - l. 123: Both cases direct assumption/discharge label renaming in an unlabelled source G2i proof pi_i. Those labels belong to the inductively obtained N2i proof delta_i. - l. 135: The inserted implication elimination uses delta 1 with open context Gamma 1-prime, so its conclusion and every affected descendant context must retain those assumptions. - l. 138, 154: The context of δ_1 is added to every context affected, and eigenvariables and labels are freshened first. - l. 203: The remaining rules were not treated. translation-N2i.tex: - l. 14: The target calculus for intuitionistic logic is G2i. - l. 55: The induction statement maps a bottom conclusion to empty succedent in every case, including vacuous implication introduction. - l. 71: When B is ⊥ the induction gives an empty succedent, which is first weakened. - l. 92: Delta 2 concludes B, so its induction result is empty exactly when B is bottom, independently of A. Restore B by right weakening when necessary. - l. 92: The induction announces cases without limiting them to examples but omits conjunction, disjunction, negation, quantifiers and intuitionistic falsity. - l. 113: The induction-result premise is not an N2 labelled context, so its extraneous x: must be removed. - l. 117: The cases A = ⊥ and vacuous discharge were not treated. - l. 119: The construction explicitly uses Cut, and single-succedent shape alone does not eliminate it. State the extended calculus as in the proposition. Co-Authored-By: Claude Opus 5.5 --- .../natural-deduction/grafting.tex | 41 ++++++++----- .../natural-deduction/quantifiers.tex | 38 ++++++++---- .../natural-deduction/rules-proofs.tex | 17 +++--- .../natural-deduction/sequents.tex | 12 ++-- .../natural-deduction/translation-G2i.tex | 59 ++++++++++++++----- .../natural-deduction/translation-N2i.tex | 44 ++++++++++---- 6 files changed, 144 insertions(+), 67 deletions(-) diff --git a/content/proof-theory/natural-deduction/grafting.tex b/content/proof-theory/natural-deduction/grafting.tex index 2d41f203..7c778b16 100644 --- a/content/proof-theory/natural-deduction/grafting.tex +++ b/content/proof-theory/natural-deduction/grafting.tex @@ -22,7 +22,7 @@ \AxiomC{$\Discharge{!B}{x}$} \DeduceC{$!A$} \DischargeRule{\Intro{\lif}}{x} -\UnaryInfC{$!B \lif !C$} +\UnaryInfC{$!B \lif !A$} \AxiomC{} \DeduceC{$!B$} \RightLabel{\Elim{\lif}} @@ -48,37 +48,50 @@ \end{defn} Provided that $\delta_1$ and $\delta_2$ don't have different -assumption !!{formula}s labelled with the same label, and no open -assumption of~$\delta_2$ contains an eigenvariable of~$\delta_1$, the +assumption !!{formula}s labelled with the same label, no open +assumption label of~$\delta_2$ is discharged in~$\delta_1$, and no +open assumption of~$\delta_2$ contains an eigenvariable of~$\delta_1$, the resulting $\Subst{\delta_1}{\delta_2}{!B^x}$ is a correct !!{proof}, -and its open assumptions are those of $\delta_1$ together with those -of~$\delta_2$. When grafting !!{proof}s, these conditions will -typically be satisfied. The first is satisfied whenever $\delta_1$ and -$\delta_2$ are subproofs of a larger !!{proof}. If the second is not -satisfied, we can rename the eigenvariables of~$\delta_1$ so that it -is. +and its open assumptions are those of $\delta_1$ other than the +replaced occurrences of~$!B^x$, together with those of~$\delta_2$. When grafting !!{proof}s, these conditions will +typically be satisfied. Compatibility holds whenever $\delta_1$ and $\delta_2$ are +subproofs of a larger !!{proof}. The remaining conditions can be +ensured by consistently renaming discharged-assumption labels and +eigenvariables of~$\delta_1$. Freshen internal discharged labels of +the inserted copies when necessary, preserving their open labels. A corresponding definition applies to \Log{N2c} and~\Log{N2i}. \begin{defn} If $\delta_1$ is a \Log{N2c}-!!{proof} (or \Log{N2i}-!!{proof}) of~$x:!B, \Gamma_1 \Sequent !A$, and $\delta_2$ is a -\Log{N1c}-!!{proof} (\Log{N1i}-!!{proof}) of~$\Gamma_2 \Sequent !B$, +\Log{N2c}-!!{proof} (\Log{N2i}-!!{proof}) of~$\Gamma_2 \Sequent !B$, then $\Subst{\delta_1}{\delta_2}{x:!B}$ is the result of replacing -every axiom $x:!B \Sequent !B$ in~$\delta_1$ by~$\delta_2$, and adding -$\Gamma_2$ to the context of every sequent below such axioms. +each axiom $x:!B \Sequent !B$ corresponding to the designated open +assumption by~$\delta_2$, and replacing $x:!B$ by~$\Gamma_2$ in the +context of every sequent below a replaced axiom. Discharged-assumption +labels are first renamed as necessary so that no already discharged +occurrence is mistaken for the designated open assumption. \end{defn} \begin{prop} If $\delta_1 \Proves x:!B, \Gamma_1 \Sequent !A$ and $\delta_2 \Proves \Gamma_2 \Sequent !B$, then $\Subst{\delta_1}{\delta_2}{x:!B} \Proves \Gamma_1, \Gamma_2 \Sequent -!A$, provided no eigenvariable of~$\delta_1$ occurs in~$\Gamma_2$. +!A$, provided the labels are compatible, no label in~$\Gamma_2$ +is discharged in~$\delta_1$, and no eigenvariable of~$\delta_1$ +occurs in~$\Gamma_2$. \end{prop} \begin{proof} - By induction on $\pheight{\delta}$. + By induction on $\pheight{\delta_1}$. At a designated axiom use + $\delta_2$; leave other axioms unchanged. At an inference, apply + the induction hypothesis to its immediate sub-!!{proof}s and repeat + the inference with the updated contexts. The label conditions + prevent discharge capture, and the eigenvariable condition is + preserved because the new open assumptions contain no eigenvariable + of~$\delta_1$. \end{proof} \end{document} \ No newline at end of file diff --git a/content/proof-theory/natural-deduction/quantifiers.tex b/content/proof-theory/natural-deduction/quantifiers.tex index c08648fb..5f66b159 100644 --- a/content/proof-theory/natural-deduction/quantifiers.tex +++ b/content/proof-theory/natural-deduction/quantifiers.tex @@ -29,7 +29,7 @@ \begin{lem}\ollabel{lem:subst-regular} If $\delta$ is regular, ends in~$!C$, $c$ is !!a{constant} not used as an eigenvariable -in~$\delta$, and $t$~is a term not containing any eigenvariables +in~$\delta$, and $t$~is a closed term not containing any eigenvariables of~$\delta$, then $\Subst{\delta}{t}{c}$ resulting from~$\delta$ by replacing every occurrence of~$c$ by~$t$ is a regular !!{proof}. The end-!!{formula} of $\Subst{\delta}{t}{c}$ is $\Subst{!C}{t}{c}$. If @@ -110,19 +110,24 @@ \] By induction hypothesis, $\Subst{\delta_1'}{t}{c}$ and $\Subst{\delta_2'}{t}{c}$ are regular !!{proof}s of - $\lexists[x][!A(x,c)]$ and of $!C$ from the open + $\lexists[x][!A(x,t)]$ and of $\Subst{!C}{t}{c}$ from the open assumption~$!A(a,t)$. Since $a$ is an eigenvariable of~$\delta$, $a$~does not occur in~$t$. Therefore, the last inference in $\Subst{\delta}{t}{c}$, \[ \AxiomC{} - \RightLabel{$\Subst{\delta'}{t}{c}$} - \DeduceC{$!A(a,t)$} - \RightLabel{\Intro{\lforall}} - \UnaryInfC{$\lforall[x][!A(x,t)]$} + \RightLabel{$\Subst{\delta_1'}{t}{c}$} + \DeduceC{$\lexists[x][!A(x,t)]$} + \AxiomC{$\Discharge{!A(a,t)}{x}$} + \RightLabel{$\Subst{\delta_2'}{t}{c}$} + \DeduceC{$\Subst{!C}{t}{c}$} + \DischargeRule{\Elim{\lexists}}{x} + \BinaryInfC{$\Subst{!C}{t}{c}$} \DisplayProof \] - is correct: $\Subst{!A(x,t)}{a}{x} \ident \Subst{!A(a,c)}{t}{c}$, neither the conclusion~$!C$ nor any open assumption contains~$a$. + is correct: $\Subst{!A(x,t)}{a}{x} \ident \Subst{!A(a,c)}{t}{c}$, + and neither the conclusion~$\Subst{!C}{t}{c}$ nor any remaining + open assumption contains~$a$. \end{enumerate} \end{proof} @@ -130,19 +135,26 @@ If $\delta$ is !!a{proof} in \Log{N1c} or \Log{N1i}, then there is a regular !!{proof}~$\delta'$ with the same structure (in particular, the same !!{height}) which differs from $\delta$ only by replacing -eigenvariables. +eigenvariables and consistently renaming discharged-assumption labels. \end{prop} \begin{proof} +First consistently rename discharged-assumption labels so that +no discharge label is reused outside the assumptions discharged by +its inference. This preserves all open assumptions and the proof +structure, and prevents later local substitutions from creating +incompatible formulas with the same label. For the purpose of the proof only, call an eigenvariable inference of~$\delta$ \emph{clean} if its eigenvariable is not the eigenvariable of another inference nor does it occur anywhere in~$\delta$ except the -immediate sub-!!{proof} of the inference, and \emph{dirty} otherwise. +immediate sub-!!{proof} of \Intro{\lforall}, or the sub-!!{proof} +leading to the minor premise of \Elim{\lexists}, respectively, and +\emph{dirty} otherwise. Let $n$ be the number of dirty eigenvariable inferences in~$\delta$. We show, by induction on~$n$, that $\delta$~can be transformed into the required regular !!{proof}~$\delta'$. If $n=0$, all eigenvariable inferences in~$\delta$ are clean, and so $\delta$ is regular, and there is -nothing to prove. Otherwise, pick a highest eigenvariable inference, +nothing to prove. Otherwise, pick a highest dirty eigenvariable inference, say \Intro{\lforall}. The sub-!!{proof}~$\delta_1$ of~$\delta$ ending in it is of the form \[ @@ -155,7 +167,9 @@ \] Note that as $c$ is an eigenvariable, it does not occur in~$\lforall[x][!A(x)]$ or an open assumption. The proof $\delta_2$ is -regular, since it contains no eigenvariable inferences at all. Let $a$ +regular, since all eigenvariable inferences above the selected +inference are clean. Moreover, $c$ is not an eigenvariable of +$\delta_2$, since such an upper inference would also be dirty. Let $a$ be !!a{constant} not occurring in~$\delta$. By \olref{lem:subst-regular}, $\Subst{\delta_2}{a}{c}$ is a regular proof of $!A(a)$. By the eigenvariable condition, no open assumption @@ -179,7 +193,7 @@ \begin{prob} Describe the case in the proof of \olref{prop:regular} where the -topmost eigenvariable inference is~\Elim{\lexists}. +selected highest dirty eigenvariable inference is~\Elim{\lexists}. \end{prob} We will not appeal to the proposition just proved explicitly, but we diff --git a/content/proof-theory/natural-deduction/rules-proofs.tex b/content/proof-theory/natural-deduction/rules-proofs.tex index b0718e89..85187566 100644 --- a/content/proof-theory/natural-deduction/rules-proofs.tex +++ b/content/proof-theory/natural-deduction/rules-proofs.tex @@ -65,7 +65,7 @@ assumptions: \[ \AxiomC{$\Discharge{!A}{y}$} -\DischargeRule{\Intro{\lif}}{x} +\RightLabel{\Intro{\lif}} \UnaryInfC{$!B \lif !A$} \DischargeRule{\Intro{\lif}}{y} \UnaryInfC{$!A \lif (!B \lif !A)$} @@ -128,8 +128,8 @@ the discharged~$!A(c)$, does not occur in~$!B$, and does not occur in~$!A$. This is called the \emph{eigenvariable condition}. -!!^{proof}s in \Log{N1c} and~\Log{N1i} are finite trees of sequents -that are inductively generated from axioms using the rules of +!!^{proof}s in \Log{N1c} and~\Log{N1i} are finite trees of !!{formula} occurrences +that are inductively generated from assumptions using the rules of inference. Each leaf is an assumption, possibly labelled with a discharge label, and every other !!{formula} follows from the !!{formula}s immediately above it by one of the inference rules of the @@ -175,7 +175,7 @@ \DeduceC{$!A_2$} \AxiomC{} \RightLabel{$\delta_3$} - \DeduceC{$!A_2$} + \DeduceC{$!A_3$} \RightLabel{$R$} \TrinaryInfC{$!A$} \DisplayProof @@ -188,7 +188,8 @@ \emph{open assumptions} of the !!{proof} if they are open assumptions of $\delta_1$, $\delta_2$, or~$\delta_3$, except those occurrences discharged by the rule. If the rule is labelled~$x$ (or - $x\, y$), then for \Intro{\lif} and~\Intro{\lnot}, that is all open + $x\, y$), then for \Intro{\lif}, \Intro{\lnot}, and (in \Log{N1c}) \FalseCl, + that is all open assumptions in~$\delta_1$ labelled~$x$; for \Elim{\lexists}, it is all open assumptions labelled~$x$ in~$\delta_2$; for \Elim{\lor}, it is all open assumptions labelled~$x$ in~$\delta_2$ and all open @@ -199,7 +200,7 @@ The !!{proof}s used in the inductive construction of !!a{proof} are called its \emph{sub-!!{proof}s}. The sub-!!{proof}s ending in the premises of an inference are called the \emph{immediate -sub-!!{proof}s} of the inference. The rules of \Log{N2c} and \Log{N2i} +sub-!!{proof}s} of the inference. The rules of \Log{N1c} and \Log{N1i} are given in \olref{tab:N1} \subfile{rules-N1} @@ -218,7 +219,7 @@ sub-!!{proof}s~$\delta_1$, $\delta_2$, and~$\delta_3$, then $\pheight{\delta} = \max(\pheight{\delta_1}, \pheight{\delta_2}, \pheight{\delta_3}) + 1$. \end{enumerate} -If a sequent~$S$ has !!a{proof} of height $\le n$, we write $\Proves[n] S$. +If !!a{formula}~$S$ has !!a{proof} of height $\le n$, we write $\Proves[n] S$. \end{defn} \begin{ex} @@ -244,7 +245,7 @@ The immediate sub-!!{proof}s of the last inference in~$\delta_2$ and in~$\delta_3$ is the same: $!A \land !B$. Both !!{proof}s have the occurrence of $!A\land !B$ as an open assumption. We have -$\pheight{\delta_1} = \pheight{\delta_2} = 1$. +$\pheight{\delta_2} = \pheight{\delta_3} = 1$. The rule \Intro{\land} requires two premises of the form $!B$ and $!A$ to justify a conclusion of the form~$!B \land !A$. Thus, the following diff --git a/content/proof-theory/natural-deduction/sequents.tex b/content/proof-theory/natural-deduction/sequents.tex index ba46c567..271c4056 100644 --- a/content/proof-theory/natural-deduction/sequents.tex +++ b/content/proof-theory/natural-deduction/sequents.tex @@ -10,7 +10,7 @@ \olsection{Natural Deduction with Sequents: \Log{N2c} and~\Log{N2i}} -!!^a{proof}~$\delta$ in \Log{G1c} or \Log{G1i} shows that its +!!^a{proof}~$\delta$ in \Log{N1c} or \Log{N1i} shows that its end-!!{formula}~$!A$ follows from its open assumptions. If $\Gamma$ is the set of !!{formula}s~$!B$, where $!B^x$ occurs as an open assumptions in~$\delta$, we can write this as $\delta \Proves \Gamma @@ -43,6 +43,8 @@ applications of the corresponding rules in \Log{N2c} and~\Log{N2i} also when the corresponding context !!{formula}s $!A$, $!B$, and $!A(a)$ are not present in the context of the relevant premise. +The same convention applies to \FalseCl in~\Log{N2c}: its indicated +negated assumption may be absent from the premise context. \begin{prop} If $\delta$ is !!a{proof} in~\Log{N1c} or \Log{N1i} of~$!A$, then @@ -134,14 +136,14 @@ \UnaryInf$\Gamma \fCenter !B \lif !C$ \DisplayProof \] - By inductive hypothesis, there is !!a{proof} in~\Log{N1c} + By inductive hypothesis, there is !!a{proof}~$\delta_1'$ in~\Log{N1c} (\Log{N1i}) of~$!C$. In the first case, $!B^x$ is an open - assumption of~$\delta'$; in the second case it is not. We can take + assumption of~$\delta_1'$; in the second case it is not. We can take the !!{proof}~$\delta'$ to be \[ \bottomAlignProof \AxiomC{$\Discharge{!B}{x}$} - \RightLabel{$\delta_1$} + \RightLabel{$\delta_1\prime$} \DeduceC{$!C$} \DischargeRule{\Intro{\lif}}{x} \UnaryInfC{$!B \lif !C$} @@ -149,7 +151,7 @@ \quad\text{ or }\quad \bottomAlignProof \AxiomC{} - \RightLabel{$\delta_1$} + \RightLabel{$\delta_1\prime$} \DeduceC{$!C$} \RightLabel{\Intro{\lif}} \UnaryInfC{$!B \lif !C$} diff --git a/content/proof-theory/natural-deduction/translation-G2i.tex b/content/proof-theory/natural-deduction/translation-G2i.tex index d40847b8..3bf5ffc5 100644 --- a/content/proof-theory/natural-deduction/translation-G2i.tex +++ b/content/proof-theory/natural-deduction/translation-G2i.tex @@ -10,6 +10,19 @@ \olsection{Translating from \Log{G2i} to \Log{N2i}} +Here \Log{G2i} is the intuitionistic variant of \Log{G2c}: all +sequents have at most one formula on the right. In addition, replace +its \LeftR{\lor} rule by the shared-succedent rule +\[ +\Axiom$!A,\Gamma_1 \fCenter \Delta$ +\Axiom$!B,\Gamma_2 \fCenter \Delta$ +\RightLabel{\LeftR{\lor}} +\BinaryInf$!A\lor !B,\Gamma_1,\Gamma_2 \fCenter \Delta$ +\DisplayProof +\] +where $\Delta$ is empty or a singleton. All other axioms and rules +are those of \Log{G2c} subject to the same succedent restriction. + The antecedents of sequents in \Log{G2i} are multisets~$\Gamma$ of !!{formula}s, while those of sequents in \Log{N2i} are sets~$\Gamma'$ of labelled formulas with the property that every label occurs only @@ -22,13 +35,13 @@ \begin{prop}\ollabel{prop:G2i-to-N2i} If $\Log{G2i} + \Cut \Proves \Gamma \Sequent \Delta$ then $\Log{N2i} \Proves \Gamma' \Sequent !C$, where $!C \ident \lfalse$ if $\Delta$ is -empty and $\Delta = \{!A\}$ otherwise, and $\Gamma'$ corresponds +empty and $\Delta = \{!C\}$ otherwise, and $\Gamma'$ corresponds to~$\Gamma$. \end{prop} \begin{proof} We show that if $\pi$ is !!a{proof} of $\Gamma \Sequent \Delta$ in - \Log{G2ci}, then there is a~$\Gamma'$ corresponding to~$\Gamma$ and + $\Log{G2i}+\Cut$, then there is a~$\Gamma'$ corresponding to~$\Gamma$ and !!a{proof}~$\delta$ of~$\Gamma' \Sequent !C$ in~\Log{N2i}. We do this by induction on $n = \pheight{\pi}$. @@ -39,7 +52,7 @@ If $n>0$, $\pi$ ends in a rule~$R$. The inductive hypothesis guarantees that there are !!{proof}s of sequents corresponding to - the premises of that rule in~\Log{N2c}. We can assume that all + the premises of that rule in~\Log{N2i}. We can assume that all discharge labels in those proofs are distinct, and that a label $x$ only occurs above an inference that discharges it, if it is discharged at all (by relabelling if necessary). We then show how @@ -64,7 +77,7 @@ \AxiomC{} \RightLabel{$\pi_1$} \Deduce$\Gamma \fCenter \Delta$ - \RightLabel{\RightR{\Weakening}} + \RightLabel{\LeftR{\Weakening}} \UnaryInf$!A, \Gamma \fCenter \Delta$ \DisplayProof \] @@ -83,13 +96,13 @@ \UnaryInf$!A, \Gamma \fCenter \Delta$ \DisplayProof \] - The induction hypothesis applied to $\pi_1$ yields !!a{proof} + The induction hypothesis applied to $\pi_1$ yields !!a{proof}~$\delta_1$ of~$\Pi, \Gamma' \Sequent !C$, where $\Pi \subseteq \{x : !A, y:!A\}$. If $\Pi = \{x : !A, y:!A\}$, replace all labelled - !!{formula}s $y:!A$ in~$\pi_1$ by $x:!A$. Since $x$~occurs in the - context of the end-sequent of~$\pi_1$ we can assume that no - inference in~$\pi_1$ discharges !!a{formula} of the form~$x:!B$, - i.e., no $x:!B$ on the left side of a sequent in~$\pi_1$ is + !!{formula}s $y:!A$ in~$\delta_1$ by $x:!A$. Since $x$~occurs in the + context of the end-sequent of~$\delta_1$ we can assume that no + inference in~$\delta_1$ discharges !!a{formula} of the form~$x:!B$, + i.e., no $x:!B$ on the left side of a sequent in~$\delta_1$ is active. Consequently, the result is still !!a{proof} in~\Log{N2i}. \item If $R$ is $\RightR{\lif}$, $\pi$ ends in \[ @@ -102,8 +115,8 @@ \] By the inductive hypothesis, there is !!a{proof}~$\delta_1$ of $x: !A, \Gamma' \Sequent !B$ or $\Gamma' \Sequent !B$ where $\Gamma'$ - corresponds to~$\Gamma$. We can take $\delta_1$ - to be $\delta$ plus an application of \Intro{\lif}. + corresponds to~$\Gamma$. We can take $\delta$ + to be $\delta_1$ plus an application of \Intro{\lif}. \item If $R$ is \LeftR{\lif}, $\pi$ ends in \[ \AxiomC{} @@ -120,7 +133,7 @@ \Sequent !A$ and $\delta_2$ of $x: !B, \Gamma_2' \Sequent !C$ or of of $\Gamma_2' \Sequent !C$. If $\delta_2$ is of the latter form, $\delta_2$ can serve as~$\delta$. Otherwise, we can relabel all - formulas and discharge labels in~$\pi_1$ to ensure that no label + formulas and discharge labels in~$\delta_1$ to ensure that no label occurs in both $\delta_1$ and~$\delta_2$. Then $\Gamma_1' \cup \Gamma_2'$ corresponds to $\Gamma_1 \cup \Gamma_2$. Since $x:!B$ occurs in the end-sequent of~$\delta_2$, $x:!B$ cannot be active in @@ -132,10 +145,15 @@ \RightLabel{$\delta_1$} \Deduce$\Gamma_1' \fCenter !A$ \RightLabel{\Elim{\lif}} - \BinaryInf$x: !A \lif !B \fCenter !B$ + \BinaryInf$x: !A \lif !B, \Gamma_1' \fCenter !B$ \DisplayProof \] - and every occurrence of $x:!B$ in~$\delta_2$ by $x:!A \lif !B$. + and replace $x:!B$ in each affected context of~$\delta_2$ by + $x:!A \lif !B,\Gamma_1'$, as in the grafting definition. Before + grafting, rename eigenvariables of~$\delta_2$ away from the + inserted open assumptions, and freshen internal discharged labels + and eigenvariables of inserted copies while preserving their + open-assumption labels. The result $\Subst{\delta_2}{\delta_3}{x:!B}$ is !!a{proof} of $x:!A \lif !B, \Gamma_1', \Gamma_2' \Sequent !C$. \item If $R$ is \RightR{\land}, $\pi$ ends in @@ -151,8 +169,8 @@ \DisplayProof \] The inductive hypothesis yields proof $\delta_1$ of $\Gamma_1' - \Sequent !A$ and $\delta_2$ of $\Gamma_2' \Sequent !A$. By - relabelling all formulas and discharge labels in~$\pi_2$ we can + \Sequent !A$ and $\delta_2$ of $\Gamma_2' \Sequent !B$. By + relabelling all formulas and discharge labels in~$\delta_2$ we can ensure that no label occurs in both $\delta_1$ and $\delta_2$. Then $\Gamma_1' \cup \Gamma_2'$ corresponds to $\Gamma_1 \cup \Gamma_2$. We obtain !!a{proof}~$\delta$ by applying $\Intro{\land}$ @@ -201,6 +219,15 @@ $\delta_2$ by $\delta_1$ to obtain~$\delta$ as the !!{proof}~$\Subst{\delta_2}{\delta_1}{x:!A}$ of $\Gamma_1', \Gamma_2' \Sequent !C$. \end{enumerate} + The remaining right logical rules translate by the corresponding + introductions. For each remaining left rule, combine the induction + results with the corresponding elimination from a fresh assumption + of its principal formula, grafting at a used active assumption and + retaining an unchanged proof when that assumption is unused. + Discharge may be vacuous. The original eigenvariable conditions + hold for the smaller translated contexts. Before each graft, + freshen internal eigenvariables away from the inserted assumptions + and use the stated label convention. \end{proof} \end{document} \ No newline at end of file diff --git a/content/proof-theory/natural-deduction/translation-N2i.tex b/content/proof-theory/natural-deduction/translation-N2i.tex index e4458ab0..4c420b36 100644 --- a/content/proof-theory/natural-deduction/translation-N2i.tex +++ b/content/proof-theory/natural-deduction/translation-N2i.tex @@ -11,7 +11,7 @@ \olsection{Translating from \Log{N2} to \Log{G2}} \begin{prop}\ollabel{prop:N2-to-G2} If $\Log{N2c}\ (\Log{N2i}) \Proves -\Gamma \Sequent !A$ then $\Log{G2c}\ (\Log{N2i}) + \Cut \Proves \Gamma' +\Gamma \Sequent !A$ then $\Log{G2c}\ (\Log{G2i}) + \Cut \Proves \Gamma' \Sequent \Delta$ where $\Gamma'$ is the multiset of !!{formula}s resulting from $\Gamma$ by removing labels, and $\Delta = \{!A\}$ if $!A$ is not~$\lfalse$, and $\Delta = \emptyset$ if it is. @@ -52,8 +52,9 @@ \DisplayProof \] The inductive hypothesis yields !!a{proof}~$\pi_1$ of $\Gamma' - \Sequent !C$, from which we obtain $\pi$ by applying - \LeftR{\Weakening} with~$!B$, and then~\RightR{\lif}. + \Sequent !C$, or of $\Gamma'\Sequent\ $ if $!C\ident\lfalse$. + In the latter case first apply \RightR{\Weakening} with~$!C$. + Then apply \LeftR{\Weakening} with~$!B$ and \RightR{\lif} to obtain~$\pi$. \item If $R$ is \Elim{\lif}, $\delta$ ends in \[ \AxiomC{} @@ -68,7 +69,10 @@ \] where $\Gamma = \Gamma_1 \cup \Gamma_2$. The inductive hypothesis yields !!{proof}s $\pi_1$ of $\Gamma_1' \Sequent !B \lif !A$ and - $\pi_2$ of $\Gamma_2' \Sequent !B$. We obtain the !!{proof}~$\pi$ as + $\pi_2$ of $\Gamma_2' \Sequent !B$, except that the latter has + empty succedent when $!B\ident\lfalse$. In that case first add + \RightR{\Weakening} with~$!B$ to~$\pi_2$. If $!A\not\ident\lfalse$, + we obtain the !!{proof}~$\pi$ as \[ \AxiomC{} \RightLabel{$\pi_1$} @@ -89,10 +93,18 @@ $!C$ but $(\Gamma_1 \cup \Gamma_2)'$ contains only one copy. We can correct this by adding suitable \LeftR{\Contraction} inferences. - In the event that $!A \ident \lfalse$, the inductive hypothesis - applied to $\delta_2$ yields !!a{proof} of $\Gamma_2' \Sequent \ $, - from which we can obtain the !!{proof}~$\pi$ by adding suitable - \LeftR{\Weakening} inferences and a \RightR{\Weakening} with~$!A$. + If $!A\ident\lfalse$, use the axiom $\lfalse\Sequent\ $ in place + of $!A\Sequent !A$ in the same construction. Its \LeftR{\lif} + inference and subsequent \Cut$\,$ then both have empty succedent, + as required. Apply the same antecedent contractions. +\item For the remaining rules, translate introductions by the corresponding + right rules and eliminations by the corresponding left rules followed + by \Cut. As in the implication cases, use empty succedents for bottom + conclusions, restore an intermediate bottom formula by right weakening + when required, and use left weakening for vacuous discharge. Translate + \FalseInt{} by right weakening. Contract repeated contexts, and in + \Log{G2c} the repeated common succedent from \LeftR{\lor}, as necessary. + The original eigenvariable conditions survive removal of labels. \item If $R$ is \FalseCl, $\delta$ ends in \[ \AxiomC{} @@ -110,15 +122,23 @@ \UnaryInf$\fCenter !A, \lnot !A$ \AxiomC{} \RightLabel{$\pi_1$} - \Deduce$x: \lnot !A, \Gamma' \fCenter $ + \Deduce$\lnot !A, \Gamma' \fCenter $ \RightLabel{\Cut} \BinaryInf$\Gamma' \fCenter !A$ \DisplayProof \] + If $!A\ident\lfalse$, append a cut with the axiom + $\lfalse\Sequent\ $ to obtain the required empty succedent. + If the $\FalseCl$ inference discharges no assumption, its premise + lacks $x:\lnot !A$. The induction hypothesis then already supplies + $\Gamma'\Sequent\ $; retain that proof when $!A\ident\lfalse$, + and otherwise apply \RightR{\Weakening} with~$!A$. \end{enumerate} -Note that only the translation of \FalseCl{} results in -!!a{proof}~$\pi$ with more than one !!{formula} on the right. That is, -the translation of a~\Log{N2i} !!{proof} is a \Log{G2i}-!!{proof}. +All nonclassical cases can be carried out directly in +$\Log{G2i}+\Cut$, using its shared-succedent \LeftR{\lor} rule. +The \FalseCl construction uses a classical sequent with two formulas +on the right. Thus a~\Log{N2i} !!{proof} translates to a +$\Log{G2i}+\Cut$ !!{proof}. \end{proof} \end{document} \ No newline at end of file From afb9b116fb5bf3f6336fa77c218c743a622a42a3 Mon Sep 17 00:00:00 2001 From: KokunoYumeto <208192274+KokunoYumeto@users.noreply.github.com> Date: Mon, 30 Nov 2026 22:30:51 +0100 Subject: [PATCH 2/3] proof-theory/normalization: corrections (59 places) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit introduction.tex: - l. 16, 27: Delta 1 is introduced as the proof of A; delta 2 proves B from A. Remove the conflicting name on the implication proof and label the displayed right proof of A as delta 1. - l. 54: The literal bound excludes open assumptions, quantified instances, and primitive falsity. A proof from bottom to atomic P already contains an assumption not among the conclusion's subformulas; a proof of P -> not-not-P uses bottom even with no open assumptions. normalization-thm.tex: - l. 32, 40: The repaired permutation and reduction arguments use one explicit order of segment starts, which excludes maximal starts from all copied side/premise subproofs and controls boundary cuts. The theorem must invoke that same selection criterion. permutations.tex: - l. 22: Every displayed repeated major formula is B conjunction C, and the final inference is conjunction elimination. The introductory cut-formula identification has the wrong connective. - l. 68: A length-two segment starting at an assumption can become a singleton assumption directly used by elimination. Such a singleton is excluded by the cut definition, so the cut may disappear rather than survive with a shorter length. - l. 75: Cut length sums only cuts of the current maximum rank. Converting a lower-rank cut need not change it; when rank drops, many previously lower-rank cuts can become maximal and their total length can be larger. - l. 80: There are at least two paths through the two minor branches, but only maximal-rank paths contribute to cut length. With the converted formula maximal and rank unchanged, each path loses a node or disappears, giving the claimed lower bound. - l. 320: The exercise asks only one pair, existential elimination followed by existential elimination. There is no second (latter) case to identify. - l. 345: The original converted display reuses eigenconstant c for two existential eliminations, violating the declared unique-eigenvariable regularity. - l. 353, 356, 361, 364, 369: The two copies of δ_5 need different eigenconstants and labels. - l. 383: Verified an explicit valid propositional counterexample: A=P or Q, C=R and S. A case inference on D or E has two A-assumption minor premises; its A conclusion is eliminated with two C-introduction branches, and C is then projected. reductions.tex: - l. 15: The definition of singleton cuts explicitly includes FalseInt, and this section eventually treats that alternative. The opening must either include it or delimit the introduction case; the correction does both. - l. 53: Vacuous implication introduction leaves no B^x site, so reduction discards the entire argument proof and may lose its open assumptions. - l. 65: There is no delta 4 in the implication example. More substantially, the following paragraphs themselves explain that cuts in delta 3 may be duplicated and boundary segments can change, contradicting an unconditional unchanged-cut and decrease assertion. - l. 80: Diagram-specific rightmost selection does not uniformly exclude copied maximal cuts in introduction premises or crossing segments whose endpoint is below the copied subtree. The independently checked permutation counterexample demonstrates why starts matter. - l. 90: A proof ending in FalseInt grafted into a major-premise assumption creates a singleton cut by the explicit definition, just as an introduction-ending proof does. Its formula is still B, so the existing strictly smaller-depth argument applies. - l. 93: A proof that ends in the rule for ⊥ also produces a cut of length 1. - l. 113: The substitution lemma requires that t contain no eigenconstant of the proof being substituted into. Regularity alone does not enforce this for a vacuous quantified matrix, whose displayed instance may hide all constants of t. - l. 304, 307: Giving arbitrary different C the same label violates the explicit compatibility requirement. Use y for C and label the disjunction elimination with both discharged labels, matching all other case-analysis trees. segments.tex: - l. 66: Clause 3 of the immediately following definition orders a segment from a minor-premise occurrence to that inference's conclusion. The explanatory sentence reverses the order. - l. 96: The formal definition just above explicitly includes singleton segments introduced by FalseInt. The prose summary must retain that alternative. - l. 104: The maximum defining cut rank is undefined on an empty set without a convention. The following induction applies the measures to all proofs, including normal ones. Set rank and the already naturally empty sum to zero explicitly. translations.tex: - l. 15: The source calculus is G2i. - l. 28: The corollary leaves its conclusion formula C unrelated to the source succedent. Under a universal reading this would assert a proof of arbitrary Q from a context corresponding to P when the source is P=>P. - l. 37: An introduction can occur above an elimination in a minor-premise subtree without a cut. Normality concerns introduction/FalseInt conclusions on the major-premise chain, including intervening case-elimination segments. - l. 44: G2i is the cut-free rule system; the intermediate source proof explicitly ending in Cut belongs to G2i+Cut. Name the extended calculus in both descriptions while retaining the final cut-free result. - l. 58: The conditional lacks its predicate. - l. 61: The formal list condition does not prevent early stopping or arbitrary continuation after a minor premise, while the explanatory prose and main-branch proof require maximal contiguous paths. Make adjacency and the allowed terminal positions explicit. - l. 71, 73: The main-branch induction uses the fact that only disjunction/existential elimination can discharge along relevant branches; FalseCl invalidates this for N2c and has no case in the proof. - l. 83: A globally open label can occur in the chosen main branch and another minor branch. Replacing only its main-branch formula then makes one label denote two formulas; deleting the implication-prefix context can likewise erase assumptions still used elsewhere. - l. 111: Implication and negation elimination form the union of major- and minor-premise contexts. They can add formulas without discharging any. The intended and subsequently used property is that the major context is not reduced, not that it is unchanged. - l. 121: Distinguish is misspelled in this transition to constructor cases. - l. 133, 135: The reason why the context stays unchanged along the main branch is stated. - l. 158: The constructed smaller proof is named delta 1 immediately above. Delta-prime is not defined in this argument. - l. 161: Its succedent is Delta, empty when A is bottom. - l. 161, 166: The proposition maps final bottom to empty succedent, but all three displayed special cases weaken it back to bottom. Use Delta uniformly in G2 conclusions and preserve emptiness. - l. 178, 182, 220, 225, 229, 287, 306: When A = ⊥ the proposition gives an empty succedent, so Δ is written for it. - l. 199: An assumption that is discharged vacuously must first be added by weakening. - l. 234, 308: The case of an empty succedent, and the contraction of extra copies. - l. 275: Delta 1 is the independent proof of the implication antecedent and may have arbitrary length. Delta 2 is the continuation below the first implication elimination; that fragment is empty exactly when the elimination is also the final inference. - l. 279: The two induction inputs are delta 1 from Gamma 1 and delta 2-prime from E,Gamma 2. Their unlabelled contexts therefore have distinct primes and indices. - l. 315: A normal proof of P from open P conjunction Q contains that compound assumption; normal forall-elimination contains P(c), a matrix instance rather than a literal subformula; and a normal proof of P -> not-not-P uses primitive bottom. - l. 323: Every non-bottom formula is preserved by the displayed rule-by-rule construction; exclude bottom from the occurrence claim and invoke the qualified first-order subformula property. Co-Authored-By: Claude Opus 5.5 --- .../normalization/introduction.tex | 15 +- .../normalization/normalization-thm.tex | 8 +- .../normalization/permutations.tex | 78 +++++--- .../proof-theory/normalization/reductions.tex | 82 ++++---- .../proof-theory/normalization/segments.tex | 9 +- .../normalization/translations.tex | 177 ++++++++---------- 6 files changed, 194 insertions(+), 175 deletions(-) diff --git a/content/proof-theory/normalization/introduction.tex b/content/proof-theory/normalization/introduction.tex index 75534800..657efc23 100644 --- a/content/proof-theory/normalization/introduction.tex +++ b/content/proof-theory/normalization/introduction.tex @@ -13,7 +13,7 @@ If you have !!{prove}d a conditional~$!A \lif !B$, you might be in a position to use it in !!a{proof} of~$!B$ by using~\Elim{\lif}. This would of course also require !!a{proof}~$\delta_1$ of~$!A$. Your -!!{proof}~$\delta_1$ of~$!A \lif !B$, more likely than not, ends +!!{proof} of~$!A \lif !B$, more likely than not, ends in~\Intro{\lif}, which turns !!a{proof}~$\delta_2$ of~$!B$ from the open assumption~$!A$ into one of~$!A \lif !B$. If it does, your final !!{proof} has the form @@ -24,7 +24,7 @@ \DischargeRule{\Intro{\lif}}{x} \UnaryInfC{$!A \lif !B$} \AxiomC{} -\RightLabel{$\delta_2$} +\RightLabel{$\delta_1$} \DeduceC{$!A$} \RightLabel{\Elim{\lif}} \BinaryInfC{$!B$} @@ -51,10 +51,11 @@ than you can while avoiding them. There are other similarities: normal !!{proof} can be much longer than the shortest !!{proof} with detours of the same result, just like !!{proof}s in the sequent calculus can -be much shorter with cuts than the shortest cut-free !!{proof}. The -sub-!!{formula} property, that you can always !!{prove} a result using -only sub-!!{formula}s of the result in your !!{proof}, follows from -normalization for natural deduction just as it follows from -cut-elimination for the sequent calculus. +be much shorter with cuts than the shortest cut-free !!{proof}. Normalization also yields a sub-!!{formula} property. For +intuitionistic natural deduction, a result can be !!{prove}d using +sub-!!{formula}s of its conclusion and open assumptions, allowing +substitution instances of quantified sub-!!{formula}s and the logical +constant~$\lfalse$. The classical version requires a corresponding +qualification for the negated assumptions used by classical reductio. \end{document} diff --git a/content/proof-theory/normalization/normalization-thm.tex b/content/proof-theory/normalization/normalization-thm.tex index 0096d7fa..880c44b1 100644 --- a/content/proof-theory/normalization/normalization-thm.tex +++ b/content/proof-theory/normalization/normalization-thm.tex @@ -29,7 +29,9 @@ If the cut length is~$0$, there are no cuts, $\delta$ is already normal. So assume that cut rank and cut length of~$\delta$ are~$> - 0$. Pick a topmost, rightmost maximal cut segment. If the cut + 0$. Pick a maximal cut segment whose first occurrence is earliest in + the postorder defined for permutation conversions, with all minor + premises visited before the major premise at each elimination. If the cut segment has length $>1$, apply a permutation conversion. If the cut segment has length~$1$, apply the corresponding reduction conversion. This results in a new !!{proof} which either has the @@ -37,8 +39,8 @@ inductive hypothesis applies. \end{proof} -The strategy used in the above proof (always deal with a -topmost rightmost maximal cut) suggests a specific order in which +The strategy used in the above proof (always deal with the maximal +cut whose first occurrence is earliest in the specified postorder) suggests a specific order in which conversions must be applied to !!a{proof} in order to result in a normal !!{proof}. Surprisingly enough, the order actually does not matter. Applying permutation and reduction conversions in any order diff --git a/content/proof-theory/normalization/permutations.tex b/content/proof-theory/normalization/permutations.tex index 08f90082..5b0e72c0 100644 --- a/content/proof-theory/normalization/permutations.tex +++ b/content/proof-theory/normalization/permutations.tex @@ -19,7 +19,7 @@ !!{elimination} inference it is the major premise of. For instance, if the inferences involved are \Elim{\lor} and -\Elim{\land}, $!A \ident !B \lor !C$ and there is a +\Elim{\land}, $!A \ident !B \land !C$ and there is a sub-!!{proof}~$\delta_1$ that ends in: \[ \AxiomC{} @@ -65,24 +65,25 @@ \] The cuts that ended in the premise of \Elim{\land} below \Elim{\lor} now end in the premise of one of the \Elim{\land} inferences above the -minor premises of \Elim{\lor}, i.e., the length of each has decreased -by~$1$. +minor premises of \Elim{\lor}, i.e., each corresponding segment has shortened by~$1$. +A segment that becomes a singleton assumption may cease to be a cut. Moreover, any cut that lies entirely within $\delta_2$, $\delta_3$, or $\delta_4$, or entirely outside~$\delta_1$ in~$\delta$ is unchanged: it still involves the same !!{formula}s, goes through the same inferences, so in particular has the same rank and length as the -corresponding cut in~$\delta$. So the cut rank of the new !!{proof} has -not increased, and the cut length of the new !!{proof} is less than that -of the old !!{proof}. +corresponding cut in~$\delta$. Thus the cut rank does not increase. If the converted cut is +maximal, either the cut rank decreases or it stays the same and the +cut length decreases. \begin{prob} -After a permutation conversion, the length of at least one cut is -reduced by~$1$. If we permute \Elim{\land} across an~\Elim{\lor}, -there are actually two cut segments the length of which decrease, so -in this case the cut length of the !!{proof} decreases by at -least~$2$. Can the cut length of !!a{proof} decrease by more than~$2$ -by a single such permutation? Can the cut \emph{rank} decrease? +After a permutation conversion, at least one segment shortens +by~$1$ and may cease to be a cut. Suppose we permute \Elim{\land} +across an~\Elim{\lor} on a maximal cut, and the cut rank stays the +same. At least two maximal segments shorten or disappear, so the cut +length decreases by at least~$2$. Can it decrease by more than~$2$ +in this situation? Can such a permutation instead decrease the +cut \emph{rank}? \end{prob} The process of moving !!a{elimination} rule above an \Elim{\lor} or @@ -317,7 +318,7 @@ \begin{prob} Give the permutation conversions for \Elim{\lexists} followed by \Elim{\exists}. Explain why no eigenvariable condition is violated in -the latter. +this case. \end{prob} We should convince ourselves that when applying a permutation @@ -342,7 +343,8 @@ \BinaryInfC{$!C$} \DisplayProof \] -If we replace this by +Before the move, rename discharged-assumption labels away from +all open labels that will be moved into their scopes. Replace this by \[ \AxiomC{} \RightLabel{$\delta_2$} @@ -350,23 +352,27 @@ \AxiomC{$\Discharge{!D}{x}$} \RightLabel{$\delta_3$} \DeduceC{$\lexists[x][!B(x)]$} -\AxiomC{$\Discharge{!B(c)}{z}$} -\RightLabel{$\delta_5$} +\AxiomC{$\Discharge{!B(c_1)}{z_1}$} +\RightLabel{$\delta_5^{(1)}$} \DeduceC{$!C$} -\DischargeRule{\Elim{\lexists}}{z} +\DischargeRule{\Elim{\lexists}}{z_1} \BinaryInfC{$!C$} \AxiomC{$\Discharge{!E}{y}$} \RightLabel{$\delta_4$} \DeduceC{$\lexists[x][!B(x)]$} -\AxiomC{$\Discharge{!B(c)}{z}$} -\RightLabel{$\delta_5$} +\AxiomC{$\Discharge{!B(c_2)}{z_2}$} +\RightLabel{$\delta_5^{(2)}$} \DeduceC{$!C$} -\DischargeRule{\Elim{\lexists}}{z} +\DischargeRule{\Elim{\lexists}}{z_2} \BinaryInfC{$!C$} \DischargeRule{\Elim{\lor}}{x\,y} \TrinaryInfC{$!C$} \DisplayProof \] +Here $\delta_5^{(1)}$ and $\delta_5^{(2)}$ are independently freshened +copies: replace $c$ by distinct fresh constants $c_1,c_2$, and rename +all internal discharged labels and eigenvariables consistently, +while preserving the labels of open assumptions. we might worry that the eigenvariable~$c$ might occur in, say,~$!D$. After all, the assumption $!D$ is discharged above the original~$\Elim{\lexists}$ and so in the original !!{proof} it does not @@ -380,15 +386,27 @@ in the !!{proof}. In particular, $c$~cannot occur in $\delta_3$ or~$\delta_4$. -This example shows something else: Note that the new !!{proof} has two -copies of~$\delta_5$. This means that if $\delta_5$ contains a maximal -cut, we have \emph{not} reduced the cut length! Thus we must take care -that we apply a permutation conversion only when we know that there is -no maximal cut in $\delta_5$. We will ensure this by always selecting -a \emph{topmost} maximal cut, that is a maximal cut such that the -sub-!!{proof} (in this case,~$\delta_1$) contains no maximal cut that -ends above the last inference in the sub-!!{proof}. This rules out the -possibility that there are other maximal cuts in~$\delta_5$ (or indeed -in $\delta_2$, $\delta_3$, or~$\delta_4$). +The new !!{proof} has two copies of~$\delta_5$. If a maximal cut +starts in that sub-!!{proof}, even if it ends below it, duplication +can prevent the cut length from decreasing. We therefore select cuts +by their first occurrences, not only by their endpoints. + +Order formula occurrences by the following postorder traversal of the +proof tree: visit every immediate sub-!!{proof} before its conclusion; +at an !!{elimination} inference visit all minor-premise sub-!!{proof}s +before the major-premise sub-!!{proof}; use a fixed order for other +premises. Among maximal cuts choose one whose first occurrence comes +earliest in this order. + +Every side sub-!!{proof} copied in the permutation is visited before +the selected first occurrence. It therefore contains no first +occurrence of a maximal cut, including a cut that continues outside +that sub-!!{proof}. The selected segments shorten or disappear. A new +segment along the conclusion of the moved elimination either has +smaller rank (a component or matrix instance of the eliminated +formula), or, for \Elim{\lor} and \Elim{\lexists}, starts in a copied +minor sub-!!{proof} and so cannot have maximal rank. Thus cut rank +decreases, or remains unchanged while cut length decreases. The same +selection order will be used for reduction conversions. \end{document} diff --git a/content/proof-theory/normalization/reductions.tex b/content/proof-theory/normalization/reductions.tex index 06f1c0e4..ad5606fa 100644 --- a/content/proof-theory/normalization/reductions.tex +++ b/content/proof-theory/normalization/reductions.tex @@ -12,8 +12,9 @@ If a cut in !!a{proof} in \Log{N1i} has length~$1$, it is a segment consisting of a single !!{formula} occurrence, and that !!{formula} is -both the conclusion of !!a{introduction} inference and the major -premise of !!a{elimination} inference. In the normalization proof, +both the conclusion of an !!{introduction} inference or of~\FalseInt, +and the major premise of an !!{elimination} inference. We first +consider the introduction case. In the normalization proof, such cuts are ``reduced'' by replacing the sub-!!{proof} ending in such an !!{introduction}/!!{elimination} pair by a new !!{proof} in which the pair of inferences has been eliminated. Such a replacement @@ -50,26 +51,30 @@ \DisplayProof \] By $\Subst{\delta_2}{\delta_3}{!B^x}$ we mean the !!{proof} that -results from~$\delta_2$ by replacing every assumption~$!B$ that's -labelled~$x$ with the entire !!{proof}~$\delta_3$. This !!{proof} no -longer has open assumptions of the form~$!B$ with label~$x$. It has no -other assumptions labelled~$x$, since we assume, as usual, that no two -!!{formula}s occur as assumptions with the same label. Hence, the new -!!{proof} has the same open assumptions as~$\delta_1$, every inference -in~$\delta_2$ that discharges assumptions discharges the same -assumptions in~$\Subst{\delta_2}{\delta_3}{!B^x}$, and every inference -in~$\delta_3$ that discharges assumptions results in possibly multiple -copies, which discharge the corresponding assumptions -in~$\Subst{\delta_2}{\delta_3}{!B^x}$. +results from~$\delta_2$ by replacing each open assumption~$!B^x$ +that the displayed introduction discharges with the entire +!!{proof}~$\delta_3$. First rename discharged-assumption labels in +the receiving proof to avoid capturing open labels of~$\delta_3$, +and rename its eigenvariables away from those open assumptions. +Freshen internal bound labels and eigenvariables independently in +inserted copies while preserving their open-assumption labels. -Any cut that lies entirely within $\delta_2$, $\delta_3$, or -$\delta_4$, or entirely outside~$\delta_1$ in~$\delta$ is unchanged: -it still involves the same !!{formula}s, goes through the same -inferences, so in particular has the same rank and length as the -corresponding cut in~$\delta$. We have removed a maximal cut of -length~$1$ and so either have reduced the cut length, or reduced the -cut rank (if the cut length of~$\delta$ was~$1$ and this was the only -maximal cut). +The new !!{proof} has the same conclusion as~$\delta_1$ and only +open assumptions already present in~$\delta_1$. Its open-assumption +set can be smaller: if the displayed introduction discharges no +assumption, no copy of~$\delta_3$ is inserted. With the stated +freshening, surviving discharge inferences close exactly their +intended assumptions. In particular, assumptions supplied by the +inserted proof are not accidentally discharged merely because a +label was reused. + +A surviving copy of a cut lying wholly inside $\delta_2$ or +$\delta_3$ and disjoint from the grafting boundaries has the same +rank and length as the original. Cuts wholly outside~$\delta_1$ are +unchanged. However, copies may be duplicated or discarded, and +segments meeting grafting boundaries may change. Removing the +selected maximal cut therefore gives the required decrease only +after the following duplication and boundary checks. However, two things may happen: \begin{enumerate} @@ -77,21 +82,25 @@ multiplied all the cuts in~$\delta_3$. If some of those were maximal cuts, the cut length of the new !!{proof} may be greater than the cut length of the old !!{proof}. We have to guarantee that this does not - happen. We do so by applying reduction conversions only to - \emph{rightmost} maximal cuts, that is, to cuts which are such that - no maximal cut lies on a branch through~$\delta$ to the right of the - cut being reduced. If there were a cut in~$\delta_3$ it would be to - the right of the cut being reduced here, and so we wouldn't be - working on a rightmost cut. By always selecting rightmost cuts, we - guarantee that either we decrease the cut length of the !!{proof}, - or even reduce the cut rank. + happen. Use the same selection order as for permutations: among + maximal cuts, choose the one whose first occurrence is earliest + in postorder, visiting minor-premise sub-!!{proof}s before the + major-premise sub-!!{proof} at every elimination. + In this implication example, all of~$\delta_3$ is visited before + the selected introduction conclusion. More generally, every + sub-!!{proof} copied by a reduction is either above that introduction + conclusion or in a minor premise visited first. Thus no maximal cut + starts in any copied sub-!!{proof}, even if it would end outside it. + This excludes duplication of maximal cuts uniformly for all rule + shapes; the new boundary cuts considered next have lower rank. \item If an assumption $!B^x$ in $\delta_2$ is the major premise of !!a{elimination} inference, and the last inference of~$\delta_3$ is - \Elim{\lor}, \Elim{\lexists}, or !!a{introduction} inference, we + \Elim{\lor}, \Elim{\lexists}, an !!{introduction} inference, or + \FalseInt, we have generated a new cut by grafting~$\delta_3$ onto $\delta_2$ at such an assumption. What was just an assumption in~$\delta_2$ is now - a cut of length~$1$ (the conclusion of !!a{introduction} inference - and major premise of !!a{elimination} inference) or the last + a cut of length~$1$ (the conclusion of an !!{introduction} inference + or of~\FalseInt, and major premise of !!a{elimination} inference) or the last !!{formula} occurrence of a cut segment (major premise of !!a{elimination} inference and conclusion of~\Elim{\lor} or \Elim{\lexists}). If $B^x$ was a minor premise of \Elim{\lor} or @@ -110,7 +119,10 @@ conversion} (or \emph{detour conversion}). The patterns for some of the rule pairs is given in \olref{tab:reduction-conversions}. (The remaining are left as -exercises.) +exercises.) Before a displayed quantifier substitution, rename all +internal eigenvariables away from the closed witness term~$t$. +Apply the capture-avoiding grafting conventions above to the resulting +proofs and to every inserted copy. \begin{table} \begin{multline*} @@ -301,10 +313,10 @@ \AxiomC{$\Discharge{!B}{x}$} \RightLabel{$\delta_3$} \DeduceC{$!D$} -\AxiomC{$\Discharge{!C}{x}$} +\AxiomC{$\Discharge{!C}{y}$} \RightLabel{$\delta_4$} \DeduceC{$!D$} -\RightLabel{\Elim{\lor}} +\DischargeRule{\Elim{\lor}}{x\,y} \TrinaryInfC{$!D$} \DisplayProof \quad\text{by}\quad diff --git a/content/proof-theory/normalization/segments.tex b/content/proof-theory/normalization/segments.tex index 7cfb717c..71db2c56 100644 --- a/content/proof-theory/normalization/segments.tex +++ b/content/proof-theory/normalization/segments.tex @@ -63,8 +63,8 @@ account for all these possibilities, we define detours using certain kinds of sequences of !!{formula} occurrences in an \Log{N1i}-proof called \emph{segments}. In our example, it's a sequence of occurrences -of~$!A \lif !B$, where a minor premise of $\Elim{\lor}$ or -$\Elim{\lexists}$ follows its conclusion. In the example, there are +of~$!A \lif !B$, where the conclusion of $\Elim{\lor}$ or +$\Elim{\lexists}$ follows its minor premise. In the example, there are two such segments, each containing three occurrences of~$!A \lif !B$. Here is the official definition. @@ -93,8 +93,8 @@ Note that a cut segment need not begin with the conclusion of !!a{introduction} rule. All that's required is that it ends with the major premise of !!a{elimination} rule. However, a segment of -length~$1$ does have to be the conclusions of !!{introduction} rules -to count as a cut. +length~$1$ does have to be the conclusion of an !!{introduction} +rule or of~\FalseInt{} to count as a cut. \begin{defn} The \emph{rank} of a cut is~$\depth{!A}$. The \emph{cut @@ -102,6 +102,7 @@ cuts in~$\delta$. A cut is \emph{maximal} in~$\delta$ if its rank is~$\cutrank{\delta}$, i.e., it has maximal rank. The \emph{cut length} of~$\delta$ is the sum of the lengths of all its maximal cuts. +If there are no cuts, both cut rank and cut length are defined to be~$0$. \end{defn} \end{document} diff --git a/content/proof-theory/normalization/translations.tex b/content/proof-theory/normalization/translations.tex index f713459e..31e215fd 100644 --- a/content/proof-theory/normalization/translations.tex +++ b/content/proof-theory/normalization/translations.tex @@ -12,7 +12,7 @@ !!^{proof}s in \Log{N2i} can be translated to !!{proof}s in \Log{G2i} and vice versa. First of all, the result of translating cut-free -\Log{2i} !!{proof}s results in normal \Log{N2i}-!!{proof}s. +\Log{G2i} !!{proof}s results in normal \Log{N2i}-!!{proof}s. To state the result we need a bit of terminology to let us relate antecendents of sequents in~\Log{N2i} and in~\Log{G2i} more easily: a @@ -25,8 +25,9 @@ \begin{cor} If $\Log{G2i} \Proves \Gamma \Sequent \Delta$ then there is a normal \Log{N2c}-!!{proof}~$\delta$ of $\Gamma' \Sequent !C$, where the -set~$\Gamma'$ of labelled !!{formula}s corresponds to the -multiset~$\Gamma$, i.e., for every !!{formula}~$!A$, the number of +formula $!C$ is $\lfalse$ when $\Delta$ is empty and is the sole +formula in~$\Delta$ otherwise, and the set~$\Gamma'$ of labelled +!!{formula}s corresponds to the multiset~$\Gamma$, i.e., for every !!{formula}~$!A$, the number of !!{element}s of~$\Gamma'$ of the form $x : !A$ is less than or equal to the multiplicity of~$!A$ (i.e., the number of copies of~$!A$) in~$\Gamma$. @@ -34,14 +35,18 @@ \begin{proof} By inspection of the proof of \olref[nat][tgi]{prop:G2i-to-N2i}: we -add !!{introduction} rules to the end of !!{proof}s, and -!!{elimination} rules only at the top of !!{proof}s, so never -introduce an !!{introduction} rule above !!a{elimination} rule. +add !!{introduction} rules at the ends of the translated proofs. +The elimination rules introduced by left-rule translations have a +fresh assumption as major premise, and any translated proofs combined +with them occur in minor-premise positions. Consequently no +introduction or \FalseInt conclusion is placed on an elimination +major-premise chain, and no case-elimination segment is made into a +cut. The resulting proof is normal. \end{proof} The translation of the \Cut{} rule given in \olref[nat][tgi]{prop:G2i-to-N2i}, however, can introduce cuts in the -\Log{N2i}-!!{proof}~$\delta$. If a \Log{G2i} !!{proof} ends in~\Cut{} +\Log{N2i}-!!{proof}~$\delta$. If a $\Log{G2i}+\Cut$ !!{proof} ends in~\Cut{} with immediate sub-!!{proof}s $\pi_1$ and $\pi_2$ of $\Gamma_1 \Sequent !A$ and $!A, \Gamma_2 \Sequent \Delta_2$, respectively, we graft the translation $\delta_1$ of~$\pi_1$ onto the axioms $x:!A @@ -55,13 +60,14 @@ in~\Log{G2i}. In the proof of \olref[nat][tni]{prop:N2-to-G2}, the translation of \Elim{\land}, \Elim{\lif}, \Elim{\lnot}, \Elim{\lforall} results in~\Cut{} inferences in the resulting -\Log{G2i} !!{proof}. If the \Log{N2i}-!!{proof} we start from, this +$\Log{G2i}+\Cut$ !!{proof}. If the \Log{N2i}-!!{proof} we start from is normal, this can, however, be avoided. -Let's call a list $S_1$, \dots,~$S_n$ of occurrences of sequents in a -\Log{N2i}-!!{proof}~$\delta$ a \emph{branch} if $S_1$ is an axiom, and -whenever $S_i$ is a major premise of an inference, $S_{i+1}$ is its -conclusion. In other words, a branch traces sequents downwards +Let's call a maximal list $S_1$, \dots,~$S_n$ of sequent occurrences +in a \Log{N2i}-!!{proof} $\delta$ a \emph{branch} if $S_1$ is an +axiom and, for every $i Date: Mon, 30 Nov 2026 22:30:52 +0100 Subject: [PATCH 3/3] proof-theory/propositions-as-types: corrections (48 places) introduction.tex: - l. 16: An occurrence already bound by an inner lambda-x keeps its nearer binder. Only occurrences free in the body N become bound by the newly added outer abstraction. - l. 20: For (lambda x.lambda y.x)y, naive replacement produces lambda y.y and captures the argument's free y. The correct beta contractum is lambda z.y for fresh z. Explicit capture avoidance is necessary for the stated lambda calculus. - l. 39: A type A->B specifies B as codomain, not necessarily the image. A constant function into a two-element B is not onto B but has that function type. Correct both uses of range in this explanation. - l. 57: An arbitrary proof of an implication may be the single assumption f:A->B, whose term is f rather than an abstraction. The displayed empty-conclusion-context rule specifically describes implication introduction with no other open hypotheses. - l. 75: The constructor M1 M2 applies a term of type A->B to one of type A. It is not composition of two functions, which requires an additional function type and yields a function. normalization.tex: - l. 13: The grammar deliberately permits raw terms, and the annotated raw term (lambda x:A.xx)(lambda x:A.xx) has a beta self-loop. The normalization claims require well-typed terms. The chapter concerns the propositional fragment. - l. 23: The grammar includes primitive bottom as well as propositional variables. Its structural length needs the base case len(bottom)=0; otherwise formulas containing bottom have undefined rank. - l. 35, 38: The payload has type A_i and the injection annotation supplies the other summand, A_(3-i). The eliminated sum is A_1 or A_2, so its length is len(A_1)+len(A_2)+1. The source A,B are not bound by this display. - l. 41, 44: Only the three principal beta contractions have been given a rank. A projection of a neutral case term with pair-valued branches has no principal beta redex but can still be permuted: the measure and its zero case concern beta redexes. - l. 54, 57: Substitution creates a case redex only when the variable being replaced is its scrutinee, so the source index i must be x. The inserted abstraction need not bind x; use an arbitrary fresh binder y. Remove the unmatched closing parenthesis in the rank equation. - l. 85: A variable is not a redex, and the source only defines cutrank on redexes. The newly exposed projection of a pair has the rank of its product type, namely len(A), with no intermediate cutrank(x). - l. 107: A substitution contractum contains redexes inherited from the receiving body, copied wholly from the inserted argument or payload, and newly created at a substitution boundary. - l. 118: Redexes copied from N are a case of their own. - l. 127: The induction on the rank does not go through: contracting a case expression can expose an application of higher rank (there is a typed example with maximal rank 1 that exposes one of rank 3). The existence of normal forms is taken from the normalization theorem for natural deduction instead. - l. 133: The rank argument does not work (the local lemma does not bound the rank in a context); the result is taken from the normalization theorem for natural deduction. - l. 160: The original this means inference moves from existence of a normal form to termination of every strategy. State the existential execution consequence of weak beta normalization and preserve the following separate true assertion of strong beta normalization. - l. 160: The coordinated predicates halts and produces require the conjunction and; an is an accidental truncation. - l. 181: The multistep relation includes identity and therefore is not terminating as a binary step relation; SN must refer to one-step beta reduction. - l. 201: The property is proved for beta reduction. - l. 222: The first projection of pair(O1-prime,O2) selects O1-prime, so the printed endpoint O2 is wrong. Keep the original deliberately illustrative proof (it explicitly says E.g.) and correct this endpoint. - l. 226: Newman requires termination of the generating one-step relation. The source red is explicitly reflexive, so it permits constant infinite chains. State the correct hypothesis for redone_beta and confluence of its reflexive transitive closure. - l. 231: The source equates both alleged first successors with N, so its descent argument does not descend. Its common descendant also need not be normal, so comparing it directly with normal endpoints cannot establish distinct normal forms. proof-terms.tex: - l. 12: There are no quantified or primitive-negation term constructors, so a correspondence theorem over all first-order N2i proofs is unsupported. - l. 15: N2i contexts are sets of labelled formulas, and the same section explicitly says so a few lines later. The product example shares x across two premises and takes set union, rather than retaining ordered duplicate entries. - l. 41: The second premise has proof term capital M. The constructor must retain that argument, not an unrelated lowercase m. - l. 78: The injection constructor is unary and must encode the premise proof N. Omitting its argument loses that proof and contradicts the declared constructor arity. - l. 113: This grammar clause assumes proof term N but uses an undeclared M with a formula marker. Its injection payload must be that declared N. proofs-to-terms.tex: - l. 23: The correspondence is for the propositional fragment. - l. 25: A vacuous implication introduction has no discharged occurrence determining its binder name, so lambda x:A.y and lambda z:A.y encode the same sequent derivation. propositions-as-types.tex: - l. 14: The imported proofs-to-terms section explicitly gives the conjunction/product swap proof and its pair of projections; terms-to-proofs also reconstructs that example. The editorial note that no product examples exist is stale. - l. 14: The imported reduction.tex expressly introduces permutation conversions and displays a projection/case commuting conversion as both proof trees and a term equation. Thus an absolute claim that permutations are not covered is false. reduction.tex: - l. 13: An introduced formula used only as a minor premise of an unrelated elimination is not an introduction/elimination redex. The cancellation argument requires it to be the major premise of the elimination for its introduced connective. - l. 62: The inj macro has one optional type annotation and then two mandatory arguments, index and payload (open-logic-config.sty:756). The source supplies three mandatory groups and consequently misassigns the arguments. - l. 62: The three displayed principal beta rules do not include root abort contraction or case permutations. A projection of a neutral case with pair branches can be beta-normal while still admitting the displayed permutation. - l. 94: The payload M has type A_i, while the injection annotation records the other summand. To obtain A1 or A2, that annotation must be A_(3-i), as the preceding typing rules specify. - l. 129: The relation meant is one-step beta reduction. - l. 175: In the displayed permutation delta alone proves A_i, before the injection. Assign M to that entire disjunction-introduction proof, leaving the displayed proof trees and valid term permutation unchanged. - l. 185: The closure under replacement of subterms is part of the definition of each relation. - l. 189: The schematic third term repeats M2, inadvertently inserting an identity step into the one-step chain. It should be the next indexed term M3. - l. 192: Beta-normal and fully normal terms differ when there are permutations or falsity conversions. sequent-natural-deduction.tex: - l. 20, 22: The following purported restatement and both projection trees concern arbitrary A conjunction B. The opening accidentally specializes both occurrences to A conjunction A; restoring B makes the explanation describe its actual rule schema. - l. 115, 117: With D=A or (A->bottom) and B=D->bottom, assume B and A, introduce D, use B to obtain bottom, discharge A, introduce D again, use B again and discharge B. Remove the stray implication and four unmatched parentheses. type-preservation.tex: - l. 17: The relation that mirrors the proof conversions is that of all term conversions, of which beta reduction is a part. - l. 90: Carefuly is a misspelling of carefully in the expressly assigned induction verification. - l. 90: An occurrence of x may be below additional binders, so its axiom context Gamma-prime can strictly contain Gamma,x:B1. Literal replacement by the bare Gamma proof leaves the tN3 shared-context rules unmatched. - l. 106, 109: The preceding reduction section includes a projection/case permutation. A projection over a neutral case term with pair-valued branches is beta-normal but still has that permutation step, so failure of full normality does not imply a principal beta step. Co-Authored-By: Claude Opus 5.5 --- .../propositions-as-types/introduction.tex | 17 +- .../propositions-as-types/normalization.tex | 166 ++++++++---------- .../propositions-as-types/proof-terms.tex | 15 +- .../propositions-as-types/proofs-to-terms.tex | 7 +- .../propositions-as-types.tex | 3 +- .../propositions-as-types/reduction.tex | 42 +++-- .../sequent-natural-deduction.tex | 18 +- .../type-preservation.tex | 27 +-- 8 files changed, 149 insertions(+), 146 deletions(-) diff --git a/content/proof-theory/propositions-as-types/introduction.tex b/content/proof-theory/propositions-as-types/introduction.tex index d89080e2..094adb16 100644 --- a/content/proof-theory/propositions-as-types/introduction.tex +++ b/content/proof-theory/propositions-as-types/introduction.tex @@ -13,11 +13,13 @@ The lambda calculus is a simple model of computation. It operates on terms built from variables. If $N$ and $M$ are terms, then $(NM)$ is also a term (``$N$ applied to~$M$''). If $N$ is a term, then -$\lambd[x][N]$ is a term. If $N$ contains the variable~$x$, then the -corresponding occurrences of~$x$ in $\lambd[x][N]$ are bound by the +$\lambd[x][N]$ is a term. If $N$ contains free occurrences of the variable~$x$, then those +occurrences of~$x$ become bound in $\lambd[x][N]$ by the outer $\lambd[x]$ operator, and so are no longer free. A term of the form $(\lambd[x][N]M)$ is said to $\beta$-contract to $\Subst{N}{M}{x}$ -(the result of replacing every free occurrence of $x$ in~$N$ by $M$). +(the result of capture-avoiding replacement of every free occurrence +of $x$ in~$N$ by $M$, first renaming bound variables of~$N$ when +necessary). A term $N$ $\beta$-converts to~$N'$ if $N'$ results from $N$ by $\beta$-contracting a subterm, and we write $N \redone N'$. A computation in the $\lambd$-calculus is a sequence $N \redone N_1 @@ -36,8 +38,8 @@ $(\lambd[x][N]M)$ then is applying the function $\lambd[x][N]$ to an argument~$M$, and $\beta$-contraction tells us how to evaluate it: replace $x$ in $N$ by~$M$ (and keep evaluating the resulting term). -Now think of these as functions with a fixed domain and range. If the -domain of $\lambd[x][N]$ is $A$ and its range~$B$, then we should +Now think of these as functions with a fixed domain and codomain. If the +domain of $\lambd[x][N]$ is $A$ and its codomain~$B$, then we should think of the variable~$x$ as only taking arguments from~$A$ and $N$ as producing values from~$B$. Consequently, $(\lambd[x][N]M)$ only should make sense if $\lambd[x][N]$ is a function $A \to B$, and $M \in A$. @@ -54,7 +56,8 @@ These typing rules now clearly correspond to !!{derivation}s in natural deduction, where the types are represented by !!{formula}s, and the !!{derivation}s themselves to $\lambd$-terms. For instance, -!!a{derivation} of $!A \lif !B$ corresponds to a term +!!a{derivation} of $!A \lif !B$ ending in \Intro{\lif}, with no +remaining open assumptions, corresponds to a term $\lambd[\typeof{x}{!A}][N]$, which has the function type $!A \lif !B$. The inference rules of natural deduction correspond to typing rules in the typed lambda calculus, e.g., @@ -72,7 +75,7 @@ is of type~$!B$, then $\lambd[\typeof{x}{!A}][N]$ is of type~$!A \lif !B$. -The $\Elim\lif$ rule corresponds to the typing rule for composition +The $\Elim\lif$ rule corresponds to the typing rule for application terms, i.e., \[ \AxiomC{$!A \lif !B$} diff --git a/content/proof-theory/propositions-as-types/normalization.tex b/content/proof-theory/propositions-as-types/normalization.tex index d4bb162a..a6d90f0b 100644 --- a/content/proof-theory/propositions-as-types/normalization.tex +++ b/content/proof-theory/propositions-as-types/normalization.tex @@ -10,17 +10,20 @@ \olsection{Normalization} -In this section we prove that, via some reduction order, any deduction -can be reduced to a normal deduction, which is called the -\emph{normalization property}. We will make use of the -propositions-as-types correspondence: we show that every proof term -can be reduced to a normal form; normalization for natural deduction -!!{derivation}s then follows. +This section concerns well-typed terms in the propositional +fragment with $\land$, $\lor$, $\lif$, and $\lfalse$. We distinguish +the principal beta relation $\redone[\beta]$ from the full term +conversion relation $\redone$, which also represents proof +permutations and falsity conversions. First we examine local beta +redex ranks. Full weak normalization follows from the earlier +natural-deduction normalization theorem and the propositions-as-types +correspondence. The standard strong beta normalization property is stated separately +when we discuss computation and confluence. Firstly we define some functions that measure the complexity of terms. The \emph{length}~$\len{!A}$ of !!a{formula}s is defined by \begin{align*} - \len{p} &= 0\\ + \len{p} &= 0,\qquad \len{\lfalse}=0\\ \len{!A \land !B} &= \len{!A} + \len{!B} + 1\\ \len{!A \lor !B} &= \len{!A} + \len{!B} + 1 \\ \len{!A \lif !B} &= \len{!A} + \len{!B} + 1. @@ -32,16 +35,16 @@ \len{!A} + \len{!B} + 1 \\ \cutrank{\ande{i}{\andi{\typeof{M}{!A}}{\typeof{N}{!B}}}} &= \len{!A} + \len{!B} + 1 \\ - \cutrank{\ore{\ori{i}{!A_{i}}{\typeof{M}{!A_i}}} + \cutrank{\ore{\ori{i}{!A_{3-i}}{\typeof{M}{!A_i}}} {\typeof{x_1}{!A_1}}{\typeof{N_1}{!C}} {\typeof{x_2}{!A_2}}{\typeof{N_2}{!C}}} &= - \len{!A} + \len{!B} + 1 + \len{!A_1} + \len{!A_2} + 1 \end{align*} The complexity of a proof term is measured by the most complex -redex in it, and $0$ if it is normal: +principal beta redex in it, and $0$ if it is beta-normal: \[ \maxrank{M} = \max \{\cutrank{N} | N \text{ is a sub term of } M \text{ - and is redex}\} + and is a principal beta redex}\} \] \begin{lem}\ollabel{lem:subst} @@ -51,10 +54,10 @@ \item $M$ is itself a redex, or \item $M$ is of the form $\ande{i}{x}$, and $N$ is of the form $\andi{P_1}{P_2}$ - \item $M$ is of the form $\ore{i}{x_1}{P_1}{x_2}{P_2}$, and $N$ is + \item $M$ is of the form $\ore{x}{x_1}{P_1}{x_2}{P_2}$, and $N$ is of the form $\ori{i}{}{Q}$ \item $M$ is of the form $x Q$, and $N$ is of the form - $\lambd[x][P]$ + $\lambd[y][P]$, after choosing its binder fresh as necessary \end{enumerate} In the first case, $\cutrank{\Subst{M}{N}{x}} = \cutrank{M}$; in the other cases, $\cutrank{\Subst{M}{N}{x}} = \len{!A})$. @@ -82,8 +85,8 @@ \[ \Subst{M}{N}{x} \ident \Subst{\ande{i}{x}}{\andi{P_1}{P_2}}{x}, \] - which is $\ande{i}{\andi{P_1}{P_2}}$. Its cut rank is equal to - $\cutrank{x}$, which is $\len{!A}$. + which is $\ande{i}{\andi{P_1}{P_2}}$. Its cut rank is the length $\len{!A}$ of the product type + of~$x$. \end{enumerate} \end{enumerate} The cases of $\ore{N}{x_1}{N_1}{x_2}{N_2}$ and $P Q$ are similar. @@ -104,8 +107,9 @@ \item If $M$ is of the form $(\lambd[\typeof{x}{!A}][N])\typeof{Q}{!A}$, then $M'$ is $\Subst{N}{\typeof{Q}{!A}}{\typeof{x}{!A}}$. Consider a redex in - $M'$. Either there is corresponding redex in $N$ with equal cut - rank, which is less than $\cutrank{M}$ by assumption, or the cut + $M'$. Either there is a corresponding redex in $N$ or a copied + redex from $Q$, with equal cut rank, which is less than + $\cutrank{M}$ by assumption; or the cut rank equals $\len{!A}$, which by definition is less than $\cutrank{(\lambd[x^{!A}][N])Q}$. \item If $M$ is of the form @@ -115,8 +119,9 @@ {\typeof{x_2}{!A_2}}{\typeof{N_2}{!C}}, \] then $M' \ident \Subst{N_i}{N}{\typeof{x_i}{!A_i}}$. Consider a - redex in~$M'$. Either there is corresponding redex in $N_i$ with - equal cut rank, which is less than $\cutrank{M}$ by assumption; or + redex in~$M'$. Either there is a corresponding redex in $N_i$ or a copied + redex from $N$, with equal cut rank, which is less than + $\cutrank{M}$ by assumption; or the cut rank equals $\len{!A_i}$, which by definition is less than $\cutrank{\ore{\ori{i}{}{\typeof{N}{!A_i}}} {\typeof{x_1}{!A_1}}{\typeof{N_1}{!C}} @@ -124,44 +129,27 @@ \end{enumerate} \end{proof} -\begin{thm} - All proof terms reduce to normal form; all !!{derivation}s reduce to - normal !!{derivation}s. +\begin{thm}[Full weak normalization] +Every well-typed proof term in the stated propositional fragment has +a full normal form. Every corresponding intuitionistic deduction has +a normal form under the full proof conversions. \end{thm} \begin{proof} - The second follows from the first. We prove the first by complete - induction on $m=\maxrank{M}$, where $M$ is a proof term. - \begin{enumerate} - - \item If $m=0$, $M$ is already normal. - \item - Otherwise, we proceed by induction on~$n$, the number of - redexes in $M$ with cut rank equal to~$m$. - \begin{enumerate} - \item If $n=1$, select any redex $N$ such that $m = \cutrank{N} > - \cutrank{P}$ for any proper sub-term $P$ which is also a redex - of course. Such a redex must exist, since any term only has - finitely many subterms. - - Let $N'$ denote the reductum of $N$. Now by the lemma - $\maxrank{N'} < \maxrank{N}$, thus we can see that $n$, the - number of redexes with $\cutrank=m$ is decreased. So $m$ is - decreased (by $1$ or more), and we can apply the inductive - hypothesis for~$m$. - \item For the induction step, assume $n>1$. the process is - similar, except that $n$ is only decreased to a positive number - and thus $m$ does not change. We simply apply the induction - hypothesis for~$n$. - \end{enumerate} -\end{enumerate} +Reconstruct the term's natural deduction using its free-variable +context. Apply the earlier normalization theorem for $\Log{N2i}$, +and assign terms to the resulting deductions. By the definition of +the full term conversions, each proof conversion is represented by +the corresponding term conversion. The final deduction and its term +are fully normal. Conversions may discard unused assumptions; +weakening restores any larger ambient typing context. This uses the +previous proof normalization theorem, not the local rank lemma. \end{proof} -The fact that typed $\lambd$-terms normalize means that every such -term \emph{has a normal form}. If we think of $\beta$-reducing -$\lambd$-terms to their normal form as executing a computation and the -normal form as the value of the computation, this means that every -computation in the typed $\lambd$-calculus eventually halts an +A typed $\lambd$-term beta-normalizes if it \emph{has a beta-normal form}. If we think of $\beta$-reducing +$\lambd$-terms to a beta-normal form as executing a computation and the +normal form as the value of the computation, weak beta normalization means that every +computation in the typed $\lambd$-calculus has an execution that halts and produces a value. Moreover, type preservation ensures that the value has the right type. E.g., if $N$ has type $!A \lif !B$ (i.e., it is a function that is supposed to work for arguments of type~$!A$ and @@ -178,29 +166,24 @@ but \emph{any} way to execute the computation eventually produces a value. -How do we know that different ways of executing a computation produce -the \emph{same} value? So far we just know (from type preservation) -that all values it produces are of the same type. The typed -$\lambd$-calculus has another important property: it is -\emph{confluent} or \emph{Church-Rosser}. If $N \red N_1$ and $N \red -N_2$ then there is some term~$N'$ such that $N_1 \red N'$ and $N_2 \red -N'$. Recall that $N \red N'$ means: $N'$ results from zero or more -$\redone$-reduction steps. If $N_1$ is in normal form then the only -term $N'$ such that $N_1 \red N'$ is $N_1$ itself (via zero -$\redone$-reduction steps). It follows that if $N_1$ and $N_2$ are -both in normal form, then $N_1 = N' = N_2$. In other words, since -$\red$ is strongly normalizing, every way of reducing a term -eventually results in a normal form. Since $\red$ is Church-Rosser, -any two normal forms are equal. Hence, computation in the typed -$\lambd$-calculus always terminates and the value (normal form) is the -same regardless of how the computation proceeds. +Different beta computations of the same well-typed term produce +the same normal form, up to renaming bound variables. The one-step +relation $\redone[\beta]$ is strongly normalizing, and its reflexive +transitive closure $\red[\beta]$ is confluent: if +$N\red[\beta]N_1$ and $N\red[\beta]N_2$, there is an $N'$ with +$N_1\red[\beta]N'$ and $N_2\red[\beta]N'$. If both descendants +are beta-normal, these last reductions take zero steps, so the two +normal forms are equal up to bound-variable renaming. Termination +concerns one-step reduction, not its reflexive closure. We prove +confluence below for beta reduction only; no confluence assertion for +the larger full proof-conversion relation is needed. Proving that a relation is confluent is typically difficult. However, we can easily establish the following weaker condition: -\begin{prop}[Weak Church-Rosser Property] -If $N \redone N_1$ and $N \redone N_2$ then there is a term $N'$ such -that $N_1 \red N'$ and $N_2 \red N'$. +\begin{prop}[Weak Church-Rosser Property for beta reduction] +If $N \redone[\beta] N_1$ and $N \redone[\beta] N_2$ then there is a term $N'$ such +that $N_1 \red[\beta] N'$ and $N_2 \red[\beta] N'$. \end{prop} \begin{proof} @@ -219,36 +202,29 @@ subterm of $O_1$, then converting $M_2$ results in $O_1'$. So converting $M_1$ first and then $M_2$ results in $O_1'$. But converting $M_2$ first results in $\proj{1}{\pair{O_1'}{O_2}}$ and - this reduces also to~$O_2$. + this reduces also to~$O_1'$. \end{proof} \begin{lem}[Newman's Lemma] -If $\red$ is strongly normalizing and has the weak Church-Rosser -property, it is confluent. +If a one-step relation $\redone[\beta]$ is strongly normalizing +and has the weak Church-Rosser property, its reflexive transitive +closure $\red[\beta]$ is confluent. \end{lem} \begin{proof} - Since $\red$ is strongly normalizing, any reduction sequence results - in a normal form. Normal forms are unique iff $\red$ is confluent. - So suppose some term $N$ has two distinct normal forms $N'$ and - $N''$, the result of reduction sequences - \begin{align*} - N & = N_1' \redone N_2' \redone \dots \redone N_k' = N' \text{ and}\\ - N & = N_1'' \redone N_2'' \redone \dots \redone N_l'' = N'' - \end{align*} - (The reduction sequence must have length $>0$ since otherwise $N$ - would already be in normal form.) - - If $N_1' = N_1''$ then it has two distinct normal forms ($N'$ and - $N''$). If $N_1' \neq N_1''$ then by weak Church-Rosser there is - some $N'''$ such that $N_1' \red N'''$ and $N_1'' \red N'''$. Since - $N' \neq N''$, either $N''' \neq N'$ or $N''' \neq N''$. - Consequently, either $N_1'$ or $N_1''$ has two distinct normal - forms. We've shown that if $N$ has two distinct normal forms, there - is an $N_1$ such that $N \redone N_1$ and $N_1$ has two distinct - normal forms. Obviously we can keep going and produce $N \redone N_1 - \redone N_2 \redone \dots$, but this is impossible because $\redone$ - is strongly normalizing. +Strong normalization guarantees that every term has a normal form. +We prove uniqueness of normal forms by well-founded induction on the +one-step descendants of~$N$. Suppose $N$ reduces to normal forms +$U$ and $V$. If $N$ is already normal, both equal $N$. Otherwise +the two reductions begin with actual steps +$N\redone[\beta]N_1$ and $N\redone[\beta]N_2$. +Weak Church-Rosser gives a common descendant $Q$ of $N_1$ and $N_2$. +By strong normalization reduce $Q$ to a normal form $W$. +The induction hypothesis at the proper descendants $N_1$ and $N_2$ +gives $U=W$ and $V=W$, respectively. This proves uniqueness. +Finally any two descendants of $N$ can themselves be reduced to +normal forms. Their normal forms are also normal forms of $N$, so +they agree and give the required common descendant. \end{proof} diff --git a/content/proof-theory/propositions-as-types/proof-terms.tex b/content/proof-theory/propositions-as-types/proof-terms.tex index ce6f1314..f333204d 100644 --- a/content/proof-theory/propositions-as-types/proof-terms.tex +++ b/content/proof-theory/propositions-as-types/proof-terms.tex @@ -10,9 +10,16 @@ \olsection{Proof Terms} +In this chapter the proof-term correspondence is restricted to the +propositional fragment with $\lif$, $\land$, $\lor$, and $\lfalse$; +negation is treated as the abbreviation $\lnot !A\equiv(!A\lif\lfalse)$. +The term-labelled propositional systems in the tables are +\Log{tN2ip} and \Log{tN3ip}; we abbreviate these names as +\Log{tN2i} and \Log{tN3i} in the prose. + We label assumptions in \Log{N1i} with variables (e.g., $!A^x$) as discharge labels. In \Log{N2i}, every sequent $\Gamma \Sequent !A$ -has a list of variable--!!{formula} pairs in the context~$\Gamma$ on +has a compatible set of variable--!!{formula} pairs in the context~$\Gamma$ on the left. Thus, in \Log{N2i}, every sequent in !!a{proof} carries not only the information what the !!{proof} so far has !!{prove}d (i.e., $!A$), but also which assumptions are open at each point (i.e., @@ -38,7 +45,7 @@ \Axiom$\Gamma_1 \fCenter N: !A$ \Axiom$\Gamma_2 \fCenter M: !B$ \RightLabel{\Intro{\land}} -\BinaryInf$\Gamma_1, \Gamma_2 \fCenter c^\land(N, m) : !A \land !B $ +\BinaryInf$\Gamma_1, \Gamma_2 \fCenter c^\land(N, M) : !A \land !B $ \DisplayProof \quad \Axiom$\Gamma \fCenter N: !A \land !B$ @@ -75,7 +82,7 @@ \[ \Axiom$\Gamma \fCenter N:!A$ \RightLabel{\Intro{\lor}[1]} -\UnaryInf$\Gamma \fCenter c^{\lor{!B}}_1:!A \lor !B$ +\UnaryInf$\Gamma \fCenter c^{\lor{!B}}_1(N):!A \lor !B$ \DisplayProof \quad \Axiom$\Gamma \fCenter N:\lfalse$ @@ -110,7 +117,7 @@ \item If $N$ is a proof term, then $\proj{i}{N}$ is also a proof term, where $i$ is $1$ or~$2$~(\Elim\land[i]). \item If $N$ is a proof term, and $!A$ is a formula, then - $\inj[!A]{i}{!M}$ is a proof term, where $i$ is $1$ or~$2$~(\Intro\lor[i]). + $\inj[!A]{i}{N}$ is a proof term, where $i$ is $1$ or~$2$~(\Intro\lor[i]). \item If $M$, $N_1$, $N_2$ are proof terms, and $x_1$, $x_2$ are variables, then $\dcase{M}{x_1}{N_1}{x_2}{N_2}$ is a proof term~(\Elim\lor). diff --git a/content/proof-theory/propositions-as-types/proofs-to-terms.tex b/content/proof-theory/propositions-as-types/proofs-to-terms.tex index ff5d4775..32ff51ab 100644 --- a/content/proof-theory/propositions-as-types/proofs-to-terms.tex +++ b/content/proof-theory/propositions-as-types/proofs-to-terms.tex @@ -20,9 +20,12 @@ the rules of \Log{tN2i}. \begin{prop} -Every !!{proof}~$\delta$ of $\Gamma \Sequent !A$ in \Log{N2i} +Every !!{proof}~$\delta$ of $\Gamma \Sequent !A$ in the stated +propositional fragment of \Log{N2i} corresponds to !!a{proof}~$\delta'$ of $\Gamma \Sequent N : !A$ in -\Log{tN2i}. The proof term $N$ is uniquely determined by~$\delta$. +\Log{tN2i}. The proof term $N$ is determined by~$\delta$ up to consistent +renaming of bound variables; fixing all discharge labels, including +vacuous ones, fixes a representative. \end{prop} \begin{proof} diff --git a/content/proof-theory/propositions-as-types/propositions-as-types.tex b/content/proof-theory/propositions-as-types/propositions-as-types.tex index 9948d01b..7c8a967d 100644 --- a/content/proof-theory/propositions-as-types/propositions-as-types.tex +++ b/content/proof-theory/propositions-as-types/propositions-as-types.tex @@ -11,8 +11,7 @@ This is a \emph{very experimental} draft of a chapter on the Curry--Howard correspondence. It needs more explanation and motivation, and there are probably errors and omissions. The proof - of normalization should be reviewed and expanded. There are no - examples for the product type. Permutation and simplification + of normalization should be reviewed and expanded. More examples for the product type would be useful. Permutation conversions have only one example, and simplification conversions are not covered. It will make a lot more sense once there is also material on the (typed) lambda calculus which is basically presupposed here. Use with extreme caution. diff --git a/content/proof-theory/propositions-as-types/reduction.tex b/content/proof-theory/propositions-as-types/reduction.tex index 27836b02..7930086c 100644 --- a/content/proof-theory/propositions-as-types/reduction.tex +++ b/content/proof-theory/propositions-as-types/reduction.tex @@ -10,8 +10,8 @@ \olsection{Reduction} -In natural deduction !!{derivation}s, !!a{introduction} rule that is -followed by !!a{elimination} rule is a detour that can be ``reduced''. +In natural deduction !!{derivation}s, an !!{introduction} rule whose conclusion is immediately used as +the major premise of the corresponding !!{elimination} rule is a detour that can be ``reduced''. For instance, an $\Intro{\land}$ followed by $\Elim{\land}$ ``cancel out,'' since the conclusion of $\Elim{\land}$ is always one of the conjuncts of the conjunction that \Intro{\land} produces, and the @@ -59,8 +59,19 @@ called the \emph{reductum}. Unlike untyped lambda calculus, where only $(\lambd[x][N])Q$ is considered to be redex, in the typed lambda calculus the syntax is extended to terms involving $\pair{N}{M}$, -$\proj{i}{N}$, $\inj{i}{!A}{N}$, $\dcase{N}{x_1}{M_1}{x_2}{M_2}$, and -$\abort{!A}{N}$, with corresponding redexes. +$\proj{i}{N}$, $\inj[!A]{i}{N}$, $\dcase{N}{x_1}{M_1}{x_2}{M_2}$, and +$\abort{!A}{N}$. +We write $\redone[\beta]$ for the compatible closure of the three +principal beta contractions: application of an abstraction, projection +of a pair, and case analysis of an injection. The abort constructor +has no root beta contraction. + +The undecorated relation $\redone$ will denote the larger relation +transported from the propositional \Log{N2i} proof conversions, +including their permutation and falsity conversions. Thus every beta +step is a step of~$\redone$, but the converse need not hold. All +substitutions and conversions avoid capture, with bound variables +renamed as needed. Similarly we have reduction for disjunction: \begin{gather*} @@ -91,7 +102,7 @@ \end{gather*} This corresponds to a reduction on proof terms: \begin{gather*} - \dcase{\inj[!A_i]{i}{M}}{x_1}{N_1}{x_2}{N_2} \redone \Subst{N_i}{M}{x_i} + \dcase{\inj[!A_{3-i}]{i}{M}}{x_1}{N_1}{x_2}{N_2} \redone[\beta] \Subst{N_i}{M}{x_i} \end{gather*} where $M$ is the proof term of~$\delta$, and $N_i$ is the proof term of~$\delta_i$. This is the beta reduction rule of for sum types. @@ -126,7 +137,7 @@ For proof terms, this amounts to ordinary beta reduction: \begin{gather*} (\lambd[\typeof{x}{!A}][N]M) - \redone \Subst{N}{M}{x} + \redone[\beta] \Subst{N}{M}{x} \end{gather*} In addition to reduction conversions on !!{proof}s, we can consider @@ -172,7 +183,8 @@ \TrinaryInfC{$!C_i$} \DisplayProof \end{multline*} -If the proof terms of $\delta$, $\delta_1$, and $\delta_2$ are $M$, +If the proof terms of the entire disjunction-introduction proof, +$\delta_1$, and $\delta_2$ are $M$, $N_1$, and $N_2$, respectively, the corresponding reduction rule for proof terms, i.e., $\lambd$ terms, is: \[ @@ -182,16 +194,18 @@ Of course we can eliminate detours not just at the ends of !!{proof}s, but also within !!{proof}s, by applying the reduction conversion to a -sub-!!{proof} ending in a detour. Similarly, $\beta$-reduction applies -to subterms of $\lambd$-terms. If $N$ is a subterm of $M$, $N \redone +sub-!!{proof} ending in a detour. Each declared term-conversion relation is closed under +replacement of subterms. If $N$ is a subterm of $M$, $N \redone N'$, we can replace the subterm $N$ in~$M$ by $N'$ to obtain $M'$. In that case we also write $M \redone M'$. If there is a sequence $M = M_1 -\redone M_2 \redone M_2 \redone \dots \redone M_k = M'$ (including +\redone M_2 \redone M_3 \redone \dots \redone M_k = M'$ (including where $k=1$, i.e., $M = M'$) we write $M \red M'$. -A !!{proof} where no conversion can be applied to any sub-!!{proof} -is called \emph{normal}. Similarly, a $\lambd$-term where no -conversion can be applied (to any sub-term) is called \emph{normal}. A -normal $\lambd$-term is also called a \emph{normal form}. +Write $\red[\beta]$ for zero or more beta steps. A term is +\emph{beta-normal} if no $\redone[\beta]$ step applies. A proof, or +its corresponding term, is \emph{fully normal} if none of the full +proof conversions applies; for terms this means no $\redone$ step. +These notions differ in the presence of permutations or falsity +conversions. \end{document} diff --git a/content/proof-theory/propositions-as-types/sequent-natural-deduction.tex b/content/proof-theory/propositions-as-types/sequent-natural-deduction.tex index 54f1aa36..4d4abb00 100644 --- a/content/proof-theory/propositions-as-types/sequent-natural-deduction.tex +++ b/content/proof-theory/propositions-as-types/sequent-natural-deduction.tex @@ -17,9 +17,9 @@ We write $\Gamma, !A_1, \dots, !A_n$ for $\Gamma \cup \{!A_1, \dots, !A_n\}$, and $\Gamma, \Delta$ for $\Gamma \cup \Delta$. -Observe that when we have $\Gamma \Sequent !A \land !A$, meaning we +Observe that when we have $\Gamma \Sequent !A \land !B$, meaning we have !!a{derivation} with $\Gamma$ as !!{undischarged} assumptions and -$!A \land !A$ as end-!!{formula}, then by applying $\Elim{\land}$ at +$!A \land !B$ as end-!!{formula}, then by applying $\Elim{\land}$ at the bottom, we can get !!a{derivation} with the same !!{undischarged} assumptions and $!A$ as conclusion. In other words, if $\Gamma \Sequent !A \land !B$, then $\Gamma \Sequent !A$. @@ -113,14 +113,14 @@ assumptions from which it was !!{derive}d. \begin{prooftree} + \Axiom$!B \fCenter !B$ + \Axiom$!B \fCenter !B$ \Axiom$!A \fCenter !A$ - \UnaryInf $!A \fCenter !A \lor (!A \lif \lfalse)$ - \Axiom $!B \fCenter !B$ - \BinaryInf$!A, !B\lif \fCenter \lfalse$ - \UnaryInf$(!B \fCenter !A \lif \lfalse$ - \UnaryInf$( !B \fCenter !A \lor (!A \lif \lfalse)$ - \Axiom$(!B \fCenter !B$ - \BinaryInf$(!B \fCenter \lfalse$ + \UnaryInf$!A \fCenter !A \lor (!A \lif \lfalse)$ + \BinaryInf$!A, !B \fCenter \lfalse$ + \UnaryInf$!B \fCenter !A \lif \lfalse$ + \UnaryInf$!B \fCenter !A \lor (!A \lif \lfalse)$ + \BinaryInf$!B \fCenter \lfalse$ \UnaryInf$\fCenter !B \lif \lfalse$ \end{prooftree} where $!B$ is short for $(!A \lor (!A \lif \lfalse))\lif \lfalse$. diff --git a/content/proof-theory/propositions-as-types/type-preservation.tex b/content/proof-theory/propositions-as-types/type-preservation.tex index 2e0eca06..c6ac5c28 100644 --- a/content/proof-theory/propositions-as-types/type-preservation.tex +++ b/content/proof-theory/propositions-as-types/type-preservation.tex @@ -14,11 +14,10 @@ defined directly for the systems \Log{tN2i} and \Log{tN3i}. The system \Log{tN3i} defines the type of a $\lambd$-term~$N$ relative to the context~$\Gamma$ as the !!{formula}~$!A$ such that $\Gamma \Sequent N -: !A$ has !!a{proof} in \Log{tN3i}. The fact that the -$\beta$-reduction rules for $\lambd$-terms exactly mirror the -reduction and permutation conversions of !!{proof}s has an important -consequence: the type of a $\lambd$-term relative to a -context~$\Gamma$ remains the same after $\beta$-conversion. This +: !A$ has !!a{proof} in \Log{tN3i}. The declared term-conversion relation mirrors the corresponding +proof conversions. Consequently the type of a term relative to +$\Gamma$ is preserved by those conversions, and in particular by its +beta-reduction subrelation. This property is called \emph{type preservation}. \begin{prop} @@ -87,10 +86,12 @@ \end{multline*} Again the proof term of the !!{proof} on the right is exactly the result of $\beta$-reducing the proof term of the !!{proof} on the - left. Of course one would have to carefuly verify (by induction on - the height of~$\delta_2$) that if we replace all axioms of the form - $\Gamma' \Sequent x:!B_1$ in~$\delta_2$ by the !!{proof}~$\delta_3$ - of $\Gamma \Sequent M:!B_1$ actually results in !!a{proof} + left. Of course one would have to carefully verify (by induction on + the height of~$\delta_2$) that, after renaming the abstraction's bound variable~$x$ and + the intervening binders fresh for~$\Gamma$ and~$M$, replacing each + axiom $\Gamma'\Sequent x:!B_1$ by a copy of~$\delta_3$ weakened + from~$\Gamma$ to $\Gamma'\setminus\{x:!B_1\}$, and deleting + $x:!B_1$ from every affected context, results in !!a{proof} $\Subst{\delta_2}{\delta_3}{x:!B_1}$ of $\Gamma \Sequent \Subst{N}{M}{x} : !B_2$. \end{proof} @@ -103,11 +104,11 @@ \Sequent M: !B$) to which a conversion can be applied. If $N \redone N'$ by replacing $M$ by its reductum, the corresponding result of applying the reduction to~$\delta$ is !!a{proof} of $\Gamma \Sequent -N' : !A$. Hence every $\lambd$-term not in normal form $\beta$-reduces -to another. This property is called \emph{progress}. +N' : !A$. Hence every $\lambd$-term not in normal form has a term-conversion +step. This property is called \emph{progress}. -Progress together with type preservation ensure that $\beta$-reduction -of $\lambd$-terms never ``gets stuck'': if a term is well-typed and +Progress and type preservation ensure that the declared +conversions of $\lambd$-terms never ``get stuck'': if a term is well-typed and isn't in normal form, it reduces to another well-typed term (and that term is of the same type).