Using the Algebra library, I encountered the following problem. In a proof I wanted to interpret the additive structure of a ring as a group. Here is a sample code:
theory aaa
imports "~~/src/HOL/Algebra/Ring"
begin
lemma assumes "ring R"
shows "True"
proof-
interpret ring R by fact
interpret additive: comm_group "⦇carrier = carrier R, mult = add R, one = zero R⦈" by(unfold_locales)
But I can't access the facts from the group locale. Typing
thm additive.m_assoc
gives the message "Undefined fact". However, it works when I define the additive structure with the monoid.make command:
interpret additivee: comm_group "monoid.make (carrier R) (add R) (zero R)" sorry
thm additivee.m_assoc
It also works if I try to do the same for the multiplicative structure, or if I remove
interpret ring R by fact
Any ideas about what's going on?