theory Test imports Main "~~/src/HOL/Library/Monad_Syntax" begin definition double :: "nat option \ nat option" where "double m \ do { x \ m; let d = x*2; Some d }" thm double_def thm (do_notation) double_def text {*@{thm [display,margin=40,mode=do_notation] double_def}*} end