Chapter 3. Hypothetical and general judgments
A Hypothetical judgment expresses an Entailment between one or more Hypothesises and a Conclusion.
-> Two forms of Entailment:
Derivability.
Admissibility.
-> Both differ in that Derivability is Stable under extension with new rules, but Admissibility is not.
A General judgment expresses the Universality or Genericity of a Judgment.
-> Two forms of General judgment:
The generic judgment expresses generality with respect to all substitution instances for variables in a judgment.
Parametric (general) judgment.
The parametric judgment expresses generality with respect to renamings of symbols.
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 of Rules.
The Derivability judgment is written , where and are Basic judgments.
Such a Derivability judgment means that we may derive from the Expansion of the rules with the Axioms:
The Hypothesises, or Antecedents, of the judgment, as "temporary axioms".
The Conclusion, or Consequents are derived by composing rules in .
A set of finite Basic judgments is usually denoted as a capital Greek letter, such as or .
is taken to mean the Expansion of with additional axioms with judgments in as the Consequents.
The Judgment means that is Derivable from rules .
The Judgment means that for each in .
An equivalent way of defining is to say that the rule
is Derivable from - there is a derivation of composed of the rules in augmented by treating as axioms.
Derivability is Stable under extension with new rules.
Stability
Theorem. If , then .
Proof
Any derivation of from is also a derivation from , because any rule in is also a rule in .
Structural property
Reflexivity: Every judgment is a consequence of itself - . Each hypothesis justifies itself as a Conclusion.
Weakening: If , then . Entailment is not influenced by un-exercised options.
Transitivity: If and , then . 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 , is a weaker form of Hypothetical judgment stating that implies .
That is, the conclusion is derivable from rules when the assumptions are all derivable from rules .
In particular, if any of the hypotheses are not derivable relative to , then the judgment is vacuously true.
An equivalent way to define the judgment is to state that the rule
is admissible relative to the rules in .
Given any derivations of using the rules in , we may build a derivation of using the rules in .
Example
The Admissibility judgment
is valid.
Reason: Any derivation of from rules must contain a sub-derivation of 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:
with the following rule:
Then the rule is Inadmissible.
Derivability as a stronger judgment than Admissibility
Theorem. If , then .
Proof
Repeated application of the transitivity of derivability shows that if and , then .
Counterexample to: If , then .
This amounts to showing an instance of , and such that:
, or If then .
.
We can take to contain:
We can take to contain:
We can take to be: .
Interpretation of an admissibility evidence
Evidence for admissibility can be thought of as a mathematical function transforming derivations of the hypotheses into a derivation of the consequent.
Structural property (admissibility)
Reflexivity: If is derivable from the original rules, then is derivable from the original rules: .
Weakening: If is derivable from the original rules assuming that each of the judgments in are derivable from these rules, then must also be derivable assuming that and are derivable from the original rules: if , then .
Transitivity: If and , then . If the judgments in are derivable, so is , by assumption, and hence so are the judgments in , and hence so is .
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 (): Specific only to the Derivation of a particular Premise.
A Hypothetical rule takes the following explicit form:
The Hypothesises are the Global hypothesises of the Rule.
The Hypothesises are the Local hypothesises of the th Premise or the Rule.
Interpretation: is a Derivable consequence of if, for every Premise , is a Derivable consequence of augmented by the local hypotheses .
Context switch: Deriving a Premise involves a "context switch" where the Global hypothesises are extended by the Local hypothesises of that Premise.
Uniformity & Implicit form
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:
-> 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 consisting of:
A finite set of Basic judgments .
A Basic judgment .
A set of Hypothetical rules defines the strongest Formal derivability judgment that is Structural and Closed (under) Uniform rules .
Structurality means that the Formal derivability judgment must be closed under the following rules:
Reflexivity:
Weakening:
Transitivity:
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 holds whenever , one must show that is closed under:
The rules of : If and \ldots and , then .
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.
- is Derivable from according to Rules , with objects consisting of Abstract binding tree (ABT)s over Symbols and Variables .
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 is a set of rules containing a Free variable of Sort , then it must also contain all possible substitution instances of Abstract binding tree (ABT)s of Sort for , including those that contain other Free variables.
If contains Rules with a Symbolic parameter , then it must contain all instances of that rule obtained by renaming of a sort to any 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:
where .
Evidence for Generic derivability consists of a Generic derivation involving the Variables .
-> If the rules are Uniform, the choice of does not matter.
Example
Given as:
The Generic derivation :
is Evidence for the Judgment:
provided .
The Generic derivability judgment enjoys the following Structural property governing the behavior of Variables, provided that is Uniform.
Proliferation:
If , then .
Renaming:
If , then for any .
Substitution:
If and , then .
Remarks: To my understanding, acts somewhat like free variables, and 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:
where .
Evidence for Parametric (general) judgment consists of a Derivation involving the symbols .
Uniformity of 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:
Global variables: .
For each , Local variables of the th Premise: .
Implicit form:
A Generic inductive definition is an ordinary Inductive definition of a family of formal Generic (general) judgments of the form .
Formal Generic (general) judgments are identified up to Renaming of Variables.
-> The latter Judgment is treated as identical to the Judgment for any Renaming .
If is a collection of Generic rules, we write to mean that the formal Generic (general) judgment is derivable from rules .
When specialized to a set of Generic rules, the principle of Rule induction states that to show when , it is sufficient to show that is closed under the rules .
If then .
The property must respect Renamings of the Variables in a formal Generic (general) judgment.
To ensure that a Formal generic judgment behaves like a Generic (general) judgment, the Structural rules are Admissible.
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 to the global variables .
Assimilate the added hypothesis 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
Foundational roots
The concepts of entailment and generality are central to logic and programming languages.
Harper's formulation builds specifically on the work of Martin-Lof (1983, 1987) and Avron (1991).
Contrast with AUTOMATH & LF
Unified Concept: Systems like AUTOMATH and the LF Logical Framework consolidate hypothetical and general reasoning into a single concept.
Arbitrary Nesting: These systems allow for arbitrarily nested combinations of judgments (e.g., judgments about judgments).
Harper's distinction
Restricted structure: Unlike LF, PFPL considers only general hypothetical judgments over basic judgment forms. It separates the machinery of entailment from the basic judgments.
Explicitly introduces symbols and variables, which were not present in the previous accounts (Martin-Lof/Avron).
Why symbols matter (Parametric Judgments)
Parametric judgments are necessary to specify languages that allow the dynamic creation of "new" objects.
Exercise
Exercise 3.1
Problem statement. Combinators are inductively defined by the rule set given as follows:
Give an inductive definition of the length of a combinator defined as the number of occurrences of and within it.
Solution
Definition
Existence
For every , there must exist such that .
- For and , it's obvious that is a witness. - Suppose that is a witness for and is a witness for , then it's obvious that is a witness for .
Uniqueness
For every , if there exist two and such that and , then .
- For and , it's obvious that is the unique value. - Suppose that is a witness for and is a witness for , then it's obvious that is the unique value.
Exercise 3.2
Problem statement. The general judgment
states that is a combinator that may involve the variables . Prove that if and , then 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 (combinators) do not mention variables or contexts, how is it possible to derive a judgment that contains them?
For example:
- The rule for is just . It knows nothing about . - We often need to prove things like .
Where does the permission to use come from if not from the rules?
For some variables and hypotheses :
- Reflexivity: $$ \displaystyle\frac{}{\mathcal{Y}\ \vert \ \Gamma, J \vdash_\mathcal{C} J} $$ - is defined to be equivalent to , which in turn, means that with instantiated, is derivable using the rules . Because the rules in holds regardless of instantiations of and , we can lift each rule in like this: $$ \displaystyle \frac{\mathcal{Y}\ \vert \ \Gamma \vdash a_1 \text{ comb} \quad \mathcal{Y}\ \vert \ \Gamma \vdash a_2 \text{ comb}}{\mathcal{Y}\ \vert \ \Gamma \vdash \mathsf{ap}(a_1; a_2) \text{ comb}} $$
Solution
After lifting, becomes (minus the structural rules):
By the problem statement, I assume that:
There is a derivation using the rules with a conclusion of .
Consider the last rule applied in for each of the above rule, then maybe try to modify the derivation to conclude .
Exercise 3.3
Problem statement. Conversion, or equivalence, of combinators is expressed by the judgment defined by the rule set extending as follows:
The no-doubt mysterious motivation for the last two equations will become clearer in a moment. For now, show that
Note: The combinator is written for short, left-associatively when used in succession.
Solution
After lifting, the ruleset becomes:
We'll prove that:
Exercise 3.4
Problem statement. Show that if , then there is a combinator , written and called bracket abstraction, such that:
Consequently, by Exercise 3.2, if , then:
Hint:
Inductively define the judgment:
where . Then argue that it defines as a binary function of and . The motivation for the conversion axioms governing and should become clear while developing the proof of the desired equivalence.
Confusion point
I thought worked for all and & spent 1 hour wondering why this problem was nontrivial.
It turns out, because is a combinator, which means .
If contains the variable , then, . It's only true that .
Solution
We define as:
Exercise 3.5
Problem statement. Prove that bracket abstraction, as defined in Exercise 3.4, is non-compositional by exhibiting and such that and
such that:
Hint: Consider the case that is .
Suggest a modification to the definition of bracket abstraction that is compositional by showing under the same conditions given above that:
Note
Because is a categorical judgment evaluated in an empty context, must be a closed combinator with no free variables, whereas is defined under a hypothetical judgment that explicitly permits variables.
Solution
If , then:
.
-> LHS = .
.
-> RHS = .
It's trivial that there exists an being some combination of and such that (they are equivalent though).
Intuition: To redefine a new bracket abstraction that is compositional in this context, it must at least be compositional when .
My guts feeling here is to modify the fourth rule in the original ruleset.
Then LHS = = = RHS for all such that .
Start with .
New definition:
Exercise 3.6
Problem statement. Consider the set of ABT's generated by the operators , with arity , and , with arity , and possibly involving variables in , all of which are of sort .
Give an inductive definition of the judgment , which specifies that has no free occurrences of the variables in .
Hint: It is essential to give an inductive definition of the hypothetical, general judgment
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.