3 Forward declares `boost::hana::Group`.
5 @copyright Louis Dionne 2013-2017
6 Distributed under the Boost Software License, Version 1.0.
7 (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
10 #ifndef BOOST_HANA_FWD_CONCEPT_GROUP_HPP
11 #define BOOST_HANA_FWD_CONCEPT_GROUP_HPP
13 #include <boost/hana/config.hpp>
16 BOOST_HANA_NAMESPACE_BEGIN
17 //! @ingroup group-concepts
18 //! @defgroup group-Group Group
19 //! The `Group` concept represents `Monoid`s where all objects have
20 //! an inverse w.r.t. the `Monoid`'s binary operation.
22 //! A [Group][1] is an algebraic structure built on top of a `Monoid`
23 //! which adds the ability to invert the action of the `Monoid`'s binary
24 //! operation on any element of the set. Specifically, a `Group` is a
25 //! `Monoid` `(S, +)` such that every element `s` in `S` has an inverse
26 //! (say `s'`) which is such that
28 //! s + s' == s' + s == identity of the Monoid
31 //! There are many examples of `Group`s, one of which would be the
32 //! additive `Monoid` on integers, where the inverse of any integer
33 //! `n` is the integer `-n`. The method names used here refer to
34 //! exactly this model.
37 //! Minimal complete definitions
38 //! ----------------------------
40 //! When `minus` is specified, the `negate` method is defaulted by setting
42 //! negate(x) = minus(zero<G>(), x)
46 //! When `negate` is specified, the `minus` method is defaulted by setting
48 //! minus(x, y) = plus(x, negate(y))
54 //! For all objects `x` of a `Group` `G`, the following laws must be
57 //! plus(x, negate(x)) == zero<G>() // right inverse
58 //! plus(negate(x), x) == zero<G>() // left inverse
69 //! `hana::integral_constant`
72 //! Free model for non-boolean arithmetic data types
73 //! ------------------------------------------------
74 //! A data type `T` is arithmetic if `std::is_arithmetic<T>::%value` is
75 //! true. For a non-boolean arithmetic data type `T`, a model of `Group`
76 //! is automatically defined by setting
78 //! minus(x, y) = (x - y)
83 //! The rationale for not providing a Group model for `bool` is the same
84 //! as for not providing a `Monoid` model.
87 //! Structure-preserving functions
88 //! ------------------------------
89 //! Let `A` and `B` be two `Group`s. A function `f : A -> B` is said to
90 //! be a [Group morphism][2] if it preserves the group structure between
91 //! `A` and `B`. Rigorously, for all objects `x, y` of data type `A`,
93 //! f(plus(x, y)) == plus(f(x), f(y))
95 //! Because of the `Group` structure, it is easy to prove that the
96 //! following will then also be satisfied:
98 //! f(negate(x)) == negate(f(x))
99 //! f(zero<A>()) == zero<B>()
101 //! Functions with these properties interact nicely with `Group`s, which
102 //! is why they are given such a special treatment.
105 //! [1]: http://en.wikipedia.org/wiki/Group_(mathematics)
106 //! [2]: http://en.wikipedia.org/wiki/Group_homomorphism
107 template <typename G>
109 BOOST_HANA_NAMESPACE_END
111 #endif // !BOOST_HANA_FWD_CONCEPT_GROUP_HPP