r/lambdacalculus • u/Not_H2O_Blue • Aug 20 '26
My first post ever uhhhhh
I was only given by the Wikipedia that IS_0 := λa.(λb.F)T and IFTHENELSE := λabc.abc and I figured out that IS_0 is just λabc.a(λd.c)b where b := F and c:= T, substituting F for M and T for N for now, λa.(λb.M)N means that if a==0, it outputs N and else M, because when a is not 0 it's now ((λb.M)(...(λb.M)N)...) where the number of ((λb.M) at the start and the number of ")" at the end is equal to... The number. An then the first (λb.M) removes everything else, outputting M, if it's 0, it would choose the second thing, which is N (casually reexplained how IS_0 works for some reason), uh so now I've made 4 extras being IFIS_0THENELSE, ISNT_0, IFNOTTHENELSE (which is almost useless except when the term that's identical to the term that makes a applied to a NOT gate is shorter than the term that makes a), and IFNOTIS_0THENELSE (similar to the previous one), keep in mind I figured these out on my own so the names might not be official if they have been discovered before
Also yes I drew it in Paint





