A Hypothetical judgment expresses an Entailment between one or more Hypothesises and a Conclusion.
-> Two forms of Entailment:
A General judgment expresses the Universality or Genericity of a Judgment.
-> Two forms of General judgment:
Hypothetical judgments
The Hypothetical judgment arranges the rules for expressing the Validity of a Conclusion conditional on the Validity of one or more Hypothesises.
There are two forms of Hypothetical judgments:
-> Differ according to the sense in which the Conclusion is conditional on the Hypothesises.
-> One is stable under extension with more rules, and the other is not.
Derivability
Consider a given set R of Rules.
The Derivability judgment is written J1,…,Jk⊢RK, where Ji and K are Basic judgments.
Such a Derivability judgment means that we may derive K from the Expansion R∪{J1,…,Jk} of the rules R with the Axioms:
J1…Jk
- The Hypothesises, or Antecedents, of the judgment, J1,…,Jk as "temporary axioms".
- The Conclusion, or Consequents are derived by composing rules in R.
A set of finite Basic judgments is usually denoted as a capital Greek letter, such as Γ or Δ.
R∪Γ is taken to mean the Expansion of R with additional axioms with judgments in Γ as the Consequents.
The Judgment Γ⊢RK means that K is Derivable from rules R∪Γ.
The Judgment ⊢RΓ means that ⊢RJ for each J in Γ.
An equivalent way of defining J1,…,Jn⊢RJ is to say that the rule
JJ1 … Jn
is Derivable from R - there is a derivation of J composed of the rules in R augmented by treating J1,…,Jn as axioms.
Derivability is Stable under extension with new rules.
Stability
Theorem. If Γ⊢RJ, then Γ⊢R∪R′J.
Proof
Any derivation of J from R∪Γ is also a derivation from (R∪R′)∪Γ, because any rule in R is also a rule in R∪R′.
Structural property
- Reflexivity: Every judgment is a consequence of itself - Γ,J⊢RJ. Each hypothesis justifies itself as a Conclusion.
- Weakening: If Γ⊢RJ, then Γ,K⊢RJ. Entailment is not influenced by un-exercised options.
- Transitivity: If Γ,K⊢RJ and Γ⊢RK, then Γ⊢RJ. If we replace an axiom by a derivation of it, the result is a derivation of its consequent without that hypothesis.
Admissibility
Admissibility, usually written as Γ⊨RJ, is a weaker form of Hypothetical judgment stating that ⊢RΓ implies ⊢RJ.
That is, the conclusion J is derivable from rules R when the assumptions Γ are all derivable from rules R.
In particular, if any of the hypotheses are not derivable relative to R, then the judgment is vacuously true.
- An equivalent way to define the judgment J1,…,Jn⊨RJ is to state that the rule
JJ1 … Jn
is admissible relative to the rules in R.
Given any derivations of J1,…,Jn using the rules in R, we may build a derivation of J using the rules in R.
Example
The Admissibility judgment
succ(a) even⊨a odd
is valid.
Reason: Any derivation of succ(a) even from rules must contain a sub-derivation of a odd from the same rules, which justifies the conclusion.
Unstability
The admissibility judgment is not stable under extension to the rules.
Counterexample
If we enrich the original rules:
zero even
succ(n) oddn even
succ(n) evenn odd
with the following rule:
succ(zero) even
Then the rule succ(a) even⊨a odd is Inadmissible.
Derivability as a stronger judgment than Admissibility
Theorem. If Γ⊢RJ, then Γ⊨RJ.
Proof
Repeated application of the transitivity of derivability shows that if Γ⊢RJ and ⊢RΓ, then ⊢RJ .
- Counterexample to: If Γ⊨RJ, then Γ⊢RJ.
This amounts to showing an instance of R, Γ and J such that:
- Γ⊨RJ, or If ⊢RΓ then ⊢RJ.
- Γ⊢RJ.
We can take R to contain:
zero even
succ(n) oddn even
succ(n) evenn odd
We can take Γ to contain:
succ(zero) even
We can take J to be: zero odd.
Interpretation of an admissibility evidence
- Evidence for admissibility can be thought of as a mathematical function transforming derivations ▽1,…,▽n of the hypotheses into a derivation ▽ of the consequent.
Structural property (admissibility)
- Reflexivity: If J is derivable from the original rules, then J is derivable from the original rules: J⊨RJ.
- Weakening: If J is derivable from the original rules assuming that each of the judgments in Γ are derivable from these rules, then J must also be derivable assuming that Γ and K are derivable from the original rules: if Γ⊨RJ, then Γ,K⊨RJ.
- Transitivity: If Γ,K⊨RJ and Γ⊨RK, then Γ⊨RJ. If the judgments in Γ are derivable, so is K, by assumption, and hence so are the judgments in Γ,K, and hence so is J.
Hypothetical inductive definitions
Hypothetical inductive definitions enrich standard Inductive definitions by allowing rules where the Premises and Conclusions are Derivability judgments.
This structure introduces two types of hypotheses:
- Global hypothesises (Γ): In effect at the point where the Rule is applied.
- Local hypothesises (Γi): Specific only to the Derivation of a particular Premise.
A Hypothetical rule takes the following explicit form:
Γ⊢JΓ Γ1⊢J1…Γ Γn⊢Jn
The Hypothesises Γ are the Global hypothesises of the Rule.
The Hypothesises Γi are the Local hypothesises of the $i$th Premise or the Rule.
- Interpretation: J is a Derivable consequence of Γ if, for every Premise i, Ji is a Derivable consequence of Γ augmented by the local hypotheses Γi.
- Context switch: Deriving a Premise involves a "context switch" where the Global hypothesises are extended by the Local hypothesises of that Premise.
Rules in a Hypothetical inductive definition must be Uniform, meaning they apply in all global Contexts.
Because of this Uniformity, the global Context Γ is often suppressed, leading to the Implicit form:
JΓ1⊢J1…Γn⊢Jn
-> Implicit understanding: The rule applies for any choice of Global hypothesises.
Structurality of judgments
A Hypothetical inductive definition -> An ordinary Inductive definition of a Formal derivability judgment Γ⊢J consisting of:
- A finite set of Basic judgments Γ.
- A Basic judgment J.
A set of Hypothetical rules R defines the strongest Formal derivability judgment that is Structural and Closed (under) Uniform rules R.
Structurality means that the Formal derivability judgment must be closed under the following rules:
Reflexivity:
Γ,J⊢J
Weakening:
Γ,K⊢JΓ⊢J
Transitivity:
Γ⊢JΓ⊢KΓ,K⊢J
Hypothetical rule induction
The principle of Hypothetical rule induction is simply standard Rule induction applied to the Formal derivability judgment.
To show that a property P(Γ⊢J) holds whenever Γ⊢RJ, one must show that P is closed under:
- The rules of R: If P(Γ Γ1⊢J1) and \ldots and P(Γ Γn⊢Jn), then P(Γ⊢J).
- The structural rules: The property must be preserved under Reflexivity, Weakening, and Transitivity.
In practice, rather than proving the structural steps explicitly during induction, we typically prove that the structural rules are Admissible.
- If rules are Uniform, Weakening and Transitivity are usually clearly admissible.
- Reflexivity is usually postulated explicitly as a rule.
General judgments
General judgments codify the Rules for handling Variables in a Judgment.
Variable: An unknown, ranging over a specified set of objects.
A Generic (general) judgment states that a Judgment holds for any choice of objects replacing designated variables in the judgment.
A Parametric (general) judgments codify the handling of Symbolic parameters, expressing generality over any choice of Fresh renamings of designated Symbols of a Judgment.
ΓRU;XJ - J is Derivable from Γ according to Rules R, with objects consisting of Abstract binding tree (ABT)s over Symbols U and Variables X.
The concept of Uniformity of a Rule must be extended to require that rules be:
Closed under renaming and substitution for Variables.
Closed under renaming for Symbolic parameters.
Formally:
If R is a set of rules containing a Free variable x of Sort s, then it must also contain all possible substitution instances of Abstract binding tree (ABT)s a of Sort s for x, including those that contain other Free variables.
If R contains Rules with a Symbolic parameter u, then it must contain all instances of that rule obtained by renaming u of a sort to any u′ of the same Sort.
-> Ruling out:
Stating a rule for a variable, without also stating it for all instances of that variable.
Stating a rule for a parameter without stating it for all possible renamings of that parameter.
Generic derivability
Generic derivability judgment is defined by:
Y ∣ Γ⊢RX JiffΓ⊢RXYJ
where Y∩X=∅.
Evidence for Generic derivability consists of a Generic derivation ▽ involving the Variables XY.
-> If the rules are Uniform, the choice of Y does not matter.
Example
Given R as:
zero nat
succ(x) natx nat
The Generic derivation ▽:
succ(succ(x)) natsucc(x) natx nat
is Evidence for the Judgment:
x ∣ x nat⊢RX succ(succ(x)) nat
provided x∈/X.
The Generic derivability judgment enjoys the following Structural property governing the behavior of Variables, provided that R is Uniform.
Proliferation:
If Y ∣ Γ⊢RX J, then Y,y ∣ Γ⊢RXJ.
Renaming:
If Y,y ∣ Γ⊢RXJ, then Y,y′ ∣ [y↔y′]Γ⊢RX[y↔y′]J for any y′∈/XY.
Substitution:
If Y,y ∣ Γ⊢RXJ and a∈B[XY], then Y ∣ [a/y]Γ⊢RX[a/y]J.
Remarks: To my understanding, X acts somewhat like free variables, and Y acts somewhat like bound variables.
Parametric derivability
Parametric (general) judgment is defined analogously like Generic (general) judgment, albeit by generalizing over Symbolic parameters, rather than Variables.
Parametric (general) judgment is defined by:
V ∥ Y ∣ Γ⊢RU;X JiffY ∣ ΓRUV;X J
where V∩U=∅.
Evidence for Parametric (general) judgment consists of a Derivation ▽ involving the symbols V.
Uniformity of R ensures that any choice of parameter names is as good as any other. Derivability is Stable under Renaming.
Generic inductive definitions
A Generic inductive definition admits Generic inductive definition in the Premises of rules.
-> Augmenting the variables & the rules within those Premises.
A Generic rule has the form:
Y ∣ Γ⊢JY Y1 ∣ Γ Γ1⊢J1…Y Yn ∣ Γ Γn⊢Jn
- Global variables: Y.
- For each 1≤i≤n, Local variables of the $i$th Premise: Yi.
Implicit form:
JY1 ∣ Γ1⊢J1…Yn ∣ Γn⊢Jn
A Generic inductive definition is an ordinary Inductive definition of a family of formal Generic (general) judgments of the form Y ∣ Γ⊢J.
Formal Generic (general) judgments are identified up to Renaming of Variables.
-> The latter Judgment is treated as identical to the Judgment Y′ ∣ ρ^(Γ)⊢ρ^(J) for any Renaming ρ:Y↔Y′.
If R is a collection of Generic rules, we write Y ∣ Γ⊢RJ to mean that the formal Generic (general) judgment Y ∣ Γ⊢J is derivable from rules R.
When specialized to a set of Generic rules, the principle of Rule induction states that to show P(Y ∣ Γ⊢J) when Y ∣Γ⊢RJ, it is sufficient to show that P is closed under the rules R.
If P(Y Y1 ∣ Γ Γ1⊢J1) … P(Y Yn ∣ Γ Γn⊢Jn) then P(Y ∣ Γ⊢J).
To ensure that a Formal generic judgment behaves like a Generic (general) judgment, the Structural rules are Admissible.
Y ∣ Γ,J⊢J(3.14a)
Y ∣ Γ,J′⊢JY ∣ Γ⊢J(3.14b)
Y,x ∣ Γ⊢JY ∣ Γ⊢J(3.14c)
Y,x ∣ Γ⊢JY,x′ ∣ [x↔x′]Γ⊢[x↔x′]J(3.14d)
Y ∣ Γ⊢J′Y ∣ Γ⊢JY ∣ Γ,J⊢J′(3.14e)
Y ∣ [a/x]Γ⊢[a/x]JY,x ∣ Γ⊢Ja∈B[Y](3.14f)
The Admissibility of rule (3.14a) is in practice ensured by explicitly including it.
The Admissibility of rules (3.14b) and (3.14c) is assured if each of the generic rules is Uniform because we may:
- Assimilate the added variable x to the global variables Y.
- Assimilate the added hypothesis J′ to the global hypotheses Γ′.
The Admissibility of rule (3.14d) is ensured by the identification convention for the formal generic judgment.
Rule (3.14f) must be verified explicitly for each inductive definition.
Parametric inductive definition is similar to generic inductive definition.
Notes
Exercise
Exercise 3.1
Problem statement. Combinators are inductively defined by the rule set C given as follows:
s comb(3.15a)
k comb(3.15b)
ap(a1;a2) comba1 comba2 comb(3.15c)
Give an inductive definition of the length of a combinator defined as the number of occurrences of s and k within it.
Solution
Definition
len(s;succ(zero))
len(k;succ(zero))
len(ap(a1;a2);plus(l1;l2))a1 comba2 comblen(a1;l1)len(a2;l2)
Existence
For every a comb, there must exist n nat such that len(a;n).
For a=s and a=k, it's obvious that n=succ(zero) is a witness. - Suppose that n1 nat is a witness for a1 comb and n2 nat is a witness for a2 comb, then it's obvious that plus(l1;l2) is a witness for ap(a1;a2).
Uniqueness
For every a comb, if there exist two n1 nat and n2 nat such that len(a;n1) and len(a;n2), then n1=n2.
For a=s and a=k, it's obvious that n=succ(zero) is the unique value. - Suppose that n1 nat is a witness for a1 comb and n2 nat is a witness for a2 comb, then it's obvious that plus(l1;l2) is the unique value.
Exercise 3.2
Problem statement. The general judgment
x1,…,xn∣x1 comb,…,xn comb⊢CA comb
states that A is a combinator that may involve the variables x1,…,xn. Prove that if x∣x comb⊢Ca2 comb and a1 comb, then [a1/x]a2 comb by induction on the derivation of the first hypothesis of the implication.
Confusion and notes
Lifting & Hypothetical judgments.
The core question:
If the base rules C (combinators) do not mention variables or contexts, how is it possible to derive a judgment that contains them?
For example:
The rule for s is just s comb. It knows nothing about x. - We often need to prove things like x⊢ap(s;x).
Where does the permission to use x come from if not from the rules?
For some variables Y and hypotheses Γ:
Reflexivity:
Y ∣ Γ,J⊢CJ
- Y ∣ Γ⊢CJ is defined to be equivalent to Γ⊢CYJ, which in turn, means that with Y instantiated, J is derivable using the rules Γ∪C.
Because the rules in C holds regardless of instantiations of Y and Γ, we can lift each rule in C like this:
Y ∣ Γ⊢ap(a1;a2) combY ∣ Γ⊢a1 combY ∣ Γ⊢a2 comb
Solution
After lifting, C becomes (minus the structural rules):
Γ⊢s comb(3.15a)
Γ⊢k comb(3.15b)
Y ∣ Γ⊢ap(a1;a2) combY ∣ Γ⊢a1 combY ∣ Γ⊢a2 comb(3.15c)
By the problem statement, I assume that:
There is a derivation ▽ using the rules C with a conclusion of x ∣ x comb⊢Ca2 comb.
Consider the last rule applied in ▽ for each of the above rule, then maybe try to modify the derivation to conclude ap(a1;a2).
Exercise 3.3
Problem statement. Conversion, or equivalence, of combinators is expressed by the judgment A≡B defined by the rule set E extending C as follows:
a≡aa comb(3.16a)
a1≡a2a2≡a1(3.16b)
a1≡a3a1≡a2a2≡a3(3.16c)
a1 a2≡a1′ a2′a1≡a1′a2≡a2′(3.16d)
ka1a2≡a1a1 comba2 comb(3.16e)
sa1a2a3≡(a1a3) (a2a3)a1 comba2 comba3 comb(3.16f)
The no-doubt mysterious motivation for the last two equations will become clearer in a moment. For now, show that
x∣x comb⊢C∪Eskkx≡x
Note: The combinator ap(a1;a2) is written a1 a2 for short, left-associatively when used in succession.
Solution
After lifting, the ruleset E becomes:
x≡xY ∣ J⊢x comb(3.16a)
x1≡x2Y ∣ J⊢x2≡x1(3.16b)
Y ∣ J⊢x2≡x3Y ∣ J⊢x1≡x2Y ∣ J⊢x2≡x3(3.16c)
Y ∣ J⊢x1 x2≡x1′ x2′Y ∣ J⊢x1≡x1′Y ∣ J⊢x2≡x2′(3.16d)
Y ∣ J⊢kx1x2≡x1Y ∣ J⊢x1 combY ∣ J⊢x2 comb(3.16e)
Y ∣ J⊢sx1x2x3≡(x1x3) (x2x3)Y ∣ J⊢x1 combY ∣ J⊢x2 combY ∣ J⊢x3 comb(3.16f)
We'll prove that:
x∣x comb⊢C∪Eskkx≡x.
x ∣ x comb⊢s k k x≡xx ∣ x comb⊢s k k x≡(k x) (k x)x ∣ x comb⊢k combx ∣ x comb⊢x combx ∣ x comb⊢(k x) combx ∣ x comb⊢x comb
Exercise 3.4
Problem statement. Show that if x∣x comb⊢Ca comb, then there is a combinator a′, written [x]a and called bracket abstraction, such that:
x∣x comb⊢C∪Ea′ x≡a
Consequently, by Exercise 3.2, if a′′ comb, then:
([x]a) a′′≡[a′′/x]a
Hint:
Inductively define the judgment:
x∣x comb⊢absx a is a′
where x∣x comb⊢a comb. Then argue that it defines a′ as a binary function of x and a. The motivation for the conversion axioms governing k and s should become clear while developing the proof of the desired equivalence.
Confusion point
I thought a′=[x]a≡k a worked for all a and x & spent 1 hour wondering why this problem was nontrivial.
It turns out, because a′ is a combinator, which means ⊢a′ comb.
If a contains the variable x, then, ⊢(k a) comb. It's only true that x ∣ x comb⊢(k a) comb .
Solution
We define abs as:
x ∣ x comb⊢absx s is k s
x ∣ x comb⊢absx k is k k
x y ∣ x comb y comb⊢absx y is k y
x ∣ x comb⊢absx x is s k k x
x ∣ x comb⊢absx ap a1 a2 is s a1′ a2′x ∣ x comb⊢absx a1 is a1′x ∣ x comb⊢absx a2 is a2′
Exercise 3.5
Problem statement. Prove that bracket abstraction, as defined in Exercise 3.4, is non-compositional by exhibiting a and b such that a comb and
xy∣x comby comb⊢Cb comb
such that: [a/y]([x]b)=[x]([a/y]b)
Hint: Consider the case that b is y.
Suggest a modification to the definition of bracket abstraction that is compositional by showing under the same conditions given above that:
[a/y]([x]b)=[x]([a/y]b)
Because a is a categorical judgment evaluated in an empty context, a must be a closed combinator with no free variables, whereas b is defined under a hypothetical judgment that explicitly permits variables.
Solution
- If b=y, then:
- [x]b=[x]y=k y.
-> LHS = [a/y]([x] b)=[a/y](k y)=k a.
- [a/y]b=[a/y]y=a.
-> RHS = [x]([a/y]b)=[x]a.
It's trivial that there exists an a being some combination of s and k such that k a=[x]a (they are equivalent though).
- Intuition: To redefine a new bracket abstraction that is compositional in this context, it must at least be compositional when b=y.
My guts feeling here is to modify the fourth rule in the original ruleset.
Then LHS = [a/y]([x]y) = [x]a = RHS for all a such that ⊢a comb.
- Start with a=k.
- New definition:
x ∣ x comb⊢absx s is k s
x ∣ x comb⊢absx k is k k
x ∣ x comb⊢absx x is s k k
x ∣ x comb y comb⊢absx y is
x ∣ x comb⊢absx ap a1 a2 is s a1′ a2′x ∣ x comb⊢absx a1 is a1′x ∣ x comb⊢absx a2 is a2′
Exercise 3.6
Problem statement. Consider the set B[X] of ABT's generated by the operators ap, with arity (Exp,Exp)Exp, and λ, with arity (Exp.Exp)Exp, and possibly involving variables in X, all of which are of sort Exp.
Give an inductive definition of the judgment b closed, which specifies that b has no free occurrences of the variables in X.
Hint: It is essential to give an inductive definition of the hypothetical, general judgment
x1,…,xn∣x1 closed,…,xn closed⊢b closed
in order to account for the binding of a variable by the λ operator.
The hypothesis that a variable is closed seems self-contradictory in that a variable obviously occurs free in itself. Explain why this is not the case by examining carefully the meaning of the hypothetical and general judgments.
Solution