diff -r 5352449209b1 -r 160eaf566bcb src/HOL/Modules.thy --- a/src/HOL/Modules.thy Mon Oct 07 21:51:31 2019 +0200 +++ b/src/HOL/Modules.thy Tue Oct 08 10:26:40 2019 +0000 @@ -86,8 +86,30 @@ lemma sum_constant_scale: "(\x\A. y) = scale (of_nat (card A)) y" by (induct A rule: infinite_finite_induct) (simp_all add: algebra_simps) +end + +setup \Sign.add_const_constraint (\<^const_name>\divide\, SOME \<^typ>\'a \ 'a \ 'a\)\ + +context module +begin + +lemma [field_simps]: + shows scale_left_distrib_NO_MATCH: "NO_MATCH (x div y) c \ (a + b) *s x = a *s x + b *s x" + and scale_right_distrib_NO_MATCH: "NO_MATCH (x div y) a \ a *s (x + y) = a *s x + a *s y" + and scale_left_diff_distrib_NO_MATCH: "NO_MATCH (x div y) c \ (a - b) *s x = a *s x - b *s x" + and scale_right_diff_distrib_NO_MATCH: "NO_MATCH (x div y) a \ a *s (x - y) = a *s x - a *s y" + by (rule scale_left_distrib scale_right_distrib scale_left_diff_distrib scale_right_diff_distrib)+ + +end + +setup \Sign.add_const_constraint (\<^const_name>\divide\, SOME \<^typ>\'a::divide \ 'a \ 'a\)\ + + section \Subspace\ +context module +begin + definition subspace :: "'b set \ bool" where "subspace S \ 0 \ S \ (\x\S. \y\S. x + y \ S) \ (\c. \x\S. c *s x \ S)"