theory Demo2 = Main: subsection{* moreover/ultimately *} (* thm mono_def *) lemma assumes monof: "mono(f::int\int)" and monog: "mono(g::int\int)" shows "mono(\i. f i + g i)" proof --"rule monoI used automatically" fix i j :: int assume A: "i \ j" from A monof have "f i \ f j" by(simp add:mono_def) moreover from A monog have "g i \ g j" by(simp add:mono_def) ultimately show "f i + g i \ f j + g j" by arith qed subsection{* also/finally *} declare ring_eq_simps [simp] subsection{* Monotonicity reasoning *} lemma "(a+b::int)\ \ 2*(a\ + b\)" proof - have "(a+b)\ \ (a+b)\ + (a-b)\" by simp also have "(a+b)\ \ a\ + b\ + 2*a*b" by(simp add:numeral_2_eq_2) also have "(a-b)\ = a\ + b\ - 2*a*b" by(simp add:numeral_2_eq_2) finally show ?thesis by simp qed end