Skip to content

Question: Handling AST Explosion and Timeouts with Deeply Nested Sigma Types (e.g., Eff2-Topos Structures) #175

Description

@yura-ogura

Hello HoTTLean team,

First, thank you for your incredible work on SynthLean and HoTTLean.

My work is heavily inspired by Prof. Awodey's recent theoretical papers on the Effective 2-topos and Path Types.

I am currently working on a Proof-of-Concept (PoC) in Lean 4 that bridges a deeply embedded syntactic DSL for zero-knowledge cryptographic protocols with categorical semantics in the Effective 2-Topos, heavily utilizing the natural model semantics approach from your framework.

My repository can be found here: https://github.com/yura-ogura/crypto_topos

The Problem:
While formalizing higher categorical structures like IsAssembly, IsEffObject, and InternalGroupoid, I encountered a severe compiler limitation. These structures inherently form deeply nested $\Sigma$-types (around 10 to 17 levels deep).

When I attempt to implement these as fully concrete def or structure instances mapping down to my $\mathbb{Z}_q$ algebraic models, the Lean 4 compiler suffers from AST explosion and deterministic timeouts during type checking and reduction.

Current Workaround:
To keep the PoC computationally feasible and ensure instant compilation, I had to temporarily flatten these deeply nested structures and operations into axiom interfaces. While this eliminates the compiler load (and bypasses universe level contradictions between Type 1 categorical structures and Type 0 identities), it obviously loses the computational content of the semantic model.

My Questions:
Since your team is at the forefront of implementing these massive categorical and synthetic structures in Lean:

  1. How does the HoTTLean / SynthLean architecture handle the AST explosion associated with deeply nested $\Sigma$-types?
  2. Are there specific design patterns (e.g., flattening into mutual inductives, specific opaque bounding, or compiler flags) you recommend to bypass these deterministic timeouts?
  3. How do you safely map universe polymorphic/higher-type structures without triggering universe level contradictions during identity evaluation?

Any advice, pointers to specific files in your codebase, or general guidance would be massively appreciated. I am just a student trying to push the boundaries of what is possible with Lean 4 in cryptography, and your insights would be invaluable.

Thank you!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions