Lambda Calc, Peano Axioms, & Recreating Maths

I made doubling:

I tried calling (call num1 with inputs successor) with inputs successor, but it didn't work.
plus again

Right, that's just num1+num1 -- compare it to your plus function.

Let's say you want to do 3x5 and get 15. 3 is λf. λx. f(f(f(x))). 5 is λf. λx. f(f(f(f(f(x))))). You want 15 cascaded Fs. So, make three groups of five, or five groups of three.

I seem to have made plus again:
(16)+5
plus again

I'm trying to get 6(6(6(6(6(x))))).

So, the function that cascades five of something is 5(...) So figure out what you want five of...

Calling 6 5 times just makes those weird exponents (I think...)

I'm not sure.

Ugh-no
(This makes 27, so weird exponents.)

I'll try to figure this out.

Groovy.

I just figured out why exponents are weird. I flipped num2 and num1.

Yup! :~)

Okay. I give up. Can you give me a hint?

Okay. By definition, 3(f) ➞ λx. f(f(f(x)))

Saying that in words, three is the function of a function f that reports a new function, call it g, such that g(x) = f(f(f(x))).

If we want 3×5, say, and if we have an arbitrary function f, and we have 3(f), is there a way we can use 5 to get 15(f)?

Does that help?

Maybe?

Perhaps 3(λ5(f))?

How do you say that in Snap!?

[scratchblocks]
(call (three) with inputs ((#(5)::operators)@addInput::grey ring) @addInput::control)
[/scratchblocks]

And did that give you 15? If so, just generalize it to axb instead of 3x5. If not, note that 3(5) is different from 3(5(f)).

It did not.

(Also, sorry for not posting. My family has a strict "No Computers During Breaks" rule.)

Huh, I would understand better if the rule were "no computers during school weeks"!

Anyway,

Breaks are family time. I need my computer for homework.

Anyway, I've been puzzling about that. Would I need to pass a number (or other function) to five?

Yeah. When you have a free variable like that f, think about wrapping the expression in (λf ...)

Like this?
mult.possibly

You can't put them all in one lambda like that.

Remember, the second and third most important words in computer science are domain and range. What's the domain of TIMES? Answer: it takes two numbers as its inputs. So, not three inputs, two. What does it report? A number. Okay, so, what is a number? It's

(λf . (λx . something))

So if (we're guessing -- I really haven't looked it up lately) 3×5 = 3(5(f)), then the return value has to be something that takes f as an input (as all numbers do; that's what the initial λf means) and reports λx . 3(5(f))(x).