Skip to content

Commit 7daa771

Browse files
committed
Add some notes on proofs with empty domains
1 parent 4349c0d commit 7daa771

3 files changed

Lines changed: 47 additions & 14 deletions

File tree

src/notebook/math/logic/deduction/proof_tree.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ def get_open_variables(
6767
if var not in eigen
6868
}
6969

70-
def is_strict(self) -> bool:
71-
return True
70+
def new_implicit_variables(self) -> Collection[Variable]:
71+
return set()
7272

7373
def __str__(self) -> str:
7474
return self.build_renderer().render()
@@ -193,9 +193,9 @@ def get_open_variables(
193193
) -> Collection[Variable]:
194194
return set(self._iter_open_variables(eigen, discharged))
195195

196-
def is_strict(self) -> bool:
196+
def new_implicit_variables(self) -> Collection[Variable]:
197197
open_vars = self.get_open_variables()
198-
return any(var not in open_vars for var in self.implicit_variables)
198+
return {var for var in self.implicit_variables if var not in open_vars}
199199

200200
def __str__(self) -> str:
201201
return self.build_renderer().render()

src/notebook/math/logic/deduction/test_proof_tree.py

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
parse_formula_placeholder,
1010
parse_formula_with_substitution,
1111
parse_marker,
12+
parse_variable,
1213
)
1314
from ..propositional import parse_prop_formula
1415
from ..signature import FormalLogicSignature
@@ -265,6 +266,24 @@ def test_forall_introduction() -> None:
265266
)
266267

267268

269+
# rem:fol_empty_universe/natural_deduction
270+
def test_forall_elimination(dummy_signature: FormalLogicSignature) -> None:
271+
tree = apply(
272+
CLASSICAL_NATURAL_DEDUCTION_SYSTEM['∀₋'],
273+
assume(parse_formula('∀x.p¹(x)', dummy_signature), parse_marker('u')),
274+
conclusion_config=parse_formula_with_substitution('p¹(x)[x ↦ y]', dummy_signature),
275+
)
276+
277+
assert tree.get_open_variables() == set()
278+
assert tree.new_implicit_variables() == {parse_variable('y')}
279+
assert str(tree) == dedent('''\
280+
[∀x.p¹(x)]ᵘ
281+
___________ ∀₋
282+
p¹(y)
283+
'''
284+
)
285+
286+
268287
# ex:def:fol_natural_deduction/reintroduction
269288
def test_forall_reintroduction(dummy_signature: FormalLogicSignature) -> None:
270289
tree = apply(
@@ -280,7 +299,7 @@ def test_forall_reintroduction(dummy_signature: FormalLogicSignature) -> None:
280299
)
281300

282301
assert tree.get_open_variables() == set()
283-
assert not tree.is_strict()
302+
assert tree.new_implicit_variables() == set()
284303
assert str(tree) == dedent('''\
285304
[∀x.p¹(x)]ᵘ
286305
___________ ∀₋
@@ -305,7 +324,7 @@ def test_forall_reintroduction_with_renaming(dummy_signature: FormalLogicSignatu
305324
)
306325

307326
assert tree.get_open_variables() == set()
308-
assert not tree.is_strict()
327+
assert tree.new_implicit_variables() == set()
309328
assert str(tree) == dedent('''\
310329
[∀x.p¹(x)]ᵘ
311330
___________ ∀₋
@@ -330,7 +349,7 @@ def test_forall_to_exists(dummy_signature: FormalLogicSignature) -> None:
330349
)
331350

332351
assert tree.get_open_variables() == set()
333-
assert not tree.is_strict()
352+
assert tree.new_implicit_variables() == set()
334353
assert str(tree) == dedent('''\
335354
[∀x.p¹(x)]ᵘ
336355
___________ ∀₋
@@ -356,7 +375,7 @@ def test_forall_to_exists_with_constant(dummy_signature: FormalLogicSignature) -
356375
)
357376

358377
assert tree.get_open_variables() == set()
359-
assert not tree.is_strict()
378+
assert tree.new_implicit_variables() == set()
360379
assert str(tree) == dedent('''\
361380
[∀x.p¹(x)]ᵘ
362381
___________ ∀₋

text/first_order_natural_deduction.tex

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ \section{First-order natural deduction}\label{sec:first_order_natural_deduction}
477477

478478
Actually, we will need a more elaborate construction --- a function \( F(D, E) \) depending on a set \( D \) of discharged markers and a set \( E \) of discharged eigenvariables. We call \( F(\varnothing, \varnothing) \) \enquote{the} set of open free variables of the tree.
479479

480-
\thmitem{def:fol_natural_deduction_proof_tree/implicit_variables} Similarly to implicit open premises, we may also have \term{implicit open variables}. We will call the proof tree \term{strict} if all implicit variables are also explicit open free variables.
480+
\thmitem{def:fol_natural_deduction_proof_tree/implicit_variables} Similarly to implicit open premises, we may also have \term{implicit free variables}.
481481
\end{thmenum}
482482

483483
Just as with assumption discharging, binding variables is also delicate to handle:
@@ -563,7 +563,7 @@ \section{First-order natural deduction}\label{sec:first_order_natural_deduction}
563563

564564
Thus, have taken the union of all open variables of the subtrees and all free variables of the implicit premises, excluding those discharged at the current application.
565565

566-
\thmitem{def:fol_natural_deduction_proof_tree/application/implicit_variables} If the conclusion schema features a substitution, i.e. if \( \Psi = \Lambda[\xi \mapsto \Tau] \), let the set of implicit open variables be the set of variables of the term \( \Tau[\BbbI] \). Otherwise, let \( C_d \) be the empty set.
566+
\thmitem{def:fol_natural_deduction_proof_tree/application/implicit_variables} If the conclusion schema features a substitution, i.e. if \( \Psi = \Lambda[\xi \mapsto \Tau] \), let the set of implicit free variables be the set of variables of the term \( \Tau[\BbbI] \). Otherwise, let \( C_d \) be the empty set.
567567
\end{thmenum}
568568
\end{thmenum}
569569
\end{definition}
@@ -576,7 +576,7 @@ \section{First-order natural deduction}\label{sec:first_order_natural_deduction}
576576

577577
\item Even though we do not disallow eigenvariables in the conclusion, they would be treated the same as regular variables.
578578

579-
\item Implicit variables and strict proof trees are not established concepts. Nonstrict rule application trees, in which the conclusion may introduce new free variables, have some debatable aspects despite being the norm. See \cref{rem:fol_empty_universe/natural_deduction} for a broader discussion.
579+
\item Implicit variables are not an established concept. Placing restrictions on them allows us to mitigate some debatable proof trees --- see \cref{rem:fol_empty_universe/natural_deduction} for a broader discussion.
580580

581581
\item The term \enquote{eigenvariable} comes from \tcite{#2, where #1}{Gentzen1935LogischeSchließen} introduces natural deduction. In the corresponding English translation, \cite[293]{Gentzen1964LogicalDeduction}, eigenvariables are instead called \enquote{proper variables}. Both terms are currently used in English (e.g. \incite[\S 5.1.10]{Mimram2020ProgramEqualsProof} uses \enquote{eigenvariable}, while \incite[38]{TroelstraSchwichtenberg2000BasicProofTheory} uses \enquote{proper variable}).
582582

@@ -927,11 +927,25 @@ \section{First-order natural deduction}\label{sec:first_order_natural_deduction}
927927

928928
This derivation is not sound in an empty universe where nothing exists. Nevertheless, the standard treatment of natural deduction ignores this issue --- starting from Gentzen's \cite[186]{Gentzen1935LogischeSchließen}, and including \cite[ch. 2]{TroelstraSchwichtenberg2000BasicProofTheory}, \cite[\S 2.8]{VanDalen2004LogicAndStructure} and \cite[97]{КолмогоровДрагалин2006Логика}.
929929

930-
\incite*[\S 5.1.10]{Mimram2020ProgramEqualsProof} provides a hint at how to handle this situation. We have adapted his remarks when introducing strict proof trees in \cref{def:fol_natural_deduction_proof_tree/implicit_variables}. Since the only open assumption above has no free variables, the application of \ref{inf:def:fol_natural_deduction/forall/elim} is strict only if \( \tau \) is closed. This is the case when \( \tau \) contains at least one individual constant. But if the signature has an individual constant, its domain cannot be empty.
930+
There are some ad-hoc ways to prevent the above rule applications:
931+
\begin{thmenum}
932+
\thmitem{rem:fol_empty_universe/restricted_implicit} We may require all \hyperref[def:fol_natural_deduction_proof_tree/implicit_variables]{implicit free variables} to belong to the existing \hyperref[def:fol_natural_deduction_proof_tree/open_variables]{open free variables}. This would affect the rule \ref{inf:def:fol_natural_deduction/forall/elim}. It would be possible to derive \( \varphi[x \mapsto \tau] \) from \( \qforall x \varphi \), but only if the free variables of \( \tau \) are open in the proof tree.
933+
934+
In our example, the proof tree has no variables open, thus \( \tau \) must use constants rather than variables. But if the signature has an individual constant, its domain cannot be empty. If, on the other hand, the domain is empty, the rule becomes inapplicable.
935+
936+
On the other hand, this restriction would prevent the following sound proof
937+
\begin{equation*}
938+
\begin{prooftree}
939+
\hypo{ [\qforall x p(x)]^u }
940+
\infer1[\ref{inf:def:fol_natural_deduction/forall/elim}]{ p(y) }
941+
\infer1[\ref{inf:def:fol_natural_deduction/forall/intro}]{ \qforall z p(z) }
942+
\end{prooftree}
943+
\end{equation*}
931944

932-
If, on the other hand, the domain is empty, the rule is inapplicable. Strict proof trees require us to be more careful with the choice of conclusion of \ref{inf:def:fol_natural_deduction/forall/elim}. However, this makes them compatible with empty universes.
945+
\thmitem{rem:fol_empty_universe/non_eigenvariable} An alternative is suggested by \incite[\S 5.1.10]{Mimram2020ProgramEqualsProof}. He allows implicit variables to be used at most once in non-eigenvariable substitutions. In our example, this allows the application of \ref{inf:def:fol_natural_deduction/forall/elim}, but not that of \ref{inf:def:fol_natural_deduction/exists/intro}.
933946

934-
Due to the increased complexity, we will not further pursue this path.
947+
Unlike the solution above, this one does not prevent us from applying \ref{inf:def:fol_natural_deduction/forall/intro} instead because the restriction is only for non-eigenvariable substitutions.
948+
\end{thmenum}
935949
\end{remark}
936950

937951
\begin{remark}\label{rem:sequent_calculus_eigenvariables}

0 commit comments

Comments
 (0)