[[P0]] + ≡x0y0, [[P0]] − u0 ≡y0,
[[Pn+1]] ≡let fn:={|Pn|} in let yn+1 :=fnx in let zn:=xn+1yn+1 in [],
[[Pn+1]] + ≡znx, [[Pn+1]] − a ≡ ( yn+1, if a=n+ 1, fn(zny). a, otherwise. Their size is calculated as follows:
d{|P0|}e = 6, d[[Pn+1]]e =d{|Pn|}e+ 12, d[[Pn+1]]+e= 2, d[[Pn+1]] − ae= ( 1, if a =n+ 1, a+ 6, otherwise, d{|Pn+1|}e =d{|Pn|}e+ n(n+ 1) 2 + 6n+ 22, hence d{|Pn|}e = (n−1)n(2n−1) 12 + 13 n(n−1) 24 + 22n+ 6, which is O(n 3).
Corollary 4.27 (Quasi-linear Dialectica extraction). Let P :C be a closed proof in NAω. Then there is a closed term {|P|}+:σ∗(C), such thatd{|P|}+e ≤K(dPeddPee2),
and a proof P :∀yτ−(C) |C|({|P|}+)↓+
y .
Proof. Follows from Theorem 4.23 and Corollary 4.19. Note that we cannot claim the quasi-linear bound on the projected term({|P|}+)↓+, since its size depends expo-
nentially on the size of the conclusion formulaC.
Remark 4.28. The usual characterisation theorem for the original Dialectica interpre- tation states that in an extension of HAω for any formula C we are able to prove its
equivalence to the formula∃x∀y |C|xy. Since Proposition 4.18states syntactic equal- ity of the formulas|C|xy and(|C|)x↑+
y↑−, the dened term mapping immediately gives us a
characterisation theorem for the quasi-linear variant of the Dialectica interpretation.
4.7 Program simplication via ane reductions
Let us revisit Example 4.1 from Section 4.1. Applying directly the results from Theorem 4.23, we obtain the termR:=λy6let x:=y6 in λy7let f1 :=s in f1y7, where
s:=RNx t0(λx λplet xp :=p in t1),
t0 :=λy0let y:=y0 in let y1 :=y in y1,
t1 :=λy2let f0 := (λy3let z:=y3 in let y4 :=z+z in y4) in
let y :=y2 in let y5 :=y+ 1 in let z0 :=xpy5 in f0z0.
This rst attempt seems discouraging, because the term R is denitely larger than [[P]]+ from Example4.1. However, the time complexity ofR can be shown to be now
linear.
One idea for simplication ofRis to normalise it. However, the normal form ofRis
exactly[[P]]+, which is of exponential time complexity. To improve the readability of
the quasi-linear programs, and in particular of R, another strategy for simplication
needs to be chosen.
We will consider a subset of the term reduction relation, which does not increase the size of involved terms. This reduction follows Grishin's idea of logics with weakening but no contraction [Gri74, Gri81], and we refer to it as ane, borrowing the name for such logic as suggested by Girard. In the following, we will denote the number of free occurrences of the variable x in the term t as#x(t).
Denition 4.29 (Ane term reductions). We dene the ane term reduction rela- tion a 7→ inductively as follows: (λx s)t 7→a s[x:=t], if #x(t)≤1 Spliths, tif 7→a f s t, Cases tts t 7→a s, RN0s t a 7→ s, Cases ffs t 7→a t, RL(ρ)nils t a 7→ s, and if s 7→a s0, then sr 7→a s0r, rs7→a rs0, λx s 7→a λx s0.
The reexive and transitive closure is denoted as usual a∗
7→. Proposition 4.30. Let r 7→a s. Then
1. dse<dre, 2. #x(s)≤#x(r).
Proof. Straightforward verication by induction on the denition of the a
4.7 Program simplication via ane reductions The reduction relation a
7→is clearly strongly normalising as a subrelation of7→. To prove its conuence, it suces to prove that it is locally conuent [BN98]. First, we prove a technical lemma.
Lemma 4.31. Ifr 7→a r0 and #x(r) = 1, then r[x:=p] a∗
7→r0[x:=p]for any term p;
Proof. Induction on the denition of a
7→. If the base redex does not contain the variable x, then the claim is trivial. Otherwise, we need to consider only the case (λz s)t 7→a s[z :=t] with #z(s)≤ 1, as in all the other cases r0 is a subterm of r or an application built from subterms of r and then the claim follows trivially by the
denition of a
7→. Since#x(r) = 1, we have that either x∈FV(s), or x∈FV(t). Case x ∈ FV(s). Since the substitution (λz s) [x:=p] is capture-free, we can
assume thatz /∈FV(p). Thus #z(s) = #z(s[x:=p]). Then
(λz s[x:=p])t7→a s[x:=p] [z :=t]≡s[z :=t] [x:=p].
Case x∈FV(t). We have
(λz s)t[x:=p]7→a s[z :=t[x:=p]]≡s[z :=t] [x:=p].
Theorem 4.32 (Local conuence of ane reductions). Let r 7→a s1 and r
a 7→ s2.
Then there is a term r0, such that s1
a∗
7→t and s2
a∗
7→r0.
Proof. It is only sucient to consider pairs of redexes, which might interfere with each other, i.e., which cannot be independently reduced in parallel. Therefore, we can restrict ourselves to the case whenr 7→a s1 is in one of the forms described in the
base case of the denition of the reduction relation a
7→. In most of these forms s1 is
a subterm of r and the local conuence holds trivially.
Case Spliths, tif 7→a f s t. The only possibility for the reduct s2 is Spliths0, t0if0,
where ∗0 is a reduct of ∗ for exactly one of the terms s, t or f and is equal to ∗ for
the other terms. In this case, r0 :=f0s0t0.
Case (λx s)t 7→a s[x:=t]. Let us denote by s0 and t0 some arbitrary reducts of s
and t, respectively.
Subcase s2 ≡(λx s)t0. We set r0 :=s[x:=t0]. By induction on the term s we can
prove that ifx∈FV(s), thens[x:=t]7→a s[x:=t0], which is sucient to claim that s1
a∗
7→r0.
Subcases2 ≡(λx s0)t. By Proposition4.30,#x(s0)≤1. Therefore, we can perform the reduction in s2 and set r0 := s0[x:=t]. Finally, by Lemma 4.31 we have that
s1
a
7→r0 if x∈FV(s), or s1 ≡r0 otherwise.
We can simplify R by considering its ane normal form. Thus we obtain t0
a
=λy y, t1
a
R=a R0 :=λxRx(λy y) (λx λp λy(λz z+z)(p(y+ 1))).
Now R0xy still reduces to 2x(x+y) in a number of steps depending linearly on x, as opposed to its exponentially behaving counterpart [[P]]+ obtained by applying the
original Dialectica interpretation.