Site specific recombination and transposition.........pdf
Pure Algebra to Applied AI: a personal journey
1. 1/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
Pure Algebra to Applied ¨¨¨
CT AI:
a personal journey
Valeria de Paiva
Samsung Research America, USA
July, 2019
Valeria de Paiva EBMM2019, Rio
5. 5/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
Introduction
I’m a logician, a proof-theorist and a category theorist.
I work in industry, have done so for the last 20 years, applying the
purest of pure mathematics, in surprising ways.
Today I want to tell you about a most under-appreciated piece of
mathematics on the 20th century.
The Curry-Howard Correspondence
Categorical Proof Theory
what I have to do with that
Valeria de Paiva EBMM2019, Rio
6. 5/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
Introduction
I’m a logician, a proof-theorist and a category theorist.
I work in industry, have done so for the last 20 years, applying the
purest of pure mathematics, in surprising ways.
Today I want to tell you about a most under-appreciated piece of
mathematics on the 20th century.
The Curry-Howard Correspondence
Categorical Proof Theory
what I have to do with that
Valeria de Paiva EBMM2019, Rio
7. 5/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
Introduction
I’m a logician, a proof-theorist and a category theorist.
I work in industry, have done so for the last 20 years, applying the
purest of pure mathematics, in surprising ways.
Today I want to tell you about a most under-appreciated piece of
mathematics on the 20th century.
The Curry-Howard Correspondence
Categorical Proof Theory
what I have to do with that
Valeria de Paiva EBMM2019, Rio
8. 6/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
Mathematics is full of surprises...
It often happens that there are similarities between the
solutions to problems. Sometimes, these similarities point
to more general phenomena that simultaneously explain
several different pieces of mathematics. These more
general phenomena can be very difficult to discover, but
when they are discovered, they have a very important
simplifying and organizing role, and can lead to the
solutions of further problems, or raise new and
fascinating questions. – T. Gowers, The Importance of Mathematics, 2000
Valeria de Paiva EBMM2019, Rio
9. 7/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
Algebra, Proofs and Programs
The bulk of mathematics today got crystallized in the
last years of the 19th century, first years of the 20th
century. The shock is still being felt.
A Revolution in Mathematics?
What Really Happened a Century Ago
and Why It Matters Today
Frank Quinn (Notices of the AMS, Jan 2012)
Valeria de Paiva EBMM2019, Rio
10. 8/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
Algebra, Proofs and Programs
[...] a fundamental shift occurred in mathematics from
about 1880 to 1940–the consideration of a wide variety
of mathematical ”structures,”defined axiomatically and
studied both individually and as the classes of structures
–groups, fields, lattices, etc.– satisfying those axioms.
This approach is so common now that it is almost
superfluous to mention it explicitly, but it represented a
major conceptual shift in answering the question: What
is mathematics?
The axiomatization of Linear Algebra, Moore, Historia Mathematica, 1995.
Valeria de Paiva EBMM2019, Rio
11. 9/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
Bourbaki on Algebra
The axiomatization of algebra was begun by Dedekind
and Hilbert, and then vigorously pursued by Steinitz
(1910). It was then completed in the years following
1920 by Artin, Noether and their colleagues at G¨ottingen
(Hasse, Krull, Schreier, van der Waerden). It was
presented to the world in complete form by van der
Waerden’s book (1930).
Valeria de Paiva EBMM2019, Rio
12. 10/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
Algebra to Category Theory
Category Theory
There’s an underlying unity of mathematical concepts/theories
More important than the mathematical concepts themselves is
how they relate to each other
Topological spaces come with continuous maps, while vector
spaces come with linear transformations
Morphisms: how structures transform into others in the
(most reasonable) way to organize the mathematical edifice.
Valeria de Paiva EBMM2019, Rio
13. 11/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
Proofs?
Mathematics in turmoil in the turn of the century because of
paradoxes e.g. Russell’s Paradox
Hilbert’s program: provide secure foundations for all mathematics.
How? Formalization!
all mathematical statements should be written in a precise formal
language, and manipulated according to well defined rules.
Base all of mathematics in finitistic methods
There is no ignorabimus in mathematics
Proving the consistency of Arithmetic: the big quest
Valeria de Paiva EBMM2019, Rio
14. 12/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
Hilbert’s Program
Consistent: no contradiction can be obtained in the formalism of
mathematics.
Complete: all true mathematical statements can be proven in the
formalism. Consistency proof use only “finitistic”reasoning about finite mathematical objects.
Conservative: any result about “real objects”obtained using
reasoning about “ideal objects”(such as uncountable sets) can be
proved without ideal objects.
Decidable: an algorithm for deciding the truth or falsity of any
mathematical statement.
Valeria de Paiva EBMM2019, Rio
15. 13/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
G¨odel’s Incompleteness Theorems (1931)
Hilbert’s program impossible, if interpreted in the most obvious
way. BUT:
The development of proof theory itself is an outgrowth of
Hilbert’s program. Gentzen’s development of natural
deduction and the sequent calculus [too]. G¨odel obtained
his incompleteness theorems while trying to prove the
consistency of analysis. The tradition of reductive proof
theory of the Gentzen-Sch¨utte school is itself a direct
continuation of Hilbert’s program.
Valeria de Paiva EBMM2019, Rio
16. 14/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
Proofs as programs?
Alonzo Church: the lambda calculus (1932)
Church realized that lambda terms could be used to express every
function that could ever be computed by a machine.
Instead of “the function f where f (x) = t”, he simply wrote λx.t.
The lambda calculus is an universal programming language.
The Curry-Howard correspondence: logicians and computer
scientists developed a cornucopia of new logics/program constructs
based on the correspondence between proofs and programs.
Valeria de Paiva EBMM2019, Rio
17. 15/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
Curry-Howard for Implication
Natural deduction rules for implication (without λ-terms)
A → B A
B
[A]
·
·
·
·
π
B
A → B
Natural deduction rules for implication (with λ-terms)
M : A → B N : A
M(N): B
[x : A]
·
·
·
·
π
M : B
λx.M : A → B
function application abstraction
Valeria de Paiva EBMM2019, Rio
18. 16/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
Algebra, Proofs and Programs
Types are formulae/objects in appropriate category,
Terms/programs are proofs/morphisms in the category,
Logical constructors are appropriate categorical constructions.
Most important: Reduction is proof normalization (Tait)
Outcome: Transfer results/tools from logic to CT to CSci
Valeria de Paiva EBMM2019, Rio
20. 18/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
Proof Theory using Categories...
Category: a collection of objects and of morphisms, satisfying
obvious laws
Functors: the natural notion of morphism between categories
Natural transformations: the natural notion of morphisms between
functors
Constructors: products, sums, limits, duals....
Adjunctions: an abstract version of equality
How does this relate to logic?
Where are the theorems?
A long time coming:
Curry, Schoenfinkel, Howard (1969, published in 1980)
Valeria de Paiva EBMM2019, Rio
21. 19/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
Categorical Proof Theory
Model derivations/proofs, not whether theorems are true or not
Proofs definitely first-class citizens
How? Uses extended Curry-Howard correspondence
Why is it good? Modeling derivations useful in linguistics,
functional programming, compilers..
Why is it important? Widespread use of logic/algebra in CS means
new important problems to solve with our favorite tools.
Why so little impact on maths or logic?
Valeria de Paiva EBMM2019, Rio
22. 20/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
How many Curry-Howard Correspondences?
Easier to count, if thinking about the logics:
Intuitionistic Propositional Logic, System F, Dependent Type
Theory (Martin-L¨of), Linear Logic, Constructive Modal Logics,
various versions of Classical Logic since the early 90’s.
The programs corresponding to these logical systems are futuristic
programs. Not realistic ones.
The logics inform the design of new type systems, that can be used
in new applications.
Valeria de Paiva EBMM2019, Rio
24. 22/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
Dialectica Interpretation
If we cannot do Hilbert’s program with finitistic means, can we do
it some other way?
Can we, at least, prove consistency of arithmetic?
Try: liberalized version of Hilbert’s programme – justify classical
systems in terms of notions as intuitively clear as possible.
G¨odel’s approach: computable (or primitive recursive) functionals
of finite type (System T), using the Dialectica Interpretation
(named after the Swiss journal Dialectica, special volume
dedicated to Paul Bernays 70th birthday) in 1958.
Valeria de Paiva EBMM2019, Rio
25. 23/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
Dialectica Categories
Hyland suggested that to provide a categorical model of the
Dialectica Interpretation, one should look at the functionals
corresponding to the interpretation of logical implication.
The categories in my thesis proved to be a model of Linear Logic
Linear Logic introduced by Girard (1987) as a proof-theoretic tool:
the symmetries of classical logic plus the constructive content of
proofs of intuitionistic logic.
Linear Logic: a tool for semantics of Computing.
Valeria de Paiva EBMM2019, Rio
26. 24/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
Linear Logic
A proof theoretic logic described by Jean-Yves Girard in 1986.
Basic idea: assumptions cannot be discarded or duplicated. They
must be used exactly once – just like dollar bills...
Other approaches to accounting for logical resources before.
Great win of Linear Logic: Account for resources when you want
to, otherwise fall back on traditional logic, A → B iff !A −◦ B
Valeria de Paiva EBMM2019, Rio
27. 25/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
Dialectica Categories as Models of Linear Logic
In Linear Logic formulas denote resources. Resources are premises,
assumptions and conclusions, as they are used in logical proofs.
For example:
$1 −◦ latte
If I have a dollar, I can get a Latte
$1 −◦ cappuccino
If I have a dollar, I can get a Cappuccino
$1
I have a dollar
Can conclude either latte or cappuccino
— But using my dollar and one of the premisses above, say
$1 −◦ latte gives me a latte but the dollar is gone
— Usual logic doesn’t pay attention to uses of premisses, A implies B
and A gives me B but I still have A
Valeria de Paiva EBMM2019, Rio
28. 26/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
Linear Implication and (Multiplicative) Conjunction
Traditional implication: A, A → B B
A, A → B A ∧ B Re-use A
Linear implication: A, A −◦ B B
A, A −◦ B A ⊗ B Cannot re-use A
Traditional conjunction: A ∧ B A Discard B
Linear conjunction: A ⊗ B A Cannot discard B
Of course: !A A⊗!A Re-use
!(A) ⊗ B B Discard
Valeria de Paiva EBMM2019, Rio
29. 27/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
The challenges of modeling Linear Logic
Traditional categorical modeling of intuitionistic logic:
formula A object A of appropriate category
A ∧ B A × B (real product)
A → B BA (set of functions from A to B)
But these are real products, so we have projections (A × B → A)
and diagonals (A → A × A) which correspond to deletion and
duplication of resources.
Not linear!!!
Need to use tensor products and internal homs in Category Theory.
Hard to decide how to define the
“make-everything-as-usual”operator ”!”.
Valeria de Paiva EBMM2019, Rio
30. 28/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
My version of Curry-Howard: Dialectica Categories
Based on G¨odel’s Dialectica Interpretation (1958):
Result: an interpretation of intuitionistic arithmetic HA in a
quantifier-free theory of functionals of finite type T.
Idea: translate every formula A of HA to AD = ∃u∀x.AD, where
AD is quantifier-free.
Use: If HA proves A then T proves AD(t, y) where y is string of
variables for functionals of finite type, t a suitable sequence of
terms not containing y
Goal: to be as constructive as possible while being able to interpret
all of classical arithmetic
Valeria de Paiva EBMM2019, Rio
31. 29/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
Motivation and interpretation
For G¨odel (in 1958) the Dialectica interpretation was a way of
proving consistency of arithmetic.
For me (in 1988) an internal way of modelling Dialectica turned
out to produce models of Linear Logic instead of models of
Intuitionistic Logic, which were expected...
For Blass (in 1995) a way of connecting work of Votj´as in Set
Theory with mine and also his own work on Linear Logic and
cardinalities of the continuum.
Valeria de Paiva EBMM2019, Rio
32. 30/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
Dialectica Categories
Objects of DDial2(Sets) are triples, a generic object is
A = (U, X, R), where U and X are sets and α ⊆ U × X is an usual
set-theoretic relation. A morphism from A to B = (V , Y , β) is a
pair of functions f : U → V and F : U × Y → X such that
uαF(u, y) → fuβy. (Note direction!)
Theorem: You have to find the right structure. . .
(de Paiva 1987) The category DDial2(Sets) has a symmetric monoi-
dal closed structure, which makes it a model of (exponential-free)
intuitionistic multiplicative linear logic.
Theorem(Hard part): You also want usual logic. . .
There is a comonad ! which models exponentials/modalities and
recovers Intuitionistic and Classical Logic.
Valeria de Paiva EBMM2019, Rio
33. 31/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
Second Kind of Dialectica Categories
Girard’s sugestion in Boulder: objects of Dial2(Sets) are triples,
a generic object is A = (U, X, R), where U and X are sets and
α ⊆ U × X is a set-theoretic relation. A morphism from A to
B = (V , Y , β) is a pair of functions f : U → V and F : Y → X
such that uαFy → fuβy. (Simplified maps!)
Theorem: You just have to find the right structure
(de Paiva 1989) The category Dial2(Sets) has a symmetric mo-
noidal closed structure, and involution which makes it a model of
(exponential-free) classical multiplicative linear logic.
Theorem (Even Harder part): You still want usual logic. . .
There is a comonad ! which models exponentials/modalities, hence
recovers Intuitionistic and Classical Logic.
Valeria de Paiva EBMM2019, Rio
34. 32/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
Can we give some intuition for these morphisms?
Blass makes the case for thinking of problems in computational
complexity. Intuitively an object of Dial2(Sets)
A = (U, X, α)
can be seen as representing a problem.
The elements of U are instances of the problem, while the
elements of X are possible answers to the problem instances.
The relation α says whether the answer is correct for that instance
of the problem or not.
Valeria de Paiva EBMM2019, Rio
35. 33/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
Examples of objects in Dial2(Sets)
1. The object (N, N, =) where n is related to m iff n = m.
2. The object (NN, N, R) where f is R-related to n iff f (n) = n.
3. The object (R, R, ≤) where r1 and r2 are related iff r1 ≤ r2
4. The objects (2, 2, =) and (2, 2, =) with usual
equality/inequality.
Valeria de Paiva EBMM2019, Rio
36. 34/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
The Right Structure?
To “internalize”the notion of map between problems, we need to
consider the collection of all maps from U to V , V U, the collection
of all maps from Y to X, XY and we need to make sure that a
pair f : U → V and F : Y → X in that set, satisfies the dialectica
condition:
∀u ∈ U, y ∈ Y , uαFy → fuβy
This give us an object (V U × XY , U × Y , eval) where
eval: V U × XY × (U × Y ) → 2 is the ‘relation’ that evaluates the
pair (f , F) on the pair (u, y) and checks the dialectica implication
between relations.
Valeria de Paiva EBMM2019, Rio
37. 35/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
The Right Structure!
Because it’s fun, let us calculate the “reverse engineering”
necessary for a model of Linear Logic..
A ⊗ B → C if and only if A → [B −◦ C]
U × V (α ⊗ β)XV
× Y U
U α X
⇓ ⇓
W
f
c
γ T
T
(g1, g2)
W V
× Y Z
c
(β −◦ γ)V × Z
T
Valeria de Paiva EBMM2019, Rio
38. 36/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
Dialectica CS Applications
Petri nets (≥ 2 phds), non-commutative versions Lambek
calculus (linguistics), model of imperative state (Correa et al)
Generic models of LL (SchalkdP04), Linguistics Analysis of
the syntax-semantics interface for Natural Language,
Glue Approach (Dalrymple, Lamping and Gupta)
Biering’s ‘Copenhagen Interpretation’ (1st fibrational version),
Hofstra ”The dialectica monad and its cousins”; ”The
Compiler Forest”Budiu et al (2012); P. Hyvernat. “A linear
category of polynomial diagrams”.
Recently: Von Glehn polynomials/containers (PhD 2014);
Piedrot (PhD 2014) Krivine machine interpretation; Moss
”Dialectica models of type theory”, PhD 2017; Moss and von
Glehm ”Dialectica models of type theory”, LICS 2018; T.
Powell, Dialectica and Learning.
Valeria de Paiva EBMM2019, Rio
39. 37/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
Mathematical (Set-theoretic) Applications
Blass (1995) Dialectica categories as a tool for proving inequalities
between cardinalities of the continuum.
Blass realized that Dialectica was also used by P. Votj´as for set
theory, proving inequalities between cardinal invariants: Questions
and Answers: A Category Arising in Linear Logic, Complexity
Theory, and Set Theory (1995). I learnt from Samuel Gomes da
Silva about his and Charles Morgan’s work using Blass/Votj´as’
ideas and we started working together
Valeria de Paiva EBMM2019, Rio
40. 38/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
Lofty Goals
Blass (1995)
It is an empirical fact that proofs between cardinal characteristics
of the continuum usually proceed by representing the characteristics
as norms of objects in PV and then exhibiting explicit morphisms
between those objects.
Blass Question
Why is this so?
jointly so far: natural numbers object in Dialectica categories (de
Paiva, Morgan and da Silva, Natural Number Objects in Dialectica
Categories, LFSA 2013; Dialectica categories, cardinalities of the
continuum and combinatorics of ideals, 2017. more on his own
Valeria de Paiva EBMM2019, Rio
41. 39/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
Conclusions
Introduced you to the under-appreciated Curry-Howard
correspondence.
Hinted at its importance for interdisciplinarity:
Algebra, Proofs and Programs
Described one example: Dialectica categories Dial2(Sets),
Illustrated one easy, but essential, theorem in categorical logic.
Hinted at Blass and Votj´as use for mapping cardinal invariants.
Much more explaining needed...
Valeria de Paiva EBMM2019, Rio
42. 40/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
Take Home
Working in interdisciplinary areas is hard, but rewarding.
The frontier between logic, computing, linguistics and categories is
a fun place to be.
Mathematics teaches you a way of thinking, more than specific
theorems.
Barriers: over-specialization, lack of open access and unwillingness
to ‘waste time’ on formalizations
Enablers: international scientific communities, open access,
growing interaction between fields?...
Handsome payoff expected
Fall in love with your ideas and enjoy talking to many about them..
Valeria de Paiva EBMM2019, Rio
44. 42/42
Introduction
Algebra, Proofs, Programs
Categorical Proof Theory
Linear Logic
Dialectica Categories
Conclusions
Some References
A.Blass, Questions and Answers: A Category Arising in Linear Logic,
Complexity Theory, and Set Theory, Advances in Linear Logic (ed. J.-Y.
Girard, Y. Lafont, and L. Regnier) London Math. Soc. Lecture Notes 222
(1995).
de Paiva, A dialectica-like model of linear logic, Category Theory and
Computer Science, Springer, (1989) 341–356.
de Paiva, The Dialectica Categories, In Proc of Categories in Computer
Science and Logic, Boulder, CO, 1987. Contemporary Mathematics, vol
92, American Mathematical Society, 1989 (eds. J. Gray and A. Scedrov)
P. Vojt´aˇs, Generalized Galois-Tukey-connections between explicit relations
on classical objects of real analysis. In: Set theory of the reals (Ramat
Gan, 1991), Israel Math. Conf. Proc. 6, Bar-Ilan Univ., Ramat Gan
(1993), 619–643.
Valeria de Paiva EBMM2019, Rio