Skip to content

Start general definitions for computation models#550

Open
kesslermaximilian wants to merge 3 commits into
leanprover:mainfrom
kesslermaximilian:computation-model-typeclasses
Open

Start general definitions for computation models#550
kesslermaximilian wants to merge 3 commits into
leanprover:mainfrom
kesslermaximilian:computation-model-typeclasses

Conversation

@kesslermaximilian
Copy link
Copy Markdown

This is a draft so far and should accompany the discussion on zulip.
If we think this design pattern is useful and should be part of cslib, I'll extend these definitiions and also add appropriate documentation etc.

@kesslermaximilian
Copy link
Copy Markdown
Author

THe corresponding topic on zulip is #CSLib > Typeclasses for computation models

step {a : τ} : cfg a → Option (cfg a)

/-- An abstract version of a turing machine with input alphabet `Γ₀` and output alphabet `Γ₁`. -/
class Transducer (τ : Type*) (Γᵢₙ Γₒᵤₜ : Type) extends TransitionSystem τ where
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least on github web, Γₒᵤₜ renders super weirdly (at least in the monospace font). So I take my suggestion from zulip back a bit. Maybe Γᵢ and Γₒ ? Please also update the comment above.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that is true, and I changed it accordingly

@kesslermaximilian kesslermaximilian changed the title [draft] start outlining general definitions for computation models start outlining general definitions for computation models May 12, 2026
@kesslermaximilian kesslermaximilian changed the title start outlining general definitions for computation models Start general definitions for computation models May 12, 2026
Copy link
Copy Markdown
Collaborator

@ctchou ctchou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, I find it difficult to review basic definitions like these in isolation. We need to see them "in action" before we can judge their quality. I would recommend that they be used to at least express some nontrivial results before we accept them.

-/
class TransitionSystem (τ : Type u) where
cfg (t : τ) : Type*
step {t : τ} : cfg t → Option (cfg t)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First, I don't understand why you need the cfg field. What's wrong with dropping cfg and replacing every cfg t by τ? In general, it's more hassle dealing with a family of types than just a single type.

Second, there is already a theory of partial function is mathlib:
https://leanprover-community.github.io/mathlib4_docs/Mathlib/Data/PFun.html
Any reason you want to develop your own theory of partial functions?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants