Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Natural deduction
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Proofs and type theory== {{Unreferenced section|date=May 2024}} The presentation of natural deduction so far has concentrated on the nature of propositions without giving a formal definition of a ''proof''. To formalise the notion of proof, we alter the presentation of hypothetical derivations slightly. We label the antecedents with ''proof variables'' (from some countable set ''V'' of variables), and decorate the succedent with the actual proof. The antecedents or ''hypotheses'' are separated from the succedent by means of a ''[[Turnstile (symbol)|turnstile]]'' (โข). This modification sometimes goes under the name of ''localised hypotheses''. The following diagram summarises the change. {| style="margin-left: 2em;" |- | โโโโ u<sub>1</sub> โโโโ u<sub>2</sub> ... โโโโ u<sub>n</sub> J<sub>1</sub> J<sub>2</sub> J<sub>n</sub> โฎ J | width="10%" align="center" | โ || u<sub>1</sub>:J<sub>1</sub>, u<sub>2</sub>:J<sub>2</sub>, ..., u<sub>n</sub>:J<sub>n</sub> โข J |} The collection of hypotheses will be written as ฮ when their exact composition is not relevant. To make proofs explicit, we move from the proof-less judgment "''A''" to a judgment: "ฯ ''is a proof of (A)''", which is written symbolically as "ฯ : ''A''". Following the standard approach, proofs are specified with their own formation rules for the judgment "ฯ ''proof''". The simplest possible proof is the use of a labelled hypothesis; in this case the evidence is the label itself. {| style="margin-left: 2em;" |- | u โ V โโโโโโโ proof-F u proof | width="10%" | || โโโโโโโโโโโโโโโโโโโโโ hyp u:A โข u : A |} Let us re-examine some of the connectives with explicit proofs. For conjunction, we look at the introduction rule โงI to discover the form of proofs of conjunction: they must be a pair of proofs of the two conjuncts. Thus: {| style="margin-left: 2em;" |- | ฯ<sub>1</sub> proof ฯ<sub>2</sub> proof โโโโโโโโโโโโโโโโโโโโ pair-F (ฯ<sub>1</sub>, ฯ<sub>2</sub>) proof | width="10%" | || ฮ โข ฯ<sub>1</sub> : A ฮ โข ฯ<sub>2</sub> : B โโโโโโโโโโโโโโโโโโโโโโโโโ โงI ฮ โข (ฯ<sub>1</sub>, ฯ<sub>2</sub>) : A โง B |} The elimination rules โงE<sub>1</sub> and โงE<sub>2</sub> select either the left or the right conjunct; thus the proofs are a pair of projections—first ('''fst''') and second ('''snd'''). {| style="margin-left: 2em;" |- | ฯ proof โโโโโโโโโโโ '''fst'''-F '''fst''' ฯ proof | width="10%" | || ฮ โข ฯ : A โง B โโโโโโโโโโโโโ โงE<sub>1</sub> ฮ โข '''fst''' ฯ : A |- | ฯ proof โโโโโโโโโโโ '''snd'''-F '''snd''' ฯ proof | width="10%" | || ฮ โข ฯ : A โง B โโโโโโโโโโโโโ โงE<sub>2</sub> ฮ โข '''snd''' ฯ : B |} For implication, the introduction form localises or ''binds'' the hypothesis, written using a ฮป; this corresponds to the discharged label. In the rule, "ฮ, ''u'':''A''" stands for the collection of hypotheses ฮ, together with the additional hypothesis ''u''. {| style="margin-left: 2em;" |- | ฯ proof โโโโโโโโโโโโ ฮป-F ฮปu. ฯ proof | width="10%" | || ฮ, u:A โข ฯ : B โโโโโโโโโโโโโโโโโ โI ฮ โข ฮปu. ฯ : A โ B |- | ฯ<sub>1</sub> proof ฯ<sub>2</sub> proof โโโโโโโโโโโโโโโโโโโ app-F ฯ<sub>1</sub> ฯ<sub>2</sub> proof | width="10%" | || ฮ โข ฯ<sub>1</sub> : A โ B ฮ โข ฯ<sub>2</sub> : A โโโโโโโโโโโโโโโโโโโโโโโโโโโโ โE ฮ โข ฯ<sub>1</sub> ฯ<sub>2</sub> : B |} With proofs available explicitly, one can manipulate and reason about proofs. The key operation on proofs is the substitution of one proof for an assumption used in another proof. This is commonly known as a ''substitution theorem'', and can be proved by [[mathematical induction|induction]] on the depth (or structure) of the second judgment. === Substitution theorem === {{Unreferenced section|date=May 2024}} : ''If'' ฮ โข ฯ<sub>1</sub> : ''A'' ''and'' ฮ, ''u'':''A'' โข ฯ<sub>2</sub> : ''B'', ''then'' ฮ โข [ฯ<sub>1</sub>/''u''] ฯ<sub>2</sub> : B. So far the judgment "ฮ โข ฯ : ''A''" has had a purely logical interpretation. In [[type theory]], the logical view is exchanged for a more computational view of objects. Propositions in the logical interpretation are now viewed as ''types'', and proofs as programs in the [[lambda calculus]]. Thus the interpretation of "ฯ : ''A''" is "''the program'' ฯ has type ''A''". The logical connectives are also given a different reading: conjunction is viewed as [[product type|product]] (ร), implication as the function [[function type|arrow]] (โ), etc. The differences are only cosmetic, however. Type theory has a natural deduction presentation in terms of formation, introduction and elimination rules; in fact, the reader can easily reconstruct what is known as ''simple type theory'' from the previous sections. The difference between logic and type theory is primarily a shift of focus from the types (propositions) to the programs (proofs). Type theory is chiefly interested in the convertibility or reducibility of programs. For every type, there are canonical programs of that type which are irreducible; these are known as ''canonical forms'' or ''values''. If every program can be reduced to a canonical form, then the type theory is said to be ''[[normalization property (abstract rewriting)|normalising]]'' (or ''weakly normalising''). If the canonical form is unique, then the theory is said to be ''strongly normalising''. Normalisability is a rare feature of most non-trivial type theories, which is a big departure from the logical world. (Recall that almost every logical derivation has an equivalent normal derivation.) To sketch the reason: in type theories that admit recursive definitions, it is possible to write programs that never reduce to a value; such looping programs can generally be given any type. In particular, the looping program has type โฅ, although there is no logical proof of "โฅ". For this reason, the ''propositions as types; proofs as programs'' paradigm only works in one direction, if at all: interpreting a type theory as a logic generally gives an inconsistent logic. ===Example: Dependent Type Theory=== {{Unreferenced section|date=May 2024}} Like logic, type theory has many extensions and variants, including first-order and higher-order versions. One branch, known as [[dependent type theory]], is used in a number of [[computer-assisted proof]] systems. Dependent type theory allows quantifiers to range over programs themselves. These quantified types are written as ฮ and ฮฃ instead of โ and โ, and have the following formation rules: {| style="margin-left: 2em;" |- | ฮ โข A type ฮ, x:A โข B type โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ ฮ -F ฮ โข ฮ x:A. B type | width="10%" | || ฮ โข A type ฮ, x:A โข B type โโโโโโโโโโโโโโโโโโโโโโโโโโโโ ฮฃ-F ฮ โข ฮฃx:A. B type |} These types are generalisations of the arrow and product types, respectively, as witnessed by their introduction and elimination rules. {| style="margin-left: 2em;" |- | ฮ, x:A โข ฯ : B โโโโโโโโโโโโโโโโโโโโ ฮ I ฮ โข ฮปx. ฯ : ฮ x:A. B | width="10%" | || ฮ โข ฯ<sub>1</sub> : ฮ x:A. B ฮ โข ฯ<sub>2</sub> : A โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ ฮ E ฮ โข ฯ<sub>1</sub> ฯ<sub>2</sub> : [ฯ<sub>2</sub>/x] B |} {| style="margin-left: 2em;" |- | ฮ โข ฯ<sub>1</sub> : A ฮ, x:A โข ฯ<sub>2</sub> : B โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ ฮฃI ฮ โข (ฯ<sub>1</sub>, ฯ<sub>2</sub>) : ฮฃx:A. B | width="10%" | || ฮ โข ฯ : ฮฃx:A. B โโโโโโโโโโโโโโโโ ฮฃE<sub>1</sub> ฮ โข '''fst''' ฯ : A |} {| style="margin-left: 2em;" |- | ฮ โข ฯ : ฮฃx:A. B โโโโโโโโโโโโโโโโโโโโโโโโ ฮฃE<sub>2</sub> ฮ โข '''snd''' ฯ : ['''fst''' ฯ/x] B |} Dependent type theory in full generality is very powerful: it is able to express almost any conceivable property of programs directly in the types of the program. This generality comes at a steep price — either typechecking is undecidable ([[extensional type theory]]), or extensional reasoning is more difficult ([[intensional type theory]]). For this reason, some dependent type theories do not allow quantification over arbitrary programs, but rather restrict to programs of a given decidable ''index domain'', for example integers, strings, or linear programs. Since dependent type theories allow types to depend on programs, a natural question to ask is whether it is possible for programs to depend on types, or any other combination. There are many kinds of answers to such questions. A popular approach in type theory is to allow programs to be quantified over types, also known as ''[[parametric polymorphism]]''; of this there are two main kinds: if types and programs are kept separate, then one obtains a somewhat more well-behaved system called ''[[predicative polymorphism]]''; if the distinction between program and type is blurred, one obtains the type-theoretic analogue of higher-order logic, also known as ''[[impredicative polymorphism]]''. Various combinations of dependency and polymorphism have been considered in the literature, the most famous being the [[lambda cube]] of [[Henk Barendregt]]. The intersection of logic and type theory is a vast and active research area. New logics are usually formalised in a general type theoretic setting, known as a [[logical framework]]. Popular modern logical frameworks such as the [[calculus of constructions]] and [[LF (logical framework)|LF]] are based on higher-order dependent type theory, with various trade-offs in terms of decidability and expressive power. These logical frameworks are themselves always specified as natural deduction systems, which is a testament to the versatility of the natural deduction approach.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Natural deduction
(section)
Add topic