Typed Crossings: What Casts, Refinement Proofs and Chain-of-Thought Checks Carry Across a Boundary

A claim established in one structure is routinely reused in another: an identity on the natural numbers after a cast to the integers, a property of a specification after refinement to an implementation, the validity of a written chain of reasoning as a statement about the computation that produced it. Whether the claim survives is a property of the map that carries it, and it cannot be read off the symbol or the word that is reused. This position paper argues that such a crossing should be declared and typed: by its kind, which fixes what a failure of the crossing consists in, and by what it preserves, under which conditions. Three cases are examined. In Lean 4, Mathlib's bundled morphisms and cast lemmas type the crossing wherever cast automation works. In system verification, properties beyond functional correctness are carried across a refinement one preservation proof at a time. In machine learning, the validity of a model's written reasoning and its faithfulness to the model's computation are two different crossings. A judgement on the trace alone can agree with faithfulness exactly when faithfulness does not vary among the computations that write the same trace; where one trace is written by two computations and describes only one of them, no check on the trace tells the two apart. Verify the trace, and you have verified the trace. Each field already handles the problem locally. The contribution is a common vocabulary, taken from Layered Event Modelling, that states what the local solutions share, together with a Lean 4 mechanisation: the underlying graph model, a crossing with a declared kind and associated preservation proofs, with casts as the worked example, and the results on traces. The mechanised results are elementary, the mechanisation covers only part of the paper, no new experiments are reported, and the paper states where its claims stop.

Authors

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-11-14
DOI
https://doi.org/10.5281/zenodo.24219768
Primary Topic
Logic, programming, and type systems
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
preprint

Typed Crossings: What Casts, Refinement Proofs and Chain-of-Thought Checks Carry Across a Boundary

Bernhard Kreinz
Zenodo (CERN European Organization for Nuclear Research)
Logic, programming, and type systems
preprint

Typed Crossings: What Casts, Refinement Proofs and Chain-of-Thought Checks Carry Across a Boundary

Bernhard Kreinz
preprint en

Abstract

A claim established in one structure is routinely reused in another: an identity on the natural numbers after a cast to the integers, a property of a specification after refinement to an implementation, the validity of a written chain of reasoning as a statement about the computation that produced it. Whether the claim survives is a property of the map that carries it, and it cannot be read off the symbol or the word that is reused. This position paper argues that such a crossing should be declared and typed: by its kind, which fixes what a failure of the crossing consists in, and by what it preserves, under which conditions. Three cases are examined. In Lean 4, Mathlib's bundled morphisms and cast lemmas type the crossing wherever cast automation works. In system verification, properties beyond functional correctness are carried across a refinement one preservation proof at a time. In machine learning, the validity of a model's written reasoning and its faithfulness to the model's computation are two different crossings. A judgement on the trace alone can agree with faithfulness exactly when faithfulness does not vary among the computations that write the same trace; where one trace is written by two computations and describes only one of them, no check on the trace tells the two apart. Verify the trace, and you have verified the trace. Each field already handles the problem locally. The contribution is a common vocabulary, taken from Layered Event Modelling, that states what the local solutions share, together with a Lean 4 mechanisation: the underlying graph model, a crossing with a declared kind and associated preservation proofs, with casts as the worked example, and the results on traces. The mechanised results are elementary, the mechanisation covers only part of the paper, no new experiments are reported, and the paper states where its claims stop.

Zenodo (CERN European Organization for Nuclear Research)
Logic, programming, and type systems
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon