Theory HS_VC_KA_rel
subsection ‹ Relational model ›
text ‹ In this subsection, we follow Gomes and Struth~\<^cite>‹"afp:vericomp"› and show that relations
form Kleene algebras. ›
theory HS_VC_KA_rel
imports Kleene_Algebra.Kleene_Algebra
begin
context dioid_one_zero
begin
lemma power_inductl: "z + x ⋅ y ≤ y ⟹ (x ^ n) ⋅ z ≤ y"
by(induct n, auto, metis mult.assoc mult_isol order_trans)
lemma power_inductr: "z + y ⋅ x ≤ y ⟹ z ⋅ (x ^ n) ≤ y"
proof (induct n)
case 0 show ?case
using "0.prems" by auto
case Suc
{fix n
assume "z + y ⋅ x ≤ y ⟹ z ⋅ x ^ n ≤ y"
and "z + y ⋅ x ≤ y"
hence "z ⋅ x ^ n ≤ y"
by auto
also have "z ⋅ x ^ Suc n = z ⋅ x ⋅ x ^ n"
by (metis mult.assoc power_Suc)
moreover have "... = (z ⋅ x ^ n) ⋅ x"
by (metis mult.assoc power_commutes)
moreover have "... ≤ y ⋅ x"
by (metis calculation(1) mult_isor)
moreover have "... ≤ y"
using ‹z + y ⋅ x ≤ y› by auto
ultimately have "z ⋅ x ^ Suc n ≤ y" by auto}
thus ?case
by (metis Suc)
qed
end