Welcome to TiddlyWiki created by Jeremy Ruston, Copyright © 2007 UnaMesa Association
''theory'' AbelianGroup_ZF ''imports'' [[Group_ZF]]
''begin
''
A group is called ``abelian`` if its operation is commutative, i.e. $P\langle a,b \rangle = P\langle a,b \rangle$ for all group elements $a,b$, where $P$ is the group operation. It is customary to use the additive notation for abelian groups, so this condition is typically written as $a+b = b+a$. We will be using multiplicative notation though (in which the commutativity condition of the operation is written as $a\cdot b = b\cdot a$), just to avoid the hassle of changing the notation we used for general groups.
!Rearrangement formulae
This section is not interesting and should not be read. Here we will prove formulas is which right hand side uses the same factors as the left hand side, just in different order. These facts are obvious in informal math sense, but Isabelle prover is not able to derive them automatically, so we have to prove them by hand.
Proving the facts about associative and commutative operations is quite tedious in formalized mathematics. To a human the thing is simple: we can arrange the elements in any order and put parantheses wherever we want, it is all the same. However, formalizing this statement would be rather difficult (I think). The next lemma attempts a quasi-algorithmic approach to this type of problem. To prove that two expressions are equal, we first strip one from parantheses, then rearrange the elements in proper order, then put the parantheses where we want them to be. The algorithm for rearrangement is easy to describe: we keep putting the first element (from the right) that is in the wrong place at the left-most position until we get the proper arrangement. As far removing parantheses is concerned Isabelle does its job automatically.
''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L2</nowiki>:
'' assumes '' A1: $ P \text{ is commutative on } G$ ''and '' A2: $ a\in G$, $ b\in G$, $ c\in G$, $ d\in G$, $ E\in G$, $ F\in G$ '' shows '' $ (a\cdot b)\cdot (c\cdot d)\cdot (E\cdot F) = (a\cdot (d\cdot F))\cdot (b\cdot (c\cdot E))$+++[proof ]>
''from '' A2 ''have'' $ (a\cdot b)\cdot (c\cdot d)\cdot (E\cdot F) = a\cdot b\cdot c\cdot d\cdot E\cdot F$ ''using'' +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ === , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''also'' ''have'' $ a\cdot b\cdot c\cdot d\cdot E\cdot F = a\cdot d\cdot F\cdot b\cdot c\cdot E$+++[proof ]>
''from '' A1, A2 ''have'' $ a\cdot b\cdot c\cdot d\cdot E\cdot F = F\cdot (a\cdot b\cdot c\cdot d\cdot E)$ ''using'' +++^[IsCommutative_def | func_ZF ]... Definition of <nowiki>IsCommutative</nowiki>:
$ f \text{ is commutative on } G \equiv \forall x\in G.\ \forall y\in G.\ f\langle x,y\rangle = f\langle y,x\rangle $=== , +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ ===
''also'' ''from '' A2 ''have'' $ F\cdot (a\cdot b\cdot c\cdot d\cdot E) = F\cdot a\cdot b\cdot c\cdot d\cdot E$ ''using'' +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ === , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''also'' ''from '' A1, A2 ''have'' $ F\cdot a\cdot b\cdot c\cdot d\cdot E = d\cdot (F\cdot a\cdot b\cdot c)\cdot E$ ''using'' +++^[IsCommutative_def | func_ZF ]... Definition of <nowiki>IsCommutative</nowiki>:
$ f \text{ is commutative on } G \equiv \forall x\in G.\ \forall y\in G.\ f\langle x,y\rangle = f\langle y,x\rangle $=== , +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ ===
''also'' ''from '' A2 ''have'' $ d\cdot (F\cdot a\cdot b\cdot c)\cdot E = d\cdot F\cdot a\cdot b\cdot c\cdot E$ ''using'' +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ === , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''also'' ''from '' A1, A2 ''have'' $ d\cdot F\cdot a\cdot b\cdot c\cdot E = a\cdot (d\cdot F)\cdot b\cdot c\cdot E$ ''using'' +++^[IsCommutative_def | func_ZF ]... Definition of <nowiki>IsCommutative</nowiki>:
$ f \text{ is commutative on } G \equiv \forall x\in G.\ \forall y\in G.\ f\langle x,y\rangle = f\langle y,x\rangle $=== , +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ ===
''also'' ''from '' A2 ''have'' $ a\cdot (d\cdot F)\cdot b\cdot c\cdot E = a\cdot d\cdot F\cdot b\cdot c\cdot E$ ''using'' +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ === , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''finally '' ''show'' $ thesis$
''qed'' ===
''also'' ''from '' A2 ''have'' $ a\cdot d\cdot F\cdot b\cdot c\cdot E = (a\cdot (d\cdot F))\cdot (b\cdot (c\cdot E))$ ''using'' +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ === , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''finally '' ''show'' $ thesis$
''qed'' ===
Another useful rearrangement.
''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L3</nowiki>:
'' assumes '' A1: $ P \text{ is commutative on } G$ ''and '' A2: $ a\in G$, $ b\in G$ ''and '' A3: $ c\in G$, $ d\in G$, $ E\in G$, $ F\in G$ '' shows '' $ a\cdot b\cdot ((c\cdot d)^{-1}\cdot (E\cdot F)^{-1}) = (a\cdot (E\cdot c)^{-1})\cdot (b\cdot (F\cdot d)^{-1})$+++[proof ]>
''from '' A3 ''have'' T1: $ c^{-1}\in G$, $ d^{-1}\in G$, $ E^{-1}\in G$, $ F^{-1}\in G$, $ (c\cdot d)^{-1}\in G$, $ (E\cdot F)^{-1}\in G$ ''using'' +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ === , +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ ===
''from '' A2, T1 ''have'' $ a\cdot b\cdot ((c\cdot d)^{-1}\cdot (E\cdot F)^{-1}) = a\cdot b\cdot (c\cdot d)^{-1}\cdot (E\cdot F)^{-1}$ ''using'' +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ === , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''also'' ''from '' A2, A3 ''have'' $ a\cdot b\cdot (c\cdot d)^{-1}\cdot (E\cdot F)^{-1} = (a\cdot b)\cdot (d^{-1}\cdot c^{-1})\cdot (F^{-1}\cdot E^{-1})$ ''using'' +++^[group_inv_of_two | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_two</nowiki>: ''assumes '' $ a\in G$ ''and'' $ b\in G$ '' shows '' $ b^{-1}\cdot a^{-1} = (a\cdot b)^{-1}$ ===
''also'' ''from '' A1, A2, T1 ''have'' $ (a\cdot b)\cdot (d^{-1}\cdot c^{-1})\cdot (F^{-1}\cdot E^{-1}) = (a\cdot (c^{-1}\cdot E^{-1}))\cdot (b\cdot (d^{-1}\cdot F^{-1}))$ ''using'' +++^[group0_4_L2 | AbelianGroup_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L2</nowiki>: ''assumes '' $ P \text{ is commutative on } G$ ''and'' $ a\in G$, $ b\in G$, $ c\in G$, $ d\in G$, $ E\in G$, $ F\in G$ '' shows '' $ (a\cdot b)\cdot (c\cdot d)\cdot (E\cdot F) = (a\cdot (d\cdot F))\cdot (b\cdot (c\cdot E))$ ===
''also'' ''from '' A2, A3 ''have'' $ (a\cdot (c^{-1}\cdot E^{-1}))\cdot (b\cdot (d^{-1}\cdot F^{-1})) = (a\cdot (E\cdot c)^{-1})\cdot (b\cdot (F\cdot d)^{-1})$ ''using'' +++^[group_inv_of_two | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_two</nowiki>: ''assumes '' $ a\in G$ ''and'' $ b\in G$ '' shows '' $ b^{-1}\cdot a^{-1} = (a\cdot b)^{-1}$ ===
''finally '' ''show'' $ thesis$
''qed'' ===
Some useful rearrangements for two elements of a group.
''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L4</nowiki>:
'' assumes '' A1: $ P \text{ is commutative on } G$ ''and '' A2: $ a\in G$, $ b\in G$ '' shows '' $ b^{-1}\cdot a^{-1} = a^{-1}\cdot b^{-1}$, $ (a\cdot b)^{-1} = a^{-1}\cdot b^{-1}$, $ (a\cdot b^{-1})^{-1} = a^{-1}\cdot b$+++[proof ]>
''from '' A2 ''have'' T1: $ b^{-1}\in G$, $ a^{-1}\in G$ ''using'' +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ ===
''with '' A1 ''show'' $ b^{-1}\cdot a^{-1} = a^{-1}\cdot b^{-1}$ ''using'' +++^[IsCommutative_def | func_ZF ]... Definition of <nowiki>IsCommutative</nowiki>:
$ f \text{ is commutative on } G \equiv \forall x\in G.\ \forall y\in G.\ f\langle x,y\rangle = f\langle y,x\rangle $===
''with '' A2 ''show'' $ (a\cdot b)^{-1} = a^{-1}\cdot b^{-1}$ ''using'' +++^[group_inv_of_two | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_two</nowiki>: ''assumes '' $ a\in G$ ''and'' $ b\in G$ '' shows '' $ b^{-1}\cdot a^{-1} = (a\cdot b)^{-1}$ ===
''from '' A2, T1 ''have'' $ (a\cdot b^{-1})^{-1} = (b^{-1})^{-1}\cdot a^{-1}$ ''using'' +++^[group_inv_of_two | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_two</nowiki>: ''assumes '' $ a\in G$ ''and'' $ b\in G$ '' shows '' $ b^{-1}\cdot a^{-1} = (a\cdot b)^{-1}$ ===
''with '' A1, A2, T1 ''show'' $ (a\cdot b^{-1})^{-1} = a^{-1}\cdot b$ ''using'' +++^[group_inv_of_inv | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_inv</nowiki>: ''assumes '' $ a\in G$ '' shows '' $ a = (a^{-1})^{-1}$ === , +++^[IsCommutative_def | func_ZF ]... Definition of <nowiki>IsCommutative</nowiki>:
$ f \text{ is commutative on } G \equiv \forall x\in G.\ \forall y\in G.\ f\langle x,y\rangle = f\langle y,x\rangle $===
''qed'' ===
Another bunch of useful rearrangements with three elements.
''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L4A</nowiki>:
'' assumes '' A1: $ P \text{ is commutative on } G$ ''and '' A2: $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot b\cdot c = c\cdot a\cdot b$, $ a^{-1}\cdot (b^{-1}\cdot c^{-1})^{-1} = (a\cdot (b\cdot c)^{-1})^{-1}$, $ a\cdot (b\cdot c)^{-1} = a\cdot b^{-1}\cdot c^{-1}$, $ a\cdot (b\cdot c^{-1})^{-1} = a\cdot b^{-1}\cdot c$, $ a\cdot b^{-1}\cdot c^{-1} = a\cdot c^{-1}\cdot b^{-1}$+++[proof ]>
''from '' A1, A2 ''have'' $ a\cdot b\cdot c = c\cdot (a\cdot b)$ ''using'' +++^[IsCommutative_def | func_ZF ]... Definition of <nowiki>IsCommutative</nowiki>:
$ f \text{ is commutative on } G \equiv \forall x\in G.\ \forall y\in G.\ f\langle x,y\rangle = f\langle y,x\rangle $=== , +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ ===
''with '' A2 ''show'' $ a\cdot b\cdot c = c\cdot a\cdot b$ ''using'' +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ === , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''from '' A2 ''have'' T: $ b^{-1}\in G$, $ c^{-1}\in G$, $ b^{-1}\cdot c^{-1} \in G$, $ a\cdot b \in G$ ''using'' +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ === , +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ ===
''with '' A1, A2 ''show'' $ a^{-1}\cdot (b^{-1}\cdot c^{-1})^{-1} = (a\cdot (b\cdot c)^{-1})^{-1}$ ''using'' +++^[group_inv_of_two | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_two</nowiki>: ''assumes '' $ a\in G$ ''and'' $ b\in G$ '' shows '' $ b^{-1}\cdot a^{-1} = (a\cdot b)^{-1}$ === , +++^[IsCommutative_def | func_ZF ]... Definition of <nowiki>IsCommutative</nowiki>:
$ f \text{ is commutative on } G \equiv \forall x\in G.\ \forall y\in G.\ f\langle x,y\rangle = f\langle y,x\rangle $===
''from '' A1, A2, T ''have'' $ a\cdot (b\cdot c)^{-1} = a\cdot (b^{-1}\cdot c^{-1})$ ''using'' +++^[group_inv_of_two | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_two</nowiki>: ''assumes '' $ a\in G$ ''and'' $ b\in G$ '' shows '' $ b^{-1}\cdot a^{-1} = (a\cdot b)^{-1}$ === , +++^[IsCommutative_def | func_ZF ]... Definition of <nowiki>IsCommutative</nowiki>:
$ f \text{ is commutative on } G \equiv \forall x\in G.\ \forall y\in G.\ f\langle x,y\rangle = f\langle y,x\rangle $===
''with '' A2, T ''show'' $ a\cdot (b\cdot c)^{-1} = a\cdot b^{-1}\cdot c^{-1}$ ''using'' +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''from '' A1, A2, T ''have'' $ a\cdot (b\cdot c^{-1})^{-1} = a\cdot (b^{-1}\cdot (c^{-1})^{-1})$ ''using'' +++^[group_inv_of_two | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_two</nowiki>: ''assumes '' $ a\in G$ ''and'' $ b\in G$ '' shows '' $ b^{-1}\cdot a^{-1} = (a\cdot b)^{-1}$ === , +++^[IsCommutative_def | func_ZF ]... Definition of <nowiki>IsCommutative</nowiki>:
$ f \text{ is commutative on } G \equiv \forall x\in G.\ \forall y\in G.\ f\langle x,y\rangle = f\langle y,x\rangle $===
''with '' A2, T ''show'' $ a\cdot (b\cdot c^{-1})^{-1} = a\cdot b^{-1}\cdot c$ ''using'' +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ === , +++^[group_inv_of_inv | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_inv</nowiki>: ''assumes '' $ a\in G$ '' shows '' $ a = (a^{-1})^{-1}$ ===
''from '' A1, A2, T ''have'' $ a\cdot b^{-1}\cdot c^{-1} = a\cdot (c^{-1}\cdot b^{-1})$ ''using'' +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ === , +++^[IsCommutative_def | func_ZF ]... Definition of <nowiki>IsCommutative</nowiki>:
$ f \text{ is commutative on } G \equiv \forall x\in G.\ \forall y\in G.\ f\langle x,y\rangle = f\langle y,x\rangle $===
''with '' A2, T ''show'' $ a\cdot b^{-1}\cdot c^{-1} = a\cdot c^{-1}\cdot b^{-1}$ ''using'' +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''qed'' ===
Another useful rearrangement.
''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L4B</nowiki>:
'' assumes '' $ P \text{ is commutative on } G$ ''and '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot b^{-1}\cdot (b\cdot c^{-1}) = a\cdot c^{-1}$ ''using'' <nowiki>prems</nowiki> , +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ === , +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ === , +++^[group0_4_L4 | AbelianGroup_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L4</nowiki>: ''assumes '' $ P \text{ is commutative on } G$ ''and'' $ a\in G$, $ b\in G$ '' shows '' $ b^{-1}\cdot a^{-1} = a^{-1}\cdot b^{-1}$,
$ (a\cdot b)^{-1} = a^{-1}\cdot b^{-1}$, $ (a\cdot b^{-1})^{-1} = a^{-1}\cdot b$ === , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ === , +++^[inv_cancel_two | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inv_cancel_two</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b^{-1}\cdot b = a$,
$ a\cdot b\cdot b^{-1} = a$, $ a^{-1}\cdot (a\cdot b) = b$, $ a\cdot (a^{-1}\cdot b) = b$ ===
A couple of permutations of order for three alements.
''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L4C</nowiki>:
'' assumes '' A1: $ P \text{ is commutative on } G$ ''and '' A2: $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot b\cdot c = c\cdot a\cdot b$, $ a\cdot b\cdot c = a\cdot (c\cdot b)$, $ a\cdot b\cdot c = c\cdot (a\cdot b)$, $ a\cdot b\cdot c = c\cdot b\cdot a$+++[proof ]>
''from '' A1, A2 ''show'' I: $ a\cdot b\cdot c = c\cdot a\cdot b$ ''using'' +++^[group0_4_L4A | AbelianGroup_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L4A</nowiki>: ''assumes '' $ P \text{ is commutative on } G$ ''and'' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot b\cdot c = c\cdot a\cdot b$,
$ a^{-1}\cdot (b^{-1}\cdot c^{-1})^{-1} = (a\cdot (b\cdot c)^{-1})^{-1}$,
$ a\cdot (b\cdot c)^{-1} = a\cdot b^{-1}\cdot c^{-1}$,
$ a\cdot (b\cdot c^{-1})^{-1} = a\cdot b^{-1}\cdot c$,
$ a\cdot b^{-1}\cdot c^{-1} = a\cdot c^{-1}\cdot b^{-1}$ ===
''also'' ''from '' A1, A2 ''have'' $ c\cdot a\cdot b = a\cdot c\cdot b$ ''using'' +++^[IsCommutative_def | func_ZF ]... Definition of <nowiki>IsCommutative</nowiki>:
$ f \text{ is commutative on } G \equiv \forall x\in G.\ \forall y\in G.\ f\langle x,y\rangle = f\langle y,x\rangle $===
''also'' ''from '' A2 ''have'' $ a\cdot c\cdot b = a\cdot (c\cdot b)$ ''using'' +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''finally '' ''show'' $ a\cdot b\cdot c = a\cdot (c\cdot b)$
''from '' A2, I ''show'' $ a\cdot b\cdot c = c\cdot (a\cdot b)$ ''using'' +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''also'' ''from '' A1, A2 ''have'' $ c\cdot (a\cdot b) = c\cdot (b\cdot a)$ ''using'' +++^[IsCommutative_def | func_ZF ]... Definition of <nowiki>IsCommutative</nowiki>:
$ f \text{ is commutative on } G \equiv \forall x\in G.\ \forall y\in G.\ f\langle x,y\rangle = f\langle y,x\rangle $===
''also'' ''from '' A2 ''have'' $ c\cdot (b\cdot a) = c\cdot b\cdot a$ ''using'' +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''finally '' ''show'' $ a\cdot b\cdot c = c\cdot b\cdot a$
''qed'' ===
Some rearangement with three elements and inverse.
''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L4D</nowiki>:
'' assumes '' A1: $ P \text{ is commutative on } G$ ''and '' A2: $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a^{-1}\cdot b^{-1}\cdot c = c\cdot a^{-1}\cdot b^{-1}$, $ b^{-1}\cdot a^{-1}\cdot c = c\cdot a^{-1}\cdot b^{-1}$, $ (a^{-1}\cdot b\cdot c)^{-1} = a\cdot b^{-1}\cdot c^{-1}$+++[proof ]>
''from '' A2 ''have'' T: $ a^{-1} \in G$, $ b^{-1} \in G$, $ c^{-1}\in G$ ''using'' +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ ===
''with '' A1, A2 ''show'' $ a^{-1}\cdot b^{-1}\cdot c = c\cdot a^{-1}\cdot b^{-1}$, $ b^{-1}\cdot a^{-1}\cdot c = c\cdot a^{-1}\cdot b^{-1}$ ''using'' +++^[group0_4_L4A | AbelianGroup_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L4A</nowiki>: ''assumes '' $ P \text{ is commutative on } G$ ''and'' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot b\cdot c = c\cdot a\cdot b$,
$ a^{-1}\cdot (b^{-1}\cdot c^{-1})^{-1} = (a\cdot (b\cdot c)^{-1})^{-1}$,
$ a\cdot (b\cdot c)^{-1} = a\cdot b^{-1}\cdot c^{-1}$,
$ a\cdot (b\cdot c^{-1})^{-1} = a\cdot b^{-1}\cdot c$,
$ a\cdot b^{-1}\cdot c^{-1} = a\cdot c^{-1}\cdot b^{-1}$ ===
''from '' A1, A2, T ''show'' $ (a^{-1}\cdot b\cdot c)^{-1} = a\cdot b^{-1}\cdot c^{-1}$ ''using'' +++^[group_inv_of_three | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_three</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ (a\cdot b\cdot c)^{-1} = c^{-1}\cdot (a\cdot b)^{-1}$,
$ (a\cdot b\cdot c)^{-1} = c^{-1}\cdot (b^{-1}\cdot a^{-1})$,
$ (a\cdot b\cdot c)^{-1} = c^{-1}\cdot b^{-1}\cdot a^{-1}$ === , +++^[group_inv_of_inv | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_inv</nowiki>: ''assumes '' $ a\in G$ '' shows '' $ a = (a^{-1})^{-1}$ === , +++^[group0_4_L4C | AbelianGroup_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L4C</nowiki>: ''assumes '' $ P \text{ is commutative on } G$ ''and'' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot b\cdot c = c\cdot a\cdot b$, $ a\cdot b\cdot c = a\cdot (c\cdot b)$,
$ a\cdot b\cdot c = c\cdot (a\cdot b)$, $ a\cdot b\cdot c = c\cdot b\cdot a$ ===
''qed'' ===
Another rearrangement lemma with three elements and equation.
''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L5</nowiki>:
'' assumes '' A1: $ P \text{ is commutative on } G$ ''and '' A2: $ a\in G$, $ b\in G$, $ c\in G$ ''and '' A3: $ c = a\cdot b^{-1}$ '' shows '' $ a = b\cdot c$+++[proof ]>
''from '' A2, A3 ''have'' $ c\cdot (b^{-1})^{-1} = a$ ''using'' +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ === , +++^[group0_2_L18 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L18</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ ''and'' $ c = a\cdot b$ '' shows '' $ c\cdot b^{-1} = a$, $ a^{-1}\cdot c = b$ ===
''with '' A1, A2 ''show'' $ thesis$ ''using'' +++^[group_inv_of_inv | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_inv</nowiki>: ''assumes '' $ a\in G$ '' shows '' $ a = (a^{-1})^{-1}$ === , +++^[IsCommutative_def | func_ZF ]... Definition of <nowiki>IsCommutative</nowiki>:
$ f \text{ is commutative on } G \equiv \forall x\in G.\ \forall y\in G.\ f\langle x,y\rangle = f\langle y,x\rangle $===
''qed'' ===
In abelian groups we can cancel an element with its inverse even if separated by another element.
''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L6A</nowiki>:
'' assumes '' A1: $ P \text{ is commutative on } G$ ''and '' A2: $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b\cdot a^{-1} = b$, $ a^{-1}\cdot b\cdot a = b$, $ a^{-1}\cdot (b\cdot a) = b$, $ a\cdot (b\cdot a^{-1}) = b$+++[proof ]>
''from '' A1, A2 ''have'' $ a\cdot b\cdot a^{-1} = a^{-1}\cdot a\cdot b$ ''using'' +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ === , +++^[group0_4_L4A | AbelianGroup_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L4A</nowiki>: ''assumes '' $ P \text{ is commutative on } G$ ''and'' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot b\cdot c = c\cdot a\cdot b$,
$ a^{-1}\cdot (b^{-1}\cdot c^{-1})^{-1} = (a\cdot (b\cdot c)^{-1})^{-1}$,
$ a\cdot (b\cdot c)^{-1} = a\cdot b^{-1}\cdot c^{-1}$,
$ a\cdot (b\cdot c^{-1})^{-1} = a\cdot b^{-1}\cdot c$,
$ a\cdot b^{-1}\cdot c^{-1} = a\cdot c^{-1}\cdot b^{-1}$ ===
''also'' ''from '' A2 ''have'' $ \ldots = b$ ''using'' +++^[group0_2_L6 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L6</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x\cdot x^{-1} = 1 \wedge x^{-1}\cdot x = 1 $ === , +++^[group0_2_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L2</nowiki>: '' shows '' $ 1 \in G \wedge (\forall g\in G.\ (1 \cdot g = g \wedge g\cdot 1 = g))$ ===
''finally '' ''show'' $ a\cdot b\cdot a^{-1} = b$
''from '' A1, A2 ''have'' $ a^{-1}\cdot b\cdot a = a\cdot a^{-1}\cdot b$ ''using'' +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ === , +++^[group0_4_L4A | AbelianGroup_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L4A</nowiki>: ''assumes '' $ P \text{ is commutative on } G$ ''and'' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot b\cdot c = c\cdot a\cdot b$,
$ a^{-1}\cdot (b^{-1}\cdot c^{-1})^{-1} = (a\cdot (b\cdot c)^{-1})^{-1}$,
$ a\cdot (b\cdot c)^{-1} = a\cdot b^{-1}\cdot c^{-1}$,
$ a\cdot (b\cdot c^{-1})^{-1} = a\cdot b^{-1}\cdot c$,
$ a\cdot b^{-1}\cdot c^{-1} = a\cdot c^{-1}\cdot b^{-1}$ ===
''also'' ''from '' A2 ''have'' $ \ldots = b$ ''using'' +++^[group0_2_L6 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L6</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x\cdot x^{-1} = 1 \wedge x^{-1}\cdot x = 1 $ === , +++^[group0_2_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L2</nowiki>: '' shows '' $ 1 \in G \wedge (\forall g\in G.\ (1 \cdot g = g \wedge g\cdot 1 = g))$ ===
''finally '' ''show'' $ a^{-1}\cdot b\cdot a = b$
''moreover'' ''from '' A2 ''have'' $ a^{-1}\cdot b\cdot a = a^{-1}\cdot (b\cdot a)$ ''using'' +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ === , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''ultimately '' ''show'' $ a^{-1}\cdot (b\cdot a) = b$
''from '' A1, A2 ''show'' $ a\cdot (b\cdot a^{-1}) = b$ ''using'' +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ === , +++^[IsCommutative_def | func_ZF ]... Definition of <nowiki>IsCommutative</nowiki>:
$ f \text{ is commutative on } G \equiv \forall x\in G.\ \forall y\in G.\ f\langle x,y\rangle = f\langle y,x\rangle $=== , +++^[inv_cancel_two | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inv_cancel_two</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b^{-1}\cdot b = a$,
$ a\cdot b\cdot b^{-1} = a$, $ a^{-1}\cdot (a\cdot b) = b$, $ a\cdot (a^{-1}\cdot b) = b$ ===
''qed'' ===
Another lemma about cancelling with two elements.
''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L6AA</nowiki>:
'' assumes '' A1: $ P \text{ is commutative on } G$ ''and '' A2: $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b^{-1}\cdot a^{-1} = b^{-1}$ ''using'' <nowiki>prems</nowiki> , +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ === , +++^[group0_4_L6A | AbelianGroup_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L6A</nowiki>: ''assumes '' $ P \text{ is commutative on } G$ ''and'' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b\cdot a^{-1} = b$,
$ a^{-1}\cdot b\cdot a = b$, $ a^{-1}\cdot (b\cdot a) = b$, $ a\cdot (b\cdot a^{-1}) = b$ ===
Another lemma about cancelling with two elements.
''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L6AB</nowiki>:
'' assumes '' A1: $ P \text{ is commutative on } G$ ''and '' A2: $ a\in G$, $ b\in G$ '' shows '' $ a\cdot (a\cdot b)^{-1} = b^{-1}$, $ a\cdot (b\cdot a^{-1}) = b$+++[proof ]>
''from '' A2 ''have'' $ a\cdot (a\cdot b)^{-1} = a\cdot (b^{-1}\cdot a^{-1})$ ''using'' +++^[group_inv_of_two | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_two</nowiki>: ''assumes '' $ a\in G$ ''and'' $ b\in G$ '' shows '' $ b^{-1}\cdot a^{-1} = (a\cdot b)^{-1}$ ===
''also'' ''from '' A2 ''have'' $ \ldots = a\cdot b^{-1}\cdot a^{-1}$ ''using'' +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ === , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''also'' ''from '' A1, A2 ''have'' $ \ldots = b^{-1}$ ''using'' +++^[group0_4_L6AA | AbelianGroup_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L6AA</nowiki>: ''assumes '' $ P \text{ is commutative on } G$ ''and'' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b^{-1}\cdot a^{-1} = b^{-1}$ ===
''finally '' ''show'' $ a\cdot (a\cdot b)^{-1} = b^{-1}$
''from '' A1, A2 ''have'' $ a\cdot (b\cdot a^{-1}) = a\cdot (a^{-1}\cdot b)$ ''using'' +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ === , +++^[IsCommutative_def | func_ZF ]... Definition of <nowiki>IsCommutative</nowiki>:
$ f \text{ is commutative on } G \equiv \forall x\in G.\ \forall y\in G.\ f\langle x,y\rangle = f\langle y,x\rangle $===
''also'' ''from '' A2 ''have'' $ \ldots = b$ ''using'' +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ === , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ === , +++^[group0_2_L6 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L6</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x\cdot x^{-1} = 1 \wedge x^{-1}\cdot x = 1 $ === , +++^[group0_2_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L2</nowiki>: '' shows '' $ 1 \in G \wedge (\forall g\in G.\ (1 \cdot g = g \wedge g\cdot 1 = g))$ ===
''finally '' ''show'' $ a\cdot (b\cdot a^{-1}) = b$
''qed'' ===
Another lemma about cancelling with two elements.
''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L6AC</nowiki>:
'' assumes '' $ P \text{ is commutative on } G$ ''and '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot (a\cdot b^{-1})^{-1} = b$ ''using'' <nowiki>prems</nowiki> , +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ === , +++^[group0_4_L6AB | AbelianGroup_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L6AB</nowiki>: ''assumes '' $ P \text{ is commutative on } G$ ''and'' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot (a\cdot b)^{-1} = b^{-1}$, $ a\cdot (b\cdot a^{-1}) = b$ === , +++^[group_inv_of_inv | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_inv</nowiki>: ''assumes '' $ a\in G$ '' shows '' $ a = (a^{-1})^{-1}$ ===
In abelian groups we can cancel an element with its inverse even if separated by two other elements.
''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L6B</nowiki>:
'' assumes '' A1: $ P \text{ is commutative on } G$ ''and '' A2: $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot b\cdot c\cdot a^{-1} = b\cdot c$, $ a^{-1}\cdot b\cdot c\cdot a = b\cdot c$+++[proof ]>
''from '' A2 ''have'' $ a\cdot b\cdot c\cdot a^{-1} = a\cdot (b\cdot c)\cdot a^{-1}$, $ a^{-1}\cdot b\cdot c\cdot a = a^{-1}\cdot (b\cdot c)\cdot a$ ''using'' +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ === , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ === , +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ ===
''with '' A1, A2 ''show'' $ a\cdot b\cdot c\cdot a^{-1} = b\cdot c$, $ a^{-1}\cdot b\cdot c\cdot a = b\cdot c$ ''using'' +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ === , +++^[group0_4_L6A | AbelianGroup_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L6A</nowiki>: ''assumes '' $ P \text{ is commutative on } G$ ''and'' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b\cdot a^{-1} = b$,
$ a^{-1}\cdot b\cdot a = b$, $ a^{-1}\cdot (b\cdot a) = b$, $ a\cdot (b\cdot a^{-1}) = b$ ===
''qed'' ===
In abelian groups we can cancel an element with its inverse even if separated by three other elements.
''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L6C</nowiki>:
'' assumes '' A1: $ P \text{ is commutative on } G$ ''and '' A2: $ a\in G$, $ b\in G$, $ c\in G$, $ d\in G$ '' shows '' $ a\cdot b\cdot c\cdot d\cdot a^{-1} = b\cdot c\cdot d$+++[proof ]>
''from '' A2 ''have'' $ a\cdot b\cdot c\cdot d\cdot a^{-1} = a\cdot (b\cdot c\cdot d)\cdot a^{-1}$ ''using'' +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ === , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''with '' A1, A2 ''show'' $ thesis$ ''using'' +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ === , +++^[group0_4_L6A | AbelianGroup_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L6A</nowiki>: ''assumes '' $ P \text{ is commutative on } G$ ''and'' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b\cdot a^{-1} = b$,
$ a^{-1}\cdot b\cdot a = b$, $ a^{-1}\cdot (b\cdot a) = b$, $ a\cdot (b\cdot a^{-1}) = b$ ===
''qed'' ===
Another couple of useful rearrangements of three elements and cancelling.
''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L6D</nowiki>:
'' assumes '' A1: $ P \text{ is commutative on } G$ ''and '' A2: $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot b^{-1}\cdot (a\cdot c^{-1})^{-1} = c\cdot b^{-1}$, $ (a\cdot c)^{-1}\cdot (b\cdot c) = a^{-1}\cdot b$, $ a\cdot (b\cdot (c\cdot a^{-1}\cdot b^{-1})) = c$, $ a\cdot b\cdot c^{-1}\cdot (c\cdot a^{-1}) = b$+++[proof ]>
''from '' A2 ''have'' T: $ a^{-1} \in G$, $ b^{-1} \in G$, $ c^{-1} \in G$, $ a\cdot b \in G$, $ a\cdot b^{-1} \in G$, $ c^{-1}\cdot a^{-1} \in G$, $ c\cdot a^{-1} \in G$ ''using'' +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ === , +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ ===
''with '' A1, A2 ''show'' $ a\cdot b^{-1}\cdot (a\cdot c^{-1})^{-1} = c\cdot b^{-1}$ ''using'' +++^[group0_2_L12 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L12</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ (a\cdot b^{-1})^{-1} = b\cdot a^{-1}$, $ (a^{-1}\cdot b)^{-1} = b^{-1}\cdot a$ === , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ === , +++^[group0_4_L6B | AbelianGroup_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L6B</nowiki>: ''assumes '' $ P \text{ is commutative on } G$ ''and'' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot b\cdot c\cdot a^{-1} = b\cdot c$, $ a^{-1}\cdot b\cdot c\cdot a = b\cdot c$ === , +++^[IsCommutative_def | func_ZF ]... Definition of <nowiki>IsCommutative</nowiki>:
$ f \text{ is commutative on } G \equiv \forall x\in G.\ \forall y\in G.\ f\langle x,y\rangle = f\langle y,x\rangle $===
''from '' A2, T ''have'' $ (a\cdot c)^{-1}\cdot (b\cdot c) = c^{-1}\cdot a^{-1}\cdot b\cdot c$ ''using'' +++^[group_inv_of_two | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_two</nowiki>: ''assumes '' $ a\in G$ ''and'' $ b\in G$ '' shows '' $ b^{-1}\cdot a^{-1} = (a\cdot b)^{-1}$ === , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''also'' ''from '' A1, A2, T ''have'' $ \ldots = a^{-1}\cdot b$ ''using'' +++^[group0_4_L6B | AbelianGroup_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L6B</nowiki>: ''assumes '' $ P \text{ is commutative on } G$ ''and'' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot b\cdot c\cdot a^{-1} = b\cdot c$, $ a^{-1}\cdot b\cdot c\cdot a = b\cdot c$ ===
''finally '' ''show'' $ (a\cdot c)^{-1}\cdot (b\cdot c) = a^{-1}\cdot b$
''from '' A1, A2, T ''show'' $ a\cdot (b\cdot (c\cdot a^{-1}\cdot b^{-1})) = c$ ''using'' +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ === , +++^[group0_4_L6B | AbelianGroup_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L6B</nowiki>: ''assumes '' $ P \text{ is commutative on } G$ ''and'' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot b\cdot c\cdot a^{-1} = b\cdot c$, $ a^{-1}\cdot b\cdot c\cdot a = b\cdot c$ === , +++^[group0_4_L6A | AbelianGroup_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L6A</nowiki>: ''assumes '' $ P \text{ is commutative on } G$ ''and'' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b\cdot a^{-1} = b$,
$ a^{-1}\cdot b\cdot a = b$, $ a^{-1}\cdot (b\cdot a) = b$, $ a\cdot (b\cdot a^{-1}) = b$ ===
''from '' T ''have'' $ a\cdot b\cdot c^{-1}\cdot (c\cdot a^{-1}) = a\cdot b\cdot (c^{-1}\cdot (c\cdot a^{-1}))$ ''using'' +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''also'' ''from '' A1, A2, T ''have'' $ \ldots = b$ ''using'' +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ === , +++^[group0_2_L6 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L6</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x\cdot x^{-1} = 1 \wedge x^{-1}\cdot x = 1 $ === , +++^[group0_2_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L2</nowiki>: '' shows '' $ 1 \in G \wedge (\forall g\in G.\ (1 \cdot g = g \wedge g\cdot 1 = g))$ === , +++^[group0_4_L6A | AbelianGroup_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L6A</nowiki>: ''assumes '' $ P \text{ is commutative on } G$ ''and'' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b\cdot a^{-1} = b$,
$ a^{-1}\cdot b\cdot a = b$, $ a^{-1}\cdot (b\cdot a) = b$, $ a\cdot (b\cdot a^{-1}) = b$ ===
''finally '' ''show'' $ a\cdot b\cdot c^{-1}\cdot (c\cdot a^{-1}) = b$
''qed'' ===
Another useful rearrangement of three elements and cancelling.
''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L6E</nowiki>:
'' assumes '' A1: $ P \text{ is commutative on } G$ ''and '' A2: $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot b\cdot (a\cdot c)^{-1} = b\cdot c^{-1}$+++[proof ]>
''from '' A2 ''have'' T: $ b^{-1} \in G$, $ c^{-1} \in G$ ''using'' +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ ===
''with '' A1, A2 ''have'' $ a\cdot (b^{-1})^{-1}\cdot (a\cdot (c^{-1})^{-1})^{-1} = c^{-1}\cdot (b^{-1})^{-1}$ ''using'' +++^[group0_4_L6D | AbelianGroup_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L6D</nowiki>: ''assumes '' $ P \text{ is commutative on } G$ ''and'' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot b^{-1}\cdot (a\cdot c^{-1})^{-1} = c\cdot b^{-1}$,
$ (a\cdot c)^{-1}\cdot (b\cdot c) = a^{-1}\cdot b$,
$ a\cdot (b\cdot (c\cdot a^{-1}\cdot b^{-1})) = c$,
$ a\cdot b\cdot c^{-1}\cdot (c\cdot a^{-1}) = b$ ===
''with '' A1, A2, T ''show'' $ a\cdot b\cdot (a\cdot c)^{-1} = b\cdot c^{-1}$ ''using'' +++^[group_inv_of_inv | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_inv</nowiki>: ''assumes '' $ a\in G$ '' shows '' $ a = (a^{-1})^{-1}$ === , +++^[IsCommutative_def | func_ZF ]... Definition of <nowiki>IsCommutative</nowiki>:
$ f \text{ is commutative on } G \equiv \forall x\in G.\ \forall y\in G.\ f\langle x,y\rangle = f\langle y,x\rangle $===
''qed'' ===
A rearrangement with two elements and canceelling, special case of //group0_4_L6D// when $c=b^{-1}$.
''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L6F</nowiki>:
'' assumes '' A1: $ P \text{ is commutative on } G$ ''and '' A2: $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b^{-1}\cdot (a\cdot b)^{-1} = b^{-1}\cdot b^{-1}$+++[proof ]>
''from '' A2 ''have'' $ b^{-1} \in G$ ''using'' +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ ===
''with '' A1, A2 ''have'' $ a\cdot b^{-1}\cdot (a\cdot (b^{-1})^{-1})^{-1} = b^{-1}\cdot b^{-1}$ ''using'' +++^[group0_4_L6D | AbelianGroup_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L6D</nowiki>: ''assumes '' $ P \text{ is commutative on } G$ ''and'' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot b^{-1}\cdot (a\cdot c^{-1})^{-1} = c\cdot b^{-1}$,
$ (a\cdot c)^{-1}\cdot (b\cdot c) = a^{-1}\cdot b$,
$ a\cdot (b\cdot (c\cdot a^{-1}\cdot b^{-1})) = c$,
$ a\cdot b\cdot c^{-1}\cdot (c\cdot a^{-1}) = b$ ===
''with '' A2 ''show'' $ a\cdot b^{-1}\cdot (a\cdot b)^{-1} = b^{-1}\cdot b^{-1}$ ''using'' +++^[group_inv_of_inv | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_inv</nowiki>: ''assumes '' $ a\in G$ '' shows '' $ a = (a^{-1})^{-1}$ ===
''qed'' ===
Some other rearrangements with four elements. The algorithm for proof as in //group0_4_L2// works very well here.
''lemma'' ''(in'' group0'')'' <nowiki>rearr_ab_gr_4_elemA</nowiki>:
'' assumes '' A1: $ P \text{ is commutative on } G$ ''and '' A2: $ a\in G$, $ b\in G$, $ c\in G$, $ d\in G$ '' shows '' $ a\cdot b\cdot c\cdot d = a\cdot d\cdot b\cdot c$, $ a\cdot b\cdot c\cdot d = a\cdot c\cdot (b\cdot d)$+++[proof ]>
''from '' A1, A2 ''have'' $ a\cdot b\cdot c\cdot d = d\cdot (a\cdot b\cdot c)$ ''using'' +++^[IsCommutative_def | func_ZF ]... Definition of <nowiki>IsCommutative</nowiki>:
$ f \text{ is commutative on } G \equiv \forall x\in G.\ \forall y\in G.\ f\langle x,y\rangle = f\langle y,x\rangle $=== , +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ ===
''also'' ''from '' A2 ''have'' $ \ldots = d\cdot a\cdot b\cdot c$ ''using'' +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ === , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''also'' ''from '' A1, A2 ''have'' $ \ldots = a\cdot d\cdot b\cdot c$ ''using'' +++^[IsCommutative_def | func_ZF ]... Definition of <nowiki>IsCommutative</nowiki>:
$ f \text{ is commutative on } G \equiv \forall x\in G.\ \forall y\in G.\ f\langle x,y\rangle = f\langle y,x\rangle $=== , +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ ===
''finally '' ''show'' $ a\cdot b\cdot c\cdot d = a\cdot d\cdot b\cdot c$
''from '' A1, A2 ''have'' $ a\cdot b\cdot c\cdot d = c\cdot (a\cdot b)\cdot d$ ''using'' +++^[IsCommutative_def | func_ZF ]... Definition of <nowiki>IsCommutative</nowiki>:
$ f \text{ is commutative on } G \equiv \forall x\in G.\ \forall y\in G.\ f\langle x,y\rangle = f\langle y,x\rangle $=== , +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ ===
''also'' ''from '' A2 ''have'' $ \ldots = c\cdot a\cdot b\cdot d$ ''using'' +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ === , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''also'' ''from '' A1, A2 ''have'' $ \ldots = a\cdot c\cdot b\cdot d$ ''using'' +++^[IsCommutative_def | func_ZF ]... Definition of <nowiki>IsCommutative</nowiki>:
$ f \text{ is commutative on } G \equiv \forall x\in G.\ \forall y\in G.\ f\langle x,y\rangle = f\langle y,x\rangle $=== , +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ ===
''also'' ''from '' A2 ''have'' $ \ldots = a\cdot c\cdot (b\cdot d)$ ''using'' +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ === , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''finally '' ''show'' $ a\cdot b\cdot c\cdot d = a\cdot c\cdot (b\cdot d)$
''qed'' ===
Some rearrangements with four elements and inverse that are applications of //rearr_ab_gr_4_elem//
''lemma'' ''(in'' group0'')'' <nowiki>rearr_ab_gr_4_elemB</nowiki>:
'' assumes '' A1: $ P \text{ is commutative on } G$ ''and '' A2: $ a\in G$, $ b\in G$, $ c\in G$, $ d\in G$ '' shows '' $ a\cdot b^{-1}\cdot c^{-1}\cdot d^{-1} = a\cdot d^{-1}\cdot b^{-1}\cdot c^{-1}$, $ a\cdot b\cdot c\cdot d^{-1} = a\cdot d^{-1}\cdot b\cdot c$, $ a\cdot b\cdot c^{-1}\cdot d^{-1} = a\cdot c^{-1}\cdot (b\cdot d^{-1})$+++[proof ]>
''from '' A2 ''have'' T: $ b^{-1} \in G$, $ c^{-1} \in G$, $ d^{-1} \in G$ ''using'' +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ ===
''with '' A1, A2 ''show'' $ a\cdot b^{-1}\cdot c^{-1}\cdot d^{-1} = a\cdot d^{-1}\cdot b^{-1}\cdot c^{-1}$, $ a\cdot b\cdot c\cdot d^{-1} = a\cdot d^{-1}\cdot b\cdot c$, $ a\cdot b\cdot c^{-1}\cdot d^{-1} = a\cdot c^{-1}\cdot (b\cdot d^{-1})$ ''using'' +++^[rearr_ab_gr_4_elemA | AbelianGroup_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>rearr_ab_gr_4_elemA</nowiki>: ''assumes '' $ P \text{ is commutative on } G$ ''and'' $ a\in G$, $ b\in G$, $ c\in G$, $ d\in G$ '' shows '' $ a\cdot b\cdot c\cdot d = a\cdot d\cdot b\cdot c$,
$ a\cdot b\cdot c\cdot d = a\cdot c\cdot (b\cdot d)$ ===
''qed'' ===
Some rearrangement lemmas with four elements.
''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L7</nowiki>:
'' assumes '' A1: $ P \text{ is commutative on } G$ ''and '' A2: $ a\in G$, $ b\in G$, $ c\in G$, $ d\in G$ '' shows '' $ a\cdot b\cdot c\cdot d^{-1} = a\cdot d^{-1}\cdot b\cdot c$, $ a\cdot d\cdot (b\cdot d\cdot (c\cdot d))^{-1} = a\cdot (b\cdot c)^{-1}\cdot d^{-1}$, $ a\cdot (b\cdot c)\cdot d = a\cdot b\cdot d\cdot c$+++[proof ]>
''from '' A2 ''have'' T: $ b\cdot c \in G$, $ d^{-1} \in G$, $ b^{-1}\in G$, $ c^{-1}\in G$, $ d^{-1}\cdot b \in G$, $ c^{-1}\cdot d \in G$, $ (b\cdot c)^{-1} \in G$, $ b\cdot d \in G$, $ b\cdot d\cdot c \in G$, $ (b\cdot d\cdot c)^{-1} \in G$, $ a\cdot d \in G$, $ b\cdot c \in G$ ''using'' +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ === , +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ ===
''with '' A1, A2 ''have'' $ a\cdot b\cdot c\cdot d^{-1} = a\cdot (d^{-1}\cdot b\cdot c)$ ''using'' +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ === , +++^[group0_4_L4A | AbelianGroup_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L4A</nowiki>: ''assumes '' $ P \text{ is commutative on } G$ ''and'' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot b\cdot c = c\cdot a\cdot b$,
$ a^{-1}\cdot (b^{-1}\cdot c^{-1})^{-1} = (a\cdot (b\cdot c)^{-1})^{-1}$,
$ a\cdot (b\cdot c)^{-1} = a\cdot b^{-1}\cdot c^{-1}$,
$ a\cdot (b\cdot c^{-1})^{-1} = a\cdot b^{-1}\cdot c$,
$ a\cdot b^{-1}\cdot c^{-1} = a\cdot c^{-1}\cdot b^{-1}$ ===
''also'' ''from '' A2, T ''have'' $ a\cdot (d^{-1}\cdot b\cdot c) = a\cdot d^{-1}\cdot b\cdot c$ ''using'' +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''finally '' ''show'' $ a\cdot b\cdot c\cdot d^{-1} = a\cdot d^{-1}\cdot b\cdot c$
''from '' A2, T ''have'' $ a\cdot d\cdot (b\cdot d\cdot (c\cdot d))^{-1} = a\cdot d\cdot (d^{-1}\cdot (b\cdot d\cdot c)^{-1})$ ''using'' +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ === , +++^[group_inv_of_two | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_two</nowiki>: ''assumes '' $ a\in G$ ''and'' $ b\in G$ '' shows '' $ b^{-1}\cdot a^{-1} = (a\cdot b)^{-1}$ ===
''also'' ''from '' A2, T ''have'' $ \ldots = a\cdot (b\cdot d\cdot c)^{-1}$ ''using'' +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ === , +++^[inv_cancel_two | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inv_cancel_two</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b^{-1}\cdot b = a$,
$ a\cdot b\cdot b^{-1} = a$, $ a^{-1}\cdot (a\cdot b) = b$, $ a\cdot (a^{-1}\cdot b) = b$ ===
''also'' ''from '' A1, A2 ''have'' $ \ldots = a\cdot (d\cdot (b\cdot c))^{-1}$ ''using'' +++^[IsCommutative_def | func_ZF ]... Definition of <nowiki>IsCommutative</nowiki>:
$ f \text{ is commutative on } G \equiv \forall x\in G.\ \forall y\in G.\ f\langle x,y\rangle = f\langle y,x\rangle $=== , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''also'' ''from '' A2, T ''have'' $ \ldots = a\cdot ((b\cdot c)^{-1}\cdot d^{-1})$ ''using'' +++^[group_inv_of_two | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_two</nowiki>: ''assumes '' $ a\in G$ ''and'' $ b\in G$ '' shows '' $ b^{-1}\cdot a^{-1} = (a\cdot b)^{-1}$ ===
''also'' ''from '' A2, T ''have'' $ \ldots = a\cdot (b\cdot c)^{-1}\cdot d^{-1}$ ''using'' +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''finally '' ''show'' $ a\cdot d\cdot (b\cdot d\cdot (c\cdot d))^{-1} = a\cdot (b\cdot c)^{-1}\cdot d^{-1}$
''from '' A2 ''have'' $ a\cdot (b\cdot c)\cdot d = a\cdot (b\cdot (c\cdot d))$ ''using'' +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ === , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''also'' ''from '' A1, A2 ''have'' $ \ldots = a\cdot (b\cdot (d\cdot c))$ ''using'' +++^[IsCommutative_def | func_ZF ]... Definition of <nowiki>IsCommutative</nowiki>:
$ f \text{ is commutative on } G \equiv \forall x\in G.\ \forall y\in G.\ f\langle x,y\rangle = f\langle y,x\rangle $=== , +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ ===
''also'' ''from '' A2 ''have'' $ \ldots = a\cdot b\cdot d\cdot c$ ''using'' +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ === , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''finally '' ''show'' $ a\cdot (b\cdot c)\cdot d = a\cdot b\cdot d\cdot c$
''qed'' ===
Some other rearrangements with four elements.
''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L8</nowiki>:
'' assumes '' A1: $ P \text{ is commutative on } G$ ''and '' A2: $ a\in G$, $ b\in G$, $ c\in G$, $ d\in G$ '' shows '' $ a\cdot (b\cdot c)^{-1} = (a\cdot d^{-1}\cdot c^{-1})\cdot (d\cdot b^{-1})$, $ a\cdot b\cdot (c\cdot d) = c\cdot a\cdot (b\cdot d)$, $ a\cdot b\cdot (c\cdot d) = a\cdot c\cdot (b\cdot d)$, $ a\cdot (b\cdot c^{-1})\cdot d = a\cdot b\cdot d\cdot c^{-1}$, $ (a\cdot b)\cdot (c\cdot d)^{-1}\cdot (b\cdot d^{-1})^{-1} = a\cdot c^{-1}$+++[proof ]>
''from '' A2 ''have'' T: $ b\cdot c \in G$, $ a\cdot b \in G$, $ d^{-1} \in G$, $ b^{-1}\in G$, $ c^{-1}\in G$, $ d^{-1}\cdot b \in G$, $ c^{-1}\cdot d \in G$, $ (b\cdot c)^{-1} \in G$, $ a\cdot b \in G$, $ (c\cdot d)^{-1} \in G$, $ (b\cdot d^{-1})^{-1} \in G$, $ d\cdot b^{-1} \in G$ ''using'' +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ === , +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ ===
''from '' A2 ''have'' $ a\cdot (b\cdot c)^{-1} = a\cdot c^{-1}\cdot b^{-1}$ ''using'' +++^[group0_2_L14A | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L14A</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot c^{-1}= (a\cdot b^{-1})\cdot (b\cdot c^{-1})$,
$ a^{-1}\cdot c = (a^{-1}\cdot b)\cdot (b^{-1}\cdot c)$,
$ a\cdot (b\cdot c)^{-1} = a\cdot c^{-1}\cdot b^{-1}$,
$ a\cdot (b\cdot c^{-1}) = a\cdot b\cdot c^{-1}$,
$ (a\cdot b^{-1}\cdot c^{-1})^{-1} = c\cdot b\cdot a^{-1}$,
$ a\cdot b\cdot c^{-1}\cdot (c\cdot b^{-1}) = a$, $ a\cdot (b\cdot c)\cdot c^{-1} = a\cdot b$ ===
''moreover'' ''from '' A2 ''have'' $ a\cdot c^{-1} = (a\cdot d^{-1})\cdot (d\cdot c^{-1})$ ''using'' +++^[group0_2_L14A | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L14A</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot c^{-1}= (a\cdot b^{-1})\cdot (b\cdot c^{-1})$,
$ a^{-1}\cdot c = (a^{-1}\cdot b)\cdot (b^{-1}\cdot c)$,
$ a\cdot (b\cdot c)^{-1} = a\cdot c^{-1}\cdot b^{-1}$,
$ a\cdot (b\cdot c^{-1}) = a\cdot b\cdot c^{-1}$,
$ (a\cdot b^{-1}\cdot c^{-1})^{-1} = c\cdot b\cdot a^{-1}$,
$ a\cdot b\cdot c^{-1}\cdot (c\cdot b^{-1}) = a$, $ a\cdot (b\cdot c)\cdot c^{-1} = a\cdot b$ ===
''ultimately '' ''have'' $ a\cdot (b\cdot c)^{-1} = (a\cdot d^{-1})\cdot (d\cdot c^{-1})\cdot b^{-1}$
''with '' A1, A2, T ''have'' $ a\cdot (b\cdot c)^{-1}= a\cdot d^{-1}\cdot (c^{-1}\cdot d)\cdot b^{-1}$ ''using'' +++^[IsCommutative_def | func_ZF ]... Definition of <nowiki>IsCommutative</nowiki>:
$ f \text{ is commutative on } G \equiv \forall x\in G.\ \forall y\in G.\ f\langle x,y\rangle = f\langle y,x\rangle $===
''with '' A2, T ''show'' $ a\cdot (b\cdot c)^{-1} = (a\cdot d^{-1}\cdot c^{-1})\cdot (d\cdot b^{-1})$ ''using'' +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ === , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''from '' A2, T ''have'' $ a\cdot b\cdot (c\cdot d) = a\cdot b\cdot c\cdot d$ ''using'' +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''also'' ''have'' $ a\cdot b\cdot c\cdot d = c\cdot a\cdot b\cdot d$+++[proof ]>
''from '' A1, A2 ''have'' $ a\cdot b\cdot c\cdot d = c\cdot (a\cdot b)\cdot d$ ''using'' +++^[IsCommutative_def | func_ZF ]... Definition of <nowiki>IsCommutative</nowiki>:
$ f \text{ is commutative on } G \equiv \forall x\in G.\ \forall y\in G.\ f\langle x,y\rangle = f\langle y,x\rangle $=== , +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ ===
''also'' ''from '' A2 ''have'' $ \ldots = c\cdot a\cdot b\cdot d$ ''using'' +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ === , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''finally '' ''show'' $ thesis$
''qed'' ===
''also'' ''from '' A2 ''have'' $ c\cdot a\cdot b\cdot d = c\cdot a\cdot (b\cdot d)$ ''using'' +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ === , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''finally '' ''show'' $ a\cdot b\cdot (c\cdot d) = c\cdot a\cdot (b\cdot d)$
''with '' A1, A2 ''show'' $ a\cdot b\cdot (c\cdot d) = a\cdot c\cdot (b\cdot d)$ ''using'' +++^[IsCommutative_def | func_ZF ]... Definition of <nowiki>IsCommutative</nowiki>:
$ f \text{ is commutative on } G \equiv \forall x\in G.\ \forall y\in G.\ f\langle x,y\rangle = f\langle y,x\rangle $===
''from '' A1, A2, T ''show'' $ a\cdot (b\cdot c^{-1})\cdot d = a\cdot b\cdot d\cdot c^{-1}$ ''using'' +++^[group0_4_L7 | AbelianGroup_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L7</nowiki>: ''assumes '' $ P \text{ is commutative on } G$ ''and'' $ a\in G$, $ b\in G$, $ c\in G$, $ d\in G$ '' shows '' $ a\cdot b\cdot c\cdot d^{-1} = a\cdot d^{-1}\cdot b\cdot c$,
$ a\cdot d\cdot (b\cdot d\cdot (c\cdot d))^{-1} = a\cdot (b\cdot c)^{-1}\cdot d^{-1}$,
$ a\cdot (b\cdot c)\cdot d = a\cdot b\cdot d\cdot c$ ===
''from '' T ''have'' $ (a\cdot b)\cdot (c\cdot d)^{-1}\cdot (b\cdot d^{-1})^{-1} = (a\cdot b)\cdot ((c\cdot d)^{-1}\cdot (b\cdot d^{-1})^{-1})$ ''using'' +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''also'' ''from '' A1, A2, T ''have'' $ \ldots = (a\cdot b)\cdot (c^{-1}\cdot d^{-1}\cdot (d\cdot b^{-1}))$ ''using'' +++^[group_inv_of_two | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_two</nowiki>: ''assumes '' $ a\in G$ ''and'' $ b\in G$ '' shows '' $ b^{-1}\cdot a^{-1} = (a\cdot b)^{-1}$ === , +++^[group0_2_L12 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L12</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ (a\cdot b^{-1})^{-1} = b\cdot a^{-1}$, $ (a^{-1}\cdot b)^{-1} = b^{-1}\cdot a$ === , +++^[IsCommutative_def | func_ZF ]... Definition of <nowiki>IsCommutative</nowiki>:
$ f \text{ is commutative on } G \equiv \forall x\in G.\ \forall y\in G.\ f\langle x,y\rangle = f\langle y,x\rangle $===
''also'' ''from '' T ''have'' $ \ldots = (a\cdot b)\cdot (c^{-1}\cdot (d^{-1}\cdot (d\cdot b^{-1})))$ ''using'' +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''also'' ''from '' A1, A2, T ''have'' $ \ldots = a\cdot c^{-1}$ ''using'' +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ === , +++^[group0_2_L6 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L6</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x\cdot x^{-1} = 1 \wedge x^{-1}\cdot x = 1 $ === , +++^[group0_2_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L2</nowiki>: '' shows '' $ 1 \in G \wedge (\forall g\in G.\ (1 \cdot g = g \wedge g\cdot 1 = g))$ === , +++^[IsCommutative_def | func_ZF ]... Definition of <nowiki>IsCommutative</nowiki>:
$ f \text{ is commutative on } G \equiv \forall x\in G.\ \forall y\in G.\ f\langle x,y\rangle = f\langle y,x\rangle $=== , +++^[inv_cancel_two | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inv_cancel_two</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b^{-1}\cdot b = a$,
$ a\cdot b\cdot b^{-1} = a$, $ a^{-1}\cdot (a\cdot b) = b$, $ a\cdot (a^{-1}\cdot b) = b$ ===
''finally '' ''show'' $ (a\cdot b)\cdot (c\cdot d)^{-1}\cdot (b\cdot d^{-1})^{-1} = a\cdot c^{-1}$
''qed'' ===
Some other rearrangements with four elements.
''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L8A</nowiki>:
'' assumes '' A1: $ P \text{ is commutative on } G$ ''and '' A2: $ a\in G$, $ b\in G$, $ c\in G$, $ d\in G$ '' shows '' $ a\cdot b^{-1}\cdot (c\cdot d^{-1}) = a\cdot c\cdot (b^{-1}\cdot d^{-1})$, $ a\cdot b^{-1}\cdot (c\cdot d^{-1}) = a\cdot c\cdot b^{-1}\cdot d^{-1}$+++[proof ]>
''from '' A2 ''have'' T: $ a\in G$, $ b^{-1} \in G$, $ c\in G$, $ d^{-1} \in G$ ''using'' +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ ===
''with '' A1 ''show'' $ a\cdot b^{-1}\cdot (c\cdot d^{-1}) = a\cdot c\cdot (b^{-1}\cdot d^{-1})$ '' by (rule '' +++^[group0_4_L8 | AbelianGroup_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L8</nowiki>: ''assumes '' $ P \text{ is commutative on } G$ ''and'' $ a\in G$, $ b\in G$, $ c\in G$, $ d\in G$ '' shows '' $ a\cdot (b\cdot c)^{-1} = (a\cdot d^{-1}\cdot c^{-1})\cdot (d\cdot b^{-1})$,
$ a\cdot b\cdot (c\cdot d) = c\cdot a\cdot (b\cdot d)$,
$ a\cdot b\cdot (c\cdot d) = a\cdot c\cdot (b\cdot d)$,
$ a\cdot (b\cdot c^{-1})\cdot d = a\cdot b\cdot d\cdot c^{-1}$,
$ (a\cdot b)\cdot (c\cdot d)^{-1}\cdot (b\cdot d^{-1})^{-1} = a\cdot c^{-1}$ === '')''
''with '' A2, T ''show'' $ a\cdot b^{-1}\cdot (c\cdot d^{-1}) = a\cdot c\cdot b^{-1}\cdot d^{-1}$ ''using'' +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ === , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''qed'' ===
Some rearrangements with an equation.
''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L9</nowiki>:
'' assumes '' A1: $ P \text{ is commutative on } G$ ''and '' A2: $ a\in G$, $ b\in G$, $ c\in G$, $ d\in G$ ''and '' A3: $ a = b\cdot c^{-1}\cdot d^{-1}$ '' shows '' $ d = b\cdot a^{-1}\cdot c^{-1}$, $ d = a^{-1}\cdot b\cdot c^{-1}$, $ b = a\cdot d\cdot c$+++[proof ]>
''from '' A2 ''have'' T: $ a^{-1} \in G$, $ c^{-1} \in G$, $ d^{-1} \in G$, $ b\cdot c^{-1} \in G$ ''using'' +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ === , +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ ===
''with '' A2, A3 ''have'' $ a\cdot (d^{-1})^{-1} = b\cdot c^{-1}$ ''using'' +++^[group0_2_L18 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L18</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ ''and'' $ c = a\cdot b$ '' shows '' $ c\cdot b^{-1} = a$, $ a^{-1}\cdot c = b$ ===
''with '' A2 ''have'' $ b\cdot c^{-1} = a\cdot d$ ''using'' +++^[group_inv_of_inv | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_inv</nowiki>: ''assumes '' $ a\in G$ '' shows '' $ a = (a^{-1})^{-1}$ ===
''with '' A2, T ''have'' I: $ a^{-1}\cdot (b\cdot c^{-1}) = d$ ''using'' +++^[group0_2_L18 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L18</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ ''and'' $ c = a\cdot b$ '' shows '' $ c\cdot b^{-1} = a$, $ a^{-1}\cdot c = b$ ===
''with '' A1, A2, T ''show'' $ d = b\cdot a^{-1}\cdot c^{-1}$, $ d = a^{-1}\cdot b\cdot c^{-1}$ ''using'' +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ === , +++^[IsCommutative_def | func_ZF ]... Definition of <nowiki>IsCommutative</nowiki>:
$ f \text{ is commutative on } G \equiv \forall x\in G.\ \forall y\in G.\ f\langle x,y\rangle = f\langle y,x\rangle $===
''from '' A3 ''have'' $ a\cdot d\cdot c = (b\cdot c^{-1}\cdot d^{-1})\cdot d\cdot c$
''also'' ''from '' A2, T ''have'' $ \ldots = b\cdot c^{-1}\cdot (d^{-1}\cdot d)\cdot c$ ''using'' +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''also'' ''from '' A2, T ''have'' $ \ldots = b\cdot c^{-1}\cdot c$ ''using'' +++^[group0_2_L6 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L6</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x\cdot x^{-1} = 1 \wedge x^{-1}\cdot x = 1 $ === , +++^[group0_2_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L2</nowiki>: '' shows '' $ 1 \in G \wedge (\forall g\in G.\ (1 \cdot g = g \wedge g\cdot 1 = g))$ ===
''also'' ''from '' A2, T ''have'' $ \ldots = b\cdot (c^{-1}\cdot c)$ ''using'' +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''also'' ''from '' A2 ''have'' $ \ldots = b$ ''using'' +++^[group0_2_L6 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L6</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x\cdot x^{-1} = 1 \wedge x^{-1}\cdot x = 1 $ === , +++^[group0_2_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L2</nowiki>: '' shows '' $ 1 \in G \wedge (\forall g\in G.\ (1 \cdot g = g \wedge g\cdot 1 = g))$ ===
''finally '' ''have'' $ a\cdot d\cdot c = b$
''thus'' $ b = a\cdot d\cdot c$
''qed'' ===
''end
'' +++![Comments on AbelianGroup_ZF|click to add comment] <html> <div> <iframe style="width:60%;height:500px" src="http://www.haloscan.com/comments/slawekk/AbelianGroup_ZF"></iframe> </div> </html>
===
This site is an experimental [[TiddlyWiki|http://www.tiddlywiki.com/]] rendering of fragments of the [[IsarMathLib| http://www.nongnu.org/isarmathlib/]] project. IsarMathLib is a library of mathematical proofs formally verified by the [[Isabelle|http://www.cl.cam.ac.uk/research/hvg/Isabelle/ ]] theorem proving environment. The formalization is based on the [[Zermelo-Fraenkel set theory|http://en.wikipedia.org/wiki/Zermelo%E2%80%93Fraenkel_set_theory ]].
The software for translating Isabelle's Isar language to <nowiki>TiddlyWiki</nowiki> markup is at the early alpha stage, so some proofs may be rendered incorrectly. In case of doubts, compare with the Isabelle generated IsarMathLib [[proof document|http://www.nongnu.org/isarmathlib/IsarMathLib/document.pdf]].
The content of this page by Sławomir Kołodyński (other than the standard <nowiki>TiddlyWiki</nowiki> content) is licensed under a [[Creative Commons Attribution 3.0 License | http://creativecommons.org/licenses/by/3.0/us/]].
+++[Comments|click to leave comment]
<html> <div> <iframe style="width:70%;height:400px" src="http://www.haloscan.com/comments/slawekk/tiddlyformalmath"></iframe> </div> </html>
This document has been created from a ~TiddlyWiki from tiddlyspot.com. A ~TiddlyWiki is an electronic notebook that is great for managing todo lists, personal information, and all sorts of things.
This tiddler is for me, the author of this TiddlyWiki. Here I can configure privacy and other site settings at my [[control panel|http://formalmath.tiddlyspot.com/controlpanel]] (my control panel username is //formalmath//).
<<tiddler TspotControls>>
See also GettingStarted.
''theory'' DirectProduct_ZF ''imports'' [[func_ZF]]
''begin
''
This theory considers the direct product of binary operations. Contributed by Seo Sanghyeon.
!Definition
In group theory the notion of direct product provides a natural way of creating a new group from two given groups.
Given $(G,\cdot)$ and $(H,\circ)$ a new operation $(G\times H, \times )$ is defined as $(g, h) \times (g', h') = (g \cdot g', h \circ h')$.
''Definition
'' $ DirectProduct(P,Q,G,H) \equiv $
$ \{\langle x,\langle P\langle fst(fst(x)),fst(snd(x))\rangle , Q\langle snd(fst(x)),snd(snd(x))\rangle \rangle \rangle .\ $
$ x \in (G\times H)\times (G\times H)\}$
We define a context called //direct0// which holds an assumtion that $P, Q$ are binary operations on $G,H$, resp. and denotes $R$ as the direct product of $(G,P)$ and $(H,Q)$.
''Locale '' direct0
''assumes '' Pfun: $ P : G\times G\rightarrow G$
''assumes '' Qfun: $ Q : H\times H\rightarrow H$
''defines '' $ R \equiv DirectProduct(P,Q,G,H)$
The direct product of binary operations is a binary operation.
''lemma'' ''(in'' direct0'')'' <nowiki>DirectProduct_ZF_1_L1</nowiki>:
'' shows '' $ R : (G\times H)\times (G\times H)\rightarrow G\times H$+++[proof ]>
''from '' Pfun, Qfun ''have'' $ \forall x\in (G\times H)\times (G\times H).\ $
$ \langle P\langle fst(fst(x)),fst(snd(x))\rangle ,Q\langle snd(fst(x)),snd(snd(x))\rangle \rangle \in G\times H$
''then '' ''show'' $ thesis$ ''using'' +++^[ZF_fun_from_total | func1 ]... ''lemma'' <nowiki>ZF_fun_from_total</nowiki>: ''assumes '' $ \forall x\in X.\ b(x) \in Y$ '' shows '' $ \{\langle x,b(x)\rangle .\ x\in X\} : X\rightarrow Y$ === , +++^[DirectProduct_def | DirectProduct_ZF ]... Definition of <nowiki>DirectProduct</nowiki>:
$ DirectProduct(P,Q,G,H) \equiv $
$ \{\langle x,\langle P\langle fst(fst(x)),fst(snd(x))\rangle , Q\langle snd(fst(x)),snd(snd(x))\rangle \rangle \rangle .\ $
$ x \in (G\times H)\times (G\times H)\}$===
''qed'' ===
And it has the intended value.
''lemma'' ''(in'' direct0'')'' <nowiki>DirectProduct_ZF_1_L2</nowiki>:
'' shows '' $ \forall x\in (G\times H).\ \forall y\in (G\times H).\ $
$ R\langle x,y\rangle = \langle P\langle fst(x),fst(y)\rangle ,Q\langle snd(x),snd(y)\rangle \rangle $ ''using'' +++^[DirectProduct_def | DirectProduct_ZF ]... Definition of <nowiki>DirectProduct</nowiki>:
$ DirectProduct(P,Q,G,H) \equiv $
$ \{\langle x,\langle P\langle fst(fst(x)),fst(snd(x))\rangle , Q\langle snd(fst(x)),snd(snd(x))\rangle \rangle \rangle .\ $
$ x \in (G\times H)\times (G\times H)\}$=== , +++^[DirectProduct_ZF_1_L1 | DirectProduct_ZF ]... ''lemma'' ''(in'' direct0'')'' <nowiki>DirectProduct_ZF_1_L1</nowiki>: '' shows '' $ R : (G\times H)\times (G\times H)\rightarrow G\times H$ === , +++^[ZF_fun_from_tot_val | func1 ]... ''lemma'' <nowiki>ZF_fun_from_tot_val</nowiki>: ''assumes '' $ f:X\rightarrow Y$, $ x\in X$ ''and'' $ f = \{\langle x,b(x)\rangle .\ x\in X\}$ '' shows '' $ f(x) = b(x)$ ===
And the value belongs to the set the operation is defined on.
''lemma'' ''(in'' direct0'')'' <nowiki>DirectProduct_ZF_1_L3</nowiki>:
'' shows '' $ \forall x\in (G\times H).\ \forall y\in (G\times H).\ R\langle x,y\rangle \in G\times H$ ''using'' +++^[DirectProduct_ZF_1_L1 | DirectProduct_ZF ]... ''lemma'' ''(in'' direct0'')'' <nowiki>DirectProduct_ZF_1_L1</nowiki>: '' shows '' $ R : (G\times H)\times (G\times H)\rightarrow G\times H$ ===
!Associative and commutative operations
If P and Q are both associative or commutative operations, the direct product of P and Q has the same property.
Direct product of commutative operations is commutative.
''lemma'' ''(in'' direct0'')'' <nowiki>DirectProduct_ZF_2_L1</nowiki>:
'' assumes '' $ P \text{ is commutative on } G$ ''and '' $ Q \text{ is commutative on } H$ '' shows '' $ R \text{ is commutative on } G\times H$+++[proof ]>
''from '' assms ''have'' $ \forall x\in (G\times H).\ \forall y\in (G\times H).\ R\langle x,y\rangle = R\langle y,x\rangle $ ''using'' +++^[DirectProduct_ZF_1_L2 | DirectProduct_ZF ]... ''lemma'' ''(in'' direct0'')'' <nowiki>DirectProduct_ZF_1_L2</nowiki>: '' shows '' $ \forall x\in (G\times H).\ \forall y\in (G\times H).\ $
$ R\langle x,y\rangle = \langle P\langle fst(x),fst(y)\rangle ,Q\langle snd(x),snd(y)\rangle \rangle $
=== , +++^[IsCommutative_def | func_ZF ]... Definition of <nowiki>IsCommutative</nowiki>:
$ f \text{ is commutative on } G \equiv \forall x\in G.\ \forall y\in G.\ f\langle x,y\rangle = f\langle y,x\rangle $===
''then '' ''show'' $ thesis$ ''using'' +++^[IsCommutative_def | func_ZF ]... Definition of <nowiki>IsCommutative</nowiki>:
$ f \text{ is commutative on } G \equiv \forall x\in G.\ \forall y\in G.\ f\langle x,y\rangle = f\langle y,x\rangle $===
''qed'' ===
Direct product of associative operations is associative.
''lemma'' ''(in'' direct0'')'' <nowiki>DirectProduct_ZF_2_L2</nowiki>:
'' assumes '' $ P \text{ is associative on } G$ ''and '' $ Q \text{ is associative on } H$ '' shows '' $ R \text{ is associative on } G\times H$+++[proof ]>
''have'' $ \forall x\in G\times H.\ \forall y\in G\times H.\ \forall z\in G\times H.\ R\langle R\langle x,y\rangle ,z\rangle =$
$ \langle P\langle P\langle fst(x),fst(y)\rangle ,fst(z)\rangle ,Q\langle Q\langle snd(x),snd(y)\rangle ,snd(z)\rangle \rangle $ ''using'' +++^[DirectProduct_ZF_1_L2 | DirectProduct_ZF ]... ''lemma'' ''(in'' direct0'')'' <nowiki>DirectProduct_ZF_1_L2</nowiki>: '' shows '' $ \forall x\in (G\times H).\ \forall y\in (G\times H).\ $
$ R\langle x,y\rangle = \langle P\langle fst(x),fst(y)\rangle ,Q\langle snd(x),snd(y)\rangle \rangle $
=== , +++^[DirectProduct_ZF_1_L3 | DirectProduct_ZF ]... ''lemma'' ''(in'' direct0'')'' <nowiki>DirectProduct_ZF_1_L3</nowiki>: '' shows '' $ \forall x\in (G\times H).\ \forall y\in (G\times H).\ R\langle x,y\rangle \in G\times H$ ===
''moreover'' ''have'' $ \forall x\in G\times H.\ \forall y\in G\times H.\ \forall z\in G\times H.\ R\langle x,R\langle y,z\rangle \rangle =$
$ \langle P\langle fst(x),P\langle fst(y),fst(z)\rangle \rangle ,Q\langle snd(x),Q\langle snd(y),snd(z)\rangle \rangle \rangle $ ''using'' +++^[DirectProduct_ZF_1_L2 | DirectProduct_ZF ]... ''lemma'' ''(in'' direct0'')'' <nowiki>DirectProduct_ZF_1_L2</nowiki>: '' shows '' $ \forall x\in (G\times H).\ \forall y\in (G\times H).\ $
$ R\langle x,y\rangle = \langle P\langle fst(x),fst(y)\rangle ,Q\langle snd(x),snd(y)\rangle \rangle $
=== , +++^[DirectProduct_ZF_1_L3 | DirectProduct_ZF ]... ''lemma'' ''(in'' direct0'')'' <nowiki>DirectProduct_ZF_1_L3</nowiki>: '' shows '' $ \forall x\in (G\times H).\ \forall y\in (G\times H).\ R\langle x,y\rangle \in G\times H$ ===
''ultimately '' ''have'' $ \forall x\in G\times H.\ \forall y\in G\times H.\ \forall z\in G\times H.\ R\langle R\langle x,y\rangle ,z\rangle = R\langle x,R\langle y,z\rangle \rangle $ ''using'' <nowiki>assms</nowiki> , +++^[IsAssociative_def | func_ZF ]... Definition of <nowiki>IsAssociative</nowiki>:
$ P \text{ is associative on } G \equiv P : G\times G\rightarrow G \wedge $
$ (\forall x \in G.\ \forall y \in G.\ \forall z \in G.\ $
$ ( P(\langle P(\langle x,y\rangle ),z\rangle ) = P( \langle x,P(\langle y,z\rangle )\rangle )))$===
''then '' ''show'' $ thesis$ ''using'' +++^[DirectProduct_ZF_1_L1 | DirectProduct_ZF ]... ''lemma'' ''(in'' direct0'')'' <nowiki>DirectProduct_ZF_1_L1</nowiki>: '' shows '' $ R : (G\times H)\times (G\times H)\rightarrow G\times H$ === , +++^[IsAssociative_def | func_ZF ]... Definition of <nowiki>IsAssociative</nowiki>:
$ P \text{ is associative on } G \equiv P : G\times G\rightarrow G \wedge $
$ (\forall x \in G.\ \forall y \in G.\ \forall z \in G.\ $
$ ( P(\langle P(\langle x,y\rangle ),z\rangle ) = P( \langle x,P(\langle y,z\rangle )\rangle )))$===
''qed'' ===
''end
'' +++![Comments on DirectProduct_ZF|click to add comment] <html> <div> <iframe style="width:60%;height:500px" src="http://www.haloscan.com/comments/slawekk/DirectProduct_ZF"></iframe> </div> </html>
===
''theory'' EquivClass1 ''imports'' [[EquivClass]] [[func_ZF]] [[ZF1]]
''begin
''
In this theory file we extend the work on equivalence relations done in the standard Isabelle's EquivClass theory. That development is very good and all, but we really would prefer an approach contained within the a standard ZF set theory, without extensions specific to Isabelle. That is why this theory is written.
!Congruent functions and projections on the quotient
Suppose we have a set $X$ with a relation $r\subseteq X\times X$ and a function $f: X\rightarrow X$. The function $f$ can be compatible (congruent) with $r$ in the sense that if two elements $x,y$ are related then the values $f(x), f(x)$ are also related. This is especially useful if $r$ is an equivalence relation as it allows to "project" the function to the quotient space $X/r$ (the set of equivalence classes of $r$) and create a new function $F$ that satifies the formula $F([x]_r) = [f(x)]_r$. When $f$ is congruent with respect to $r$ such definition of the value of $F$ on the equivalence class $[x]_r$ does not depend on which $x$ we choose to represent the class. In this section we also consider binary operations that are congruent with respect to a relation. These are important in algebra - the congruency condition allows to project the operation to obtain the operation on the quotient space.
First we define the notion of function that maps equivalent elements to equivalent values. We use similar names as in the Isabelle's standard //EquivClass// theory to indicate the conceptual correspondence of the notions.
''Definition
'' $ Congruent(r,f) \equiv $
$ (\forall x y.\ \langle x,y\rangle \in r \longrightarrow \langle f(x),f(y)\rangle \in r)$
Now we will define the projection of a function onto the quotient space. In standard math the equivalence class of $x$ with respect to relation $r$ is usually denoted $[x]_r$. Here we reuse notation $r\{ x\}$ instead. This means the image of the set $\{ x\}$ with respect to the relation, which, for equivalence relations is exactly its equivalence class if you think about it.
''Definition
'' $ ProjFun(A,r,f) \equiv $
$ \{\langle c,\bigcup x\in c.\ r\{f(x)\}\rangle .\ c \in (A//r)\}$
Elements of equivalence classes belong to the set.
''lemma'' <nowiki>EquivClass_1_L1</nowiki>:
'' assumes '' A1: $ equiv(A,r)$ ''and '' A2: $ C \in A//r$ ''and '' A3: $ x\in C$ '' shows '' $ x\in A$+++[proof ]>
''from '' A2 ''have'' $ C \subseteq \bigcup (A//r)$
''with '' A1, A3 ''show'' $ x\in A$ ''using'' <nowiki>Union_quotient</nowiki>
''qed'' ===
The image of a subset of $X$ under projection is a subset of $A/r$.
''lemma'' <nowiki>EquivClass_1_L1A</nowiki>:
'' assumes '' $ A\subseteq X$ '' shows '' $ \{r\{x\}.\ x\in A\} \subseteq X//r$ ''using'' <nowiki>prems</nowiki> , <nowiki>quotientI</nowiki>
If an element belongs to an equivalence class, then its image under relation is this equivalence class.
''lemma'' <nowiki>EquivClass_1_L2</nowiki>:
'' assumes '' A1: $ equiv(A,r)$, $ C \in A//r$ ''and '' A2: $ x\in C$ '' shows '' $ r\{x\} = C$+++[proof ]>
''from '' A1, A2 ''have'' $ x \in r\{x\}$ ''using'' +++^[EquivClass_1_L1 | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_1_L1</nowiki>: ''assumes '' $ equiv(A,r)$ ''and'' $ C \in A//r$ ''and'' $ x\in C$ '' shows '' $ x\in A$ === , <nowiki>equiv_class_self</nowiki>
''with '' A2 ''have'' I: $ r\{x\}\cap C \neq 0$
''from '' A1, A2 ''have'' $ r\{x\} \in A//r$ ''using'' +++^[EquivClass_1_L1 | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_1_L1</nowiki>: ''assumes '' $ equiv(A,r)$ ''and'' $ C \in A//r$ ''and'' $ x\in C$ '' shows '' $ x\in A$ === , <nowiki>quotientI</nowiki>
''with '' A1, I ''show'' $ thesis$ ''using'' <nowiki>quotient_disj</nowiki>
''qed'' ===
Elements that belong to the same equivalence class are equivalent.
''lemma'' <nowiki>EquivClass_1_L2A</nowiki>:
'' assumes '' $ equiv(A,r)$, $ C \in A//r$, $ x\in C$, $ y\in C$ '' shows '' $ \langle x,y\rangle \in r$ ''using'' <nowiki>assms</nowiki> , +++^[EquivClass_1_L2 | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_1_L2</nowiki>: ''assumes '' $ equiv(A,r)$, $ C \in A//r$ ''and'' $ x\in C$ '' shows '' $ r\{x\} = C$ === , +++^[EquivClass_1_L1 | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_1_L1</nowiki>: ''assumes '' $ equiv(A,r)$ ''and'' $ C \in A//r$ ''and'' $ x\in C$ '' shows '' $ x\in A$ === , <nowiki>equiv_class_eq_iff</nowiki>
Every $x$ is in the class of $y$, then they are equivalent.
''lemma'' <nowiki>EquivClass_1_L2B</nowiki>:
'' assumes '' A1: $ equiv(A,r)$ ''and '' A2: $ y\in A$ ''and '' A3: $ x \in r\{y\}$ '' shows '' $ \langle x,y\rangle \in r$+++[proof ]>
''from '' A2 ''have'' $ r\{y\} \in A//r$ ''using'' <nowiki>quotientI</nowiki>
''with '' A1, A3 ''show'' $ thesis$ ''using'' +++^[EquivClass_1_L1 | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_1_L1</nowiki>: ''assumes '' $ equiv(A,r)$ ''and'' $ C \in A//r$ ''and'' $ x\in C$ '' shows '' $ x\in A$ === , <nowiki>equiv_class_self</nowiki> , <nowiki>equiv_class_nondisjoint</nowiki>
''qed'' ===
If a function is congruent then the equivalence classes of the values that come from the arguments from the same class are the same.
''lemma'' <nowiki>EquivClass_1_L3</nowiki>:
'' assumes '' A1: $ equiv(A,r)$ ''and '' A2: $ Congruent(r,f)$ ''and '' A3: $ C \in A//r$, $ x\in C$, $ y\in C$ '' shows '' $ r\{f(x)\} = r\{f(y)\}$+++[proof ]>
''from '' A1, A3 ''have'' $ \langle x,y\rangle \in r$ ''using'' +++^[EquivClass_1_L2A | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_1_L2A</nowiki>: ''assumes '' $ equiv(A,r)$, $ C \in A//r$, $ x\in C$, $ y\in C$ '' shows '' $ \langle x,y\rangle \in r$ ===
''with '' A2 ''have'' $ \langle f(x),f(y)\rangle \in r$ ''using'' +++^[Congruent_def | EquivClass1 ]... Definition of <nowiki>Congruent</nowiki>:
$ Congruent(r,f) \equiv $
$ (\forall x y.\ \langle x,y\rangle \in r \longrightarrow \langle f(x),f(y)\rangle \in r)$===
''with '' A1 ''show'' $ thesis$ ''using'' <nowiki>equiv_class_eq</nowiki>
''qed'' ===
The values of congruent functions are in the space.
''lemma'' <nowiki>EquivClass_1_L4</nowiki>:
'' assumes '' A1: $ equiv(A,r)$ ''and '' A2: $ C \in A//r$, $ x\in C$ ''and '' A3: $ Congruent(r,f)$ '' shows '' $ f(x) \in A$+++[proof ]>
''from '' A1, A2 ''have'' $ x\in A$ ''using'' +++^[EquivClass_1_L1 | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_1_L1</nowiki>: ''assumes '' $ equiv(A,r)$ ''and'' $ C \in A//r$ ''and'' $ x\in C$ '' shows '' $ x\in A$ ===
''with '' A1 ''have'' $ \langle x,x\rangle \in r$ ''using'' <nowiki>equiv_def</nowiki> , <nowiki>refl_def</nowiki>
''with '' A3 ''have'' $ \langle f(x),f(x)\rangle \in r$ ''using'' +++^[Congruent_def | EquivClass1 ]... Definition of <nowiki>Congruent</nowiki>:
$ Congruent(r,f) \equiv $
$ (\forall x y.\ \langle x,y\rangle \in r \longrightarrow \langle f(x),f(y)\rangle \in r)$===
''with '' A1 ''show'' $ thesis$ ''using'' <nowiki>equiv_type</nowiki>
''qed'' ===
Equivalence classes are not empty.
''lemma'' <nowiki>EquivClass_1_L5</nowiki>:
'' assumes '' A1: $ refl(A,r)$ ''and '' A2: $ C \in A//r$ '' shows '' $ C\neq 0$+++[proof ]>
''from '' A2 ''obtain '' $ x$ ''where '' I: $ C = r\{x\}$ ''and '' $ x\in A$ ''using'' <nowiki>quotient_def</nowiki>
''from '' A1, $ x\in A$ ''have'' $ x \in r\{x\}$ ''using'' <nowiki>refl_def</nowiki>
''with '' I ''show'' $ thesis$
''qed'' ===
To avoid using an axiom of choice, we define the projection using the expression $\bigcup _{x\in C} r(\{f(x)\})$. The next lemma shows that for congruent function this is in the quotient space $A/r$.
''lemma'' <nowiki>EquivClass_1_L6</nowiki>:
'' assumes '' A1: $ equiv(A,r)$ ''and '' A2: $ Congruent(r,f)$ ''and '' A3: $ C \in A//r$ '' shows '' $ (\bigcup x\in C.\ r\{f(x)\}) \in A//r$+++[proof ]>
''from '' A1 ''have'' $ refl(A,r)$ ''unfolding'' <nowiki>equiv_def</nowiki>
''with '' A3 ''have'' $ C\neq 0$ ''using'' +++^[EquivClass_1_L5 | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_1_L5</nowiki>: ''assumes '' $ refl(A,r)$ ''and'' $ C \in A//r$ '' shows '' $ C\neq 0$ ===
''moreover'' ''from '' A2, A3, A1 ''have'' $ \forall x\in C.\ r\{f(x)\} \in A//r$ ''using'' +++^[EquivClass_1_L4 | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_1_L4</nowiki>: ''assumes '' $ equiv(A,r)$ ''and'' $ C \in A//r$, $ x\in C$ ''and'' $ Congruent(r,f)$ '' shows '' $ f(x) \in A$ === , <nowiki>quotientI</nowiki>
''moreover'' ''from '' A1, A2, A3 ''have'' $ \forall x y.\ x\in C \wedge y\in C \longrightarrow r\{f(x)\} = r\{f(y)\}$ ''using'' +++^[EquivClass_1_L3 | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_1_L3</nowiki>: ''assumes '' $ equiv(A,r)$ ''and'' $ Congruent(r,f)$ ''and'' $ C \in A//r$, $ x\in C$, $ y\in C$ '' shows '' $ r\{f(x)\} = r\{f(y)\}$ ===
''ultimately '' ''show'' $ thesis$ '' by (rule '' +++^[ZF1_1_L2 | ZF1 ]... ''lemma'' <nowiki>ZF1_1_L2</nowiki>: ''assumes '' $ C\neq 0$ ''and'' $ \forall x\in C.\ b(x) \in A$ ''and'' $ \forall x y.\ x\in C \wedge y\in C \longrightarrow b(x) = b(y)$ '' shows '' $ (\bigcup x\in C.\ b(x))\in A$ === '')''
''qed'' ===
Congruent functions can be projected.
''lemma'' <nowiki>EquivClass_1_T0</nowiki>:
'' assumes '' $ equiv(A,r)$, $ Congruent(r,f)$ '' shows '' $ ProjFun(A,r,f) : A//r \rightarrow A//r$ ''using'' <nowiki>assms</nowiki> , +++^[EquivClass_1_L6 | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_1_L6</nowiki>: ''assumes '' $ equiv(A,r)$ ''and'' $ Congruent(r,f)$ ''and'' $ C \in A//r$ '' shows '' $ (\bigcup x\in C.\ r\{f(x)\}) \in A//r$ === , +++^[ProjFun_def | EquivClass1 ]... Definition of <nowiki>ProjFun</nowiki>:
$ ProjFun(A,r,f) \equiv $
$ \{\langle c,\bigcup x\in c.\ r\{f(x)\}\rangle .\ c \in (A//r)\}$=== , +++^[ZF_fun_from_total | func1 ]... ''lemma'' <nowiki>ZF_fun_from_total</nowiki>: ''assumes '' $ \forall x\in X.\ b(x) \in Y$ '' shows '' $ \{\langle x,b(x)\rangle .\ x\in X\} : X\rightarrow Y$ ===
We now define congruent functions of two variables (binary funtions). The predicate //Congruent2// corresponds to //congruent2// in Isabelle's standard //EquivClass// theory, but uses ZF-functions rather than meta-functions.
''Definition
'' $ Congruent2(r,f) \equiv $
$ (\forall x_1 x_2 y_1 y_2.\ \langle x_1,x_2\rangle \in r \wedge \langle y_1,y_2\rangle \in r \longrightarrow $
$ \langle f\langle x_1,y_1\rangle , f\langle x_2,y_2\rangle \rangle \in r)$
Next we define the notion of projecting a binary operation to the quotient space. This is a very important concept that allows to define quotient groups, among other things.
''Definition
'' $ ProjFun2(A,r,f) \equiv $
$ \{\langle p,\bigcup z \in fst(p)\times snd(p).\ r\{f(z)\}\rangle .\ p \in (A//r)\times (A//r) \}$
The following lemma is a two-variables equivalent of //EquivClass_1_L3//.
''lemma'' <nowiki>EquivClass_1_L7</nowiki>:
'' assumes '' A1: $ equiv(A,r)$ ''and '' A2: $ Congruent2(r,f)$ ''and '' A3: $ C_1 \in A//r$, $ C_2 \in A//r$ ''and '' A4: $ z_1 \in C_1\times C_2$, $ z_2 \in C_1\times C_2$ '' shows '' $ r\{f(z_1)\} = r\{f(z_2)\}$+++[proof ]>
''from '' A4 ''obtain '' $ x_1$ $ y_1$ $ x_2$ $ y_2$ ''where '' $ x_1\in C_1$ ''and '' $ y_1\in C_2$ ''and '' $ z_1 = \langle x_1,y_1\rangle $ ''and '' $ x_2\in C_1$ ''and '' $ y_2\in C_2$ ''and '' $ z_2 = \langle x_2,y_2\rangle $
''with '' A1, A3 ''have'' $ \langle x_1,x_2\rangle \in r$ ''and '' $ \langle y_1,y_2\rangle \in r$ ''using'' +++^[EquivClass_1_L2A | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_1_L2A</nowiki>: ''assumes '' $ equiv(A,r)$, $ C \in A//r$, $ x\in C$, $ y\in C$ '' shows '' $ \langle x,y\rangle \in r$ ===
''with '' A2 ''have'' $ \langle f\langle x_1,y_1\rangle ,f\langle x_2,y_2\rangle \rangle \in r$ ''using'' +++^[Congruent2_def | EquivClass1 ]... Definition of <nowiki>Congruent2</nowiki>:
$ Congruent2(r,f) \equiv $
$ (\forall x_1 x_2 y_1 y_2.\ \langle x_1,x_2\rangle \in r \wedge \langle y_1,y_2\rangle \in r \longrightarrow $
$ \langle f\langle x_1,y_1\rangle , f\langle x_2,y_2\rangle \rangle \in r)$===
''with '' A1, $ z_1 = \langle x_1,y_1\rangle $, $ z_2 = \langle x_2,y_2\rangle $ ''show'' $ thesis$ ''using'' <nowiki>equiv_class_eq</nowiki>
''qed'' ===
The values of congruent functions of two variables are in the space.
''lemma'' <nowiki>EquivClass_1_L8</nowiki>:
'' assumes '' A1: $ equiv(A,r)$ ''and '' A2: $ C_1 \in A//r$ ''and '' A3: $ C_2 \in A//r$ ''and '' A4: $ z \in C_1\times C_2$ ''and '' A5: $ Congruent2(r,f)$ '' shows '' $ f(z) \in A$+++[proof ]>
''from '' A4 ''obtain '' $ x$ $ y$ ''where '' $ x\in C_1$ ''and '' $ y\in C_2$ ''and '' $ z = \langle x,y\rangle $
''with '' A1, A2, A3 ''have'' $ x\in A$ ''and '' $ y\in A$ ''using'' +++^[EquivClass_1_L1 | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_1_L1</nowiki>: ''assumes '' $ equiv(A,r)$ ''and'' $ C \in A//r$ ''and'' $ x\in C$ '' shows '' $ x\in A$ ===
''with '' A1, A4 ''have'' $ \langle x,x\rangle \in r$ ''and '' $ \langle y,y\rangle \in r$ ''using'' <nowiki>equiv_def</nowiki> , <nowiki>refl_def</nowiki>
''with '' A5 ''have'' $ \langle f\langle x,y\rangle , f\langle x,y\rangle \rangle \in r$ ''using'' +++^[Congruent2_def | EquivClass1 ]... Definition of <nowiki>Congruent2</nowiki>:
$ Congruent2(r,f) \equiv $
$ (\forall x_1 x_2 y_1 y_2.\ \langle x_1,x_2\rangle \in r \wedge \langle y_1,y_2\rangle \in r \longrightarrow $
$ \langle f\langle x_1,y_1\rangle , f\langle x_2,y_2\rangle \rangle \in r)$===
''with '' A1, $ z = \langle x,y\rangle $ ''show'' $ thesis$ ''using'' <nowiki>equiv_type</nowiki>
''qed'' ===
The values of congruent functions are in the space. Note that although this lemma is intended to be used with functions, we don't need to assume that $f$ is a function.
''lemma'' <nowiki>EquivClass_1_L8A</nowiki>:
'' assumes '' A1: $ equiv(A,r)$ ''and '' A2: $ x\in A$, $ y\in A$ ''and '' A3: $ Congruent2(r,f)$ '' shows '' $ f\langle x,y\rangle \in A$+++[proof ]>
''from '' A1, A2 ''have'' $ r\{x\} \in A//r$, $ r\{y\} \in A//r$, $ \langle x,y\rangle \in r\{x\}\times r\{y\}$ ''using'' <nowiki>equiv_class_self</nowiki> , <nowiki>quotientI</nowiki>
''with '' A1, A3 ''show'' $ thesis$ ''using'' +++^[EquivClass_1_L8 | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_1_L8</nowiki>: ''assumes '' $ equiv(A,r)$ ''and'' $ C_1 \in A//r$ ''and'' $ C_2 \in A//r$ ''and'' $ z \in C_1\times C_2$ ''and'' $ Congruent2(r,f)$ '' shows '' $ f(z) \in A$ ===
''qed'' ===
The following lemma is a two-variables equivalent of //EquivClass_1_L6//.
''lemma'' <nowiki>EquivClass_1_L9</nowiki>:
'' assumes '' A1: $ equiv(A,r)$ ''and '' A2: $ Congruent2(r,f)$ ''and '' A3: $ p \in (A//r)\times (A//r)$ '' shows '' $ (\bigcup z \in fst(p)\times snd(p).\ r\{f(z)\}) \in A//r$+++[proof ]>
''from '' A3 ''have'' $ fst(p) \in A//r$ ''and '' $ snd(p) \in A//r$
''with '' A1, A2 ''have'' I: $ \forall z \in fst(p)\times snd(p).\ f(z) \in A$ ''using'' +++^[EquivClass_1_L8 | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_1_L8</nowiki>: ''assumes '' $ equiv(A,r)$ ''and'' $ C_1 \in A//r$ ''and'' $ C_2 \in A//r$ ''and'' $ z \in C_1\times C_2$ ''and'' $ Congruent2(r,f)$ '' shows '' $ f(z) \in A$ ===
''from '' A3, A1 ''have'' $ fst(p)\times snd(p) \neq 0$ ''using'' <nowiki>equiv_def</nowiki> , +++^[EquivClass_1_L5 | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_1_L5</nowiki>: ''assumes '' $ refl(A,r)$ ''and'' $ C \in A//r$ '' shows '' $ C\neq 0$ === , <nowiki>Sigma_empty_iff</nowiki>
''moreover'' ''from '' A1, I ''have'' $ \forall z \in fst(p)\times snd(p).\ r\{f(z)\} \in A//r$ ''using'' <nowiki>quotientI</nowiki>
''moreover'' ''from '' A1, A2, $ fst(p) \in A//r$, $ snd(p) \in A//r$ ''have'' $ \forall z_1 z_2.\ z_1 \in fst(p)\times snd(p) \wedge z_2 \in fst(p)\times snd(p) \longrightarrow $
$ r\{f(z_1)\} = r\{f(z_2)\}$ ''using'' +++^[EquivClass_1_L7 | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_1_L7</nowiki>: ''assumes '' $ equiv(A,r)$ ''and'' $ Congruent2(r,f)$ ''and'' $ C_1 \in A//r$, $ C_2 \in A//r$ ''and'' $ z_1 \in C_1\times C_2$, $ z_2 \in C_1\times C_2$ '' shows '' $ r\{f(z_1)\} = r\{f(z_2)\}$ ===
''ultimately '' ''show'' $ thesis$ '' by (rule '' +++^[ZF1_1_L2 | ZF1 ]... ''lemma'' <nowiki>ZF1_1_L2</nowiki>: ''assumes '' $ C\neq 0$ ''and'' $ \forall x\in C.\ b(x) \in A$ ''and'' $ \forall x y.\ x\in C \wedge y\in C \longrightarrow b(x) = b(y)$ '' shows '' $ (\bigcup x\in C.\ b(x))\in A$ === '')''
''qed'' ===
Congruent functions of two variables can be projected.
''theorem'' <nowiki>EquivClass_1_T1</nowiki>:
'' assumes '' $ equiv(A,r)$, $ Congruent2(r,f)$ '' shows '' $ ProjFun2(A,r,f) : (A//r)\times (A//r) \rightarrow A//r$ ''using'' <nowiki>assms</nowiki> , +++^[EquivClass_1_L9 | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_1_L9</nowiki>: ''assumes '' $ equiv(A,r)$ ''and'' $ Congruent2(r,f)$ ''and'' $ p \in (A//r)\times (A//r)$ '' shows '' $ (\bigcup z \in fst(p)\times snd(p).\ r\{f(z)\}) \in A//r$ === , +++^[ProjFun2_def | EquivClass1 ]... Definition of <nowiki>ProjFun2</nowiki>:
$ ProjFun2(A,r,f) \equiv $
$ \{\langle p,\bigcup z \in fst(p)\times snd(p).\ r\{f(z)\}\rangle .\ p \in (A//r)\times (A//r) \}$=== , +++^[ZF_fun_from_total | func1 ]... ''lemma'' <nowiki>ZF_fun_from_total</nowiki>: ''assumes '' $ \forall x\in X.\ b(x) \in Y$ '' shows '' $ \{\langle x,b(x)\rangle .\ x\in X\} : X\rightarrow Y$ ===
The projection diagram commutes. I wish I knew how to draw this diagram in LaTeX.
''lemma'' <nowiki>EquivClass_1_L10</nowiki>:
'' assumes '' A1: $ equiv(A,r)$ ''and '' A2: $ Congruent2(r,f)$ ''and '' A3: $ x\in A$, $ y\in A$ '' shows '' $ ProjFun2(A,r,f)\langle r\{x\},r\{y\}\rangle = r\{f\langle x,y\rangle \}$+++[proof ]>
''from '' A3, A1 ''have'' $ r\{x\} \times r\{y\} \neq 0$ ''using'' <nowiki>quotientI</nowiki> , <nowiki>equiv_def</nowiki> , +++^[EquivClass_1_L5 | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_1_L5</nowiki>: ''assumes '' $ refl(A,r)$ ''and'' $ C \in A//r$ '' shows '' $ C\neq 0$ === , <nowiki>Sigma_empty_iff</nowiki>
''moreover'' ''have'' $ \forall z \in r\{x\}\times r\{y\}.\ r\{f(z)\} = r\{f\langle x,y\rangle \}$+++[proof ]>
''fix '' $ z$
''assume '' A4: $ z \in r\{x\}\times r\{y\}$
''from '' A1, A3 ''have'' $ r\{x\} \in A//r$, $ r\{y\} \in A//r$, $ \langle x,y\rangle \in r\{x\}\times r\{y\}$ ''using'' <nowiki>quotientI</nowiki> , <nowiki>equiv_class_self</nowiki>
''with '' A1, A2, A4 ''show'' $ r\{f(z)\} = r\{f\langle x,y\rangle \}$ ''using'' +++^[EquivClass_1_L7 | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_1_L7</nowiki>: ''assumes '' $ equiv(A,r)$ ''and'' $ Congruent2(r,f)$ ''and'' $ C_1 \in A//r$, $ C_2 \in A//r$ ''and'' $ z_1 \in C_1\times C_2$, $ z_2 \in C_1\times C_2$ '' shows '' $ r\{f(z_1)\} = r\{f(z_2)\}$ ===
''qed'' ===
''ultimately '' ''have'' $ (\bigcup z \in r\{x\}\times r\{y\}.\ r\{f(z)\}) = r\{f\langle x,y\rangle \}$ '' by (rule '' +++^[ZF1_1_L1 | ZF1 ]... ''lemma'' <nowiki>ZF1_1_L1</nowiki>: ''assumes '' $ C\neq 0$ ''and'' $ \forall y\in C.\ b(y) = A$ '' shows '' $ (\bigcup y\in C.\ b(y)) = A$ === '')''
''moreover'' ''have'' $ ProjFun2(A,r,f)\langle r\{x\},r\{y\}\rangle = (\bigcup z \in r\{x\}\times r\{y\}.\ r\{f(z)\})$+++[proof ]>
''from '' assms ''have'' $ ProjFun2(A,r,f) : (A//r)\times (A//r) \rightarrow A//r$, $ \langle r\{x\},r\{y\}\rangle \in (A//r)\times (A//r)$ ''using'' +++^[EquivClass_1_T1 | EquivClass1 ]... ''theorem'' <nowiki>EquivClass_1_T1</nowiki>: ''assumes '' $ equiv(A,r)$, $ Congruent2(r,f)$ '' shows '' $ ProjFun2(A,r,f) : (A//r)\times (A//r) \rightarrow A//r$ === , <nowiki>quotientI</nowiki>
''then '' ''show'' $ thesis$ ''using'' +++^[ProjFun2_def | EquivClass1 ]... Definition of <nowiki>ProjFun2</nowiki>:
$ ProjFun2(A,r,f) \equiv $
$ \{\langle p,\bigcup z \in fst(p)\times snd(p).\ r\{f(z)\}\rangle .\ p \in (A//r)\times (A//r) \}$=== , +++^[ZF_fun_from_tot_val | func1 ]... ''lemma'' <nowiki>ZF_fun_from_tot_val</nowiki>: ''assumes '' $ f:X\rightarrow Y$, $ x\in X$ ''and'' $ f = \{\langle x,b(x)\rangle .\ x\in X\}$ '' shows '' $ f(x) = b(x)$ ===
''qed'' ===
''ultimately '' ''show'' $ thesis$
''qed'' ===
!Projecting commutative, associative and distributive operations.
In this section we show that if the operations are congruent with respect to an equivalence relation then the projection to the quotient space preserves commutativity, associativity and distributivity.
The projection of commutative operation is commutative.
''lemma'' <nowiki>EquivClass_2_L1</nowiki>:
'' assumes '' A1: $ equiv(A,r)$ ''and '' A2: $ Congruent2(r,f)$ ''and '' A3: $ f \text{ is commutative on } A$ ''and '' A4: $ c1 \in A//r$, $ c2 \in A//r$ '' shows '' $ ProjFun2(A,r,f)\langle c1,c2\rangle = ProjFun2(A,r,f)\langle c2,c1\rangle $+++[proof ]>
''from '' A4 ''obtain '' $ x$ $ y$ ''where '' D1: $ c1 = r\{x\}$, $ c2 = r\{y\}$, $ x\in A$, $ y\in A$ ''using'' <nowiki>quotient_def</nowiki>
''with '' A1, A2 ''have'' $ ProjFun2(A,r,f)\langle c1,c2\rangle = r\{f\langle x,y\rangle \}$ ''using'' +++^[EquivClass_1_L10 | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_1_L10</nowiki>: ''assumes '' $ equiv(A,r)$ ''and'' $ Congruent2(r,f)$ ''and'' $ x\in A$, $ y\in A$ '' shows '' $ ProjFun2(A,r,f)\langle r\{x\},r\{y\}\rangle = r\{f\langle x,y\rangle \}$ ===
''also'' ''from '' A3, D1 ''have'' $ r\{f\langle x,y\rangle \} = r\{f\langle y,x\rangle \}$ ''using'' +++^[IsCommutative_def | func_ZF ]... Definition of <nowiki>IsCommutative</nowiki>:
$ f \text{ is commutative on } G \equiv \forall x\in G.\ \forall y\in G.\ f\langle x,y\rangle = f\langle y,x\rangle $===
''also'' ''from '' A1, A2, D1 ''have'' $ r\{f\langle y,x\rangle \} = ProjFun2(A,r,f) \langle c2,c1\rangle $ ''using'' +++^[EquivClass_1_L10 | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_1_L10</nowiki>: ''assumes '' $ equiv(A,r)$ ''and'' $ Congruent2(r,f)$ ''and'' $ x\in A$, $ y\in A$ '' shows '' $ ProjFun2(A,r,f)\langle r\{x\},r\{y\}\rangle = r\{f\langle x,y\rangle \}$ ===
''finally '' ''show'' $ thesis$
''qed'' ===
The projection of commutative operation is commutative.
''theorem'' <nowiki>EquivClass_2_T1</nowiki>:
'' assumes '' $ equiv(A,r)$ ''and '' $ Congruent2(r,f)$ ''and '' $ f \text{ is commutative on } A$ '' shows '' $ ProjFun2(A,r,f) \text{ is commutative on } A//r$ ''using'' <nowiki>prems</nowiki> , +++^[IsCommutative_def | func_ZF ]... Definition of <nowiki>IsCommutative</nowiki>:
$ f \text{ is commutative on } G \equiv \forall x\in G.\ \forall y\in G.\ f\langle x,y\rangle = f\langle y,x\rangle $=== , +++^[EquivClass_2_L1 | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_2_L1</nowiki>: ''assumes '' $ equiv(A,r)$ ''and'' $ Congruent2(r,f)$ ''and'' $ f \text{ is commutative on } A$ ''and'' $ c1 \in A//r$, $ c2 \in A//r$ '' shows '' $ ProjFun2(A,r,f)\langle c1,c2\rangle = ProjFun2(A,r,f)\langle c2,c1\rangle $ ===
The projection of an associative operation is associative.
''lemma'' <nowiki>EquivClass_2_L2</nowiki>:
'' assumes '' A1: $ equiv(A,r)$ ''and '' A2: $ Congruent2(r,f)$ ''and '' A3: $ f \text{ is associative on } A$ ''and '' A4: $ c1 \in A//r$, $ c2 \in A//r$, $ c3 \in A//r$ ''and '' A5: $ g = ProjFun2(A,r,f)$ '' shows '' $ g\langle g\langle c1,c2\rangle ,c3\rangle = g\langle c1,g\langle c2,c3\rangle \rangle $+++[proof ]>
''from '' A4 ''obtain '' $ x$ $ y$ $ z$ ''where '' D1: $ c1 = r\{x\}$, $ c2 = r\{y\}$, $ c3 = r\{z\}$, $ x\in A$, $ y\in A$, $ z\in A$ ''using'' <nowiki>quotient_def</nowiki>
''with '' A3 ''have'' T1: $ f\langle x,y\rangle \in A$, $ f\langle y,z\rangle \in A$ ''using'' +++^[IsAssociative_def | func_ZF ]... Definition of <nowiki>IsAssociative</nowiki>:
$ P \text{ is associative on } G \equiv P : G\times G\rightarrow G \wedge $
$ (\forall x \in G.\ \forall y \in G.\ \forall z \in G.\ $
$ ( P(\langle P(\langle x,y\rangle ),z\rangle ) = P( \langle x,P(\langle y,z\rangle )\rangle )))$=== , <nowiki>apply_type</nowiki>
''with '' A1, A2, D1, A5 ''have'' $ g\langle g\langle c1,c2\rangle ,c3\rangle = r\{f\langle f\langle x,y\rangle ,z\rangle \}$ ''using'' +++^[EquivClass_1_L10 | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_1_L10</nowiki>: ''assumes '' $ equiv(A,r)$ ''and'' $ Congruent2(r,f)$ ''and'' $ x\in A$, $ y\in A$ '' shows '' $ ProjFun2(A,r,f)\langle r\{x\},r\{y\}\rangle = r\{f\langle x,y\rangle \}$ ===
''also'' ''from '' D1, A3 ''have'' $ \ldots = r\{f\langle x,f\langle y,z\rangle \rangle \}$ ''using'' +++^[IsAssociative_def | func_ZF ]... Definition of <nowiki>IsAssociative</nowiki>:
$ P \text{ is associative on } G \equiv P : G\times G\rightarrow G \wedge $
$ (\forall x \in G.\ \forall y \in G.\ \forall z \in G.\ $
$ ( P(\langle P(\langle x,y\rangle ),z\rangle ) = P( \langle x,P(\langle y,z\rangle )\rangle )))$===
''also'' ''from '' T1, A1, A2, D1, A5 ''have'' $ \ldots = g\langle c1,g\langle c2,c3\rangle \rangle $ ''using'' +++^[EquivClass_1_L10 | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_1_L10</nowiki>: ''assumes '' $ equiv(A,r)$ ''and'' $ Congruent2(r,f)$ ''and'' $ x\in A$, $ y\in A$ '' shows '' $ ProjFun2(A,r,f)\langle r\{x\},r\{y\}\rangle = r\{f\langle x,y\rangle \}$ ===
''finally '' ''show'' $ thesis$
''qed'' ===
The projection of an associative operation is associative on the quotient.
''theorem'' <nowiki>EquivClass_2_T2</nowiki>:
'' assumes '' A1: $ equiv(A,r)$ ''and '' A2: $ Congruent2(r,f)$ ''and '' A3: $ f \text{ is associative on } A$ '' shows '' $ ProjFun2(A,r,f) \text{ is associative on } A//r$+++[proof ]>
''let '' $ g = ProjFun2(A,r,f)$
''from '' A1, A2 ''have'' $ g \in (A//r)\times (A//r) \rightarrow A//r$ ''using'' +++^[EquivClass_1_T1 | EquivClass1 ]... ''theorem'' <nowiki>EquivClass_1_T1</nowiki>: ''assumes '' $ equiv(A,r)$, $ Congruent2(r,f)$ '' shows '' $ ProjFun2(A,r,f) : (A//r)\times (A//r) \rightarrow A//r$ ===
''moreover'' ''from '' A1, A2, A3 ''have'' $ \forall c1 \in A//r.\ \forall c2 \in A//r.\ \forall c3 \in A//r.\ $
$ g\langle g\langle c1,c2\rangle ,c3\rangle = g\langle c1,g\langle c2,c3\rangle \rangle $ ''using'' +++^[EquivClass_2_L2 | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_2_L2</nowiki>: ''assumes '' $ equiv(A,r)$ ''and'' $ Congruent2(r,f)$ ''and'' $ f \text{ is associative on } A$ ''and'' $ c1 \in A//r$, $ c2 \in A//r$, $ c3 \in A//r$ ''and'' $ g = ProjFun2(A,r,f)$ '' shows '' $ g\langle g\langle c1,c2\rangle ,c3\rangle = g\langle c1,g\langle c2,c3\rangle \rangle $ ===
''ultimately '' ''show'' $ thesis$ ''using'' +++^[IsAssociative_def | func_ZF ]... Definition of <nowiki>IsAssociative</nowiki>:
$ P \text{ is associative on } G \equiv P : G\times G\rightarrow G \wedge $
$ (\forall x \in G.\ \forall y \in G.\ \forall z \in G.\ $
$ ( P(\langle P(\langle x,y\rangle ),z\rangle ) = P( \langle x,P(\langle y,z\rangle )\rangle )))$===
''qed'' ===
The essential condition to show that distributivity is preserved by projections to quotient spaces, provided both operations are congruent with respect to the equivalence relation.
''lemma'' <nowiki>EquivClass_2_L3</nowiki>:
'' assumes '' A1: $ IsDistributive(X,A,M)$ ''and '' A2: $ equiv(X,r)$ ''and '' A3: $ Congruent2(r,A)$, $ Congruent2(r,M)$ ''and '' A4: $ a \in X//r$, $ b \in X//r$, $ c \in X//r$ ''and '' A5: $ A_p = ProjFun2(X,r,A)$, $ M_p = ProjFun2(X,r,M)$ '' shows '' $ M_p\langle a,A_p\langle b,c\rangle \rangle = A_p\langle M_p\langle a,b\rangle ,M_p\langle a,c\rangle \rangle \wedge $
$ M_p\langle A_p\langle b,c\rangle ,a \rangle = A_p\langle M_p\langle b,a\rangle , M_p\langle c,a\rangle \rangle $+++[proof ]>
''from '' A4 ''obtain '' $ x$ $ y$ $ z$ ''where '' $ x\in X$, $ y\in X$, $ z\in X$, $ a = r\{x\}$, $ b = r\{y\}$, $ c = r\{z\}$ ''using'' <nowiki>quotient_def</nowiki>
''with '' A1, A2, A3, A5 ''show'' $ M_p\langle a,A_p\langle b,c\rangle \rangle = A_p\langle M_p\langle a,b\rangle ,M_p\langle a,c\rangle \rangle $ ''and '' $ M_p\langle A_p\langle b,c\rangle ,a \rangle = A_p\langle M_p\langle b,a\rangle , M_p\langle c,a\rangle \rangle $ ''using'' +++^[EquivClass_1_L8A | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_1_L8A</nowiki>: ''assumes '' $ equiv(A,r)$ ''and'' $ x\in A$, $ y\in A$ ''and'' $ Congruent2(r,f)$ '' shows '' $ f\langle x,y\rangle \in A$ === , +++^[EquivClass_1_L10 | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_1_L10</nowiki>: ''assumes '' $ equiv(A,r)$ ''and'' $ Congruent2(r,f)$ ''and'' $ x\in A$, $ y\in A$ '' shows '' $ ProjFun2(A,r,f)\langle r\{x\},r\{y\}\rangle = r\{f\langle x,y\rangle \}$ === , +++^[IsDistributive_def | func_ZF ]... Definition of <nowiki>IsDistributive</nowiki>:
$ IsDistributive(X,A,M) \equiv (\forall a\in X.\ \forall b\in X.\ \forall c\in X.\ $
$ M\langle a,A\langle b,c\rangle \rangle = A\langle M\langle a,b\rangle ,M\langle a,c\rangle \rangle \wedge $
$ M\langle A\langle b,c\rangle ,a\rangle = A\langle M\langle b,a\rangle ,M\langle c,a\rangle \rangle )$===
''qed'' ===
Distributivity is preserved by projections to quotient spaces, provided both operations are congruent with respect to the equivalence relation.
''lemma'' <nowiki>EquivClass_2_L4</nowiki>:
'' assumes '' A1: $ IsDistributive(X,A,M)$ ''and '' A2: $ equiv(X,r)$ ''and '' A3: $ Congruent2(r,A)$, $ Congruent2(r,M)$ '' shows '' $ IsDistributive(X//r,ProjFun2(X,r,A),ProjFun2(X,r,M))$+++[proof ]>
''let '' $ A_p = ProjFun2(X,r,A)$
''let '' $ M_p = ProjFun2(X,r,M)$
''from '' A1, A2, A3 ''have'' $ \forall a\in X//r.\ \forall b\in X//r.\ \forall c\in X//r.\ $
$ M_p\langle a,A_p\langle b,c\rangle \rangle = A_p\langle M_p\langle a,b\rangle ,M_p\langle a,c\rangle \rangle \wedge $
$ M_p\langle A_p\langle b,c\rangle ,a\rangle = A_p\langle M_p\langle b,a\rangle ,M_p\langle c,a\rangle \rangle $ ''using'' +++^[EquivClass_2_L3 | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_2_L3</nowiki>: ''assumes '' $ IsDistributive(X,A,M)$ ''and'' $ equiv(X,r)$ ''and'' $ Congruent2(r,A)$, $ Congruent2(r,M)$ ''and'' $ a \in X//r$, $ b \in X//r$, $ c \in X//r$ ''and'' $ A_p = ProjFun2(X,r,A)$, $ M_p = ProjFun2(X,r,M)$ '' shows '' $ M_p\langle a,A_p\langle b,c\rangle \rangle = A_p\langle M_p\langle a,b\rangle ,M_p\langle a,c\rangle \rangle \wedge $
$ M_p\langle A_p\langle b,c\rangle ,a \rangle = A_p\langle M_p\langle b,a\rangle , M_p\langle c,a\rangle \rangle $
===
''then '' ''show'' $ thesis$ ''using'' +++^[IsDistributive_def | func_ZF ]... Definition of <nowiki>IsDistributive</nowiki>:
$ IsDistributive(X,A,M) \equiv (\forall a\in X.\ \forall b\in X.\ \forall c\in X.\ $
$ M\langle a,A\langle b,c\rangle \rangle = A\langle M\langle a,b\rangle ,M\langle a,c\rangle \rangle \wedge $
$ M\langle A\langle b,c\rangle ,a\rangle = A\langle M\langle b,a\rangle ,M\langle c,a\rangle \rangle )$===
''qed'' ===
!Saturated sets
In this section we consider sets that are saturated with respect to an equivalence relation. A set $A$ is saturated with respect to a relation $r$ if $A=r^{-1}(r(A))$. For equivalence relations saturated sets are unions of equivalence classes. This makes them useful as a tool to define subsets of the quoutient space using properties of representants. Namely, we often define a set $B\subseteq X/r$ by saying that $[x]_r \in B$ iff $x\in A$. If $A$ is a saturated set, this definition is consistent in the sense that it does not depend on the choice of $x$ to represent $[x]_r$.
The following defines the notion of a saturated set. Recall that in Isabelle $ r^{-1}(A)$ is the inverse image of $A$ with respect to relation $r$. This definition is not specific to equivalence relations.
''Definition
'' $ IsSaturated(r,A) \equiv A = r^{-1}(r(A))$
For equivalence relations a set is saturated iff it is an image of itself.
''lemma'' <nowiki>EquivClass_3_L1</nowiki>:
'' assumes '' A1: $ equiv(X,r)$ '' shows '' $ IsSaturated(r,A) \longleftrightarrow A = r(A)$+++[proof ]>
''assume '' $ IsSaturated(r,A)$
''then '' ''have'' $ A = (converse(r)\circ r)(A)$ ''using'' +++^[IsSaturated_def | EquivClass1 ]... Definition of <nowiki>IsSaturated</nowiki>:
$ IsSaturated(r,A) \equiv A = r^{-1}(r(A))$=== , <nowiki>vimage_def</nowiki> , <nowiki>image_comp</nowiki>
''also'' ''from '' A1 ''have'' $ \ldots = r(A)$ ''using'' <nowiki>equiv_comp_eq</nowiki>
''finally '' ''show'' $ A = r(A)$
''next ''
''assume '' $ A = r(A)$
''with '' A1 ''have'' $ A = (converse(r)\circ r)(A)$ ''using'' <nowiki>equiv_comp_eq</nowiki>
''also'' ''have'' $ \ldots = r^{-1}(r(A))$ ''using'' <nowiki>vimage_def</nowiki> , <nowiki>image_comp</nowiki>
''finally '' ''have'' $ A = r^{-1}(r(A))$
''then '' ''show'' $ IsSaturated(r,A)$ ''using'' +++^[IsSaturated_def | EquivClass1 ]... Definition of <nowiki>IsSaturated</nowiki>:
$ IsSaturated(r,A) \equiv A = r^{-1}(r(A))$===
''qed'' ===
For equivalence relations sets are contained in their images.
''lemma'' <nowiki>EquivClass_3_L2</nowiki>:
'' assumes '' A1: $ equiv(X,r)$ ''and '' A2: $ A\subseteq X$ '' shows '' $ A \subseteq r(A)$+++[proof ]>
''fix '' $ a$
''assume '' $ a\in A$
''with '' A1, A2 ''have'' $ a \in r\{a\}$ ''using'' <nowiki>equiv_class_self</nowiki>
''with '' $ a\in A$ ''show'' $ a \in r(A)$
''qed'' ===
The next lemma shows that if "$\sim$" is an equivalence relation and a set $A$ is such that $a\in A$ and $a\sim b$ implies $b\in A$, then $A$ is saturated with respect to the relation.
''lemma'' <nowiki>EquivClass_3_L3</nowiki>:
'' assumes '' A1: $ equiv(X,r)$ ''and '' A2: $ r \subseteq X\times X$ ''and '' A3: $ A\subseteq X$ ''and '' A4: $ \forall x\in A.\ \forall y\in X.\ \langle x,y\rangle \in r \longrightarrow y\in A$ '' shows '' $ IsSaturated(r,A)$+++[proof ]>
''from '' A2, A4 ''have'' $ r(A) \subseteq A$ ''using'' <nowiki>image_iff</nowiki>
''moreover'' ''from '' A1, A3 ''have'' $ A \subseteq r(A)$ ''using'' +++^[EquivClass_3_L2 | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_3_L2</nowiki>: ''assumes '' $ equiv(X,r)$ ''and'' $ A\subseteq X$ '' shows '' $ A \subseteq r(A)$ ===
''ultimately '' ''have'' $ A = r(A)$
''with '' A1 ''show'' $ IsSaturated(r,A)$ ''using'' +++^[EquivClass_3_L1 | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_3_L1</nowiki>: ''assumes '' $ equiv(X,r)$ '' shows '' $ IsSaturated(r,A) \longleftrightarrow A = r(A)$ ===
''qed'' ===
If $A\subseteq X$ and $A$ is saturated and $x\sim y$, then $x\in A$ iff $y\in A$. Here we show only one direction.
''lemma'' <nowiki>EquivClass_3_L4</nowiki>:
'' assumes '' A1: $ equiv(X,r)$ ''and '' A2: $ IsSaturated(r,A)$ ''and '' A3: $ A\subseteq X$ ''and '' A4: $ \langle x,y\rangle \in r$ ''and '' A5: $ x\in X$, $ y\in A$ '' shows '' $ x\in A$+++[proof ]>
''from '' A1, A5 ''have'' $ x \in r\{x\}$ ''using'' <nowiki>equiv_class_self</nowiki>
''with '' A1, A3, A4, A5 ''have'' $ x \in r(A)$ ''using'' <nowiki>equiv_class_eq</nowiki> , <nowiki>equiv_class_self</nowiki>
''with '' A1, A2 ''show'' $ x\in A$ ''using'' +++^[EquivClass_3_L1 | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_3_L1</nowiki>: ''assumes '' $ equiv(X,r)$ '' shows '' $ IsSaturated(r,A) \longleftrightarrow A = r(A)$ ===
''qed'' ===
If $A\subseteq X$ and $A$ is saturated and $x\sim y$, then $x\in A$ iff $y\in A$.
''lemma'' <nowiki>EquivClass_3_L5</nowiki>:
'' assumes '' A1: $ equiv(X,r)$ ''and '' A2: $ IsSaturated(r,A)$ ''and '' A3: $ A\subseteq X$ ''and '' A4: $ x\in X$, $ y\in X$ ''and '' A5: $ \langle x,y\rangle \in r$ '' shows '' $ x\in A \longleftrightarrow y\in A$+++[proof ]>
''assume '' $ y\in A$
''with '' prems ''show'' $ x\in A$ ''using'' +++^[EquivClass_3_L4 | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_3_L4</nowiki>: ''assumes '' $ equiv(X,r)$ ''and'' $ IsSaturated(r,A)$ ''and'' $ A\subseteq X$ ''and'' $ \langle x,y\rangle \in r$ ''and'' $ x\in X$, $ y\in A$ '' shows '' $ x\in A$ ===
''next ''
''assume '' $ x\in A$
''from '' A1, A5 ''have'' $ \langle y,x\rangle \in r$ ''using'' +++^[equiv_is_sym | Fol1 ]... ''lemma'' <nowiki>equiv_is_sym</nowiki>: ''assumes '' $ equiv(X,r)$ ''and'' $ \langle x,y\rangle \in r$ '' shows '' $ \langle y,x\rangle \in r$ ===
''with '' A1, A2, A3, A4, $ x\in A$ ''show'' $ y\in A$ ''using'' +++^[EquivClass_3_L4 | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_3_L4</nowiki>: ''assumes '' $ equiv(X,r)$ ''and'' $ IsSaturated(r,A)$ ''and'' $ A\subseteq X$ ''and'' $ \langle x,y\rangle \in r$ ''and'' $ x\in X$, $ y\in A$ '' shows '' $ x\in A$ ===
''qed'' ===
If $A$ is saturated then $x\in A$ iff its class is in the projection of $A$.
''lemma'' <nowiki>EquivClass_3_L6</nowiki>:
'' assumes '' A1: $ equiv(X,r)$ ''and '' A2: $ IsSaturated(r,A)$ ''and '' A3: $ A\subseteq X$ ''and '' A4: $ x\in X$ ''and '' A5: $ B = \{r\{x\}.\ x\in A\}$ '' shows '' $ x\in A \longleftrightarrow r\{x\} \in B$+++[proof ]>
''assume '' $ x\in A$
''with '' A5 ''show'' $ r\{x\} \in B$
''next ''
''assume '' $ r\{x\} \in B$
''with '' A5 ''obtain '' $ y$ ''where '' $ y \in A$ ''and '' $ r\{x\} = r\{y\}$
''with '' A1, A3 ''have'' $ \langle x,y\rangle \in r$ ''using'' <nowiki>eq_equiv_class</nowiki>
''with '' A1, A2, A3, A4, $ y \in A$ ''show'' $ x\in A$ ''using'' +++^[EquivClass_3_L4 | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_3_L4</nowiki>: ''assumes '' $ equiv(X,r)$ ''and'' $ IsSaturated(r,A)$ ''and'' $ A\subseteq X$ ''and'' $ \langle x,y\rangle \in r$ ''and'' $ x\in X$, $ y\in A$ '' shows '' $ x\in A$ ===
''qed'' ===
A technical lemma involving a projection of a saturated set and a logical epression with exclusive or. Note that we don't really care what //Xor// is here, this is true for any predicate.
''lemma'' <nowiki>EquivClass_3_L7</nowiki>:
'' assumes '' $ equiv(X,r)$ ''and '' $ IsSaturated(r,A)$ ''and '' $ A\subseteq X$ ''and '' $ x\in X$, $ y\in X$ ''and '' $ B = \{r\{x\}.\ x\in A\}$ ''and '' $ (x\in A) \text{ Xor } (y\in A)$ '' shows '' $ (r\{x\} \in B) \text{ Xor } (r\{y\} \in B)$ ''using'' <nowiki>assms</nowiki> , +++^[EquivClass_3_L6 | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_3_L6</nowiki>: ''assumes '' $ equiv(X,r)$ ''and'' $ IsSaturated(r,A)$ ''and'' $ A\subseteq X$ ''and'' $ x\in X$ ''and'' $ B = \{r\{x\}.\ x\in A\}$ '' shows '' $ x\in A \longleftrightarrow r\{x\} \in B$ ===
''end
'' +++![Comments on EquivClass1|click to add comment] <html> <div> <iframe style="width:60%;height:500px" src="http://www.haloscan.com/comments/slawekk/EquivClass1"></iframe> </div> </html>
===
''theory'' Field_ZF ''imports'' [[Ring_ZF]]
''begin
''
This theory covers basic facts about fields.
!Definition and basic properties
In this section we define what is a field and list the basic properties of fields.
Field is a notrivial commutative ring such that all non-zero elements have an inverse. We define the notion of being a field as a statement about three sets. The first set, denoted //K// is the carrier of the field. The second set, denoted //A// represents the additive operation on //K// (recall that in ZF set theory functions are sets). The third set //M// represents the multiplicative operation on //K//.
''Definition
'' $ IsAfield(K,A,M) \equiv $
$ (IsAring(K,A,M) \wedge (M \text{ is commutative on } K) \wedge $
$ TheNeutralElement(K,A) \neq TheNeutralElement(K,M) \wedge $
$ (\forall a\in K.\ a\neq TheNeutralElement(K,A)\longrightarrow $
$ (\exists b\in K.\ M\langle a,b\rangle = TheNeutralElement(K,M))))$
The //field0// context extends the //ring0// context adding field-related assumptions and notation related to the multiplicative inverse.
''Locale '' field0 = ring0 K +
''assumes '' mult_commute: $ M \text{ is commutative on } K$
''assumes '' not_triv: $ 0 \neq 1 $
''assumes '' inv_exists: $ \forall a\in K.\ a\neq 0 \longrightarrow (\exists b\in K.\ a\cdot b = 1 )$
''defines '' $ K_0 \equiv K-\{0 \}$
''defines '' $ a^{-1} \equiv GroupInv(K_0,restrict(M,K_0\times K_0))(a)$
The next lemma assures us that we are talking fields in the //field0// context.
''lemma'' ''(in'' field0'')'' <nowiki>Field_ZF_1_L1</nowiki>:
'' shows '' $ IsAfield(K,A,M)$ ''using'' <nowiki>ringAssum</nowiki> , <nowiki>mult_commute</nowiki> , <nowiki>not_triv</nowiki> , <nowiki>inv_exists</nowiki> , +++^[IsAfield_def | Field_ZF ]... Definition of <nowiki>IsAfield</nowiki>:
$ IsAfield(K,A,M) \equiv $
$ (IsAring(K,A,M) \wedge (M \text{ is commutative on } K) \wedge $
$ TheNeutralElement(K,A) \neq TheNeutralElement(K,M) \wedge $
$ (\forall a\in K.\ a\neq TheNeutralElement(K,A)\longrightarrow $
$ (\exists b\in K.\ M\langle a,b\rangle = TheNeutralElement(K,M))))$===
We can use theorems proven in the //field0// context whenever we talk about a field.
''lemma'' <nowiki>field_field0</nowiki>:
'' assumes '' $ IsAfield(K,A,M)$ '' shows '' $ field0(K,A,M)$ ''using'' <nowiki>assms</nowiki> , +++^[IsAfield_def | Field_ZF ]... Definition of <nowiki>IsAfield</nowiki>:
$ IsAfield(K,A,M) \equiv $
$ (IsAring(K,A,M) \wedge (M \text{ is commutative on } K) \wedge $
$ TheNeutralElement(K,A) \neq TheNeutralElement(K,M) \wedge $
$ (\forall a\in K.\ a\neq TheNeutralElement(K,A)\longrightarrow $
$ (\exists b\in K.\ M\langle a,b\rangle = TheNeutralElement(K,M))))$=== , <nowiki>field0_axioms.intro</nowiki> , <nowiki>ring0_def</nowiki> , <nowiki>field0_def</nowiki>
Let's have an explicit statement that the multiplication in fields is commutative.
''lemma'' ''(in'' field0'')'' <nowiki>field_mult_comm</nowiki>:
'' assumes '' $ a\in K$, $ b\in K$ '' shows '' $ a\cdot b = b\cdot a$ ''using'' <nowiki>mult_commute</nowiki> , <nowiki>assms</nowiki> , +++^[IsCommutative_def | func_ZF ]... Definition of <nowiki>IsCommutative</nowiki>:
$ f \text{ is commutative on } G \equiv \forall x\in G.\ \forall y\in G.\ f\langle x,y\rangle = f\langle y,x\rangle $===
Fields do not have zero divisors.
''lemma'' ''(in'' field0'')'' <nowiki>field_has_no_zero_divs</nowiki>:
'' shows '' $ HasNoZeroDivs(K,A,M)$+++[proof ]>
++++[{ ]>
''fix '' $ a$ $ b$
''assume '' A1: $ a\in K$, $ b\in K$ ''and '' A2: $ a\cdot b = 0 $ ''and '' A3: $ b\neq 0 $
''from '' inv_exists, A1, A3 ''obtain '' $ c$ ''where '' I: $ c\in K$ ''and '' II: $ b\cdot c = 1 $
''from '' A2 ''have'' $ a\cdot b\cdot c = 0 \cdot c$
''with '' A1, I ''have'' $ a\cdot (b\cdot c) = 0 $ ''using'' +++^[Ring_ZF_1_L11 | Ring_ZF ]... ''lemma'' ''(in'' ring0'')'' <nowiki>Ring_ZF_1_L11</nowiki>: ''assumes '' $ a\in R$, $ b\in R$, $ c\in R$ '' shows '' $ a + b + c = a + (b + c)$, $ a\cdot b\cdot c = a\cdot (b\cdot c)$ === , +++^[Ring_ZF_1_L6 | Ring_ZF ]... ''lemma'' ''(in'' ring0'')'' <nowiki>Ring_ZF_1_L6</nowiki>: ''assumes '' $ x\in R$ '' shows '' $ 0 \cdot x = 0 $, $ x\cdot 0 = 0 $ ===
''with '' A1, II ''have'' $ a=0 $ ''using'' +++^[Ring_ZF_1_L3 | Ring_ZF ]... ''lemma'' ''(in'' ring0'')'' <nowiki>Ring_ZF_1_L3</nowiki>: ''assumes '' $ a\in R$ '' shows '' $ ( - a) \in R$, $ ( - ( - a)) = a$, $ a + 0 = a$, $ 0 + a = a$, $ a\cdot 1 = a$,
$ 1 \cdot a = a$, $ a - a = 0 $, $ a - 0 = a$, $ 2 \cdot a = a + a$, $ ( - a) + a = 0 $ ===
=== ''}''
''then '' ''have'' $ \forall a\in K.\ \forall b\in K.\ a\cdot b = 0 \longrightarrow a=0 \vee b=0 $
''then '' ''show'' $ thesis$ ''using'' +++^[HasNoZeroDivs_def | Ring_ZF ]... Definition of <nowiki>HasNoZeroDivs</nowiki>:
$ HasNoZeroDivs(R,A,M) \equiv (\forall a\in R.\ \forall b\in R.\ $
$ M\langle a,b\rangle = TheNeutralElement(R,A) \longrightarrow $
$ a = TheNeutralElement(R,A) \vee b = TheNeutralElement(R,A))$===
''qed'' ===
$K_0$ (the set of nonzero field elements is closed with respect to multiplication.
''lemma'' ''(in'' field0'')'' <nowiki>Field_ZF_1_L2</nowiki>:
'' shows '' $ K_0 \text{ is closed under } M$ ''using'' +++^[Ring_ZF_1_L4 | Ring_ZF ]... ''lemma'' ''(in'' ring0'')'' <nowiki>Ring_ZF_1_L4</nowiki>: ''assumes '' $ a\in R$, $ b\in R$ '' shows '' $ a + b \in R$, $ a - b \in R$, $ a\cdot b \in R$, $ a + b = b + a$ === , +++^[field_has_no_zero_divs | Field_ZF ]... ''lemma'' ''(in'' field0'')'' <nowiki>field_has_no_zero_divs</nowiki>: '' shows '' $ HasNoZeroDivs(K,A,M)$ === , +++^[Ring_ZF_1_L12 | Ring_ZF ]... ''lemma'' ''(in'' ring0'')'' <nowiki>Ring_ZF_1_L12</nowiki>: ''assumes '' $ HasNoZeroDivs(R,A,M)$ ''and'' $ a\in R$, $ a\neq 0 $, $ b\in R$, $ b\neq 0 $ '' shows '' $ a\cdot b\neq 0 $ === , +++^[IsOpClosed_def | func_ZF ]... Definition of <nowiki>IsOpClosed</nowiki>:
$ A \text{ is closed under } f \equiv \forall x\in A.\ \forall y\in A.\ f\langle x,y\rangle \in A$===
Any nonzero element has a right inverse that is nonzero.
''lemma'' ''(in'' field0'')'' <nowiki>Field_ZF_1_L3</nowiki>:
'' assumes '' A1: $ a\in K_0$ '' shows '' $ \exists b\in K_0.\ a\cdot b = 1 $+++[proof ]>
''from '' inv_exists, A1 ''obtain '' $ b$ ''where '' $ b\in K$ ''and '' $ a\cdot b = 1 $
''with '' not_triv, A1 ''show'' $ \exists b\in K_0.\ a\cdot b = 1 $ ''using'' +++^[Ring_ZF_1_L6 | Ring_ZF ]... ''lemma'' ''(in'' ring0'')'' <nowiki>Ring_ZF_1_L6</nowiki>: ''assumes '' $ x\in R$ '' shows '' $ 0 \cdot x = 0 $, $ x\cdot 0 = 0 $ ===
''qed'' ===
If we remove zero, the field with multiplication becomes a group and we can use all theorems proven in //group0// context.
''theorem'' ''(in'' field0'')'' <nowiki>Field_ZF_1_L4</nowiki>:
'' shows '' $ \text{IsAgroup}(K_0,restrict(M,K_0\times K_0))$, $ group0(K_0,restrict(M,K_0\times K_0))$, $ 1 = TheNeutralElement(K_0,restrict(M,K_0\times K_0))$+++[proof ]>
''let '' $ f = restrict(M,K_0\times K_0)$
''have'' $ M \text{ is associative on } K$, $ K_0 \subseteq K$, $ K_0 \text{ is closed under } M$ ''using'' +++^[Field_ZF_1_L1 | Field_ZF ]... ''lemma'' ''(in'' field0'')'' <nowiki>Field_ZF_1_L1</nowiki>: '' shows '' $ IsAfield(K,A,M)$ === , +++^[IsAfield_def | Field_ZF ]... Definition of <nowiki>IsAfield</nowiki>:
$ IsAfield(K,A,M) \equiv $
$ (IsAring(K,A,M) \wedge (M \text{ is commutative on } K) \wedge $
$ TheNeutralElement(K,A) \neq TheNeutralElement(K,M) \wedge $
$ (\forall a\in K.\ a\neq TheNeutralElement(K,A)\longrightarrow $
$ (\exists b\in K.\ M\langle a,b\rangle = TheNeutralElement(K,M))))$=== , +++^[IsAring_def | Ring_ZF ]... Definition of <nowiki>IsAring</nowiki>:
$ IsAring(R,A,M) \equiv \text{IsAgroup}(R,A) \wedge (A \text{ is commutative on } R) \wedge $
$ \text{IsAmonoid}(R,M) \wedge IsDistributive(R,A,M)$=== , +++^[IsAgroup_def | Group_ZF ]... Definition of <nowiki>IsAgroup</nowiki>:
$ \text{IsAgroup}(G,f) \equiv $
$ (\text{IsAmonoid}(G,f) \wedge (\forall g\in G.\ \exists b\in G.\ f\langle g,b\rangle = TheNeutralElement(G,f)))$=== , +++^[IsAmonoid_def | Monoid_ZF ]... Definition of <nowiki>IsAmonoid</nowiki>:
$ \text{IsAmonoid}(G,f) \equiv $
$ f \text{ is associative on } G \wedge $
$ (\exists e\in G.\ (\forall g\in G.\ ( (f(\langle e,g\rangle ) = g) \wedge (f(\langle g,e\rangle ) = g))))$=== , +++^[Field_ZF_1_L2 | Field_ZF ]... ''lemma'' ''(in'' field0'')'' <nowiki>Field_ZF_1_L2</nowiki>: '' shows '' $ K_0 \text{ is closed under } M$ ===
''then '' ''have'' $ f \text{ is associative on } K_0$ ''using'' +++^[func_ZF_4_L3 | func_ZF ]... ''lemma'' <nowiki>func_ZF_4_L3</nowiki>: ''assumes '' $ f \text{ is associative on } X$ ''and'' $ A\subseteq X$ ''and'' $ A \text{ is closed under } f$ '' shows '' $ restrict(f,A\times A) \text{ is associative on } A$ ===
''moreover'' ''from '' not_triv ''have'' I: $ 1 \in K_0 \wedge (\forall a\in K_0.\ f\langle 1 ,a\rangle = a \wedge f\langle a,1 \rangle = a)$ ''using'' +++^[Ring_ZF_1_L2 | Ring_ZF ]... ''lemma'' ''(in'' ring0'')'' <nowiki>Ring_ZF_1_L2</nowiki>: '' shows '' $ 0 \in R$, $ 1 \in R$, $ ( - 0 ) = 0 $ === , +++^[Ring_ZF_1_L3 | Ring_ZF ]... ''lemma'' ''(in'' ring0'')'' <nowiki>Ring_ZF_1_L3</nowiki>: ''assumes '' $ a\in R$ '' shows '' $ ( - a) \in R$, $ ( - ( - a)) = a$, $ a + 0 = a$, $ 0 + a = a$, $ a\cdot 1 = a$,
$ 1 \cdot a = a$, $ a - a = 0 $, $ a - 0 = a$, $ 2 \cdot a = a + a$, $ ( - a) + a = 0 $ ===
''then '' ''have'' $ \exists n\in K_0.\ \forall a\in K_0.\ f\langle n,a\rangle = a \wedge f\langle a,n\rangle = a$
''ultimately '' ''have'' II: $ \text{IsAmonoid}(K_0,f)$ ''using'' +++^[IsAmonoid_def | Monoid_ZF ]... Definition of <nowiki>IsAmonoid</nowiki>:
$ \text{IsAmonoid}(G,f) \equiv $
$ f \text{ is associative on } G \wedge $
$ (\exists e\in G.\ (\forall g\in G.\ ( (f(\langle e,g\rangle ) = g) \wedge (f(\langle g,e\rangle ) = g))))$===
''then '' ''have'' $ monoid0(K_0,f)$ ''using'' <nowiki>monoid0_def</nowiki>
''moreover'' ''note '' I
''ultimately '' ''show'' $ 1 = TheNeutralElement(K_0,f)$ '' by (rule '' +++^[group0_1_L4 | Monoid_ZF ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>group0_1_L4</nowiki>: ''assumes '' $ e \in G \wedge (\forall g\in G.\ e \oplus g = g \wedge g \oplus e = g)$ '' shows '' $ e = TheNeutralElement(G,f)$ === '')''
''then '' ''have'' $ \forall a\in K_0.\ \exists b\in K_0.\ f\langle a,b\rangle = TheNeutralElement(K_0,f)$ ''using'' +++^[Field_ZF_1_L3 | Field_ZF ]... ''lemma'' ''(in'' field0'')'' <nowiki>Field_ZF_1_L3</nowiki>: ''assumes '' $ a\in K_0$ '' shows '' $ \exists b\in K_0.\ a\cdot b = 1 $ ===
''with '' II ''show'' $ \text{IsAgroup}(K_0,f)$ '' by (rule '' +++^[definition_of_group | Group_ZF ]... ''lemma'' <nowiki>definition_of_group</nowiki>: ''assumes '' $ \text{IsAmonoid}(G,f)$ ''and'' $ \forall g\in G.\ \exists b\in G.\ f\langle g,b\rangle = TheNeutralElement(G,f)$ '' shows '' $ \text{IsAgroup}(G,f)$ === '')''
''then '' ''show'' $ group0(K_0,f)$ ''using'' <nowiki>group0_def</nowiki>
''qed'' ===
The inverse of a nonzero field element is nonzero.
''lemma'' ''(in'' field0'')'' <nowiki>Field_ZF_1_L5</nowiki>:
'' assumes '' A1: $ a\in K$, $ a\neq 0 $ '' shows '' $ a^{-1} \in K_0$, $ (a^{-1})^2 \in K_0$, $ a^{-1} \in K$, $ a^{-1} \neq 0 $+++[proof ]>
''from '' A1 ''have'' $ a \in K_0$
''then '' ''show'' $ a^{-1} \in K_0$ ''using'' +++^[Field_ZF_1_L4 | Field_ZF ]... ''theorem'' ''(in'' field0'')'' <nowiki>Field_ZF_1_L4</nowiki>: '' shows '' $ \text{IsAgroup}(K_0,restrict(M,K_0\times K_0))$,
$ group0(K_0,restrict(M,K_0\times K_0))$, $ 1 = TheNeutralElement(K_0,restrict(M,K_0\times K_0))$ === , +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ ===
''then '' ''show'' $ (a^{-1})^2 \in K_0$, $ a^{-1} \in K$, $ a^{-1} \neq 0 $ ''using'' +++^[Field_ZF_1_L2 | Field_ZF ]... ''lemma'' ''(in'' field0'')'' <nowiki>Field_ZF_1_L2</nowiki>: '' shows '' $ K_0 \text{ is closed under } M$ === , +++^[IsOpClosed_def | func_ZF ]... Definition of <nowiki>IsOpClosed</nowiki>:
$ A \text{ is closed under } f \equiv \forall x\in A.\ \forall y\in A.\ f\langle x,y\rangle \in A$===
''qed'' ===
The inverse is really the inverse.
''lemma'' ''(in'' field0'')'' <nowiki>Field_ZF_1_L6</nowiki>:
'' assumes '' A1: $ a\in K$, $ a\neq 0 $ '' shows '' $ a\cdot a^{-1} = 1 $, $ a^{-1}\cdot a = 1 $+++[proof ]>
''let '' $ f = restrict(M,K_0\times K_0)$
''from '' A1 ''have'' $ group0(K_0,f)$, $ a \in K_0$ ''using'' +++^[Field_ZF_1_L4 | Field_ZF ]... ''theorem'' ''(in'' field0'')'' <nowiki>Field_ZF_1_L4</nowiki>: '' shows '' $ \text{IsAgroup}(K_0,restrict(M,K_0\times K_0))$,
$ group0(K_0,restrict(M,K_0\times K_0))$, $ 1 = TheNeutralElement(K_0,restrict(M,K_0\times K_0))$ ===
''then '' ''have'' $ f\langle a,GroupInv(K_0, f)(a)\rangle = TheNeutralElement(K_0,f) \wedge $
$ f\langle GroupInv(K_0,f)(a),a\rangle = TheNeutralElement(K_0, f)$ '' by (rule '' +++^[group0_2_L6 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L6</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x\cdot x^{-1} = 1 \wedge x^{-1}\cdot x = 1 $ === '')''
''with '' A1 ''show'' $ a\cdot a^{-1} = 1 $, $ a^{-1}\cdot a = 1 $ ''using'' +++^[Field_ZF_1_L5 | Field_ZF ]... ''lemma'' ''(in'' field0'')'' <nowiki>Field_ZF_1_L5</nowiki>: ''assumes '' $ a\in K$, $ a\neq 0 $ '' shows '' $ a^{-1} \in K_0$, $ (a^{-1})^2 \in K_0$, $ a^{-1} \in K$, $ a^{-1} \neq 0 $ === , +++^[Field_ZF_1_L4 | Field_ZF ]... ''theorem'' ''(in'' field0'')'' <nowiki>Field_ZF_1_L4</nowiki>: '' shows '' $ \text{IsAgroup}(K_0,restrict(M,K_0\times K_0))$,
$ group0(K_0,restrict(M,K_0\times K_0))$, $ 1 = TheNeutralElement(K_0,restrict(M,K_0\times K_0))$ ===
''qed'' ===
A lemma with two field elements and cancelling.
''lemma'' ''(in'' field0'')'' <nowiki>Field_ZF_1_L7</nowiki>:
'' assumes '' $ a\in K$, $ b\in K$, $ b\neq 0 $ '' shows '' $ a\cdot b\cdot b^{-1} = a$, $ a\cdot b^{-1}\cdot b = a$ ''using'' <nowiki>assms</nowiki> , +++^[Field_ZF_1_L5 | Field_ZF ]... ''lemma'' ''(in'' field0'')'' <nowiki>Field_ZF_1_L5</nowiki>: ''assumes '' $ a\in K$, $ a\neq 0 $ '' shows '' $ a^{-1} \in K_0$, $ (a^{-1})^2 \in K_0$, $ a^{-1} \in K$, $ a^{-1} \neq 0 $ === , +++^[Ring_ZF_1_L11 | Ring_ZF ]... ''lemma'' ''(in'' ring0'')'' <nowiki>Ring_ZF_1_L11</nowiki>: ''assumes '' $ a\in R$, $ b\in R$, $ c\in R$ '' shows '' $ a + b + c = a + (b + c)$, $ a\cdot b\cdot c = a\cdot (b\cdot c)$ === , +++^[Field_ZF_1_L6 | Field_ZF ]... ''lemma'' ''(in'' field0'')'' <nowiki>Field_ZF_1_L6</nowiki>: ''assumes '' $ a\in K$, $ a\neq 0 $ '' shows '' $ a\cdot a^{-1} = 1 $, $ a^{-1}\cdot a = 1 $ === , +++^[Ring_ZF_1_L3 | Ring_ZF ]... ''lemma'' ''(in'' ring0'')'' <nowiki>Ring_ZF_1_L3</nowiki>: ''assumes '' $ a\in R$ '' shows '' $ ( - a) \in R$, $ ( - ( - a)) = a$, $ a + 0 = a$, $ 0 + a = a$, $ a\cdot 1 = a$,
$ 1 \cdot a = a$, $ a - a = 0 $, $ a - 0 = a$, $ 2 \cdot a = a + a$, $ ( - a) + a = 0 $ ===
!Equations and identities
This section deals with more specialized identities that are true in fields.
$a/(a^2) = a$.
''lemma'' ''(in'' field0'')'' <nowiki>Field_ZF_2_L1</nowiki>:
'' assumes '' A1: $ a\in K$, $ a\neq 0 $ '' shows '' $ a\cdot (a^{-1})^2 = a^{-1}$+++[proof ]>
''have'' $ a\cdot (a^{-1})^2 = a\cdot (a^{-1}\cdot a^{-1})$
''also'' ''from '' A1 ''have'' $ \ldots = (a\cdot a^{-1})\cdot a^{-1}$ ''using'' +++^[Field_ZF_1_L5 | Field_ZF ]... ''lemma'' ''(in'' field0'')'' <nowiki>Field_ZF_1_L5</nowiki>: ''assumes '' $ a\in K$, $ a\neq 0 $ '' shows '' $ a^{-1} \in K_0$, $ (a^{-1})^2 \in K_0$, $ a^{-1} \in K$, $ a^{-1} \neq 0 $ === , +++^[Ring_ZF_1_L11 | Ring_ZF ]... ''lemma'' ''(in'' ring0'')'' <nowiki>Ring_ZF_1_L11</nowiki>: ''assumes '' $ a\in R$, $ b\in R$, $ c\in R$ '' shows '' $ a + b + c = a + (b + c)$, $ a\cdot b\cdot c = a\cdot (b\cdot c)$ ===
''also'' ''from '' A1 ''have'' $ \ldots = a^{-1}$ ''using'' +++^[Field_ZF_1_L6 | Field_ZF ]... ''lemma'' ''(in'' field0'')'' <nowiki>Field_ZF_1_L6</nowiki>: ''assumes '' $ a\in K$, $ a\neq 0 $ '' shows '' $ a\cdot a^{-1} = 1 $, $ a^{-1}\cdot a = 1 $ === , +++^[Field_ZF_1_L5 | Field_ZF ]... ''lemma'' ''(in'' field0'')'' <nowiki>Field_ZF_1_L5</nowiki>: ''assumes '' $ a\in K$, $ a\neq 0 $ '' shows '' $ a^{-1} \in K_0$, $ (a^{-1})^2 \in K_0$, $ a^{-1} \in K$, $ a^{-1} \neq 0 $ === , +++^[Ring_ZF_1_L3 | Ring_ZF ]... ''lemma'' ''(in'' ring0'')'' <nowiki>Ring_ZF_1_L3</nowiki>: ''assumes '' $ a\in R$ '' shows '' $ ( - a) \in R$, $ ( - ( - a)) = a$, $ a + 0 = a$, $ 0 + a = a$, $ a\cdot 1 = a$,
$ 1 \cdot a = a$, $ a - a = 0 $, $ a - 0 = a$, $ 2 \cdot a = a + a$, $ ( - a) + a = 0 $ ===
''finally '' ''show'' $ a\cdot (a^{-1})^2 = a^{-1}$
''qed'' ===
If we multiply two different numbers by a nonzero number, the results will be different.
''lemma'' ''(in'' field0'')'' <nowiki>Field_ZF_2_L2</nowiki>:
'' assumes '' $ a\in K$, $ b\in K$, $ c\in K$, $ a\neq b$, $ c\neq 0 $ '' shows '' $ a\cdot c^{-1} \neq b\cdot c^{-1}$ ''using'' <nowiki>assms</nowiki> , +++^[field_has_no_zero_divs | Field_ZF ]... ''lemma'' ''(in'' field0'')'' <nowiki>field_has_no_zero_divs</nowiki>: '' shows '' $ HasNoZeroDivs(K,A,M)$ === , +++^[Field_ZF_1_L5 | Field_ZF ]... ''lemma'' ''(in'' field0'')'' <nowiki>Field_ZF_1_L5</nowiki>: ''assumes '' $ a\in K$, $ a\neq 0 $ '' shows '' $ a^{-1} \in K_0$, $ (a^{-1})^2 \in K_0$, $ a^{-1} \in K$, $ a^{-1} \neq 0 $ === , +++^[Ring_ZF_1_L12B | Ring_ZF ]... ''lemma'' ''(in'' ring0'')'' <nowiki>Ring_ZF_1_L12B</nowiki>: ''assumes '' $ HasNoZeroDivs(R,A,M)$, $ a\in R$, $ b\in R$, $ c\in R$, $ a\neq b$, $ c\neq 0 $ '' shows '' $ a\cdot c \neq b\cdot c$ ===
We can put a nonzero factor on the other side of non-identity (is this the best way to call it?) changing it to the inverse.
''lemma'' ''(in'' field0'')'' <nowiki>Field_ZF_2_L3</nowiki>:
'' assumes '' A1: $ a\in K$, $ b\in K$, $ b\neq 0 $, $ c\in K$ ''and '' A2: $ a\cdot b \neq c$ '' shows '' $ a \neq c\cdot b^{-1}$+++[proof ]>
''from '' A1, A2 ''have'' $ a\cdot b\cdot b^{-1} \neq c\cdot b^{-1}$ ''using'' +++^[Ring_ZF_1_L4 | Ring_ZF ]... ''lemma'' ''(in'' ring0'')'' <nowiki>Ring_ZF_1_L4</nowiki>: ''assumes '' $ a\in R$, $ b\in R$ '' shows '' $ a + b \in R$, $ a - b \in R$, $ a\cdot b \in R$, $ a + b = b + a$ === , +++^[Field_ZF_2_L2 | Field_ZF ]... ''lemma'' ''(in'' field0'')'' <nowiki>Field_ZF_2_L2</nowiki>: ''assumes '' $ a\in K$, $ b\in K$, $ c\in K$, $ a\neq b$, $ c\neq 0 $ '' shows '' $ a\cdot c^{-1} \neq b\cdot c^{-1}$ ===
''with '' A1 ''show'' $ a \neq c\cdot b^{-1}$ ''using'' +++^[Field_ZF_1_L7 | Field_ZF ]... ''lemma'' ''(in'' field0'')'' <nowiki>Field_ZF_1_L7</nowiki>: ''assumes '' $ a\in K$, $ b\in K$, $ b\neq 0 $ '' shows '' $ a\cdot b\cdot b^{-1} = a$, $ a\cdot b^{-1}\cdot b = a$ ===
''qed'' ===
If if the inverse of $b$ is different than $a$, then the inverse of $a$ is different than $b$.
''lemma'' ''(in'' field0'')'' <nowiki>Field_ZF_2_L4</nowiki>:
'' assumes '' $ a\in K$, $ a\neq 0 $ ''and '' $ b^{-1} \neq a$ '' shows '' $ a^{-1} \neq b$ ''using'' <nowiki>assms</nowiki> , +++^[Field_ZF_1_L4 | Field_ZF ]... ''theorem'' ''(in'' field0'')'' <nowiki>Field_ZF_1_L4</nowiki>: '' shows '' $ \text{IsAgroup}(K_0,restrict(M,K_0\times K_0))$,
$ group0(K_0,restrict(M,K_0\times K_0))$, $ 1 = TheNeutralElement(K_0,restrict(M,K_0\times K_0))$ === , +++^[group0_2_L11B | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L11B</nowiki>: ''assumes '' $ a\in G$ ''and'' $ b^{-1} \neq a$ '' shows '' $ a^{-1} \neq b$ ===
An identity with two field elements, one and an inverse.
''lemma'' ''(in'' field0'')'' <nowiki>Field_ZF_2_L5</nowiki>:
'' assumes '' $ a\in K$, $ b\in K$, $ b\neq 0 $ '' shows '' $ (1 + a\cdot b)\cdot b^{-1} = a + b^{-1}$ ''using'' <nowiki>assms</nowiki> , +++^[Ring_ZF_1_L4 | Ring_ZF ]... ''lemma'' ''(in'' ring0'')'' <nowiki>Ring_ZF_1_L4</nowiki>: ''assumes '' $ a\in R$, $ b\in R$ '' shows '' $ a + b \in R$, $ a - b \in R$, $ a\cdot b \in R$, $ a + b = b + a$ === , +++^[Field_ZF_1_L5 | Field_ZF ]... ''lemma'' ''(in'' field0'')'' <nowiki>Field_ZF_1_L5</nowiki>: ''assumes '' $ a\in K$, $ a\neq 0 $ '' shows '' $ a^{-1} \in K_0$, $ (a^{-1})^2 \in K_0$, $ a^{-1} \in K$, $ a^{-1} \neq 0 $ === , +++^[Ring_ZF_1_L2 | Ring_ZF ]... ''lemma'' ''(in'' ring0'')'' <nowiki>Ring_ZF_1_L2</nowiki>: '' shows '' $ 0 \in R$, $ 1 \in R$, $ ( - 0 ) = 0 $ === , +++^[ring_oper_distr | Ring_ZF ]... ''lemma'' ''(in'' ring0'')'' <nowiki>ring_oper_distr</nowiki>: ''assumes '' $ a\in R$, $ b\in R$, $ c\in R$ '' shows '' $ a\cdot (b + c) = a\cdot b + a\cdot c$, $ (b + c)\cdot a = b\cdot a + c\cdot a$ === , +++^[Field_ZF_1_L7 | Field_ZF ]... ''lemma'' ''(in'' field0'')'' <nowiki>Field_ZF_1_L7</nowiki>: ''assumes '' $ a\in K$, $ b\in K$, $ b\neq 0 $ '' shows '' $ a\cdot b\cdot b^{-1} = a$, $ a\cdot b^{-1}\cdot b = a$ === , +++^[Ring_ZF_1_L3 | Ring_ZF ]... ''lemma'' ''(in'' ring0'')'' <nowiki>Ring_ZF_1_L3</nowiki>: ''assumes '' $ a\in R$ '' shows '' $ ( - a) \in R$, $ ( - ( - a)) = a$, $ a + 0 = a$, $ 0 + a = a$, $ a\cdot 1 = a$,
$ 1 \cdot a = a$, $ a - a = 0 $, $ a - 0 = a$, $ 2 \cdot a = a + a$, $ ( - a) + a = 0 $ ===
An identity with three field elements, inverse and cancelling.
''lemma'' ''(in'' field0'')'' <nowiki>Field_ZF_2_L6</nowiki>:
'' assumes '' A1: $ a\in K$, $ b\in K$, $ b\neq 0 $, $ c\in K$ '' shows '' $ a\cdot b\cdot (c\cdot b^{-1}) = a\cdot c$+++[proof ]>
''from '' A1 ''have'' T: $ a\cdot b \in K$, $ b^{-1} \in K$ ''using'' +++^[Ring_ZF_1_L4 | Ring_ZF ]... ''lemma'' ''(in'' ring0'')'' <nowiki>Ring_ZF_1_L4</nowiki>: ''assumes '' $ a\in R$, $ b\in R$ '' shows '' $ a + b \in R$, $ a - b \in R$, $ a\cdot b \in R$, $ a + b = b + a$ === , +++^[Field_ZF_1_L5 | Field_ZF ]... ''lemma'' ''(in'' field0'')'' <nowiki>Field_ZF_1_L5</nowiki>: ''assumes '' $ a\in K$, $ a\neq 0 $ '' shows '' $ a^{-1} \in K_0$, $ (a^{-1})^2 \in K_0$, $ a^{-1} \in K$, $ a^{-1} \neq 0 $ ===
''with '' mult_commute, A1 ''have'' $ a\cdot b\cdot (c\cdot b^{-1}) = a\cdot b\cdot (b^{-1}\cdot c)$ ''using'' +++^[IsCommutative_def | func_ZF ]... Definition of <nowiki>IsCommutative</nowiki>:
$ f \text{ is commutative on } G \equiv \forall x\in G.\ \forall y\in G.\ f\langle x,y\rangle = f\langle y,x\rangle $===
''moreover'' ''from '' A1, T ''have'' $ a\cdot b \in K$, $ b^{-1} \in K$, $ c\in K$
''then '' ''have'' $ a\cdot b\cdot b^{-1}\cdot c = a\cdot b\cdot (b^{-1}\cdot c)$ '' by (rule '' +++^[Ring_ZF_1_L11 | Ring_ZF ]... ''lemma'' ''(in'' ring0'')'' <nowiki>Ring_ZF_1_L11</nowiki>: ''assumes '' $ a\in R$, $ b\in R$, $ c\in R$ '' shows '' $ a + b + c = a + (b + c)$, $ a\cdot b\cdot c = a\cdot (b\cdot c)$ === '')''
''ultimately '' ''have'' $ a\cdot b\cdot (c\cdot b^{-1}) = a\cdot b\cdot b^{-1}\cdot c$
''with '' A1 ''show'' $ a\cdot b\cdot (c\cdot b^{-1}) = a\cdot c$ ''using'' +++^[Field_ZF_1_L7 | Field_ZF ]... ''lemma'' ''(in'' field0'')'' <nowiki>Field_ZF_1_L7</nowiki>: ''assumes '' $ a\in K$, $ b\in K$, $ b\neq 0 $ '' shows '' $ a\cdot b\cdot b^{-1} = a$, $ a\cdot b^{-1}\cdot b = a$ ===
''qed'' ===
''end
'' +++![Comments on Field_ZF|click to add comment] <html> <div> <iframe style="width:60%;height:500px" src="http://www.haloscan.com/comments/slawekk/Field_ZF"></iframe> </div> </html>
===
''theory'' FinOrd_ZF ''imports'' [[Finite_ZF]] [[func_ZF_1]]
''begin
''
This theory file contains properties of finite sets related to order relations. Part of this is similar to what is done in //Finite_ZF_1// except that the development is based on the notion of finite powerset defined in //Finite_ZF// rather the one defined in standard Isabelle //Finite// theory.
!Finite vs. bounded sets
The goal of this section is to show that finite sets are bounded and have maxima and minima.
For total and transitive relations nonempty finite set has a maximum.
''theorem'' <nowiki>fin_has_max</nowiki>:
'' assumes '' A1: $ r \text{ is total on } X$ ''and '' A2: $ trans(r)$ ''and '' A3: $ B \in FinPow(X)$ ''and '' A4: $ B \neq 0$ '' shows '' $ HasAmaximum(r,B)$+++[proof ]>
''have'' $ 0=0 \vee HasAmaximum(r,0)$
''moreover'' ''have'' $ \forall A \in FinPow(X).\ A=0 \vee HasAmaximum(r,A) \longrightarrow $
$ (\forall x\in X.\ (A \cup \{x\}) = 0 \vee HasAmaximum(r,A \cup \{x\}))$+++[proof ]>
++++[{ ]>
''fix '' $ A$
''assume '' $ A \in FinPow(X)$, $ A = 0 \vee HasAmaximum(r,A)$
''have'' $ \forall x\in X.\ (A \cup \{x\}) = 0 \vee HasAmaximum(r,A \cup \{x\})$+++[proof ]>
++++[{ ]>
''fix '' $ x$
''assume '' $ x\in X$
''note '' $ A = 0 \vee HasAmaximum(r,A)$
''moreover'' ++++[{ ]>
''assume '' $ A = 0$
''then '' ''have'' $ A\cup \{x\} = \{x\}$
''from '' A1 ''have'' $ refl(X,r)$ ''using'' +++^[total_is_refl | Order_ZF ]... ''lemma'' <nowiki>total_is_refl</nowiki>: ''assumes '' $ r \text{ is total on } X$ '' shows '' $ refl(X,r)$ ===
''with '' $ x\in X$, $ A\cup \{x\} = \{x\}$ ''have'' $ HasAmaximum(r,A\cup \{x\})$ ''using'' +++^[Order_ZF_4_L8 | Order_ZF_1a ]... ''lemma'' <nowiki>Order_ZF_4_L8</nowiki>: ''assumes '' $ refl(X,r)$ ''and'' $ a\in X$ '' shows '' $ HasAmaximum(r,\{a\})$, $ HasAminimum(r,\{a\})$ ===
=== ''}''
''moreover'' ++++[{ ]>
''assume '' $ HasAmaximum(r,A)$
''with '' A1, A2, $ A \in FinPow(X)$, $ x\in X$ ''have'' $ HasAmaximum(r,A\cup \{x\})$ ''using'' +++^[FinPow_def | Finite_ZF ]... Definition of <nowiki>FinPow</nowiki>:
$ FinPow(X) \equiv \{A \in Pow(X).\ Finite(A)\}$=== , +++^[Order_ZF_4_L9 | Order_ZF_1a ]... ''lemma'' <nowiki>Order_ZF_4_L9</nowiki>: ''assumes '' $ r \text{ is total on } X$ ''and'' $ trans(r)$ ''and'' $ A\subseteq X$ ''and'' $ a\in X$ ''and'' $ HasAmaximum(r,A)$ '' shows '' $ HasAmaximum(r,A\cup \{a\})$ ===
=== ''}''
''ultimately '' ''have'' $ A \cup \{x\} = 0 \vee HasAmaximum(r,A \cup \{x\})$
=== ''}''
''thus'' $ \forall x\in X.\ (A \cup \{x\}) = 0 \vee HasAmaximum(r,A \cup \{x\})$
''qed'' ===
=== ''}''
''thus'' $ thesis$
''qed'' ===
''moreover'' ''note '' A3
''ultimately '' ''have'' $ B = 0 \vee HasAmaximum(r,B)$ '' by (rule '' +++^[FinPow_induct | Finite_ZF ]... ''theorem'' <nowiki>FinPow_induct</nowiki>: ''assumes '' $ P(0)$ ''and'' $ \forall A \in FinPow(X).\ P(A) \longrightarrow (\forall a\in X.\ P(A \cup \{a\}))$ ''and'' $ B \in FinPow(X)$ '' shows '' $ P(B)$ === '')''
''with '' A4 ''show'' $ HasAmaximum(r,B)$
''qed'' ===
For linearly ordered nonempty finite sets the maximum is in the set and indeed it is the greatest element of the set.
''lemma'' <nowiki>linord_max_props</nowiki>:
'' assumes '' A1: $ IsLinOrder(X,r)$ ''and '' A2: $ A \in FinPow(X)$, $ A \neq 0$ '' shows '' $ Maximum(r,A) \in A$, $ Maximum(r,A) \in X$, $ \forall a\in A.\ \langle a,Maximum(r,A)\rangle \in r$+++[proof ]>
''from '' A1, A2 ''show'' $ Maximum(r,A) \in A$ ''and '' $ \forall a\in A.\ \langle a,Maximum(r,A)\rangle \in r$ ''using'' +++^[IsLinOrder_def | Order_ZF ]... Definition of <nowiki>IsLinOrder</nowiki>:
$ IsLinOrder(X,r) \equiv ( antisym(r) \wedge trans(r) \wedge (r \text{ is total on } X))$=== , +++^[fin_has_max | FinOrd_ZF ]... ''theorem'' <nowiki>fin_has_max</nowiki>: ''assumes '' $ r \text{ is total on } X$ ''and'' $ trans(r)$ ''and'' $ B \in FinPow(X)$ ''and'' $ B \neq 0$ '' shows '' $ HasAmaximum(r,B)$ === , +++^[Order_ZF_4_L3 | Order_ZF_1a ]... ''lemma'' <nowiki>Order_ZF_4_L3</nowiki>: ''assumes '' $ antisym(r)$ ''and'' $ HasAmaximum(r,A)$ '' shows '' $ Maximum(r,A) \in A$, $ \forall x\in A.\ \langle x,Maximum(r,A)\rangle \in r$ ===
''with '' A2 ''show'' $ Maximum(r,A) \in X$ ''using'' +++^[FinPow_def | Finite_ZF ]... Definition of <nowiki>FinPow</nowiki>:
$ FinPow(X) \equiv \{A \in Pow(X).\ Finite(A)\}$===
''qed'' ===
!Order isomorphisms of finite sets
In this section we eastablish that if two linearly ordered finite sets have the same number of elements, then they are order-isomorphic and the isomorphism is unique. This allows us to talk about ''enumeration'' of a linearly ordered finite set. We define the enumeration as the order isomorphism between the number of elements of the set (which is a natural number $n = \{0,1,..,n-1\}$) and the set.
A really weird corner case - empty set is order isomorphic with itself.
''lemma'' <nowiki>empty_ord_iso</nowiki>:
'' shows '' $ ord\_iso(0,r,0,R) \neq 0$+++[proof ]>
''have'' $ 0 \approx 0$ ''using'' <nowiki>eqpoll_refl</nowiki>
''then '' ''obtain '' $ f$ ''where '' $ f \in bij(0,0)$ ''using'' <nowiki>eqpoll_def</nowiki>
''then '' ''show'' $ thesis$ ''using'' <nowiki>ord_iso_def</nowiki>
''qed'' ===
Even weirder than //empty_ord_iso// The order automorphism of the empty set is unique.
''lemma'' <nowiki>empty_ord_iso_uniq</nowiki>:
'' assumes '' $ f \in ord\_iso(0,r,0,R)$, $ g \in ord\_iso(0,r,0,R)$ '' shows '' $ f = g$+++[proof ]>
''from '' assms ''have'' $ f : 0 \rightarrow 0$ ''and '' $ g: 0 \rightarrow 0$ ''using'' <nowiki>ord_iso_def</nowiki> , <nowiki>bij_def</nowiki> , <nowiki>surj_def</nowiki>
''moreover'' ''have'' $ \forall x\in 0.\ f(x) = g(x)$
''ultimately '' ''show'' $ f = g$ '' by (rule '' +++^[func_eq | func1 ]... ''lemma'' <nowiki>func_eq</nowiki>: ''assumes '' $ f: X\rightarrow Y$, $ g: X\rightarrow Z$ ''and'' $ \forall x\in X.\ f(x) = g(x)$ '' shows '' $ f = g$ === '')''
''qed'' ===
The empty set is the only order automorphism of itself.
''lemma'' <nowiki>empty_ord_iso_empty</nowiki>:
'' shows '' $ ord\_iso(0,r,0,R) = \{0\}$+++[proof ]>
''have'' $ 0 \in ord\_iso(0,r,0,R)$+++[proof ]>
''have'' $ ord\_iso(0,r,0,R) \neq 0$ '' by (rule '' +++^[empty_ord_iso | FinOrd_ZF ]... ''lemma'' <nowiki>empty_ord_iso</nowiki>: '' shows '' $ ord\_iso(0,r,0,R) \neq 0$ === '')''
''then '' ''obtain '' $ f$ ''where '' $ f \in ord\_iso(0,r,0,R)$
''then '' ''show'' $ 0 \in ord\_iso(0,r,0,R)$ ''using'' <nowiki>ord_iso_def</nowiki> , <nowiki>bij_def</nowiki> , <nowiki>surj_def</nowiki> , +++^[fun_subset_prod | func1 ]... ''lemma'' <nowiki>fun_subset_prod</nowiki>: ''assumes '' $ f:X\rightarrow Y$ '' shows '' $ f \subseteq X\times Y$ ===
''qed'' ===
''then '' ''show'' $ ord\_iso(0,r,0,R) = \{0\}$ ''using'' +++^[empty_ord_iso_uniq | FinOrd_ZF ]... ''lemma'' <nowiki>empty_ord_iso_uniq</nowiki>: ''assumes '' $ f \in ord\_iso(0,r,0,R)$, $ g \in ord\_iso(0,r,0,R)$ '' shows '' $ f = g$ ===
''qed'' ===
An induction (or maybe recursion?) scheme for linearly ordered sets. The induction step is that we show that if the property holds when the set is a singleton or for a set with the maximum removed, then it holds for the set. The idea is that since we can build any finite set by adding elements on the right, then if the property holds for the empty set and is invariant with respect to this operation. it must hold for all finite sets.
''lemma'' <nowiki>fin_ord_induction</nowiki>:
'' assumes '' A1: $ IsLinOrder(X,r)$ ''and '' A2: $ P(0)$ ''and '' A3: $ \forall A \in FinPow(X).\ A \neq 0 \longrightarrow (P(A - \{Maximum(r,A)\}) \longrightarrow P(A))$ ''and '' A4: $ B \in FinPow(X)$ '' shows '' $ P(B)$+++[proof ]>
''note '' A2
''moreover'' ''have'' $ \forall A \in FinPow(X).\ A \neq 0 \longrightarrow (\exists a\in A.\ P(A-\{a\}) \longrightarrow P(A))$+++[proof ]>
++++[{ ]>
''fix '' $ A$
''assume '' $ A \in FinPow(X)$ ''and '' $ A \neq 0$
''with '' A1, A3 ''have'' $ \exists a\in A.\ P(A-\{a\}) \longrightarrow P(A)$ ''using'' +++^[IsLinOrder_def | Order_ZF ]... Definition of <nowiki>IsLinOrder</nowiki>:
$ IsLinOrder(X,r) \equiv ( antisym(r) \wedge trans(r) \wedge (r \text{ is total on } X))$=== , +++^[fin_has_max | FinOrd_ZF ]... ''theorem'' <nowiki>fin_has_max</nowiki>: ''assumes '' $ r \text{ is total on } X$ ''and'' $ trans(r)$ ''and'' $ B \in FinPow(X)$ ''and'' $ B \neq 0$ '' shows '' $ HasAmaximum(r,B)$ === , +++^[IsLinOrder_def | Order_ZF ]... Definition of <nowiki>IsLinOrder</nowiki>:
$ IsLinOrder(X,r) \equiv ( antisym(r) \wedge trans(r) \wedge (r \text{ is total on } X))$=== , +++^[Order_ZF_4_L3 | Order_ZF_1a ]... ''lemma'' <nowiki>Order_ZF_4_L3</nowiki>: ''assumes '' $ antisym(r)$ ''and'' $ HasAmaximum(r,A)$ '' shows '' $ Maximum(r,A) \in A$, $ \forall x\in A.\ \langle x,Maximum(r,A)\rangle \in r$ ===
=== ''}''
''thus'' $ thesis$
''qed'' ===
''moreover'' ''note '' A4
''ultimately '' ''show'' $ P(B)$ '' by (rule '' +++^[FinPow_ind_rem_one | Finite_ZF ]... ''lemma'' <nowiki>FinPow_ind_rem_one</nowiki>: ''assumes '' $ P(0)$ ''and'' $ \forall A \in FinPow(X).\ A \neq 0 \longrightarrow (\exists a\in A.\ P(A-\{a\}) \longrightarrow P(A))$
''and'' $ B \in FinPow(X)$ '' shows '' $ P(B)$ === '')''
''qed'' ===
A sligltly more complicated version of //fin_ord_induction// that allows to prove properties that are not true for the empty set.
''lemma'' <nowiki>fin_ord_ind</nowiki>:
'' assumes '' A1: $ IsLinOrder(X,r)$ ''and '' A2: $ \forall A \in FinPow(X).\ $
$ A = 0 \vee (A = \{Maximum(r,A)\} \vee P(A - \{Maximum(r,A)\}) \longrightarrow P(A))$ ''and '' A3: $ B \in FinPow(X)$ ''and '' A4: $ B\neq 0$ '' shows '' $ P(B)$+++[proof ]>
++++[{ ]>
''fix '' $ A$
''assume '' $ A \in FinPow(X)$ ''and '' $ A \neq 0$
''with '' A1, A2 ''have'' $ \exists a\in A.\ A = \{a\} \vee P(A-\{a\}) \longrightarrow P(A)$ ''using'' +++^[IsLinOrder_def | Order_ZF ]... Definition of <nowiki>IsLinOrder</nowiki>:
$ IsLinOrder(X,r) \equiv ( antisym(r) \wedge trans(r) \wedge (r \text{ is total on } X))$=== , +++^[fin_has_max | FinOrd_ZF ]... ''theorem'' <nowiki>fin_has_max</nowiki>: ''assumes '' $ r \text{ is total on } X$ ''and'' $ trans(r)$ ''and'' $ B \in FinPow(X)$ ''and'' $ B \neq 0$ '' shows '' $ HasAmaximum(r,B)$ === , +++^[IsLinOrder_def | Order_ZF ]... Definition of <nowiki>IsLinOrder</nowiki>:
$ IsLinOrder(X,r) \equiv ( antisym(r) \wedge trans(r) \wedge (r \text{ is total on } X))$=== , +++^[Order_ZF_4_L3 | Order_ZF_1a ]... ''lemma'' <nowiki>Order_ZF_4_L3</nowiki>: ''assumes '' $ antisym(r)$ ''and'' $ HasAmaximum(r,A)$ '' shows '' $ Maximum(r,A) \in A$, $ \forall x\in A.\ \langle x,Maximum(r,A)\rangle \in r$ ===
=== ''}''
''then '' ''have'' $ \forall A \in FinPow(X).\ $
$ A = 0 \vee (\exists a\in A.\ A = \{a\} \vee P(A-\{a\}) \longrightarrow P(A))$
''with '' A3, A4 ''show'' $ P(B)$ ''using'' +++^[FinPow_rem_ind | Finite_ZF ]... ''lemma'' <nowiki>FinPow_rem_ind</nowiki>: ''assumes '' $ \forall A \in FinPow(X).\ $
$ A = 0 \vee (\exists a\in A.\ A = \{a\} \vee P(A-\{a\}) \longrightarrow P(A))$
''and'' $ A \in FinPow(X)$ ''and'' $ A\neq 0$ '' shows '' $ P(A)$ ===
''qed'' ===
Yet another induction scheme. We build and linearly ordered set by adding elements that are greater than any elements in the set.
''lemma'' <nowiki>fin_ind_add_max</nowiki>:
'' assumes '' A1: $ IsLinOrder(X,r)$ ''and '' A2: $ P(0)$ ''and '' A3: $ \forall A \in FinPow(X).\ $
$ ( \forall x \in X-A.\ P(A) \wedge (\forall a\in A.\ \langle a,x\rangle \in r ) \longrightarrow P(A \cup \{x\}))$ ''and '' A4: $ B \in FinPow(X)$ '' shows '' $ P(B)$+++[proof ]>
''note '' A1 A2
''moreover'' ''have'' $ \forall C \in FinPow(X).\ C \neq 0 \longrightarrow (P(C - \{Maximum(r,C)\}) \longrightarrow P(C))$+++[proof ]>
++++[{ ]>
''fix '' $ C$
''assume '' $ C \in FinPow(X)$ ''and '' $ C \neq 0$
''let '' $ x = Maximum(r,C)$
''let '' $ A = C - \{x\}$
''assume '' $ P(A)$
''moreover'' ''from '' $ C \in FinPow(X)$ ''have'' $ A \in FinPow(X)$ ''using'' +++^[fin_rem_point_fin | Finite_ZF ]... ''corollary'' <nowiki>fin_rem_point_fin</nowiki>: ''assumes '' $ A \in FinPow(X)$ '' shows '' $ A - \{a\} \in FinPow(X)$ ===
''moreover'' ''from '' A1, $ C \in FinPow(X)$, $ C \neq 0$ ''have'' $ x \in C$ ''and '' $ x \in X - A$ ''and '' $ \forall a\in A.\ \langle a,x\rangle \in r$ ''using'' +++^[linord_max_props | FinOrd_ZF ]... ''lemma'' <nowiki>linord_max_props</nowiki>: ''assumes '' $ IsLinOrder(X,r)$ ''and'' $ A \in FinPow(X)$, $ A \neq 0$ '' shows '' $ Maximum(r,A) \in A$,
$ Maximum(r,A) \in X$, $ \forall a\in A.\ \langle a,Maximum(r,A)\rangle \in r$ ===
''moreover'' ''note '' A3
''ultimately '' ''have'' $ P(A \cup \{x\})$
''moreover'' ''from '' $ x \in C$ ''have'' $ A \cup \{x\} = C$
''ultimately '' ''have'' $ P(C)$
=== ''}''
''thus'' $ thesis$
''qed'' ===
''moreover'' ''note '' A4
''ultimately '' ''show'' $ P(B)$ '' by (rule '' +++^[fin_ord_induction | FinOrd_ZF ]... ''lemma'' <nowiki>fin_ord_induction</nowiki>: ''assumes '' $ IsLinOrder(X,r)$ ''and'' $ P(0)$ ''and'' $ \forall A \in FinPow(X).\ A \neq 0 \longrightarrow (P(A - \{Maximum(r,A)\}) \longrightarrow P(A))$
''and'' $ B \in FinPow(X)$ '' shows '' $ P(B)$ === '')''
''qed'' ===
The only order automorphism of a linearly ordered finite set is the identity.
''theorem'' <nowiki>fin_ord_auto_id</nowiki>:
'' assumes '' A1: $ IsLinOrder(X,r)$ ''and '' A2: $ B \in FinPow(X)$ ''and '' A3: $ B\neq 0$ '' shows '' $ ord\_iso(B,r,B,r) = \{id(B)\}$+++[proof ]>
''note '' A1
''moreover'' ++++[{ ]>
''fix '' $ A$
''assume '' $ A \in FinPow(X)$, $ A\neq 0$
''let '' $ M = Maximum(r,A)$
''let '' $ A_0 = A - \{M\}$
''assume '' $ A = \{M\} \vee ord\_iso(A_0,r,A_0,r) = \{id(A_0)\}$
''moreover'' ++++[{ ]>
''assume '' $ A = \{M\}$
''have'' $ ord\_iso(\{M\},r,\{M\},r) = \{id(\{M\})\}$ ''using'' <nowiki>id_ord_auto_singleton</nowiki>
''with '' $ A = \{M\}$ ''have'' $ ord\_iso(A,r,A,r) = \{id(A)\}$
=== ''}''
''moreover'' ++++[{ ]>
''assume '' $ ord\_iso(A_0,r,A_0,r) = \{id(A_0)\}$
''have'' $ ord\_iso(A,r,A,r) = \{id(A)\}$+++[proof ]>
''show'' $ \{id(A)\} \subseteq ord\_iso(A,r,A,r)$ ''using'' <nowiki>id_ord_iso</nowiki>
++++[{ ]>
''fix '' $ f$
''assume '' $ f \in ord\_iso(A,r,A,r)$
''with '' A1, $ A \in FinPow(X)$, $ A\neq 0$ ''have'' $ restrict(f,A_0) \in ord\_iso(A_0, r, A-\{f(M)\},r)$ ''using'' +++^[IsLinOrder_def | Order_ZF ]... Definition of <nowiki>IsLinOrder</nowiki>:
$ IsLinOrder(X,r) \equiv ( antisym(r) \wedge trans(r) \wedge (r \text{ is total on } X))$=== , +++^[fin_has_max | FinOrd_ZF ]... ''theorem'' <nowiki>fin_has_max</nowiki>: ''assumes '' $ r \text{ is total on } X$ ''and'' $ trans(r)$ ''and'' $ B \in FinPow(X)$ ''and'' $ B \neq 0$ '' shows '' $ HasAmaximum(r,B)$ === , <nowiki>ord_iso_rem_max</nowiki>
''with '' A1, $ A \in FinPow(X)$, $ A\neq 0$, $ f \in ord\_iso(A,r,A,r)$, $ ord\_iso(A_0,r,A_0,r) = \{id(A_0)\}$ ''have'' $ restrict(f,A_0) = id(A_0)$ ''using'' +++^[IsLinOrder_def | Order_ZF ]... Definition of <nowiki>IsLinOrder</nowiki>:
$ IsLinOrder(X,r) \equiv ( antisym(r) \wedge trans(r) \wedge (r \text{ is total on } X))$=== , +++^[fin_has_max | FinOrd_ZF ]... ''theorem'' <nowiki>fin_has_max</nowiki>: ''assumes '' $ r \text{ is total on } X$ ''and'' $ trans(r)$ ''and'' $ B \in FinPow(X)$ ''and'' $ B \neq 0$ '' shows '' $ HasAmaximum(r,B)$ === , <nowiki>max_auto_fixpoint</nowiki>
''moreover'' ''from '' A1, $ f \in ord\_iso(A,r,A,r)$, $ A \in FinPow(X)$, $ A\neq 0$ ''have'' $ f : A \rightarrow A$ ''and '' $ M \in A$ ''and '' $ f(M) = M$ ''using'' <nowiki>ord_iso_def</nowiki> , <nowiki>bij_is_fun</nowiki> , +++^[IsLinOrder_def | Order_ZF ]... Definition of <nowiki>IsLinOrder</nowiki>:
$ IsLinOrder(X,r) \equiv ( antisym(r) \wedge trans(r) \wedge (r \text{ is total on } X))$=== , +++^[fin_has_max | FinOrd_ZF ]... ''theorem'' <nowiki>fin_has_max</nowiki>: ''assumes '' $ r \text{ is total on } X$ ''and'' $ trans(r)$ ''and'' $ B \in FinPow(X)$ ''and'' $ B \neq 0$ '' shows '' $ HasAmaximum(r,B)$ === , +++^[Order_ZF_4_L3 | Order_ZF_1a ]... ''lemma'' <nowiki>Order_ZF_4_L3</nowiki>: ''assumes '' $ antisym(r)$ ''and'' $ HasAmaximum(r,A)$ '' shows '' $ Maximum(r,A) \in A$, $ \forall x\in A.\ \langle x,Maximum(r,A)\rangle \in r$ === , <nowiki>max_auto_fixpoint</nowiki>
''ultimately '' ''have'' $ f = id(A)$ ''using'' +++^[id_fixpoint_rem | func_ZF ]... ''lemma'' <nowiki>id_fixpoint_rem</nowiki>: ''assumes '' $ f:X\rightarrow X$ ''and'' $ p\in X$ ''and'' $ f(p) = p$ ''and'' $ restrict(f, X-\{p\}) = id(X-\{p\})$ '' shows '' $ f = id(X)$ ===
=== ''}''
''then '' ''show'' $ ord\_iso(A,r,A,r) \subseteq \{id(A)\}$
''qed'' ===
=== ''}''
''ultimately '' ''have'' $ ord\_iso(A,r,A,r) = \{id(A)\}$
=== ''}''
''then '' ''have'' $ \forall A \in FinPow(X).\ A = 0 \vee $
$ (A = \{Maximum(r,A)\} \vee $
$ ord\_iso(A-\{Maximum(r,A)\},r,A-\{Maximum(r,A)\},r) = $
$ \{id(A-\{Maximum(r,A)\})\} \longrightarrow ord\_iso(A,r,A,r) = \{id(A)\})$
''moreover'' ''note '' A2 A3
''ultimately '' ''show'' $ ord\_iso(B,r,B,r) = \{id(B)\}$ '' by (rule '' +++^[fin_ord_ind | FinOrd_ZF ]... ''lemma'' <nowiki>fin_ord_ind</nowiki>: ''assumes '' $ IsLinOrder(X,r)$ ''and'' $ \forall A \in FinPow(X).\ $
$ A = 0 \vee (A = \{Maximum(r,A)\} \vee P(A - \{Maximum(r,A)\}) \longrightarrow P(A))$
''and'' $ B \in FinPow(X)$ ''and'' $ B\neq 0$ '' shows '' $ P(B)$ === '')''
''qed'' ===
Every two finite linearly ordered sets are order isomorphic. The statement is formulated to make the proof by induction on the size of the set easier, see //fin_ord_iso_ex// for an alternative formulation.
''lemma'' <nowiki>fin_order_iso</nowiki>:
'' assumes '' A1: $ IsLinOrder(X,r)$, $ IsLinOrder(Y,R)$ ''and '' A2: $ n \in nat$ '' shows '' $ \forall A \in FinPow(X).\ \forall B \in FinPow(Y).\ $
$ A \approx n \wedge B \approx n \longrightarrow ord\_iso(A,r,B,R) \neq 0$+++[proof ]>
''note '' A2
''moreover'' ''have'' $ \forall A \in FinPow(X).\ \forall B \in FinPow(Y).\ $
$ A \approx 0 \wedge B \approx 0 \longrightarrow ord\_iso(A,r,B,R) \neq 0$ ''using'' <nowiki>eqpoll_0_is_0</nowiki> , +++^[empty_ord_iso | FinOrd_ZF ]... ''lemma'' <nowiki>empty_ord_iso</nowiki>: '' shows '' $ ord\_iso(0,r,0,R) \neq 0$ ===
''moreover'' ''have'' $ \forall k \in nat.\ $
$ (\forall A \in FinPow(X).\ \forall B \in FinPow(Y).\ $
$ A \approx k \wedge B \approx k \longrightarrow ord\_iso(A,r,B,R) \neq 0) \longrightarrow $
$ (\forall C \in FinPow(X).\ \forall D \in FinPow(Y).\ $
$ C \approx succ(k) \wedge D \approx succ(k) \longrightarrow ord\_iso(C,r,D,R) \neq 0)$+++[proof ]>
++++[{ ]>
''fix '' $ k$
''assume '' $ k \in nat$
''assume '' A3: $ \forall A \in FinPow(X).\ \forall B \in FinPow(Y).\ $
$ A \approx k \wedge B \approx k \longrightarrow ord\_iso(A,r,B,R) \neq 0$
''have'' $ \forall C \in FinPow(X).\ \forall D \in FinPow(Y).\ $
$ C \approx succ(k) \wedge D \approx succ(k) \longrightarrow ord\_iso(C,r,D,R) \neq 0$+++[proof ]>
++++[{ ]>
''fix '' $ C$
''assume '' $ C \in FinPow(X)$
''fix '' $ D$
''assume '' $ D \in FinPow(Y)$
''assume '' $ C \approx succ(k)$, $ D \approx succ(k)$
''then '' ''have'' $ C \neq 0$ ''and '' $ D\neq 0$ ''using'' <nowiki>eqpoll_succ_imp_not_empty</nowiki>
''let '' $ M_C = Maximum(r,C)$
''let '' $ M_D = Maximum(R,D)$
''let '' $ C_0 = C - \{M_C\}$
''let '' $ D_0 = D - \{M_D\}$
''from '' $ C \in FinPow(X)$ ''have'' $ C \subseteq X$ ''using'' +++^[FinPow_def | Finite_ZF ]... Definition of <nowiki>FinPow</nowiki>:
$ FinPow(X) \equiv \{A \in Pow(X).\ Finite(A)\}$===
''with '' A1 ''have'' $ IsLinOrder(C,r)$ ''using'' +++^[ord_linear_subset | Order_ZF ]... ''lemma'' <nowiki>ord_linear_subset</nowiki>: ''assumes '' $ IsLinOrder(X,r)$ ''and'' $ A\subseteq X$ '' shows '' $ IsLinOrder(A,r)$ ===
''from '' $ D \in FinPow(Y)$ ''have'' $ D \subseteq Y$ ''using'' +++^[FinPow_def | Finite_ZF ]... Definition of <nowiki>FinPow</nowiki>:
$ FinPow(X) \equiv \{A \in Pow(X).\ Finite(A)\}$===
''with '' A1 ''have'' $ IsLinOrder(D,R)$ ''using'' +++^[ord_linear_subset | Order_ZF ]... ''lemma'' <nowiki>ord_linear_subset</nowiki>: ''assumes '' $ IsLinOrder(X,r)$ ''and'' $ A\subseteq X$ '' shows '' $ IsLinOrder(A,r)$ ===
''from '' A1, $ C \in FinPow(X)$, $ D \in FinPow(Y)$, $ C \neq 0$, $ D\neq 0$ ''have'' $ HasAmaximum(r,C)$ ''and '' $ HasAmaximum(R,D)$ ''using'' +++^[IsLinOrder_def | Order_ZF ]... Definition of <nowiki>IsLinOrder</nowiki>:
$ IsLinOrder(X,r) \equiv ( antisym(r) \wedge trans(r) \wedge (r \text{ is total on } X))$=== , +++^[fin_has_max | FinOrd_ZF ]... ''theorem'' <nowiki>fin_has_max</nowiki>: ''assumes '' $ r \text{ is total on } X$ ''and'' $ trans(r)$ ''and'' $ B \in FinPow(X)$ ''and'' $ B \neq 0$ '' shows '' $ HasAmaximum(r,B)$ ===
''with '' A1 ''have'' $ M_C \in C$ ''and '' $ M_D \in D$ ''using'' +++^[IsLinOrder_def | Order_ZF ]... Definition of <nowiki>IsLinOrder</nowiki>:
$ IsLinOrder(X,r) \equiv ( antisym(r) \wedge trans(r) \wedge (r \text{ is total on } X))$=== , +++^[Order_ZF_4_L3 | Order_ZF_1a ]... ''lemma'' <nowiki>Order_ZF_4_L3</nowiki>: ''assumes '' $ antisym(r)$ ''and'' $ HasAmaximum(r,A)$ '' shows '' $ Maximum(r,A) \in A$, $ \forall x\in A.\ \langle x,Maximum(r,A)\rangle \in r$ ===
''with '' $ C \approx succ(k)$, $ D \approx succ(k)$ ''have'' $ C_0 \approx k$ ''and '' $ D_0 \approx k$ ''using'' <nowiki>Diff_sing_eqpoll</nowiki>
''from '' $ C \in FinPow(X)$, $ D \in FinPow(Y)$ ''have'' $ C_0 \in FinPow(X)$ ''and '' $ D_0 \in FinPow(Y)$ ''using'' +++^[fin_rem_point_fin | Finite_ZF ]... ''corollary'' <nowiki>fin_rem_point_fin</nowiki>: ''assumes '' $ A \in FinPow(X)$ '' shows '' $ A - \{a\} \in FinPow(X)$ ===
''with '' A3, $ C_0 \approx k$, $ D_0 \approx k$ ''have'' $ ord\_iso(C_0,r,D_0,R) \neq 0$
''with '' $ IsLinOrder(C,r)$, $ IsLinOrder(D,R)$, $ HasAmaximum(r,C)$, $ HasAmaximum(R,D)$ ''have'' $ ord\_iso(C,r,D,R) \neq 0$ '' by (rule '' <nowiki>rem_max_ord_iso</nowiki> '')''
=== ''}''
''thus'' $ thesis$
''qed'' ===
=== ''}''
''thus'' $ thesis$
''qed'' ===
''ultimately '' ''show'' $ thesis$ '' by (rule '' +++^[ind_on_nat | Nat_ZF_IML ]... ''theorem'' <nowiki>ind_on_nat</nowiki>: ''assumes '' $ n\in nat$ ''and'' $ P(0)$ ''and'' $ \forall k\in nat.\ P(k)\longrightarrow P(succ(k))$ '' shows '' $ P(n)$ === '')''
''qed'' ===
Every two finite linearly ordered sets are order isomorphic.
''lemma'' <nowiki>fin_ord_iso_ex</nowiki>:
'' assumes '' A1: $ IsLinOrder(X,r)$, $ IsLinOrder(Y,R)$ ''and '' A2: $ A \in FinPow(X)$, $ B \in FinPow(Y)$ ''and '' A3: $ B \approx A$ '' shows '' $ ord\_iso(A,r,B,R) \neq 0$+++[proof ]>
''from '' A2 ''obtain '' $ n$ ''where '' $ n \in nat$ ''and '' $ A \approx n$ ''using'' +++^[finpow_decomp | Finite_ZF ]... ''lemma'' <nowiki>finpow_decomp</nowiki>: '' shows '' $ FinPow(X) = (\bigcup n \in nat.\ \{A \in Pow(X).\ A \approx n\})$ ===
''from '' A3, $ A \approx n$ ''have'' $ B \approx n$ '' by (rule '' <nowiki>eqpoll_trans</nowiki> '')''
''with '' A1, A2, $ A \approx n$, $ n \in nat$ ''show'' $ ord\_iso(A,r,B,R) \neq 0$ ''using'' +++^[fin_order_iso | FinOrd_ZF ]... ''lemma'' <nowiki>fin_order_iso</nowiki>: ''assumes '' $ IsLinOrder(X,r)$, $ IsLinOrder(Y,R)$ ''and'' $ n \in nat$ '' shows '' $ \forall A \in FinPow(X).\ \forall B \in FinPow(Y).\ $
$ A \approx n \wedge B \approx n \longrightarrow ord\_iso(A,r,B,R) \neq 0$
===
''qed'' ===
Existence and uniqueness of order isomorphism for two linearly ordered sets with the same number of elements.
''theorem'' <nowiki>fin_ord_iso_ex_uniq</nowiki>:
'' assumes '' A1: $ IsLinOrder(X,r)$, $ IsLinOrder(Y,R)$ ''and '' A2: $ A \in FinPow(X)$, $ B \in FinPow(Y)$ ''and '' A3: $ B \approx A$ '' shows '' $ \exists !f.\ f \in ord\_iso(A,r,B,R)$+++[proof ]>
''from '' assms ''show'' $ \exists f.\ f \in ord\_iso(A,r,B,R)$ ''using'' +++^[fin_ord_iso_ex | FinOrd_ZF ]... ''lemma'' <nowiki>fin_ord_iso_ex</nowiki>: ''assumes '' $ IsLinOrder(X,r)$, $ IsLinOrder(Y,R)$ ''and'' $ A \in FinPow(X)$, $ B \in FinPow(Y)$ ''and'' $ B \approx A$ '' shows '' $ ord\_iso(A,r,B,R) \neq 0$ ===
''fix '' $ f$ $ g$
''assume '' A4: $ f \in ord\_iso(A,r,B,R)$, $ g \in ord\_iso(A,r,B,R)$
''then '' ''have'' $ converse(g) \in ord\_iso(B,R,A,r)$ ''using'' <nowiki>ord_iso_sym</nowiki>
''with '' $ f \in ord\_iso(A,r,B,R)$ ''have'' I: $ converse(g)\circ f \in ord\_iso(A,r,A,r)$ '' by (rule '' <nowiki>ord_iso_trans</nowiki> '')''
++++[{ ]>
''assume '' $ A \neq 0$
''with '' A1, A2, I ''have'' $ converse(g)\circ f = id(A)$ ''using'' +++^[fin_ord_auto_id | FinOrd_ZF ]... ''theorem'' <nowiki>fin_ord_auto_id</nowiki>: ''assumes '' $ IsLinOrder(X,r)$ ''and'' $ B \in FinPow(X)$ ''and'' $ B\neq 0$ '' shows '' $ ord\_iso(B,r,B,r) = \{id(B)\}$ ===
''with '' A4 ''have'' $ f = g$ ''using'' <nowiki>ord_iso_def</nowiki> , +++^[comp_inv_id_eq_bij | func1 ]... ''lemma'' <nowiki>comp_inv_id_eq_bij</nowiki>: ''assumes '' $ a \in bij(A,B)$, $ b \in bij(A,B)$ ''and'' $ converse(b)\circ a = id(A)$ '' shows '' $ a = b$ ===
=== ''}''
''moreover'' ++++[{ ]>
''assume '' $ A = 0$
''then '' ''have'' $ A \approx 0$ ''using'' <nowiki>eqpoll_0_iff</nowiki>
''with '' A3 ''have'' $ B \approx 0$ '' by (rule '' <nowiki>eqpoll_trans</nowiki> '')''
''with '' A4, $ A = 0$ ''have'' $ f \in ord\_iso(0,r,0,R)$ ''and '' $ g \in ord\_iso(0,r,0,R)$ ''using'' <nowiki>eqpoll_0_iff</nowiki>
''then '' ''have'' $ f = g$ '' by (rule '' +++^[empty_ord_iso_uniq | FinOrd_ZF ]... ''lemma'' <nowiki>empty_ord_iso_uniq</nowiki>: ''assumes '' $ f \in ord\_iso(0,r,0,R)$, $ g \in ord\_iso(0,r,0,R)$ '' shows '' $ f = g$ === '')''
=== ''}''
''ultimately '' ''show'' $ f = g$ ''using'' <nowiki>ord_iso_def</nowiki> , +++^[comp_inv_id_eq_bij | func1 ]... ''lemma'' <nowiki>comp_inv_id_eq_bij</nowiki>: ''assumes '' $ a \in bij(A,B)$, $ b \in bij(A,B)$ ''and'' $ converse(b)\circ a = id(A)$ '' shows '' $ a = b$ ===
''qed'' ===
''end
'' +++![Comments on FinOrd_ZF|click to add comment] <html> <div> <iframe style="width:60%;height:500px" src="http://www.haloscan.com/comments/slawekk/FinOrd_ZF"></iframe> </div> </html>
===
''theory'' FinSupp_ZF ''imports'' [[Finite_ZF]] [[Group_ZF_2]]
''begin
''
Functions with finite support are those functions valued in a monoid that are equal to the neutral element everywhere except a finite number of points. They form a submonoid of the space of all functions valued in the monoid with the natural pointwise operation (or a subgroup if functions are valued in a group). Polynomials can be viewed as ring valued sequences that have finite support.
!Functions with finite support
In this section we provide the definition and set up notation for formalizing the notion of finitely supported functions.
Support of a function is the subset of its domain where the values are not zero.
''Definition
'' $ Supp(f,G,A) \equiv \{x \in domain(f).\ f(x) \neq TheNeutralElement(G,A)\}$
A finitely supported function is such that its support is in the finite powerset of its domain.
''Definition
'' $ FinSupp(X,G,A) \equiv \{f \in X\rightarrow G.\ Supp(f,G,A) \in FinPow(X)\}$
We will use the additive notation writing about finitely supported functions. In the //finsupp// context defined below we assume that $(M,A)$ is a monoid and $X$ is some arbitrary set. We denote $ \mathcal{A} $ to be the pointwise operation on $M$-valued functions on $X$ corresponding to the monoid operation $A$, (denoted as $ + $). $ 0 $ is the neutral element of the monoid.
''Locale '' finsupp
''assumes '' monoidAsssum: $ \text{IsAmonoid}(M,A)$
''defines '' $ a + b \equiv A\langle a,b\rangle $
''defines '' $ \mathcal{M} \equiv FinSupp(X,M,A)$
''defines '' $ \mathcal{A} \equiv A \text{ lifted to function space over } X$
''defines '' $ a \oplus b \equiv \mathcal{A} \langle a,b\rangle $
''defines '' $ 0 \equiv TheNeutralElement(M,A)$
''defines '' $ supp(f) \equiv Supp(f,M,A)$
We can use theorems proven in the //monoid0// context.
''lemma'' ''(in'' finsupp'')'' <nowiki>monoid0_valid</nowiki>:
'' shows '' $ monoid0(M,A)$ ''using'' <nowiki>monoidAsssum</nowiki> , <nowiki>monoid0_def</nowiki>
!Finitely supported functions valued in a monoid
We show in //Group_ZF_2// that if $(M,A)$ is a monoid, and $X$ is an arbitrary set, then the space of functions $X\rightarrow M$ with the natural pointwise operation is also a monoid. In this section we show that the set of finitely supported funtions is a a sub-monoid of that monoid.
The sum of monoid valued functions is a monoid valued function.
''lemma'' ''(in'' finsupp'')'' <nowiki>lifted_op_closed</nowiki>:
'' assumes '' $ f:X \rightarrow M$, $ g:X \rightarrow M$ '' shows '' $ f\oplus g : X\rightarrow M$+++[proof ]>
''have'' $ \mathcal{A} : (X\rightarrow M)\times (X\rightarrow M)\rightarrow (X\rightarrow M)$ ''using'' +++^[monoid0_valid | FinSupp_ZF ]... ''lemma'' ''(in'' finsupp'')'' <nowiki>monoid0_valid</nowiki>: '' shows '' $ monoid0(M,A)$ === , +++^[Group_ZF_2_1_L0A | Group_ZF_2 ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>Group_ZF_2_1_L0A</nowiki>: ''assumes '' $ F = f \text{ lifted to function space over } X$ '' shows '' $ F : (X\rightarrow G)\times (X\rightarrow G)\rightarrow (X\rightarrow G)$ ===
''with '' assms ''show'' $ f\oplus g : X\rightarrow M$
''qed'' ===
What is the value of a sum of monoid-valued functions?
''lemma'' ''(in'' finsupp'')'' <nowiki>finsupp_sum_val</nowiki>:
'' assumes '' $ f:X \rightarrow M$, $ g:X \rightarrow M$ ''and '' $ x \in X$ '' shows '' $ (f\oplus g)(x) = f(x) + g(x)$ ''using'' <nowiki>assms</nowiki> , +++^[monoid0_valid | FinSupp_ZF ]... ''lemma'' ''(in'' finsupp'')'' <nowiki>monoid0_valid</nowiki>: '' shows '' $ monoid0(M,A)$ === , +++^[lifted_val | Group_ZF_2 ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>lifted_val</nowiki>: ''assumes '' $ F = f \text{ lifted to function space over } X$ ''and'' $ s:X\rightarrow G$, $ r:X\rightarrow G$ ''and'' $ x\in X$ '' shows '' $ (F\langle s,r\rangle )(x) = s(x) \oplus r(x)$ ===
The support of the sum of functions is contained in the union of supports.
''lemma'' ''(in'' finsupp'')'' <nowiki>supp_sum_union</nowiki>:
'' assumes '' $ f:X \rightarrow M$, $ g:X \rightarrow M$ '' shows '' $ supp(f\oplus g) \subseteq supp(f) \cup supp(g)$+++[proof ]>
++++[{ ]>
''fix '' $ x$
''assume '' $ x \in supp(f\oplus g)$
''from '' assms ''have'' $ f\oplus g : X\rightarrow M$ ''using'' +++^[lifted_op_closed | FinSupp_ZF ]... ''lemma'' ''(in'' finsupp'')'' <nowiki>lifted_op_closed</nowiki>: ''assumes '' $ f:X \rightarrow M$, $ g:X \rightarrow M$ '' shows '' $ f\oplus g : X\rightarrow M$ ===
''with '' assms, $ x \in supp(f\oplus g)$ ''have'' $ x\in X$ ''and '' $ f(x) + g(x) \neq 0 $ ''using'' +++^[func1_1_L1 | func1 ]... ''lemma'' <nowiki>func1_1_L1</nowiki>: ''assumes '' $ f:A\rightarrow C$ '' shows '' $ domain(f) = A$ === , +++^[Supp_def | FinSupp_ZF ]... Definition of <nowiki>Supp</nowiki>:
$ Supp(f,G,A) \equiv \{x \in domain(f).\ f(x) \neq TheNeutralElement(G,A)\}$=== , +++^[finsupp_sum_val | FinSupp_ZF ]... ''lemma'' ''(in'' finsupp'')'' <nowiki>finsupp_sum_val</nowiki>: ''assumes '' $ f:X \rightarrow M$, $ g:X \rightarrow M$ ''and'' $ x \in X$ '' shows '' $ (f\oplus g)(x) = f(x) + g(x)$ ===
''with '' assms ''have'' $ x \in (supp(f) \cup supp(g))$ ''using'' +++^[monoid0_valid | FinSupp_ZF ]... ''lemma'' ''(in'' finsupp'')'' <nowiki>monoid0_valid</nowiki>: '' shows '' $ monoid0(M,A)$ === , +++^[sum_nonzero_elmnt_nonzero | Monoid_ZF ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>sum_nonzero_elmnt_nonzero</nowiki>: ''assumes '' $ a \oplus b \neq TheNeutralElement(G,f)$ '' shows '' $ a \neq TheNeutralElement(G,f) \vee b \neq TheNeutralElement(G,f)$ === , +++^[func1_1_L1 | func1 ]... ''lemma'' <nowiki>func1_1_L1</nowiki>: ''assumes '' $ f:A\rightarrow C$ '' shows '' $ domain(f) = A$ === , +++^[Supp_def | FinSupp_ZF ]... Definition of <nowiki>Supp</nowiki>:
$ Supp(f,G,A) \equiv \{x \in domain(f).\ f(x) \neq TheNeutralElement(G,A)\}$===
=== ''}''
''thus'' $ thesis$
''qed'' ===
The sum of finitely supported functions is finitely supported.
''lemma'' ''(in'' finsupp'')'' <nowiki>sum_finsupp</nowiki>:
'' assumes '' $ f \in \mathcal{M} $, $ g \in \mathcal{M} $ '' shows '' $ f\oplus g \in \mathcal{M} $+++[proof ]>
''from '' assms ''have'' I: $ f: X\rightarrow M$, $ g: X\rightarrow M$ ''and '' $ supp(f) \in FinPow(X)$, $ supp(g) \in FinPow(X)$ ''using'' +++^[FinSupp_def | FinSupp_ZF ]... Definition of <nowiki>FinSupp</nowiki>:
$ FinSupp(X,G,A) \equiv \{f \in X\rightarrow G.\ Supp(f,G,A) \in FinPow(X)\}$===
''then '' ''have'' $ supp(f) \cup supp(g) \in FinPow(X)$ ''and '' $ supp(f\oplus g) \subseteq supp(f) \cup supp(g)$ ''using'' +++^[union_finpow | Finite_ZF ]... ''lemma'' <nowiki>union_finpow</nowiki>: ''assumes '' $ A \in FinPow(X)$ ''and'' $ B \in FinPow(X)$ '' shows '' $ A \cup B \in FinPow(X)$ === , +++^[supp_sum_union | FinSupp_ZF ]... ''lemma'' ''(in'' finsupp'')'' <nowiki>supp_sum_union</nowiki>: ''assumes '' $ f:X \rightarrow M$, $ g:X \rightarrow M$ '' shows '' $ supp(f\oplus g) \subseteq supp(f) \cup supp(g)$ ===
''then '' ''have'' $ supp(f\oplus g) \in FinPow(X)$ '' by (rule '' +++^[subset_finpow | Finite_ZF ]... ''lemma'' <nowiki>subset_finpow</nowiki>: ''assumes '' $ A \in FinPow(X)$ ''and'' $ B \subseteq A$ '' shows '' $ B \in FinPow(X)$ === '')''
''with '' I ''show'' $ f\oplus g \in \mathcal{M} $ ''using'' +++^[lifted_op_closed | FinSupp_ZF ]... ''lemma'' ''(in'' finsupp'')'' <nowiki>lifted_op_closed</nowiki>: ''assumes '' $ f:X \rightarrow M$, $ g:X \rightarrow M$ '' shows '' $ f\oplus g : X\rightarrow M$ === , +++^[FinSupp_def | FinSupp_ZF ]... Definition of <nowiki>FinSupp</nowiki>:
$ FinSupp(X,G,A) \equiv \{f \in X\rightarrow G.\ Supp(f,G,A) \in FinPow(X)\}$===
''qed'' ===
The neutral element of the lifted (pointwise) operation is the function equal zero everywhere. In the next lemma we show that this is a finitely supported function.
''lemma'' ''(in'' finsupp'')'' <nowiki>const_zero_fin_supp</nowiki>:
'' shows '' $ TheNeutralElement(X\rightarrow M, \mathcal{A} ) \in \mathcal{M} $ ''using'' <nowiki>monoidAsssum</nowiki> , +++^[Group_ZF_2_1_L2 | Group_ZF_2 ]... ''lemma'' <nowiki>Group_ZF_2_1_L2</nowiki>: ''assumes '' $ \text{IsAmonoid}(G,f)$ ''and'' $ F = f \text{ lifted to function space over } X$ ''and'' $ E = ConstantFunction(X,TheNeutralElement(G,f))$ '' shows '' $ E = TheNeutralElement(X\rightarrow G,F)$ === , +++^[monoid0_valid | FinSupp_ZF ]... ''lemma'' ''(in'' finsupp'')'' <nowiki>monoid0_valid</nowiki>: '' shows '' $ monoid0(M,A)$ === , +++^[unit_is_neutral | Monoid_ZF ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>unit_is_neutral</nowiki>: ''assumes '' $ e = TheNeutralElement(G,f)$ '' shows '' $ e \in G \wedge (\forall g\in G.\ e \oplus g = g \wedge g \oplus e = g)$ === , +++^[func1_3_L1 | func1 ]... ''lemma'' <nowiki>func1_3_L1</nowiki>: ''assumes '' $ c\in Y$ '' shows '' $ ConstantFunction(X,c) : X\rightarrow Y$ === , +++^[func1_3_L2 | func1 ]... ''lemma'' <nowiki>func1_3_L2</nowiki>: ''assumes '' $ x\in X$ '' shows '' $ ConstantFunction(X,c)(x) = c$ === , +++^[func1_1_L1 | func1 ]... ''lemma'' <nowiki>func1_1_L1</nowiki>: ''assumes '' $ f:A\rightarrow C$ '' shows '' $ domain(f) = A$ === , +++^[Supp_def | FinSupp_ZF ]... Definition of <nowiki>Supp</nowiki>:
$ Supp(f,G,A) \equiv \{x \in domain(f).\ f(x) \neq TheNeutralElement(G,A)\}$=== , +++^[empty_in_finpow | Finite_ZF ]... ''lemma'' <nowiki>empty_in_finpow</nowiki>: '' shows '' $ 0 \in FinPow(X)$ === , +++^[FinSupp_def | FinSupp_ZF ]... Definition of <nowiki>FinSupp</nowiki>:
$ FinSupp(X,G,A) \equiv \{f \in X\rightarrow G.\ Supp(f,G,A) \in FinPow(X)\}$===
Finitely supported functions form a submonoid of all functions with pointwise operation.
''theorem'' ''(in'' finsupp'')'' <nowiki>fin_supp_monoid</nowiki>:
'' shows '' $ \text{IsAmonoid}(\mathcal{M} ,restrict(\mathcal{A} ,\mathcal{M} \times \mathcal{M} ))$+++[proof ]>
''have'' $ monoid0(X\rightarrow M,\mathcal{A} )$ ''using'' +++^[monoid0_valid | FinSupp_ZF ]... ''lemma'' ''(in'' finsupp'')'' <nowiki>monoid0_valid</nowiki>: '' shows '' $ monoid0(M,A)$ === , +++^[Group_ZF_2_1_T1 | Group_ZF_2 ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>Group_ZF_2_1_T1</nowiki>: ''assumes '' $ F = f \text{ lifted to function space over } X$ '' shows '' $ \text{IsAmonoid}(X\rightarrow G,F)$ === , <nowiki>monoid0_def</nowiki>
''moreover'' ''have'' $ \mathcal{M} \text{ is closed under } \mathcal{A} $, $ \mathcal{M} \subseteq (X\rightarrow M)$, $ TheNeutralElement(X\rightarrow M, \mathcal{A} ) \in \mathcal{M} $ ''using'' +++^[sum_finsupp | FinSupp_ZF ]... ''lemma'' ''(in'' finsupp'')'' <nowiki>sum_finsupp</nowiki>: ''assumes '' $ f \in \mathcal{M} $, $ g \in \mathcal{M} $ '' shows '' $ f\oplus g \in \mathcal{M} $ === , +++^[IsOpClosed_def | func_ZF ]... Definition of <nowiki>IsOpClosed</nowiki>:
$ A \text{ is closed under } f \equiv \forall x\in A.\ \forall y\in A.\ f\langle x,y\rangle \in A$=== , +++^[FinSupp_def | FinSupp_ZF ]... Definition of <nowiki>FinSupp</nowiki>:
$ FinSupp(X,G,A) \equiv \{f \in X\rightarrow G.\ Supp(f,G,A) \in FinPow(X)\}$=== , +++^[const_zero_fin_supp | FinSupp_ZF ]... ''lemma'' ''(in'' finsupp'')'' <nowiki>const_zero_fin_supp</nowiki>: '' shows '' $ TheNeutralElement(X\rightarrow M, \mathcal{A} ) \in \mathcal{M} $ ===
''ultimately '' ''show'' $ thesis$ ''using'' +++^[group0_1_T1 | Monoid_ZF ]... ''theorem'' ''(in'' monoid0'')'' <nowiki>group0_1_T1</nowiki>: ''assumes '' $ H \text{ is closed under } f$ ''and'' $ H\subseteq G$ ''and'' $ TheNeutralElement(G,f) \in H$ '' shows '' $ \text{IsAmonoid}(H,restrict(f,H\times H))$ ===
''qed'' ===
!Group valued finitely supported functions
Similarly as in the monoid case the group valued finitely supported functions form a subgroup of all functions valued in that group.
We will reuse the notation defined in the //finsupp// context, just adding an assumption about that the existence of the right inverse with a notation for it.
''Locale '' finsupp1 = finsupp +
''assumes '' rinverse: $ \forall x\in M.\ \exists y\in M.\ x + y = 0 $
''defines '' $ ( - a) \equiv GroupInv(M,A)(a)$
With this additional assumption $(M,A)$ becomes a group and we can use theorems proven in ine //group0// context.
''lemma'' ''(in'' finsupp1'')'' <nowiki>group0_valid</nowiki>:
'' shows '' $ \text{IsAgroup}(M,A)$ ''and '' $ group0(M,A)$ ''using'' <nowiki>monoidAsssum</nowiki> , <nowiki>rinverse</nowiki> , +++^[IsAgroup_def | Group_ZF ]... Definition of <nowiki>IsAgroup</nowiki>:
$ \text{IsAgroup}(G,f) \equiv $
$ (\text{IsAmonoid}(G,f) \wedge (\forall g\in G.\ \exists b\in G.\ f\langle g,b\rangle = TheNeutralElement(G,f)))$=== , <nowiki>group0_def</nowiki>
Recall from //Group_ZF_2// that the function space of $G$ valued functions is also a group.
''lemma'' ''(in'' finsupp1'')'' <nowiki>fungroup0_valid</nowiki>:
'' shows '' $ \text{IsAgroup}(X\rightarrow M,\mathcal{A} )$ ''and '' $ group0(X\rightarrow M,\mathcal{A} )$ ''using'' +++^[group0_valid | FinSupp_ZF ]... ''lemma'' ''(in'' finsupp1'')'' <nowiki>group0_valid</nowiki>: '' shows '' $ \text{IsAgroup}(M,A)$ ''and'' $ group0(M,A)$ === , +++^[Group_ZF_2_1_T2 | Group_ZF_2 ]... ''theorem'' ''(in'' group0'')'' <nowiki>Group_ZF_2_1_T2</nowiki>: ''assumes '' $ F = P \text{ lifted to function space over } X$ '' shows '' $ \text{IsAgroup}(X\rightarrow G,F)$ === , <nowiki>group0_def</nowiki>
A function has the same support as its negative.
''lemma'' ''(in'' finsupp1'')'' <nowiki>finsupp_neg</nowiki>:
'' assumes '' A1: $ f: X\rightarrow M$ '' shows '' $ supp(f) = supp(GroupInv(X\rightarrow M,\mathcal{A} )(f))$+++[proof ]>
''let '' $ g = GroupInv(X\rightarrow M,\mathcal{A} )(f)$
''from '' A1 ''have'' I: $ g : X\rightarrow M$ ''using'' +++^[fungroup0_valid | FinSupp_ZF ]... ''lemma'' ''(in'' finsupp1'')'' <nowiki>fungroup0_valid</nowiki>: '' shows '' $ \text{IsAgroup}(X\rightarrow M,\mathcal{A} )$ ''and'' $ group0(X\rightarrow M,\mathcal{A} )$ === , +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ ===
''have'' $ supp(g) \subseteq supp(f)$+++[proof ]>
++++[{ ]>
''fix '' $ x$
''assume '' $ x \in supp(g)$
''with '' I ''have'' $ x\in X$ ''and '' $ g(x) \neq 0 $ ''using'' +++^[func1_1_L1 | func1 ]... ''lemma'' <nowiki>func1_1_L1</nowiki>: ''assumes '' $ f:A\rightarrow C$ '' shows '' $ domain(f) = A$ === , +++^[Supp_def | FinSupp_ZF ]... Definition of <nowiki>Supp</nowiki>:
$ Supp(f,G,A) \equiv \{x \in domain(f).\ f(x) \neq TheNeutralElement(G,A)\}$===
''with '' A1 ''have'' $ x \in supp(f)$ ''using'' +++^[group0_valid | FinSupp_ZF ]... ''lemma'' ''(in'' finsupp1'')'' <nowiki>group0_valid</nowiki>: '' shows '' $ \text{IsAgroup}(M,A)$ ''and'' $ group0(M,A)$ === , +++^[lift_gr_inv_val | Group_ZF_2 ]... ''corollary'' ''(in'' group0'')'' <nowiki>lift_gr_inv_val</nowiki>: ''assumes '' $ F = P \text{ lifted to function space over } X$ ''and'' $ s : X\rightarrow G$ ''and'' $ x\in X$ '' shows '' $ (GroupInv(X\rightarrow G,F)(s))(x) = (s(x))^{-1}$ === , +++^[group0_2_L8C | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L8C</nowiki>: ''assumes '' $ a\in G$ ''and'' $ a^{-1} \neq 1 $ '' shows '' $ a\neq 1 $ === , +++^[func1_1_L1 | func1 ]... ''lemma'' <nowiki>func1_1_L1</nowiki>: ''assumes '' $ f:A\rightarrow C$ '' shows '' $ domain(f) = A$ === , +++^[Supp_def | FinSupp_ZF ]... Definition of <nowiki>Supp</nowiki>:
$ Supp(f,G,A) \equiv \{x \in domain(f).\ f(x) \neq TheNeutralElement(G,A)\}$===
=== ''}''
''thus'' $ supp(g) \subseteq supp(f)$
''qed'' ===
''moreover'' ''from '' A1, I ''have'' $ supp(f) \subseteq supp(g)$ ''using'' +++^[func1_1_L1 | func1 ]... ''lemma'' <nowiki>func1_1_L1</nowiki>: ''assumes '' $ f:A\rightarrow C$ '' shows '' $ domain(f) = A$ === , +++^[Supp_def | FinSupp_ZF ]... Definition of <nowiki>Supp</nowiki>:
$ Supp(f,G,A) \equiv \{x \in domain(f).\ f(x) \neq TheNeutralElement(G,A)\}$=== , +++^[group0_valid | FinSupp_ZF ]... ''lemma'' ''(in'' finsupp1'')'' <nowiki>group0_valid</nowiki>: '' shows '' $ \text{IsAgroup}(M,A)$ ''and'' $ group0(M,A)$ === , +++^[group0_2_L8B | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L8B</nowiki>: ''assumes '' $ a\in G$ ''and'' $ a \neq 1 $ '' shows '' $ a^{-1} \neq 1 $ === , +++^[lift_gr_inv_val | Group_ZF_2 ]... ''corollary'' ''(in'' group0'')'' <nowiki>lift_gr_inv_val</nowiki>: ''assumes '' $ F = P \text{ lifted to function space over } X$ ''and'' $ s : X\rightarrow G$ ''and'' $ x\in X$ '' shows '' $ (GroupInv(X\rightarrow G,F)(s))(x) = (s(x))^{-1}$ ===
''ultimately '' ''show'' $ thesis$
''qed'' ===
The negative of a function with a finite support is a function with a finite support.
''lemma'' ''(in'' finsupp1'')'' <nowiki>finsupp_neg_finsupp</nowiki>:
'' assumes '' A1: $ f \in \mathcal{M} $ '' shows '' $ GroupInv(X\rightarrow M,\mathcal{A} )(f) \in \mathcal{M} $+++[proof ]>
''let '' $ g = GroupInv(X\rightarrow M,\mathcal{A} )(f)$
''from '' A1 ''have'' I: $ f: X\rightarrow M$, $ supp(f) \in FinPow(X)$ ''using'' +++^[FinSupp_def | FinSupp_ZF ]... Definition of <nowiki>FinSupp</nowiki>:
$ FinSupp(X,G,A) \equiv \{f \in X\rightarrow G.\ Supp(f,G,A) \in FinPow(X)\}$=== , +++^[func1_1_L1 | func1 ]... ''lemma'' <nowiki>func1_1_L1</nowiki>: ''assumes '' $ f:A\rightarrow C$ '' shows '' $ domain(f) = A$ ===
''then '' ''have'' $ g \in X\rightarrow M$ ''using'' +++^[fungroup0_valid | FinSupp_ZF ]... ''lemma'' ''(in'' finsupp1'')'' <nowiki>fungroup0_valid</nowiki>: '' shows '' $ \text{IsAgroup}(X\rightarrow M,\mathcal{A} )$ ''and'' $ group0(X\rightarrow M,\mathcal{A} )$ === , +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ ===
''moreover'' ''from '' I ''have'' $ supp(g) \in FinPow(X)$ ''using'' +++^[finsupp_neg | FinSupp_ZF ]... ''lemma'' ''(in'' finsupp1'')'' <nowiki>finsupp_neg</nowiki>: ''assumes '' $ f: X\rightarrow M$ '' shows '' $ supp(f) = supp(GroupInv(X\rightarrow M,\mathcal{A} )(f))$ ===
''ultimately '' ''show'' $ thesis$ ''using'' +++^[FinSupp_def | FinSupp_ZF ]... Definition of <nowiki>FinSupp</nowiki>:
$ FinSupp(X,G,A) \equiv \{f \in X\rightarrow G.\ Supp(f,G,A) \in FinPow(X)\}$===
''qed'' ===
Finitely supported functions form a subgroup with pointwise addition of group-valued functions.
''theorem'' ''(in'' finsupp1'')'' <nowiki>fin_sup_group</nowiki>:
'' shows '' $ IsAsubgroup(\mathcal{M} ,\mathcal{A} )$+++[proof ]>
''have'' $ \mathcal{M} \neq 0$ ''and '' $ \mathcal{M} \subseteq X\rightarrow M$ ''and '' $ \mathcal{M} \text{ is closed under } \mathcal{A} $ ''and '' $ \forall f\in \mathcal{M} .\ GroupInv(X\rightarrow M,\mathcal{A} )(f) \in \mathcal{M} $ ''using'' +++^[const_zero_fin_supp | FinSupp_ZF ]... ''lemma'' ''(in'' finsupp'')'' <nowiki>const_zero_fin_supp</nowiki>: '' shows '' $ TheNeutralElement(X\rightarrow M, \mathcal{A} ) \in \mathcal{M} $ === , +++^[FinSupp_def | FinSupp_ZF ]... Definition of <nowiki>FinSupp</nowiki>:
$ FinSupp(X,G,A) \equiv \{f \in X\rightarrow G.\ Supp(f,G,A) \in FinPow(X)\}$=== , +++^[sum_finsupp | FinSupp_ZF ]... ''lemma'' ''(in'' finsupp'')'' <nowiki>sum_finsupp</nowiki>: ''assumes '' $ f \in \mathcal{M} $, $ g \in \mathcal{M} $ '' shows '' $ f\oplus g \in \mathcal{M} $ === , +++^[IsOpClosed_def | func_ZF ]... Definition of <nowiki>IsOpClosed</nowiki>:
$ A \text{ is closed under } f \equiv \forall x\in A.\ \forall y\in A.\ f\langle x,y\rangle \in A$=== , +++^[finsupp_neg_finsupp | FinSupp_ZF ]... ''lemma'' ''(in'' finsupp1'')'' <nowiki>finsupp_neg_finsupp</nowiki>: ''assumes '' $ f \in \mathcal{M} $ '' shows '' $ GroupInv(X\rightarrow M,\mathcal{A} )(f) \in \mathcal{M} $ ===
''then '' ''show'' $ IsAsubgroup(\mathcal{M} ,\mathcal{A} )$ ''using'' +++^[fungroup0_valid | FinSupp_ZF ]... ''lemma'' ''(in'' finsupp1'')'' <nowiki>fungroup0_valid</nowiki>: '' shows '' $ \text{IsAgroup}(X\rightarrow M,\mathcal{A} )$ ''and'' $ group0(X\rightarrow M,\mathcal{A} )$ === , +++^[group0_3_T3 | Group_ZF ]... ''theorem'' ''(in'' group0'')'' <nowiki>group0_3_T3</nowiki>: ''assumes '' $ H\neq 0$ ''and'' $ H\subseteq G$ ''and'' $ H \text{ is closed under } P$ ''and'' $ \forall x\in H.\ x^{-1} \in H$ '' shows '' $ IsAsubgroup(H,P)$ ===
''qed'' ===
''end
'' +++![Comments on FinSupp_ZF|click to add comment] <html> <div> <iframe style="width:60%;height:500px" src="http://www.haloscan.com/comments/slawekk/FinSupp_ZF"></iframe> </div> </html>
===
''theory'' Finite_ZF ''imports'' [[ZF1]] [[Nat_ZF_IML]] [[Cardinal]]
''begin
''
Standard Isabelle Finite.thy contains a very useful notion of finite powerset: the set of finite subsets of a given set. The definition, however, is specific to Isabelle and based on the notion of "datatype", obviously not something that belongs to ZF set theory. This theory file devolopes the notion of finite powerset similarly as in Finite.thy, but based on standard library's Cardinal.thy. This theory file is intended to replace IsarMathLib's //Finite1// and //Finite_ZF_1// theories that are currently derived from the "datatype" approach.
!Definition and basic properties of finite powerset
The goal of this section is to prove an induction theorem about finite powersets: if the empty set has some property and this property is preserved by adding a single element of a set, then this property is true for all finite subsets of this set.
We defined the finite powerset $ FinPow(X)$ as those elements of the powerset that are finite.
''Definition
'' $ FinPow(X) \equiv \{A \in Pow(X).\ Finite(A)\}$
The cardinality of an element of finite powerset is a natural number.
''lemma'' <nowiki>card_fin_is_nat</nowiki>:
'' assumes '' $ A \in FinPow(X)$ '' shows '' $ |A| \in nat$ ''and '' $ A \approx |A|$ ''using'' <nowiki>assms</nowiki> , +++^[FinPow_def | Finite_ZF ]... Definition of <nowiki>FinPow</nowiki>:
$ FinPow(X) \equiv \{A \in Pow(X).\ Finite(A)\}$=== , <nowiki>Finite_def</nowiki> , <nowiki>cardinal_cong</nowiki> , <nowiki>nat_into_Card</nowiki> , <nowiki>Card_cardinal_eq</nowiki>
If a set has the same number of elements as $n \in \mathbb{N}$, then its cardinality is $n$. Recall that in set theory a natural number $n$ is a set that has $n$ elements.
''lemma'' <nowiki>card_card</nowiki>:
'' assumes '' $ A \approx n$ ''and '' $ n \in nat$ '' shows '' $ |A| = n$ ''using'' <nowiki>assms</nowiki> , <nowiki>cardinal_cong</nowiki> , <nowiki>nat_into_Card</nowiki> , <nowiki>Card_cardinal_eq</nowiki>
If we add a point to a finite set, the cardinality increases by one. To understand tye second assertion $| A \cup \{ a\}| = |A| \cup \{ |A|\} $ recall that the cardinality $|A|$ of $A$ is a natural number and for natural numbers we have $n+1 = n \cup \{ n\}$.
''lemma'' <nowiki>card_fin_add_one</nowiki>:
'' assumes '' A1: $ A \in FinPow(X)$ ''and '' A2: $ a \in X-A$ '' shows '' $ |A \cup \{a\}| = succ( |A| )$, $ |A \cup \{a\}| = |A| \cup \{|A|\}$+++[proof ]>
''from '' A1, A2 ''have'' $ cons(a,A) \approx cons( |A|, |A| )$ ''using'' +++^[card_fin_is_nat | Finite_ZF ]... ''lemma'' <nowiki>card_fin_is_nat</nowiki>: ''assumes '' $ A \in FinPow(X)$ '' shows '' $ |A| \in nat$ ''and'' $ A \approx |A|$ === , <nowiki>mem_not_refl</nowiki> , <nowiki>cons_eqpoll_cong</nowiki>
''moreover'' ''have'' $ cons(a,A) = A \cup \{a\}$ '' by (rule '' +++^[consdef | ZF1 ]... ''lemma'' <nowiki>consdef</nowiki>: '' shows '' $ cons(a,A) = A \cup \{a\}$ === '')''
''moreover'' ''have'' $ cons( |A|, |A| ) = |A| \cup \{|A|\}$ '' by (rule '' +++^[consdef | ZF1 ]... ''lemma'' <nowiki>consdef</nowiki>: '' shows '' $ cons(a,A) = A \cup \{a\}$ === '')''
''ultimately '' ''have'' $ A\cup \{a\} \approx succ( |A| )$ ''using'' +++^[succ_explained | Nat_ZF_IML ]... ''lemma'' <nowiki>succ_explained</nowiki>: '' shows '' $ succ(n) = n \cup \{n\}$ ===
''with '' A1 ''show'' $ |A \cup \{a\}| = succ( |A| )$ ''and '' $ |A \cup \{a\}| = |A| \cup \{|A|\}$ ''using'' +++^[card_fin_is_nat | Finite_ZF ]... ''lemma'' <nowiki>card_fin_is_nat</nowiki>: ''assumes '' $ A \in FinPow(X)$ '' shows '' $ |A| \in nat$ ''and'' $ A \approx |A|$ === , +++^[card_card | Finite_ZF ]... ''lemma'' <nowiki>card_card</nowiki>: ''assumes '' $ A \approx n$ ''and'' $ n \in nat$ '' shows '' $ |A| = n$ ===
''qed'' ===
We can decompose the finite powerset into collection of sets of the same natural cardinalities.
''lemma'' <nowiki>finpow_decomp</nowiki>:
'' shows '' $ FinPow(X) = (\bigcup n \in nat.\ \{A \in Pow(X).\ A \approx n\})$ ''using'' <nowiki>Finite_def</nowiki> , +++^[FinPow_def | Finite_ZF ]... Definition of <nowiki>FinPow</nowiki>:
$ FinPow(X) \equiv \{A \in Pow(X).\ Finite(A)\}$===
Finite powerset is the union of sets of cardinality bounded by natural numbers.
''lemma'' <nowiki>finpow_union_card_nat</nowiki>:
'' shows '' $ FinPow(X) = (\bigcup n \in nat.\ \{A \in Pow(X).\ A \preceq n\})$+++[proof ]>
''have'' $ FinPow(X) \subseteq (\bigcup n \in nat.\ \{A \in Pow(X).\ A \preceq n\})$ ''using'' +++^[finpow_decomp | Finite_ZF ]... ''lemma'' <nowiki>finpow_decomp</nowiki>: '' shows '' $ FinPow(X) = (\bigcup n \in nat.\ \{A \in Pow(X).\ A \approx n\})$ === , +++^[FinPow_def | Finite_ZF ]... Definition of <nowiki>FinPow</nowiki>:
$ FinPow(X) \equiv \{A \in Pow(X).\ Finite(A)\}$=== , <nowiki>eqpoll_imp_lepoll</nowiki>
''moreover'' ''have'' $ (\bigcup n \in nat.\ \{A \in Pow(X).\ A \preceq n\}) \subseteq FinPow(X)$ ''using'' <nowiki>lepoll_nat_imp_Finite</nowiki> , +++^[FinPow_def | Finite_ZF ]... Definition of <nowiki>FinPow</nowiki>:
$ FinPow(X) \equiv \{A \in Pow(X).\ Finite(A)\}$===
''ultimately '' ''show'' $ thesis$
''qed'' ===
A different form of //finpow_union_card_nat// (see above) - a subset that has not more elements than a given natural number is in the finite powerset.
''lemma'' <nowiki>lepoll_nat_in_finpow</nowiki>:
'' assumes '' $ n \in nat$, $ A \subseteq X$, $ A \preceq n$ '' shows '' $ A \in FinPow(X)$ ''using'' <nowiki>assms</nowiki> , +++^[finpow_union_card_nat | Finite_ZF ]... ''lemma'' <nowiki>finpow_union_card_nat</nowiki>: '' shows '' $ FinPow(X) = (\bigcup n \in nat.\ \{A \in Pow(X).\ A \preceq n\})$ ===
Natural numbers are finite subsets of the set of natural numbers.
''lemma'' <nowiki>nat_finpow_nat</nowiki>:
'' assumes '' $ n \in nat$ '' shows '' $ n \in FinPow(nat)$ ''using'' <nowiki>assms</nowiki> , <nowiki>nat_into_Finite</nowiki> , +++^[nat_subset_nat | Nat_ZF_IML ]... ''lemma'' <nowiki>nat_subset_nat</nowiki>: ''assumes '' $ n \in nat$ '' shows '' $ n \subseteq nat$ === , +++^[FinPow_def | Finite_ZF ]... Definition of <nowiki>FinPow</nowiki>:
$ FinPow(X) \equiv \{A \in Pow(X).\ Finite(A)\}$===
A finite subset is a finite subset of itself.
''lemma'' <nowiki>fin_finpow_self</nowiki>:
'' assumes '' $ A \in FinPow(X)$ '' shows '' $ A \in FinPow(A)$ ''using'' <nowiki>assms</nowiki> , +++^[FinPow_def | Finite_ZF ]... Definition of <nowiki>FinPow</nowiki>:
$ FinPow(X) \equiv \{A \in Pow(X).\ Finite(A)\}$===
If we remove an element and put it back we get the set back.
''lemma'' <nowiki>rem_add_eq</nowiki>:
'' assumes '' $ a\in A$ '' shows '' $ (A-\{a\}) \cup \{a\} = A$ ''using'' <nowiki>assms</nowiki>
Induction for finite powerset. This is smilar to the standard Isabelle's //Fin_induct//.
''theorem'' <nowiki>FinPow_induct</nowiki>:
'' assumes '' A1: $ P(0)$ ''and '' A2: $ \forall A \in FinPow(X).\ P(A) \longrightarrow (\forall a\in X.\ P(A \cup \{a\}))$ ''and '' A3: $ B \in FinPow(X)$ '' shows '' $ P(B)$+++[proof ]>
++++[{ ]>
''fix '' $ n$
''assume '' $ n \in nat$
''moreover'' ''from '' A1 ''have'' I: $ \forall B\in Pow(X).\ B \preceq 0 \longrightarrow P(B)$ ''using'' <nowiki>lepoll_0_is_0</nowiki>
''moreover'' ''have'' $ \forall k \in nat.\ $
$ (\forall B \in Pow(X).\ (B \preceq k \longrightarrow P(B))) \longrightarrow $
$ (\forall B \in Pow(X).\ (B \preceq succ(k) \longrightarrow P(B)))$+++[proof ]>
++++[{ ]>
''fix '' $ k$
''assume '' A4: $ k \in nat$
''assume '' A5: $ \forall B \in Pow(X).\ (B \preceq k \longrightarrow P(B))$
''fix '' $ B$
''assume '' A6: $ B \in Pow(X)$, $ B \preceq succ(k)$
''have'' $ P(B)$+++[proof ]>
''have'' $ B = 0 \longrightarrow P(B)$+++[proof ]>
++++[{ ]>
''assume '' $ B = 0$
''then '' ''have'' $ B \preceq 0$ ''using'' <nowiki>lepoll_0_iff</nowiki>
''with '' I, A6 ''have'' $ P(B)$
=== ''}''
''thus'' $ B = 0 \longrightarrow P(B)$
''qed'' ===
''moreover'' ''have'' $ B\neq 0 \longrightarrow P(B)$+++[proof ]>
++++[{ ]>
''assume '' $ B \neq 0$
''then '' ''obtain '' $ a$ ''where '' II: $ a\in B$
''let '' $ A = B - \{a\}$
''from '' A6, II ''have'' $ A \subseteq X$ ''and '' $ A \preceq k$ ''using'' <nowiki>Diff_sing_lepoll</nowiki>
''with '' A4, A5 ''have'' $ A \in FinPow(X)$ ''and '' $ P(A)$ ''using'' +++^[lepoll_nat_in_finpow | Finite_ZF ]... ''lemma'' <nowiki>lepoll_nat_in_finpow</nowiki>: ''assumes '' $ n \in nat$, $ A \subseteq X$, $ A \preceq n$ '' shows '' $ A \in FinPow(X)$ === , +++^[finpow_decomp | Finite_ZF ]... ''lemma'' <nowiki>finpow_decomp</nowiki>: '' shows '' $ FinPow(X) = (\bigcup n \in nat.\ \{A \in Pow(X).\ A \approx n\})$ ===
''with '' A2, A6, II ''have'' $ P(A \cup \{a\})$
''moreover'' ''from '' II ''have'' $ A \cup \{a\} = B$
''ultimately '' ''have'' $ P(B)$
=== ''}''
''thus'' $ B\neq 0 \longrightarrow P(B)$
''qed'' ===
''ultimately '' ''show'' $ P(B)$
''qed'' ===
=== ''}''
''thus'' $ thesis$
''qed'' ===
''ultimately '' ''have'' $ \forall B \in Pow(X).\ (B \preceq n \longrightarrow P(B))$ '' by (rule '' +++^[ind_on_nat | Nat_ZF_IML ]... ''theorem'' <nowiki>ind_on_nat</nowiki>: ''assumes '' $ n\in nat$ ''and'' $ P(0)$ ''and'' $ \forall k\in nat.\ P(k)\longrightarrow P(succ(k))$ '' shows '' $ P(n)$ === '')''
=== ''}''
''then '' ''have'' $ \forall n \in nat.\ \forall B \in Pow(X).\ (B \preceq n \longrightarrow P(B))$
''with '' A3 ''show'' $ P(B)$ ''using'' +++^[finpow_union_card_nat | Finite_ZF ]... ''lemma'' <nowiki>finpow_union_card_nat</nowiki>: '' shows '' $ FinPow(X) = (\bigcup n \in nat.\ \{A \in Pow(X).\ A \preceq n\})$ ===
''qed'' ===
A subset of a finites subset is a finite subset.
''lemma'' <nowiki>subset_finpow</nowiki>:
'' assumes '' $ A \in FinPow(X)$ ''and '' $ B \subseteq A$ '' shows '' $ B \in FinPow(X)$ ''using'' <nowiki>assms</nowiki> , +++^[FinPow_def | Finite_ZF ]... Definition of <nowiki>FinPow</nowiki>:
$ FinPow(X) \equiv \{A \in Pow(X).\ Finite(A)\}$=== , <nowiki>subset_Finite</nowiki>
If we subtract anything from a finite set, the resulting set is finite.
''lemma'' <nowiki>diff_finpow</nowiki>:
'' assumes '' $ A \in FinPow(X)$ '' shows '' $ A-B \in FinPow(X)$ ''using'' <nowiki>assms</nowiki> , +++^[subset_finpow | Finite_ZF ]... ''lemma'' <nowiki>subset_finpow</nowiki>: ''assumes '' $ A \in FinPow(X)$ ''and'' $ B \subseteq A$ '' shows '' $ B \in FinPow(X)$ ===
If we remove a point from a finites subset, we get a finite subset.
''corollary'' <nowiki>fin_rem_point_fin</nowiki>:
'' assumes '' $ A \in FinPow(X)$ '' shows '' $ A - \{a\} \in FinPow(X)$ ''using'' <nowiki>assms</nowiki> , +++^[diff_finpow | Finite_ZF ]... ''lemma'' <nowiki>diff_finpow</nowiki>: ''assumes '' $ A \in FinPow(X)$ '' shows '' $ A-B \in FinPow(X)$ ===
Cardinality of a nonempty finite set is a successsor of some natural number.
''lemma'' <nowiki>card_non_empty_succ</nowiki>:
'' assumes '' A1: $ A \in FinPow(X)$ ''and '' A2: $ A \neq 0$ '' shows '' $ \exists n \in nat.\ |A| = succ(n)$+++[proof ]>
''from '' A2 ''obtain '' $ a$ ''where '' $ a \in A$
''let '' $ B = A - \{a\}$
''from '' A1, $ a \in A$ ''have'' $ B \in FinPow(X)$ ''and '' $ a \in X - B$ ''using'' +++^[FinPow_def | Finite_ZF ]... Definition of <nowiki>FinPow</nowiki>:
$ FinPow(X) \equiv \{A \in Pow(X).\ Finite(A)\}$=== , +++^[fin_rem_point_fin | Finite_ZF ]... ''corollary'' <nowiki>fin_rem_point_fin</nowiki>: ''assumes '' $ A \in FinPow(X)$ '' shows '' $ A - \{a\} \in FinPow(X)$ ===
''then '' ''have'' $ |B \cup \{a\}| = succ( |B| )$ ''using'' +++^[card_fin_add_one | Finite_ZF ]... ''lemma'' <nowiki>card_fin_add_one</nowiki>: ''assumes '' $ A \in FinPow(X)$ ''and'' $ a \in X-A$ '' shows '' $ |A \cup \{a\}| = succ( |A| )$, $ |A \cup \{a\}| = |A| \cup \{|A|\}$ ===
''moreover'' ''from '' $ a \in A$, $ B \in FinPow(X)$ ''have'' $ A = B \cup \{a\}$ ''and '' $ |B| \in nat$ ''using'' +++^[card_fin_is_nat | Finite_ZF ]... ''lemma'' <nowiki>card_fin_is_nat</nowiki>: ''assumes '' $ A \in FinPow(X)$ '' shows '' $ |A| \in nat$ ''and'' $ A \approx |A|$ ===
''ultimately '' ''show'' $ thesis$
''qed'' ===
Another variation on the induction theme: If we can show something holds for the empty set and if it holds for all finite sets with at most $k$ elements then it holds for all finite sets with at most $k+1$ elements, the it holds for all finite sets.
''theorem'' <nowiki>FinPow_card_ind</nowiki>:
'' assumes '' A1: $ P(0)$ ''and '' A2: $ \forall k\in nat.\ $
$ (\forall A \in FinPow(X).\ A \preceq k \longrightarrow P(A)) \longrightarrow $
$ (\forall A \in FinPow(X).\ A \preceq succ(k) \longrightarrow P(A))$ ''and '' A3: $ A \in FinPow(X)$ '' shows '' $ P(A)$+++[proof ]>
''from '' A3 ''have'' $ |A| \in nat$ ''and '' $ A \in FinPow(X)$ ''and '' $ A \preceq |A|$ ''using'' +++^[card_fin_is_nat | Finite_ZF ]... ''lemma'' <nowiki>card_fin_is_nat</nowiki>: ''assumes '' $ A \in FinPow(X)$ '' shows '' $ |A| \in nat$ ''and'' $ A \approx |A|$ === , <nowiki>eqpoll_imp_lepoll</nowiki>
''moreover'' ''have'' $ \forall n \in nat.\ (\forall A \in FinPow(X).\ $
$ A \preceq n \longrightarrow P(A))$+++[proof ]>
''fix '' $ n$
''assume '' $ n \in nat$
''moreover'' ''from '' A1 ''have'' $ \forall A \in FinPow(X).\ A \preceq 0 \longrightarrow P(A)$ ''using'' <nowiki>lepoll_0_is_0</nowiki>
''moreover'' ''note '' A2
''ultimately '' ''show'' $ \forall A \in FinPow(X).\ A \preceq n \longrightarrow P(A)$ '' by (rule '' +++^[ind_on_nat | Nat_ZF_IML ]... ''theorem'' <nowiki>ind_on_nat</nowiki>: ''assumes '' $ n\in nat$ ''and'' $ P(0)$ ''and'' $ \forall k\in nat.\ P(k)\longrightarrow P(succ(k))$ '' shows '' $ P(n)$ === '')''
''qed'' ===
''ultimately '' ''show'' $ P(A)$
''qed'' ===
Another type of induction (or, maybe recursion). The induction step we try to find a point in the set that if we remove it, the fact that the property holds for the smaller set implies that the property holds for the whole set.
''lemma'' <nowiki>FinPow_ind_rem_one</nowiki>:
'' assumes '' A1: $ P(0)$ ''and '' A2: $ \forall A \in FinPow(X).\ A \neq 0 \longrightarrow (\exists a\in A.\ P(A-\{a\}) \longrightarrow P(A))$ ''and '' A3: $ B \in FinPow(X)$ '' shows '' $ P(B)$+++[proof ]>
''note '' A1
''moreover'' ''have'' $ \forall k\in nat.\ $
$ (\forall B \in FinPow(X).\ B \preceq k \longrightarrow P(B)) \longrightarrow $
$ (\forall C \in FinPow(X).\ C \preceq succ(k) \longrightarrow P(C))$+++[proof ]>
++++[{ ]>
''fix '' $ k$
''assume '' $ k \in nat$
''assume '' A4: $ \forall B \in FinPow(X).\ B \preceq k \longrightarrow P(B)$
''have'' $ \forall C \in FinPow(X).\ C \preceq succ(k) \longrightarrow P(C)$+++[proof ]>
++++[{ ]>
''fix '' $ C$
''assume '' $ C \in FinPow(X)$
''assume '' $ C \preceq succ(k)$
''note '' A1
''moreover'' ++++[{ ]>
''assume '' $ C \neq 0$
''with '' A2, $ C \in FinPow(X)$ ''obtain '' $ a$ ''where '' $ a\in C$ ''and '' $ P(C-\{a\}) \longrightarrow P(C)$
''with '' A4, $ C \in FinPow(X)$, $ C \preceq succ(k)$ ''have'' $ P(C)$ ''using'' <nowiki>Diff_sing_lepoll</nowiki> , +++^[fin_rem_point_fin | Finite_ZF ]... ''corollary'' <nowiki>fin_rem_point_fin</nowiki>: ''assumes '' $ A \in FinPow(X)$ '' shows '' $ A - \{a\} \in FinPow(X)$ ===
=== ''}''
''ultimately '' ''have'' $ P(C)$
=== ''}''
''thus'' $ thesis$
''qed'' ===
=== ''}''
''thus'' $ thesis$
''qed'' ===
''moreover'' ''note '' A3
''ultimately '' ''show'' $ P(B)$ '' by (rule '' +++^[FinPow_card_ind | Finite_ZF ]... ''theorem'' <nowiki>FinPow_card_ind</nowiki>: ''assumes '' $ P(0)$ ''and'' $ \forall k\in nat.\ $
$ (\forall A \in FinPow(X).\ A \preceq k \longrightarrow P(A)) \longrightarrow $
$ (\forall A \in FinPow(X).\ A \preceq succ(k) \longrightarrow P(A))$
''and'' $ A \in FinPow(X)$ '' shows '' $ P(A)$ === '')''
''qed'' ===
Yet another induction theorem. This is similar, but slightly more complicated than //FinPow_ind_rem_one//. The difference is in the treatment of the empty set to allow to show properties that are not true for empty set.
''lemma'' <nowiki>FinPow_rem_ind</nowiki>:
'' assumes '' A1: $ \forall A \in FinPow(X).\ $
$ A = 0 \vee (\exists a\in A.\ A = \{a\} \vee P(A-\{a\}) \longrightarrow P(A))$ ''and '' A2: $ A \in FinPow(X)$ ''and '' A3: $ A\neq 0$ '' shows '' $ P(A)$+++[proof ]>
''have'' $ 0 = 0 \vee P(0)$
''moreover'' ''have'' $ \forall k\in nat.\ $
$ (\forall B \in FinPow(X).\ B \preceq k \longrightarrow (B=0 \vee P(B))) \longrightarrow $
$ (\forall A \in FinPow(X).\ A \preceq succ(k) \longrightarrow (A=0 \vee P(A)))$+++[proof ]>
++++[{ ]>
''fix '' $ k$
''assume '' $ k \in nat$
''assume '' A4: $ \forall B \in FinPow(X).\ B \preceq k \longrightarrow (B=0 \vee P(B))$
''have'' $ \forall A \in FinPow(X).\ A \preceq succ(k) \longrightarrow (A=0 \vee P(A))$+++[proof ]>
++++[{ ]>
''fix '' $ A$
''assume '' $ A \in FinPow(X)$
''assume '' $ A \preceq succ(k)$, $ A\neq 0$
''from '' A1, $ A \in FinPow(X)$, $ A\neq 0$ ''obtain '' $ a$ ''where '' $ a\in A$ ''and '' $ A = \{a\} \vee P(A-\{a\}) \longrightarrow P(A)$
''let '' $ B = A-\{a\}$
''from '' A4, $ A \in FinPow(X)$, $ A \preceq succ(k)$, $ a\in A$ ''have'' $ B = 0 \vee P(B)$ ''using'' <nowiki>Diff_sing_lepoll</nowiki> , +++^[fin_rem_point_fin | Finite_ZF ]... ''corollary'' <nowiki>fin_rem_point_fin</nowiki>: ''assumes '' $ A \in FinPow(X)$ '' shows '' $ A - \{a\} \in FinPow(X)$ ===
''with '' $ a\in A$, $ A = \{a\} \vee P(A-\{a\}) \longrightarrow P(A)$ ''have'' $ P(A)$
=== ''}''
''thus'' $ thesis$
''qed'' ===
=== ''}''
''thus'' $ thesis$
''qed'' ===
''moreover'' ''note '' A2
''ultimately '' ''have'' $ A=0 \vee P(A)$ '' by (rule '' +++^[FinPow_card_ind | Finite_ZF ]... ''theorem'' <nowiki>FinPow_card_ind</nowiki>: ''assumes '' $ P(0)$ ''and'' $ \forall k\in nat.\ $
$ (\forall A \in FinPow(X).\ A \preceq k \longrightarrow P(A)) \longrightarrow $
$ (\forall A \in FinPow(X).\ A \preceq succ(k) \longrightarrow P(A))$
''and'' $ A \in FinPow(X)$ '' shows '' $ P(A)$ === '')''
''with '' A3 ''show'' $ P(A)$
''qed'' ===
If a family of sets is closed with respect to taking intersections of two sets then it is closed with respect to taking intersections of any nonempty finite collection.
''lemma'' <nowiki>inter_two_inter_fin</nowiki>:
'' assumes '' A1: $ \forall V\in T.\ \forall W\in T.\ V \cap W \in T$ ''and '' A2: $ N \neq 0$ ''and '' A3: $ N \in FinPow(T)$ '' shows '' $ (\bigcap N \in T)$+++[proof ]>
''have'' $ 0 = 0 \vee (\bigcap 0 \in T)$
''moreover'' ''have'' $ \forall M \in FinPow(T).\ (M = 0 \vee \bigcap M \in T) \longrightarrow $
$ (\forall W \in T.\ M\cup \{W\} = 0 \vee \bigcap (M \cup \{W\}) \in T)$+++[proof ]>
++++[{ ]>
''fix '' $ M$
''assume '' $ M \in FinPow(T)$
''assume '' A4: $ M = 0 \vee \bigcap M \in T$
++++[{ ]>
''assume '' $ M = 0$
''hence'' $ \forall W \in T.\ M\cup \{W\} = 0 \vee \bigcap (M \cup \{W\}) \in T$
=== ''}''
''moreover'' ++++[{ ]>
''assume '' $ M \neq 0$
''with '' A4 ''have'' $ \bigcap M \in T$
++++[{ ]>
''fix '' $ W$
''assume '' $ W \in T$
''from '' $ M \neq 0$ ''have'' $ \bigcap (M \cup \{W\}) = (\bigcap M) \cap W$
''with '' A1, $ \bigcap M \in T$, $ W \in T$ ''have'' $ \bigcap (M \cup \{W\}) \in T$
=== ''}''
''hence'' $ \forall W \in T.\ M\cup \{W\} = 0 \vee \bigcap (M \cup \{W\}) \in T$
=== ''}''
''ultimately '' ''have'' $ \forall W \in T.\ M\cup \{W\} = 0 \vee \bigcap (M \cup \{W\}) \in T$
=== ''}''
''thus'' $ thesis$
''qed'' ===
''moreover'' ''note '' $ N \in FinPow(T)$
''ultimately '' ''have'' $ N = 0 \vee (\bigcap N \in T)$ '' by (rule '' +++^[FinPow_induct | Finite_ZF ]... ''theorem'' <nowiki>FinPow_induct</nowiki>: ''assumes '' $ P(0)$ ''and'' $ \forall A \in FinPow(X).\ P(A) \longrightarrow (\forall a\in X.\ P(A \cup \{a\}))$ ''and'' $ B \in FinPow(X)$ '' shows '' $ P(B)$ === '')''
''with '' A2 ''show'' $ (\bigcap N \in T)$
''qed'' ===
If a family of sets contains the empty set and is closed with respect to taking unions of two sets then it is closed with respect to taking unions of any finite collection.
''lemma'' <nowiki>union_two_union_fin</nowiki>:
'' assumes '' A1: $ 0 \in C$ ''and '' A2: $ \forall A\in C.\ \forall B\in C.\ A\cup B \in C$ ''and '' A3: $ N \in FinPow(C)$ '' shows '' $ \bigcup N \in C$+++[proof ]>
''from '' $ 0 \in C$ ''have'' $ \bigcup 0 \in C$
''moreover'' ''have'' $ \forall M \in FinPow(C).\ \bigcup M \in C \longrightarrow (\forall A\in C.\ \bigcup (M \cup \{A\}) \in C)$+++[proof ]>
++++[{ ]>
''fix '' $ M$
''assume '' $ M \in FinPow(C)$
''assume '' $ \bigcup M \in C$
''fix '' $ A$
''assume '' $ A\in C$
''have'' $ \bigcup (M \cup \{A\}) = (\bigcup M) \cup A$
''with '' A2, $ \bigcup M \in C$, $ A\in C$ ''have'' $ \bigcup (M \cup \{A\}) \in C$
=== ''}''
''thus'' $ thesis$
''qed'' ===
''moreover'' ''note '' $ N \in FinPow(C)$
''ultimately '' ''show'' $ \bigcup N \in C$ '' by (rule '' +++^[FinPow_induct | Finite_ZF ]... ''theorem'' <nowiki>FinPow_induct</nowiki>: ''assumes '' $ P(0)$ ''and'' $ \forall A \in FinPow(X).\ P(A) \longrightarrow (\forall a\in X.\ P(A \cup \{a\}))$ ''and'' $ B \in FinPow(X)$ '' shows '' $ P(B)$ === '')''
''qed'' ===
Empty set is in finite power set.
''lemma'' <nowiki>empty_in_finpow</nowiki>:
'' shows '' $ 0 \in FinPow(X)$ ''using'' +++^[FinPow_def | Finite_ZF ]... Definition of <nowiki>FinPow</nowiki>:
$ FinPow(X) \equiv \{A \in Pow(X).\ Finite(A)\}$===
Singleton is in the finite powerset.
''lemma'' <nowiki>singleton_in_finpow</nowiki>:
'' assumes '' $ x \in X$ '' shows '' $ \{x\} \in FinPow(X)$ ''using'' <nowiki>assms</nowiki> , +++^[FinPow_def | Finite_ZF ]... Definition of <nowiki>FinPow</nowiki>:
$ FinPow(X) \equiv \{A \in Pow(X).\ Finite(A)\}$===
Union of two finite subsets is a finite subset.
''lemma'' <nowiki>union_finpow</nowiki>:
'' assumes '' $ A \in FinPow(X)$ ''and '' $ B \in FinPow(X)$ '' shows '' $ A \cup B \in FinPow(X)$ ''using'' <nowiki>assms</nowiki> , +++^[FinPow_def | Finite_ZF ]... Definition of <nowiki>FinPow</nowiki>:
$ FinPow(X) \equiv \{A \in Pow(X).\ Finite(A)\}$===
Union of finite number of finite sets is finite.
''lemma'' <nowiki>fin_union_finpow</nowiki>:
'' assumes '' $ M \in FinPow(FinPow(X))$ '' shows '' $ \bigcup M \in FinPow(X)$ ''using'' <nowiki>assms</nowiki> , +++^[empty_in_finpow | Finite_ZF ]... ''lemma'' <nowiki>empty_in_finpow</nowiki>: '' shows '' $ 0 \in FinPow(X)$ === , +++^[union_finpow | Finite_ZF ]... ''lemma'' <nowiki>union_finpow</nowiki>: ''assumes '' $ A \in FinPow(X)$ ''and'' $ B \in FinPow(X)$ '' shows '' $ A \cup B \in FinPow(X)$ === , +++^[union_two_union_fin | Finite_ZF ]... ''lemma'' <nowiki>union_two_union_fin</nowiki>: ''assumes '' $ 0 \in C$ ''and'' $ \forall A\in C.\ \forall B\in C.\ A\cup B \in C$ ''and'' $ N \in FinPow(C)$ '' shows '' $ \bigcup N \in C$ ===
If a set is finite after removing one element, then it is finite.
''lemma'' <nowiki>rem_point_fin_fin</nowiki>:
'' assumes '' A1: $ x \in X$ ''and '' A2: $ A - \{x\} \in FinPow(X)$ '' shows '' $ A \in FinPow(X)$+++[proof ]>
''from '' assms ''have'' $ (A - \{x\}) \cup \{x\} \in FinPow(X)$ ''using'' +++^[singleton_in_finpow | Finite_ZF ]... ''lemma'' <nowiki>singleton_in_finpow</nowiki>: ''assumes '' $ x \in X$ '' shows '' $ \{x\} \in FinPow(X)$ === , +++^[union_finpow | Finite_ZF ]... ''lemma'' <nowiki>union_finpow</nowiki>: ''assumes '' $ A \in FinPow(X)$ ''and'' $ B \in FinPow(X)$ '' shows '' $ A \cup B \in FinPow(X)$ ===
''moreover'' ''have'' $ A \subseteq (A - \{x\}) \cup \{x\}$
''ultimately '' ''show'' $ A \in FinPow(X)$ ''using'' +++^[FinPow_def | Finite_ZF ]... Definition of <nowiki>FinPow</nowiki>:
$ FinPow(X) \equiv \{A \in Pow(X).\ Finite(A)\}$=== , <nowiki>subset_Finite</nowiki>
''qed'' ===
An image of a finite set is finite.
''lemma'' <nowiki>fin_image_fin</nowiki>:
'' assumes '' $ \forall V\in B.\ K(V)\in C$ ''and '' $ N \in FinPow(B)$ '' shows '' $ \{K(V).\ V\in N\} \in FinPow(C)$+++[proof ]>
''have'' $ \{K(V).\ V\in 0\} \in FinPow(C)$ ''using'' +++^[FinPow_def | Finite_ZF ]... Definition of <nowiki>FinPow</nowiki>:
$ FinPow(X) \equiv \{A \in Pow(X).\ Finite(A)\}$===
''moreover'' ''have'' $ \forall A \in FinPow(B).\ $
$ \{K(V).\ V\in A\} \in FinPow(C) \longrightarrow (\forall a\in B.\ \{K(V).\ V \in (A \cup \{a\})\} \in FinPow(C))$+++[proof ]>
++++[{ ]>
''fix '' $ A$
''assume '' $ A \in FinPow(B)$
''assume '' $ \{K(V).\ V\in A\} \in FinPow(C)$
''fix '' $ a$
''assume '' $ a\in B$
''have'' $ \{K(V).\ V \in (A \cup \{a\})\} \in FinPow(C)$+++[proof ]>
''have'' $ \{K(V).\ V \in (A \cup \{a\})\} = \{K(V).\ V\in A\} \cup \{K(a)\}$
''moreover'' ''note '' $ \{K(V).\ V\in A\} \in FinPow(C)$
''moreover'' ''from '' $ \forall V\in B.\ K(V) \in C$, $ a\in B$ ''have'' $ \{K(a)\} \in FinPow(C)$ ''using'' +++^[singleton_in_finpow | Finite_ZF ]... ''lemma'' <nowiki>singleton_in_finpow</nowiki>: ''assumes '' $ x \in X$ '' shows '' $ \{x\} \in FinPow(X)$ ===
''ultimately '' ''show'' $ thesis$ ''using'' +++^[union_finpow | Finite_ZF ]... ''lemma'' <nowiki>union_finpow</nowiki>: ''assumes '' $ A \in FinPow(X)$ ''and'' $ B \in FinPow(X)$ '' shows '' $ A \cup B \in FinPow(X)$ ===
''qed'' ===
=== ''}''
''thus'' $ thesis$
''qed'' ===
''moreover'' ''note '' $ N \in FinPow(B)$
''ultimately '' ''show'' $ \{K(V).\ V\in N\} \in FinPow(C)$ '' by (rule '' +++^[FinPow_induct | Finite_ZF ]... ''theorem'' <nowiki>FinPow_induct</nowiki>: ''assumes '' $ P(0)$ ''and'' $ \forall A \in FinPow(X).\ P(A) \longrightarrow (\forall a\in X.\ P(A \cup \{a\}))$ ''and'' $ B \in FinPow(X)$ '' shows '' $ P(B)$ === '')''
''qed'' ===
Union of a finite indexed family of finite sets is finite.
''lemma'' <nowiki>union_fin_list_fin</nowiki>:
'' assumes '' A1: $ n \in nat$ ''and '' A2: $ \forall k \in n.\ N(k) \in FinPow(X)$ '' shows '' $ \{N(k).\ k \in n\} \in FinPow(FinPow(X))$ ''and '' $ (\bigcup k \in n.\ N(k)) \in FinPow(X)$+++[proof ]>
''from '' A1 ''have'' $ n \in FinPow(n)$ ''using'' +++^[nat_finpow_nat | Finite_ZF ]... ''lemma'' <nowiki>nat_finpow_nat</nowiki>: ''assumes '' $ n \in nat$ '' shows '' $ n \in FinPow(nat)$ === , +++^[fin_finpow_self | Finite_ZF ]... ''lemma'' <nowiki>fin_finpow_self</nowiki>: ''assumes '' $ A \in FinPow(X)$ '' shows '' $ A \in FinPow(A)$ ===
''with '' A2 ''show'' $ \{N(k).\ k \in n\} \in FinPow(FinPow(X))$ '' by (rule '' +++^[fin_image_fin | Finite_ZF ]... ''lemma'' <nowiki>fin_image_fin</nowiki>: ''assumes '' $ \forall V\in B.\ K(V)\in C$ ''and'' $ N \in FinPow(B)$ '' shows '' $ \{K(V).\ V\in N\} \in FinPow(C)$ === '')''
''then '' ''show'' $ (\bigcup k \in n.\ N(k)) \in FinPow(X)$ ''using'' +++^[fin_union_finpow | Finite_ZF ]... ''lemma'' <nowiki>fin_union_finpow</nowiki>: ''assumes '' $ M \in FinPow(FinPow(X))$ '' shows '' $ \bigcup M \in FinPow(X)$ ===
''qed'' ===
''end
'' +++![Comments on Finite_ZF|click to add comment] <html> <div> <iframe style="width:60%;height:500px" src="http://www.haloscan.com/comments/slawekk/Finite_ZF"></iframe> </div> </html>
===
''theory'' Fol1 ''imports'' [[Trancl]]
''begin
''
Isabelle/ZF builds on the first order logic. Almost everything one would like to have in this area is covered in the standard Isabelle libraries. The material in this theory provides some lemmas that are missing or allow for a more readable proof style.
!Notions and lemmas in FOL
This section contains mostly shortcuts and workarounds that allow to use more readable coding style.
The next lemma serves as a workaround to problems with applying the definition of transitivity (of a relation) in our coding style (any attempt to do something like //using trans_def// results up Isabelle in an infinite loop).
''lemma'' <nowiki>Fol1_L2</nowiki>:
'' assumes '' A1: $ \forall x y z.\ \langle x, y\rangle \in r \wedge \langle y, z\rangle \in r \longrightarrow \langle x, z\rangle \in r$ '' shows '' $ trans(r)$+++[proof ]>
''from '' A1 ''have'' $ \forall x y z.\ \langle x, y\rangle \in r \longrightarrow \langle y, z\rangle \in r \longrightarrow \langle x, z\rangle \in r$ ''using'' <nowiki>imp_conj</nowiki>
''then '' ''show'' $ thesis$ ''unfolding'' <nowiki>trans_def</nowiki>
''qed'' ===
Another workaround for the problem of Isabelle simplifier looping when the transitivity definition is used.
''lemma'' <nowiki>Fol1_L3</nowiki>:
'' assumes '' A1: $ trans(r)$ ''and '' A2: $ \langle a,b\rangle \in r \wedge \langle b,c\rangle \in r$ '' shows '' $ \langle a,c\rangle \in r$+++[proof ]>
''from '' A1 ''have'' $ \forall x y z.\ \langle x, y\rangle \in r \longrightarrow \langle y, z\rangle \in r \longrightarrow \langle x, z\rangle \in r$ ''unfolding'' <nowiki>trans_def</nowiki>
''with '' A2 ''show'' $ thesis$ ''using'' <nowiki>imp_conj</nowiki>
''qed'' ===
There is a problem with application of the definition of asymetry for relations. The next lemma is a workaround.
''lemma'' <nowiki>Fol1_L4</nowiki>:
'' assumes '' A1: $ antisym(r)$ ''and '' A2: $ \langle a,b\rangle \in r$, $ \langle b,a\rangle \in r$ '' shows '' $ a=b$+++[proof ]>
''from '' A1 ''have'' $ \forall x y.\ \langle x,y\rangle \in r \longrightarrow \langle y,x\rangle \in r \longrightarrow x=y$ ''unfolding'' <nowiki>antisym_def</nowiki>
''with '' A2 ''show'' $ a=b$ ''using'' <nowiki>imp_conj</nowiki>
''qed'' ===
The definition below implements a common idiom that states that (perhaps under some assumptions) exactly one of give three statements is true.
''Definition
'' $ Exactly\_1\_of\_3\_holds(p,q,r) \equiv $
$ (p\vee q\vee r) \wedge (p \longrightarrow \neg q \wedge \neg r) \wedge (q \longrightarrow \neg p \wedge \neg r) \wedge (r \longrightarrow \neg p \wedge \neg q)$
The next lemma allows to prove statements of the form $ Exactly\_1\_of\_3\_holds (p,q,r)$.
''lemma'' <nowiki>Fol1_L5</nowiki>:
'' assumes '' $ p\vee q\vee r$ ''and '' $ p \longrightarrow \neg q \wedge \neg r$ ''and '' $ q \longrightarrow \neg p \wedge \neg r$ ''and '' $ r \longrightarrow \neg p \wedge \neg q$ '' shows '' $ Exactly\_1\_of\_3\_holds (p,q,r)$+++[proof ]>
''from '' prems ''have'' $ (p\vee q\vee r) \wedge (p \longrightarrow \neg q \wedge \neg r) \wedge (q \longrightarrow \neg p \wedge \neg r) \wedge (r \longrightarrow \neg p \wedge \neg q)$
''then '' ''show'' $ Exactly\_1\_of\_3\_holds (p,q,r)$ ''unfolding'' +++^[Exactly_1_of_3_holds_def | Fol1 ]... Definition of <nowiki>Exactly_1_of_3_holds</nowiki>:
$ Exactly\_1\_of\_3\_holds(p,q,r) \equiv $
$ (p\vee q\vee r) \wedge (p \longrightarrow \neg q \wedge \neg r) \wedge (q \longrightarrow \neg p \wedge \neg r) \wedge (r \longrightarrow \neg p \wedge \neg q)$===
''qed'' ===
If exactly one of $p,q,r$ holds and $p$ is not true, then $q$ or $r$.
''lemma'' <nowiki>Fol1_L6</nowiki>:
'' assumes '' A1: $ \neg p$ ''and '' A2: $ Exactly\_1\_of\_3\_holds (p,q,r)$ '' shows '' $ q\vee r$+++[proof ]>
''from '' A2 ''have'' $ (p\vee q\vee r) \wedge (p \longrightarrow \neg q \wedge \neg r) \wedge (q \longrightarrow \neg p \wedge \neg r) \wedge (r \longrightarrow \neg p \wedge \neg q)$ ''unfolding'' +++^[Exactly_1_of_3_holds_def | Fol1 ]... Definition of <nowiki>Exactly_1_of_3_holds</nowiki>:
$ Exactly\_1\_of\_3\_holds(p,q,r) \equiv $
$ (p\vee q\vee r) \wedge (p \longrightarrow \neg q \wedge \neg r) \wedge (q \longrightarrow \neg p \wedge \neg r) \wedge (r \longrightarrow \neg p \wedge \neg q)$===
''hence'' $ p \vee q \vee r$
''with '' A1 ''show'' $ q \vee r$
''qed'' ===
If exactly one of $p,q,r$ holds and $q$ is true, then $r$ can not be true.
''lemma'' <nowiki>Fol1_L7</nowiki>:
'' assumes '' A1: $ q$ ''and '' A2: $ Exactly\_1\_of\_3\_holds (p,q,r)$ '' shows '' $ \neg r$+++[proof ]>
''from '' A2 ''have'' $ (p\vee q\vee r) \wedge (p \longrightarrow \neg q \wedge \neg r) \wedge (q \longrightarrow \neg p \wedge \neg r) \wedge (r \longrightarrow \neg p \wedge \neg q)$ ''unfolding'' +++^[Exactly_1_of_3_holds_def | Fol1 ]... Definition of <nowiki>Exactly_1_of_3_holds</nowiki>:
$ Exactly\_1\_of\_3\_holds(p,q,r) \equiv $
$ (p\vee q\vee r) \wedge (p \longrightarrow \neg q \wedge \neg r) \wedge (q \longrightarrow \neg p \wedge \neg r) \wedge (r \longrightarrow \neg p \wedge \neg q)$===
''with '' A1 ''show'' $ \neg r$
''qed'' ===
The next lemma demonstrates an elegant form of the $ Exactly\_1\_of\_3\_holds (p,q,r)$ predicate. More on that at www.solcon.nl/mklooster/calc/calc-tri.html .
''lemma'' <nowiki>Fol1_L8</nowiki>:
'' shows '' $ Exactly\_1\_of\_3\_holds (p,q,r) \longleftrightarrow (p\longleftrightarrow q\longleftrightarrow r) \wedge \neg (p\wedge q\wedge r)$+++[proof ]>
''assume '' $ Exactly\_1\_of\_3\_holds (p,q,r)$
''then '' ''have'' $ (p\vee q\vee r) \wedge (p \longrightarrow \neg q \wedge \neg r) \wedge (q \longrightarrow \neg p \wedge \neg r) \wedge (r \longrightarrow \neg p \wedge \neg q)$ ''unfolding'' +++^[Exactly_1_of_3_holds_def | Fol1 ]... Definition of <nowiki>Exactly_1_of_3_holds</nowiki>:
$ Exactly\_1\_of\_3\_holds(p,q,r) \equiv $
$ (p\vee q\vee r) \wedge (p \longrightarrow \neg q \wedge \neg r) \wedge (q \longrightarrow \neg p \wedge \neg r) \wedge (r \longrightarrow \neg p \wedge \neg q)$===
''thus'' $ (p\longleftrightarrow q\longleftrightarrow r) \wedge \neg (p\wedge q\wedge r)$
''next ''
''assume '' $ (p\longleftrightarrow q\longleftrightarrow r) \wedge \neg (p\wedge q\wedge r)$
''hence'' $ (p\vee q\vee r) \wedge (p \longrightarrow \neg q \wedge \neg r) \wedge (q \longrightarrow \neg p \wedge \neg r) \wedge (r \longrightarrow \neg p \wedge \neg q)$
''then '' ''show'' $ Exactly\_1\_of\_3\_holds (p,q,r)$ ''unfolding'' +++^[Exactly_1_of_3_holds_def | Fol1 ]... Definition of <nowiki>Exactly_1_of_3_holds</nowiki>:
$ Exactly\_1\_of\_3\_holds(p,q,r) \equiv $
$ (p\vee q\vee r) \wedge (p \longrightarrow \neg q \wedge \neg r) \wedge (q \longrightarrow \neg p \wedge \neg r) \wedge (r \longrightarrow \neg p \wedge \neg q)$===
''qed'' ===
A property of the //Exactly_1_of_3_holds// predicate.
''lemma'' <nowiki>Fol1_L8A</nowiki>:
'' assumes '' A1: $ Exactly\_1\_of\_3\_holds (p,q,r)$ '' shows '' $ p \longleftrightarrow \neg (q \vee r)$+++[proof ]>
''from '' A1 ''have'' $ (p\vee q\vee r) \wedge (p \longrightarrow \neg q \wedge \neg r) \wedge (q \longrightarrow \neg p \wedge \neg r) \wedge (r \longrightarrow \neg p \wedge \neg q)$ ''unfolding'' +++^[Exactly_1_of_3_holds_def | Fol1 ]... Definition of <nowiki>Exactly_1_of_3_holds</nowiki>:
$ Exactly\_1\_of\_3\_holds(p,q,r) \equiv $
$ (p\vee q\vee r) \wedge (p \longrightarrow \neg q \wedge \neg r) \wedge (q \longrightarrow \neg p \wedge \neg r) \wedge (r \longrightarrow \neg p \wedge \neg q)$===
''then '' ''show'' $ p \longleftrightarrow \neg (q \vee r)$
''qed'' ===
Exclusive or definition. There is one also defined in the standard Isabelle, denoted //xor//, but it relates to boolean values, which are sets. Here we define a logical functor.
''Definition
'' $ p \text{ Xor } q \equiv (p\vee q) \wedge \neg (p \wedge q)$
The "exclusive or" is the same as negation of equivalence.
''lemma'' <nowiki>Fol1_L9</nowiki>:
'' shows '' $ p \text{ Xor } q \longleftrightarrow \neg (p\longleftrightarrow q)$ ''using'' +++^[Xor_def | Fol1 ]... Definition of <nowiki>Xor</nowiki>:
$ p \text{ Xor } q \equiv (p\vee q) \wedge \neg (p \wedge q)$===
Equivalence relations are symmetric.
''lemma'' <nowiki>equiv_is_sym</nowiki>:
'' assumes '' A1: $ equiv(X,r)$ ''and '' A2: $ \langle x,y\rangle \in r$ '' shows '' $ \langle y,x\rangle \in r$+++[proof ]>
''from '' A1 ''have'' $ sym(r)$ ''using'' <nowiki>equiv_def</nowiki>
''then '' ''have'' $ \forall x y.\ \langle x,y\rangle \in r \longrightarrow \langle y,x\rangle \in r$ ''unfolding'' <nowiki>sym_def</nowiki>
''with '' A2 ''show'' $ \langle y,x\rangle \in r$
''qed'' ===
''end
'' +++![Comments on Fol1|click to add comment] <html> <div> <iframe style="width:60%;height:500px" src="http://www.haloscan.com/comments/slawekk/Fol1"></iframe> </div> </html>
===
''theory'' Fold_ZF ''imports'' [[InductiveSeq_ZF]]
''begin
''
Suppose we have a binary operation $P: X\times X \rightarrow X$ written multiplicatively as $P\langle x, y \rangle= x\cdot y$. In informal mathematics we can take a sequence $\{ x_k \}_{k\in 0.. n}$ of elements of $X$ and consider the product $x_0\cdot x_1 \cdot .. \cdot x_n$. To do the same thing in formalized mathematics we have to define precisely what is meant by that "$\cdot .. \cdot$". The definitition we want to use is based on the notion of sequence defined by induction discussed in //InductiveSeq_ZF//. We don't really want to derive the terminology for this from the word "product" as that would tie it conceptually to the multiplicative notation. This would be awkward when we want to reuse the same notions to talk about sums like $x_0 + x_1 + .. + x_n$.
In functional programming there is something called "fold". Namely for a function $f$, initial point $a$ and list $\left[ b, c, d\right]$ the expression $ fold(f, a, [b,c,d])$ is defined to be $ f(f(f(a,b),c),d)$ (in Haskell something like this is called //foldl//). If we write $f$ in multiplicative notation we get $a\cdot b \cdot c\cdot d$, so this is exactly what we need. The notion of folds in functional programming is actually much more general that what we need here (not that I know anything about that). In this theory file we just make a slight generalization and talk about folding a list with a binary operation $f:X\times Y \rightarrow X$ with $X$ not necessarily the same as $Y$.
!Folding in ZF
Suppose we have a binary operation $f : X\times Y \rightarrow X$. Then every $y\in Y$ defines a transformation of $X$ defined by $T_y(x) = f\langle x,y\rangle$. In IsarMathLib such transformation is called as $ Fix2ndVar(f,y)$. Using this notion, given a function $f: X\times Y\rightarrow X$ and a sequence $y = \{y_k\}_{k\in N}$ of elements of $X$ we can get a sequence of transformations of $X$. This is defined in //Seq2TransSeq// below. Then we use that sequence of tranformations to define the sequence of partial folds (called //FoldSeq//) by means of //InductiveSeqVarFN// (defined in //InductiveSeq_ZF// theory) which implements the inductive sequence determined by a starting point and a sequence of transformations. Finally, we define the fold of a sequence as the last element of the sequence of the partial folds.
Definition that specifies how to convert a sequence $a$ of elements of $Y$ into a sequence of transformations of $X$, given a binary operation $f :X\times Y \rightarrow X$.
''Definition
'' $ Seq2TrSeq(f,a) \equiv \{\langle k,Fix2ndVar(f,a(k))\rangle .\ k \in domain(a)\}$
Definition of a sequence of partial folds.
''Definition
'' $ FoldSeq(f,x,a) \equiv $
$ InductiveSeqVarFN(x,fstdom(f),Seq2TrSeq(f,a),domain(a))$
Definition of a fold.
''Definition
'' $ Fold(f,x,a) \equiv Last(FoldSeq(f,x,a))$
If $X$ is a set with a binary operation $f:X\times Y \rightarrow X$ then $ Seq2TransSeqN(f,a)$ converts a sequence $a$ of elements of $Y$ into the sequence of corresponding transformations of $X$.
''lemma'' <nowiki>seq2trans_seq_props</nowiki>:
'' assumes '' A1: $ n \in nat$ ''and '' A2: $ f : X\times Y \rightarrow X$ ''and '' A3: $ a:n\rightarrow Y$ ''and '' A4: $ T = Seq2TrSeq(f,a)$ '' shows '' $ T : n \rightarrow (X\rightarrow X)$ ''and '' $ \forall k\in n.\ \forall x\in X.\ (T(k))(x) = f\langle x,a(k)\rangle $+++[proof ]>
''from '' $ a:n\rightarrow Y$ ''have'' D: $ domain(a) = n$ ''using'' +++^[func1_1_L1 | func1 ]... ''lemma'' <nowiki>func1_1_L1</nowiki>: ''assumes '' $ f:A\rightarrow C$ '' shows '' $ domain(f) = A$ ===
''with '' A2, A3, A4 ''show'' $ T : n \rightarrow (X\rightarrow X)$ ''using'' <nowiki>apply_funtype</nowiki> , +++^[fix_2nd_var_fun | func1 ]... ''lemma'' <nowiki>fix_2nd_var_fun</nowiki>: ''assumes '' $ f : X\times Y \rightarrow Z$ ''and'' $ y\in Y$ '' shows '' $ Fix2ndVar(f,y) : X \rightarrow Z$ === , +++^[ZF_fun_from_total | func1 ]... ''lemma'' <nowiki>ZF_fun_from_total</nowiki>: ''assumes '' $ \forall x\in X.\ b(x) \in Y$ '' shows '' $ \{\langle x,b(x)\rangle .\ x\in X\} : X\rightarrow Y$ === , +++^[Seq2TrSeq_def | Fold_ZF ]... Definition of <nowiki>Seq2TrSeq</nowiki>:
$ Seq2TrSeq(f,a) \equiv \{\langle k,Fix2ndVar(f,a(k))\rangle .\ k \in domain(a)\}$===
''with '' A4, D ''have'' I: $ \forall k \in n.\ T(k) = Fix2ndVar(f,a(k))$ ''using'' +++^[Seq2TrSeq_def | Fold_ZF ]... Definition of <nowiki>Seq2TrSeq</nowiki>:
$ Seq2TrSeq(f,a) \equiv \{\langle k,Fix2ndVar(f,a(k))\rangle .\ k \in domain(a)\}$=== , +++^[ZF_fun_from_tot_val0 | func1 ]... ''lemma'' <nowiki>ZF_fun_from_tot_val0</nowiki>: ''assumes '' $ f:X\rightarrow Y$ ''and'' $ f = \{\langle x,b(x)\rangle .\ x\in X\}$ '' shows '' $ \forall x\in X.\ f(x) = b(x)$ ===
++++[{ ]>
''fix '' $ k$ $ fix$ $ x$
''assume '' A5: $ k\in n$, $ x\in X$
''with '' A1, A3 ''have'' $ a(k) \in Y$ ''using'' <nowiki>apply_funtype</nowiki>
''with '' A2, A5, I ''have'' $ (T(k))(x) = f\langle x,a(k)\rangle $ ''using'' +++^[fix_var_val | func1 ]... ''lemma'' <nowiki>fix_var_val</nowiki>: ''assumes '' $ f : X\times Y \rightarrow Z$ ''and'' $ x\in X$, $ y\in Y$ '' shows '' $ Fix1stVar(f,x)(y) = f\langle x,y\rangle $, $ Fix2ndVar(f,y)(x) = f\langle x,y\rangle $ ===
=== ''}''
''thus'' $ \forall k\in n.\ \forall x\in X.\ (T(k))(x) = f\langle x,a(k)\rangle $
''qed'' ===
Basic properties of the sequence of partial folds of a sequence $a = \{y_k\}_{k\in \{0,..,n\} }$.
''theorem'' <nowiki>fold_seq_props</nowiki>:
'' assumes '' A1: $ n \in nat$ ''and '' A2: $ f : X\times Y \rightarrow X$ ''and '' A3: $ y:n\rightarrow Y$ ''and '' A4: $ x\in X$ ''and '' A5: $ Y\neq 0$ ''and '' A6: $ F = FoldSeq(f,x,y)$ '' shows '' $ F: succ(n) \rightarrow X$, $ F(0) = x$ ''and '' $ \forall k\in n.\ F(succ(k)) = f\langle F(k), y(k)\rangle $+++[proof ]>
''let '' $ T = Seq2TrSeq(f,y)$
''from '' A1, A3 ''have'' D: $ domain(y) = n$ ''using'' +++^[func1_1_L1 | func1 ]... ''lemma'' <nowiki>func1_1_L1</nowiki>: ''assumes '' $ f:A\rightarrow C$ '' shows '' $ domain(f) = A$ ===
''from '' $ f : X\times Y \rightarrow X$, $ Y\neq 0$ ''have'' I: $ fstdom(f) = X$ ''using'' +++^[fstdomdef | func1 ]... ''lemma'' <nowiki>fstdomdef</nowiki>: ''assumes '' $ f: X\times Y \rightarrow Z$ ''and'' $ Y\neq 0$ '' shows '' $ fstdom(f) = X$ ===
''with '' A1, A2, A3, A4, A6, D ''show'' II: $ F: succ(n) \rightarrow X$ ''and '' $ F(0) = x$ ''using'' +++^[seq2trans_seq_props | Fold_ZF ]... ''lemma'' <nowiki>seq2trans_seq_props</nowiki>: ''assumes '' $ n \in nat$ ''and'' $ f : X\times Y \rightarrow X$ ''and'' $ a:n\rightarrow Y$ ''and'' $ T = Seq2TrSeq(f,a)$ '' shows '' $ T : n \rightarrow (X\rightarrow X)$ ''and'' $ \forall k\in n.\ \forall x\in X.\ (T(k))(x) = f\langle x,a(k)\rangle $ === , +++^[FoldSeq_def | Fold_ZF ]... Definition of <nowiki>FoldSeq</nowiki>:
$ FoldSeq(f,x,a) \equiv $
$ InductiveSeqVarFN(x,fstdom(f),Seq2TrSeq(f,a),domain(a))$=== , <nowiki>fin_indseq_var_f_props</nowiki>
''from '' A1, A2, A3, A4, A6, I, D ''have'' $ \forall k\in n.\ F(succ(k)) = T(k)(F(k))$ ''using'' +++^[seq2trans_seq_props | Fold_ZF ]... ''lemma'' <nowiki>seq2trans_seq_props</nowiki>: ''assumes '' $ n \in nat$ ''and'' $ f : X\times Y \rightarrow X$ ''and'' $ a:n\rightarrow Y$ ''and'' $ T = Seq2TrSeq(f,a)$ '' shows '' $ T : n \rightarrow (X\rightarrow X)$ ''and'' $ \forall k\in n.\ \forall x\in X.\ (T(k))(x) = f\langle x,a(k)\rangle $ === , +++^[FoldSeq_def | Fold_ZF ]... Definition of <nowiki>FoldSeq</nowiki>:
$ FoldSeq(f,x,a) \equiv $
$ InductiveSeqVarFN(x,fstdom(f),Seq2TrSeq(f,a),domain(a))$=== , <nowiki>fin_indseq_var_f_props</nowiki>
''moreover'' ++++[{ ]>
''fix '' $ k$
''assume '' A5: $ k\in n$
''hence'' $ k \in succ(n)$
''with '' A1, A2, A3, II, A5 ''have'' $ (T(k))(F(k)) = f\langle F(k),y(k)\rangle $ ''using'' <nowiki>apply_funtype</nowiki> , +++^[seq2trans_seq_props | Fold_ZF ]... ''lemma'' <nowiki>seq2trans_seq_props</nowiki>: ''assumes '' $ n \in nat$ ''and'' $ f : X\times Y \rightarrow X$ ''and'' $ a:n\rightarrow Y$ ''and'' $ T = Seq2TrSeq(f,a)$ '' shows '' $ T : n \rightarrow (X\rightarrow X)$ ''and'' $ \forall k\in n.\ \forall x\in X.\ (T(k))(x) = f\langle x,a(k)\rangle $ ===
=== ''}''
''ultimately '' ''show'' $ \forall k\in n.\ F(succ(k)) = f\langle F(k), y(k)\rangle $
''qed'' ===
A consistency condition: if we make the list shorter, then we get a shorter sequence of partial folds with the same values as in the original sequence. This can be proven as a special case of //fin_indseq_var_f_restrict// but a proof using //fold_seq_props// and induction turns out to be shorter.
''lemma'' <nowiki>foldseq_restrict</nowiki>:
'' assumes '' $ n \in nat$, $ k \in succ(n)$ ''and '' $ i \in nat$, $ f : X\times Y \rightarrow X$, $ a : n \rightarrow Y$, $ b : i \rightarrow Y$ ''and '' $ n \subseteq i$, $ \forall j \in n.\ b(j) = a(j)$, $ x \in X$, $ Y \neq 0$ '' shows '' $ FoldSeq(f,x,b)(k) = FoldSeq(f,x,a)(k)$+++[proof ]>
''let '' $ P = FoldSeq(f,x,a)$
''let '' $ Q = FoldSeq(f,x,b)$
''from '' assms ''have'' $ n \in nat$, $ k \in succ(n)$, $ Q(0) = P(0)$ ''and '' $ \forall j \in n.\ Q(j) = P(j) \longrightarrow Q(succ(j)) = P(succ(j))$ ''using'' +++^[fold_seq_props | Fold_ZF ]... ''theorem'' <nowiki>fold_seq_props</nowiki>: ''assumes '' $ n \in nat$ ''and'' $ f : X\times Y \rightarrow X$ ''and'' $ y:n\rightarrow Y$ ''and'' $ x\in X$ ''and'' $ Y\neq 0$ ''and'' $ F = FoldSeq(f,x,y)$ '' shows '' $ F: succ(n) \rightarrow X$, $ F(0) = x$ ''and'' $ \forall k\in n.\ F(succ(k)) = f\langle F(k), y(k)\rangle $ ===
''then '' ''show'' $ Q(k) = P(k)$ '' by (rule '' +++^[fin_nat_ind | Nat_ZF_IML ]... ''lemma'' <nowiki>fin_nat_ind</nowiki>: ''assumes '' $ n \in nat$ ''and'' $ k \in succ(n)$ ''and'' $ P(0)$ ''and'' $ \forall j\in n.\ P(j) \longrightarrow P(succ(j))$ '' shows '' $ P(k)$ === '')''
''qed'' ===
A special case of //foldseq_restrict// when the longer sequence is created from the shorter one by appending one element.
''corollary'' <nowiki>fold_seq_append</nowiki>:
'' assumes '' $ n \in nat$, $ f : X\times Y \rightarrow X$, $ a:n \rightarrow Y$ ''and '' $ x\in X$, $ k \in succ(n)$, $ y\in Y$ '' shows '' $ FoldSeq(f,x,Append(a,y))(k) = FoldSeq(f,x,a)(k)$+++[proof ]>
''let '' $ b = Append(a,y)$
''from '' assms ''have'' $ b : succ(n) \rightarrow Y$, $ \forall j \in n.\ b(j) = a(j)$ ''using'' <nowiki>append_props</nowiki>
''with '' assms ''show'' $ thesis$ ''using'' +++^[foldseq_restrict | Fold_ZF ]... ''lemma'' <nowiki>foldseq_restrict</nowiki>: ''assumes '' $ n \in nat$, $ k \in succ(n)$ ''and'' $ i \in nat$,
$ f : X\times Y \rightarrow X$, $ a : n \rightarrow Y$, $ b : i \rightarrow Y$ ''and'' $ n \subseteq i$, $ \forall j \in n.\ b(j) = a(j)$, $ x \in X$, $ Y \neq 0$ '' shows '' $ FoldSeq(f,x,b)(k) = FoldSeq(f,x,a)(k)$ ===
''qed'' ===
What we really will be using is the notion of the fold of a sequence, which we define as the last element of (inductively defined) sequence of partial folds. The next theorem lists some properties of the product of the fold operation.
''theorem'' <nowiki>fold_props</nowiki>:
'' assumes '' A1: $ n \in nat$ ''and '' A2: $ f : X\times Y \rightarrow X$, $ a:n \rightarrow Y$, $ x\in X$, $ Y\neq 0$ '' shows '' $ Fold(f,x,a) = FoldSeq(f,x,a)(n)$ ''and '' $ Fold(f,x,a) \in X$+++[proof ]>
''from '' assms ''have'' $ FoldSeq(f,x,a) : succ(n) \rightarrow X$ ''using'' +++^[fold_seq_props | Fold_ZF ]... ''theorem'' <nowiki>fold_seq_props</nowiki>: ''assumes '' $ n \in nat$ ''and'' $ f : X\times Y \rightarrow X$ ''and'' $ y:n\rightarrow Y$ ''and'' $ x\in X$ ''and'' $ Y\neq 0$ ''and'' $ F = FoldSeq(f,x,y)$ '' shows '' $ F: succ(n) \rightarrow X$, $ F(0) = x$ ''and'' $ \forall k\in n.\ F(succ(k)) = f\langle F(k), y(k)\rangle $ ===
''with '' A1 ''show'' $ Fold(f,x,a) = FoldSeq(f,x,a)(n)$ ''and '' $ Fold(f,x,a) \in X$ ''using'' <nowiki>last_seq_elem</nowiki> , <nowiki>apply_funtype</nowiki> , +++^[Fold_def | Fold_ZF ]... Definition of <nowiki>Fold</nowiki>:
$ Fold(f,x,a) \equiv Last(FoldSeq(f,x,a))$===
''qed'' ===
A corner case: what happens when we fold an empty list?
''theorem'' <nowiki>fold_empty</nowiki>:
'' assumes '' A1: $ f : X\times Y \rightarrow X$ ''and '' A2: $ a:0\rightarrow Y$, $ x\in X$, $ Y\neq 0$ '' shows '' $ Fold(f,x,a) = x$+++[proof ]>
''let '' $ F = FoldSeq(f,x,a)$
''from '' assms ''have'' I: $ 0 \in nat$, $ f : X\times Y \rightarrow X$, $ a:0\rightarrow Y$, $ x\in X$, $ Y\neq 0$
''then '' ''have'' $ Fold(f,x,a) = F(0)$ '' by (rule '' +++^[fold_props | Fold_ZF ]... ''theorem'' <nowiki>fold_props</nowiki>: ''assumes '' $ n \in nat$ ''and'' $ f : X\times Y \rightarrow X$, $ a:n \rightarrow Y$, $ x\in X$, $ Y\neq 0$ '' shows '' $ Fold(f,x,a) = FoldSeq(f,x,a)(n)$ ''and'' $ Fold(f,x,a) \in X$ === '')''
''moreover'' ''from '' I ''have'' $ 0 \in nat$, $ f : X\times Y \rightarrow X$, $ a:0\rightarrow Y$, $ x\in X$, $ Y\neq 0$ ''and '' $ F = FoldSeq(f,x,a)$
''then '' ''have'' $ F(0) = x$ '' by (rule '' +++^[fold_seq_props | Fold_ZF ]... ''theorem'' <nowiki>fold_seq_props</nowiki>: ''assumes '' $ n \in nat$ ''and'' $ f : X\times Y \rightarrow X$ ''and'' $ y:n\rightarrow Y$ ''and'' $ x\in X$ ''and'' $ Y\neq 0$ ''and'' $ F = FoldSeq(f,x,y)$ '' shows '' $ F: succ(n) \rightarrow X$, $ F(0) = x$ ''and'' $ \forall k\in n.\ F(succ(k)) = f\langle F(k), y(k)\rangle $ === '')''
''ultimately '' ''show'' $ Fold(f,x,a) = x$
''qed'' ===
The next theorem tells us what happens to the fold of a sequence when we add one more element to it.
''theorem'' <nowiki>fold_append</nowiki>:
'' assumes '' A1: $ n \in nat$ ''and '' A2: $ f : X\times Y \rightarrow X$ ''and '' A3: $ a:n\rightarrow Y$ ''and '' A4: $ x\in X$ ''and '' A5: $ y\in Y$ '' shows '' $ FoldSeq(f,x,Append(a,y))(n) = Fold(f,x,a)$ ''and '' $ Fold(f,x,Append(a,y)) = f\langle Fold(f,x,a), y\rangle $+++[proof ]>
''let '' $ b = Append(a,y)$
''let '' $ P = FoldSeq(f,x,b)$
''from '' A5 ''have'' I: $ Y \neq 0$
''with '' assms ''show'' thesis1: $ P(n) = Fold(f,x,a)$ ''using'' +++^[fold_seq_append | Fold_ZF ]... ''corollary'' <nowiki>fold_seq_append</nowiki>: ''assumes '' $ n \in nat$, $ f : X\times Y \rightarrow X$, $ a:n \rightarrow Y$ ''and'' $ x\in X$, $ k \in succ(n)$, $ y\in Y$ '' shows '' $ FoldSeq(f,x,Append(a,y))(k) = FoldSeq(f,x,a)(k)$ === , +++^[fold_props | Fold_ZF ]... ''theorem'' <nowiki>fold_props</nowiki>: ''assumes '' $ n \in nat$ ''and'' $ f : X\times Y \rightarrow X$, $ a:n \rightarrow Y$, $ x\in X$, $ Y\neq 0$ '' shows '' $ Fold(f,x,a) = FoldSeq(f,x,a)(n)$ ''and'' $ Fold(f,x,a) \in X$ ===
''from '' assms, I ''have'' II: $ succ(n) \in nat$, $ f : X\times Y \rightarrow X$, $ b : succ(n) \rightarrow Y$, $ x\in X$, $ Y \neq 0$, $ P = FoldSeq(f,x,b)$ ''using'' <nowiki>append_props</nowiki>
''then '' ''have'' $ \forall k \in succ(n).\ P(succ(k)) = f\langle P(k), b(k)\rangle $ '' by (rule '' +++^[fold_seq_props | Fold_ZF ]... ''theorem'' <nowiki>fold_seq_props</nowiki>: ''assumes '' $ n \in nat$ ''and'' $ f : X\times Y \rightarrow X$ ''and'' $ y:n\rightarrow Y$ ''and'' $ x\in X$ ''and'' $ Y\neq 0$ ''and'' $ F = FoldSeq(f,x,y)$ '' shows '' $ F: succ(n) \rightarrow X$, $ F(0) = x$ ''and'' $ \forall k\in n.\ F(succ(k)) = f\langle F(k), y(k)\rangle $ === '')''
''with '' A3, A5, thesis1 ''have'' $ P(succ(n)) = f\langle Fold(f,x,a), y\rangle $ ''using'' <nowiki>append_props</nowiki>
''moreover'' ''from '' II ''have'' $ P : succ(succ(n)) \rightarrow X$ '' by (rule '' +++^[fold_seq_props | Fold_ZF ]... ''theorem'' <nowiki>fold_seq_props</nowiki>: ''assumes '' $ n \in nat$ ''and'' $ f : X\times Y \rightarrow X$ ''and'' $ y:n\rightarrow Y$ ''and'' $ x\in X$ ''and'' $ Y\neq 0$ ''and'' $ F = FoldSeq(f,x,y)$ '' shows '' $ F: succ(n) \rightarrow X$, $ F(0) = x$ ''and'' $ \forall k\in n.\ F(succ(k)) = f\langle F(k), y(k)\rangle $ === '')''
''then '' ''have'' $ Fold(f,x,b) = P(succ(n))$ ''using'' <nowiki>last_seq_elem</nowiki> , +++^[Fold_def | Fold_ZF ]... Definition of <nowiki>Fold</nowiki>:
$ Fold(f,x,a) \equiv Last(FoldSeq(f,x,a))$===
''ultimately '' ''show'' $ Fold(f,x,Append(a,y)) = f\langle Fold(f,x,a), y\rangle $
''qed'' ===
''end
'' +++![Comments on Fold_ZF|click to add comment] <html> <div> <iframe style="width:60%;height:500px" src="http://www.haloscan.com/comments/slawekk/Fold_ZF"></iframe> </div> </html>
===
Click on the items to the left to browse the IsarMathLib theories. Be patient, your browser may take a couple of seconds to render them. If you want to edit a local copy of this Wiki you may want to enter your username for signing the edits: <<option txtUserName>>.
''theory'' Group_ZF ''imports'' [[Monoid_ZF]]
''begin
''
This theory file covers basics of group theory.
!Definition and basic properties of groups
In this section we define the notion of a group and set up the notation for discussing groups. We prove some basic theorems about groups.
To define a group we take a monoid and add a requirement that the right inverse needs to exist for every element of the group.
''Definition
'' $ \text{IsAgroup}(G,f) \equiv $
$ (\text{IsAmonoid}(G,f) \wedge (\forall g\in G.\ \exists b\in G.\ f\langle g,b\rangle = TheNeutralElement(G,f)))$
We define the group inverse as the set $\{\langle x,y \rangle \in G\times G: x\cdot y = e \}$, where $e$ is the neutral element of the group. This set (which can be written as $(\cdot)^{-1}\{ e\}$) is a certain relation on the group (carrier). Since, as we show later, for every $x\in G$ there is exactly one $y\in G$ such that $x \cdot y = e$ this relation is in fact a function from $G$ to $G$.
''Definition
'' $ GroupInv(G,f) \equiv \{\langle x,y\rangle \in G\times G.\ f\langle x,y\rangle = TheNeutralElement(G,f)\}$
We will use the miltiplicative notation for groups. The neutral element is denoted $1$.
''Locale '' group0
''assumes '' groupAssum: $ \text{IsAgroup}(G,P)$
''defines '' $ 1 \equiv TheNeutralElement(G,P)$
''defines '' $ a \cdot b \equiv P\langle a,b\rangle $
''defines '' $ x^{-1} \equiv GroupInv(G,P)(x)$
First we show a lemma that says that we can use theorems proven in the //monoid0// context (locale).
''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L1</nowiki>:
'' shows '' $ monoid0(G,P)$ ''using'' <nowiki>groupAssum</nowiki> , +++^[IsAgroup_def | Group_ZF ]... Definition of <nowiki>IsAgroup</nowiki>:
$ \text{IsAgroup}(G,f) \equiv $
$ (\text{IsAmonoid}(G,f) \wedge (\forall g\in G.\ \exists b\in G.\ f\langle g,b\rangle = TheNeutralElement(G,f)))$=== , <nowiki>monoid0_def</nowiki>
In some strange cases Isabelle has difficulties with applying the definition of a group. The next lemma defines a rule to be applied in such cases.
''lemma'' <nowiki>definition_of_group</nowiki>:
'' assumes '' $ \text{IsAmonoid}(G,f)$ ''and '' $ \forall g\in G.\ \exists b\in G.\ f\langle g,b\rangle = TheNeutralElement(G,f)$ '' shows '' $ \text{IsAgroup}(G,f)$ ''using'' <nowiki>assms</nowiki> , +++^[IsAgroup_def | Group_ZF ]... Definition of <nowiki>IsAgroup</nowiki>:
$ \text{IsAgroup}(G,f) \equiv $
$ (\text{IsAmonoid}(G,f) \wedge (\forall g\in G.\ \exists b\in G.\ f\langle g,b\rangle = TheNeutralElement(G,f)))$===
A technical lemma that allows to use $1$ as the neutral element of the group without referencing a list of lemmas and definitions.
''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L2</nowiki>:
'' shows '' $ 1 \in G \wedge (\forall g\in G.\ (1 \cdot g = g \wedge g\cdot 1 = g))$ ''using'' +++^[group0_2_L1 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L1</nowiki>: '' shows '' $ monoid0(G,P)$ === , +++^[unit_is_neutral | Monoid_ZF ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>unit_is_neutral</nowiki>: ''assumes '' $ e = TheNeutralElement(G,f)$ '' shows '' $ e \in G \wedge (\forall g\in G.\ e \oplus g = g \wedge g \oplus e = g)$ ===
The group is closed under the group operation. Used all the time, useful to have handy.
''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>:
'' assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ ''using'' <nowiki>assms</nowiki> , +++^[group0_2_L1 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L1</nowiki>: '' shows '' $ monoid0(G,P)$ === , +++^[group0_1_L1 | Monoid_ZF ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>group0_1_L1</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\oplus b \in G$ ===
The group operation is associative. This is another technical lemma that allows to shorten the list of referenced lemmas in some proofs.
''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>:
'' assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ''using'' <nowiki>groupAssum</nowiki> , <nowiki>assms</nowiki> , +++^[IsAgroup_def | Group_ZF ]... Definition of <nowiki>IsAgroup</nowiki>:
$ \text{IsAgroup}(G,f) \equiv $
$ (\text{IsAmonoid}(G,f) \wedge (\forall g\in G.\ \exists b\in G.\ f\langle g,b\rangle = TheNeutralElement(G,f)))$=== , +++^[IsAmonoid_def | Monoid_ZF ]... Definition of <nowiki>IsAmonoid</nowiki>:
$ \text{IsAmonoid}(G,f) \equiv $
$ f \text{ is associative on } G \wedge $
$ (\exists e\in G.\ (\forall g\in G.\ ( (f(\langle e,g\rangle ) = g) \wedge (f(\langle g,e\rangle ) = g))))$=== , +++^[IsAssociative_def | func_ZF ]... Definition of <nowiki>IsAssociative</nowiki>:
$ P \text{ is associative on } G \equiv P : G\times G\rightarrow G \wedge $
$ (\forall x \in G.\ \forall y \in G.\ \forall z \in G.\ $
$ ( P(\langle P(\langle x,y\rangle ),z\rangle ) = P( \langle x,P(\langle y,z\rangle )\rangle )))$=== , +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ ===
The group operation maps $G\times G$ into $G$. It is conveniet to have this fact easily accessible in the //group0// context.
''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assocA</nowiki>:
'' shows '' $ P : G\times G\rightarrow G$ ''using'' <nowiki>groupAssum</nowiki> , +++^[IsAgroup_def | Group_ZF ]... Definition of <nowiki>IsAgroup</nowiki>:
$ \text{IsAgroup}(G,f) \equiv $
$ (\text{IsAmonoid}(G,f) \wedge (\forall g\in G.\ \exists b\in G.\ f\langle g,b\rangle = TheNeutralElement(G,f)))$=== , +++^[IsAmonoid_def | Monoid_ZF ]... Definition of <nowiki>IsAmonoid</nowiki>:
$ \text{IsAmonoid}(G,f) \equiv $
$ f \text{ is associative on } G \wedge $
$ (\exists e\in G.\ (\forall g\in G.\ ( (f(\langle e,g\rangle ) = g) \wedge (f(\langle g,e\rangle ) = g))))$=== , +++^[IsAssociative_def | func_ZF ]... Definition of <nowiki>IsAssociative</nowiki>:
$ P \text{ is associative on } G \equiv P : G\times G\rightarrow G \wedge $
$ (\forall x \in G.\ \forall y \in G.\ \forall z \in G.\ $
$ ( P(\langle P(\langle x,y\rangle ),z\rangle ) = P( \langle x,P(\langle y,z\rangle )\rangle )))$===
The definition of a group requires the existence of the right inverse. We show that this is also the left inverse.
''theorem'' ''(in'' group0'')'' <nowiki>group0_2_T1</nowiki>:
'' assumes '' A1: $ g\in G$ ''and '' A2: $ b\in G$ ''and '' A3: $ g\cdot b = 1 $ '' shows '' $ b\cdot g = 1 $+++[proof ]>
''from '' A2, groupAssum ''obtain '' $ c$ ''where '' I: $ c \in G \wedge b\cdot c = 1 $ ''using'' +++^[IsAgroup_def | Group_ZF ]... Definition of <nowiki>IsAgroup</nowiki>:
$ \text{IsAgroup}(G,f) \equiv $
$ (\text{IsAmonoid}(G,f) \wedge (\forall g\in G.\ \exists b\in G.\ f\langle g,b\rangle = TheNeutralElement(G,f)))$===
''then '' ''have'' $ c\in G$
''have'' $ 1 \in G$ ''using'' +++^[group0_2_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L2</nowiki>: '' shows '' $ 1 \in G \wedge (\forall g\in G.\ (1 \cdot g = g \wedge g\cdot 1 = g))$ ===
''with '' A1, A2, I ''have'' $ b\cdot g = b\cdot (g\cdot (b\cdot c))$ ''using'' +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ === , +++^[group0_2_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L2</nowiki>: '' shows '' $ 1 \in G \wedge (\forall g\in G.\ (1 \cdot g = g \wedge g\cdot 1 = g))$ === , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''also'' ''from '' A1, A2, $ c\in G$ ''have'' $ b\cdot (g\cdot (b\cdot c)) = b\cdot (g\cdot b\cdot c)$ ''using'' +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''also'' ''from '' A3, A2, I ''have'' $ b\cdot (g\cdot b\cdot c)= 1 $ ''using'' +++^[group0_2_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L2</nowiki>: '' shows '' $ 1 \in G \wedge (\forall g\in G.\ (1 \cdot g = g \wedge g\cdot 1 = g))$ ===
''finally '' ''show'' $ b\cdot g = 1 $
''qed'' ===
For every element of a group there is only one inverse.
''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L4</nowiki>:
'' assumes '' A1: $ x\in G$ '' shows '' $ \exists !y.\ y\in G \wedge x\cdot y = 1 $+++[proof ]>
''from '' A1, groupAssum ''show'' $ \exists y.\ y\in G \wedge x\cdot y = 1 $ ''using'' +++^[IsAgroup_def | Group_ZF ]... Definition of <nowiki>IsAgroup</nowiki>:
$ \text{IsAgroup}(G,f) \equiv $
$ (\text{IsAmonoid}(G,f) \wedge (\forall g\in G.\ \exists b\in G.\ f\langle g,b\rangle = TheNeutralElement(G,f)))$===
''fix '' $ y$ $ n$
''assume '' A2: $ y\in G \wedge x\cdot y = 1 $ ''and '' A3: $ n\in G \wedge x\cdot n = 1 $
''show'' $ y=n$+++[proof ]>
''from '' A1, A2 ''have'' T1: $ y\cdot x = 1 $ ''using'' +++^[group0_2_T1 | Group_ZF ]... ''theorem'' ''(in'' group0'')'' <nowiki>group0_2_T1</nowiki>: ''assumes '' $ g\in G$ ''and'' $ b\in G$ ''and'' $ g\cdot b = 1 $ '' shows '' $ b\cdot g = 1 $ ===
''from '' A2, A3 ''have'' $ y = y\cdot (x\cdot n)$ ''using'' +++^[group0_2_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L2</nowiki>: '' shows '' $ 1 \in G \wedge (\forall g\in G.\ (1 \cdot g = g \wedge g\cdot 1 = g))$ ===
''also'' ''from '' A1, A2, A3 ''have'' $ \ldots = (y\cdot x)\cdot n$ ''using'' +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''also'' ''from '' T1, A3 ''have'' $ \ldots = n$ ''using'' +++^[group0_2_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L2</nowiki>: '' shows '' $ 1 \in G \wedge (\forall g\in G.\ (1 \cdot g = g \wedge g\cdot 1 = g))$ ===
''finally '' ''show'' $ y=n$
''qed'' ===
''qed'' ===
The group inverse is a function that maps G into G.
''theorem'' <nowiki>group0_2_T2</nowiki>:
'' assumes '' A1: $ \text{IsAgroup}(G,f)$ '' shows '' $ GroupInv(G,f) : G\rightarrow G$+++[proof ]>
''have'' $ GroupInv(G,f) \subseteq G\times G$ ''using'' +++^[GroupInv_def | Group_ZF ]... Definition of <nowiki>GroupInv</nowiki>:
$ GroupInv(G,f) \equiv \{\langle x,y\rangle \in G\times G.\ f\langle x,y\rangle = TheNeutralElement(G,f)\}$===
''moreover'' ''from '' A1 ''have'' $ \forall x\in G.\ \exists !y.\ y\in G \wedge \langle x,y\rangle \in GroupInv(G,f)$ ''using'' <nowiki>group0_def</nowiki> , +++^[group0_2_L4 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L4</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ \exists !y.\ y\in G \wedge x\cdot y = 1 $ === , +++^[GroupInv_def | Group_ZF ]... Definition of <nowiki>GroupInv</nowiki>:
$ GroupInv(G,f) \equiv \{\langle x,y\rangle \in G\times G.\ f\langle x,y\rangle = TheNeutralElement(G,f)\}$===
''ultimately '' ''show'' $ thesis$ ''using'' +++^[func1_1_L11 | func1 ]... ''lemma'' <nowiki>func1_1_L11</nowiki>: ''assumes '' $ f \subseteq X\times Y$ ''and'' $ \forall x\in X.\ \exists !y.\ y\in Y \wedge \langle x,y\rangle \in f$ '' shows '' $ f: X\rightarrow Y$ ===
''qed'' ===
We can think about the group inverse (the function) as the inverse image of the neutral element. Recall that in Isabelle $ f^{-1}(A)$ denotes the inverse image of the set $A$.
''theorem'' ''(in'' group0'')'' <nowiki>group0_2_T3</nowiki>:
'' shows '' $ P^{-1}\{1 \} = GroupInv(G,P)$+++[proof ]>
''from '' groupAssum ''have'' $ P : G\times G \rightarrow G$ ''using'' +++^[IsAgroup_def | Group_ZF ]... Definition of <nowiki>IsAgroup</nowiki>:
$ \text{IsAgroup}(G,f) \equiv $
$ (\text{IsAmonoid}(G,f) \wedge (\forall g\in G.\ \exists b\in G.\ f\langle g,b\rangle = TheNeutralElement(G,f)))$=== , +++^[IsAmonoid_def | Monoid_ZF ]... Definition of <nowiki>IsAmonoid</nowiki>:
$ \text{IsAmonoid}(G,f) \equiv $
$ f \text{ is associative on } G \wedge $
$ (\exists e\in G.\ (\forall g\in G.\ ( (f(\langle e,g\rangle ) = g) \wedge (f(\langle g,e\rangle ) = g))))$=== , +++^[IsAssociative_def | func_ZF ]... Definition of <nowiki>IsAssociative</nowiki>:
$ P \text{ is associative on } G \equiv P : G\times G\rightarrow G \wedge $
$ (\forall x \in G.\ \forall y \in G.\ \forall z \in G.\ $
$ ( P(\langle P(\langle x,y\rangle ),z\rangle ) = P( \langle x,P(\langle y,z\rangle )\rangle )))$===
''then '' ''show'' $ P^{-1}\{1 \} = GroupInv(G,P)$ ''using'' +++^[func1_1_L14 | func1 ]... ''lemma'' <nowiki>func1_1_L14</nowiki>: ''assumes '' $ f\in X\rightarrow Y$ '' shows '' $ f^{-1}(\{y\}) = \{x\in X.\ f(x) = y\}$ === , +++^[GroupInv_def | Group_ZF ]... Definition of <nowiki>GroupInv</nowiki>:
$ GroupInv(G,f) \equiv \{\langle x,y\rangle \in G\times G.\ f\langle x,y\rangle = TheNeutralElement(G,f)\}$===
''qed'' ===
The inverse is in the group.
''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>:
'' assumes '' A1: $ x\in G$ '' shows '' $ x^{-1}\in G$+++[proof ]>
''from '' groupAssum ''have'' $ GroupInv(G,P) : G\rightarrow G$ ''using'' +++^[group0_2_T2 | Group_ZF ]... ''theorem'' <nowiki>group0_2_T2</nowiki>: ''assumes '' $ \text{IsAgroup}(G,f)$ '' shows '' $ GroupInv(G,f) : G\rightarrow G$ ===
''with '' A1 ''show'' $ thesis$ ''using'' <nowiki>apply_type</nowiki>
''qed'' ===
The notation for the inverse means what it is supposed to mean.
''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L6</nowiki>:
'' assumes '' A1: $ x\in G$ '' shows '' $ x\cdot x^{-1} = 1 \wedge x^{-1}\cdot x = 1 $+++[proof ]>
''from '' groupAssum ''have'' $ GroupInv(G,P) : G\rightarrow G$ ''using'' +++^[group0_2_T2 | Group_ZF ]... ''theorem'' <nowiki>group0_2_T2</nowiki>: ''assumes '' $ \text{IsAgroup}(G,f)$ '' shows '' $ GroupInv(G,f) : G\rightarrow G$ ===
''with '' A1 ''have'' $ \langle x,x^{-1}\rangle \in GroupInv(G,P)$ ''using'' <nowiki>apply_Pair</nowiki>
''then '' ''show'' $ x\cdot x^{-1} = 1 $ ''using'' +++^[GroupInv_def | Group_ZF ]... Definition of <nowiki>GroupInv</nowiki>:
$ GroupInv(G,f) \equiv \{\langle x,y\rangle \in G\times G.\ f\langle x,y\rangle = TheNeutralElement(G,f)\}$===
''with '' A1 ''show'' $ x^{-1}\cdot x = 1 $ ''using'' +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ === , +++^[group0_2_T1 | Group_ZF ]... ''theorem'' ''(in'' group0'')'' <nowiki>group0_2_T1</nowiki>: ''assumes '' $ g\in G$ ''and'' $ b\in G$ ''and'' $ g\cdot b = 1 $ '' shows '' $ b\cdot g = 1 $ ===
''qed'' ===
The next two lemmas state that unless we multiply by the neutral element, the result is always different than any of the operands.
''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L7</nowiki>:
'' assumes '' A1: $ a\in G$ ''and '' A2: $ b\in G$ ''and '' A3: $ a\cdot b = a$ '' shows '' $ b=1 $+++[proof ]>
''from '' A3 ''have'' $ a^{-1} \cdot (a\cdot b) = a^{-1}\cdot a$
''with '' A1, A2 ''show'' $ thesis$ ''using'' +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ === , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ === , +++^[group0_2_L6 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L6</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x\cdot x^{-1} = 1 \wedge x^{-1}\cdot x = 1 $ === , +++^[group0_2_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L2</nowiki>: '' shows '' $ 1 \in G \wedge (\forall g\in G.\ (1 \cdot g = g \wedge g\cdot 1 = g))$ ===
''qed'' ===
See the comment to //group0_2_L7//.
''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L8</nowiki>:
'' assumes '' A1: $ a\in G$ ''and '' A2: $ b\in G$ ''and '' A3: $ a\cdot b = b$ '' shows '' $ a=1 $+++[proof ]>
''from '' A3 ''have'' $ (a\cdot b)\cdot b^{-1} = b\cdot b^{-1}$
''with '' A1, A2 ''have'' $ a\cdot (b\cdot b^{-1}) = b\cdot b^{-1}$ ''using'' +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ === , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''with '' A1, A2 ''show'' $ thesis$ ''using'' +++^[group0_2_L6 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L6</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x\cdot x^{-1} = 1 \wedge x^{-1}\cdot x = 1 $ === , +++^[group0_2_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L2</nowiki>: '' shows '' $ 1 \in G \wedge (\forall g\in G.\ (1 \cdot g = g \wedge g\cdot 1 = g))$ ===
''qed'' ===
The inverse of the neutral element is the neutral element.
''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_one</nowiki>:
'' shows '' $ 1 ^{-1} = 1 $ ''using'' +++^[group0_2_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L2</nowiki>: '' shows '' $ 1 \in G \wedge (\forall g\in G.\ (1 \cdot g = g \wedge g\cdot 1 = g))$ === , +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ === , +++^[group0_2_L6 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L6</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x\cdot x^{-1} = 1 \wedge x^{-1}\cdot x = 1 $ === , +++^[group0_2_L7 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L7</nowiki>: ''assumes '' $ a\in G$ ''and'' $ b\in G$ ''and'' $ a\cdot b = a$ '' shows '' $ b=1 $ ===
if $a^{-1} = 1$, then $a=1$.
''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L8A</nowiki>:
'' assumes '' A1: $ a\in G$ ''and '' A2: $ a^{-1} = 1 $ '' shows '' $ a = 1 $+++[proof ]>
''from '' A1 ''have'' $ a\cdot a^{-1} = 1 $ ''using'' +++^[group0_2_L6 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L6</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x\cdot x^{-1} = 1 \wedge x^{-1}\cdot x = 1 $ ===
''with '' A1, A2 ''show'' $ a = 1 $ ''using'' +++^[group0_2_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L2</nowiki>: '' shows '' $ 1 \in G \wedge (\forall g\in G.\ (1 \cdot g = g \wedge g\cdot 1 = g))$ ===
''qed'' ===
If $a$ is not a unit, then its inverse is not a unit either.
''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L8B</nowiki>:
'' assumes '' $ a\in G$ ''and '' $ a \neq 1 $ '' shows '' $ a^{-1} \neq 1 $ ''using'' <nowiki>assms</nowiki> , +++^[group0_2_L8A | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L8A</nowiki>: ''assumes '' $ a\in G$ ''and'' $ a^{-1} = 1 $ '' shows '' $ a = 1 $ ===
If $a^{-1}$ is not a unit, then a is not a unit either.
''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L8C</nowiki>:
'' assumes '' $ a\in G$ ''and '' $ a^{-1} \neq 1 $ '' shows '' $ a\neq 1 $ ''using'' <nowiki>assms</nowiki> , +++^[group0_2_L8A | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L8A</nowiki>: ''assumes '' $ a\in G$ ''and'' $ a^{-1} = 1 $ '' shows '' $ a = 1 $ === , +++^[group_inv_of_one | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_one</nowiki>: '' shows '' $ 1 ^{-1} = 1 $ ===
If a product of two elements of a group is equal to the neutral element then they are inverses of each other.
''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L9</nowiki>:
'' assumes '' A1: $ a\in G$ ''and '' A2: $ b\in G$ ''and '' A3: $ a\cdot b = 1 $ '' shows '' $ a = b^{-1}$ ''and '' $ b = a^{-1}$+++[proof ]>
''from '' A3 ''have'' $ a\cdot b\cdot b^{-1} = 1 \cdot b^{-1}$
''with '' A1, A2 ''have'' $ a\cdot (b\cdot b^{-1}) = 1 \cdot b^{-1}$ ''using'' +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ === , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''with '' A1, A2 ''show'' $ a = b^{-1}$ ''using'' +++^[group0_2_L6 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L6</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x\cdot x^{-1} = 1 \wedge x^{-1}\cdot x = 1 $ === , +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ === , +++^[group0_2_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L2</nowiki>: '' shows '' $ 1 \in G \wedge (\forall g\in G.\ (1 \cdot g = g \wedge g\cdot 1 = g))$ ===
''from '' A3 ''have'' $ a^{-1}\cdot (a\cdot b) = a^{-1}\cdot 1 $
''with '' A1, A2 ''show'' $ b = a^{-1}$ ''using'' +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ === , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ === , +++^[group0_2_L6 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L6</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x\cdot x^{-1} = 1 \wedge x^{-1}\cdot x = 1 $ === , +++^[group0_2_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L2</nowiki>: '' shows '' $ 1 \in G \wedge (\forall g\in G.\ (1 \cdot g = g \wedge g\cdot 1 = g))$ ===
''qed'' ===
It happens quite often that we know what is (have a meta-function for) the right inverse in a group. The next lemma shows that the value of the group inverse (function) is equal to the right inverse (meta-function).
''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L9A</nowiki>:
'' assumes '' A1: $ \forall g\in G.\ b(g) \in G \wedge g\cdot b(g) = 1 $ '' shows '' $ \forall g\in G.\ b(g) = g^{-1}$+++[proof ]>
''fix '' $ g$
''assume '' $ g\in G$
''moreover'' ''from '' A1, $ g\in G$ ''have'' $ b(g) \in G$
''moreover'' ''from '' A1, $ g\in G$ ''have'' $ g\cdot b(g) = 1 $
''ultimately '' ''show'' $ b(g) = g^{-1}$ '' by (rule '' +++^[group0_2_L9 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L9</nowiki>: ''assumes '' $ a\in G$ ''and'' $ b\in G$ ''and'' $ a\cdot b = 1 $ '' shows '' $ a = b^{-1}$ ''and'' $ b = a^{-1}$ === '')''
''qed'' ===
What is the inverse of a product?
''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_two</nowiki>:
'' assumes '' A1: $ a\in G$ ''and '' A2: $ b\in G$ '' shows '' $ b^{-1}\cdot a^{-1} = (a\cdot b)^{-1}$+++[proof ]>
''from '' A1, A2 ''have'' $ b^{-1}\in G$, $ a^{-1}\in G$, $ a\cdot b\in G$, $ b^{-1}\cdot a^{-1} \in G$ ''using'' +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ === , +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ ===
''from '' A1, A2, $ b^{-1}\cdot a^{-1} \in G$ ''have'' $ a\cdot b\cdot (b^{-1}\cdot a^{-1}) = a\cdot (b\cdot (b^{-1}\cdot a^{-1}))$ ''using'' +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''moreover'' ''from '' A2, $ b^{-1}\in G$, $ a^{-1}\in G$ ''have'' $ b\cdot (b^{-1}\cdot a^{-1}) = b\cdot b^{-1}\cdot a^{-1}$ ''using'' +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''moreover'' ''from '' A2, $ a^{-1}\in G$ ''have'' $ b\cdot b^{-1}\cdot a^{-1} = a^{-1}$ ''using'' +++^[group0_2_L6 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L6</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x\cdot x^{-1} = 1 \wedge x^{-1}\cdot x = 1 $ === , +++^[group0_2_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L2</nowiki>: '' shows '' $ 1 \in G \wedge (\forall g\in G.\ (1 \cdot g = g \wedge g\cdot 1 = g))$ ===
''ultimately '' ''have'' $ a\cdot b\cdot (b^{-1}\cdot a^{-1}) = a\cdot a^{-1}$
''with '' A1 ''have'' $ a\cdot b\cdot (b^{-1}\cdot a^{-1}) = 1 $ ''using'' +++^[group0_2_L6 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L6</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x\cdot x^{-1} = 1 \wedge x^{-1}\cdot x = 1 $ ===
''with '' $ a\cdot b \in G$, $ b^{-1}\cdot a^{-1} \in G$ ''show'' $ b^{-1}\cdot a^{-1} = (a\cdot b)^{-1}$ ''using'' +++^[group0_2_L9 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L9</nowiki>: ''assumes '' $ a\in G$ ''and'' $ b\in G$ ''and'' $ a\cdot b = 1 $ '' shows '' $ a = b^{-1}$ ''and'' $ b = a^{-1}$ ===
''qed'' ===
What is the inverse of a product of three elements?
''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_three</nowiki>:
'' assumes '' A1: $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ (a\cdot b\cdot c)^{-1} = c^{-1}\cdot (a\cdot b)^{-1}$, $ (a\cdot b\cdot c)^{-1} = c^{-1}\cdot (b^{-1}\cdot a^{-1})$, $ (a\cdot b\cdot c)^{-1} = c^{-1}\cdot b^{-1}\cdot a^{-1}$+++[proof ]>
''from '' A1 ''have'' T: $ a\cdot b \in G$, $ a^{-1} \in G$, $ b^{-1} \in G$, $ c^{-1} \in G$ ''using'' +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ === , +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ ===
''with '' A1 ''show'' $ (a\cdot b\cdot c)^{-1} = c^{-1}\cdot (a\cdot b)^{-1}$ ''and '' $ (a\cdot b\cdot c)^{-1} = c^{-1}\cdot (b^{-1}\cdot a^{-1})$ ''using'' +++^[group_inv_of_two | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_two</nowiki>: ''assumes '' $ a\in G$ ''and'' $ b\in G$ '' shows '' $ b^{-1}\cdot a^{-1} = (a\cdot b)^{-1}$ ===
''with '' T ''show'' $ (a\cdot b\cdot c)^{-1} = c^{-1}\cdot b^{-1}\cdot a^{-1}$ ''using'' +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''qed'' ===
The inverse of the inverse is the element.
''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_inv</nowiki>:
'' assumes '' $ a\in G$ '' shows '' $ a = (a^{-1})^{-1}$ ''using'' <nowiki>assms</nowiki> , +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ === , +++^[group0_2_L6 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L6</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x\cdot x^{-1} = 1 \wedge x^{-1}\cdot x = 1 $ === , +++^[group0_2_L9 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L9</nowiki>: ''assumes '' $ a\in G$ ''and'' $ b\in G$ ''and'' $ a\cdot b = 1 $ '' shows '' $ a = b^{-1}$ ''and'' $ b = a^{-1}$ ===
If $a^{-1}\cdot b=1$, then $a=b$.
''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L11</nowiki>:
'' assumes '' A1: $ a\in G$, $ b\in G$ ''and '' A2: $ a^{-1}\cdot b = 1 $ '' shows '' $ a=b$+++[proof ]>
''from '' A1, A2 ''have'' $ a^{-1} \in G$, $ b\in G$, $ a^{-1}\cdot b = 1 $ ''using'' +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ ===
''then '' ''have'' $ b = (a^{-1})^{-1}$ '' by (rule '' +++^[group0_2_L9 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L9</nowiki>: ''assumes '' $ a\in G$ ''and'' $ b\in G$ ''and'' $ a\cdot b = 1 $ '' shows '' $ a = b^{-1}$ ''and'' $ b = a^{-1}$ === '')''
''with '' A1 ''show'' $ a=b$ ''using'' +++^[group_inv_of_inv | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_inv</nowiki>: ''assumes '' $ a\in G$ '' shows '' $ a = (a^{-1})^{-1}$ ===
''qed'' ===
If $a\cdot b^{-1}=1$, then $a=b$.
''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L11A</nowiki>:
'' assumes '' A1: $ a\in G$, $ b\in G$ ''and '' A2: $ a\cdot b^{-1} = 1 $ '' shows '' $ a=b$+++[proof ]>
''from '' A1, A2 ''have'' $ a \in G$, $ b^{-1}\in G$, $ a\cdot b^{-1} = 1 $ ''using'' +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ ===
''then '' ''have'' $ a = (b^{-1})^{-1}$ '' by (rule '' +++^[group0_2_L9 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L9</nowiki>: ''assumes '' $ a\in G$ ''and'' $ b\in G$ ''and'' $ a\cdot b = 1 $ '' shows '' $ a = b^{-1}$ ''and'' $ b = a^{-1}$ === '')''
''with '' A1 ''show'' $ a=b$ ''using'' +++^[group_inv_of_inv | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_inv</nowiki>: ''assumes '' $ a\in G$ '' shows '' $ a = (a^{-1})^{-1}$ ===
''qed'' ===
If if the inverse of $b$ is different than $a$, then the inverse of $a$ is different than $b$.
''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L11B</nowiki>:
'' assumes '' A1: $ a\in G$ ''and '' A2: $ b^{-1} \neq a$ '' shows '' $ a^{-1} \neq b$+++[proof ]>
++++[{ ]>
''assume '' $ a^{-1} = b$
''then '' ''have'' $ (a^{-1})^{-1} = b^{-1}$
''with '' A1, A2 ''have'' $ False$ ''using'' +++^[group_inv_of_inv | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_inv</nowiki>: ''assumes '' $ a\in G$ '' shows '' $ a = (a^{-1})^{-1}$ ===
=== ''}''
''then '' ''show'' $ a^{-1} \neq b$
''qed'' ===
What is the inverse of $ab^{-1}$ ?
''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L12</nowiki>:
'' assumes '' A1: $ a\in G$, $ b\in G$ '' shows '' $ (a\cdot b^{-1})^{-1} = b\cdot a^{-1}$, $ (a^{-1}\cdot b)^{-1} = b^{-1}\cdot a$+++[proof ]>
''from '' A1 ''have'' $ (a\cdot b^{-1})^{-1} = (b^{-1})^{-1}\cdot a^{-1}$ ''and '' $ (a^{-1}\cdot b)^{-1} = b^{-1}\cdot (a^{-1})^{-1}$ ''using'' +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ === , +++^[group_inv_of_two | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_two</nowiki>: ''assumes '' $ a\in G$ ''and'' $ b\in G$ '' shows '' $ b^{-1}\cdot a^{-1} = (a\cdot b)^{-1}$ ===
''with '' A1 ''show'' $ (a\cdot b^{-1})^{-1} = b\cdot a^{-1}$, $ (a^{-1}\cdot b)^{-1} = b^{-1}\cdot a$ ''using'' +++^[group_inv_of_inv | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_inv</nowiki>: ''assumes '' $ a\in G$ '' shows '' $ a = (a^{-1})^{-1}$ ===
''qed'' ===
A couple useful rearrangements with three elements: we can insert a $b\cdot b^{-1}$ between two group elements (another version) and one about a product of an element and inverse of a product, and two others.
''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L14A</nowiki>:
'' assumes '' A1: $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot c^{-1}= (a\cdot b^{-1})\cdot (b\cdot c^{-1})$, $ a^{-1}\cdot c = (a^{-1}\cdot b)\cdot (b^{-1}\cdot c)$, $ a\cdot (b\cdot c)^{-1} = a\cdot c^{-1}\cdot b^{-1}$, $ a\cdot (b\cdot c^{-1}) = a\cdot b\cdot c^{-1}$, $ (a\cdot b^{-1}\cdot c^{-1})^{-1} = c\cdot b\cdot a^{-1}$, $ a\cdot b\cdot c^{-1}\cdot (c\cdot b^{-1}) = a$, $ a\cdot (b\cdot c)\cdot c^{-1} = a\cdot b$+++[proof ]>
''from '' A1 ''have'' T: $ a^{-1} \in G$, $ b^{-1}\in G$, $ c^{-1}\in G$, $ a^{-1}\cdot b \in G$, $ a\cdot b^{-1} \in G$, $ a\cdot b \in G$, $ c\cdot b^{-1} \in G$, $ b\cdot c \in G$ ''using'' +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ === , +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ ===
''from '' A1, T ''have'' $ a\cdot c^{-1} = a\cdot (b^{-1}\cdot b)\cdot c^{-1}$, $ a^{-1}\cdot c = a^{-1}\cdot (b\cdot b^{-1})\cdot c$ ''using'' +++^[group0_2_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L2</nowiki>: '' shows '' $ 1 \in G \wedge (\forall g\in G.\ (1 \cdot g = g \wedge g\cdot 1 = g))$ === , +++^[group0_2_L6 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L6</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x\cdot x^{-1} = 1 \wedge x^{-1}\cdot x = 1 $ ===
''with '' A1, T ''show'' $ a\cdot c^{-1}= (a\cdot b^{-1})\cdot (b\cdot c^{-1})$, $ a^{-1}\cdot c = (a^{-1}\cdot b)\cdot (b^{-1}\cdot c)$ ''using'' +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''from '' A1 ''have'' $ a\cdot (b\cdot c)^{-1} = a\cdot (c^{-1}\cdot b^{-1})$ ''using'' +++^[group_inv_of_two | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_two</nowiki>: ''assumes '' $ a\in G$ ''and'' $ b\in G$ '' shows '' $ b^{-1}\cdot a^{-1} = (a\cdot b)^{-1}$ ===
''with '' A1, T ''show'' $ a\cdot (b\cdot c)^{-1} =a\cdot c^{-1}\cdot b^{-1}$ ''using'' +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''from '' A1, T ''show'' $ a\cdot (b\cdot c^{-1}) = a\cdot b\cdot c^{-1}$ ''using'' +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''from '' A1, T ''show'' $ (a\cdot b^{-1}\cdot c^{-1})^{-1} = c\cdot b\cdot a^{-1}$ ''using'' +++^[group_inv_of_three | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_three</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ (a\cdot b\cdot c)^{-1} = c^{-1}\cdot (a\cdot b)^{-1}$,
$ (a\cdot b\cdot c)^{-1} = c^{-1}\cdot (b^{-1}\cdot a^{-1})$,
$ (a\cdot b\cdot c)^{-1} = c^{-1}\cdot b^{-1}\cdot a^{-1}$ === , +++^[group_inv_of_inv | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_inv</nowiki>: ''assumes '' $ a\in G$ '' shows '' $ a = (a^{-1})^{-1}$ ===
''from '' T ''have'' $ a\cdot b\cdot c^{-1}\cdot (c\cdot b^{-1}) = a\cdot b\cdot (c^{-1}\cdot (c\cdot b^{-1}))$ ''using'' +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''also'' ''from '' A1, T ''have'' $ \ldots = a\cdot b\cdot b^{-1}$ ''using'' +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ === , +++^[group0_2_L6 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L6</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x\cdot x^{-1} = 1 \wedge x^{-1}\cdot x = 1 $ === , +++^[group0_2_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L2</nowiki>: '' shows '' $ 1 \in G \wedge (\forall g\in G.\ (1 \cdot g = g \wedge g\cdot 1 = g))$ ===
''also'' ''from '' A1, T ''have'' $ \ldots = a\cdot (b\cdot b^{-1})$ ''using'' +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''also'' ''from '' A1 ''have'' $ \ldots = a$ ''using'' +++^[group0_2_L6 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L6</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x\cdot x^{-1} = 1 \wedge x^{-1}\cdot x = 1 $ === , +++^[group0_2_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L2</nowiki>: '' shows '' $ 1 \in G \wedge (\forall g\in G.\ (1 \cdot g = g \wedge g\cdot 1 = g))$ ===
''finally '' ''show'' $ a\cdot b\cdot c^{-1}\cdot (c\cdot b^{-1}) = a$
''from '' A1, T ''have'' $ a\cdot (b\cdot c)\cdot c^{-1} = a\cdot (b\cdot (c\cdot c^{-1}))$ ''using'' +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''also'' ''from '' A1, T ''have'' $ \ldots = a\cdot b$ ''using'' +++^[group0_2_L6 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L6</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x\cdot x^{-1} = 1 \wedge x^{-1}\cdot x = 1 $ === , +++^[group0_2_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L2</nowiki>: '' shows '' $ 1 \in G \wedge (\forall g\in G.\ (1 \cdot g = g \wedge g\cdot 1 = g))$ ===
''finally '' ''show'' $ a\cdot (b\cdot c)\cdot c^{-1} = a\cdot b$
''qed'' ===
Another lemma about rearranging a product of four group elements.
''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L15</nowiki>:
'' assumes '' A1: $ a\in G$, $ b\in G$, $ c\in G$, $ d\in G$ '' shows '' $ (a\cdot b)\cdot (c\cdot d)^{-1} = a\cdot (b\cdot d^{-1})\cdot a^{-1}\cdot (a\cdot c^{-1})$+++[proof ]>
''from '' A1 ''have'' T1: $ d^{-1}\in G$, $ c^{-1}\in G$, $ a\cdot b\in G$, $ a\cdot (b\cdot d^{-1})\in G$ ''using'' +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ === , +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ ===
''with '' A1 ''have'' $ (a\cdot b)\cdot (c\cdot d)^{-1} = (a\cdot b)\cdot (d^{-1}\cdot c^{-1})$ ''using'' +++^[group_inv_of_two | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_two</nowiki>: ''assumes '' $ a\in G$ ''and'' $ b\in G$ '' shows '' $ b^{-1}\cdot a^{-1} = (a\cdot b)^{-1}$ ===
''also'' ''from '' A1, T1 ''have'' $ \ldots = a\cdot (b\cdot d^{-1})\cdot c^{-1}$ ''using'' +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''also'' ''from '' A1, T1 ''have'' $ \ldots = a\cdot (b\cdot d^{-1})\cdot a^{-1}\cdot (a\cdot c^{-1})$ ''using'' +++^[group0_2_L14A | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L14A</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot c^{-1}= (a\cdot b^{-1})\cdot (b\cdot c^{-1})$,
$ a^{-1}\cdot c = (a^{-1}\cdot b)\cdot (b^{-1}\cdot c)$,
$ a\cdot (b\cdot c)^{-1} = a\cdot c^{-1}\cdot b^{-1}$,
$ a\cdot (b\cdot c^{-1}) = a\cdot b\cdot c^{-1}$,
$ (a\cdot b^{-1}\cdot c^{-1})^{-1} = c\cdot b\cdot a^{-1}$,
$ a\cdot b\cdot c^{-1}\cdot (c\cdot b^{-1}) = a$, $ a\cdot (b\cdot c)\cdot c^{-1} = a\cdot b$ ===
''finally '' ''show'' $ thesis$
''qed'' ===
We can cancel an element with its inverse that is written next to it.
''lemma'' ''(in'' group0'')'' <nowiki>inv_cancel_two</nowiki>:
'' assumes '' A1: $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b^{-1}\cdot b = a$, $ a\cdot b\cdot b^{-1} = a$, $ a^{-1}\cdot (a\cdot b) = b$, $ a\cdot (a^{-1}\cdot b) = b$+++[proof ]>
''from '' A1 ''have'' $ a\cdot b^{-1}\cdot b = a\cdot (b^{-1}\cdot b)$, $ a\cdot b\cdot b^{-1} = a\cdot (b\cdot b^{-1})$, $ a^{-1}\cdot (a\cdot b) = a^{-1}\cdot a\cdot b$, $ a\cdot (a^{-1}\cdot b) = a\cdot a^{-1}\cdot b$ ''using'' +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ === , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''with '' A1 ''show'' $ a\cdot b^{-1}\cdot b = a$, $ a\cdot b\cdot b^{-1} = a$, $ a^{-1}\cdot (a\cdot b) = b$, $ a\cdot (a^{-1}\cdot b) = b$ ''using'' +++^[group0_2_L6 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L6</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x\cdot x^{-1} = 1 \wedge x^{-1}\cdot x = 1 $ === , +++^[group0_2_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L2</nowiki>: '' shows '' $ 1 \in G \wedge (\forall g\in G.\ (1 \cdot g = g \wedge g\cdot 1 = g))$ ===
''qed'' ===
Another lemma about cancelling with two group elements.
''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L16A</nowiki>:
'' assumes '' A1: $ a\in G$, $ b\in G$ '' shows '' $ a\cdot (b\cdot a)^{-1} = b^{-1}$+++[proof ]>
''from '' A1 ''have'' $ (b\cdot a)^{-1} = a^{-1}\cdot b^{-1}$, $ b^{-1} \in G$ ''using'' +++^[group_inv_of_two | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_two</nowiki>: ''assumes '' $ a\in G$ ''and'' $ b\in G$ '' shows '' $ b^{-1}\cdot a^{-1} = (a\cdot b)^{-1}$ === , +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ ===
''with '' A1 ''show'' $ a\cdot (b\cdot a)^{-1} = b^{-1}$ ''using'' +++^[inv_cancel_two | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inv_cancel_two</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b^{-1}\cdot b = a$,
$ a\cdot b\cdot b^{-1} = a$, $ a^{-1}\cdot (a\cdot b) = b$, $ a\cdot (a^{-1}\cdot b) = b$ ===
''qed'' ===
Adding a neutral element to a set that is closed under the group operation results in a set that is closed under the group operation.
''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L17</nowiki>:
'' assumes '' $ H\subseteq G$ ''and '' $ H \text{ is closed under } P$ '' shows '' $ (H \cup \{1 \}) \text{ is closed under } P$ ''using'' <nowiki>assms</nowiki> , +++^[IsOpClosed_def | func_ZF ]... Definition of <nowiki>IsOpClosed</nowiki>:
$ A \text{ is closed under } f \equiv \forall x\in A.\ \forall y\in A.\ f\langle x,y\rangle \in A$=== , +++^[group0_2_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L2</nowiki>: '' shows '' $ 1 \in G \wedge (\forall g\in G.\ (1 \cdot g = g \wedge g\cdot 1 = g))$ ===
We can put an element on the other side of an equation.
''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L18</nowiki>:
'' assumes '' A1: $ a\in G$, $ b\in G$, $ c\in G$ ''and '' A2: $ c = a\cdot b$ '' shows '' $ c\cdot b^{-1} = a$, $ a^{-1}\cdot c = b$+++[proof ]>
''from '' A2, A1 ''have'' $ c\cdot b^{-1} = a\cdot (b\cdot b^{-1})$, $ a^{-1}\cdot c = (a^{-1}\cdot a)\cdot b$ ''using'' +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ === , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''moreover'' ''from '' A1 ''have'' $ a\cdot (b\cdot b^{-1}) = a$, $ (a^{-1}\cdot a)\cdot b = b$ ''using'' +++^[group0_2_L6 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L6</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x\cdot x^{-1} = 1 \wedge x^{-1}\cdot x = 1 $ === , +++^[group0_2_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L2</nowiki>: '' shows '' $ 1 \in G \wedge (\forall g\in G.\ (1 \cdot g = g \wedge g\cdot 1 = g))$ ===
''ultimately '' ''show'' $ c\cdot b^{-1} = a$, $ a^{-1}\cdot c = b$
''qed'' ===
Multiplying different group elements by the same factor results in different group elements.
''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L19</nowiki>:
'' assumes '' A1: $ a\in G$, $ b\in G$, $ c\in G$ ''and '' A2: $ a\neq b$ '' shows '' $ a\cdot c \neq b\cdot c$ ''and '' $ c\cdot a \neq c\cdot b$+++[proof ]>
++++[{ ]>
''assume '' $ a\cdot c = b\cdot c \vee c\cdot a =c\cdot b$
''then '' ''have'' $ a\cdot c\cdot c^{-1} = b\cdot c\cdot c^{-1} \vee c^{-1}\cdot (c\cdot a) = c^{-1}\cdot (c\cdot b)$
''with '' A1, A2 ''have'' $ False$ ''using'' +++^[inv_cancel_two | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inv_cancel_two</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b^{-1}\cdot b = a$,
$ a\cdot b\cdot b^{-1} = a$, $ a^{-1}\cdot (a\cdot b) = b$, $ a\cdot (a^{-1}\cdot b) = b$ ===
=== ''}''
''then '' ''show'' $ a\cdot c \neq b\cdot c$ ''and '' $ c\cdot a \neq c\cdot b$
''qed'' ===
!Subgroups
There are two common ways to define subgroups. One requires that the group operation is closed in the subgroup. The second one defines subgroup as a subset of a group which is itself a group under the group operations. We use the second approach because it results in shorter definition.
The rest of this section is devoted to proving the equivalence of these two definitions of the notion of a subgroup.
A pair $(H,P)$ is a subgroup if $H$ forms a group with the operation $P$ restricted to $H\times H$. It may be surprising that we don't require $H$ to be a subset of $G$. This however can be inferred from the definition if the pair $(G,P)$ is a group, see lemma //group0_3_L2//.
''Definition
'' $ IsAsubgroup(H,P) \equiv \text{IsAgroup}(H, restrict(P,H\times H))$
Formally the group operation in a subgroup is different than in the group as they have different domains. Of course we want to use the original operation with the associated notation in the subgroup. The next couple of lemmas will allow for that. The next lemma states that the neutral element of a subgroup is in the subgroup and it is both right and left neutral there. The notation is very ugly because we don't want to introduce a separate notation for the subgroup operation.
''lemma'' <nowiki>group0_3_L1</nowiki>:
'' assumes '' A1: $ IsAsubgroup(H,f)$ ''and '' A2: $ n = TheNeutralElement(H,restrict(f,H\times H))$ '' shows '' $ n \in H$, $ \forall h\in H.\ restrict(f,H\times H)\langle n,h \rangle = h$, $ \forall h\in H.\ restrict(f,H\times H)\langle h,n\rangle = h$+++[proof ]>
''let '' $ b = restrict(f,H\times H)$
''let '' $ e = TheNeutralElement(H,restrict(f,H\times H))$
''from '' A1 ''have'' $ group0(H,b)$ ''using'' +++^[IsAsubgroup_def | Group_ZF ]... Definition of <nowiki>IsAsubgroup</nowiki>:
$ IsAsubgroup(H,P) \equiv \text{IsAgroup}(H, restrict(P,H\times H))$=== , <nowiki>group0_def</nowiki>
''then '' ''have'' I: $ e \in H \wedge (\forall h\in H.\ (b\langle e,h \rangle = h \wedge b\langle h,e\rangle = h))$ '' by (rule '' +++^[group0_2_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L2</nowiki>: '' shows '' $ 1 \in G \wedge (\forall g\in G.\ (1 \cdot g = g \wedge g\cdot 1 = g))$ === '')''
''with '' A2 ''show'' $ n \in H$
''from '' A2, I ''show'' $ \forall h\in H.\ b\langle n,h\rangle = h$ ''and '' $ \forall h\in H.\ b\langle h,n\rangle = h$
''qed'' ===
A subgroup is contained in the group.
''lemma'' ''(in'' group0'')'' <nowiki>group0_3_L2</nowiki>:
'' assumes '' A1: $ IsAsubgroup(H,P)$ '' shows '' $ H \subseteq G$+++[proof ]>
''fix '' $ h$
''assume '' $ h\in H$
''let '' $ b = restrict(P,H\times H)$
''let '' $ n = TheNeutralElement(H,restrict(P,H\times H))$
''from '' A1 ''have'' $ b \in H\times H\rightarrow H$ ''using'' +++^[IsAsubgroup_def | Group_ZF ]... Definition of <nowiki>IsAsubgroup</nowiki>:
$ IsAsubgroup(H,P) \equiv \text{IsAgroup}(H, restrict(P,H\times H))$=== , +++^[IsAgroup_def | Group_ZF ]... Definition of <nowiki>IsAgroup</nowiki>:
$ \text{IsAgroup}(G,f) \equiv $
$ (\text{IsAmonoid}(G,f) \wedge (\forall g\in G.\ \exists b\in G.\ f\langle g,b\rangle = TheNeutralElement(G,f)))$=== , +++^[IsAmonoid_def | Monoid_ZF ]... Definition of <nowiki>IsAmonoid</nowiki>:
$ \text{IsAmonoid}(G,f) \equiv $
$ f \text{ is associative on } G \wedge $
$ (\exists e\in G.\ (\forall g\in G.\ ( (f(\langle e,g\rangle ) = g) \wedge (f(\langle g,e\rangle ) = g))))$=== , +++^[IsAssociative_def | func_ZF ]... Definition of <nowiki>IsAssociative</nowiki>:
$ P \text{ is associative on } G \equiv P : G\times G\rightarrow G \wedge $
$ (\forall x \in G.\ \forall y \in G.\ \forall z \in G.\ $
$ ( P(\langle P(\langle x,y\rangle ),z\rangle ) = P( \langle x,P(\langle y,z\rangle )\rangle )))$===
''moreover'' ''from '' A1, $ h\in H$ ''have'' $ \langle n,h\rangle \in H\times H$ ''using'' +++^[group0_3_L1 | Group_ZF ]... ''lemma'' <nowiki>group0_3_L1</nowiki>: ''assumes '' $ IsAsubgroup(H,f)$ ''and'' $ n = TheNeutralElement(H,restrict(f,H\times H))$ '' shows '' $ n \in H$, $ \forall h\in H.\ restrict(f,H\times H)\langle n,h \rangle = h$,
$ \forall h\in H.\ restrict(f,H\times H)\langle h,n\rangle = h$ ===
''moreover'' ''from '' A1, $ h\in H$ ''have'' $ h = b\langle n,h \rangle $ ''using'' +++^[group0_3_L1 | Group_ZF ]... ''lemma'' <nowiki>group0_3_L1</nowiki>: ''assumes '' $ IsAsubgroup(H,f)$ ''and'' $ n = TheNeutralElement(H,restrict(f,H\times H))$ '' shows '' $ n \in H$, $ \forall h\in H.\ restrict(f,H\times H)\langle n,h \rangle = h$,
$ \forall h\in H.\ restrict(f,H\times H)\langle h,n\rangle = h$ ===
''ultimately '' ''have'' $ \langle \langle n,h\rangle ,h\rangle \in b$ ''using'' +++^[func1_1_L5A | func1 ]... ''lemma'' <nowiki>func1_1_L5A</nowiki>: ''assumes '' $ f:X\rightarrow Y$, $ x\in X$, $ y = f(x)$ '' shows '' $ \langle x,y\rangle \in f$, $ y \in range(f)$ ===
''then '' ''have'' $ \langle \langle n,h\rangle ,h\rangle \in P$ ''using'' <nowiki>restrict_subset</nowiki>
''moreover'' ''from '' groupAssum ''have'' $ P:G\times G\rightarrow G$ ''using'' +++^[IsAgroup_def | Group_ZF ]... Definition of <nowiki>IsAgroup</nowiki>:
$ \text{IsAgroup}(G,f) \equiv $
$ (\text{IsAmonoid}(G,f) \wedge (\forall g\in G.\ \exists b\in G.\ f\langle g,b\rangle = TheNeutralElement(G,f)))$=== , +++^[IsAmonoid_def | Monoid_ZF ]... Definition of <nowiki>IsAmonoid</nowiki>:
$ \text{IsAmonoid}(G,f) \equiv $
$ f \text{ is associative on } G \wedge $
$ (\exists e\in G.\ (\forall g\in G.\ ( (f(\langle e,g\rangle ) = g) \wedge (f(\langle g,e\rangle ) = g))))$=== , +++^[IsAssociative_def | func_ZF ]... Definition of <nowiki>IsAssociative</nowiki>:
$ P \text{ is associative on } G \equiv P : G\times G\rightarrow G \wedge $
$ (\forall x \in G.\ \forall y \in G.\ \forall z \in G.\ $
$ ( P(\langle P(\langle x,y\rangle ),z\rangle ) = P( \langle x,P(\langle y,z\rangle )\rangle )))$===
''ultimately '' ''show'' $ h\in G$ ''using'' +++^[func1_1_L5 | func1 ]... ''lemma'' <nowiki>func1_1_L5</nowiki>: ''assumes '' $ \langle x,y\rangle \in f$ ''and'' $ f:X\rightarrow Y$ '' shows '' $ x\in X \wedge y\in Y$ ===
''qed'' ===
The group's neutral element (denoted $1$ in the group0 context) is a neutral element for the subgroup with respect to the group action.
''lemma'' ''(in'' group0'')'' <nowiki>group0_3_L3</nowiki>:
'' assumes '' $ IsAsubgroup(H,P)$ '' shows '' $ \forall h\in H.\ 1 \cdot h = h \wedge h\cdot 1 = h$ ''using'' <nowiki>assms</nowiki> , <nowiki>groupAssum</nowiki> , +++^[group0_3_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_3_L2</nowiki>: ''assumes '' $ IsAsubgroup(H,P)$ '' shows '' $ H \subseteq G$ === , +++^[group0_2_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L2</nowiki>: '' shows '' $ 1 \in G \wedge (\forall g\in G.\ (1 \cdot g = g \wedge g\cdot 1 = g))$ ===
The neutral element of a subgroup is the same as that of the group.
''lemma'' ''(in'' group0'')'' <nowiki>group0_3_L4</nowiki>:
'' assumes '' A1: $ IsAsubgroup(H,P)$ '' shows '' $ TheNeutralElement(H,restrict(P,H\times H)) = 1 $+++[proof ]>
''let '' $ n = TheNeutralElement(H,restrict(P,H\times H))$
''from '' A1 ''have'' $ n \in H$ ''using'' +++^[group0_3_L1 | Group_ZF ]... ''lemma'' <nowiki>group0_3_L1</nowiki>: ''assumes '' $ IsAsubgroup(H,f)$ ''and'' $ n = TheNeutralElement(H,restrict(f,H\times H))$ '' shows '' $ n \in H$, $ \forall h\in H.\ restrict(f,H\times H)\langle n,h \rangle = h$,
$ \forall h\in H.\ restrict(f,H\times H)\langle h,n\rangle = h$ ===
''with '' groupAssum, A1 ''have'' $ n\in G$ ''using'' +++^[group0_3_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_3_L2</nowiki>: ''assumes '' $ IsAsubgroup(H,P)$ '' shows '' $ H \subseteq G$ ===
''with '' A1, $ n \in H$ ''show'' $ thesis$ ''using'' +++^[group0_3_L1 | Group_ZF ]... ''lemma'' <nowiki>group0_3_L1</nowiki>: ''assumes '' $ IsAsubgroup(H,f)$ ''and'' $ n = TheNeutralElement(H,restrict(f,H\times H))$ '' shows '' $ n \in H$, $ \forall h\in H.\ restrict(f,H\times H)\langle n,h \rangle = h$,
$ \forall h\in H.\ restrict(f,H\times H)\langle h,n\rangle = h$ === , <nowiki>restrict_if</nowiki> , +++^[group0_2_L7 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L7</nowiki>: ''assumes '' $ a\in G$ ''and'' $ b\in G$ ''and'' $ a\cdot b = a$ '' shows '' $ b=1 $ ===
''qed'' ===
The neutral element of the group (denoted $1$ in the group0 context) belongs to every subgroup.
''lemma'' ''(in'' group0'')'' <nowiki>group0_3_L5</nowiki>:
'' assumes '' A1: $ IsAsubgroup(H,P)$ '' shows '' $ 1 \in H$+++[proof ]>
''from '' A1 ''show'' $ 1 \in H$ ''using'' +++^[group0_3_L1 | Group_ZF ]... ''lemma'' <nowiki>group0_3_L1</nowiki>: ''assumes '' $ IsAsubgroup(H,f)$ ''and'' $ n = TheNeutralElement(H,restrict(f,H\times H))$ '' shows '' $ n \in H$, $ \forall h\in H.\ restrict(f,H\times H)\langle n,h \rangle = h$,
$ \forall h\in H.\ restrict(f,H\times H)\langle h,n\rangle = h$ === , +++^[group0_3_L4 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_3_L4</nowiki>: ''assumes '' $ IsAsubgroup(H,P)$ '' shows '' $ TheNeutralElement(H,restrict(P,H\times H)) = 1 $ ===
''qed'' ===
Subgroups are closed with respect to the group operation.
''lemma'' ''(in'' group0'')'' <nowiki>group0_3_L6</nowiki>:
'' assumes '' A1: $ IsAsubgroup(H,P)$ ''and '' A2: $ a\in H$, $ b\in H$ '' shows '' $ a\cdot b \in H$+++[proof ]>
''let '' $ f = restrict(P,H\times H)$
''from '' A1 ''have'' $ monoid0(H,f)$ ''using'' +++^[IsAsubgroup_def | Group_ZF ]... Definition of <nowiki>IsAsubgroup</nowiki>:
$ IsAsubgroup(H,P) \equiv \text{IsAgroup}(H, restrict(P,H\times H))$=== , +++^[IsAgroup_def | Group_ZF ]... Definition of <nowiki>IsAgroup</nowiki>:
$ \text{IsAgroup}(G,f) \equiv $
$ (\text{IsAmonoid}(G,f) \wedge (\forall g\in G.\ \exists b\in G.\ f\langle g,b\rangle = TheNeutralElement(G,f)))$=== , <nowiki>monoid0_def</nowiki>
''with '' A2 ''have'' $ f (\langle a,b\rangle ) \in H$ ''using'' +++^[group0_1_L1 | Monoid_ZF ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>group0_1_L1</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\oplus b \in G$ ===
''with '' A2 ''show'' $ a\cdot b \in H$ ''using'' <nowiki>restrict_if</nowiki>
''qed'' ===
A preliminary lemma that we need to show that taking the inverse in the subgroup is the same as taking the inverse in the group.
''lemma'' <nowiki>group0_3_L7A</nowiki>:
'' assumes '' A1: $ \text{IsAgroup}(G,f)$ ''and '' A2: $ IsAsubgroup(H,f)$ ''and '' A3: $ g = restrict(f,H\times H)$ '' shows '' $ GroupInv(G,f) \cap H\times H = GroupInv(H,g)$+++[proof ]>
''let '' $ e = TheNeutralElement(G,f)$
''let '' $ e_1 = TheNeutralElement(H,g)$
''from '' A1 ''have'' $ group0(G,f)$ ''using'' <nowiki>group0_def</nowiki>
''from '' A2, A3 ''have'' $ group0(H,g)$ ''using'' +++^[IsAsubgroup_def | Group_ZF ]... Definition of <nowiki>IsAsubgroup</nowiki>:
$ IsAsubgroup(H,P) \equiv \text{IsAgroup}(H, restrict(P,H\times H))$=== , <nowiki>group0_def</nowiki>
''from '' $ group0(G,f)$, A2, A3 ''have'' $ GroupInv(G,f) = f^{-1}\{e_1\}$ ''using'' +++^[group0_3_L4 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_3_L4</nowiki>: ''assumes '' $ IsAsubgroup(H,P)$ '' shows '' $ TheNeutralElement(H,restrict(P,H\times H)) = 1 $ === , +++^[group0_2_T3 | Group_ZF ]... ''theorem'' ''(in'' group0'')'' <nowiki>group0_2_T3</nowiki>: '' shows '' $ P^{-1}\{1 \} = GroupInv(G,P)$ ===
''moreover'' ''have'' $ g^{-1}\{e_1\} = f^{-1}\{e_1\} \cap H\times H$+++[proof ]>
''from '' A1 ''have'' $ f \in G\times G\rightarrow G$ ''using'' +++^[IsAgroup_def | Group_ZF ]... Definition of <nowiki>IsAgroup</nowiki>:
$ \text{IsAgroup}(G,f) \equiv $
$ (\text{IsAmonoid}(G,f) \wedge (\forall g\in G.\ \exists b\in G.\ f\langle g,b\rangle = TheNeutralElement(G,f)))$=== , +++^[IsAmonoid_def | Monoid_ZF ]... Definition of <nowiki>IsAmonoid</nowiki>:
$ \text{IsAmonoid}(G,f) \equiv $
$ f \text{ is associative on } G \wedge $
$ (\exists e\in G.\ (\forall g\in G.\ ( (f(\langle e,g\rangle ) = g) \wedge (f(\langle g,e\rangle ) = g))))$=== , +++^[IsAssociative_def | func_ZF ]... Definition of <nowiki>IsAssociative</nowiki>:
$ P \text{ is associative on } G \equiv P : G\times G\rightarrow G \wedge $
$ (\forall x \in G.\ \forall y \in G.\ \forall z \in G.\ $
$ ( P(\langle P(\langle x,y\rangle ),z\rangle ) = P( \langle x,P(\langle y,z\rangle )\rangle )))$===
''moreover'' ''from '' A2, $ group0(G,f)$ ''have'' $ H\times H \subseteq G\times G$ ''using'' +++^[group0_3_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_3_L2</nowiki>: ''assumes '' $ IsAsubgroup(H,P)$ '' shows '' $ H \subseteq G$ ===
''ultimately '' ''show'' $ g^{-1}\{e_1\} = f^{-1}\{e_1\} \cap H\times H$ ''using'' <nowiki>A3</nowiki> , +++^[func1_2_L1 | func1 ]... ''lemma'' <nowiki>func1_2_L1</nowiki>: ''assumes '' $ f:X\rightarrow Y$ ''and'' $ B\subseteq X$ '' shows '' $ restrict(f,B)^{-1}(A) = f^{-1}(A) \cap B$ ===
''qed'' ===
''moreover'' ''from '' A3, $ group0(H,g)$ ''have'' $ GroupInv(H,g) = g^{-1}\{e_1\}$ ''using'' +++^[group0_2_T3 | Group_ZF ]... ''theorem'' ''(in'' group0'')'' <nowiki>group0_2_T3</nowiki>: '' shows '' $ P^{-1}\{1 \} = GroupInv(G,P)$ ===
''ultimately '' ''show'' $ thesis$
''qed'' ===
Using the lemma above we can show the actual statement: taking the inverse in the subgroup is the same as taking the inverse in the group.
''theorem'' ''(in'' group0'')'' <nowiki>group0_3_T1</nowiki>:
'' assumes '' A1: $ IsAsubgroup(H,P)$ ''and '' A2: $ g = restrict(P,H\times H)$ '' shows '' $ GroupInv(H,g) = restrict(GroupInv(G,P),H)$+++[proof ]>
''from '' groupAssum ''have'' $ GroupInv(G,P) : G\rightarrow G$ ''using'' +++^[group0_2_T2 | Group_ZF ]... ''theorem'' <nowiki>group0_2_T2</nowiki>: ''assumes '' $ \text{IsAgroup}(G,f)$ '' shows '' $ GroupInv(G,f) : G\rightarrow G$ ===
''moreover'' ''from '' A1, A2 ''have'' $ GroupInv(H,g) : H\rightarrow H$ ''using'' +++^[IsAsubgroup_def | Group_ZF ]... Definition of <nowiki>IsAsubgroup</nowiki>:
$ IsAsubgroup(H,P) \equiv \text{IsAgroup}(H, restrict(P,H\times H))$=== , +++^[group0_2_T2 | Group_ZF ]... ''theorem'' <nowiki>group0_2_T2</nowiki>: ''assumes '' $ \text{IsAgroup}(G,f)$ '' shows '' $ GroupInv(G,f) : G\rightarrow G$ ===
''moreover'' ''from '' A1 ''have'' $ H \subseteq G$ ''using'' +++^[group0_3_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_3_L2</nowiki>: ''assumes '' $ IsAsubgroup(H,P)$ '' shows '' $ H \subseteq G$ ===
''moreover'' ''from '' groupAssum, A1, A2 ''have'' $ GroupInv(G,P) \cap H\times H = GroupInv(H,g)$ ''using'' +++^[group0_3_L7A | Group_ZF ]... ''lemma'' <nowiki>group0_3_L7A</nowiki>: ''assumes '' $ \text{IsAgroup}(G,f)$ ''and'' $ IsAsubgroup(H,f)$ ''and'' $ g = restrict(f,H\times H)$ '' shows '' $ GroupInv(G,f) \cap H\times H = GroupInv(H,g)$ ===
''ultimately '' ''show'' $ thesis$ ''using'' +++^[func1_2_L3 | func1 ]... ''lemma'' <nowiki>func1_2_L3</nowiki>: ''assumes '' $ f:X\rightarrow Y$ ''and'' $ g:A\rightarrow Z$ ''and'' $ A\subseteq X$ ''and'' $ f \cap A\times Z = g$ '' shows '' $ g = restrict(f,A)$ ===
''qed'' ===
A sligtly weaker, but more convenient in applications, reformulation of the above theorem.
''theorem'' ''(in'' group0'')'' <nowiki>group0_3_T2</nowiki>:
'' assumes '' $ IsAsubgroup(H,P)$ ''and '' $ g = restrict(P,H\times H)$ '' shows '' $ \forall h\in H.\ GroupInv(H,g)(h) = h^{-1}$ ''using'' <nowiki>assms</nowiki> , +++^[group0_3_T1 | Group_ZF ]... ''theorem'' ''(in'' group0'')'' <nowiki>group0_3_T1</nowiki>: ''assumes '' $ IsAsubgroup(H,P)$ ''and'' $ g = restrict(P,H\times H)$ '' shows '' $ GroupInv(H,g) = restrict(GroupInv(G,P),H)$ === , <nowiki>restrict_if</nowiki>
Subgroups are closed with respect to taking the group inverse.
''theorem'' ''(in'' group0'')'' <nowiki>group0_3_T3A</nowiki>:
'' assumes '' A1: $ IsAsubgroup(H,P)$ ''and '' A2: $ h\in H$ '' shows '' $ h^{-1}\in H$+++[proof ]>
''let '' $ g = restrict(P,H\times H)$
''from '' A1 ''have'' $ GroupInv(H,g) \in H\rightarrow H$ ''using'' +++^[IsAsubgroup_def | Group_ZF ]... Definition of <nowiki>IsAsubgroup</nowiki>:
$ IsAsubgroup(H,P) \equiv \text{IsAgroup}(H, restrict(P,H\times H))$=== , +++^[group0_2_T2 | Group_ZF ]... ''theorem'' <nowiki>group0_2_T2</nowiki>: ''assumes '' $ \text{IsAgroup}(G,f)$ '' shows '' $ GroupInv(G,f) : G\rightarrow G$ ===
''with '' A2 ''have'' $ GroupInv(H,g)(h) \in H$ ''using'' <nowiki>apply_type</nowiki>
''with '' A1, A2 ''show'' $ h^{-1}\in H$ ''using'' +++^[group0_3_T2 | Group_ZF ]... ''theorem'' ''(in'' group0'')'' <nowiki>group0_3_T2</nowiki>: ''assumes '' $ IsAsubgroup(H,P)$ ''and'' $ g = restrict(P,H\times H)$ '' shows '' $ \forall h\in H.\ GroupInv(H,g)(h) = h^{-1}$ ===
''qed'' ===
The next theorem states that a nonempty subset of a group $G$ that is closed under the group operation and taking the inverse is a subgroup of the group.
''theorem'' ''(in'' group0'')'' <nowiki>group0_3_T3</nowiki>:
'' assumes '' A1: $ H\neq 0$ ''and '' A2: $ H\subseteq G$ ''and '' A3: $ H \text{ is closed under } P$ ''and '' A4: $ \forall x\in H.\ x^{-1} \in H$ '' shows '' $ IsAsubgroup(H,P)$+++[proof ]>
''let '' $ g = restrict(P,H\times H)$
''let '' $ n = TheNeutralElement(H,g)$
''from '' A3 ''have'' I: $ \forall x\in H.\ \forall y\in H.\ x\cdot y \in H$ ''using'' +++^[IsOpClosed_def | func_ZF ]... Definition of <nowiki>IsOpClosed</nowiki>:
$ A \text{ is closed under } f \equiv \forall x\in A.\ \forall y\in A.\ f\langle x,y\rangle \in A$===
''from '' A1 ''obtain '' $ x$ ''where '' $ x\in H$
''with '' A4, I, A2 ''have'' $ 1 \in H$ ''using'' +++^[group0_2_L6 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L6</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x\cdot x^{-1} = 1 \wedge x^{-1}\cdot x = 1 $ ===
''with '' A3, A2 ''have'' T2: $ \text{IsAmonoid}(H,g)$ ''using'' +++^[group0_2_L1 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L1</nowiki>: '' shows '' $ monoid0(G,P)$ === , +++^[group0_1_T1 | Monoid_ZF ]... ''theorem'' ''(in'' monoid0'')'' <nowiki>group0_1_T1</nowiki>: ''assumes '' $ H \text{ is closed under } f$ ''and'' $ H\subseteq G$ ''and'' $ TheNeutralElement(G,f) \in H$ '' shows '' $ \text{IsAmonoid}(H,restrict(f,H\times H))$ ===
''moreover'' ''have'' $ \forall h\in H.\ \exists b\in H.\ g\langle h,b\rangle = n$+++[proof ]>
''fix '' $ h$
''assume '' $ h\in H$
''with '' A4, A2 ''have'' $ h\cdot h^{-1} = 1 $ ''using'' +++^[group0_2_L6 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L6</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x\cdot x^{-1} = 1 \wedge x^{-1}\cdot x = 1 $ ===
''moreover'' ''from '' groupAssum, A2, A3, $ 1 \in H$ ''have'' $ 1 = n$ ''using'' +++^[IsAgroup_def | Group_ZF ]... Definition of <nowiki>IsAgroup</nowiki>:
$ \text{IsAgroup}(G,f) \equiv $
$ (\text{IsAmonoid}(G,f) \wedge (\forall g\in G.\ \exists b\in G.\ f\langle g,b\rangle = TheNeutralElement(G,f)))$=== , +++^[group0_1_L6 | Monoid_ZF ]... ''lemma'' <nowiki>group0_1_L6</nowiki>: ''assumes '' $ \text{IsAmonoid}(G,f)$ ''and'' $ H \text{ is closed under } f$ ''and'' $ H\subseteq G$ ''and'' $ TheNeutralElement(G,f) \in H$ '' shows '' $ TheNeutralElement(H,restrict(f,H\times H)) = TheNeutralElement(G,f)$ ===
''moreover'' ''from '' A4, $ h\in H$ ''have'' $ g\langle h,h^{-1}\rangle = h\cdot h^{-1}$ ''using'' <nowiki>restrict_if</nowiki>
''ultimately '' ''have'' $ g\langle h,h^{-1}\rangle = n$
''with '' A4, $ h\in H$ ''show'' $ \exists b\in H.\ g\langle h,b\rangle = n$
''qed'' ===
''ultimately '' ''show'' $ IsAsubgroup(H,P)$ ''using'' +++^[IsAsubgroup_def | Group_ZF ]... Definition of <nowiki>IsAsubgroup</nowiki>:
$ IsAsubgroup(H,P) \equiv \text{IsAgroup}(H, restrict(P,H\times H))$=== , +++^[IsAgroup_def | Group_ZF ]... Definition of <nowiki>IsAgroup</nowiki>:
$ \text{IsAgroup}(G,f) \equiv $
$ (\text{IsAmonoid}(G,f) \wedge (\forall g\in G.\ \exists b\in G.\ f\langle g,b\rangle = TheNeutralElement(G,f)))$===
''qed'' ===
Intersection of subgroups is a subgroup.
''lemma'' <nowiki>group0_3_L7</nowiki>:
'' assumes '' A1: $ \text{IsAgroup}(G,f)$ ''and '' A2: $ IsAsubgroup(H_1,f)$ ''and '' A3: $ IsAsubgroup(H_2,f)$ '' shows '' $ IsAsubgroup(H_1\cap H_2,restrict(f,H_1\times H_1))$+++[proof ]>
''let '' $ e = TheNeutralElement(G,f)$
''let '' $ g = restrict(f,H_1\times H_1)$
''from '' A1 ''have'' I: $ group0(G,f)$ ''using'' <nowiki>group0_def</nowiki>
''from '' A2 ''have'' $ group0(H_1,g)$ ''using'' +++^[IsAsubgroup_def | Group_ZF ]... Definition of <nowiki>IsAsubgroup</nowiki>:
$ IsAsubgroup(H,P) \equiv \text{IsAgroup}(H, restrict(P,H\times H))$=== , <nowiki>group0_def</nowiki>
''moreover'' ''have'' $ H_1\cap H_2 \neq 0$+++[proof ]>
''from '' A1, A2, A3 ''have'' $ e \in H_1\cap H_2$ ''using'' <nowiki>group0_def</nowiki> , +++^[group0_3_L5 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_3_L5</nowiki>: ''assumes '' $ IsAsubgroup(H,P)$ '' shows '' $ 1 \in H$ ===
''thus'' $ thesis$
''qed'' ===
''moreover'' ''have'' $ H_1\cap H_2 \subseteq H_1$
''moreover'' ''from '' A2, A3, I, $ H_1\cap H_2 \subseteq H_1$ ''have'' $ H_1\cap H_2 \text{ is closed under } g$ ''using'' +++^[group0_3_L6 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_3_L6</nowiki>: ''assumes '' $ IsAsubgroup(H,P)$ ''and'' $ a\in H$, $ b\in H$ '' shows '' $ a\cdot b \in H$ === , +++^[IsOpClosed_def | func_ZF ]... Definition of <nowiki>IsOpClosed</nowiki>:
$ A \text{ is closed under } f \equiv \forall x\in A.\ \forall y\in A.\ f\langle x,y\rangle \in A$=== , +++^[func_ZF_4_L7 | func_ZF ]... ''lemma'' <nowiki>func_ZF_4_L7</nowiki>: ''assumes '' $ A \text{ is closed under } f$, $ B \text{ is closed under } f$ '' shows '' $ A\cap B \text{ is closed under } f$ === , +++^[func_ZF_4_L5 | func_ZF ]... ''lemma'' <nowiki>func_ZF_4_L5</nowiki>: ''assumes '' $ A \text{ is closed under } f$ ''and'' $ A\subseteq B$ '' shows '' $ A \text{ is closed under } restrict(f,B\times B)$ ===
''moreover'' ''from '' A2, A3, I ''have'' $ \forall x \in H_1\cap H_2.\ GroupInv(H_1,g)(x) \in H_1\cap H_2$ ''using'' +++^[group0_3_T2 | Group_ZF ]... ''theorem'' ''(in'' group0'')'' <nowiki>group0_3_T2</nowiki>: ''assumes '' $ IsAsubgroup(H,P)$ ''and'' $ g = restrict(P,H\times H)$ '' shows '' $ \forall h\in H.\ GroupInv(H,g)(h) = h^{-1}$ === , +++^[group0_3_T3A | Group_ZF ]... ''theorem'' ''(in'' group0'')'' <nowiki>group0_3_T3A</nowiki>: ''assumes '' $ IsAsubgroup(H,P)$ ''and'' $ h\in H$ '' shows '' $ h^{-1}\in H$ ===
''ultimately '' ''show'' $ thesis$ ''using'' +++^[group0_3_T3 | Group_ZF ]... ''theorem'' ''(in'' group0'')'' <nowiki>group0_3_T3</nowiki>: ''assumes '' $ H\neq 0$ ''and'' $ H\subseteq G$ ''and'' $ H \text{ is closed under } P$ ''and'' $ \forall x\in H.\ x^{-1} \in H$ '' shows '' $ IsAsubgroup(H,P)$ ===
''qed'' ===
''end
'' +++![Comments on Group_ZF|click to add comment] <html> <div> <iframe style="width:60%;height:500px" src="http://www.haloscan.com/comments/slawekk/Group_ZF"></iframe> </div> </html>
===
''theory'' Group_ZF_1 ''imports'' [[Group_ZF]]
''begin
''
In this theory we consider right and left translations and odd functions.
!Translations
In this section we consider translations. Translations are maps $T: G\rightarrow G$ of the form $T_g (a) = g\cdot a$ or $T_g (a) = a\cdot g$. We also consider two-dimensional translations $T_g : G\times G \rightarrow G\times G$, where $T_g(a,b) = (a\cdot g, b\cdot g)$ or $T_g(a,b) = (g\cdot a, g\cdot b)$.
For an element $a\in G$ the right translation is defined a function (set of pairs) such that its value (the second element of a pair) is the value of the group operation on the first element of the pair and $g$. This looks a bit strange in the raw set notation, when we write a function explicitely as a set of pairs and value of the group operation on the pair $\langle a,b \rangle$ as $ P\langle a,b\rangle $ instead of the usual infix $a\cdot b$ or $a + b$.
''Definition
'' $ RightTranslation(G,P,g) \equiv \{\langle a,b\rangle \in G\times G.\ P\langle a,g\rangle = b\}$
A similar definition of the left translation.
''Definition
'' $ LeftTranslation(G,P,g) \equiv \{\langle a,b\rangle \in G\times G.\ P\langle g,a\rangle = b\}$
Translations map $G$ into $G$. Two dimensional translations map $G\times G$ into itself.
''lemma'' ''(in'' group0'')'' <nowiki>group0_5_L1</nowiki>:
'' assumes '' A1: $ g\in G$ '' shows '' $ RightTranslation(G,P,g) : G\rightarrow G$, $ LeftTranslation(G,P,g) : G\rightarrow G$+++[proof ]>
''from '' A1 ''have'' $ \forall a\in G.\ a\cdot g \in G$ ''and '' $ \forall a\in G.\ g\cdot a \in G$ ''using'' +++^[group_oper_assocA | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assocA</nowiki>: '' shows '' $ P : G\times G\rightarrow G$ === , <nowiki>apply_funtype</nowiki>
''then '' ''show'' $ RightTranslation(G,P,g) : G\rightarrow G$, $ LeftTranslation(G,P,g) : G\rightarrow G$ ''using'' +++^[RightTranslation_def | Group_ZF_1 ]... Definition of <nowiki>RightTranslation</nowiki>:
$ RightTranslation(G,P,g) \equiv \{\langle a,b\rangle \in G\times G.\ P\langle a,g\rangle = b\}$=== , +++^[LeftTranslation_def | Group_ZF_1 ]... Definition of <nowiki>LeftTranslation</nowiki>:
$ LeftTranslation(G,P,g) \equiv \{\langle a,b\rangle \in G\times G.\ P\langle g,a\rangle = b\}$=== , +++^[func1_1_L11A | func1 ]... ''lemma'' <nowiki>func1_1_L11A</nowiki>: ''assumes '' $ \forall x\in X.\ b(x)\in Y$ '' shows '' $ \{\langle x,y\rangle \in X\times Y.\ b(x) = y\} : X\rightarrow Y$ ===
''qed'' ===
The values of the translations are what we expect.
''lemma'' ''(in'' group0'')'' <nowiki>group0_5_L2</nowiki>:
'' assumes '' $ g\in G$, $ a\in G$ '' shows '' $ RightTranslation(G,P,g)(a) = a\cdot g$, $ LeftTranslation(G,P,g)(a) = g\cdot a$ ''using'' <nowiki>assms</nowiki> , +++^[group0_5_L1 | Group_ZF_1 ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_5_L1</nowiki>: ''assumes '' $ g\in G$ '' shows '' $ RightTranslation(G,P,g) : G\rightarrow G$, $ LeftTranslation(G,P,g) : G\rightarrow G$ === , +++^[RightTranslation_def | Group_ZF_1 ]... Definition of <nowiki>RightTranslation</nowiki>:
$ RightTranslation(G,P,g) \equiv \{\langle a,b\rangle \in G\times G.\ P\langle a,g\rangle = b\}$=== , +++^[LeftTranslation_def | Group_ZF_1 ]... Definition of <nowiki>LeftTranslation</nowiki>:
$ LeftTranslation(G,P,g) \equiv \{\langle a,b\rangle \in G\times G.\ P\langle g,a\rangle = b\}$=== , +++^[func1_1_L11B | func1 ]... ''lemma'' <nowiki>func1_1_L11B</nowiki>: ''assumes '' $ f:X\rightarrow Y$, $ x\in X$ ''and'' $ f = \{\langle x,y\rangle \in X\times Y.\ b(x) = y\}$ '' shows '' $ f(x) = b(x)$ ===
Composition of left translations is a left translation by the product.
''lemma'' ''(in'' group0'')'' <nowiki>group0_5_L4</nowiki>:
'' assumes '' A1: $ g\in G$, $ h\in G$, $ a\in G$ ''and '' A2: $ T_g = LeftTranslation(G,P,g)$, $ T_h = LeftTranslation(G,P,h)$ '' shows '' $ T_g(T_h(a)) = g\cdot h\cdot a$, $ T_g(T_h(a)) = LeftTranslation(G,P,g\cdot h)(a)$+++[proof ]>
''from '' A1 ''have'' I: $ h\cdot a\in G$, $ g\cdot h\in G$ ''using'' +++^[group_oper_assocA | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assocA</nowiki>: '' shows '' $ P : G\times G\rightarrow G$ === , <nowiki>apply_funtype</nowiki>
''with '' A1, A2 ''show'' $ T_g(T_h(a)) = g\cdot h\cdot a$ ''using'' +++^[group0_5_L2 | Group_ZF_1 ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_5_L2</nowiki>: ''assumes '' $ g\in G$, $ a\in G$ '' shows '' $ RightTranslation(G,P,g)(a) = a\cdot g$, $ LeftTranslation(G,P,g)(a) = g\cdot a$ === , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''with '' A1, A2, I ''show'' $ T_g(T_h(a)) = LeftTranslation(G,P,g\cdot h)(a)$ ''using'' +++^[group0_5_L2 | Group_ZF_1 ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_5_L2</nowiki>: ''assumes '' $ g\in G$, $ a\in G$ '' shows '' $ RightTranslation(G,P,g)(a) = a\cdot g$, $ LeftTranslation(G,P,g)(a) = g\cdot a$ === , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''qed'' ===
Composition of right translations is a right translation by the product.
''lemma'' ''(in'' group0'')'' <nowiki>group0_5_L5</nowiki>:
'' assumes '' A1: $ g\in G$, $ h\in G$, $ a\in G$ ''and '' A2: $ T_g = RightTranslation(G,P,g)$, $ T_h = RightTranslation(G,P,h)$ '' shows '' $ T_g(T_h(a)) = a\cdot h\cdot g$, $ T_g(T_h(a)) = RightTranslation(G,P,h\cdot g)(a)$+++[proof ]>
''from '' A1 ''have'' I: $ a\cdot h\in G$, $ h\cdot g \in G$ ''using'' +++^[group_oper_assocA | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assocA</nowiki>: '' shows '' $ P : G\times G\rightarrow G$ === , <nowiki>apply_funtype</nowiki>
''with '' A1, A2 ''show'' $ T_g(T_h(a)) = a\cdot h\cdot g$ ''using'' +++^[group0_5_L2 | Group_ZF_1 ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_5_L2</nowiki>: ''assumes '' $ g\in G$, $ a\in G$ '' shows '' $ RightTranslation(G,P,g)(a) = a\cdot g$, $ LeftTranslation(G,P,g)(a) = g\cdot a$ === , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''with '' A1, A2, I ''show'' $ T_g(T_h(a)) = RightTranslation(G,P,h\cdot g)(a)$ ''using'' +++^[group0_5_L2 | Group_ZF_1 ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_5_L2</nowiki>: ''assumes '' $ g\in G$, $ a\in G$ '' shows '' $ RightTranslation(G,P,g)(a) = a\cdot g$, $ LeftTranslation(G,P,g)(a) = g\cdot a$ === , +++^[group_oper_assoc | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assoc</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot (b\cdot c) = a\cdot b\cdot c$ ===
''qed'' ===
The image of a set under a composition of translations is the same as the image under translation by a product.
''lemma'' ''(in'' group0'')'' <nowiki>group0_5_L6</nowiki>:
'' assumes '' A1: $ g\in G$, $ h\in G$ ''and '' A2: $ A\subseteq G$ ''and '' A3: $ T_g = RightTranslation(G,P,g)$, $ T_h = RightTranslation(G,P,h)$ '' shows '' $ T_g(T_h(A)) = \{a\cdot h\cdot g.\ a\in A\}$+++[proof ]>
''from '' A2 ''have'' $ \forall a\in A.\ a\in G$
''from '' A1, A3 ''have'' $ T_g : G\rightarrow G$, $ T_h : G\rightarrow G$ ''using'' +++^[group0_5_L1 | Group_ZF_1 ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_5_L1</nowiki>: ''assumes '' $ g\in G$ '' shows '' $ RightTranslation(G,P,g) : G\rightarrow G$, $ LeftTranslation(G,P,g) : G\rightarrow G$ ===
''with '' assms, $ \forall a\in A.\ a\in G$ ''show'' $ T_g(T_h(A)) = \{a\cdot h\cdot g.\ a\in A\}$ ''using'' +++^[func1_1_L15C | func1 ]... ''lemma'' <nowiki>func1_1_L15C</nowiki>: ''assumes '' $ f:X\rightarrow Y$ ''and'' $ g:Y\rightarrow Z$ ''and'' $ A\subseteq X$ '' shows '' $ g(f(A)) = \{g(f(x)).\ x\in A\}$, $ g(f(A)) = (g\circ f)(A)$ === , +++^[group0_5_L5 | Group_ZF_1 ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_5_L5</nowiki>: ''assumes '' $ g\in G$, $ h\in G$, $ a\in G$ ''and'' $ T_g = RightTranslation(G,P,g)$, $ T_h = RightTranslation(G,P,h)$ '' shows '' $ T_g(T_h(a)) = a\cdot h\cdot g$, $ T_g(T_h(a)) = RightTranslation(G,P,h\cdot g)(a)$ ===
''qed'' ===
!Odd functions
This section is about odd functions.
Odd functions are those that commute with the group inverse: $f(a^{-1}) = (f(a))^{-1}.$
''Definition
'' $ IsOdd(G,P,f) \equiv (\forall a\in G.\ f(GroupInv(G,P)(a)) = GroupInv(G,P)(f(a)) )$
Let's see the definition of an odd function in a more readable notation.
''lemma'' ''(in'' group0'')'' <nowiki>group0_6_L1</nowiki>:
'' shows '' $ IsOdd(G,P,p) \longleftrightarrow ( \forall a\in G.\ p(a^{-1}) = (p(a))^{-1} )$ ''using'' +++^[IsOdd_def | Group_ZF_1 ]... Definition of <nowiki>IsOdd</nowiki>:
$ IsOdd(G,P,f) \equiv (\forall a\in G.\ f(GroupInv(G,P)(a)) = GroupInv(G,P)(f(a)) )$===
We can express the definition of an odd function in two ways.
''lemma'' ''(in'' group0'')'' <nowiki>group0_6_L2</nowiki>:
'' assumes '' A1: $ p : G\rightarrow G$ '' shows '' $ (\forall a\in G.\ p(a^{-1}) = (p(a))^{-1}) \longleftrightarrow (\forall a\in G.\ (p(a^{-1}))^{-1} = p(a))$+++[proof ]>
''assume '' $ \forall a\in G.\ p(a^{-1}) = (p(a))^{-1}$
''with '' A1 ''show'' $ \forall a\in G.\ (p(a^{-1}))^{-1} = p(a)$ ''using'' <nowiki>apply_funtype</nowiki> , +++^[group_inv_of_inv | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_inv</nowiki>: ''assumes '' $ a\in G$ '' shows '' $ a = (a^{-1})^{-1}$ ===
''next ''
''assume '' A2: $ \forall a\in G.\ (p(a^{-1}))^{-1} = p(a)$
++++[{ ]>
''fix '' $ a$
''assume '' $ a\in G$
''with '' A1, A2 ''have'' $ p(a^{-1}) \in G$ ''and '' $ ((p(a^{-1}))^{-1})^{-1} = (p(a))^{-1}$ ''using'' <nowiki>apply_funtype</nowiki> , +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ ===
''then '' ''have'' $ p(a^{-1}) = (p(a))^{-1}$ ''using'' +++^[group_inv_of_inv | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_inv</nowiki>: ''assumes '' $ a\in G$ '' shows '' $ a = (a^{-1})^{-1}$ ===
=== ''}''
''then '' ''show'' $ \forall a\in G.\ p(a^{-1}) = (p(a))^{-1}$
''qed'' ===
''end
'' +++![Comments on Group_ZF_1|click to add comment] <html> <div> <iframe style="width:60%;height:500px" src="http://www.haloscan.com/comments/slawekk/Group_ZF_1"></iframe> </div> </html>
===
''theory'' Group_ZF_1b ''imports'' [[Group_ZF]]
''begin
''
In a typical textbook a group is defined as a set $G$ with an associative operation such that two conditions hold: A: there is an element $e\in G$ such that for all $g\in G$ we have $e\cdot g = g$ and $g\cdot e =g$. We call this element a "unit" or a "neutral element" of the group.
B: for every $a\in G$ there exists a $b\in G$ such that $a\cdot b = e$, where $e$ is the element of $G$ whose existence is guaranteed by A. The validity of this definition is rather dubious to me, as condition A does not define any specific element $e$ that can be referred to in condition B - it merely states that a set of such units $e$ is not empty. Of course it does work in the end as we can prove that the set of such neutral elements has exactly one element, but still the definition by itself is not valid. You just can't reference a variable bound by a quantifier outside of the scope of that quantifier.
One way around this is to first use condition A to define the notion of a monoid, then prove the uniqueness of $e$ and then use the condition B to define groups. Another way is to write conditions A and B together as follows: $$\exists_{e \in G} \ (\forall_{g \in G} \ e\cdot g = g \wedge g\cdot e = g) \wedge (\forall_{a\in G}\exists_{b\in G}\ a\cdot b = e).$$ This is rather ugly. What I want to talk about is an amusing way to define groups directly without any reference to the neutral elements. Namely, we can define a group as a non-empty set $G$ with an associative operation "$\cdot $" such that
C: for every $a,b\in G$ the equations $a\cdot x = b$ and $y\cdot a = b$ can be solved in $G$.
This theory file aims at proving the equivalence of this alternative definition with the usual definition of the group, as formulated in //Group_ZF.thy//. The informal proofs come from an Aug. 14, 2005 post by buli on the matematyka.org forum.
!An alternative definition of group
First we will define notation for writing about groups.
We will use the multiplicative notation for the group operation. To do this, we define a context (locale) that tells Isabelle to interpret $a\cdot b$ as the value of function $P$ on the pair $\langle a,b \rangle$.
''Locale '' group2
''defines '' $ a \cdot b \equiv P\langle a,b\rangle $
The next theorem states that a set $G$ with an associative operation that satisfies condition C is a group, as defined in IsarMathLib //Group_ZF// theory.
''theorem'' ''(in'' group2'')'' <nowiki>altgroup_is_group</nowiki>:
'' assumes '' A1: $ G\neq 0$ ''and '' A2: $ P \text{ is associative on } G$ ''and '' A3: $ \forall a\in G.\ \forall b\in G.\ \exists x\in G.\ a\cdot x = b$ ''and '' A4: $ \forall a\in G.\ \forall b\in G.\ \exists y\in G.\ y\cdot a = b$ '' shows '' $ \text{IsAgroup}(G,P)$+++[proof ]>
''from '' A1 ''obtain '' $ a$ ''where '' $ a\in G$
''with '' A3 ''obtain '' $ x$ ''where '' $ x\in G$ ''and '' $ a\cdot x = a$
''from '' A4, $ a\in G$ ''obtain '' $ y$ ''where '' $ y\in G$ ''and '' $ y\cdot a = a$
''have'' I: $ \forall b\in G.\ b = b\cdot x \wedge b = y\cdot b$+++[proof ]>
''fix '' $ b$
''assume '' $ b\in G$
''with '' A4, $ a\in G$ ''obtain '' $ y_b$ ''where '' $ y_b\in G$ ''and '' $ y_b\cdot a = b$
''from '' A3, $ a\in G$, $ b\in G$ ''obtain '' $ x_b$ ''where '' $ x_b\in G$ ''and '' $ a\cdot x_b = b$
''from '' $ a\cdot x = a$, $ y\cdot a = a$, $ y_b\cdot a = b$, $ a\cdot x_b = b$ ''have'' $ b = y_b\cdot (a\cdot x)$ ''and '' $ b = (y\cdot a)\cdot x_b$
''moreover'' ''from '' A2, $ a\in G$, $ x\in G$, $ y\in G$, $ x_b\in G$, $ y_b\in G$ ''have'' $ (y\cdot a)\cdot x_b = y\cdot (a\cdot x_b)$, $ y_b\cdot (a\cdot x) = (y_b\cdot a)\cdot x$ ''using'' +++^[IsAssociative_def | func_ZF ]... Definition of <nowiki>IsAssociative</nowiki>:
$ P \text{ is associative on } G \equiv P : G\times G\rightarrow G \wedge $
$ (\forall x \in G.\ \forall y \in G.\ \forall z \in G.\ $
$ ( P(\langle P(\langle x,y\rangle ),z\rangle ) = P( \langle x,P(\langle y,z\rangle )\rangle )))$===
''moreover'' ''from '' $ y_b\cdot a = b$, $ a\cdot x_b = b$ ''have'' $ (y_b\cdot a)\cdot x = b\cdot x$, $ y\cdot (a\cdot x_b) = y\cdot b$
''ultimately '' ''show'' $ b = b\cdot x \wedge b = y\cdot b$
''qed'' ===
''moreover'' ''have'' $ x = y$+++[proof ]>
''from '' $ x\in G$, I ''have'' $ x = y\cdot x$
''also'' ''from '' $ y\in G$, I ''have'' $ y\cdot x = y$
''finally '' ''show'' $ x = y$
''qed'' ===
''ultimately '' ''have'' $ \forall b\in G.\ b\cdot x = b \wedge x\cdot b = b$
''with '' A2, $ x\in G$ ''have'' $ \text{IsAmonoid}(G,P)$ ''using'' +++^[IsAmonoid_def | Monoid_ZF ]... Definition of <nowiki>IsAmonoid</nowiki>:
$ \text{IsAmonoid}(G,f) \equiv $
$ f \text{ is associative on } G \wedge $
$ (\exists e\in G.\ (\forall g\in G.\ ( (f(\langle e,g\rangle ) = g) \wedge (f(\langle g,e\rangle ) = g))))$===
''with '' A3 ''show'' $ \text{IsAgroup}(G,P)$ ''using'' <nowiki>monoid0_def</nowiki> , +++^[unit_is_neutral | Monoid_ZF ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>unit_is_neutral</nowiki>: ''assumes '' $ e = TheNeutralElement(G,f)$ '' shows '' $ e \in G \wedge (\forall g\in G.\ e \oplus g = g \wedge g \oplus e = g)$ === , +++^[IsAgroup_def | Group_ZF ]... Definition of <nowiki>IsAgroup</nowiki>:
$ \text{IsAgroup}(G,f) \equiv $
$ (\text{IsAmonoid}(G,f) \wedge (\forall g\in G.\ \exists b\in G.\ f\langle g,b\rangle = TheNeutralElement(G,f)))$===
''qed'' ===
The converse of //altgroup_is_group//: in every (classically defined) group condition C holds. In informal mathematics we can say "Obviously condition C holds in any group." In formalized mathematics the word "obviously" is not in the language. The next theorem is proven in the context called //group0// defined in the theory //Group_ZF.thy//. Similarly to the //group2// that context defines $a\cdot b$ as $P\langle a,b\rangle$ It also defines notation related to the group inverse and adds an assumption that the pair $(G,P)$ is a group to all its theorems. This is why in the next theorem we don't explicitely assume that $(G,P)$ is a group - this assumption is implicit in the context.
''theorem'' ''(in'' group0'')'' <nowiki>group_is_altgroup</nowiki>:
'' shows '' $ \forall a\in G.\ \forall b\in G.\ \exists x\in G.\ a\cdot x = b$ ''and '' $ \forall a\in G.\ \forall b\in G.\ \exists y\in G.\ y\cdot a = b$+++[proof ]>
++++[{ ]>
''fix '' $ a$ $ b$
''assume '' $ a\in G$, $ b\in G$
''let '' $ x = a^{-1}\cdot b$
''let '' $ y = b\cdot a^{-1}$
''from '' $ a\in G$, $ b\in G$ ''have'' $ x \in G$, $ y \in G$ ''and '' $ a\cdot x = b$, $ y\cdot a = b$ ''using'' +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ === , +++^[group_op_closed | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_op_closed</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b \in G$ === , +++^[inv_cancel_two | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inv_cancel_two</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\cdot b^{-1}\cdot b = a$,
$ a\cdot b\cdot b^{-1} = a$, $ a^{-1}\cdot (a\cdot b) = b$, $ a\cdot (a^{-1}\cdot b) = b$ ===
''hence'' $ \exists x\in G.\ a\cdot x = b$ ''and '' $ \exists y\in G.\ y\cdot a = b$
=== ''}''
''thus'' $ \forall a\in G.\ \forall b\in G.\ \exists x\in G.\ a\cdot x = b$ ''and '' $ \forall a\in G.\ \forall b\in G.\ \exists y\in G.\ y\cdot a = b$
''qed'' ===
''end
'' +++![Comments on Group_ZF_1b|click to add comment] <html> <div> <iframe style="width:60%;height:500px" src="http://www.haloscan.com/comments/slawekk/Group_ZF_1b"></iframe> </div> </html>
===
''theory'' Group_ZF_2 ''imports'' [[AbelianGroup_ZF]] [[func_ZF]] [[EquivClass1]]
''begin
''
This theory continues Group\_ZF.thy and considers lifting the group structure to function spaces and projecting the group structure to quotient spaces, in particular the quotient qroup.
!Lifting groups to function spaces
If we have a monoid (group) $G$ than we get a monoid (group) structure on a space of functions valued in in $G$ by defining $(f\cdot g)(x) := f(x)\cdot g(x)$. We call this process ''lifting the monoid (group) to function space''. This section formalizes this lifting.
The lifted operation is an operation on the function space.
''lemma'' ''(in'' monoid0'')'' <nowiki>Group_ZF_2_1_L0A</nowiki>:
'' assumes '' A1: $ F = f \text{ lifted to function space over } X$ '' shows '' $ F : (X\rightarrow G)\times (X\rightarrow G)\rightarrow (X\rightarrow G)$+++[proof ]>
''from '' monoidAsssum ''have'' $ f : G\times G\rightarrow G$ ''using'' +++^[IsAmonoid_def | Monoid_ZF ]... Definition of <nowiki>IsAmonoid</nowiki>:
$ \text{IsAmonoid}(G,f) \equiv $
$ f \text{ is associative on } G \wedge $
$ (\exists e\in G.\ (\forall g\in G.\ ( (f(\langle e,g\rangle ) = g) \wedge (f(\langle g,e\rangle ) = g))))$=== , +++^[IsAssociative_def | func_ZF ]... Definition of <nowiki>IsAssociative</nowiki>:
$ P \text{ is associative on } G \equiv P : G\times G\rightarrow G \wedge $
$ (\forall x \in G.\ \forall y \in G.\ \forall z \in G.\ $
$ ( P(\langle P(\langle x,y\rangle ),z\rangle ) = P( \langle x,P(\langle y,z\rangle )\rangle )))$===
''with '' A1 ''show'' $ thesis$ ''using'' +++^[func_ZF_1_L3 | func_ZF ]... ''theorem'' <nowiki>func_ZF_1_L3</nowiki>: ''assumes '' $ f : Y\times Y\rightarrow Y$ ''and'' $ F = f \text{ lifted to function space over } X$ '' shows '' $ F : (X\rightarrow range(f))\times (X\rightarrow range(f))\rightarrow (X\rightarrow range(f))$ === , +++^[group0_1_L3B | Monoid_ZF ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>group0_1_L3B</nowiki>: '' shows '' $ range(f) = G$ ===
''qed'' ===
The result of the lifted operation is in the function space.
''lemma'' ''(in'' monoid0'')'' <nowiki>Group_ZF_2_1_L0</nowiki>:
'' assumes '' A1: $ F = f \text{ lifted to function space over } X$ ''and '' A2: $ s:X\rightarrow G$, $ r:X\rightarrow G$ '' shows '' $ F\langle s,r\rangle : X\rightarrow G$+++[proof ]>
''from '' A1 ''have'' $ F : (X\rightarrow G)\times (X\rightarrow G)\rightarrow (X\rightarrow G)$ ''using'' +++^[Group_ZF_2_1_L0A | Group_ZF_2 ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>Group_ZF_2_1_L0A</nowiki>: ''assumes '' $ F = f \text{ lifted to function space over } X$ '' shows '' $ F : (X\rightarrow G)\times (X\rightarrow G)\rightarrow (X\rightarrow G)$ ===
''with '' A2 ''show'' $ thesis$ ''using'' <nowiki>apply_funtype</nowiki>
''qed'' ===
The lifted monoid operation has a neutral element, namely the constant function with the neutral element as the value.
''lemma'' ''(in'' monoid0'')'' <nowiki>Group_ZF_2_1_L1</nowiki>:
'' assumes '' A1: $ F = f \text{ lifted to function space over } X$ ''and '' A2: $ E = ConstantFunction(X,TheNeutralElement(G,f))$ '' shows '' $ E : X\rightarrow G \wedge (\forall s\in X\rightarrow G.\ F\langle E,s\rangle = s \wedge F\langle s,E\rangle = s)$+++[proof ]>
''from '' A2 ''show'' T1: $ E : X\rightarrow G$ ''using'' +++^[unit_is_neutral | Monoid_ZF ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>unit_is_neutral</nowiki>: ''assumes '' $ e = TheNeutralElement(G,f)$ '' shows '' $ e \in G \wedge (\forall g\in G.\ e \oplus g = g \wedge g \oplus e = g)$ === , +++^[func1_3_L1 | func1 ]... ''lemma'' <nowiki>func1_3_L1</nowiki>: ''assumes '' $ c\in Y$ '' shows '' $ ConstantFunction(X,c) : X\rightarrow Y$ ===
''show'' $ \forall s\in X\rightarrow G.\ F\langle E,s\rangle = s \wedge F\langle s,E\rangle = s$+++[proof ]>
''fix '' $ s$
''assume '' A3: $ s:X\rightarrow G$
''from '' monoidAsssum ''have'' T2: $ f : G\times G\rightarrow G$ ''using'' +++^[IsAmonoid_def | Monoid_ZF ]... Definition of <nowiki>IsAmonoid</nowiki>:
$ \text{IsAmonoid}(G,f) \equiv $
$ f \text{ is associative on } G \wedge $
$ (\exists e\in G.\ (\forall g\in G.\ ( (f(\langle e,g\rangle ) = g) \wedge (f(\langle g,e\rangle ) = g))))$=== , +++^[IsAssociative_def | func_ZF ]... Definition of <nowiki>IsAssociative</nowiki>:
$ P \text{ is associative on } G \equiv P : G\times G\rightarrow G \wedge $
$ (\forall x \in G.\ \forall y \in G.\ \forall z \in G.\ $
$ ( P(\langle P(\langle x,y\rangle ),z\rangle ) = P( \langle x,P(\langle y,z\rangle )\rangle )))$===
''from '' A3, A1, T1 ''have'' $ F\langle E,s\rangle : X\rightarrow G$, $ F\langle s,E\rangle : X\rightarrow G$, $ s : X\rightarrow G$ ''using'' +++^[Group_ZF_2_1_L0 | Group_ZF_2 ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>Group_ZF_2_1_L0</nowiki>: ''assumes '' $ F = f \text{ lifted to function space over } X$ ''and'' $ s:X\rightarrow G$, $ r:X\rightarrow G$ '' shows '' $ F\langle s,r\rangle : X\rightarrow G$ ===
''moreover'' ''from '' T2, A1, T1, A2, A3 ''have'' $ \forall x\in X.\ (F\langle E,s\rangle )(x) = s(x)$, $ \forall x\in X.\ (F\langle s,E\rangle )(x) = s(x)$ ''using'' +++^[func_ZF_1_L4 | func_ZF ]... ''theorem'' <nowiki>func_ZF_1_L4</nowiki>: ''assumes '' $ f : Y\times Y\rightarrow Y$ ''and'' $ F = f \text{ lifted to function space over } X$ ''and'' $ s:X\rightarrow range(f)$, $ r:X\rightarrow range(f)$ ''and'' $ x\in X$ '' shows '' $ (F\langle s,r\rangle )(x) = f\langle s(x),r(x)\rangle $ === , +++^[group0_1_L3B | Monoid_ZF ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>group0_1_L3B</nowiki>: '' shows '' $ range(f) = G$ === , +++^[func1_3_L2 | func1 ]... ''lemma'' <nowiki>func1_3_L2</nowiki>: ''assumes '' $ x\in X$ '' shows '' $ ConstantFunction(X,c)(x) = c$ === , <nowiki>apply_type</nowiki> , +++^[unit_is_neutral | Monoid_ZF ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>unit_is_neutral</nowiki>: ''assumes '' $ e = TheNeutralElement(G,f)$ '' shows '' $ e \in G \wedge (\forall g\in G.\ e \oplus g = g \wedge g \oplus e = g)$ ===
''ultimately '' ''show'' $ F\langle E,s\rangle = s \wedge F\langle s,E\rangle = s$ ''using'' <nowiki>fun_extension_iff</nowiki>
''qed'' ===
''qed'' ===
Monoids can be lifted to a function space.
''lemma'' ''(in'' monoid0'')'' <nowiki>Group_ZF_2_1_T1</nowiki>:
'' assumes '' A1: $ F = f \text{ lifted to function space over } X$ '' shows '' $ \text{IsAmonoid}(X\rightarrow G,F)$+++[proof ]>
''from '' monoidAsssum, A1 ''have'' $ F \text{ is associative on } (X\rightarrow G)$ ''using'' +++^[IsAmonoid_def | Monoid_ZF ]... Definition of <nowiki>IsAmonoid</nowiki>:
$ \text{IsAmonoid}(G,f) \equiv $
$ f \text{ is associative on } G \wedge $
$ (\exists e\in G.\ (\forall g\in G.\ ( (f(\langle e,g\rangle ) = g) \wedge (f(\langle g,e\rangle ) = g))))$=== , +++^[func_ZF_2_L4 | func_ZF ]... ''lemma'' <nowiki>func_ZF_2_L4</nowiki>: ''assumes '' $ f \text{ is associative on } G$ ''and'' $ F = f \text{ lifted to function space over } X$ '' shows '' $ F \text{ is associative on } (X\rightarrow range(f))$ === , +++^[group0_1_L3B | Monoid_ZF ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>group0_1_L3B</nowiki>: '' shows '' $ range(f) = G$ ===
''moreover'' ''from '' A1 ''have'' $ \exists E \in X\rightarrow G.\ \forall s \in X\rightarrow G.\ F\langle E,s\rangle = s \wedge F\langle s,E\rangle = s$ ''using'' +++^[Group_ZF_2_1_L1 | Group_ZF_2 ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>Group_ZF_2_1_L1</nowiki>: ''assumes '' $ F = f \text{ lifted to function space over } X$ ''and'' $ E = ConstantFunction(X,TheNeutralElement(G,f))$ '' shows '' $ E : X\rightarrow G \wedge (\forall s\in X\rightarrow G.\ F\langle E,s\rangle = s \wedge F\langle s,E\rangle = s)$
===
''ultimately '' ''show'' $ thesis$ ''using'' +++^[IsAmonoid_def | Monoid_ZF ]... Definition of <nowiki>IsAmonoid</nowiki>:
$ \text{IsAmonoid}(G,f) \equiv $
$ f \text{ is associative on } G \wedge $
$ (\exists e\in G.\ (\forall g\in G.\ ( (f(\langle e,g\rangle ) = g) \wedge (f(\langle g,e\rangle ) = g))))$===
''qed'' ===
The constant function with the neutral element as the value is the neutral element of the lifted monoid.
''lemma'' <nowiki>Group_ZF_2_1_L2</nowiki>:
'' assumes '' A1: $ \text{IsAmonoid}(G,f)$ ''and '' A2: $ F = f \text{ lifted to function space over } X$ ''and '' A3: $ E = ConstantFunction(X,TheNeutralElement(G,f))$ '' shows '' $ E = TheNeutralElement(X\rightarrow G,F)$+++[proof ]>
''from '' A1, A2 ''have'' T1: $ monoid0(G,f)$ ''and '' T2: $ monoid0(X\rightarrow G,F)$ ''using'' <nowiki>monoid0_def</nowiki> , +++^[Group_ZF_2_1_T1 | Group_ZF_2 ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>Group_ZF_2_1_T1</nowiki>: ''assumes '' $ F = f \text{ lifted to function space over } X$ '' shows '' $ \text{IsAmonoid}(X\rightarrow G,F)$ ===
''from '' T1, A2, A3 ''have'' $ E : X\rightarrow G \wedge (\forall s\in X\rightarrow G.\ F\langle E,s\rangle = s \wedge F\langle s,E\rangle = s)$ ''using'' +++^[Group_ZF_2_1_L1 | Group_ZF_2 ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>Group_ZF_2_1_L1</nowiki>: ''assumes '' $ F = f \text{ lifted to function space over } X$ ''and'' $ E = ConstantFunction(X,TheNeutralElement(G,f))$ '' shows '' $ E : X\rightarrow G \wedge (\forall s\in X\rightarrow G.\ F\langle E,s\rangle = s \wedge F\langle s,E\rangle = s)$
===
''with '' T2 ''show'' $ thesis$ ''using'' +++^[group0_1_L4 | Monoid_ZF ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>group0_1_L4</nowiki>: ''assumes '' $ e \in G \wedge (\forall g\in G.\ e \oplus g = g \wedge g \oplus e = g)$ '' shows '' $ e = TheNeutralElement(G,f)$ ===
''qed'' ===
The lifted operation acts on the functions in a natural way defined by the monoid operation.
''lemma'' ''(in'' monoid0'')'' <nowiki>lifted_val</nowiki>:
'' assumes '' $ F = f \text{ lifted to function space over } X$ ''and '' $ s:X\rightarrow G$, $ r:X\rightarrow G$ ''and '' $ x\in X$ '' shows '' $ (F\langle s,r\rangle )(x) = s(x) \oplus r(x)$ ''using'' <nowiki>monoidAsssum</nowiki> , <nowiki>assms</nowiki> , +++^[IsAmonoid_def | Monoid_ZF ]... Definition of <nowiki>IsAmonoid</nowiki>:
$ \text{IsAmonoid}(G,f) \equiv $
$ f \text{ is associative on } G \wedge $
$ (\exists e\in G.\ (\forall g\in G.\ ( (f(\langle e,g\rangle ) = g) \wedge (f(\langle g,e\rangle ) = g))))$=== , +++^[IsAssociative_def | func_ZF ]... Definition of <nowiki>IsAssociative</nowiki>:
$ P \text{ is associative on } G \equiv P : G\times G\rightarrow G \wedge $
$ (\forall x \in G.\ \forall y \in G.\ \forall z \in G.\ $
$ ( P(\langle P(\langle x,y\rangle ),z\rangle ) = P( \langle x,P(\langle y,z\rangle )\rangle )))$=== , +++^[group0_1_L3B | Monoid_ZF ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>group0_1_L3B</nowiki>: '' shows '' $ range(f) = G$ === , +++^[func_ZF_1_L4 | func_ZF ]... ''theorem'' <nowiki>func_ZF_1_L4</nowiki>: ''assumes '' $ f : Y\times Y\rightarrow Y$ ''and'' $ F = f \text{ lifted to function space over } X$ ''and'' $ s:X\rightarrow range(f)$, $ r:X\rightarrow range(f)$ ''and'' $ x\in X$ '' shows '' $ (F\langle s,r\rangle )(x) = f\langle s(x),r(x)\rangle $ ===
The lifted operation acts on the functions in a natural way defined by the group operation. This is the same as //lifted_val//, but in the //group0// context.
''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_1_L3</nowiki>:
'' assumes '' $ F = P \text{ lifted to function space over } X$ ''and '' $ s:X\rightarrow G$, $ r:X\rightarrow G$ ''and '' $ x\in X$ '' shows '' $ (F\langle s,r\rangle )(x) = s(x)\cdot r(x)$ ''using'' <nowiki>assms</nowiki> , +++^[group0_2_L1 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L1</nowiki>: '' shows '' $ monoid0(G,P)$ === , +++^[lifted_val | Group_ZF_2 ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>lifted_val</nowiki>: ''assumes '' $ F = f \text{ lifted to function space over } X$ ''and'' $ s:X\rightarrow G$, $ r:X\rightarrow G$ ''and'' $ x\in X$ '' shows '' $ (F\langle s,r\rangle )(x) = s(x) \oplus r(x)$ ===
In the group0 context we can apply theorems proven in monoid0 context to the lifted monoid.
''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_1_L4</nowiki>:
'' assumes '' A1: $ F = P \text{ lifted to function space over } X$ '' shows '' $ monoid0(X\rightarrow G,F)$+++[proof ]>
''from '' A1 ''show'' $ thesis$ ''using'' +++^[group0_2_L1 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L1</nowiki>: '' shows '' $ monoid0(G,P)$ === , +++^[Group_ZF_2_1_T1 | Group_ZF_2 ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>Group_ZF_2_1_T1</nowiki>: ''assumes '' $ F = f \text{ lifted to function space over } X$ '' shows '' $ \text{IsAmonoid}(X\rightarrow G,F)$ === , <nowiki>monoid0_def</nowiki>
''qed'' ===
The compostion of a function $f:X\rightarrow G$ with the group inverse is a right inverse for the lifted group.
''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_1_L5</nowiki>:
'' assumes '' A1: $ F = P \text{ lifted to function space over } X$ ''and '' A2: $ s : X\rightarrow G$ ''and '' A3: $ i = GroupInv(G,P)\circ s$ '' shows '' $ i: X\rightarrow G$ ''and '' $ F\langle s,i\rangle = TheNeutralElement(X\rightarrow G,F)$+++[proof ]>
''let '' $ E = ConstantFunction(X,1 )$
''have'' $ E : X\rightarrow G$ ''using'' +++^[group0_2_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L2</nowiki>: '' shows '' $ 1 \in G \wedge (\forall g\in G.\ (1 \cdot g = g \wedge g\cdot 1 = g))$ === , +++^[func1_3_L1 | func1 ]... ''lemma'' <nowiki>func1_3_L1</nowiki>: ''assumes '' $ c\in Y$ '' shows '' $ ConstantFunction(X,c) : X\rightarrow Y$ ===
''moreover'' ''from '' groupAssum, A2, A3, A1 ''have'' $ F\langle s,i\rangle : X\rightarrow G$ ''using'' +++^[group0_2_T2 | Group_ZF ]... ''theorem'' <nowiki>group0_2_T2</nowiki>: ''assumes '' $ \text{IsAgroup}(G,f)$ '' shows '' $ GroupInv(G,f) : G\rightarrow G$ === , <nowiki>comp_fun</nowiki> , +++^[Group_ZF_2_1_L4 | Group_ZF_2 ]... ''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_1_L4</nowiki>: ''assumes '' $ F = P \text{ lifted to function space over } X$ '' shows '' $ monoid0(X\rightarrow G,F)$ === , +++^[group0_1_L1 | Monoid_ZF ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>group0_1_L1</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\oplus b \in G$ ===
''moreover'' ''from '' groupAssum, A2, A3, A1 ''have'' $ \forall x\in X.\ (F\langle s,i\rangle )(x) = E(x)$ ''using'' +++^[group0_2_T2 | Group_ZF ]... ''theorem'' <nowiki>group0_2_T2</nowiki>: ''assumes '' $ \text{IsAgroup}(G,f)$ '' shows '' $ GroupInv(G,f) : G\rightarrow G$ === , <nowiki>comp_fun</nowiki> , +++^[Group_ZF_2_1_L3 | Group_ZF_2 ]... ''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_1_L3</nowiki>: ''assumes '' $ F = P \text{ lifted to function space over } X$ ''and'' $ s:X\rightarrow G$, $ r:X\rightarrow G$ ''and'' $ x\in X$ '' shows '' $ (F\langle s,r\rangle )(x) = s(x)\cdot r(x)$ === , <nowiki>comp_fun_apply</nowiki> , <nowiki>apply_funtype</nowiki> , +++^[group0_2_L6 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L6</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x\cdot x^{-1} = 1 \wedge x^{-1}\cdot x = 1 $ === , +++^[func1_3_L2 | func1 ]... ''lemma'' <nowiki>func1_3_L2</nowiki>: ''assumes '' $ x\in X$ '' shows '' $ ConstantFunction(X,c)(x) = c$ ===
''moreover'' ''from '' groupAssum, A1 ''have'' $ E = TheNeutralElement(X\rightarrow G,F)$ ''using'' +++^[IsAgroup_def | Group_ZF ]... Definition of <nowiki>IsAgroup</nowiki>:
$ \text{IsAgroup}(G,f) \equiv $
$ (\text{IsAmonoid}(G,f) \wedge (\forall g\in G.\ \exists b\in G.\ f\langle g,b\rangle = TheNeutralElement(G,f)))$=== , +++^[Group_ZF_2_1_L2 | Group_ZF_2 ]... ''lemma'' <nowiki>Group_ZF_2_1_L2</nowiki>: ''assumes '' $ \text{IsAmonoid}(G,f)$ ''and'' $ F = f \text{ lifted to function space over } X$ ''and'' $ E = ConstantFunction(X,TheNeutralElement(G,f))$ '' shows '' $ E = TheNeutralElement(X\rightarrow G,F)$ ===
''ultimately '' ''show'' $ F\langle s,i\rangle = TheNeutralElement(X\rightarrow G,F)$ ''using'' <nowiki>fun_extension_iff</nowiki> , +++^[IsAgroup_def | Group_ZF ]... Definition of <nowiki>IsAgroup</nowiki>:
$ \text{IsAgroup}(G,f) \equiv $
$ (\text{IsAmonoid}(G,f) \wedge (\forall g\in G.\ \exists b\in G.\ f\langle g,b\rangle = TheNeutralElement(G,f)))$=== , +++^[Group_ZF_2_1_L2 | Group_ZF_2 ]... ''lemma'' <nowiki>Group_ZF_2_1_L2</nowiki>: ''assumes '' $ \text{IsAmonoid}(G,f)$ ''and'' $ F = f \text{ lifted to function space over } X$ ''and'' $ E = ConstantFunction(X,TheNeutralElement(G,f))$ '' shows '' $ E = TheNeutralElement(X\rightarrow G,F)$ ===
''from '' groupAssum, A2, A3 ''show'' $ i: X\rightarrow G$ ''using'' +++^[group0_2_T2 | Group_ZF ]... ''theorem'' <nowiki>group0_2_T2</nowiki>: ''assumes '' $ \text{IsAgroup}(G,f)$ '' shows '' $ GroupInv(G,f) : G\rightarrow G$ === , <nowiki>comp_fun</nowiki>
''qed'' ===
Groups can be lifted to the function space.
''theorem'' ''(in'' group0'')'' <nowiki>Group_ZF_2_1_T2</nowiki>:
'' assumes '' A1: $ F = P \text{ lifted to function space over } X$ '' shows '' $ \text{IsAgroup}(X\rightarrow G,F)$+++[proof ]>
''from '' A1 ''have'' $ \text{IsAmonoid}(X\rightarrow G,F)$ ''using'' +++^[group0_2_L1 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L1</nowiki>: '' shows '' $ monoid0(G,P)$ === , +++^[Group_ZF_2_1_T1 | Group_ZF_2 ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>Group_ZF_2_1_T1</nowiki>: ''assumes '' $ F = f \text{ lifted to function space over } X$ '' shows '' $ \text{IsAmonoid}(X\rightarrow G,F)$ ===
''moreover'' ''have'' $ \forall s\in X\rightarrow G.\ \exists i\in X\rightarrow G.\ F\langle s,i\rangle = TheNeutralElement(X\rightarrow G,F)$+++[proof ]>
''fix '' $ s$
''assume '' A2: $ s : X\rightarrow G$
''let '' $ i = GroupInv(G,P)\circ s$
''from '' groupAssum, A2 ''have'' $ i:X\rightarrow G$ ''using'' +++^[group0_2_T2 | Group_ZF ]... ''theorem'' <nowiki>group0_2_T2</nowiki>: ''assumes '' $ \text{IsAgroup}(G,f)$ '' shows '' $ GroupInv(G,f) : G\rightarrow G$ === , <nowiki>comp_fun</nowiki>
''moreover'' ''from '' A1, A2 ''have'' $ F\langle s,i\rangle = TheNeutralElement(X\rightarrow G,F)$ ''using'' +++^[Group_ZF_2_1_L5 | Group_ZF_2 ]... ''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_1_L5</nowiki>: ''assumes '' $ F = P \text{ lifted to function space over } X$ ''and'' $ s : X\rightarrow G$ ''and'' $ i = GroupInv(G,P)\circ s$ '' shows '' $ i: X\rightarrow G$ ''and'' $ F\langle s,i\rangle = TheNeutralElement(X\rightarrow G,F)$ ===
''ultimately '' ''show'' $ \exists i\in X\rightarrow G.\ F\langle s,i\rangle = TheNeutralElement(X\rightarrow G,F)$
''qed'' ===
''ultimately '' ''show'' $ thesis$ ''using'' +++^[IsAgroup_def | Group_ZF ]... Definition of <nowiki>IsAgroup</nowiki>:
$ \text{IsAgroup}(G,f) \equiv $
$ (\text{IsAmonoid}(G,f) \wedge (\forall g\in G.\ \exists b\in G.\ f\langle g,b\rangle = TheNeutralElement(G,f)))$===
''qed'' ===
What is the group inverse for the lifted group?
''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_1_L6</nowiki>:
'' assumes '' A1: $ F = P \text{ lifted to function space over } X$ '' shows '' $ \forall s\in (X\rightarrow G).\ GroupInv(X\rightarrow G,F)(s) = GroupInv(G,P)\circ s$+++[proof ]>
''from '' A1 ''have'' $ group0(X\rightarrow G,F)$ ''using'' <nowiki>group0_def</nowiki> , +++^[Group_ZF_2_1_T2 | Group_ZF_2 ]... ''theorem'' ''(in'' group0'')'' <nowiki>Group_ZF_2_1_T2</nowiki>: ''assumes '' $ F = P \text{ lifted to function space over } X$ '' shows '' $ \text{IsAgroup}(X\rightarrow G,F)$ ===
''moreover'' ''from '' A1 ''have'' $ \forall s\in X\rightarrow G.\ GroupInv(G,P)\circ s : X\rightarrow G \wedge $
$ F\langle s,GroupInv(G,P)\circ s\rangle = TheNeutralElement(X\rightarrow G,F)$ ''using'' +++^[Group_ZF_2_1_L5 | Group_ZF_2 ]... ''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_1_L5</nowiki>: ''assumes '' $ F = P \text{ lifted to function space over } X$ ''and'' $ s : X\rightarrow G$ ''and'' $ i = GroupInv(G,P)\circ s$ '' shows '' $ i: X\rightarrow G$ ''and'' $ F\langle s,i\rangle = TheNeutralElement(X\rightarrow G,F)$ ===
''ultimately '' ''have'' $ \forall s\in (X\rightarrow G).\ GroupInv(G,P)\circ s = GroupInv(X\rightarrow G,F)(s)$ '' by (rule '' +++^[group0_2_L9A | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L9A</nowiki>: ''assumes '' $ \forall g\in G.\ b(g) \in G \wedge g\cdot b(g) = 1 $ '' shows '' $ \forall g\in G.\ b(g) = g^{-1}$ === '')''
''thus'' $ thesis$
''qed'' ===
What is the value of the group inverse for the lifted group?
''corollary'' ''(in'' group0'')'' <nowiki>lift_gr_inv_val</nowiki>:
'' assumes '' $ F = P \text{ lifted to function space over } X$ ''and '' $ s : X\rightarrow G$ ''and '' $ x\in X$ '' shows '' $ (GroupInv(X\rightarrow G,F)(s))(x) = (s(x))^{-1}$ ''using'' <nowiki>groupAssum</nowiki> , <nowiki>assms</nowiki> , +++^[Group_ZF_2_1_L6 | Group_ZF_2 ]... ''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_1_L6</nowiki>: ''assumes '' $ F = P \text{ lifted to function space over } X$ '' shows '' $ \forall s\in (X\rightarrow G).\ GroupInv(X\rightarrow G,F)(s) = GroupInv(G,P)\circ s$ === , +++^[group0_2_T2 | Group_ZF ]... ''theorem'' <nowiki>group0_2_T2</nowiki>: ''assumes '' $ \text{IsAgroup}(G,f)$ '' shows '' $ GroupInv(G,f) : G\rightarrow G$ === , <nowiki>comp_fun_apply</nowiki>
What is the group inverse in a subgroup of the lifted group?
''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_1_L6A</nowiki>:
'' assumes '' A1: $ F = P \text{ lifted to function space over } X$ ''and '' A2: $ IsAsubgroup(H,F)$ ''and '' A3: $ g = restrict(F,H\times H)$ ''and '' A4: $ s\in H$ '' shows '' $ GroupInv(H,g)(s) = GroupInv(G,P)\circ s$+++[proof ]>
''from '' A1 ''have'' T1: $ group0(X\rightarrow G,F)$ ''using'' <nowiki>group0_def</nowiki> , +++^[Group_ZF_2_1_T2 | Group_ZF_2 ]... ''theorem'' ''(in'' group0'')'' <nowiki>Group_ZF_2_1_T2</nowiki>: ''assumes '' $ F = P \text{ lifted to function space over } X$ '' shows '' $ \text{IsAgroup}(X\rightarrow G,F)$ ===
''with '' A2, A3, A4 ''have'' $ GroupInv(H,g)(s) = GroupInv(X\rightarrow G,F)(s)$ ''using'' +++^[group0_3_T1 | Group_ZF ]... ''theorem'' ''(in'' group0'')'' <nowiki>group0_3_T1</nowiki>: ''assumes '' $ IsAsubgroup(H,P)$ ''and'' $ g = restrict(P,H\times H)$ '' shows '' $ GroupInv(H,g) = restrict(GroupInv(G,P),H)$ === , <nowiki>restrict</nowiki>
''moreover'' ''from '' T1, A1, A2, A4 ''have'' $ GroupInv(X\rightarrow G,F)(s) = GroupInv(G,P)\circ s$ ''using'' +++^[group0_3_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_3_L2</nowiki>: ''assumes '' $ IsAsubgroup(H,P)$ '' shows '' $ H \subseteq G$ === , +++^[Group_ZF_2_1_L6 | Group_ZF_2 ]... ''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_1_L6</nowiki>: ''assumes '' $ F = P \text{ lifted to function space over } X$ '' shows '' $ \forall s\in (X\rightarrow G).\ GroupInv(X\rightarrow G,F)(s) = GroupInv(G,P)\circ s$ ===
''ultimately '' ''show'' $ thesis$
''qed'' ===
If a group is abelian, then its lift to a function space is also abelian.
''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_1_L7</nowiki>:
'' assumes '' A1: $ F = P \text{ lifted to function space over } X$ ''and '' A2: $ P \text{ is commutative on } G$ '' shows '' $ F \text{ is commutative on } (X\rightarrow G)$+++[proof ]>
''from '' A1, A2 ''have'' $ F \text{ is commutative on } (X\rightarrow range(P))$ ''using'' +++^[group_oper_assocA | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_oper_assocA</nowiki>: '' shows '' $ P : G\times G\rightarrow G$ === , +++^[func_ZF_2_L2 | func_ZF ]... ''lemma'' <nowiki>func_ZF_2_L2</nowiki>: ''assumes '' $ f : G\times G\rightarrow G$ ''and'' $ f \text{ is commutative on } G$ ''and'' $ F = f \text{ lifted to function space over } X$ '' shows '' $ F \text{ is commutative on } (X\rightarrow range(f))$ ===
''moreover'' ''from '' groupAssum ''have'' $ range(P) = G$ ''using'' +++^[group0_2_L1 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L1</nowiki>: '' shows '' $ monoid0(G,P)$ === , +++^[group0_1_L3B | Monoid_ZF ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>group0_1_L3B</nowiki>: '' shows '' $ range(f) = G$ ===
''ultimately '' ''show'' $ thesis$
''qed'' ===
!Equivalence relations on groups
The goal of this section is to establish that (under some conditions) given an equivalence relation on a group or (monoid )we can project the group (monoid) structure on the quotient and obtain another group.
The neutral element class is neutral in the projection.
''lemma'' ''(in'' monoid0'')'' <nowiki>Group_ZF_2_2_L1</nowiki>:
'' assumes '' A1: $ equiv(G,r)$ ''and '' A2: $ Congruent2(r,f)$ ''and '' A3: $ F = ProjFun2(G,r,f)$ ''and '' A4: $ e = TheNeutralElement(G,f)$ '' shows '' $ r\{e\} \in G//r \wedge $
$ (\forall c \in G//r.\ F\langle r\{e\},c\rangle = c \wedge F\langle c,r\{e\}\rangle = c)$+++[proof ]>
''from '' A4 ''show'' T1: $ r\{e\} \in G//r$ ''using'' +++^[unit_is_neutral | Monoid_ZF ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>unit_is_neutral</nowiki>: ''assumes '' $ e = TheNeutralElement(G,f)$ '' shows '' $ e \in G \wedge (\forall g\in G.\ e \oplus g = g \wedge g \oplus e = g)$ === , <nowiki>quotientI</nowiki>
''show'' $ \forall c \in G//r.\ F\langle r\{e\},c\rangle = c \wedge F\langle c,r\{e\}\rangle = c$+++[proof ]>
''fix '' $ c$
''assume '' A5: $ c \in G//r$
''then '' ''obtain '' $ g$ ''where '' D1: $ g\in G$, $ c = r\{g\}$ ''using'' <nowiki>quotient_def</nowiki>
''with '' A1, A2, A3, A4, D1 ''show'' $ F\langle r\{e\},c\rangle = c \wedge F\langle c,r\{e\}\rangle = c$ ''using'' +++^[unit_is_neutral | Monoid_ZF ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>unit_is_neutral</nowiki>: ''assumes '' $ e = TheNeutralElement(G,f)$ '' shows '' $ e \in G \wedge (\forall g\in G.\ e \oplus g = g \wedge g \oplus e = g)$ === , +++^[EquivClass_1_L10 | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_1_L10</nowiki>: ''assumes '' $ equiv(A,r)$ ''and'' $ Congruent2(r,f)$ ''and'' $ x\in A$, $ y\in A$ '' shows '' $ ProjFun2(A,r,f)\langle r\{x\},r\{y\}\rangle = r\{f\langle x,y\rangle \}$ ===
''qed'' ===
''qed'' ===
The projected structure is a monoid.
''theorem'' ''(in'' monoid0'')'' <nowiki>Group_ZF_2_2_T1</nowiki>:
'' assumes '' A1: $ equiv(G,r)$ ''and '' A2: $ Congruent2(r,f)$ ''and '' A3: $ F = ProjFun2(G,r,f)$ '' shows '' $ \text{IsAmonoid}(G//r,F)$+++[proof ]>
''let '' $ E = r\{TheNeutralElement(G,f)\}$
''from '' A1, A2, A3 ''have'' $ E \in G//r \wedge (\forall c\in G//r.\ F\langle E,c\rangle = c \wedge F\langle c,E\rangle = c)$ ''using'' +++^[Group_ZF_2_2_L1 | Group_ZF_2 ]... ''lemma'' <nowiki>Group_ZF_2_2_L1</nowiki>: ''assumes '' $ \text{IsAmonoid}(G,f)$ ''and'' $ equiv(G,r)$ ''and'' $ Congruent2(r,f)$ ''and'' $ F = ProjFun2(G,r,f)$ ''and'' $ e = TheNeutralElement(G,f)$ '' shows '' $ r\{e\} = TheNeutralElement(G//r,F)$ ===
''hence'' $ \exists E\in G//r.\ \forall c\in G//r.\ F\langle E,c\rangle = c \wedge F\langle c,E\rangle = c$
''with '' monoidAsssum, A1, A2, A3 ''show'' $ thesis$ ''using'' +++^[IsAmonoid_def | Monoid_ZF ]... Definition of <nowiki>IsAmonoid</nowiki>:
$ \text{IsAmonoid}(G,f) \equiv $
$ f \text{ is associative on } G \wedge $
$ (\exists e\in G.\ (\forall g\in G.\ ( (f(\langle e,g\rangle ) = g) \wedge (f(\langle g,e\rangle ) = g))))$=== , +++^[EquivClass_2_T2 | EquivClass1 ]... ''theorem'' <nowiki>EquivClass_2_T2</nowiki>: ''assumes '' $ equiv(A,r)$ ''and'' $ Congruent2(r,f)$ ''and'' $ f \text{ is associative on } A$ '' shows '' $ ProjFun2(A,r,f) \text{ is associative on } A//r$ ===
''qed'' ===
The class of the neutral element is the neutral element of the projected monoid.
''lemma'' <nowiki>Group_ZF_2_2_L1</nowiki>:
'' assumes '' A1: $ \text{IsAmonoid}(G,f)$ ''and '' A2: $ equiv(G,r)$ ''and '' A3: $ Congruent2(r,f)$ ''and '' A4: $ F = ProjFun2(G,r,f)$ ''and '' A5: $ e = TheNeutralElement(G,f)$ '' shows '' $ r\{e\} = TheNeutralElement(G//r,F)$+++[proof ]>
''from '' A1, A2, A3, A4 ''have'' T1: $ monoid0(G,f)$ ''and '' T2: $ monoid0(G//r,F)$ ''using'' <nowiki>monoid0_def</nowiki> , +++^[Group_ZF_2_2_T1 | Group_ZF_2 ]... ''theorem'' ''(in'' monoid0'')'' <nowiki>Group_ZF_2_2_T1</nowiki>: ''assumes '' $ equiv(G,r)$ ''and'' $ Congruent2(r,f)$ ''and'' $ F = ProjFun2(G,r,f)$ '' shows '' $ \text{IsAmonoid}(G//r,F)$ ===
''from '' T1, A2, A3, A4, A5 ''have'' $ r\{e\} \in G//r \wedge $
$ (\forall c \in G//r.\ F\langle r\{e\},c\rangle = c \wedge F\langle c,r\{e\}\rangle = c)$ ''using'' +++^[Group_ZF_2_2_L1 | Group_ZF_2 ]... ''lemma'' <nowiki>Group_ZF_2_2_L1</nowiki>: ''assumes '' $ \text{IsAmonoid}(G,f)$ ''and'' $ equiv(G,r)$ ''and'' $ Congruent2(r,f)$ ''and'' $ F = ProjFun2(G,r,f)$ ''and'' $ e = TheNeutralElement(G,f)$ '' shows '' $ r\{e\} = TheNeutralElement(G//r,F)$ ===
''with '' T2 ''show'' $ thesis$ ''using'' +++^[group0_1_L4 | Monoid_ZF ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>group0_1_L4</nowiki>: ''assumes '' $ e \in G \wedge (\forall g\in G.\ e \oplus g = g \wedge g \oplus e = g)$ '' shows '' $ e = TheNeutralElement(G,f)$ ===
''qed'' ===
The projected operation can be defined in terms of the group operation on representants in a natural way.
''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_2_L2</nowiki>:
'' assumes '' A1: $ equiv(G,r)$ ''and '' A2: $ Congruent2(r,P)$ ''and '' A3: $ F = ProjFun2(G,r,P)$ ''and '' A4: $ a\in G$, $ b\in G$ '' shows '' $ F\langle r\{a\},r\{b\}\rangle = r\{a\cdot b\}$+++[proof ]>
''from '' A1, A2, A3, A4 ''show'' $ thesis$ ''using'' +++^[EquivClass_1_L10 | EquivClass1 ]... ''lemma'' <nowiki>EquivClass_1_L10</nowiki>: ''assumes '' $ equiv(A,r)$ ''and'' $ Congruent2(r,f)$ ''and'' $ x\in A$, $ y\in A$ '' shows '' $ ProjFun2(A,r,f)\langle r\{x\},r\{y\}\rangle = r\{f\langle x,y\rangle \}$ ===
''qed'' ===
The class of the inverse is a right inverse of the class.
''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_2_L3</nowiki>:
'' assumes '' A1: $ equiv(G,r)$ ''and '' A2: $ Congruent2(r,P)$ ''and '' A3: $ F = ProjFun2(G,r,P)$ ''and '' A4: $ a\in G$ '' shows '' $ F\langle r\{a\},r\{a^{-1}\}\rangle = TheNeutralElement(G//r,F)$+++[proof ]>
''from '' A1, A2, A3, A4 ''have'' $ F\langle r\{a\},r\{a^{-1}\}\rangle = r\{1 \}$ ''using'' +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ === , +++^[Group_ZF_2_2_L2 | Group_ZF_2 ]... ''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_2_L2</nowiki>: ''assumes '' $ equiv(G,r)$ ''and'' $ Congruent2(r,P)$ ''and'' $ F = ProjFun2(G,r,P)$ ''and'' $ a\in G$, $ b\in G$ '' shows '' $ F\langle r\{a\},r\{b\}\rangle = r\{a\cdot b\}$ === , +++^[group0_2_L6 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L6</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x\cdot x^{-1} = 1 \wedge x^{-1}\cdot x = 1 $ ===
''with '' groupAssum, A1, A2, A3 ''show'' $ thesis$ ''using'' +++^[IsAgroup_def | Group_ZF ]... Definition of <nowiki>IsAgroup</nowiki>:
$ \text{IsAgroup}(G,f) \equiv $
$ (\text{IsAmonoid}(G,f) \wedge (\forall g\in G.\ \exists b\in G.\ f\langle g,b\rangle = TheNeutralElement(G,f)))$=== , +++^[Group_ZF_2_2_L1 | Group_ZF_2 ]... ''lemma'' <nowiki>Group_ZF_2_2_L1</nowiki>: ''assumes '' $ \text{IsAmonoid}(G,f)$ ''and'' $ equiv(G,r)$ ''and'' $ Congruent2(r,f)$ ''and'' $ F = ProjFun2(G,r,f)$ ''and'' $ e = TheNeutralElement(G,f)$ '' shows '' $ r\{e\} = TheNeutralElement(G//r,F)$ ===
''qed'' ===
The group structure can be projected to the quotient space.
''theorem'' ''(in'' group0'')'' <nowiki>Group_ZF_3_T2</nowiki>:
'' assumes '' A1: $ equiv(G,r)$ ''and '' A2: $ Congruent2(r,P)$ '' shows '' $ \text{IsAgroup}(G//r,ProjFun2(G,r,P))$+++[proof ]>
''let '' $ F = ProjFun2(G,r,P)$
''let '' $ E = TheNeutralElement(G//r,F)$
''from '' groupAssum, A1, A2 ''have'' $ \text{IsAmonoid}(G//r,F)$ ''using'' +++^[IsAgroup_def | Group_ZF ]... Definition of <nowiki>IsAgroup</nowiki>:
$ \text{IsAgroup}(G,f) \equiv $
$ (\text{IsAmonoid}(G,f) \wedge (\forall g\in G.\ \exists b\in G.\ f\langle g,b\rangle = TheNeutralElement(G,f)))$=== , <nowiki>monoid0_def</nowiki> , +++^[Group_ZF_2_2_T1 | Group_ZF_2 ]... ''theorem'' ''(in'' monoid0'')'' <nowiki>Group_ZF_2_2_T1</nowiki>: ''assumes '' $ equiv(G,r)$ ''and'' $ Congruent2(r,f)$ ''and'' $ F = ProjFun2(G,r,f)$ '' shows '' $ \text{IsAmonoid}(G//r,F)$ ===
''moreover'' ''have'' $ \forall c\in G//r.\ \exists b\in G//r.\ F\langle c,b\rangle = E$+++[proof ]>
''fix '' $ c$
''assume '' A3: $ c \in G//r$
''then '' ''obtain '' $ g$ ''where '' D1: $ g\in G$, $ c = r\{g\}$ ''using'' <nowiki>quotient_def</nowiki>
''let '' $ b = r\{g^{-1}\}$
''from '' D1 ''have'' $ b \in G//r$ ''using'' +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ === , <nowiki>quotientI</nowiki>
''moreover'' ''from '' A1, A2, D1 ''have'' $ F\langle c,b\rangle = E$ ''using'' +++^[Group_ZF_2_2_L3 | Group_ZF_2 ]... ''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_2_L3</nowiki>: ''assumes '' $ equiv(G,r)$ ''and'' $ Congruent2(r,P)$ ''and'' $ F = ProjFun2(G,r,P)$ ''and'' $ a\in G$ '' shows '' $ F\langle r\{a\},r\{a^{-1}\}\rangle = TheNeutralElement(G//r,F)$ ===
''ultimately '' ''show'' $ \exists b\in G//r.\ F\langle c,b\rangle = E$
''qed'' ===
''ultimately '' ''show'' $ thesis$ ''using'' +++^[IsAgroup_def | Group_ZF ]... Definition of <nowiki>IsAgroup</nowiki>:
$ \text{IsAgroup}(G,f) \equiv $
$ (\text{IsAmonoid}(G,f) \wedge (\forall g\in G.\ \exists b\in G.\ f\langle g,b\rangle = TheNeutralElement(G,f)))$===
''qed'' ===
The group inverse (in the projected group) of a class is the class of the inverse.
''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_2_L4</nowiki>:
'' assumes '' A1: $ equiv(G,r)$ ''and '' A2: $ Congruent2(r,P)$ ''and '' A3: $ F = ProjFun2(G,r,P)$ ''and '' A4: $ a\in G$ '' shows '' $ r\{a^{-1}\} = GroupInv(G//r,F)(r\{a\})$+++[proof ]>
''from '' A1, A2, A3 ''have'' $ group0(G//r,F)$ ''using'' +++^[Group_ZF_3_T2 | Group_ZF_2 ]... ''theorem'' ''(in'' group0'')'' <nowiki>Group_ZF_3_T2</nowiki>: ''assumes '' $ equiv(G,r)$ ''and'' $ Congruent2(r,P)$ '' shows '' $ \text{IsAgroup}(G//r,ProjFun2(G,r,P))$ === , <nowiki>group0_def</nowiki>
''moreover'' ''from '' A4 ''have'' $ r\{a\} \in G//r$, $ r\{a^{-1}\} \in G//r$ ''using'' +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ === , <nowiki>quotientI</nowiki>
''moreover'' ''from '' A1, A2, A3, A4 ''have'' $ F\langle r\{a\},r\{a^{-1}\}\rangle = TheNeutralElement(G//r,F)$ ''using'' +++^[Group_ZF_2_2_L3 | Group_ZF_2 ]... ''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_2_L3</nowiki>: ''assumes '' $ equiv(G,r)$ ''and'' $ Congruent2(r,P)$ ''and'' $ F = ProjFun2(G,r,P)$ ''and'' $ a\in G$ '' shows '' $ F\langle r\{a\},r\{a^{-1}\}\rangle = TheNeutralElement(G//r,F)$ ===
''ultimately '' ''show'' $ thesis$ '' by (rule '' +++^[group0_2_L9 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L9</nowiki>: ''assumes '' $ a\in G$ ''and'' $ b\in G$ ''and'' $ a\cdot b = 1 $ '' shows '' $ a = b^{-1}$ ''and'' $ b = a^{-1}$ === '')''
''qed'' ===
!Normal subgroups and quotient groups
If $H$ is a subgroup of $G$, then for every $a\in G$ we can cosider the sets $\{a\cdot h. h \in H\}$ and $\{ h\cdot a. h \in H\}$ (called a left and right ''coset of H'', resp.) These sets sometimes form a group, called the ''quotient group''. This section discusses the notion of quotient groups.
A normal subgorup $N$ of a group $G$ is such that $aba^{-1}$ belongs to $N$ if $a\in G, b\in N$.
''Definition
'' $ IsAnormalSubgroup(G,P,N) \equiv IsAsubgroup(N,P) \wedge $
$ (\forall n\in N.\ \forall g\in G.\ P\langle P\langle g,n \rangle ,GroupInv(G,P)(g) \rangle \in N)$
Having a group and a normal subgroup $N$ we can create another group consisting of eqivalence classes of the relation $a\sim b \equiv a\cdot b^{-1} \in N$. We will refer to this relation as the quotient group relation. The classes of this relation are in fact cosets of subgroup $H$.
''Definition
'' $ QuotientGroupRel(G,P,H) \equiv $
$ \{\langle a,b\rangle \in G\times G.\ P\langle a, GroupInv(G,P)(b)\rangle \in H\}$
Next we define the operation in the quotient group as the projection of the group operation on the classses of the quotient group relation.
''Definition
'' $ QuotientGroupOp(G,P,H) \equiv ProjFun2(G,QuotientGroupRel(G,P,H ),P)$
Definition of a normal subgroup in a more readable notation.
''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_4_L0</nowiki>:
'' assumes '' $ IsAnormalSubgroup(G,P,H)$ ''and '' $ g\in G$, $ n\in H$ '' shows '' $ g\cdot n\cdot g^{-1} \in H$ ''using'' <nowiki>assms</nowiki> , +++^[IsAnormalSubgroup_def | Group_ZF_2 ]... Definition of <nowiki>IsAnormalSubgroup</nowiki>:
$ IsAnormalSubgroup(G,P,N) \equiv IsAsubgroup(N,P) \wedge $
$ (\forall n\in N.\ \forall g\in G.\ P\langle P\langle g,n \rangle ,GroupInv(G,P)(g) \rangle \in N)$===
The quotient group relation is reflexive.
''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_4_L1</nowiki>:
'' assumes '' $ IsAsubgroup(H,P)$ '' shows '' $ refl(G,QuotientGroupRel(G,P,H))$ ''using'' <nowiki>assms</nowiki> , +++^[group0_2_L6 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L6</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x\cdot x^{-1} = 1 \wedge x^{-1}\cdot x = 1 $ === , +++^[group0_3_L5 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_3_L5</nowiki>: ''assumes '' $ IsAsubgroup(H,P)$ '' shows '' $ 1 \in H$ === , +++^[QuotientGroupRel_def | Group_ZF_2 ]... Definition of <nowiki>QuotientGroupRel</nowiki>:
$ QuotientGroupRel(G,P,H) \equiv $
$ \{\langle a,b\rangle \in G\times G.\ P\langle a, GroupInv(G,P)(b)\rangle \in H\}$=== , <nowiki>refl_def</nowiki>
The quotient group relation is symmetric.
''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_4_L2</nowiki>:
'' assumes '' A1: $ IsAsubgroup(H,P)$ '' shows '' $ sym(QuotientGroupRel(G,P,H))$+++[proof ]>
++++[{ ]>
''fix '' $ a$ $ b$
''assume '' A2: $ \langle a,b\rangle \in QuotientGroupRel(G,P,H)$
''with '' A1 ''have'' $ (a\cdot b^{-1})^{-1} \in H$ ''using'' +++^[QuotientGroupRel_def | Group_ZF_2 ]... Definition of <nowiki>QuotientGroupRel</nowiki>:
$ QuotientGroupRel(G,P,H) \equiv $
$ \{\langle a,b\rangle \in G\times G.\ P\langle a, GroupInv(G,P)(b)\rangle \in H\}$=== , +++^[group0_3_T3A | Group_ZF ]... ''theorem'' ''(in'' group0'')'' <nowiki>group0_3_T3A</nowiki>: ''assumes '' $ IsAsubgroup(H,P)$ ''and'' $ h\in H$ '' shows '' $ h^{-1}\in H$ ===
''moreover'' ''from '' A2 ''have'' $ (a\cdot b^{-1})^{-1} = b\cdot a^{-1}$ ''using'' +++^[QuotientGroupRel_def | Group_ZF_2 ]... Definition of <nowiki>QuotientGroupRel</nowiki>:
$ QuotientGroupRel(G,P,H) \equiv $
$ \{\langle a,b\rangle \in G\times G.\ P\langle a, GroupInv(G,P)(b)\rangle \in H\}$=== , +++^[group0_2_L12 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L12</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ (a\cdot b^{-1})^{-1} = b\cdot a^{-1}$, $ (a^{-1}\cdot b)^{-1} = b^{-1}\cdot a$ ===
''ultimately '' ''have'' $ b\cdot a^{-1} \in H$
''with '' A2 ''have'' $ \langle b,a\rangle \in QuotientGroupRel(G,P,H)$ ''using'' +++^[QuotientGroupRel_def | Group_ZF_2 ]... Definition of <nowiki>QuotientGroupRel</nowiki>:
$ QuotientGroupRel(G,P,H) \equiv $
$ \{\langle a,b\rangle \in G\times G.\ P\langle a, GroupInv(G,P)(b)\rangle \in H\}$===
=== ''}''
''then '' ''show'' $ thesis$ ''using'' <nowiki>symI</nowiki>
''qed'' ===
The quotient group relation is transistive.
''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_4_L3A</nowiki>:
'' assumes '' A1: $ IsAsubgroup(H,P)$ ''and '' A2: $ \langle a,b\rangle \in QuotientGroupRel(G,P,H)$ ''and '' A3: $ \langle b,c\rangle \in QuotientGroupRel(G,P,H)$ '' shows '' $ \langle a,c\rangle \in QuotientGroupRel(G,P,H)$+++[proof ]>
''let '' $ r = QuotientGroupRel(G,P,H)$
''from '' A2, A3 ''have'' T1: $ a\in G$, $ b\in G$, $ c\in G$ ''using'' +++^[QuotientGroupRel_def | Group_ZF_2 ]... Definition of <nowiki>QuotientGroupRel</nowiki>:
$ QuotientGroupRel(G,P,H) \equiv $
$ \{\langle a,b\rangle \in G\times G.\ P\langle a, GroupInv(G,P)(b)\rangle \in H\}$===
''from '' A1, A2, A3 ''have'' $ (a\cdot b^{-1})\cdot (b\cdot c^{-1}) \in H$ ''using'' +++^[QuotientGroupRel_def | Group_ZF_2 ]... Definition of <nowiki>QuotientGroupRel</nowiki>:
$ QuotientGroupRel(G,P,H) \equiv $
$ \{\langle a,b\rangle \in G\times G.\ P\langle a, GroupInv(G,P)(b)\rangle \in H\}$=== , +++^[group0_3_L6 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_3_L6</nowiki>: ''assumes '' $ IsAsubgroup(H,P)$ ''and'' $ a\in H$, $ b\in H$ '' shows '' $ a\cdot b \in H$ ===
''moreover'' ''from '' T1 ''have'' $ a\cdot c^{-1} = (a\cdot b^{-1})\cdot (b\cdot c^{-1})$ ''using'' +++^[group0_2_L14A | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L14A</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot c^{-1}= (a\cdot b^{-1})\cdot (b\cdot c^{-1})$,
$ a^{-1}\cdot c = (a^{-1}\cdot b)\cdot (b^{-1}\cdot c)$,
$ a\cdot (b\cdot c)^{-1} = a\cdot c^{-1}\cdot b^{-1}$,
$ a\cdot (b\cdot c^{-1}) = a\cdot b\cdot c^{-1}$,
$ (a\cdot b^{-1}\cdot c^{-1})^{-1} = c\cdot b\cdot a^{-1}$,
$ a\cdot b\cdot c^{-1}\cdot (c\cdot b^{-1}) = a$, $ a\cdot (b\cdot c)\cdot c^{-1} = a\cdot b$ ===
''ultimately '' ''have'' $ a\cdot c^{-1} \in H$
''with '' T1 ''show'' $ thesis$ ''using'' +++^[QuotientGroupRel_def | Group_ZF_2 ]... Definition of <nowiki>QuotientGroupRel</nowiki>:
$ QuotientGroupRel(G,P,H) \equiv $
$ \{\langle a,b\rangle \in G\times G.\ P\langle a, GroupInv(G,P)(b)\rangle \in H\}$===
''qed'' ===
The quotient group relation is an equivalence relation. Note we do not need the subgroup to be normal for this to be true.
''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_4_L3</nowiki>:
'' assumes '' A1: $ IsAsubgroup(H,P)$ '' shows '' $ equiv(G,QuotientGroupRel(G,P,H))$+++[proof ]>
''let '' $ r = QuotientGroupRel(G,P,H)$
''from '' A1 ''have'' $ \forall a b c.\ (\langle a, b\rangle \in r \wedge \langle b, c\rangle \in r \longrightarrow \langle a, c\rangle \in r)$ ''using'' +++^[Group_ZF_2_4_L3A | Group_ZF_2 ]... ''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_4_L3A</nowiki>: ''assumes '' $ IsAsubgroup(H,P)$ ''and'' $ \langle a,b\rangle \in QuotientGroupRel(G,P,H)$ ''and'' $ \langle b,c\rangle \in QuotientGroupRel(G,P,H)$ '' shows '' $ \langle a,c\rangle \in QuotientGroupRel(G,P,H)$ ===
''then '' ''have'' $ trans(r)$ ''using'' +++^[Fol1_L2 | Fol1 ]... ''lemma'' <nowiki>Fol1_L2</nowiki>: ''assumes '' $ \forall x y z.\ \langle x, y\rangle \in r \wedge \langle y, z\rangle \in r \longrightarrow \langle x, z\rangle \in r$
'' shows '' $ trans(r)$ ===
''with '' A1 ''show'' $ thesis$ ''using'' +++^[Group_ZF_2_4_L1 | Group_ZF_2 ]... ''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_4_L1</nowiki>: ''assumes '' $ IsAsubgroup(H,P)$ '' shows '' $ refl(G,QuotientGroupRel(G,P,H))$ === , +++^[Group_ZF_2_4_L2 | Group_ZF_2 ]... ''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_4_L2</nowiki>: ''assumes '' $ IsAsubgroup(H,P)$ '' shows '' $ sym(QuotientGroupRel(G,P,H))$ === , +++^[QuotientGroupRel_def | Group_ZF_2 ]... Definition of <nowiki>QuotientGroupRel</nowiki>:
$ QuotientGroupRel(G,P,H) \equiv $
$ \{\langle a,b\rangle \in G\times G.\ P\langle a, GroupInv(G,P)(b)\rangle \in H\}$=== , <nowiki>equiv_def</nowiki>
''qed'' ===
The next lemma states the essential condition for congruency of the group operation with respect to the quotient group relation.
''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_4_L4</nowiki>:
'' assumes '' A1: $ IsAnormalSubgroup(G,P,H)$ ''and '' A2: $ \langle a1,a2\rangle \in QuotientGroupRel(G,P,H)$ ''and '' A3: $ \langle b1,b2\rangle \in QuotientGroupRel(G,P,H)$ '' shows '' $ \langle a1\cdot b1, a2\cdot b2\rangle \in QuotientGroupRel(G,P,H)$+++[proof ]>
''from '' A2, A3 ''have'' T1: $ a1\in G$, $ a2\in G$, $ b1\in G$, $ b2\in G$, $ a1\cdot b1 \in G$, $ a2\cdot b2 \in G$, $ b1\cdot b2^{-1} \in H$, $ a1\cdot a2^{-1} \in H$ ''using'' +++^[QuotientGroupRel_def | Group_ZF_2 ]... Definition of <nowiki>QuotientGroupRel</nowiki>:
$ QuotientGroupRel(G,P,H) \equiv $
$ \{\langle a,b\rangle \in G\times G.\ P\langle a, GroupInv(G,P)(b)\rangle \in H\}$=== , +++^[group0_2_L1 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L1</nowiki>: '' shows '' $ monoid0(G,P)$ === , +++^[group0_1_L1 | Monoid_ZF ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>group0_1_L1</nowiki>: ''assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\oplus b \in G$ ===
''with '' A1 ''show'' $ thesis$ ''using'' +++^[IsAnormalSubgroup_def | Group_ZF_2 ]... Definition of <nowiki>IsAnormalSubgroup</nowiki>:
$ IsAnormalSubgroup(G,P,N) \equiv IsAsubgroup(N,P) \wedge $
$ (\forall n\in N.\ \forall g\in G.\ P\langle P\langle g,n \rangle ,GroupInv(G,P)(g) \rangle \in N)$=== , +++^[group0_3_L6 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_3_L6</nowiki>: ''assumes '' $ IsAsubgroup(H,P)$ ''and'' $ a\in H$, $ b\in H$ '' shows '' $ a\cdot b \in H$ === , +++^[group0_2_L15 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L15</nowiki>: ''assumes '' $ a\in G$, $ b\in G$, $ c\in G$, $ d\in G$ '' shows '' $ (a\cdot b)\cdot (c\cdot d)^{-1} = a\cdot (b\cdot d^{-1})\cdot a^{-1}\cdot (a\cdot c^{-1})$ === , +++^[QuotientGroupRel_def | Group_ZF_2 ]... Definition of <nowiki>QuotientGroupRel</nowiki>:
$ QuotientGroupRel(G,P,H) \equiv $
$ \{\langle a,b\rangle \in G\times G.\ P\langle a, GroupInv(G,P)(b)\rangle \in H\}$===
''qed'' ===
If the subgroup is normal, the group operation is congruent with respect to the quotient group relation.
''lemma'' <nowiki>Group_ZF_2_4_L5A</nowiki>:
'' assumes '' $ \text{IsAgroup}(G,P)$ ''and '' $ IsAnormalSubgroup(G,P,H)$ '' shows '' $ Congruent2(QuotientGroupRel(G,P,H),P)$ ''using'' <nowiki>assms</nowiki> , <nowiki>group0_def</nowiki> , +++^[Group_ZF_2_4_L4 | Group_ZF_2 ]... ''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_4_L4</nowiki>: ''assumes '' $ IsAnormalSubgroup(G,P,H)$ ''and'' $ \langle a1,a2\rangle \in QuotientGroupRel(G,P,H)$ ''and'' $ \langle b1,b2\rangle \in QuotientGroupRel(G,P,H)$ '' shows '' $ \langle a1\cdot b1, a2\cdot b2\rangle \in QuotientGroupRel(G,P,H)$ === , +++^[Congruent2_def | EquivClass1 ]... Definition of <nowiki>Congruent2</nowiki>:
$ Congruent2(r,f) \equiv $
$ (\forall x_1 x_2 y_1 y_2.\ \langle x_1,x_2\rangle \in r \wedge \langle y_1,y_2\rangle \in r \longrightarrow $
$ \langle f\langle x_1,y_1\rangle , f\langle x_2,y_2\rangle \rangle \in r)$===
The quotient group is indeed a group.
''theorem'' <nowiki>Group_ZF_2_4_T1</nowiki>:
'' assumes '' $ \text{IsAgroup}(G,P)$ ''and '' $ IsAnormalSubgroup(G,P,H)$ '' shows '' $ \text{IsAgroup}(G//QuotientGroupRel(G,P,H),QuotientGroupOp(G,P,H))$ ''using'' <nowiki>assms</nowiki> , <nowiki>group0_def</nowiki> , +++^[Group_ZF_2_4_L3 | Group_ZF_2 ]... ''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_4_L3</nowiki>: ''assumes '' $ IsAsubgroup(H,P)$ '' shows '' $ equiv(G,QuotientGroupRel(G,P,H))$ === , +++^[IsAnormalSubgroup_def | Group_ZF_2 ]... Definition of <nowiki>IsAnormalSubgroup</nowiki>:
$ IsAnormalSubgroup(G,P,N) \equiv IsAsubgroup(N,P) \wedge $
$ (\forall n\in N.\ \forall g\in G.\ P\langle P\langle g,n \rangle ,GroupInv(G,P)(g) \rangle \in N)$=== , +++^[Group_ZF_2_4_L5A | Group_ZF_2 ]... ''lemma'' <nowiki>Group_ZF_2_4_L5A</nowiki>: ''assumes '' $ \text{IsAgroup}(G,P)$ ''and'' $ IsAnormalSubgroup(G,P,H)$ '' shows '' $ Congruent2(QuotientGroupRel(G,P,H),P)$ === , +++^[Group_ZF_3_T2 | Group_ZF_2 ]... ''theorem'' ''(in'' group0'')'' <nowiki>Group_ZF_3_T2</nowiki>: ''assumes '' $ equiv(G,r)$ ''and'' $ Congruent2(r,P)$ '' shows '' $ \text{IsAgroup}(G//r,ProjFun2(G,r,P))$ === , +++^[QuotientGroupOp_def | Group_ZF_2 ]... Definition of <nowiki>QuotientGroupOp</nowiki>:
$ QuotientGroupOp(G,P,H) \equiv ProjFun2(G,QuotientGroupRel(G,P,H ),P)$===
The class (coset) of the neutral element is the neutral element of the quotient group.
''lemma'' <nowiki>Group_ZF_2_4_L5B</nowiki>:
'' assumes '' $ \text{IsAgroup}(G,P)$ ''and '' $ IsAnormalSubgroup(G,P,H)$ ''and '' $ r = QuotientGroupRel(G,P,H)$ ''and '' $ e = TheNeutralElement(G,P)$ '' shows '' $ r\{e\} = TheNeutralElement(G//r,QuotientGroupOp(G,P,H))$ ''using'' <nowiki>assms</nowiki> , +++^[IsAnormalSubgroup_def | Group_ZF_2 ]... Definition of <nowiki>IsAnormalSubgroup</nowiki>:
$ IsAnormalSubgroup(G,P,N) \equiv IsAsubgroup(N,P) \wedge $
$ (\forall n\in N.\ \forall g\in G.\ P\langle P\langle g,n \rangle ,GroupInv(G,P)(g) \rangle \in N)$=== , <nowiki>group0_def</nowiki> , +++^[IsAgroup_def | Group_ZF ]... Definition of <nowiki>IsAgroup</nowiki>:
$ \text{IsAgroup}(G,f) \equiv $
$ (\text{IsAmonoid}(G,f) \wedge (\forall g\in G.\ \exists b\in G.\ f\langle g,b\rangle = TheNeutralElement(G,f)))$=== , +++^[Group_ZF_2_4_L3 | Group_ZF_2 ]... ''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_4_L3</nowiki>: ''assumes '' $ IsAsubgroup(H,P)$ '' shows '' $ equiv(G,QuotientGroupRel(G,P,H))$ === , +++^[Group_ZF_2_4_L5A | Group_ZF_2 ]... ''lemma'' <nowiki>Group_ZF_2_4_L5A</nowiki>: ''assumes '' $ \text{IsAgroup}(G,P)$ ''and'' $ IsAnormalSubgroup(G,P,H)$ '' shows '' $ Congruent2(QuotientGroupRel(G,P,H),P)$ === , +++^[QuotientGroupOp_def | Group_ZF_2 ]... Definition of <nowiki>QuotientGroupOp</nowiki>:
$ QuotientGroupOp(G,P,H) \equiv ProjFun2(G,QuotientGroupRel(G,P,H ),P)$=== , +++^[Group_ZF_2_2_L1 | Group_ZF_2 ]... ''lemma'' <nowiki>Group_ZF_2_2_L1</nowiki>: ''assumes '' $ \text{IsAmonoid}(G,f)$ ''and'' $ equiv(G,r)$ ''and'' $ Congruent2(r,f)$ ''and'' $ F = ProjFun2(G,r,f)$ ''and'' $ e = TheNeutralElement(G,f)$ '' shows '' $ r\{e\} = TheNeutralElement(G//r,F)$ ===
A group element is equivalent to the neutral element iff it is in the subgroup we divide the group by.
''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_4_L5C</nowiki>:
'' assumes '' $ a\in G$ '' shows '' $ \langle a,1 \rangle \in QuotientGroupRel(G,P,H) \longleftrightarrow a\in H$ ''using'' <nowiki>assms</nowiki> , +++^[QuotientGroupRel_def | Group_ZF_2 ]... Definition of <nowiki>QuotientGroupRel</nowiki>:
$ QuotientGroupRel(G,P,H) \equiv $
$ \{\langle a,b\rangle \in G\times G.\ P\langle a, GroupInv(G,P)(b)\rangle \in H\}$=== , +++^[group_inv_of_one | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group_inv_of_one</nowiki>: '' shows '' $ 1 ^{-1} = 1 $ === , +++^[group0_2_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L2</nowiki>: '' shows '' $ 1 \in G \wedge (\forall g\in G.\ (1 \cdot g = g \wedge g\cdot 1 = g))$ ===
A group element is in $H$ iff its class is the neutral element of $G/H$.
''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_4_L5D</nowiki>:
'' assumes '' A1: $ IsAnormalSubgroup(G,P,H)$ ''and '' A2: $ a\in G$ ''and '' A3: $ r = QuotientGroupRel(G,P,H)$ ''and '' A4: $ TheNeutralElement(G//r,QuotientGroupOp(G,P,H)) = e$ '' shows '' $ r\{a\} = e \longleftrightarrow \langle a,1 \rangle \in r$+++[proof ]>
''assume '' $ r\{a\} = e$
''with '' groupAssum, assms ''have'' $ r\{1 \} = r\{a\}$ ''and '' I: $ equiv(G,r)$ ''using'' +++^[Group_ZF_2_4_L5B | Group_ZF_2 ]... ''lemma'' <nowiki>Group_ZF_2_4_L5B</nowiki>: ''assumes '' $ \text{IsAgroup}(G,P)$ ''and'' $ IsAnormalSubgroup(G,P,H)$ ''and'' $ r = QuotientGroupRel(G,P,H)$ ''and'' $ e = TheNeutralElement(G,P)$ '' shows '' $ r\{e\} = TheNeutralElement(G//r,QuotientGroupOp(G,P,H))$ === , +++^[IsAnormalSubgroup_def | Group_ZF_2 ]... Definition of <nowiki>IsAnormalSubgroup</nowiki>:
$ IsAnormalSubgroup(G,P,N) \equiv IsAsubgroup(N,P) \wedge $
$ (\forall n\in N.\ \forall g\in G.\ P\langle P\langle g,n \rangle ,GroupInv(G,P)(g) \rangle \in N)$=== , +++^[Group_ZF_2_4_L3 | Group_ZF_2 ]... ''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_4_L3</nowiki>: ''assumes '' $ IsAsubgroup(H,P)$ '' shows '' $ equiv(G,QuotientGroupRel(G,P,H))$ ===
''with '' A2 ''have'' $ \langle 1 ,a\rangle \in r$ ''using'' <nowiki>eq_equiv_class</nowiki>
''with '' I ''show'' $ \langle a,1 \rangle \in r$ '' by (rule '' +++^[equiv_is_sym | Fol1 ]... ''lemma'' <nowiki>equiv_is_sym</nowiki>: ''assumes '' $ equiv(X,r)$ ''and'' $ \langle x,y\rangle \in r$ '' shows '' $ \langle y,x\rangle \in r$ === '')''
''next ''
''assume '' $ \langle a,1 \rangle \in r$
''moreover'' ''from '' A1, A3 ''have'' $ equiv(G,r)$ ''using'' +++^[IsAnormalSubgroup_def | Group_ZF_2 ]... Definition of <nowiki>IsAnormalSubgroup</nowiki>:
$ IsAnormalSubgroup(G,P,N) \equiv IsAsubgroup(N,P) \wedge $
$ (\forall n\in N.\ \forall g\in G.\ P\langle P\langle g,n \rangle ,GroupInv(G,P)(g) \rangle \in N)$=== , +++^[Group_ZF_2_4_L3 | Group_ZF_2 ]... ''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_4_L3</nowiki>: ''assumes '' $ IsAsubgroup(H,P)$ '' shows '' $ equiv(G,QuotientGroupRel(G,P,H))$ ===
''ultimately '' ''have'' $ r\{a\} = r\{1 \}$ ''using'' <nowiki>equiv_class_eq</nowiki>
''with '' groupAssum, A1, A3, A4 ''show'' $ r\{a\} = e$ ''using'' +++^[Group_ZF_2_4_L5B | Group_ZF_2 ]... ''lemma'' <nowiki>Group_ZF_2_4_L5B</nowiki>: ''assumes '' $ \text{IsAgroup}(G,P)$ ''and'' $ IsAnormalSubgroup(G,P,H)$ ''and'' $ r = QuotientGroupRel(G,P,H)$ ''and'' $ e = TheNeutralElement(G,P)$ '' shows '' $ r\{e\} = TheNeutralElement(G//r,QuotientGroupOp(G,P,H))$ ===
''qed'' ===
The class of $a\in G$ is the neutral element of the quotient $G/H$ iff $a\in H$.
''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_4_L5E</nowiki>:
'' assumes '' $ IsAnormalSubgroup(G,P,H)$ ''and '' $ a\in G$ ''and '' $ r = QuotientGroupRel(G,P,H)$ ''and '' $ TheNeutralElement(G//r,QuotientGroupOp(G,P,H)) = e$ '' shows '' $ r\{a\} = e \longleftrightarrow a\in H$ ''using'' <nowiki>assms</nowiki> , +++^[Group_ZF_2_4_L5C | Group_ZF_2 ]... ''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_4_L5C</nowiki>: ''assumes '' $ a\in G$ '' shows '' $ \langle a,1 \rangle \in QuotientGroupRel(G,P,H) \longleftrightarrow a\in H$ === , +++^[Group_ZF_2_4_L5D | Group_ZF_2 ]... ''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_4_L5D</nowiki>: ''assumes '' $ IsAnormalSubgroup(G,P,H)$ ''and'' $ a\in G$ ''and'' $ r = QuotientGroupRel(G,P,H)$ ''and'' $ TheNeutralElement(G//r,QuotientGroupOp(G,P,H)) = e$ '' shows '' $ r\{a\} = e \longleftrightarrow \langle a,1 \rangle \in r$ ===
Essential condition to show that every subgroup of an abelian group is normal.
''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_4_L5</nowiki>:
'' assumes '' A1: $ P \text{ is commutative on } G$ ''and '' A2: $ IsAsubgroup(H,P)$ ''and '' A3: $ g\in G$, $ h\in H$ '' shows '' $ g\cdot h\cdot g^{-1} \in H$+++[proof ]>
''from '' A2, A3 ''have'' T1: $ h\in G$, $ g^{-1} \in G$ ''using'' +++^[group0_3_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_3_L2</nowiki>: ''assumes '' $ IsAsubgroup(H,P)$ '' shows '' $ H \subseteq G$ === , +++^[inverse_in_group | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>inverse_in_group</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x^{-1}\in G$ ===
''with '' A3, A1 ''have'' $ g\cdot h\cdot g^{-1} = g^{-1}\cdot g\cdot h$ ''using'' +++^[group0_4_L4A | AbelianGroup_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_4_L4A</nowiki>: ''assumes '' $ P \text{ is commutative on } G$ ''and'' $ a\in G$, $ b\in G$, $ c\in G$ '' shows '' $ a\cdot b\cdot c = c\cdot a\cdot b$,
$ a^{-1}\cdot (b^{-1}\cdot c^{-1})^{-1} = (a\cdot (b\cdot c)^{-1})^{-1}$,
$ a\cdot (b\cdot c)^{-1} = a\cdot b^{-1}\cdot c^{-1}$,
$ a\cdot (b\cdot c^{-1})^{-1} = a\cdot b^{-1}\cdot c$,
$ a\cdot b^{-1}\cdot c^{-1} = a\cdot c^{-1}\cdot b^{-1}$ ===
''with '' A3, T1 ''show'' $ thesis$ ''using'' +++^[group0_2_L6 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L6</nowiki>: ''assumes '' $ x\in G$ '' shows '' $ x\cdot x^{-1} = 1 \wedge x^{-1}\cdot x = 1 $ === , +++^[group0_2_L2 | Group_ZF ]... ''lemma'' ''(in'' group0'')'' <nowiki>group0_2_L2</nowiki>: '' shows '' $ 1 \in G \wedge (\forall g\in G.\ (1 \cdot g = g \wedge g\cdot 1 = g))$ ===
''qed'' ===
Every subgroup of an abelian group is normal. Moreover, the quotient group is also abelian.
''lemma'' <nowiki>Group_ZF_2_4_L6</nowiki>:
'' assumes '' A1: $ \text{IsAgroup}(G,P)$ ''and '' A2: $ P \text{ is commutative on } G$ ''and '' A3: $ IsAsubgroup(H,P)$ '' shows '' $ IsAnormalSubgroup(G,P,H)$, $ QuotientGroupOp(G,P,H) \text{ is commutative on } (G//QuotientGroupRel(G,P,H))$+++[proof ]>
''from '' A1, A2, A3 ''show'' T1: $ IsAnormalSubgroup(G,P,H)$ ''using'' <nowiki>group0_def</nowiki> , +++^[IsAnormalSubgroup_def | Group_ZF_2 ]... Definition of <nowiki>IsAnormalSubgroup</nowiki>:
$ IsAnormalSubgroup(G,P,N) \equiv IsAsubgroup(N,P) \wedge $
$ (\forall n\in N.\ \forall g\in G.\ P\langle P\langle g,n \rangle ,GroupInv(G,P)(g) \rangle \in N)$=== , +++^[Group_ZF_2_4_L5 | Group_ZF_2 ]... ''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_4_L5</nowiki>: ''assumes '' $ P \text{ is commutative on } G$ ''and'' $ IsAsubgroup(H,P)$ ''and'' $ g\in G$, $ h\in H$ '' shows '' $ g\cdot h\cdot g^{-1} \in H$ ===
''let '' $ r = QuotientGroupRel(G,P,H)$
''from '' A1, A3, T1 ''have'' $ equiv(G,r)$, $ Congruent2(r,P)$ ''using'' <nowiki>group0_def</nowiki> , +++^[Group_ZF_2_4_L3 | Group_ZF_2 ]... ''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_4_L3</nowiki>: ''assumes '' $ IsAsubgroup(H,P)$ '' shows '' $ equiv(G,QuotientGroupRel(G,P,H))$ === , +++^[Group_ZF_2_4_L5A | Group_ZF_2 ]... ''lemma'' <nowiki>Group_ZF_2_4_L5A</nowiki>: ''assumes '' $ \text{IsAgroup}(G,P)$ ''and'' $ IsAnormalSubgroup(G,P,H)$ '' shows '' $ Congruent2(QuotientGroupRel(G,P,H),P)$ ===
''with '' A2 ''show'' $ QuotientGroupOp(G,P,H) \text{ is commutative on } (G//QuotientGroupRel(G,P,H))$ ''using'' +++^[EquivClass_2_T1 | EquivClass1 ]... ''theorem'' <nowiki>EquivClass_2_T1</nowiki>: ''assumes '' $ equiv(A,r)$ ''and'' $ Congruent2(r,f)$ ''and'' $ f \text{ is commutative on } A$ '' shows '' $ ProjFun2(A,r,f) \text{ is commutative on } A//r$ === , +++^[QuotientGroupOp_def | Group_ZF_2 ]... Definition of <nowiki>QuotientGroupOp</nowiki>:
$ QuotientGroupOp(G,P,H) \equiv ProjFun2(G,QuotientGroupRel(G,P,H ),P)$===
''qed'' ===
The group inverse (in the quotient group) of a class (coset) is the class of the inverse.
''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_4_L7</nowiki>:
'' assumes '' $ IsAnormalSubgroup(G,P,H)$ ''and '' $ a\in G$ ''and '' $ r = QuotientGroupRel(G,P,H)$ ''and '' $ F = QuotientGroupOp(G,P,H)$ '' shows '' $ r\{a^{-1}\} = GroupInv(G//r,F)(r\{a\})$ ''using'' <nowiki>groupAssum</nowiki> , <nowiki>assms</nowiki> , +++^[IsAnormalSubgroup_def | Group_ZF_2 ]... Definition of <nowiki>IsAnormalSubgroup</nowiki>:
$ IsAnormalSubgroup(G,P,N) \equiv IsAsubgroup(N,P) \wedge $
$ (\forall n\in N.\ \forall g\in G.\ P\langle P\langle g,n \rangle ,GroupInv(G,P)(g) \rangle \in N)$=== , +++^[Group_ZF_2_4_L3 | Group_ZF_2 ]... ''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_4_L3</nowiki>: ''assumes '' $ IsAsubgroup(H,P)$ '' shows '' $ equiv(G,QuotientGroupRel(G,P,H))$ === , +++^[Group_ZF_2_4_L5A | Group_ZF_2 ]... ''lemma'' <nowiki>Group_ZF_2_4_L5A</nowiki>: ''assumes '' $ \text{IsAgroup}(G,P)$ ''and'' $ IsAnormalSubgroup(G,P,H)$ '' shows '' $ Congruent2(QuotientGroupRel(G,P,H),P)$ === , +++^[QuotientGroupOp_def | Group_ZF_2 ]... Definition of <nowiki>QuotientGroupOp</nowiki>:
$ QuotientGroupOp(G,P,H) \equiv ProjFun2(G,QuotientGroupRel(G,P,H ),P)$=== , +++^[Group_ZF_2_2_L4 | Group_ZF_2 ]... ''lemma'' ''(in'' group0'')'' <nowiki>Group_ZF_2_2_L4</nowiki>: ''assumes '' $ equiv(G,r)$ ''and'' $ Congruent2(r,P)$ ''and'' $ F = ProjFun2(G,r,P)$ ''and'' $ a\in G$ '' shows '' $ r\{a^{-1}\} = GroupInv(G//r,F)(r\{a\})$ ===
!Function spaces as monoids
On every space of functions $\{f : X\rightarrow X\}$ we can define a natural monoid structure with composition as the operation. This section explores this fact.
The next lemma states that composition has a neutral element, namely the identity function on $X$ (the one that maps $x\in X$ into itself).
''lemma'' <nowiki>Group_ZF_2_5_L1</nowiki>:
'' assumes '' A1: $ F = Composition(X)$ '' shows '' $ \exists I\in (X\rightarrow X).\ \forall f\in (X\rightarrow X).\ F\langle I,f\rangle = f \wedge F\langle f,I\rangle = f$+++[proof ]>
''let '' $ I = id(X)$
''from '' A1 ''have'' $ I \in X\rightarrow X \wedge (\forall f\in (X\rightarrow X).\ F\langle I,f\rangle = f \wedge F\langle f,I\rangle = f)$ ''using'' <nowiki>id_type</nowiki> , +++^[func_ZF_6_L1A | func_ZF ]... ''lemma'' <nowiki>func_ZF_6_L1A</nowiki>: ''assumes '' $ f : X\rightarrow X$ '' shows '' $ Composition(X)\langle f,id(X)\rangle = f$, $ Composition(X)\langle id(X),f\rangle = f$ ===
''thus'' $ thesis$
''qed'' ===
The space of functions that map a set $X$ into itsef is a monoid with composition as operation and the identity function as the neutral element.
''lemma'' <nowiki>Group_ZF_2_5_L2</nowiki>:
'' shows '' $ \text{IsAmonoid}(X\rightarrow X,Composition(X))$, $ id(X) = TheNeutralElement(X\rightarrow X,Composition(X))$+++[proof ]>
''let '' $ I = id(X)$
''let '' $ F = Composition(X)$
''show'' $ \text{IsAmonoid}(X\rightarrow X,Composition(X))$ ''using'' +++^[func_ZF_5_L5 | func_ZF ]... ''lemma'' <nowiki>func_ZF_5_L5</nowiki>: '' shows '' $ Composition(X) \text{ is associative on } (X\rightarrow X)$ === , +++^[Group_ZF_2_5_L1 | Group_ZF_2 ]... ''lemma'' <nowiki>Group_ZF_2_5_L1</nowiki>: ''assumes '' $ F = Composition(X)$ '' shows '' $ \exists I\in (X\rightarrow X).\ \forall f\in (X\rightarrow X).\ F\langle I,f\rangle = f \wedge F\langle f,I\rangle = f$
=== , +++^[IsAmonoid_def | Monoid_ZF ]... Definition of <nowiki>IsAmonoid</nowiki>:
$ \text{IsAmonoid}(G,f) \equiv $
$ f \text{ is associative on } G \wedge $
$ (\exists e\in G.\ (\forall g\in G.\ ( (f(\langle e,g\rangle ) = g) \wedge (f(\langle g,e\rangle ) = g))))$===
''then '' ''have'' $ monoid0(X\rightarrow X,F)$ ''using'' <nowiki>monoid0_def</nowiki>
''moreover'' ''have'' $ I \in X\rightarrow X \wedge (\forall f\in (X\rightarrow X).\ F\langle I,f\rangle = f \wedge F\langle f,I\rangle = f)$ ''using'' <nowiki>id_type</nowiki> , +++^[func_ZF_6_L1A | func_ZF ]... ''lemma'' <nowiki>func_ZF_6_L1A</nowiki>: ''assumes '' $ f : X\rightarrow X$ '' shows '' $ Composition(X)\langle f,id(X)\rangle = f$, $ Composition(X)\langle id(X),f\rangle = f$ ===
''ultimately '' ''show'' $ I = TheNeutralElement(X\rightarrow X,F)$ ''using'' +++^[group0_1_L4 | Monoid_ZF ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>group0_1_L4</nowiki>: ''assumes '' $ e \in G \wedge (\forall g\in G.\ e \oplus g = g \wedge g \oplus e = g)$ '' shows '' $ e = TheNeutralElement(G,f)$ ===
''qed'' ===
''end
'' +++![Comments on Group_ZF_2|click to add comment] <html> <div> <iframe style="width:60%;height:500px" src="http://www.haloscan.com/comments/slawekk/Group_ZF_2"></iframe> </div> </html>
===
/***
|Name|InlineJavascriptPlugin|
|Source|http://www.TiddlyTools.com/#InlineJavascriptPlugin|
|Documentation|http://www.TiddlyTools.com/#InlineJavascriptPluginInfo|
|Version|1.9.3|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|Insert Javascript executable code directly into your tiddler content.|
''Call directly into TW core utility routines, define new functions, calculate values, add dynamically-generated TiddlyWiki-formatted output'' into tiddler content, or perform any other programmatic actions each time the tiddler is rendered.
!!!!!Documentation
>see [[InlineJavascriptPluginInfo]]
!!!!!Revisions
<<<
2008.06.11 [1.9.3] added $(...) function as 'shorthand' convenience syntax for document.getElementById()
2008.03.03 [1.9.2] corrected declaration of wikifyPlainText() for 'TW 2.1.x compatibility fallback' (fixes Safari "parse error")
2008.02.23 [1.9.1] in onclick function, use string instead of array for 'bufferedHTML' attribute on link element (fixes IE errors)
2008.02.21 [1.9.0] 'onclick' scripts now allow returned text (or document.write() calls) to be wikified into a span that immediately follows the onclick link. Also, added default 'return false' handling if no return value provided (prevents HREF from being triggered -- return TRUE to allow HREF to be processed). Thanks to Xavier Verges for suggestion and preliminary code.
|please see [[InlineJavascriptPluginInfo]] for additional revision details|
2005.11.08 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.InlineJavascriptPlugin= {major: 1, minor: 9, revision: 3, date: new Date(2008,6,11)};
config.formatters.push( {
name: "inlineJavascript",
match: "\\<script",
lookahead: "\\<script(?: src=\\\"((?:.|\\n)*?)\\\")?(?: label=\\\"((?:.|\\n)*?)\\\")?(?: title=\\\"((?:.|\\n)*?)\\\")?(?: key=\\\"((?:.|\\n)*?)\\\")?( show)?\\>((?:.|\\n)*?)\\</script\\>",
handler: function(w) {
var lookaheadRegExp = new RegExp(this.lookahead,"mg");
lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = lookaheadRegExp.exec(w.source)
if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
var src=lookaheadMatch[1];
var label=lookaheadMatch[2];
var tip=lookaheadMatch[3];
var key=lookaheadMatch[4];
var show=lookaheadMatch[5];
var code=lookaheadMatch[6];
if (src) { // load a script library
// make script tag, set src, add to body to execute, then remove for cleanup
var script = document.createElement("script"); script.src = src;
document.body.appendChild(script); document.body.removeChild(script);
}
if (code) { // there is script code
if (show) // show inline script code in tiddler output
wikify("{{{\n"+lookaheadMatch[0]+"\n}}}\n",w.output);
if (label) { // create a link to an 'onclick' script
// add a link, define click handler, save code in link (pass 'place'), set link attributes
var link=createTiddlyElement(w.output,"a",null,"tiddlyLinkExisting",wikifyPlainText(label));
var fixup=code.replace(/document.write\s*\(/gi,'place.bufferedHTML+=(');
link.code="function _out(place){"+fixup+"\n};_out(this);"
link.tiddler=w.tiddler;
link.onclick=function(){
this.bufferedHTML="";
try{ var r=eval(this.code);
if(this.bufferedHTML.length || (typeof(r)==="string")&&r.length)
var s=this.parentNode.insertBefore(document.createElement("span"),this.nextSibling);
if(this.bufferedHTML.length)
s.innerHTML=this.bufferedHTML;
if((typeof(r)==="string")&&r.length) {
wikify(r,s,null,this.tiddler);
return false;
} else return r!==undefined?r:false;
} catch(e){alert(e.description||e.toString());return false;}
};
link.setAttribute("title",tip||"");
var URIcode='javascript:void(eval(decodeURIComponent(%22(function(){try{';
URIcode+=encodeURIComponent(encodeURIComponent(code.replace(/\n/g,' ')));
URIcode+='}catch(e){alert(e.description||e.toString())}})()%22)))';
link.setAttribute("href",URIcode);
link.style.cursor="pointer";
if (key) link.accessKey=key.substr(0,1); // single character only
}
else { // run inline script code
var fixup=code.replace(/document.write\s*\(/gi,'place.innerHTML+=(');
var code="function _out(place){"+fixup+"\n};_out(w.output);"
try { var out=eval(code); } catch(e) { out=e.description?e.description:e.toString(); }
if (out && out.length) wikify(out,w.output,w.highlightRegExp,w.tiddler);
}
}
w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
}
}
} )
//}}}
// // Backward-compatibility for TW2.1.x and earlier
//{{{
if (typeof(wikifyPlainText)=="undefined") window.wikifyPlainText=function(text,limit,tiddler) {
if(limit > 0) text = text.substr(0,limit);
var wikifier = new Wikifier(text,formatter,null,tiddler);
return wikifier.wikifyPlain();
}
//}}}
// // $(...) function: 'shorthand' convenience syntax for document.getElementById()
//{{{
if (typeof($)=="undefined") { // avoid redefinition
function $() {
var elements=new Array();
for (var i=0; i<arguments.length; i++) {
var element=arguments[i];
if (typeof element=='string') element=document.getElementById(element);
if (arguments.length==1) return element;
elements.push(element);
}
return elements;
}
}
//}}}
''theory'' Introduction ''imports'' [[equalities]]
''begin
''
This theory does not contain any formalized mathematics used in other theories, but is an introduction to IsarMathLib project.
!How to read IsarMathLib proofs - a tutorial
Isar (the Isabelle's formal proof language) was designed to be similar to the standard language of mathematics. Any person able to read proofs in a typical mathematical paper should be able to read and understand Isar proofs without having to learn a special proof language. However, Isar is a formal proof language and as such it does contain a couple of constructs whose meaning is hard to guess. In this tutorial we will define a notion and prove an example theorem about that notion, explaining Isar syntax along the way. This tutorial may also serve as a style guide for IsarMathLib contributors. Note that this tutorial aims to help in reading the presentation of the Isar language that is used in IsarMathLib proof document and TiddlyWiki rendering on the Tiddly Formal Math site, but does not teach how to write proofs that can be verified by Isabelle. This presentation is different than the source processed by Isabelle (the concept that the source and presentation look different should be familiar to any LaTeX user). To learn how to write Isar proofs one needs to study the source of this tutorial as well.
The first thing that mathematicians typically do is to define notions. In Isar this is done with the //definition// keyword. In our case we define a notion of two sets being disjoint. We will use the infix notation, i.e. the string $ \text{ is disjoint with }$ put between two sets to denote our notion of disjointness. The left side of the $ \equiv $ symbol is the notion being defined, the right side says how we define it. In Isabelle //0// is used to denote both zero (of natural numbers) and the empty set, which is not surprising as those two things are the same in set theory.
''Definition
'' $ A \text{ is disjoint with } B \equiv A \cap B = 0$
We are ready to prove a theorem. Here we show that the relation of being disjoint is symmetric. We start with one of the keywords ''theorem'', ''lemma'' or ''corollary''. In Isar they are synonymous. Then we provide a name for the theorem. In standard mathematics theorems are numbered. In Isar we can do that too, but it is considered better to give theorems meaningful names. After the ''shows'' keyword we give the statement to show. The $ \longleftrightarrow $ symbol denotes the equivalence in Isabelle/ZF. Here we want to show that "A is disjoint with B iff and only if B is disjoint with A". To prove this fact we show two implications - the first one that $ A \text{ is disjoint with } B$ implies $ B \text{ is disjoint with } A$ and then the converse one. Each of these implications is formulated as a statement to be proved and then proved in a subproof like a mini-theorem. Each subproof uses a proof block to show the implication. Proof blocks are delimited with curly brackets in Isar. Proof block is one of the constructs that does not exist in informal mathematics, so it may be confusing. When reading a proof containing a proof block I suggest to focus first on what is that we are proving in it. This can be done by looking at the first line or two of the block and then at the last statement. In our case the block starts with "assume $ A \text{ is disjoint with } B$ and the last statement is "then have $ B \text{ is disjoint with } A$". It is a typical pattern when someone needs to prove an implication: one assumes the antecedent and then shows that the consequent follows from this assumption. Implications are denoted with the $ \longrightarrow $ symbol in Isabelle. After we prove both implications we collect them using the ''moreover'' construct. The keyword ''ultimately'' indicates that what follows is the conclusion of the statements collected with ''moreover''. The ''show'' keyword is like ''have'', except that it indicates that we have arrived at the claim of the theorem (or a subproof).
''theorem'' <nowiki>disjointness_symetric</nowiki>:
'' shows '' $ A \text{ is disjoint with } B \longleftrightarrow B \text{ is disjoint with } A$+++[proof ]>
''have'' $ A \text{ is disjoint with } B \longrightarrow B \text{ is disjoint with } A$+++[proof ]>
++++[{ ]>
''assume '' $ A \text{ is disjoint with } B$
''then '' ''have'' $ A \cap B = 0$ ''using'' +++^[AreDisjoint_def | Introduction ]... Definition of <nowiki>AreDisjoint</nowiki>:
$ A \text{ is disjoint with } B \equiv A \cap B = 0$===
''hence'' $ B \cap A = 0$
''then '' ''have'' $ B \text{ is disjoint with } A$ ''using'' +++^[AreDisjoint_def | Introduction ]... Definition of <nowiki>AreDisjoint</nowiki>:
$ A \text{ is disjoint with } B \equiv A \cap B = 0$===
=== ''}''
''thus'' $ thesis$
''qed'' ===
''moreover'' ''have'' $ B \text{ is disjoint with } A \longrightarrow A \text{ is disjoint with } B$+++[proof ]>
++++[{ ]>
''assume '' $ B \text{ is disjoint with } A$
''then '' ''have'' $ B \cap A = 0$ ''using'' +++^[AreDisjoint_def | Introduction ]... Definition of <nowiki>AreDisjoint</nowiki>:
$ A \text{ is disjoint with } B \equiv A \cap B = 0$===
''hence'' $ A \cap B = 0$
''then '' ''have'' $ A \text{ is disjoint with } B$ ''using'' +++^[AreDisjoint_def | Introduction ]... Definition of <nowiki>AreDisjoint</nowiki>:
$ A \text{ is disjoint with } B \equiv A \cap B = 0$===
=== ''}''
''thus'' $ thesis$
''qed'' ===
''ultimately '' ''show'' $ thesis$
''qed'' ===
!Overview of the project
The //Fol1//, // ZF1// and //Nat_ZF_IML// theory files contain some background material that is needed for the remaining theories. //Order_ZF// and //Order_ZF_1a// reformulate material from standard Isabelle's //Order// theory in terms of non-strict (less-or-equal) order relations. //Order_ZF_1// on the other hand directly continues the //Order// theory file using strict order relations (less and not equal). This is useful for translating theorems from Metamath. In //NatOrder_ZF// we prove that the usual order on natural numbers is linear.
The //func1// theory provides basic facts about functions. //func_ZF// continues this development with more advanced topics that relate to algebraic properties of binary operations, like lifting a binary operation to a function space, associative, commutative and distributive operations and properties of functions related to order relations. //func_ZF_1// is about properties of functions related to order relations. The standard Isabelle's //Finite// theory defines the finite powerset of a set as a certain "datatype" (?) with some recursive properties. IsarMathLib's //Finite1// and //Finite_ZF_1// theories develop more facts about this notion. These two theories are obsolete now. They will be gradually replaced by an approach based on set theory rather than tools specific to Isabelle. This approach is presented in //Finite_ZF// theory file. In //FinOrd_ZF// we talk about ordered finite sets. The //EquivClass1// theory file is a reformulation of the material in the standard Isabelle's //EquivClass// theory in the spirit of ZF set theory.
//FiniteSeq_ZF// discusses the notion of finite sequences (a.k.a. lists). //InductiveSeq_ZF// provides the definition and properties of (what is known in basic calculus as) sequences defined by induction, i. e. by a formula of the form $a_0 = x,\ a_{n+1} = f(a_n)$. //Fold_ZF// shows how the familiar from functional programming notion of fold can be interpreted in set theory. //Partitions_ZF// is about splitting a set into non-overlapping subsets. This is a common trick in proofs. //Semigroup_ZF// treats the expressions of the form $a_0\cdot a_1\cdot .. \cdot a_n$, (i.e. products of finite sequences), where "$\cdot$" is an associative binary operation. The //Topology_ZF// series covers basics of general topology: interior, closure, boundary, compact sets, separation axioms and continuous functions.
//Group_ZF//, //Group_ZF_1//, //Group_ZF_1b// and //Group_ZF_2// provide basic facts of the group theory. //Group_ZF_3// considers the notion of almost homomorphisms that is nedeed for the real numbers construction in //Real_ZF//. In //DirectProduct_ZF// we define direct product of groups and show some its basic properties. The //OrderedGroup_ZF// theory treats ordered groups. This is a suprisingly large theory for such relatively obscure topic.
//Ring_ZF// defines rings. //Ring_ZF_1// covers the properties of rings that are specific to the real numbers construction in //Real_ZF//. The //OrderedRing_ZF// theory looks at the consequences of adding a linear order to the ring algebraic structure.
//Field_ZF// and //OrderedField_ZF// contain basic facts about (you guessed it) fields and ordered fields.
//Int_ZF_IML// theory considers the integers as a monoid (multiplication) and an abelian ordered group (addition). In //Int_ZF_1// we show that integers form a commutative ring. //Int_ZF_2// contains some facts about slopes (almost homomorphisms on integers) needed for real numbers construction, used in //Real_ZF_1//. In the //IntDiv_ZF_IML// theory translates some properties of the integer quotient and reminder functions studied in the standard Isabelle's //IntDiv_ZF// theory to the notation used in IsarMathLib.
The //Real_ZF// and //Real_ZF_1// theories contain the construction of real numbers based on the paper \cite{Arthan2004} by R. D. Arthan (not Cauchy sequences, not Dedekind sections). The heavy lifting is done mostly in //Group_ZF_3//, //Ring_ZF_1// and //Int_ZF_2//. //Real_ZF// contains the part of the construction that can be done starting from generic abelian groups (rather than additive group of integers). This allows to show that real numbers form a ring. //Real_ZF_1// continues the construction using properties specific to the integers and showing that real numbers constructed this way form a complete ordered field. In //Complex_ZF// we construct complex numbers starting from a complete ordered field (a model of real numbers). We also define the notation for writing about complex numbers and prove that the structure of complex numbers constructed there satisfies the axioms of complex numbers used in Metamath. //MMI_prelude// defines the //mmisar0// context in which most theorems translated from Metamath are proven. It also contains a chapter explaining how the translation works. In the //Metamath_interface// theory we prove a theorem that the //mmisar0// context is valid (can be used) in the //complex0// context. All theories using the translated results will import the //Metamath_interface// theory. The //Metamath_sampler// theory provides some examples of using the translated theorems in the //complex0// context. The theories //MMI_logic_and_sets//, //MMI_Complex//, //MMI_Complex_1// and //MMI_Complex_2// contain the theorems imported from the Metamath's set.mm database. As the translated proofs are rather verbose these theories are not printed in this proof document. The full list of translated facts can be found in the //Metamath_theorems.txt// file included in the IsarMathLib distribution. The //MMI_examples// provides some theorems imported from Metamath that are printed in this proof document as examples of how translated proofs look like.
''end
'' +++![Comments on Introduction|click to add comment] <html> <div> <iframe style="width:60%;height:500px" src="http://www.haloscan.com/comments/slawekk/Introduction"></iframe> </div> </html>
===
/***
|''Name:''|LoadRemoteFileThroughProxy (previous LoadRemoteFileHijack)|
|''Description:''|When the TiddlyWiki file is located on the web (view over http) the content of [[SiteProxy]] tiddler is added in front of the file url. If [[SiteProxy]] does not exist "/proxy/" is added. |
|''Version:''|1.1.0|
|''Date:''|mar 17, 2007|
|''Source:''|http://tiddlywiki.bidix.info/#LoadRemoteFileHijack|
|''Author:''|BidiX (BidiX (at) bidix (dot) info)|
|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|
|''~CoreVersion:''|2.2.0|
***/
//{{{
version.extensions.LoadRemoteFileThroughProxy = {
major: 1, minor: 1, revision: 0,
date: new Date("mar 17, 2007"),
source: "http://tiddlywiki.bidix.info/#LoadRemoteFileThroughProxy"};
if (!window.bidix) window.bidix = {}; // bidix namespace
if (!bidix.core) bidix.core = {};
bidix.core.loadRemoteFile = loadRemoteFile;
loadRemoteFile = function(url,callback,params)
{
if ((document.location.toString().substr(0,4) == "http") && (url.substr(0,4) == "http")){
url = store.getTiddlerText("SiteProxy", "/proxy/") + url;
}
return bidix.core.loadRemoteFile(url,callback,params);
}
//}}}
AboutThisSite
GettingStarted
[[Introduction]]
[[Fol1]]
ZF1
Nat_ZF_IML
[[func1]]
[[func_ZF]]
Fold_ZF
EquivClass1
Finite_ZF
Partitions_ZF
Order_ZF
Order_ZF_1a
FinOrd_ZF
FinSupp_ZF
Topology_ZF
Topology_ZF_1
Topology_ZF_1b
Topology_ZF_2
Semigroup_ZF
Monoid_ZF
Group_ZF
Group_ZF_1
Group_ZF_1b
DirectProduct_ZF
AbelianGroup_ZF
Group_ZF_2
Ring_ZF
Field_ZF
[[Administration]]
''theory'' Monoid_ZF ''imports'' [[func_ZF]]
''begin
''
This theory provides basic facts about monoids.
!Definition and basic properties
In this section we talk about monoids. The notion of a monoid is similar to the notion of a semigroup except that we require the existence of a neutral element. It is also similar to the notion of group except that we don't require existence of the inverse.
Monoid is a set $G$ with an associative operation and a neutral element. The operation is a function on $G\times G$ with values in $G$. In the context of ZF set theory this means that it is a set of pairs $\langle x,y \rangle$, where $x\in G\times G$ and $y\in G$. In other words the operation is a certain subset of $(G\times G)\times G$. We express all this by defing a predicate $ \text{IsAmonoid}(G,f)$. Here $G$ is the ''carrier'' of the group and $f$ is the binary operation on it.
''Definition
'' $ \text{IsAmonoid}(G,f) \equiv $
$ f \text{ is associative on } G \wedge $
$ (\exists e\in G.\ (\forall g\in G.\ ( (f(\langle e,g\rangle ) = g) \wedge (f(\langle g,e\rangle ) = g))))$
The next locale called ''monoid0'' defines a context for theorems that concern monoids. In this contex we assume that the pair $(G,f)$ is a monoid. We will use the $ \oplus $ symbol to denote the monoid operation (for no particular reason).
''Locale '' monoid0
''assumes '' monoidAsssum: $ \text{IsAmonoid}(G,f)$
''defines '' $ a \oplus b \equiv f\langle a,b\rangle $
The result of the monoid operation is in the monoid (carrier).
''lemma'' ''(in'' monoid0'')'' <nowiki>group0_1_L1</nowiki>:
'' assumes '' $ a\in G$, $ b\in G$ '' shows '' $ a\oplus b \in G$ ''using'' <nowiki>assms</nowiki> , <nowiki>monoidAsssum</nowiki> , +++^[IsAmonoid_def | Monoid_ZF ]... Definition of <nowiki>IsAmonoid</nowiki>:
$ \text{IsAmonoid}(G,f) \equiv $
$ f \text{ is associative on } G \wedge $
$ (\exists e\in G.\ (\forall g\in G.\ ( (f(\langle e,g\rangle ) = g) \wedge (f(\langle g,e\rangle ) = g))))$=== , +++^[IsAssociative_def | func_ZF ]... Definition of <nowiki>IsAssociative</nowiki>:
$ P \text{ is associative on } G \equiv P : G\times G\rightarrow G \wedge $
$ (\forall x \in G.\ \forall y \in G.\ \forall z \in G.\ $
$ ( P(\langle P(\langle x,y\rangle ),z\rangle ) = P( \langle x,P(\langle y,z\rangle )\rangle )))$=== , <nowiki>apply_funtype</nowiki>
There is only one neutral element in monoid.
''lemma'' ''(in'' monoid0'')'' <nowiki>group0_1_L2</nowiki>:
'' shows '' $ \exists !e.\ e\in G \wedge (\forall g\in G.\ ( (e\oplus g = g) \wedge g\oplus e = g))$+++[proof ]>
''fix '' $ e$ $ y$
''assume '' $ e \in G \wedge (\forall g\in G.\ e \oplus g = g \wedge g \oplus e = g)$ ''and '' $ y \in G \wedge (\forall g\in G.\ y \oplus g = g \wedge g \oplus y = g)$
''then '' ''have'' $ y\oplus e = y$, $ y\oplus e = e$
''thus'' $ e = y$
''next ''
''from '' monoidAsssum ''show'' $ \exists e.\ e\in G \wedge (\forall g\in G.\ e\oplus g = g \wedge g\oplus e = g)$ ''using'' +++^[IsAmonoid_def | Monoid_ZF ]... Definition of <nowiki>IsAmonoid</nowiki>:
$ \text{IsAmonoid}(G,f) \equiv $
$ f \text{ is associative on } G \wedge $
$ (\exists e\in G.\ (\forall g\in G.\ ( (f(\langle e,g\rangle ) = g) \wedge (f(\langle g,e\rangle ) = g))))$===
''qed'' ===
We could put the definition of neutral element anywhere, but it is only usable in conjuction with the above lemma.
''Definition
'' $ TheNeutralElement(G,f) \equiv $
$ ( \text{The } e.\ e\in G \wedge (\forall g\in G.\ f\langle e,g\rangle = g \wedge f\langle g,e\rangle = g))$
The neutral element is neutral.
''lemma'' ''(in'' monoid0'')'' <nowiki>unit_is_neutral</nowiki>:
'' assumes '' A1: $ e = TheNeutralElement(G,f)$ '' shows '' $ e \in G \wedge (\forall g\in G.\ e \oplus g = g \wedge g \oplus e = g)$+++[proof ]>
''let '' $ n = \text{The } b.\ b\in G \wedge (\forall g\in G.\ b\oplus g = g \wedge g\oplus b = g)$
''have'' $ \exists !b.\ b\in G \wedge (\forall g\in G.\ b\oplus g = g \wedge g\oplus b = g)$ ''using'' +++^[group0_1_L2 | Monoid_ZF ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>group0_1_L2</nowiki>: '' shows '' $ \exists !e.\ e\in G \wedge (\forall g\in G.\ ( (e\oplus g = g) \wedge g\oplus e = g))$ ===
''then '' ''have'' $ n\in G \wedge (\forall g\in G.\ n\oplus g = g \wedge g\oplus n = g)$ '' by (rule '' <nowiki>theI</nowiki> '')''
''with '' A1 ''show'' $ thesis$ ''using'' +++^[TheNeutralElement_def | Monoid_ZF ]... Definition of <nowiki>TheNeutralElement</nowiki>:
$ TheNeutralElement(G,f) \equiv $
$ ( \text{The } e.\ e\in G \wedge (\forall g\in G.\ f\langle e,g\rangle = g \wedge f\langle g,e\rangle = g))$===
''qed'' ===
The monoid carrier is not empty.
''lemma'' ''(in'' monoid0'')'' <nowiki>group0_1_L3A</nowiki>:
'' shows '' $ G\neq 0$+++[proof ]>
''have'' $ TheNeutralElement(G,f) \in G$ ''using'' +++^[unit_is_neutral | Monoid_ZF ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>unit_is_neutral</nowiki>: ''assumes '' $ e = TheNeutralElement(G,f)$ '' shows '' $ e \in G \wedge (\forall g\in G.\ e \oplus g = g \wedge g \oplus e = g)$ ===
''thus'' $ thesis$
''qed'' ===
The range of the monoid operation is the whole monoid carrier.
''lemma'' ''(in'' monoid0'')'' <nowiki>group0_1_L3B</nowiki>:
'' shows '' $ range(f) = G$+++[proof ]>
''from '' monoidAsssum ''have'' $ f : G\times G\rightarrow G$ ''using'' +++^[IsAmonoid_def | Monoid_ZF ]... Definition of <nowiki>IsAmonoid</nowiki>:
$ \text{IsAmonoid}(G,f) \equiv $
$ f \text{ is associative on } G \wedge $
$ (\exists e\in G.\ (\forall g\in G.\ ( (f(\langle e,g\rangle ) = g) \wedge (f(\langle g,e\rangle ) = g))))$=== , +++^[IsAssociative_def | func_ZF ]... Definition of <nowiki>IsAssociative</nowiki>:
$ P \text{ is associative on } G \equiv P : G\times G\rightarrow G \wedge $
$ (\forall x \in G.\ \forall y \in G.\ \forall z \in G.\ $
$ ( P(\langle P(\langle x,y\rangle ),z\rangle ) = P( \langle x,P(\langle y,z\rangle )\rangle )))$===
''then '' ''show'' $ range(f) \subseteq G$ ''using'' +++^[func1_1_L5B | func1 ]... ''lemma'' <nowiki>func1_1_L5B</nowiki>: ''assumes '' $ f:X\rightarrow Y$ '' shows '' $ range(f) \subseteq Y$ ===
''show'' $ G \subseteq range(f)$+++[proof ]>
''fix '' $ g$
''assume '' A1: $ g\in G$
''let '' $ e = TheNeutralElement(G,f)$
''from '' A1 ''have'' $ \langle e,g\rangle \in G\times G$, $ g = f\langle e,g\rangle $ ''using'' +++^[unit_is_neutral | Monoid_ZF ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>unit_is_neutral</nowiki>: ''assumes '' $ e = TheNeutralElement(G,f)$ '' shows '' $ e \in G \wedge (\forall g\in G.\ e \oplus g = g \wedge g \oplus e = g)$ ===
''with '' $ f : G\times G\rightarrow G$ ''show'' $ g \in range(f)$ ''using'' +++^[func1_1_L5A | func1 ]... ''lemma'' <nowiki>func1_1_L5A</nowiki>: ''assumes '' $ f:X\rightarrow Y$, $ x\in X$, $ y = f(x)$ '' shows '' $ \langle x,y\rangle \in f$, $ y \in range(f)$ ===
''qed'' ===
''qed'' ===
In a monoid any neutral element is the neutral element.
''lemma'' ''(in'' monoid0'')'' <nowiki>group0_1_L4</nowiki>:
'' assumes '' A1: $ e \in G \wedge (\forall g\in G.\ e \oplus g = g \wedge g \oplus e = g)$ '' shows '' $ e = TheNeutralElement(G,f)$+++[proof ]>
''let '' $ n = \text{The } b.\ b\in G \wedge (\forall g\in G.\ b\oplus g = g \wedge g\oplus b = g)$
''have'' $ \exists !b.\ b\in G \wedge (\forall g\in G.\ b\oplus g = g \wedge g\oplus b = g)$ ''using'' +++^[group0_1_L2 | Monoid_ZF ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>group0_1_L2</nowiki>: '' shows '' $ \exists !e.\ e\in G \wedge (\forall g\in G.\ ( (e\oplus g = g) \wedge g\oplus e = g))$ ===
''moreover'' ''note '' A1
''ultimately '' ''have'' $ n = e$ '' by (rule '' <nowiki>the_equality2</nowiki> '')''
''then '' ''show'' $ thesis$ ''using'' +++^[TheNeutralElement_def | Monoid_ZF ]... Definition of <nowiki>TheNeutralElement</nowiki>:
$ TheNeutralElement(G,f) \equiv $
$ ( \text{The } e.\ e\in G \wedge (\forall g\in G.\ f\langle e,g\rangle = g \wedge f\langle g,e\rangle = g))$===
''qed'' ===
The next lemma shows that if the if we restrict the monoid operation to a subset of $G$ that contains the neutral element, then the neutral element of the monoid operation is also neutral with the restricted operation.
''lemma'' ''(in'' monoid0'')'' <nowiki>group0_1_L5</nowiki>:
'' assumes '' A1: $ \forall x\in H.\ \forall y\in H.\ x\oplus y \in H$ ''and '' A2: $ H\subseteq G$ ''and '' A3: $ e = TheNeutralElement(G,f)$ ''and '' A4: $ g = restrict(f,H\times H)$ ''and '' A5: $ e\in H$ ''and '' A6: $ h\in H$ '' shows '' $ g\langle e,h\rangle = h \wedge g\langle h,e\rangle = h$+++[proof ]>
''from '' A4, A6, A5 ''have'' $ g\langle e,h\rangle = e\oplus h \wedge g\langle h,e\rangle = h\oplus e$ ''using'' <nowiki>restrict_if</nowiki>
''with '' A3, A4, A6, A2 ''show'' $ g\langle e,h\rangle = h \wedge g\langle h,e\rangle = h$ ''using'' +++^[unit_is_neutral | Monoid_ZF ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>unit_is_neutral</nowiki>: ''assumes '' $ e = TheNeutralElement(G,f)$ '' shows '' $ e \in G \wedge (\forall g\in G.\ e \oplus g = g \wedge g \oplus e = g)$ ===
''qed'' ===
The next theorem shows that if the monoid operation is closed on a subset of $G$ then this set is a (sub)monoid (although we do not define this notion). This fact will be useful when we study subgroups.
''theorem'' ''(in'' monoid0'')'' <nowiki>group0_1_T1</nowiki>:
'' assumes '' A1: $ H \text{ is closed under } f$ ''and '' A2: $ H\subseteq G$ ''and '' A3: $ TheNeutralElement(G,f) \in H$ '' shows '' $ \text{IsAmonoid}(H,restrict(f,H\times H))$+++[proof ]>
''let '' $ g = restrict(f,H\times H)$
''let '' $ e = TheNeutralElement(G,f)$
''from '' monoidAsssum ''have'' $ f \in G\times G\rightarrow G$ ''using'' +++^[IsAmonoid_def | Monoid_ZF ]... Definition of <nowiki>IsAmonoid</nowiki>:
$ \text{IsAmonoid}(G,f) \equiv $
$ f \text{ is associative on } G \wedge $
$ (\exists e\in G.\ (\forall g\in G.\ ( (f(\langle e,g\rangle ) = g) \wedge (f(\langle g,e\rangle ) = g))))$=== , +++^[IsAssociative_def | func_ZF ]... Definition of <nowiki>IsAssociative</nowiki>:
$ P \text{ is associative on } G \equiv P : G\times G\rightarrow G \wedge $
$ (\forall x \in G.\ \forall y \in G.\ \forall z \in G.\ $
$ ( P(\langle P(\langle x,y\rangle ),z\rangle ) = P( \langle x,P(\langle y,z\rangle )\rangle )))$===
''moreover'' ''from '' A2 ''have'' $ H\times H \subseteq G\times G$
''moreover'' ''from '' A1 ''have'' $ \forall p \in H\times H.\ f(p) \in H$ ''using'' +++^[IsOpClosed_def | func_ZF ]... Definition of <nowiki>IsOpClosed</nowiki>:
$ A \text{ is closed under } f \equiv \forall x\in A.\ \forall y\in A.\ f\langle x,y\rangle \in A$===
''ultimately '' ''have'' $ g \in H\times H\rightarrow H$ ''using'' +++^[func1_2_L4 | func1 ]... ''lemma'' <nowiki>func1_2_L4</nowiki>: ''assumes '' $ f:X\rightarrow Y$ ''and'' $ A\subseteq X$ ''and'' $ \forall x\in A.\ f(x) \in Z$ '' shows '' $ restrict(f,A) : A\rightarrow Z$ ===
''moreover'' ''have'' $ \forall x\in H.\ \forall y\in H.\ \forall z\in H.\ $
$ g\langle g\langle x,y\rangle ,z\rangle = g\langle x,g\langle y,z\rangle \rangle $+++[proof ]>
''from '' A1 ''have'' $ \forall x\in H.\ \forall y\in H.\ \forall z\in H.\ $
$ g\langle g\langle x,y\rangle ,z\rangle = x\oplus y\oplus z$ ''using'' +++^[IsOpClosed_def | func_ZF ]... Definition of <nowiki>IsOpClosed</nowiki>:
$ A \text{ is closed under } f \equiv \forall x\in A.\ \forall y\in A.\ f\langle x,y\rangle \in A$=== , <nowiki>restrict_if</nowiki>
''moreover'' ''have'' $ \forall x\in H.\ \forall y\in H.\ \forall z\in H.\ x\oplus y\oplus z = x\oplus (y\oplus z)$+++[proof ]>
''from '' monoidAsssum ''have'' $ \forall x\in G.\ \forall y\in G.\ \forall z\in G.\ x\oplus y\oplus z = x\oplus (y\oplus z)$ ''using'' +++^[IsAmonoid_def | Monoid_ZF ]... Definition of <nowiki>IsAmonoid</nowiki>:
$ \text{IsAmonoid}(G,f) \equiv $
$ f \text{ is associative on } G \wedge $
$ (\exists e\in G.\ (\forall g\in G.\ ( (f(\langle e,g\rangle ) = g) \wedge (f(\langle g,e\rangle ) = g))))$=== , +++^[IsAssociative_def | func_ZF ]... Definition of <nowiki>IsAssociative</nowiki>:
$ P \text{ is associative on } G \equiv P : G\times G\rightarrow G \wedge $
$ (\forall x \in G.\ \forall y \in G.\ \forall z \in G.\ $
$ ( P(\langle P(\langle x,y\rangle ),z\rangle ) = P( \langle x,P(\langle y,z\rangle )\rangle )))$===
''with '' A2 ''show'' $ thesis$
''qed'' ===
''moreover'' ''from '' A1 ''have'' $ \forall x\in H.\ \forall y\in H.\ \forall z\in H.\ x\oplus (y\oplus z) = g\langle x,g\langle y,z\rangle \rangle $ ''using'' +++^[IsOpClosed_def | func_ZF ]... Definition of <nowiki>IsOpClosed</nowiki>:
$ A \text{ is closed under } f \equiv \forall x\in A.\ \forall y\in A.\ f\langle x,y\rangle \in A$=== , <nowiki>restrict_if</nowiki>
''ultimately '' ''show'' $ thesis$
''qed'' ===
''moreover'' ''have'' $ \exists n\in H.\ (\forall h\in H.\ g\langle n,h\rangle = h \wedge g\langle h,n\rangle = h)$+++[proof ]>
''from '' A1 ''have'' $ \forall x\in H.\ \forall y\in H.\ x\oplus y \in H$ ''using'' +++^[IsOpClosed_def | func_ZF ]... Definition of <nowiki>IsOpClosed</nowiki>:
$ A \text{ is closed under } f \equiv \forall x\in A.\ \forall y\in A.\ f\langle x,y\rangle \in A$===
''with '' A2, A3 ''have'' $ \forall h\in H.\ g\langle e,h\rangle = h \wedge g\langle h,e\rangle = h$ ''using'' +++^[group0_1_L5 | Monoid_ZF ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>group0_1_L5</nowiki>: ''assumes '' $ \forall x\in H.\ \forall y\in H.\ x\oplus y \in H$ ''and'' $ H\subseteq G$ ''and'' $ e = TheNeutralElement(G,f)$ ''and'' $ g = restrict(f,H\times H)$ ''and'' $ e\in H$ ''and'' $ h\in H$ '' shows '' $ g\langle e,h\rangle = h \wedge g\langle h,e\rangle = h$ ===
''with '' A3 ''show'' $ thesis$
''qed'' ===
''ultimately '' ''show'' $ thesis$ ''using'' +++^[IsAmonoid_def | Monoid_ZF ]... Definition of <nowiki>IsAmonoid</nowiki>:
$ \text{IsAmonoid}(G,f) \equiv $
$ f \text{ is associative on } G \wedge $
$ (\exists e\in G.\ (\forall g\in G.\ ( (f(\langle e,g\rangle ) = g) \wedge (f(\langle g,e\rangle ) = g))))$=== , +++^[IsAssociative_def | func_ZF ]... Definition of <nowiki>IsAssociative</nowiki>:
$ P \text{ is associative on } G \equiv P : G\times G\rightarrow G \wedge $
$ (\forall x \in G.\ \forall y \in G.\ \forall z \in G.\ $
$ ( P(\langle P(\langle x,y\rangle ),z\rangle ) = P( \langle x,P(\langle y,z\rangle )\rangle )))$===
''qed'' ===
Under the assumptions of // group0_1_T1// the neutral element of a submonoid is the same as that of the monoid.
''lemma'' <nowiki>group0_1_L6</nowiki>:
'' assumes '' A1: $ \text{IsAmonoid}(G,f)$ ''and '' A2: $ H \text{ is closed under } f$ ''and '' A3: $ H\subseteq G$ ''and '' A4: $ TheNeutralElement(G,f) \in H$ '' shows '' $ TheNeutralElement(H,restrict(f,H\times H)) = TheNeutralElement(G,f)$+++[proof ]>
''let '' $ e = TheNeutralElement(G,f)$
''let '' $ g = restrict(f,H\times H)$
''from '' assms ''have'' $ monoid0(H,g)$ ''using'' <nowiki>monoid0_def</nowiki> , +++^[group0_1_T1 | Monoid_ZF ]... ''theorem'' ''(in'' monoid0'')'' <nowiki>group0_1_T1</nowiki>: ''assumes '' $ H \text{ is closed under } f$ ''and'' $ H\subseteq G$ ''and'' $ TheNeutralElement(G,f) \in H$ '' shows '' $ \text{IsAmonoid}(H,restrict(f,H\times H))$ ===
''moreover'' ''have'' $ e \in H \wedge (\forall h\in H.\ g\langle e,h\rangle = h \wedge g\langle h,e\rangle = h)$+++[proof ]>
++++[{ ]>
''fix '' $ h$
''assume '' $ h \in H$
''with '' assms ''have'' $ monoid0(G,f)$, $ \forall x\in H.\ \forall y\in H.\ f\langle x,y\rangle \in H$, $ H\subseteq G$, $ e = TheNeutralElement(G,f)$, $ g = restrict(f,H\times H)$, $ e \in H$, $ h \in H$ ''using'' <nowiki>monoid0_def</nowiki> , +++^[IsOpClosed_def | func_ZF ]... Definition of <nowiki>IsOpClosed</nowiki>:
$ A \text{ is closed under } f \equiv \forall x\in A.\ \forall y\in A.\ f\langle x,y\rangle \in A$===
''then '' ''have'' $ g\langle e,h\rangle = h \wedge g\langle h,e\rangle = h$ '' by (rule '' +++^[group0_1_L5 | Monoid_ZF ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>group0_1_L5</nowiki>: ''assumes '' $ \forall x\in H.\ \forall y\in H.\ x\oplus y \in H$ ''and'' $ H\subseteq G$ ''and'' $ e = TheNeutralElement(G,f)$ ''and'' $ g = restrict(f,H\times H)$ ''and'' $ e\in H$ ''and'' $ h\in H$ '' shows '' $ g\langle e,h\rangle = h \wedge g\langle h,e\rangle = h$ === '')''
=== ''}''
''hence'' $ \forall h\in H.\ g\langle e,h\rangle = h \wedge g\langle h,e\rangle = h$
''with '' A4 ''show'' $ thesis$
''qed'' ===
''ultimately '' ''have'' $ e = TheNeutralElement(H,g)$ '' by (rule '' +++^[group0_1_L4 | Monoid_ZF ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>group0_1_L4</nowiki>: ''assumes '' $ e \in G \wedge (\forall g\in G.\ e \oplus g = g \wedge g \oplus e = g)$ '' shows '' $ e = TheNeutralElement(G,f)$ === '')''
''thus'' $ thesis$
''qed'' ===
If a sum of two elements is not zero, then at least one has to be nonzero.
''lemma'' ''(in'' monoid0'')'' <nowiki>sum_nonzero_elmnt_nonzero</nowiki>:
'' assumes '' $ a \oplus b \neq TheNeutralElement(G,f)$ '' shows '' $ a \neq TheNeutralElement(G,f) \vee b \neq TheNeutralElement(G,f)$ ''using'' <nowiki>assms</nowiki> , +++^[unit_is_neutral | Monoid_ZF ]... ''lemma'' ''(in'' monoid0'')'' <nowiki>unit_is_neutral</nowiki>: ''assumes '' $ e = TheNeutralElement(G,f)$ '' shows '' $ e \in G \wedge (\forall g\in G.\ e \oplus g = g \wedge g \oplus e = g)$ ===
''end
'' +++![Comments on Monoid_ZF|click to add comment] <html> <div> <iframe style="width:60%;height:500px" src="http://www.haloscan.com/comments/slawekk/Monoid_ZF"></iframe> </div> </html>
===
''theory'' Nat_ZF_IML ''imports'' [[Arith]]
''begin
''
The ZF set theory constructs natural numbers from the empty set and the notion of a one-element set. Namely, zero of natural numbers is defined as the empty set. For each natural number $n$ the next natural number is defined as $n\cup \{n\}$. With this definition for every non-zero natural number we get the identity $n = \{0,1,2,..,n-1\}$. It is good to remember that when we see an expression like $f: n \rightarrow X$. Also, with this definition the relation "less or equal than" becomes "$\subseteq$" and the relation "less than" becomes "$\in$".
!Induction
The induction lemmas in the standard Isabelle's Nat.thy file like for example //nat_induct// require the induction step to be a higher order statement (the one that uses the $\Longrightarrow$ sign). I found it difficult to apply from Isar, which is perhaps more of an indication of my Isar skills than anything else. Anyway, here we provide a first order version that is easier to reference in Isar declarative style proofs.
The next theorem is a version of induction on natural numbers that I was thought in school.
''theorem'' <nowiki>ind_on_nat</nowiki>:
'' assumes '' A1: $ n\in nat$ ''and '' A2: $ P(0)$ ''and '' A3: $ \forall k\in nat.\ P(k)\longrightarrow P(succ(k))$ '' shows '' $ P(n)$+++[proof ]>
''note '' A1 A2
''moreover'' ++++[{ ]>
''fix '' $ x$
''assume '' $ x\in nat$, $ P(x)$ ''and '' $ \forall k\in nat.\ P(k)\longrightarrow P(succ(k))$
''hence'' $ P(succ(x))$
=== ''}''
''ultimately '' ''show'' $ P(n)$ '' by (rule '' <nowiki>nat_induct</nowiki> '')''
''qed'' ===
A nonzero natural number has a predecessor.
''lemma'' <nowiki>Nat_ZF_1_L3</nowiki>:
'' assumes '' A1: $ n \in nat$ ''and '' A2: $ n\neq 0$ '' shows '' $ \exists k\in nat.\ n = succ(k)$+++[proof ]>
''from '' A1 ''have'' $ n \in \{0\} \cup \{succ(k).\ k\in nat\}$ ''using'' <nowiki>nat_unfold</nowiki>
''with '' A2 ''show'' $ thesis$
''qed'' ===
What is //succ//, anyway?
''lemma'' <nowiki>succ_explained</nowiki>:
'' shows '' $ succ(n) = n \cup \{n\}$ ''using'' <nowiki>succ_iff</nowiki>
Empty set is an element of every natural number which is not zero.
''lemma'' <nowiki>empty_in_every_succ</nowiki>:
'' assumes '' A1: $ n \in nat$ '' shows '' $ 0 \in succ(n)$+++[proof ]>
''note '' A1
''moreover'' ''have'' $ 0 \in succ(0)$
''moreover'' ++++[{ ]>
''fix '' $ k$
''assume '' $ k \in nat$ ''and '' A2: $ 0 \in succ(k)$
''then '' ''have'' $ succ(k) \subseteq succ(succ(k))$
''with '' A2 ''have'' $ 0 \in succ(succ(k))$
=== ''}''
''then '' ''have'' $ \forall k \in nat.\ 0 \in succ(k) \longrightarrow 0 \in succ(succ(k))$
''ultimately '' ''show'' $ 0 \in succ(n)$ '' by (rule '' +++^[ind_on_nat | Nat_ZF_IML ]... ''theorem'' <nowiki>ind_on_nat</nowiki>: ''assumes '' $ n\in nat$ ''and'' $ P(0)$ ''and'' $ \forall k\in nat.\ P(k)\longrightarrow P(succ(k))$ '' shows '' $ P(n)$ === '')''
''qed'' ===
If one natural number is less than another then their successors are in the same relation.
''lemma'' <nowiki>succ_ineq</nowiki>:
'' assumes '' A1: $ n \in nat$ '' shows '' $ \forall i \in n.\ succ(i) \in succ(n)$+++[proof ]>
''note '' A1
''moreover'' ''have'' $ \forall k \in 0.\ succ(k) \in succ(0)$
''moreover'' ++++[{ ]>
''fix '' $ k$
''assume '' A2: $ \forall i\in k.\ succ(i) \in succ(k)$
++++[{ ]>
''fix '' $ i$
''assume '' $ i \in succ(k)$
''then '' ''have'' $ i \in k \vee i = k$
''moreover'' ++++[{ ]>
''assume '' $ i\in k$
''with '' A2 ''have'' $ succ(i) \in succ(k)$
''hence'' $ succ(i) \in succ(succ(k))$
=== ''}''
''moreover'' ++++[{ ]>
''assume '' $ i = k$
''then '' ''have'' $ succ(i) \in succ(succ(k))$
=== ''}''
''ultimately '' ''have'' $ succ(i) \in succ(succ(k))$
=== ''}''
''then '' ''have'' $ \forall i \in succ(k).\ succ(i) \in succ(succ(k))$
=== ''}''
''then '' ''have'' $ \forall k \in nat.\ $
$ ( (\forall i\in k.\ succ(i) \in succ(k)) \longrightarrow (\forall i \in succ(k).\ succ(i) \in succ(succ(k))) )$
''ultimately '' ''show'' $ \forall i \in n.\ succ(i) \in succ(n)$ '' by (rule '' +++^[ind_on_nat | Nat_ZF_IML ]... ''theorem'' <nowiki>ind_on_nat</nowiki>: ''assumes '' $ n\in nat$ ''and'' $ P(0)$ ''and'' $ \forall k\in nat.\ P(k)\longrightarrow P(succ(k))$ '' shows '' $ P(n)$ === '')''
''qed'' ===
For natural numbers if $k\subseteq n$ the similar holds for their successors.
''lemma'' <nowiki>succ_subset</nowiki>:
'' assumes '' A1: $ k \in nat$, $ n \in nat$ ''and '' A2: $ k\subseteq n$ '' shows '' $ succ(k) \subseteq succ(n)$+++[proof ]>
''from '' A1 ''have'' T: $ Ord(k)$ ''and '' $ Ord(n)$ ''using'' <nowiki>nat_into_Ord</nowiki>
''with '' A2 ''have'' $ succ(k) \leq succ(n)$ ''using'' <nowiki>subset_imp_le</nowiki>
''then '' ''show'' $ succ(k) \subseteq succ(n)$ ''using'' <nowiki>le_imp_subset</nowiki>
''qed'' ===
For any two natural numbers one of them is contained in the other.
''lemma'' <nowiki>nat_incl_total</nowiki>:
'' assumes '' A1: $ i \in nat$, $ j \in nat$ '' shows '' $ i \subseteq j \vee j \subseteq i$+++[proof ]>
''from '' A1 ''have'' T: $ Ord(i)$, $ Ord(j)$ ''using'' <nowiki>nat_into_Ord</nowiki>
''then '' ''have'' $ i\in j \vee i=j \vee j\in i$ ''using'' <nowiki>Ord_linear</nowiki>
''moreover'' ++++[{ ]>
''assume '' $ i\in j$
''with '' T ''have'' $ i\subseteq j \vee j\subseteq i$ ''using'' <nowiki>lt_def</nowiki> , <nowiki>leI</nowiki> , <nowiki>le_imp_subset</nowiki>
=== ''}''
''moreover'' ++++[{ ]>
''assume '' $ i=j$
''then '' ''have'' $ i\subseteq j \vee j\subseteq i$
=== ''}''
''moreover'' ++++[{ ]>
''assume '' $ j\in i$
''with '' T ''have'' $ i\subseteq j \vee j\subseteq i$ ''using'' <nowiki>lt_def</nowiki> , <nowiki>leI</nowiki> , <nowiki>le_imp_subset</nowiki>
=== ''}''
''ultimately '' ''show'' $ i \subseteq j \vee j \subseteq i$
''qed'' ===
The set of natural numbers is the union of all successors of natural numbers.
''lemma'' <nowiki>nat_union_succ</nowiki>:
'' shows '' $ nat = (\bigcup n \in nat.\ succ(n))$+++[proof ]>
''show'' $ nat \subseteq (\bigcup n \in nat.\ succ(n))$
''next ''
++++[{ ]>
''fix '' $ k$
''assume '' A2: $ k \in (\bigcup n \in nat.\ succ(n))$
''then '' ''obtain '' $ n$ ''where '' T: $ n \in nat$ ''and '' I: $ k \in succ(n)$
''then '' ''have'' $ k \leq n$ ''using'' <nowiki>nat_into_Ord</nowiki> , <nowiki>lt_def</nowiki>
''with '' T ''have'' $ k \in nat$ ''using'' <nowiki>le_in_nat</nowiki>
=== ''}''
''then '' ''show'' $ (\bigcup n \in nat.\ succ(n)) \subseteq nat$
''qed'' ===
Successors of natural numbers are subsets of the set of natural numbers.
''lemma'' <nowiki>succnat_subset_nat</nowiki>:
'' assumes '' A1: $ n \in nat$ '' shows '' $ succ(n) \subseteq nat$+++[proof ]>
''from '' A1 ''have'' $ succ(n) \subseteq (\bigcup n \in nat.\ succ(n))$
''then '' ''show'' $ succ(n) \subseteq nat$ ''using'' +++^[nat_union_succ | Nat_ZF_IML ]... ''lemma'' <nowiki>nat_union_succ</nowiki>: '' shows '' $ nat = (\bigcup n \in nat.\ succ(n))$ ===
''qed'' ===
Element of a natural number is a natural number.
''lemma'' <nowiki>elem_nat_is_nat</nowiki>:
'' assumes '' A1: $ n \in nat$ ''and '' A2: $ k\in n$ '' shows '' $ k < n$, $ k \in nat$, $ k \leq n$, $ \langle k,n\rangle \in Le$+++[proof ]>
''from '' A1, A2 ''show'' $ k < n$ ''using'' <nowiki>nat_into_Ord</nowiki> , <nowiki>lt_def</nowiki>
''with '' A1 ''show'' $ k \in nat$ ''using'' <nowiki>lt_nat_in_nat</nowiki>
''from '' $ k < n$ ''show'' $ k \leq n$ ''using'' <nowiki>leI</nowiki>
''with '' A1, $ k \in nat$ ''show'' $ \langle k,n\rangle \in Le$ ''using'' <nowiki>Le_def</nowiki>
''qed'' ===
The set of natural numbers is the union of its elements.
''lemma'' <nowiki>nat_union_nat</nowiki>:
'' shows '' $ nat = \bigcup nat$ ''using'' +++^[elem_nat_is_nat | Nat_ZF_IML ]... ''lemma'' <nowiki>elem_nat_is_nat</nowiki>: ''assumes '' $ n \in nat$ ''and'' $ k\in n$ '' shows '' $ k < n$, $ k \in nat$, $ k \leq n$, $ \langle k,n\rangle \in Le$ ===
A natural number is a subset of the set of natural numbers.
''lemma'' <nowiki>nat_subset_nat</nowiki>:
'' assumes '' A1: $ n \in nat$ '' shows '' $ n \subseteq nat$+++[proof ]>
''from '' A1 ''have'' $ n \subseteq \bigcup nat$
''then '' ''show'' $ n \subseteq nat$ ''using'' +++^[nat_union_nat | Nat_ZF_IML ]... ''lemma'' <nowiki>nat_union_nat</nowiki>: '' shows '' $ nat = \bigcup nat$ ===
''qed'' ===
Adding a natural numbers does not decrease what we add to.
''lemma'' <nowiki>add_nat_le</nowiki>:
'' assumes '' A1: $ n \in nat$ ''and '' A2: $ k \in nat$ '' shows '' $ n \leq n \ \sharp + k$, $ n \subseteq n \ \sharp + k$, $ n \subseteq k \ \sharp + n$+++[proof ]>
''from '' A1, A2 ''have'' $ n \leq n$, $ 0 \leq k$, $ n \in nat$, $ k \in nat$ ''using'' <nowiki>nat_le_refl</nowiki> , <nowiki>nat_0_le</nowiki>
''then '' ''have'' $ n \ \sharp + 0 \leq n \ \sharp + k$ '' by (rule '' <nowiki>add_le_mono</nowiki> '')''
''with '' A1 ''show'' $ n \leq n \ \sharp + k$ ''using'' <nowiki>add_0_right</nowiki>
''then '' ''show'' $ n \subseteq n \ \sharp + k$ ''using'' <nowiki>le_imp_subset</nowiki>
''then '' ''show'' $ n \subseteq k \ \sharp + n$ ''using'' <nowiki>add_commute</nowiki>
''qed'' ===
Result of adding an element of $k$ is smaller than of adding $k$.
''lemma'' <nowiki>add_lt_mono</nowiki>:
'' assumes '' $ k \in nat$ ''and '' $ j\in k$ '' shows '' $ (n \ \sharp + j) < (n \ \sharp + k)$, $ (n \ \sharp + j) \in (n \ \sharp + k)$+++[proof ]>
''from '' assms ''have'' $ j < k$, $ k \in nat$ ''using'' +++^[elem_nat_is_nat | Nat_ZF_IML ]... ''lemma'' <nowiki>elem_nat_is_nat</nowiki>: ''assumes '' $ n \in nat$ ''and'' $ k\in n$ '' shows '' $ k < n$, $ k \in nat$, $ k \leq n$, $ \langle k,n\rangle \in Le$ ===
''then '' ''show'' $ (n \ \sharp + j) < (n \ \sharp + k)$, $ (n \ \sharp + j) \in (n \ \sharp + k)$ ''using'' <nowiki>add_lt_mono2</nowiki> , <nowiki>ltD</nowiki>
''qed'' ===
A technical lemma about a decomposition of a sum of two natural numbers: if a number $i$ is from $m + n$ then it is either from $m$ or can be written as a sum of $m$ and a number from $n$. The proof by induction w.r.t. to $m$ seems to be a bit heavy-handed, but I could not figure out how to do this directly from results from standard Isabelle/ZF.
''lemma'' <nowiki>nat_sum_decomp</nowiki>:
'' assumes '' A1: $ n \in nat$ ''and '' A2: $ m \in nat$ '' shows '' $ \forall i \in m \ \sharp + n.\ i \in m \vee (\exists j \in n.\ i = m \ \sharp + j)$+++[proof ]>
''note '' A1
''moreover'' ''from '' A2 ''have'' $ \forall i \in m \ \sharp + 0.\ i \in m \vee (\exists j \in 0.\ i = m \ \sharp + j)$ ''using'' <nowiki>add_0_right</nowiki>
''moreover'' ''have'' $ \forall k\in nat.\ $
$ (\forall i \in m \ \sharp + k.\ i \in m \vee (\exists j \in k.\ i = m \ \sharp + j)) \longrightarrow $
$ (\forall i \in m \ \sharp + succ(k).\ i \in m \vee (\exists j \in succ(k).\ i = m \ \sharp + j))$+++[proof ]>
++++[{ ]>
''fix '' $ k$
''assume '' A3: $ k \in nat$
++++[{ ]>
''assume '' A4: $ \forall i \in m \ \sharp + k.\ i \in m \vee (\exists j \in k.\ i = m \ \sharp + j)$
++++[{ ]>
''fix '' $ i$
''assume '' $ i \in m \ \sharp + succ(k)$
''then '' ''have'' $ i \in m \ \sharp + k \vee i = m \ \sharp + k$ ''using'' <nowiki>add_succ_right</nowiki>
''moreover'' ''from '' A4, A3 ''have'' $ i \in m \ \sharp + k \longrightarrow i \in m \vee (\exists j \in succ(k).\ i = m \ \sharp + j)$
''ultimately '' ''have'' $ i \in m \vee (\exists j \in succ(k).\ i = m \ \sharp + j)$
=== ''}''
''then '' ''have'' $ \forall i \in m \ \sharp + succ(k).\ i \in m \vee (\exists j \in succ(k).\ i = m \ \sharp + j)$
=== ''}''
''then '' ''have'' $ (\forall i \in m \ \sharp + k.\ i \in m \vee (\exists j \in k.\ i = m \ \sharp + j)) \longrightarrow $
$ (\forall i \in m \ \sharp + succ(k).\ i \in m \vee (\exists j \in succ(k).\ i = m \ \sharp + j))$
=== ''}''
''then '' ''show'' $ thesis$
''qed'' ===
''ultimately '' ''show'' $ \forall i \in m \ \sharp + n.\ i \in m \vee (\exists j \in n.\ i = m \ \sharp + j)$ '' by (rule '' +++^[ind_on_nat | Nat_ZF_IML ]... ''theorem'' <nowiki>ind_on_nat</nowiki>: ''assumes '' $ n\in nat$ ''and'' $ P(0)$ ''and'' $ \forall k\in nat.\ P(k)\longrightarrow P(succ(k))$ '' shows '' $ P(n)$ === '')''
''qed'' ===
A variant of induction useful for finite sequences.
''lemma'' <nowiki>fin_nat_ind</nowiki>:
'' assumes '' A1: $ n \in nat$ ''and '' A2: $ k \in succ(n)$ ''and '' A3: $ P(0)$ ''and '' A4: $ \forall j\in n.\ P(j) \longrightarrow P(succ(j))$ '' shows '' $ P(k)$+++[proof ]>
''from '' A2 ''have'' $ k \in n \vee k=n$
''with '' A1 ''have'' $ k \in nat$ ''using'' +++^[elem_nat_is_nat | Nat_ZF_IML ]... ''lemma'' <nowiki>elem_nat_is_nat</nowiki>: ''assumes '' $ n \in nat$ ''and'' $ k\in n$ '' shows '' $ k < n$, $ k \in nat$, $ k \leq n$, $ \langle k,n\rangle \in Le$ ===
''moreover'' ''from '' A3 ''have'' $ 0 \in succ(n) \longrightarrow P(0)$
''moreover'' ''from '' A1, A4 ''have'' $ \forall k \in nat.\ (k \in succ(n) \longrightarrow P(k)) \longrightarrow (succ(k) \in succ(n) \longrightarrow P(succ(k)))$ ''using'' <nowiki>nat_into_Ord</nowiki> , <nowiki>Ord_succ_mem_iff</nowiki>
''ultimately '' ''have'' $ k \in succ(n) \longrightarrow P(k)$ '' by (rule '' +++^[ind_on_nat | Nat_ZF_IML ]... ''theorem'' <nowiki>ind_on_nat</nowiki>: ''assumes '' $ n\in nat$ ''and'' $ P(0)$ ''and'' $ \forall k\in nat.\ P(k)\longrightarrow P(succ(k))$ '' shows '' $ P(n)$ === '')''
''with '' A2 ''show'' $ P(k)$
''qed'' ===
Some properties of positive natural numbers.
''lemma'' <nowiki>succ_plus</nowiki>:
'' assumes '' $ n \in nat$, $ k \in nat$ '' shows '' $ succ(n \ \sharp + j) \in nat$, $ succ(n) \ \sharp + succ(j) = succ(succ(n \ \sharp + j))$ ''using'' <nowiki>assms</nowiki>
!Intervals
In this section we consider intervals of natural numbers i.e. sets of the form $\{n+j : j \in 0..k-1\}$.
The interval is determined by two parameters: starting point and length. Recall that in standard Isabelle's //Arith.thy// the symbol $ \ \sharp +$ is defined as the sum of natural numbers.
''Definition
'' $ NatInterval(n,k) \equiv \{n \ \sharp + j.\ j\in k\}$
Subtracting the beginning af the interval results in a number from the length of the interval.It may sound weird, but note that the length of such interval is a natural number, hence a set.
''lemma'' <nowiki>inter_diff_in_len</nowiki>:
'' assumes '' A1: $ k \in nat$ ''and '' A2: $ i \in NatInterval(n,k)$ '' shows '' $ i \ \sharp - n \in k$+++[proof ]>
''from '' A2 ''obtain '' $ j$ ''where '' I: $ i = n \ \sharp + j$ ''and '' II: $ j \in k$ ''using'' +++^[NatInterval_def | Nat_ZF_IML ]... Definition of <nowiki>NatInterval</nowiki>:
$ NatInterval(n,k) \equiv \{n \ \sharp + j.\ j\in k\}$===
''from '' A1, II ''have'' $ j \in nat$ ''using'' +++^[elem_nat_is_nat | Nat_ZF_IML ]... ''lemma'' <nowiki>elem_nat_is_nat</nowiki>: ''assumes '' $ n \in nat$ ''and'' $ k\in n$ '' shows '' $ k < n$, $ k \in nat$, $ k \leq n$, $ \langle k,n\rangle \in Le$ ===
''moreover'' ''from '' I ''have'' $ i \ \sharp - n = natify(j)$ ''using'' <nowiki>diff_add_inverse</nowiki>
''ultimately '' ''have'' $ i \ \sharp - n = j$
''with '' II ''show'' $ thesis$
''qed'' ===
Intervals don't overlap with their starting point and the union of an interval with its starting point is the sum of the starting point and the length of the interval.
''lemma'' <nowiki>length_start_decomp</nowiki>:
'' assumes '' A1: $ n \in nat$, $ k \in nat$ '' shows '' $ n \cap NatInterval(n,k) = 0$, $ n \cup NatInterval(n,k) = n \ \sharp + k$+++[proof ]>
++++[{ ]>
''fix '' $ i$
''assume '' A2: $ i \in n$ ''and '' $ i \in NatInterval(n,k)$
''then '' ''obtain '' $ j$ ''where '' I: $ i = n \ \sharp + j$ ''and '' II: $ j \in k$ ''using'' +++^[NatInterval_def | Nat_ZF_IML ]... Definition of <nowiki>NatInterval</nowiki>:
$ NatInterval(n,k) \equiv \{n \ \sharp + j.\ j\in k\}$===
''from '' A1 ''have'' $ k \in nat$ ''using'' +++^[elem_nat_is_nat | Nat_ZF_IML ]... ''lemma'' <nowiki>elem_nat_is_nat</nowiki>: ''assumes '' $ n \in nat$ ''and'' $ k\in n$ '' shows '' $ k < n$, $ k \in nat$, $ k \leq n$, $ \langle k,n\rangle \in Le$ ===
''with '' II ''have'' $ j \in nat$ ''using'' +++^[elem_nat_is_nat | Nat_ZF_IML ]... ''lemma'' <nowiki>elem_nat_is_nat</nowiki>: ''assumes '' $ n \in nat$ ''and'' $ k\in n$ '' shows '' $ k < n$, $ k \in nat$, $ k \leq n$, $ \langle k,n\rangle \in Le$ ===
''with '' A1, I ''have'' $ n \leq i$ ''using'' +++^[add_nat_le | Nat_ZF_IML ]... ''lemma'' <nowiki>add_nat_le</nowiki>: ''assumes '' $ n \in nat$ ''and'' $ k \in nat$ '' shows '' $ n \leq n \ \sharp + k$, $ n \subseteq n \ \sharp + k$, $ n \subseteq k \ \sharp + n$ ===
''moreover'' ''from '' A1, A2 ''have'' $ i < n$ ''using'' +++^[elem_nat_is_nat | Nat_ZF_IML ]... ''lemma'' <nowiki>elem_nat_is_nat</nowiki>: ''assumes '' $ n \in nat$ ''and'' $ k\in n$ '' shows '' $ k < n$, $ k \in nat$, $ k \leq n$, $ \langle k,n\rangle \in Le$ ===
''ultimately '' ''have'' $ False$ ''using'' <nowiki>le_imp_not_lt</nowiki>
=== ''}''
''thus'' $ n \cap NatInterval(n,k) = 0$
''from '' A1 ''have'' $ n \subseteq n \ \sharp + k$ ''using'' +++^[add_nat_le | Nat_ZF_IML ]... ''lemma'' <nowiki>add_nat_le</nowiki>: ''assumes '' $ n \in nat$ ''and'' $ k \in nat$ '' shows '' $ n \leq n \ \sharp + k$, $ n \subseteq n \ \sharp + k$, $ n \subseteq k \ \sharp + n$ ===
''moreover'' ++++[{ ]>
''fix '' $ i$
''assume '' $ i \in NatInterval(n,k)$
''then '' ''obtain '' $ j$ ''where '' III: $ i = n \ \sharp + j$ ''and '' IV: $ j \in k$ ''using'' +++^[NatInterval_def | Nat_ZF_IML ]... Definition of <nowiki>NatInterval</nowiki>:
$ NatInterval(n,k) \equiv \{n \ \sharp + j.\ j\in k\}$===
''with '' A1 ''have'' $ j < k$ ''using'' +++^[elem_nat_is_nat | Nat_ZF_IML ]... ''lemma'' <nowiki>elem_nat_is_nat</nowiki>: ''assumes '' $ n \in nat$ ''and'' $ k\in n$ '' shows '' $ k < n$, $ k \in nat$, $ k \leq n$, $ \langle k,n\rangle \in Le$ ===
''with '' A1, III ''have'' $ i \in n \ \sharp + k$ ''using'' <nowiki>add_lt_mono2</nowiki> , <nowiki>ltD</nowiki>
=== ''}''
''ultimately '' ''have'' $ n \cup NatInterval(n,k) \subseteq n \ \sharp + k$
''moreover'' ''from '' A1 ''have'' $ n \ \sharp + k \subseteq n \cup NatInterval(n,k)$ ''using'' +++^[nat_sum_decomp | Nat_ZF_IML ]... ''lemma'' <nowiki>nat_sum_decomp</nowiki>: ''assumes '' $ n \in nat$ ''and'' $ m \in nat$ '' shows '' $ \forall i \in m \ \sharp + n.\ i \in m \vee (\exists j \in n.\ i = m \ \sharp + j)$ === , +++^[NatInterval_def | Nat_ZF_IML ]... Definition of <nowiki>NatInterval</nowiki>:
$ NatInterval(n,k) \equiv \{n \ \sharp + j.\ j\in k\}$===
''ultimately '' ''show'' $ n \cup NatInterval(n,k) = n \ \sharp + k$
''qed'' ===
Sme properties of three adjacent intervals.
''lemma'' <nowiki>adjacent_intervals3</nowiki>:
'' assumes '' $ n \in nat$, $ k \in nat$, $ m \in nat$ '' shows '' $ n \ \sharp + k \ \sharp + m = (n \ \sharp + k) \cup NatInterval(n \ \sharp + k,m)$, $ n \ \sharp + k \ \sharp + m = n \cup NatInterval(n,k \ \sharp + m)$, $ n \ \sharp + k \ \sharp + m = n \cup NatInterval(n,k) \cup NatInterval(n \ \sharp + k,m)$ ''using'' <nowiki>assms</nowiki> , <nowiki>add_assoc</nowiki> , +++^[length_start_decomp | Nat_ZF_IML ]... ''lemma'' <nowiki>length_start_decomp</nowiki>: ''assumes '' $ n \in nat$, $ k \in nat$ '' shows '' $ n \cap NatInterval(n,k) = 0$, $ n \cup NatInterval(n,k) = n \ \sharp + k$ ===
''end
'' +++![Comments on Nat_ZF_IML|click to add comment] <html> <div> <iframe style="width:60%;height:500px" src="http://www.haloscan.com/comments/slawekk/Nat_ZF_IML"></iframe> </div> </html>
===
/***
|Name|NestedSlidersPlugin|
|Source|http://www.TiddlyTools.com/#NestedSlidersPlugin|
|Version|2.3.2|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <<br>>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides|Slider.prototype.stop|
|Description|show content in nest-able 'slider' or 'floating' panels, without needing to create separate tiddlers for each panel|
!!!!!Configuration
<<<
Enable animation for slider panels
<<option chkFloatingSlidersAnimate>> allow sliders to animate when opening/closing
>(note: This setting is in //addition// to the general option for enabling/disabling animation effects:
><<option chkAnimate>> enable animations (entire document)
>For slider animation to occur, you must also allow animation in general.
Debugging messages for 'lazy sliders' deferred rendering:
<<option chkDebugLazySliderDefer>> show debugging alert when deferring slider rendering
<<option chkDebugLazySliderRender>> show debugging alert when deferred slider is actually rendered
<<<
!!!!!Usage
<<<
When installed, this plugin adds new wiki syntax for embedding 'slider' panels directly into tiddler content. Use {{{+++}}} and {{{===}}} to delimit the slider content. You can also 'nest' these sliders as deep as you like (see complex nesting example below), so that expandable 'tree-like' hierarchical displays can be created. This is most useful when converting existing in-line text content to create in-line annotations, footnotes, context-sensitive help, or other subordinate information displays.
Additional optional syntax elements let you specify
*default to open
*cookiename
*heading level
*floater (with optional CSS width value)
*transient display (clicking elsewhere closes panel)
*custom class/label/tooltip/accesskey
*alternate label/tooltip (displayed when panel is open)
*panelID (for later use with {{{<<DOM>>}}} macro. See [[DOMTweaksPlugin]])
*automatic blockquote style on panel
*deferred rendering of panel content
The complete syntax, using all options, is:
//{{{
++++(cookiename)!!!!!^width^*{{class{[label=key|tooltip][altlabel|alttooltip]}}}#panelID:>...
content goes here
===
//}}}
where:
* {{{+++}}} (or {{{++++}}}) and {{{===}}}<br>marks the start and end of the slider definition, respectively. When the extra {{{+}}} is used, the slider will be open when initially displayed.
* {{{(cookiename)}}}<br>saves the slider opened/closed state, and restores this state whenever the slider is re-rendered.
* {{{!}}} through {{{!!!!!}}}<br>displays the slider label using a formatted headline (Hn) style instead of a button/link style
* {{{^width^}}} (or just {{{^}}})<br>makes the slider 'float' on top of other content rather than shifting that content downward. 'width' must be a valid CSS value (e.g., "30em", "180px", "50%", etc.). If omitted, the default width is "auto" (i.e., fit to content)
* {{{"*"}}} //(without the quotes)//<br>denotes "transient display": when a click occurs elsewhere in the document, the slider/floating panel will be automatically closed. This is useful for creating 'pulldown menus' that automatically go away after they are used. //Note: using SHIFT-click on a slider label will open/close that slider without triggering the automatic closing of any transient slider panels that are currently displayed, permitting ''temporary'' display of several transient panels at once.//
* """{{class{[label=key|tooltip][altlabel|alttooltip]}}}"""<br>uses label/tooltip/accesskey. """{{class{...}}}""", """=key""", """|tooltip""" and """[altlabel|alttooltip]""" are optional. 'class' is any valid CSS class name, used to style the slider label text. 'key' must be a ''single letter only''. altlabel/alttooltip specifiy alternative label/tooltip for use when slider/floating panel is displayed.
* {{{#panelID:}}}<br>defines a unique DOM element ID that is assigned to the panel element used to display the slider content. This ID can then be used later to reposition the panel using the {{{<<DOM move id>>}}} macro (see [[DOMTweaksPlugin]]), or to access/modify the panel element through use of {{{document.getElementById(...)}}}) javascript code in a plugin or inline script.
* {{{">"}}} //(without the quotes)//<br>automatically adds blockquote formatting to slider content
* {{{"..."}}} //(without the quotes)//<br>defers rendering of closed sliders until the first time they are opened. //Note: deferred rendering may produce unexpected results in some cases. Use with care.//
//Note: to make slider definitions easier to read and recognize when editing a tiddler, newlines immediately following the {{{+++}}} 'start slider' or preceding the {{{===}}} 'end slider' sequence are automatically supressed so that excess whitespace is eliminated from the output.//
<<<
!!!!!Examples
<<<
simple in-line slider:
{{{
+++
content
===
}}}
+++
content
===
----
use a custom label and tooltip:
{{{
+++[label|tooltip]
content
===
}}}
+++[label|tooltip]
content
===
----
content automatically blockquoted:
{{{
+++>
content
===
}}}
+++>
content
===
----
all options combined //(default open, cookie, heading, sized floater, transient, class, label/tooltip/key, blockquoted, deferred)//
{{{
++++(testcookie)!!!^30em^*{{big{[label=Z|click or press Alt-Z to open]}}}>...
content
===
}}}
++++(testcookie)!!!^30em^*{{big{[label=Z|click or press Alt-Z to open]}}}>...
content
===
----
complex nesting example:
{{{
+++[get info...=I|click for information or press Alt-I]
put some general information here,
plus a floating panel with more specific info:
+++^10em^[view details...|click for details]
put some detail here, which could in turn contain a transient panel,
perhaps with a +++^25em^*[glossary definition]explaining technical terms===
===
===
}}}
+++[get info...=I|click for information or press Alt-I]
put some general information here,
plus a floating panel with more specific info:
+++^10em^[view details...|click for details]
put some detail here, which could in turn contain a transient panel,
perhaps with a +++^25em^*[glossary definition]explaining technical terms===
===
===
<<<
!!!!!Installation
<<<
import (or copy/paste) the following tiddlers into your document:
''NestedSlidersPlugin'' (tagged with <<tag systemConfig>>)
<<<
!!!!!Revision History
<<<
''2007.11.14 - 2.3.2'' in onClickNestedSlider(), prevent SHIFT-click events from opening a new, empty browser window by setting "cancelBubble=true" and calling "stopPropagation()". Note: SHIFT-click is still processed as a normal click (i.e., it toggles the slider panel display). Also, using SHIFT-click will prevent 'transient' sliders from being automatically closed when another slider is opened, allowing you to *temporarily* display several transient sliders at once.
''2007.07.26 - 2.3.1'' in document.onclick(), propagate return value from hijacked core click handler to consume OR bubble up click as needed. Fixes "IE click disease", whereby nearly every mouse click causes a page transition.
|please see [[NestedSlidersPluginHistory]] for additional revision details|
''2005.11.03 - 1.0.0'' initial public release
<<<
!!!!!Credits
<<<
This feature was implemented by EricShulman from [[ELS Design Studios|http:/www.elsdesign.com]] with initial research and suggestions from RodneyGomes, GeoffSlocock, and PaulPetterson.
<<<
!!!!!Code
***/
//{{{
version.extensions.nestedSliders = {major: 2, minor: 3, revision: 2, date: new Date(2007,11,14)};
//}}}
//{{{
// options for deferred rendering of sliders that are not initially displayed
if (config.options.chkDebugLazySliderDefer==undefined) config.options.chkDebugLazySliderDefer=false;
if (config.options.chkDebugLazySliderRender==undefined) config.options.chkDebugLazySliderRender=false;
if (config.options.chkFloatingSlidersAnimate==undefined) config.options.chkFloatingSlidersAnimate=false;
// default styles for 'floating' class
setStylesheet(".floatingPanel { position:absolute; z-index:10; padding:0.5em; margin:0em; \
background-color:#eee; color:#000; border:1px solid #000; text-align:left; }","floatingPanelStylesheet");
//}}}
//{{{
config.formatters.push( {
name: "nestedSliders",
match: "\\n?\\+{3}",
terminator: "\\s*\\={3}\\n?",
lookahead: "\\n?\\+{3}(\\+)?(\\([^\\)]*\\))?(\\!*)?(\\^(?:[^\\^\\*\\[\\>]*\\^)?)?(\\*)?(?:\\{\\{([\\w]+[\\s\\w]*)\\{)?(\\[[^\\]]*\\])?(\\[[^\\]]*\\])?(?:\\}{3})?(\\#[^:]*\\:)?(\\>)?(\\.\\.\\.)?\\s*",
handler: function(w)
{
lookaheadRegExp = new RegExp(this.lookahead,"mg");
lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = lookaheadRegExp.exec(w.source)
if(lookaheadMatch && lookaheadMatch.index == w.matchStart)
{
// var defopen=lookaheadMatch[1]
// var cookiename=lookaheadMatch[2]
// var header=lookaheadMatch[3]
// var panelwidth=lookaheadMatch[4]
// var transient=lookaheadMatch[5]
// var class=lookaheadMatch[6]
// var label=lookaheadMatch[7]
// var openlabel=lookaheadMatch[8]
// var panelID=lookaheadMatch[9]
// var blockquote=lookaheadMatch[10]
// var deferred=lookaheadMatch[11]
// location for rendering button and panel
var place=w.output;
// default to closed, no cookie, no accesskey, no alternate text/tip
var show="none"; var cookie=""; var key="";
var closedtext=">"; var closedtip="";
var openedtext="<"; var openedtip="";
// extra "+", default to open
if (lookaheadMatch[1]) show="block";
// cookie, use saved open/closed state
if (lookaheadMatch[2]) {
cookie=lookaheadMatch[2].trim().slice(1,-1);
cookie="chkSlider"+cookie;
if (config.options[cookie]==undefined)
{ config.options[cookie] = (show=="block") }
show=config.options[cookie]?"block":"none";
}
// parse label/tooltip/accesskey: [label=X|tooltip]
if (lookaheadMatch[7]) {
var parts=lookaheadMatch[7].trim().slice(1,-1).split("|");
closedtext=parts.shift();
if (closedtext.substr(closedtext.length-2,1)=="=")
{ key=closedtext.substr(closedtext.length-1,1); closedtext=closedtext.slice(0,-2); }
openedtext=closedtext;
if (parts.length) closedtip=openedtip=parts.join("|");
else { closedtip="show "+closedtext; openedtip="hide "+closedtext; }
}
// parse alternate label/tooltip: [label|tooltip]
if (lookaheadMatch[8]) {
var parts=lookaheadMatch[8].trim().slice(1,-1).split("|");
openedtext=parts.shift();
if (parts.length) openedtip=parts.join("|");
else openedtip="hide "+openedtext;
}
var title=show=='block'?openedtext:closedtext;
var tooltip=show=='block'?openedtip:closedtip;
// create the button
if (lookaheadMatch[3]) { // use "Hn" header format instead of button/link
var lvl=(lookaheadMatch[3].length>6)?6:lookaheadMatch[3].length;
var btn = createTiddlyElement(createTiddlyElement(place,"h"+lvl,null,null,null),"a",null,lookaheadMatch[6],title);
btn.onclick=onClickNestedSlider;
btn.setAttribute("href","javascript:;");
btn.setAttribute("title",tooltip);
}
else
var btn = createTiddlyButton(place,title,tooltip,onClickNestedSlider,lookaheadMatch[6]);
btn.innerHTML=title; // enables use of HTML entities in label
// set extra button attributes
btn.setAttribute("closedtext",closedtext);
btn.setAttribute("closedtip",closedtip);
btn.setAttribute("openedtext",openedtext);
btn.setAttribute("openedtip",openedtip);
btn.sliderCookie = cookie; // save the cookiename (if any) in the button object
btn.defOpen=lookaheadMatch[1]!=null; // save default open/closed state (boolean)
btn.keyparam=key; // save the access key letter ("" if none)
if (key.length) {
btn.setAttribute("accessKey",key); // init access key
btn.onfocus=function(){this.setAttribute("accessKey",this.keyparam);}; // **reclaim** access key on focus
}
btn.onmouseover=function(event) // mouseover on button aligns floater position with button
{ if (window.adjustSliderPos) window.adjustSliderPos(this.parentNode,this,this.sliderPanel,this.sliderPanel.className); }
// create slider panel
var panelClass=lookaheadMatch[4]?"floatingPanel":"sliderPanel";
var panelID=lookaheadMatch[9]; if (panelID) panelID=panelID.slice(1,-1); // trim off delimiters
var panel=createTiddlyElement(place,"div",panelID,panelClass,null);
panel.button = btn; // so the slider panel know which button it belongs to
btn.sliderPanel=panel; // so the button knows which slider panel it belongs to
panel.defaultPanelWidth=(lookaheadMatch[4] && lookaheadMatch[4].length>2)?lookaheadMatch[4].slice(1,-1):"";
panel.setAttribute("transient",lookaheadMatch[5]=="*"?"true":"false");
panel.style.display = show;
panel.style.width=panel.defaultPanelWidth;
panel.onmouseover=function(event) // mouseover on panel aligns floater position with button
{ if (window.adjustSliderPos) window.adjustSliderPos(this.parentNode,this.button,this,this.className); }
// render slider (or defer until shown)
w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
if ((show=="block")||!lookaheadMatch[11]) {
// render now if panel is supposed to be shown or NOT deferred rendering
w.subWikify(lookaheadMatch[10]?createTiddlyElement(panel,"blockquote"):panel,this.terminator);
// align floater position with button
if (window.adjustSliderPos) window.adjustSliderPos(place,btn,panel,panelClass);
}
else {
var src = w.source.substr(w.nextMatch);
var endpos=findMatchingDelimiter(src,"+++","===");
panel.setAttribute("raw",src.substr(0,endpos));
panel.setAttribute("blockquote",lookaheadMatch[10]?"true":"false");
panel.setAttribute("rendered","false");
w.nextMatch += endpos+3;
if (w.source.substr(w.nextMatch,1)=="\n") w.nextMatch++;
if (config.options.chkDebugLazySliderDefer) alert("deferred '"+title+"':\n\n"+panel.getAttribute("raw"));
}
}
}
}
)
// TBD: ignore 'quoted' delimiters (e.g., "{{{+++foo===}}}" isn't really a slider)
function findMatchingDelimiter(src,starttext,endtext) {
var startpos = 0;
var endpos = src.indexOf(endtext);
// check for nested delimiters
while (src.substring(startpos,endpos-1).indexOf(starttext)!=-1) {
// count number of nested 'starts'
var startcount=0;
var temp = src.substring(startpos,endpos-1);
var pos=temp.indexOf(starttext);
while (pos!=-1) { startcount++; pos=temp.indexOf(starttext,pos+starttext.length); }
// set up to check for additional 'starts' after adjusting endpos
startpos=endpos+endtext.length;
// find endpos for corresponding number of matching 'ends'
while (startcount && endpos!=-1) {
endpos = src.indexOf(endtext,endpos+endtext.length);
startcount--;
}
}
return (endpos==-1)?src.length:endpos;
}
//}}}
//{{{
window.onClickNestedSlider=function(e)
{
if (!e) var e = window.event;
var theTarget = resolveTarget(e);
var theLabel = theTarget.firstChild.data;
var theSlider = theTarget.sliderPanel
var isOpen = theSlider.style.display!="none";
// toggle label
theTarget.innerHTML=isOpen?theTarget.getAttribute("closedText"):theTarget.getAttribute("openedText");
// toggle tooltip
theTarget.setAttribute("title",isOpen?theTarget.getAttribute("closedTip"):theTarget.getAttribute("openedTip"));
// deferred rendering (if needed)
if (theSlider.getAttribute("rendered")=="false") {
if (config.options.chkDebugLazySliderRender)
alert("rendering '"+theLabel+"':\n\n"+theSlider.getAttribute("raw"));
var place=theSlider;
if (theSlider.getAttribute("blockquote")=="true")
place=createTiddlyElement(place,"blockquote");
wikify(theSlider.getAttribute("raw"),place);
theSlider.setAttribute("rendered","true");
}
// show/hide the slider
if(config.options.chkAnimate && (theSlider.className!='floatingPanel' || config.options.chkFloatingSlidersAnimate))
anim.startAnimating(new Slider(theSlider,!isOpen,e.shiftKey || e.altKey,"none"));
else
theSlider.style.display = isOpen ? "none" : "block";
// reset to default width (might have been changed via plugin code)
theSlider.style.width=theSlider.defaultPanelWidth;
// align floater panel position with target button
if (!isOpen && window.adjustSliderPos) window.adjustSliderPos(theSlider.parentNode,theTarget,theSlider,theSlider.className);
// if showing panel, set focus to first 'focus-able' element in panel
if (theSlider.style.display!="none") {
var ctrls=theSlider.getElementsByTagName("*");
for (var c=0; c<ctrls.length; c++) {
var t=ctrls[c].tagName.toLowerCase();
if ((t=="input" && ctrls[c].type!="hidden") || t=="textarea" || t=="select")
{ ctrls[c].focus(); break; }
}
}
var cookie=theTarget.sliderCookie;
if (cookie && cookie.length) {
config.options[cookie]=!isOpen;
if (config.options[cookie]!=theTarget.defOpen)
saveOptionCookie(cookie);
else { // remove cookie if slider is in default display state
var ex=new Date(); ex.setT