2015-12-08 17:57:55 +00:00
|
|
|
/-
|
|
|
|
Copyright (c) 2015 Jeremy Avigad. All rights reserved.
|
|
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
Authors: Jeremy Avigad
|
|
|
|
|
|
|
|
Bundled structures
|
|
|
|
-/
|
2017-06-02 16:13:20 +00:00
|
|
|
import algebra.ring
|
2016-11-23 22:59:13 +00:00
|
|
|
open algebra pointed is_trunc
|
2015-12-08 17:57:55 +00:00
|
|
|
|
|
|
|
namespace algebra
|
|
|
|
structure Semigroup :=
|
|
|
|
(carrier : Type) (struct : semigroup carrier)
|
|
|
|
|
|
|
|
attribute Semigroup.carrier [coercion]
|
|
|
|
attribute Semigroup.struct [instance]
|
|
|
|
|
|
|
|
structure CommSemigroup :=
|
|
|
|
(carrier : Type) (struct : comm_semigroup carrier)
|
|
|
|
|
|
|
|
attribute CommSemigroup.carrier [coercion]
|
|
|
|
attribute CommSemigroup.struct [instance]
|
|
|
|
|
|
|
|
structure Monoid :=
|
|
|
|
(carrier : Type) (struct : monoid carrier)
|
|
|
|
|
|
|
|
attribute Monoid.carrier [coercion]
|
|
|
|
attribute Monoid.struct [instance]
|
|
|
|
|
|
|
|
structure CommMonoid :=
|
|
|
|
(carrier : Type) (struct : comm_monoid carrier)
|
|
|
|
|
|
|
|
attribute CommMonoid.carrier [coercion]
|
|
|
|
attribute CommMonoid.struct [instance]
|
|
|
|
|
2016-09-20 02:13:16 +00:00
|
|
|
structure Group :=
|
2017-06-02 16:13:20 +00:00
|
|
|
(carrier : Type) (struct' : group carrier)
|
2015-12-08 17:57:55 +00:00
|
|
|
|
2017-06-02 16:13:20 +00:00
|
|
|
attribute Group.struct' [instance]
|
2016-11-23 22:59:13 +00:00
|
|
|
|
|
|
|
section
|
2017-06-02 16:13:20 +00:00
|
|
|
local attribute Group.carrier [coercion]
|
|
|
|
definition pSet_of_Group [constructor] [reducible] [coercion] (G : Group) : Set* :=
|
|
|
|
ptrunctype.mk (Group.carrier G) !semigroup.is_set_carrier 1
|
2016-11-23 22:59:13 +00:00
|
|
|
end
|
|
|
|
|
2017-06-02 16:13:20 +00:00
|
|
|
definition Group.struct [instance] [priority 2000] (G : Group) : group G :=
|
|
|
|
Group.struct' G
|
|
|
|
|
2016-11-23 22:59:13 +00:00
|
|
|
attribute algebra._trans_of_pSet_of_Group [unfold 1]
|
|
|
|
attribute algebra._trans_of_pSet_of_Group_1 algebra._trans_of_pSet_of_Group_2 [constructor]
|
|
|
|
|
2017-06-02 16:13:20 +00:00
|
|
|
definition pType_of_Group [reducible] [constructor] (G : Group) : Type* :=
|
|
|
|
G
|
|
|
|
definition Set_of_Group [reducible] [constructor] (G : Group) : Set :=
|
|
|
|
G
|
2015-12-08 17:57:55 +00:00
|
|
|
|
2016-09-20 02:13:16 +00:00
|
|
|
definition AddGroup : Type := Group
|
|
|
|
|
2017-06-02 16:13:20 +00:00
|
|
|
definition pSet_of_AddGroup [constructor] [reducible] [coercion] (G : AddGroup) : Set* :=
|
|
|
|
pSet_of_Group G
|
|
|
|
|
2016-09-18 04:14:19 +00:00
|
|
|
definition AddGroup.mk [constructor] [reducible] (G : Type) (H : add_group G) : AddGroup :=
|
2016-09-20 02:13:16 +00:00
|
|
|
Group.mk G H
|
2016-09-17 22:37:49 +00:00
|
|
|
|
2017-06-02 16:13:20 +00:00
|
|
|
definition AddGroup.struct [reducible] [instance] [priority 2000] (G : AddGroup) : add_group G :=
|
2016-09-20 02:13:16 +00:00
|
|
|
Group.struct G
|
2016-09-17 22:37:49 +00:00
|
|
|
|
2017-06-02 16:13:20 +00:00
|
|
|
attribute algebra._trans_of_pSet_of_AddGroup [unfold 1]
|
|
|
|
attribute algebra._trans_of_pSet_of_AddGroup_1 algebra._trans_of_pSet_of_AddGroup_2 [constructor]
|
2016-09-20 02:13:16 +00:00
|
|
|
|
2017-06-02 16:13:20 +00:00
|
|
|
definition pType_of_AddGroup [reducible] [constructor] : AddGroup → Type* :=
|
|
|
|
algebra._trans_of_pSet_of_AddGroup_1
|
|
|
|
definition Set_of_AddGroup [reducible] [constructor] : AddGroup → Set :=
|
|
|
|
algebra._trans_of_pSet_of_AddGroup_2
|
2016-09-17 22:37:49 +00:00
|
|
|
|
2017-06-02 16:13:20 +00:00
|
|
|
structure AbGroup :=
|
|
|
|
(carrier : Type) (struct' : ab_group carrier)
|
2016-09-20 02:13:16 +00:00
|
|
|
|
2017-06-02 16:13:20 +00:00
|
|
|
attribute AbGroup.struct' [instance]
|
2016-09-17 22:37:49 +00:00
|
|
|
|
2017-06-02 16:13:20 +00:00
|
|
|
section
|
|
|
|
local attribute AbGroup.carrier [coercion]
|
2016-11-24 05:13:05 +00:00
|
|
|
definition Group_of_AbGroup [coercion] [constructor] (G : AbGroup) : Group :=
|
2016-11-23 22:59:13 +00:00
|
|
|
Group.mk G _
|
2017-06-02 16:13:20 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
definition AbGroup.struct [instance] [priority 2000] (G : AbGroup) : ab_group G :=
|
|
|
|
AbGroup.struct' G
|
2016-11-23 22:59:13 +00:00
|
|
|
|
2016-11-24 05:13:05 +00:00
|
|
|
attribute algebra._trans_of_Group_of_AbGroup_1
|
|
|
|
algebra._trans_of_Group_of_AbGroup
|
|
|
|
algebra._trans_of_Group_of_AbGroup_3 [constructor]
|
|
|
|
attribute algebra._trans_of_Group_of_AbGroup_2 [unfold 1]
|
2016-11-23 22:59:13 +00:00
|
|
|
|
2017-06-02 16:13:20 +00:00
|
|
|
definition AddAbGroup : Type := AbGroup
|
|
|
|
|
|
|
|
definition AddGroup_of_AddAbGroup [coercion] [constructor] (G : AddAbGroup) : AddGroup :=
|
|
|
|
Group_of_AbGroup G
|
2017-02-03 02:38:48 +00:00
|
|
|
|
2017-06-02 16:13:20 +00:00
|
|
|
definition AddAbGroup.struct [reducible] [instance] [priority 2000] (G : AddAbGroup) :
|
|
|
|
add_ab_group G :=
|
2017-02-03 02:38:48 +00:00
|
|
|
AbGroup.struct G
|
2016-09-17 22:37:49 +00:00
|
|
|
|
2017-06-02 16:13:20 +00:00
|
|
|
definition AddAbGroup.mk [constructor] [reducible] (G : Type) (H : add_ab_group G) :
|
|
|
|
AddAbGroup :=
|
|
|
|
AbGroup.mk G H
|
|
|
|
|
|
|
|
attribute algebra._trans_of_AddGroup_of_AddAbGroup_1
|
|
|
|
algebra._trans_of_AddGroup_of_AddAbGroup
|
|
|
|
algebra._trans_of_AddGroup_of_AddAbGroup_3 [constructor]
|
|
|
|
attribute algebra._trans_of_AddGroup_of_AddAbGroup_2 [unfold 1]
|
|
|
|
|
2016-09-17 22:37:49 +00:00
|
|
|
-- structure AddSemigroup :=
|
|
|
|
-- (carrier : Type) (struct : add_semigroup carrier)
|
2015-12-08 17:57:55 +00:00
|
|
|
|
2016-09-17 22:37:49 +00:00
|
|
|
-- attribute AddSemigroup.carrier [coercion]
|
|
|
|
-- attribute AddSemigroup.struct [instance]
|
2015-12-08 17:57:55 +00:00
|
|
|
|
2016-09-17 22:37:49 +00:00
|
|
|
-- structure AddCommSemigroup :=
|
|
|
|
-- (carrier : Type) (struct : add_comm_semigroup carrier)
|
2015-12-08 17:57:55 +00:00
|
|
|
|
2016-09-17 22:37:49 +00:00
|
|
|
-- attribute AddCommSemigroup.carrier [coercion]
|
|
|
|
-- attribute AddCommSemigroup.struct [instance]
|
2015-12-08 17:57:55 +00:00
|
|
|
|
2016-09-17 22:37:49 +00:00
|
|
|
-- structure AddMonoid :=
|
|
|
|
-- (carrier : Type) (struct : add_monoid carrier)
|
2015-12-08 17:57:55 +00:00
|
|
|
|
2016-09-17 22:37:49 +00:00
|
|
|
-- attribute AddMonoid.carrier [coercion]
|
|
|
|
-- attribute AddMonoid.struct [instance]
|
2015-12-08 17:57:55 +00:00
|
|
|
|
2016-09-17 22:37:49 +00:00
|
|
|
-- structure AddCommMonoid :=
|
|
|
|
-- (carrier : Type) (struct : add_comm_monoid carrier)
|
2015-12-08 17:57:55 +00:00
|
|
|
|
2016-09-17 22:37:49 +00:00
|
|
|
-- attribute AddCommMonoid.carrier [coercion]
|
|
|
|
-- attribute AddCommMonoid.struct [instance]
|
2015-12-08 17:57:55 +00:00
|
|
|
|
2016-09-17 22:37:49 +00:00
|
|
|
-- structure AddGroup :=
|
|
|
|
-- (carrier : Type) (struct : add_group carrier)
|
2015-12-08 17:57:55 +00:00
|
|
|
|
2016-09-17 22:37:49 +00:00
|
|
|
-- attribute AddGroup.carrier [coercion]
|
|
|
|
-- attribute AddGroup.struct [instance]
|
2015-12-08 17:57:55 +00:00
|
|
|
|
2016-11-24 05:13:05 +00:00
|
|
|
-- structure AddAbGroup :=
|
|
|
|
-- (carrier : Type) (struct : add_ab_group carrier)
|
2015-12-08 17:57:55 +00:00
|
|
|
|
2016-11-24 05:13:05 +00:00
|
|
|
-- attribute AddAbGroup.carrier [coercion]
|
|
|
|
-- attribute AddAbGroup.struct [instance]
|
2017-02-03 02:38:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
-- some bundled infinity-structures
|
|
|
|
structure InfGroup :=
|
2017-06-02 16:13:20 +00:00
|
|
|
(carrier : Type) (struct' : inf_group carrier)
|
2017-02-03 02:38:48 +00:00
|
|
|
|
2017-06-02 16:13:20 +00:00
|
|
|
attribute InfGroup.struct' [instance]
|
2017-02-03 02:38:48 +00:00
|
|
|
|
|
|
|
section
|
2017-06-02 16:13:20 +00:00
|
|
|
local attribute InfGroup.carrier [coercion]
|
2017-02-03 02:38:48 +00:00
|
|
|
definition pType_of_InfGroup [constructor] [reducible] [coercion] (G : InfGroup) : Type* :=
|
|
|
|
pType.mk G 1
|
|
|
|
end
|
|
|
|
|
|
|
|
attribute algebra._trans_of_pType_of_InfGroup [unfold 1]
|
|
|
|
|
2017-06-02 16:13:20 +00:00
|
|
|
definition InfGroup.struct [instance] [priority 2000] (G : InfGroup) : inf_group G :=
|
|
|
|
InfGroup.struct' G
|
|
|
|
|
2017-02-03 02:38:48 +00:00
|
|
|
definition AddInfGroup : Type := InfGroup
|
|
|
|
|
2017-06-02 16:13:20 +00:00
|
|
|
definition pType_of_AddInfGroup [constructor] [reducible] [coercion] (G : AddInfGroup) : Type* :=
|
|
|
|
pType_of_InfGroup G
|
|
|
|
|
2017-02-03 02:38:48 +00:00
|
|
|
definition AddInfGroup.mk [constructor] [reducible] (G : Type) (H : add_inf_group G) :
|
|
|
|
AddInfGroup :=
|
|
|
|
InfGroup.mk G H
|
|
|
|
|
|
|
|
definition AddInfGroup.struct [reducible] (G : AddInfGroup) : add_inf_group G :=
|
|
|
|
InfGroup.struct G
|
|
|
|
|
2017-06-02 16:13:20 +00:00
|
|
|
attribute algebra._trans_of_pType_of_AddInfGroup [unfold 1]
|
2017-02-03 02:38:48 +00:00
|
|
|
|
|
|
|
structure AbInfGroup :=
|
2017-06-02 16:13:20 +00:00
|
|
|
(carrier : Type) (struct' : ab_inf_group carrier)
|
|
|
|
|
|
|
|
attribute AbInfGroup.struct' [instance]
|
|
|
|
|
|
|
|
section
|
|
|
|
local attribute AbInfGroup.carrier [coercion]
|
|
|
|
definition InfGroup_of_AbInfGroup [coercion] [constructor] (G : AbInfGroup) : InfGroup :=
|
|
|
|
InfGroup.mk G _
|
|
|
|
end
|
|
|
|
|
|
|
|
definition AbInfGroup.struct [instance] [priority 2000] (G : AbInfGroup) : ab_inf_group G :=
|
|
|
|
AbInfGroup.struct' G
|
2017-02-03 02:38:48 +00:00
|
|
|
|
2017-06-02 16:13:20 +00:00
|
|
|
attribute algebra._trans_of_InfGroup_of_AbInfGroup_1 [constructor]
|
|
|
|
attribute algebra._trans_of_InfGroup_of_AbInfGroup [unfold 1]
|
2017-02-03 02:38:48 +00:00
|
|
|
|
|
|
|
definition AddAbInfGroup : Type := AbInfGroup
|
|
|
|
|
2017-06-02 16:13:20 +00:00
|
|
|
definition AddInfGroup_of_AddAbInfGroup [coercion] [constructor] (G : AddAbInfGroup) : AddInfGroup :=
|
|
|
|
InfGroup_of_AbInfGroup G
|
2017-02-03 02:38:48 +00:00
|
|
|
|
2017-06-02 16:13:20 +00:00
|
|
|
definition AddAbInfGroup.struct [reducible] [instance] [priority 2000] (G : AddAbInfGroup) :
|
|
|
|
add_ab_inf_group G :=
|
2017-02-03 02:38:48 +00:00
|
|
|
AbInfGroup.struct G
|
|
|
|
|
2017-06-02 16:13:20 +00:00
|
|
|
definition AddAbInfGroup.mk [constructor] [reducible] (G : Type) (H : add_ab_inf_group G) :
|
|
|
|
AddAbInfGroup :=
|
|
|
|
AbInfGroup.mk G H
|
2017-02-03 02:38:48 +00:00
|
|
|
|
2017-06-02 16:13:20 +00:00
|
|
|
attribute algebra._trans_of_AddInfGroup_of_AddAbInfGroup_1 [constructor]
|
|
|
|
attribute algebra._trans_of_AddInfGroup_of_AddAbInfGroup [unfold 1]
|
2017-02-03 02:38:48 +00:00
|
|
|
|
|
|
|
definition InfGroup_of_Group [constructor] (G : Group) : InfGroup :=
|
|
|
|
InfGroup.mk G _
|
|
|
|
|
|
|
|
definition AddInfGroup_of_AddGroup [constructor] (G : AddGroup) : AddInfGroup :=
|
|
|
|
AddInfGroup.mk G _
|
|
|
|
|
|
|
|
definition AbInfGroup_of_AbGroup [constructor] (G : AbGroup) : AbInfGroup :=
|
|
|
|
AbInfGroup.mk G _
|
|
|
|
|
|
|
|
definition AddAbInfGroup_of_AddAbGroup [constructor] (G : AddAbGroup) : AddAbInfGroup :=
|
|
|
|
AddAbInfGroup.mk G _
|
|
|
|
|
2017-06-02 16:13:20 +00:00
|
|
|
/- rings -/
|
|
|
|
structure Ring :=
|
|
|
|
(carrier : Type) (struct : ring carrier)
|
|
|
|
|
|
|
|
attribute Ring.carrier [coercion]
|
|
|
|
attribute Ring.struct [instance]
|
|
|
|
|
2015-12-08 17:57:55 +00:00
|
|
|
end algebra
|
2018-09-11 14:45:30 +00:00
|
|
|
open algebra
|
|
|
|
|
|
|
|
namespace infgroup
|
|
|
|
attribute [coercion] InfGroup_of_Group
|
|
|
|
attribute [coercion] AbInfGroup_of_AbGroup
|
|
|
|
end infgroup
|