Theory Domain
section ‹Domain›
theory Domain
imports Stone_Relation_Algebras.Semirings Tests
begin
context idempotent_left_semiring
begin
sublocale ils: il_semiring where inf = times and sup = sup and bot = bot and less_eq = less_eq and less = less and top = 1
apply unfold_locales
apply (simp add: sup_assoc)
apply (simp add: sup_commute)
apply simp
apply simp
apply (simp add: mult_assoc)
apply (simp add: mult_right_dist_sup)
apply simp
apply simp
apply simp
apply (simp add: mult_right_isotone)
apply (simp add: le_iff_sup)
by (simp add: less_le_not_le)
end
class left_zero_domain_semiring = idempotent_left_zero_semiring + dom +
assumes d_restrict: "x ⊔ d(x) * x = d(x) * x"
assumes d_mult_d : "d(x * y) = d(x * d(y))"
assumes d_plus_one: "d(x) ⊔ 1 = 1"
assumes d_zero : "d(bot) = bot"
assumes d_dist_sup: "d(x ⊔ y) = d(x) ⊔ d(y)"
begin
text ‹Many lemmas in this class are taken from Georg Struth's theories.›
lemma d_restrict_equals:
"x = d(x) * x"
by (metis sup_commute d_plus_one d_restrict mult_left_one mult_right_dist_sup)
lemma d_involutive:
"d(d(x)) = d(x)"
by (metis d_mult_d mult_left_one)
lemma d_fixpoint:
"(∃y . x = d(y)) ⟷ x = d(x)"
using d_involutive by auto
lemma d_type:
"∀P . (∀x . x = d(x) ⟶ P(x)) ⟷ (∀x . P(d(x)))"
by (metis d_involutive)
lemma d_mult_sub:
"d(x * y) ≤ d(x)"
by (metis d_dist_sup d_mult_d d_plus_one le_iff_sup mult_left_sub_dist_sup_left mult_1_right)
lemma d_sub_one:
"x ≤ 1 ⟹ x ≤ d(x)"
by (metis d_restrict_equals mult_right_isotone mult_1_right)
lemma d_strict:
"d(x) = bot ⟷ x = bot"
by (metis d_restrict_equals d_zero mult_left_zero)
lemma d_one:
"d(1) = 1"
by (metis d_restrict_equals mult_1_right)
lemma d_below_one:
"d(x) ≤ 1"
by (simp add: d_plus_one le_iff_sup)
lemma d_isotone:
"x ≤ y ⟹ d(x) ≤ d(y)"
by (metis d_dist_sup le_iff_sup)
lemma d_plus_left_upper_bound:
"d(x) ≤ d(x ⊔ y)"
by (simp add: d_isotone)
lemma d_export:
"d(d(x) * y) = d(x) * d(y)"
apply (rule order.antisym)
apply (metis d_below_one d_involutive d_mult_sub d_restrict_equals d_isotone d_mult_d mult_isotone mult_left_one)
by (metis d_below_one d_sub_one coreflexive_mult_closed d_mult_d)
lemma d_idempotent:
"d(x) * d(x) = d(x)"
by (metis d_export d_restrict_equals)
lemma d_commutative:
"d(x) * d(y) = d(y) * d(x)"
by (metis ils.il_inf_associative order.antisym d_export d_mult_d d_mult_sub d_one d_restrict_equals mult_isotone mult_left_one)
lemma d_least_left_preserver:
"x ≤ d(y) * x ⟷ d(x) ≤ d(y)"
by (metis d_below_one d_involutive d_mult_sub d_restrict_equals order.eq_iff mult_left_isotone mult_left_one)
lemma d_weak_locality:
"x * y = bot ⟷ x * d(y) = bot"
by (metis d_mult_d d_strict)
lemma d_sup_closed:
"d(d(x) ⊔ d(y)) = d(x) ⊔ d(y)"
by (simp add: d_involutive d_dist_sup)
lemma d_mult_closed:
"d(d(x) * d(y)) = d(x) * d(y)"
using d_export d_mult_d by auto
lemma d_mult_left_lower_bound:
"d(x) * d(y) ≤ d(x)"
by (metis d_export d_involutive d_mult_sub)
lemma d_mult_greatest_lower_bound:
"d(x) ≤ d(y) * d(z) ⟷ d(x) ≤ d(y) ∧ d(x) ≤ d(z)"
by (metis d_commutative d_idempotent d_mult_left_lower_bound mult_isotone order_trans)
lemma d_mult_left_absorb_sup:
"d(x) * (d(x) ⊔ d(y)) = d(x)"
by (metis sup_commute d_idempotent d_plus_one mult_left_dist_sup mult_1_right)
lemma d_sup_left_absorb_mult:
"d(x) ⊔ d(x) * d(y) = d(x)"
using d_mult_left_lower_bound sup.absorb_iff1 by auto
lemma d_sup_left_dist_mult:
"d(x) ⊔ d(y) * d(z) = (d(x) ⊔ d(y)) * (d(x) ⊔ d(z))"
by (smt sup_assoc d_commutative d_idempotent d_mult_left_absorb_sup mult_left_dist_sup mult_right_dist_sup)
lemma d_order:
"d(x) ≤ d(y) ⟷ d(x) = d(x) * d(y)"
by (metis d_mult_greatest_lower_bound d_mult_left_absorb_sup le_iff_sup order_refl)
lemma d_mult_below:
"d(x) * y ≤ y"
by (metis sup_left_divisibility d_plus_one mult_left_one mult_right_dist_sup)
lemma d_preserves_equation:
"d(y) * x ≤ x * d(y) ⟷ d(y) * x = d(y) * x * d(y)"
by (simp add: d_below_one d_idempotent test_preserves_equation)
end
class left_zero_antidomain_semiring = idempotent_left_zero_semiring + dom + uminus +
assumes a_restrict : "-x * x = bot"
assumes a_plus_mult_d: "-(x * y) ⊔ -(x * --y) = -(x * --y)"
assumes a_complement : "--x ⊔ -x = 1"
assumes d_def : "d(x) = --x"
begin