AFTD Auto-Formalizing Theoretical Domains

Cslib.FreeM.FreeCont.run_toContT

theoremverifiedformalizationimported Lean

The canonical interpreter toContT derived from liftM agrees with the hand-written recursive interpreter run for FreeCont.

Statement

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
open Cslib Cslib.FreeM Cslib.FreeM.FreeCont in
universe u v w w' w'' in
variable {r : Type u} {α : Type v} {β : Type w} in
@[simp]
theorem Cslib.FreeM.FreeCont.run_toContT {α : Type u} (comp : FreeCont r α) (k : α → r) :
    (toContT comp).run k = pure (run comp k)
Formalizes
CSLib, `Cslib.FreeM.FreeCont.run_toContT`
Lean proof
By Tanner Duve, from github.com/leanprover/cslib at 3951377e5a3f (Copyright (c) 2025 Tanner Duve. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.33.0.
Verified
08 Oct 2026
Axioms
Quot.soundpropext
Built on 51
Used by 9

Lean source view module on GitHub

set_option autoImplicit true inset_option relaxedAutoImplicit true inopen Cslib Cslib.FreeM Cslib.FreeM.FreeCont inuniverse u v w w' w'' invariable {r : Type u} {α : Type v} {β : Type w} in/-- The canonical interpreter `toContT` derived from `liftM` agrees with the hand-written recursive interpreter `run` for `FreeCont`. -/@[simp]theorem Cslib.FreeM.FreeCont.run_toContT {α : Type u} (comp : FreeCont r α) (k : α → r) :    (toContT comp).run k = pure (run comp k) := by  simp only [toContT]  induction comp using FreeM.induction with  | pure a => rfl  | lift_bind op cont ih =>    cases op    simp_rw [run_bind]    simp [ih]
See it in the graphDiscuss this resultChallenge it