Skip to main content



A thread about "recursion versus induction".

This is about a beautiful idea discovered by Per Martin-Löf in his now known as Martin-Löf type theory, or MLTT.

Suppose you want to define a function f : ℕ → A.

One possibility is that we have an element a₀ : A and a function s : A → A, and then we can define

f 0 = a₀,
f(n+1) = s (f n).

This is a (simple) recursive definition of f.

1/

in reply to Martin Escardo

This entry was edited (1 month ago)
in reply to Martin Escardo

For my edification, I will attempt a mini-thread translating the start of this thread to Metamath notation.

Write seq 1 ( G , F ) for the sequence F(1), F(1) G F(2), ( F(1) G F(2) ) G F(3), . . .

Simple recursive example: 5^N = seq 1 ( • , ( i ∈ ℕ ↦ 5 ) ) . Here a₀ is 5 and s maps a number to 5 times that number.

Primitive-recursive example: N! = seq 1 ( • , ( i ∈ ℕ ↦ i ) ) .
Here a₀ is 1 and s maps a number to that number times the index in the sequence.

1/3

This entry was edited (1 month ago)
in reply to soaproot

Metamath doesn't have enough dependent typing examples to go much further than this, but we do have one usage which is at least in one sense dependently typed.

Suppose that G : ( C × D ) ⟶ C , F(1) ∈ C , and F(n) ∈ D for n at least 2

Then we can show seq 1 ( G , F ) : ℕ ⟶ C

This is a very limited form of dependent typing: F has one type at the first element, and a second type at all the rest, and that's it.

2/3

This entry was edited (1 month ago)
in reply to soaproot

Metamath references:

* definition of seq: us.metamath.org/ileuni/df-seqf… (following the definitions back will eventually make it to set theory axioms)
* exponentiation defined using seq: us.metamath.org/ileuni/df-exp.…
* factorial defined using seq: us.metamath.org/ileuni/df-fac.…
* "dependent" typing: us.metamath.org/ileuni/seqf2.h… which is used, indirectly, to prove us.metamath.org/ileuni/ctinf.h… ("A set is countably infinite if and only if it has decidable equality, is countable, and is infinite.")

3/3

in reply to soaproot

@soaproot Don't you have functions X → V where X is a set and V is the class of all sets? That should get you going.
in reply to Andrej Bauer

Yes! It is possible we have some examples a bit more fitting than the one I cited but in principle the overall type could be X → V as you say, and one can get more specific than V based on the particular value within X. cc @MartinEscardo
This entry was edited (1 month ago)
in reply to soaproot

@soaproot Right, in set theory the induction principle for ℕ says this: suppose a family of sets P : ℕ → V is given, and suppose a ∈ P 0, and we have a family of maps h_n : P n → P (n + 1), indexed by n ∈ ℕ. Then there is a unique f ∈ ∏ (n : N), P n such that f(0) = a and f(n + 1) = h_n (f (n)),

To get the usual induction from this, given a predicate φ : ℕ → {⊥, ⊤}, consider the family P(n) = {⋆ | φ(n)}.

in reply to Andrej Bauer

@andrejbauer That would seem to translate to our notation (I wrote it up at github.com/metamath/set.mm/iss… ) but I don't think we've proved anything too much like that.

Yet, anyway.

in reply to soaproot

@soaproot writes "For my edification, I will attempt a mini-thread translating [...]"

That's the best way to try to understand anything.

Translate it to your own language, whatever this language is, natural, formal, or whatever.

Whenever I tried to understand a paper when I was a PhD student, I rewrote it in my own way.

I still do this close to retirement.

soaproot reshared this.



¿Hay algún artista de Mastodon que vaya a estar en el salón de cómic de Zaragoza el domingo por la mañana? Por conocerse y comprarles algo a los artistas del Fediverso…

in reply to Flatbush Gardener 🌈

A stainless steel pan sits on a black stovetop, filled with a mixture of small, diced pieces. The contents appear to be mostly translucent, with pale yellow and light pink hues. There are several small, reddish-purple pieces scattered throughout the mixture, suggesting diced onions. The mixture is surrounded by a light, brownish liquid, and it appears to be simmering or cooking. The pan has rounded sides and a metallic sheen.

Provided by @altbot, generated privately and locally using Gemma3:27b

🌱 Energy used: 0.081 Wh



„Sometimes when people leave they are not angry anymore. They are just fucking tired…“



Festival La Nuit de l'Erdre. Ben Harper, Vanessa Paradis, Lenny Kravitz : Enorme programmation pour 2026


Lenny Kravitz, Vanessa Paradis, Ben Harper, Suzane, Bob Sainclar... ! Pour le festival 2026, la plus grande édition de l'histoire, les organisateurs de la Nuit de l'Erdre ont fait fort ! Rencontre avec Olivier Tenailleau, programmateur du Festival depuis 15 ans !

Canårđø-2.žerø reshared this.



Jeff Lynne - Electric Light Orchestra - “Livin' Thing”

#choons1

youtube.com/watch?v=UL98FL32JB…



I love the process of making a thing where I just start throwing things at the wall and all of a sudden something clicks and it keeps me busy and excited for a while. If you also like uplifting cheesy house tracks...I have a new one for you 😂 Happy Friday! 🧀🎶🕺

soundcloud.com/botteaap/fired-…

#music #house



Oh, elle est super intéressante cette évolution de la densité à Paris sur 150 ans !
On dirait une diffusion chimique...
Si j'avais la foi, j'en ferais un gif animé, mais là tout de suite, vu mes (non) compétences graphiques et l'heure, je vais plutôt manger à la place.

N'hésitez pas à me piquer l'idée si ça vous dit !
fr.wikipedia.org/wiki/Arrondis…

This entry was edited (1 month ago)


I challenged myself to get a new #album finished by August of this year. I failed at that, but nobody got hurt so I'm gonna cut me some slack.

The current state of the world is enraging to everyone who isn't a fascist sycophant. But rage is a destructive emotion when left to roam the psyche freely. Since I'm a schmuck with some instruments I decided to spin that feeling into songs.

mby8.bandcamp.com/album/kick-a…

This entry was edited (1 week ago)


Sometimes something hits you from the side, unexpected.

An article someone sent me leads with

Actor Bette Davis once said, “Getting old ain’t for sissies.”


and all I can think of is the famous SF Men's Chorus photo

The photograph shows 115 members of the San Francisco Gay Men's Chorus with their backs turned to the camera, representing the former members of the choir who have died of HIV/AIDS, with seven founding members of the choir facing the camera. The picture is authentic, but it was taken almost 30 years ago in 1993. Since then, the number of former choir members to have died of HIV/AIDS has exceeded 300, thereby outstripping the number of current members.


snopes.com/fact-check/gay-mens…

#Pandemic

reshared this

in reply to Irenes (many)

@ireneista I know a married gay male couple who are in their 70s who literally do not have any other gay friends of their age group because everyone else died of AIDS.

They're not grieving any more - it's mostly been decades - but it's really not a happy topic.




today is the Feast of Our Lady of Guadalupe 🙏
This entry was edited (1 month ago)


x.com/atrupar/status/199915269…

Y’all, you know I avoid the HellSite like it was a plague pit, but a dozen or more people have sent me this, and .... wow. More of this please. Stand up to the lies in broad daylight. Tell the world with your whole chest what monsters this administration has unleashed.

#MAGAZINER #Noem #ice #veterans #SaeJoonPark #senate #usgov




Manfred Mann’s Earth Band - Blinded By The Light 1999

#choons

youtube.com/watch?v=7gxUmCfa_Q…



Spotify hates Art

King Gizzard Pulled Their Music From Spotify in Protest, and Now Spotify Is Hosting AI Knockoffs of Their Songs futurism.com/future-society/ki…