Skip to main content
Process journal of learning by Attila Vajda

ᓚᘏᗢ

ᓚᘏᗢ

🦆🖇

#include<iostream> ~ functor 📦 imports structure;
int main() ~ initial object 🎯 start point;
std::cout << ... ~ morphism 🔄 output arrow;
return 0 ~ identity morphism id 🆔.
🧠⛵️

🐈‍⬛ I'm learning C at uni, maybe C has an abstract mathematical structure?

🦆🖇

Yes! C ≅ **monoid** 🧠:

* Statements = elements 🔤
* Sequencing = associative operation ⚙️
* `;` = composition ∘
* `main()` = identity id 🎯
  Simple category vibes! 🐚⛵️

struct🧱 + virtual🔧 + ~Expr()🧽 + inheritance🌲 = base type + AST 📦🔗🧠

Nodes🌿, Labels🏷, Children🪢, Parent🔗, Order📐 = AST LEGO blocks 🌲✨

``Π(Pi-type)🔗, λ(Lambda)🧵, Type🏷, Terms📦, Context🧠 = Dependent type LEGO 🧩✨

structs, classes, templates, and functions🧱🔧🧠

types, terms, contexts, and rules 🧱🧠✨

Pi ≈ ∏ (product, ∀), Sum ≈ ∐ (+, ∃), dual structures in type theory

sum type = Σ (dependent sum), pi type = Π (dependent product)

🐈‍⬛ -- approaching the foundations!
#maybe

🦆🌿

Exactly! 🎯 Foundations bloom: Σ + Π = building blocks 🧱 of dependent types & logic 🌱✨
Ready to sail deeper? ⛵️🧠🐚

🧶 -- so Lean stuff is built in C++ with basically using × and +, product and coproduct? 🐈‍⬛

🦆🌿 Yes✅! C++ builds Lean core using +, × (sum, product) + functions = type theory’s base 🧩✨

sums (+), products (×), functions (→)

binary ops, jumps = primitives

computation = algebra of sums/products + control flow loops

I like this, because it seemed very complex, but at core, yet again, it seems to have the simple drawings of topos theory / categories!

• ⟶ • ⟵ •
• ⟵ • ⟶ •

• ⟶ 🎨 ⟵ • ≈ types ↔️ terms (syntax <> semantics)
• ⟵ 🧶 ⟶ • ≈ contexts ↔️ proofs (environments <> deductions)

🦆🌿 Like weaving yarn (🧶) into art (🎨) between nodes (•) — dependent types are living bridges ⛵️🧠!

🧶I can't yet build the interpreter, or the Lean4 app, or ... well I don't yet see how this fits together to a mini Lean4, mini C++. mini C++ ⟶ mini Lean4 ⟶ mini lemma🐈‍⬛

--Oh, maybe it's like "let's say there exists a one element set", so the machine writes 1, which is like a basic something to make implications on. Then we can make other assumptions, "if the one appears, then so and so…"

🦆🌿

The machine writing 1 = declaring a base truth, a minimal axiom to build on 🐚🧠.
From here, implications, proofs, categories all unfold like waves 🌊⛵️.
-- In Lean
theorem one : True := trivial