← All papers
First page of MedLean: A Modest Step Toward Reviving Formal Medical Verification as a Safety World Model in the Era of MLLMs

MedLean: A Modest Step Toward Reviving Formal Medical Verification as a Safety World Model in the Era of MLLMs

Zhihao Tang, Chao Li, Jun Zhao

cs.AI Dec 3, 2026 · v1
Clinical oncology guidelines are compiled into 1,861 executable Lean 4 rules, with a verification kernel backed by 23 machine-checked Lean 4 theorems.
Formal medical verification encodes clinical guidelines into mathematical logic to audit care plans, yet traditional tools stalled under heavy coding burdens, manual record extraction, and opaque outputs. Conversely, multimodal and large language models (MLLMs and LLMs) excel at clinical text processing but still release contraindicated therapies under missing tests and omit mandatory clinical duties. We investigate whether formal medical verification can be revived alongside MLLMs as their interactive safety world model. Focusing on oncology, we introduce MedLean, a two-stage Lean 4 framework comprising an offline compiler and Z3 full-space auditor (MedLean-Compiler) over four NCCN and CSCO guidelines (1,861 executable rules) and an online verification kernel proved across 23 machine-checked theorems (MedLean-Verifier). Static auditing uncovers 362 binary negative-default leaks alongside genuine published-guideline contradictions. Across 428 multi-cancer cases with DeepSeek-V4.1-Flash and GPT-6.2-Astra, MedLean drives high-risk releases to 0% and lifts whole-plan certification to 98.4% and 100%. Binary rule engines actively degrade mandatory-duty completion below unverified LLMs, and safety-first models achieve full base certification partly through conservative omission unless paired with consultation-target accountability.

LLMs used for clinical planning can release contraindicated therapies when tests are missing and can omit mandatory clinical duties. Earlier formal medical verification tools were held back by heavy coding burden, manual record extraction, and outputs physicians could not read.

MedLean-Compiler converts four NCCN and CSCO oncology guidelines (1,029 source records) into page-anchored Lean 4 rules and audits them with Z3 for encoding leaks and guideline conflicts. MedLean-Verifier is a Lean 4 kernel using three-valued clinical logic, backed by 23 machine-checked theorems on soundness, completeness and veto dominance. It audits whole LLM care plans, returns structured revision feedback for at most two turns, and emits exact {0,1} certification rewards.

Figure 2: Overview of the MedLean architecture. (a) MedLean-Verifier (online loop): Given a structured clinical case with three-valued patient facts and a standardized action menu, unverified LLMs ( 161/300 unsafe on DeepSeek Main) or binary Python rule scripts ( 7/300 unsafe) risk coercing missing contraindications to false and overlooking mandatory duties (top track). MedLean routes each proposa

Static auditing found 362 binary negative-default leaks and genuine contradictions in published guidelines. Across 428 synthetic cases with two LLMs, high-risk releases fell to 0%. Whole-plan certification reached 98.4% and 100%, while binary rule engines lowered mandatory-duty completion.

MethodCert.DutyHigh-risk (blind)
Direct LLM0/30010/127161 (98)
Single-Claim0/30010/1270 (0)
Plain Rule0/3008/1277 (7)
MedLean299/300127/1270 (0)
Main cohort (300 cases), DeepSeek-V4.1-Flash