Author: Paul-André Melliès Event: Ecole de Printemps en Informatique Théorique (EPIT) Theme: (Co)inductive & circular reasoning in programming, proofs and verification Date: May 19-23, 2025 Source: Aussois Slides


Introduction: Game Semantics

  • Core Idea: Every proof of a formula A initiates a dialogue where Proponent tries to convince Opponent, and Opponent tries to refute Proponent. This provides an interactive approach to logic and programming languages.
  • Linear Logic: Viewed through the lens of game semantics.

Example: The Drinker Formula

  • Formula:
    • Meaning: In a non-empty café, there exists a customer y such that if y is drinking, then all customers x are drinking.
  • Provable in classical logic, but not in constructive logic.
  • Proof Interpretation (Winning Strategy):
    1. Prover picks a random customer y.
    2. Refutator contradicts by finding a customer x who is not drinking while y is.
    3. Prover changes their witness to (the customer exhibited by Refutator).
    4. Refutator must admit defeat; Prover wins.

I have to win in one of the two games

Duality in Game Semantics

  • Proponent (Program) plays the game A.
  • Opponent (Environment) plays the game A (or A⊥).
  • Negation permutes the roles of Proponent and Opponent.

Logical Connectives in Game Semantics

We can build new games

  • Sum (Constructive Disjunction):
    • Proponent selects the board to be played.
    • Symbol:

The winning strategy becomes a choice what game to be played (or)

  • Product (Constructive Conjunction): Opponent selects the board to be played.
    • Symbol: &

By de morgan, we can flip the roles of Proponent and Opponent Winning strategy: I need to know the best strategy for TWO games(and)

  • Tensor Product (Classical Conjunction): Two games played in parallel. Opponent can switch boards, but Player cannot.
    • Symbol:

In order to win the game, you have to be really strong, to play both games well — classical conjunction

  • Parallel Product (Classical Disjunction): Two games played in parallel. Player can switch boards, but Opponent cannot.
    • Winning means win on either of the two boards.
    • Symbol: (often represented by \invamp or \parr in LaTeX, or as an upside-down &)

We have the scheduler, ask Polgar to play a move, I can go to Carlsen play the same move, after Carlsen played, I can go back to Polgar and play the same move. … Can win by playing Polgar against Carlsen — copycat strategy

  • Law of Excluded Middle: . Player wins by playing one game (e.g., Polgar) against the other (e.g., Carlsen).

Note: the four connectives have a relation to linear algebra

Exponential Modality (!)

  • Opponent opens as many copies as necessary to beat Proponent but is not allowed to open an infinite number of copies.

Give great power to the opponent to choose his strategy (oppenent can really explore the game). At the end we can say the opponent have a really good approximation of how I play. The hardship for me: I have to win each game as the opponent opens new copies and get better The only good news: not allowed to open

  • Coinductive from Player’s view, inductive from Opponent’s view.

opponent should decide at some point to stop

  • Isomorphism: . This is reminiscent of and is the origin of the name “exponential modality”.

In classical logic, the player can backtrack using the exp. modality (see drinker)


Tensorial Logic and Linear Continuations

  • A primitive logic of tensor, sum, and negation.

Continuations

nat * nat => nat

Currently, bot can be viewed as any type, later we will see they are related to automata

(nat ⇒⊥) ⇒⊥ × (nat ⇒⊥) ⇒⊥ × (nat ⇒⊥) ⇒ ⊥

by viewing as sequential algorithms:

  • Captures the difference between function-style operations and sequential algorithms.
    • Example: Left-to-right vs. Right-to-left addition.
      • lradd =
      • rladd =

The double negation of encoding nat can be viewed as question (program) and answer(player, environment)

time frame:
¬¬nat × ¬¬ nat ⇒ ¬¬nat
                question
question
12       
        question
            5
                    17

Tensorial Logic:

* A logic of tensor, sum, and negation.
* Linear logic without $A \cong \neg\neg A$.
* The syntax of linear continuations and dialogue games.
  • Formulas: .
  • Sequents: .
  • Key Rules:
    • Axiom:
    • Cut:
    • Negation Left
    • Negation Right:
    • Exchange
    • Tensor Left:
    • Tensor Right:
    • Sum Left:
    • Sum Right (L/R): ,
    • Units: , ,

Now we have two way of prove (lradd way and rladd way):


Functorial Approach to Proof Invariants

One application of category theory

Cartesian Closed Categories (CCCs)

  • Brouwer-Heyting-Kolmogorov Interpretation:
    • Proof of is a pair of proofs for A and B.
    • Proof of is an algorithm transforming proofs of A into proofs of B.

    What does algorithm mean? We should look at CCCs:

  • A cartesian category is closed if there’s a functor and a natural bijection .

We can construct Free CCC from a category

  • Free CCC:
    • Objects are formulas: .
    • Morphisms are simply-typed -terms modulo -conversion.
    • -normal forms provide a “basis”.
  • Simply-Typed -calculus Rules: Variable, Abstraction, Application, Weakening, Contraction, Exchange. With products: Pairing, Projections, Unit.
  • Execution: -rule: . -rule: .
  • Proof Invariants: Every CCC induces a proof invariant modulo execution from free-ccc(C) to .
  • morphisms are just proof invariants in lambda terms (w.r.t. beta/eta ~ execution)

Analogy with Knot Invariants

  • Every ribbon category induces a knot invariant modulo deformation from free-ribbon(C) to .
  • The free ribbon category is the category of framed tangles.

Proofs as 3D String Diagrams

  • Example: Left-to-right proof of depicted as a flow of negation.

Dialogue Categories

Every CCC is a dialogue category

  • The categorical counterpart of tensorial logic.
  • Definition: A symmetric monoidal category with:
    • An object (representing falsity or end of game).
    • A functor .
    • A natural family of bijections .
  • Dialogue Category with Finite Sums:
    • Underlying category has finite sums.
    • Finite sums distribute over the tensor product.
      • is an isomorphism.
      • is an isomorphism.

Free Dialogue Category with Sums

  • Objects: Formulas of tensorial logic () modulo equations (associativity, unit laws, distributivity).
  • Morphisms: Derivation trees of tensorial logic modulo equations.
  • Every dialogue category with sums induces a functor preserving logical structure (negation, sums, tensor products, units).

Dialogue Games

We keep the same formula, but view them as dialogue games no longer derivation trees, but “proof nets”

  • The concrete data structure behind the logic.
  • Key Theorem:
    • Objects of are dialogue games generated by .
    • Morphisms of are total and innocent strategies.
    • Slogan: Innocent strategies are the “proof-nets” of tensorial logic.
  • Correspondence (Normal Form): Every formula of tensorial logic is uniquely determined by a normal form .
    • Interpretation: (choice), (parallelism), (change of player).
  • Rooted Dialogue Game: A bipartite tree with nodes (cells) and (values).
    • .

value and cells will alernate in the tree path * Polarity function such that: * * * Root of the tree is a value of polarity +1.

  • Dialogue Game: A family of rooted dialogue games .
  • Operations on Dialogue Games:
    • Sum (): Putting families of rooted games side-by-side. Every dialogue game is the sum of its rooted components .
    • Negation (): Transforms a dialogue game (family of roots) into a new rooted dialogue game by adding a new root connected to the original roots via “op” cells.
    • Tensor Product (): Defined by coalesced sum of negated games (sharing a common root).
    • Every rooted dialogue game is a tensor product of negated games .
    • Hence, every dialogue game is of the form .
    • Tensor distributes over sum: .

Positions of a Dialogue Game

  • The underlying asynchronous transition system.
  • Positionality Theorem (2004): Innocent strategies are positional.
  • The set defines a coherence space and an ordered set of positions.

Gödel Translation L LL+

  • Suspension Modality (): A symmetric monoidal comonad on a symmetric monoidal category .
  • Every suspension modality induces an adjunction between and its category of -coalgebras.
  • When is -autonomous, is a dialogue category with negation .
  • This induces a functor from to mapping logical connectives appropriately (e.g., ).
  • Functorial Interpretations: , , .

Types as Sets of Positions

  • Positions can be seen as states in a higher-order automaton or intersection types specifying -term behavior.

Church Encoding of Data Types

  • A functional encoding of words and trees.
  • Natural Numbers:
    • Based on the induction principle: .
    • Removing first-order part: .
    • Church encoding type: .
    • Zero:
    • One:
    • There’s a one-to-one correspondence between -terms of type (up to ) and natural numbers.
  • Finite Words:
    • Type: (for an alphabet of two letters).
    • Example aba: .
    • One-to-one correspondence with finite words .
  • Finite Trees:
    • Type (e.g., for signature ): .
    • Example: .
    • One-to-one correspondence with finite trees on the signature.

Church Encoding in Linear Logic

  • Arrow type factors as .
  • .
  • A tree can be typed with on arguments (e.g., ) or more linearly (e.g., ).
  • Duality:
    • Proponent (Program) plays ; Opponent (Environment) plays .
    • Dual of a tree is a tree automaton.
    • Counter-formula for trees is the type of tree automata.
    • Counter-formula (with more !) is type of alternating tree automata.

Higher-Order Automata

  • Goal: Define recognizable languages for sets of simply-typed -terms.
  • Approach: Use a finite Scott domain interpretation of types (after Salvati).

Scott Semantics of Linear Logic

  • A preorder induces a Scott domain where elements are lower sets of .
  • If base type o is interpreted as , then any type is interpreted as for some preorder of higher-order states.
  • Logical Connectives on Preorders:
    • , with order .
  • Preorder of Higher-Order States ():
    • (linear implication maps to tensor product like structure for states). A state for is like .

Definition: Higher-Order Automaton

A higher-order automaton consists of:

  • A higher-order alphabet where are simple types (arities).
  • A simple type (the language’s type).
  • A finite preordered set of states .
  • Transition functions (using the for atomic states in ).
  • An initial higher-order state .

Run-Trees

  • A run-tree is a derivation tree of the judgement in an intersection type system.
  • Key Rules for Run-Trees (Intersection Types):
    • Variable: (simplified)
    • Abstraction: (simplified, using for state form)
    • Application: (where is a set of states for N)
    • Bag:

Adequacy Theorem (for -calculus)

  • Given a finite preorder .
  • The interpretation of a simply-typed -term of type coincides with the set of its accepting states.
  • .
  • Corollary: Acceptance property is decidable.

Higher-Order Recursion Schemes (HORS)

  • From finite to infinitary lambda-calculus.
  • Example: , generates an infinite tree.
  • Can be seen as a -term of a specific type in simply-typed -calculus with a recursion operator .
    • E.g., , can be .
  • This produces an infinitary -term .
  • Generation by infinitary -rewriting: (infinite tree).
    • The sequence of -reductions can be chosen “strongly Cauchy convergent”.

Invariance Theorem

  • For a strongly Cauchy convergent infinite -reduction sequence :
    • The HO-automaton recognizes the HO-automaton recognizes .
  • This is easy for automata with purely inductive acceptance but needs revisiting for mixed inductive/coinductive conditions.

Higher-Order Automata with Boundary

  • Shifting to infinitary trees and -terms.

The -calculus

  • Simply-typed -calculus with least () and greatest () fixpoint operators.
  • Syntactically behave same: , .
  • Interpreted differently in Scott semantics .

Infinite -terms with Boundary

  • A boundary of an infinitary -term is a set of infinite paths of .
  • An infinitary -term with boundary is . (Inspired by Borelian games).

Adequacy Theorem with Boundary

  • The interpretation of a -term coincides with its set of accepting states.
  • , where acceptance on run-trees reflects inductive/coinductive status of fixpoints.
  • : infinite path not in boundary.
  • : infinite path in boundary.

Invariance Theorem (with Boundary)

  • For (strongly Cauchy convergent):
    • HO-automaton recognizes with boundary recognizes with boundary .
  • Tool: Diffraction Patterns: An occurrence of a -redex in is turned into a diffraction pattern in by the reduction.

  • The S4 construction at work.
  • Colour Modality () on Preorders: For colours, .
    • (n times).
  • defines a comonad that commutes with finite products.
  • The composite modality defines an exponential modality of linear logic, making a CCC.
  • Inductive-Coinductive Fixpoint: For (even) colours, defines an interpretation in -calculus.
  • Collecting colours is like collecting levels of copies.

Parametric Modality (for Intersection Types)

  • A family of functors for , each lax monoidal, defining a parametric comonad.
  • Relates to copy management in linear logic (e.g., , ).

Conclusion and Future Works

  • Higher-order automata generalize and explain higher-order model checking.
  • A modal -calculus with boundaries refines the usual -calculus.
  • Decidability proof based on Scott semantics of linear logic and infinitary rewriting theory.
  • New automata-theoretic foundations for the lambda-calculus.

Not Discussed

  • Profinite lambda-calculus (with van Gool, Moreau, 2023).
  • Equivalence of syntactic (Hillebrand & Kanellakis 1996) and semantic (Salvati 2009) definitions of higher-order regular languages (Moreau & Nguyên, 2024).
  • Dialogue duploids and classical L-calculus (with Mangel, Munch-Maccagnoni, 2025).
  • Ongoing work on context-free grammars and Chomsky-Schützenberger theorem (with Zeilberger, 2022, 2025).