<p>The first approach is subsumed by the second, sort of (because the first approach is slightly broken).</p>

<p>One should never consider expressions with free variables without explicitly specifying a context in which they appear (this is a lesson one learns as soon as one wants to formalize $\forall$ and $\exists$ that are allowed to range over possibly empty types or sets).</p>

<p>In a single-sorted theory, equations without context $t_1 = t_2$ can always be equipped with a context $\Gamma \vdash t_1 = t_2 : S$ where $S$ is the single sort and $\Gamma = x_1 : S, \ldots, x_n : S$, with $x_i$ being the free variables in $t_1$ and $t_2$.</p>

<p>Leaving the context implicit like that is not quite right. For example, what if I want to write down an equation that involves $x_1$ and $x_2$ in a context which also mentions $x_3$? You might think that sort of thing is going to be useless, but it isn't, not if $x_3$ could come from an empty type.</p>

<p>Also, as soon as you think about categorical semantics you will see that it makes little sense to have bare equations without contexts.</p>

<p>So I would advise you to put your equations in contexts, and then use the shorter form as an abbreviation. One reference where everything is done explicitly in a context all the time is Bart Jacob's <a href="http://books.google.si/books/about/Categorical_Logic_and_Type_Theory.html?id=0hhyL4WG3ngC" rel="nofollow">"Categorical Logic and Type Theory"</a>, Chapter 8 is about polymorphic type theory and might be of particular interest to you.</p>

CC BY-SA 3.0
2012-01-10T08:32:29.270Z
yes, clearly the old style does not scale to more pathological types (e.g. eta for unit) or more interesting types (like, say, singletons). However, none of these occur for the type equivalence of vanilla F-omega, where the only kinds are $\Omega$ and $\kappa_1\to\kappa_2$. I wonder if it is at least possible in that context to use the old style. I expect it is, given that beta-eta is consistent, but have never seen it used.
Andreas Rossberg
CC BY-SA 3.0
2012-01-10T07:15:26.150Z
2012-01-10T08:17:53.630Z
2012-01-10T08:17:53.630Z
Andrej Bauer
<p>There are (at least) two styles for defining a (declarative) equivalence judgement for a typed lambda calculus:</p>

<ol>
<li>via a plain relation  $t_1 = t_2$,</li>
<li>via an indexed relation $\Gamma \vdash t_1 = t_2 : T$.</li>
</ol>

<p>Barendregt [1] e.g. uses the simpler former style, while other sources often seem to be preferring the latter.</p>

<p>I have only seen the first style being used for the case of simple beta equivalence (as in Barendregt). Is it possible to use this style even in the presence of an eta-rule, esp considering that eta-expansion does not necessarily preserve well-formedness?</p>

<p>More specifically, I'm interested in the (simple?) case of eta-equivalence for F-omega types. Any pointers are welcome.</p>

<p>[1] H. Barendregt, Lambda Calculi With Types. In: Handbook of Logic in Computer Science, Vol 2. Oxford University Press 1992</p>

CC BY-SA 3.0
2012-01-10T07:07:34.973Z
I'd consider 1 "old style" and 2 "new style". Or to put it another way, one should always put free variables in context, therefore 2 is the preferred way, even in a uni-typed setting (where the variables are then just listed).
Andrej Bauer
CC BY-SA 3.0
2012-01-10T12:13:36.050Z
@Andreas: Tangential question: has it been investigated what the semantic consequences of adding/omitting $\eta$ in F$\omega$ are?  A few years back I looked for work in that direction, but could not find much. Maybe I didn't search hard enough.
Martin Berger
CC BY-SA 3.0
2012-01-10T15:00:01.260Z
@MartinBerger: I don't have a real answer for that in general. But I need it in the context of module systems for programming languages, where you typically want a type name to equate its $\eta$-expansion, and certain encoding techniques are simplified in its presence. Building that into the semantics of your internal language then is a natural and highly convenient thing to do.
Andreas Rossberg
<lo.logic><type-theory><lambda-calculus>
How to define eta-equivalence for F-omega types?
Andreas Rossberg
# How to define eta-equivalence for F-omega types?

(Asked by: username_0 on 2012-01-09)

There are (at least) two styles for defining a (declarative) equivalence judgement for a typed lambda calculus:

1. via a plain relation $t\_1 = t\_2$,
2. via an indexed relation $\Gamma \vdash t\_1 = t\_2 : T$.

Barendregt [1] e.g. uses the simpler former style, while other sources often seem to be preferring the latter.

I have only seen the first style being used for the case of simple beta equivalence (as in Barendregt). Is it possible to use this style even in the presence of an eta-rule, esp considering that eta-expansion does not necessarily preserve well-formedness?

More specifically, I'm interested in the (simple?) case of eta-equivalence for F-omega types. Any pointers are welcome.

[1] H. Barendregt, Lambda Calculi With Types. In: Handbook of Logic in Computer Science, Vol 2. Oxford University Press 1992

**Tags:** lo.logic, type-theory, lambda-calculus
> **Comments:**
> **username_1**: I'd consider 1 "old style" and 2 "new style". Or to put it another way, one should always put free variables in context, therefore 2 is the preferred way, even in a uni-typed setting (where the variables are then just listed).  
> **username_2**: @Andreas: Tangential question: has it been investigated what the semantic consequences of adding/omitting $\eta$ in F$\omega$ are?  A few years back I looked for work in that direction, but could not find much. Maybe I didn't search hard enough.  
> **username_0**: @MartinBerger: I don't have a real answer for that in general. But I need it in the context of module systems for programming languages, where you typically want a type name to equate its $\eta$-expansion, and certain encoding techniques are simplified in its presence. Building that into the semantics of your internal language then is a natural and highly convenient thing to do.  

---

## 1 answers

### Answer by username_1 on 2012-01-10. Score: 4

The first approach is subsumed by the second, sort of (because the first approach is slightly broken).

One should never consider expressions with free variables without explicitly specifying a context in which they appear (this is a lesson one learns as soon as one wants to formalize $\forall$ and $\exists$ that are allowed to range over possibly empty types or sets).

In a single-sorted theory, equations without context $t\_1 = t\_2$ can always be equipped with a context $\Gamma \vdash t\_1 = t\_2 : S$ where $S$ is the single sort and $\Gamma = x\_1 : S, \ldots, x\_n : S$, with $x\_i$ being the free variables in $t\_1$ and $t\_2$.

Leaving the context implicit like that is not quite right. For example, what if I want to write down an equation that involves $x\_1$ and $x\_2$ in a context which also mentions $x\_3$? You might think that sort of thing is going to be useless, but it isn't, not if $x\_3$ could come from an empty type.

Also, as soon as you think about categorical semantics you will see that it makes little sense to have bare equations without contexts.

So I would advise you to put your equations in contexts, and then use the shorter form as an abbreviation. One reference where everything is done explicitly in a context all the time is Bart Jacob's ["Categorical Logic and Type Theory"](http://books.google.si/books/about/Categorical_Logic_and_Type_Theory.html?id=0hhyL4WG3ngC), Chapter 8 is about polymorphic type theory and might be of particular interest to you.

> **Comments:**
> **username_0**: yes, clearly the old style does not scale to more pathological types (e.g. eta for unit) or more interesting types (like, say, singletons). However, none of these occur for the type equivalence of vanilla F-omega, where the only kinds are $\Omega$ and $\kappa_1\to\kappa_2$. I wonder if it is at least possible in that context to use the old style. I expect it is, given that beta-eta is consistent, but have never seen it used.  

---

