Пусть → β
← β
Ключевые слова: восходящее слияние, перевернутая собственность ЧР
Я начал с рассмотрения более слабого свойства: локального слияния (т. Е. Если l → β d ← β r
(Верх) В случае , когда оба сокращения находятся на верхнем уровне, то гипотеза становится ( λ х 1 . Б 1 ) 1 → B 1 [ 1 / х 1 ] = Ь 2 [ 2 / х 2 ] ← ( λ х 2 . б 2 ) 2
(Бросок) Если х 1
Наивное доказательство по индукции (на b 1
Если b 1
b1 является переменной y 1y1 ,Если у 1 = х 1
y1=x1 , гипотеза становится ( λ х 1 . Х 1 ) 1 → 1 = Ь 2 [ 2 / х 2 ] ← ( λ х 2 . Б 2 ) на 2(λx1.x1)a1→a1=b2[a2/x2]←(λx2.b2)a2 , и мы действительно имеем ( λ х 1 . х 1 ) 1 = ( λ х 1 х . 1 ) ( б 2 [ 2 / х 2 ] ) ← ( λ х 1 . х 1 ) ( ( λ х 2 . б 2 ) 2 ) → ( λ х 2 . б 2 ) 2(λx1.x1)a1=(λx1.x1)(b2[a2/x2])←(λx1.x1)((λx2.b2)a2)→(λx2.b2)a2 .Если y 1 ≠ x 1
y1≠x1 , то мы можем просто использовать (Throw).
Те же доказательства применимы, если b 2
b2 является переменной.Для b 1 = λ y . c 1
b1=λy.c1 и b 2 = λ y . с 2b2=λy.c2 , гипотеза становится ( А , х 1 . А , у . с 1 ) 1 → А , у . c 1 [ a 1 / x 1 ] = λ y . c 2 [ a 2 / x 2 ] ← ( λх 2 . λ y . с 2 ) 2(λx1.λy.c1)a1→λy.c1[a1/x1]=λy.c2[a2/x2]←(λx2.λy.c2)a2 и предположение индукции дает дd такимчто ( λ х 1 . с 1 ) 1 ← д → ( λ х 2 . с 2 ) 2(λx1.c1)a1←d→(λx2.c2)a2 откуда следуетчто Л у . ( Λ х 1 . С 1 ) 1 ← . d → λ А , уу . ( Λ х 2 . С 2 ) 2λy.(λx1.c1)a1←λy.d→λy.(λx2.c2)a2 . К сожалению, у нас нет λ y . ( Λ х 2 . С 2 ) 2 → ( λ х 2 . Λ у . С 2 ) 2λy.(λx2.c2)a2→(λx2.λy.c2)a2 . (Это заставляет меня думать о σσ сокращении.)Аналогичная проблема возникает для приложений: λ
λ s не там, где они должны быть.
источник
Ответы:
Два контрпримеры:
The counterexample detailed below is given in The Lambda Calculus: Its Syntax and Semantics by H.P. Barenredgt, revised edition (1984), exercise 3.5.11 (vii). It is attributed to Plotkin (no precise reference). I give an incomplete proof which is adapted from a proof by Vincent van Oostrom of a different counterexample, in Take Five: an Easy Expansion Exercise (1996) [PDF].
The basis of the proof is the standardization theorem, which allows us to consider only beta expansions of a certain form. Intuitively speaking, a standard reduction is a reduction that makes all of its contractions from left to right. More precisely, a reduction is non-standard iff there is a step MiMi whose redex is a residual of a redex to the left of the redex of a previous step MjMj ; “left” and “right” for a redex are defined by the position of the λλ that is eliminated when the redex is contracted.
The standardization theorem states that there if M→∗βNM→∗βN then there is a standard reduction from MM to NN .
Let L=(λx.bx(bc))cL=(λx.bx(bc))c and R=(λx.xx)(bc)R=(λx.xx)(bc) . Both terms beta-reduce to bc(bc)bc(bc) in one step.
Suppose that there is a common ancestor AA such that L←∗βA→∗βRL←∗βA→∗βR . Thanks to the standardization theorem, we can assume that both reductions are standard. Without loss of generality, suppose that AA is the first step where these reductions differ. Of these two reductions, let σσ be the one where the redex of the first step is to the left of the other, and write A=C1[(λz.M)N]A=C1[(λz.M)N] where C1C1 is the context of this contraction and (λz.M)N(λz.M)N is the redex. Let ττ be the other reduction.
Since ττ is standard and its first step is to the right of the hole in C1C1 , it cannot contract at C1C1 nor to the left of it. Therefore the final term of ττ is of the form C2[(λz.M′)N′]C2[(λz.M′)N′] where the parts of C1C1 and C2C2 to the left of their holes are identical, M→∗βM′M→∗βM′ and N→∗βN′N→∗βN′ . Since σσ starts by reducing at C1C1 and never reduces further left, its final term must be of the form C3[S]C3[S] where the part of C3C3 to the left of its hole is identical to the left part of C1C1 and C2C2 , and M[z←N]→∗βSM[z←N]→∗βS .
Observe that each of LL and RR contains a single lambda which is to the left of the application operator at the top level. Since ττ preserves the lambda of λz.Mλz.M , this lambda is the one in whichever of LL or RR is the final term of ττ , and in that term the argument of the application is obtained by reducing NN . The redex is at the toplevel, meaning that C1=C2=C3=[]C1=C2=C3=[] .
If ττ ends in RR , then M→∗βzzM→∗βzz , N→∗βbcN→∗βbc and M[z←N]→∗β(λx.bx(bc))cM[z←N]→∗β(λx.bx(bc))c . If NN has a descendant in LL then this descendant must also reduce to bcbc which is the normal form of NN . In particular, no descendant of NN can be a lambda, so σσ cannot contract a subterm of the form ˇNPNˇP where ˇNNˇ is a descendant of NN . Since the only subterm of LL that reduces to bcbc is bcbc , the sole possible descendant of N in L is the sole occurrence of bc itself.
If τ ends in L, then M→∗βbz(bc), N→∗βc, and M[z←N]→∗β(λx.xx)(bc). If N has a descendant in R then this descendant must also reduce to c by confluence.
At this point, the conclusion should follow easily according to van Oostrom, but I'm missing something: I don't see how tracing the descendants of N gives any information about M. Apologies for the incomplete post, I'll think about it overnight.
источник
Note that β-reduction can make any term disappear. Assuming that variable x does not appear free in a term v, you have (λx.v)t1→βv and (λx.v)t2→βv for any terms t1 and t2. As a consequence, the fact that reverse β-reduction is confluent is somewhat equivalent to: for all terms t1 and t2, there is a term u such that u→∗βt1 and u→∗βt2. This seems very false to me!
источник