Discussion:
[isabelle] free Abelian groups
Lawrence Paulson
2018-09-03 17:32:13 UTC
Permalink
HOL Light defines a type “frag” of free Abelian groups over some other type: finite maps from type elements to integers. Each such map represents a monomial with integer exponents. Do we have such a thing already? (We have finite maps, of course.)

Larry Paulson
Manuel Eberl
2018-09-03 20:35:17 UTC
Permalink
I don't think we have anything like that. It is a very nice structure,
but I have never really run into a situation where I needed anything
like it.

I guess you need that for homology, right?

Manuel
HOL Light defines a type “frag” of free Abelian groups over some other type: finite maps from type elements to integers. Each such map represents a monomial with integer exponents. Do we have such a thing already? (We have finite maps, of course.)
Larry Paulson
Johannes Hölzl
2018-09-03 20:53:06 UTC
Permalink
One option is to use the Poly_Mapping theory in AFP/Polynomials:

https://www.isa-afp.org/browser_info/current/AFP/Polynomials/Poly_Mapping.html

These are the finite maps where the default value is 0. To represent free Abelian group over 'a
use: 'a ⇒⇩0 int the group structure is given by the additive operations.

What is missing is the map to interpret a free Abelian group as a formal sum:
map :: ('a = 'b::ab_group_add) => ('a ⇒⇩0 int) => 'b
map f G = (SUM a | lookup G a ~= 0. lookup G a *_i f a)

where *_i is scalar multiplication with an integer, defines as:
(n + 1) *_i a = n *_i a + a
(n - 1) *_i a = n *_i a - a
0 *_i a = 0

- Johannes
Post by Lawrence Paulson
HOL Light defines a type “frag” of free Abelian groups over some other type: finite maps from type
elements to integers. Each such map represents a monomial with integer exponents. Do we have such
a thing already? (We have finite maps, of course.)
Larry Paulson
Lawrence Paulson
2018-09-05 13:49:23 UTC
Permalink
Thanks for the suggestion. I've already reported a decent chunk of the HOL Light code, but it's surely better to work with this more general development.

I wonder whether Poly_Mapping.thy should be moved to the Library directory? It doesn't depend on anything else in the Polynomial entry.

Larry
Post by Johannes Hölzl
https://www.isa-afp.org/browser_info/current/AFP/Polynomials/Poly_Mapping.html
These are the finite maps where the default value is 0. To represent free Abelian group over 'a
use: 'a ⇒⇩0 int the group structure is given by the additive operations.
map :: ('a = 'b::ab_group_add) => ('a ⇒⇩0 int) => 'b
map f G = (SUM a | lookup G a ~= 0. lookup G a *_i f a)
(n + 1) *_i a = n *_i a + a
(n - 1) *_i a = n *_i a - a
0 *_i a = 0
- Johannes
Post by Lawrence Paulson
HOL Light defines a type “frag” of free Abelian groups over some other type: finite maps from type
elements to integers. Each such map represents a monomial with integer exponents. Do we have such
a thing already? (We have finite maps, of course.)
Larry Paulson
Florian Haftmann
2018-09-16 13:35:41 UTC
Permalink
Hi Larry,
Post by Lawrence Paulson
I wonder whether Poly_Mapping.thy should be moved to the Library directory? It doesn't depend on anything else in the Polynomial entry.
this would be feasible of course, with the following issues:

* I still do not have a more appropriate name at hand than poly_mapping
and I am open to suggestions.

* Since the theory has a strong bias towards constructing and executing
algebraic concepts, Computational_Algebra might be a better session.

* The theory contains auxiliary concerning lists with no trailing zeros,
which would be useful as separate theory also: for radix representations
and HOL-Library.Polynomial also.

* Another prospective application: ‹(nat, 8 word) poly_mapping› would be
a suitable model for big integers as bytes.

Cheers,
Florian
--
PGP available:
http://isabelle.in.tum.de/~haftmann/pgp/florian_haftmann_at_informatik_tu_muenchen_de
Lawrence Paulson
2018-09-17 13:15:26 UTC
Permalink
I would be equally happy to see it in Computational_Algebra. Presumably its dependence on three other theories from HOL-Library isn't relevant.

Presumably no_trailing_zeros could be transferred to Library.More_List, since it builds on primitives defined in that theory.

I have no suggestions for a more appropriate name.

Larry
Post by Florian Haftmann
Hi Larry,
Post by Lawrence Paulson
I wonder whether Poly_Mapping.thy should be moved to the Library directory? It doesn't depend on anything else in the Polynomial entry.
* I still do not have a more appropriate name at hand than poly_mapping
and I am open to suggestions.
* Since the theory has a strong bias towards constructing and executing
algebraic concepts, Computational_Algebra might be a better session.
* The theory contains auxiliary concerning lists with no trailing zeros,
which would be useful as separate theory also: for radix representations
and HOL-Library.Polynomial also.
* Another prospective application: ‹(nat, 8 word) poly_mapping› would be
a suitable model for big integers as bytes.
Cheers,
Florian
--
http://isabelle.in.tum.de/~haftmann/pgp/florian_haftmann_at_informatik_tu_muenchen_de
Manuel Eberl
2018-09-17 15:07:50 UTC
Permalink
If the 'b is restricted to int, one has the subgroup of a finite Abelian
group where all the elements have finite support. This is commonly
called a the group of ‘formal sums’. Another possible name would be
‘signed multisets’.

Not of course, ‘poly_mapping’ is a bit more general than that in that it
allows an arbitrary result type, not just integers. Perhaps ‘formal sum’
is still good enough. Or ‘formal quasisum’?

Manuel
Post by Lawrence Paulson
I would be equally happy to see it in Computational_Algebra. Presumably its dependence on three other theories from HOL-Library isn't relevant.
Presumably no_trailing_zeros could be transferred to Library.More_List, since it builds on primitives defined in that theory.
I have no suggestions for a more appropriate name.
Larry
Post by Florian Haftmann
Hi Larry,
Post by Lawrence Paulson
I wonder whether Poly_Mapping.thy should be moved to the Library directory? It doesn't depend on anything else in the Polynomial entry.
* I still do not have a more appropriate name at hand than poly_mapping
and I am open to suggestions.
* Since the theory has a strong bias towards constructing and executing
algebraic concepts, Computational_Algebra might be a better session.
* The theory contains auxiliary concerning lists with no trailing zeros,
which would be useful as separate theory also: for radix representations
and HOL-Library.Polynomial also.
* Another prospective application: ‹(nat, 8 word) poly_mapping› would be
a suitable model for big integers as bytes.
Cheers,
Florian
--
http://isabelle.in.tum.de/~haftmann/pgp/florian_haftmann_at_informatik_tu_muenchen_de
José Manuel Rodriguez Caballero
2018-09-04 01:22:58 UTC
Permalink
Post by Lawrence Paulson
HOL Light defines a type “frag” of free Abelian groups over some other
type: finite maps from type elements to integers. Each such map represents
a monomial with integer exponents.
I don't think we have anything like that. It is a very nice structure,
but I have never really run into a situation where I needed anything
like it.
There is a deep theoretical reason in order to explain why the above
mentioned frag from HOL Light is avoided, whenever it is possible, in
Abstract Algebra, e.g., in Serge Lang's approach:
https://www.springer.com/gp/book/9780387953854

First, a little bit of terminology. Let M be a module over the ring R
(R-module for short). The R-module of finite maps from elements in M to R,
which are homomorphisms, is denoted M* and it is called the dual R-module
of M. An Abelian group is the same as an R-module, where R is the ring of
integers, denoted Z. If M a free Z-module, i.e. a free Abelian group, then
M* can be identified with the above-mentioned frag of HOL Light, endowed
with the componentwise addition. Reference for dual modules:
https://en.wikipedia.org/wiki/Dual_module

The problem is that Abstract Algebra concerns the properties of structures
which are independent from their concrete presentations. For any R-module
M, its dual R-module M* depends upon both M and a set S of generators of M.
In general, for a given M, there are many choices of the set S. So, in
order to prove a property of M from a property of M*, the set S should be
arbitrary from the beginning of the proof. Otherwise, the property of M*
will be translated into a property of the pair (M, S), not just of M.
Abstract Algebra is not interested in the pair (M, S), although
Computational Algebra may be interested in such a pair.

This problem was the main motivation for the introduction of the concept of
natural transformation, and then for the development of Category Theory.
For example, there is a natural transformation between M and M** (its
double dual, i.e., the dual of its dual).

References for natural transformations:
Text (advanced): https://ncatlab.org/nlab/show/natural+transformation
Video (elementary introduction):


Kind Regards,
Jose M.
Lawrence Paulson
2018-09-05 10:12:18 UTC
Permalink
That background is very interesting, thanks! However, I merely need this in order to port some HOL Light proofs involving homology theory. As I port these proofs with almost no knowledge of the subject matter, I'm seldom able to improve them very much. I leave that to people who know what they are doing. Meanwhile, even in their original form, the ported HOL Light libraries seem to be very useful.

Larry
Post by José Manuel Rodriguez Caballero
Post by Lawrence Paulson
HOL Light defines a type “frag” of free Abelian groups over some other
type: finite maps from type elements to integers. Each such map represents
a monomial with integer exponents.
I don't think we have anything like that. It is a very nice structure,
but I have never really run into a situation where I needed anything
like it.
There is a deep theoretical reason in order to explain why the above
mentioned frag from HOL Light is avoided, whenever it is possible, in
https://www.springer.com/gp/book/9780387953854
Lawrence Paulson
2018-09-07 18:34:21 UTC
Permalink
That’s annoying. Looks like Mailman wants to work for Linux only. The rest of the world formats paragraphs as single lines.

I don’t see any formatting options on the mailing list configuration page, but I’m open to hints.

Larry
https://lists.cam.ac.uk/pipermail/cl-isabelle-users/2018-September/msg00041.html .
As you can see, it transforms to one big line which is very hard to
read, because you have to scrool horizontally. Please, configure your mail
client properly or (better) configure mailing list archive to display mails
properly.
Lawrence Paulson
2018-09-10 13:10:09 UTC
Permalink
Thanks for the suggestion. I don't know a lot about CSS, but I looked online a bit and got the impression that line wrapping was the default: "nowrap" must be specified somewhere, but I couldn't find it.

I don't have direct control over the actual archive website, which is managed by our computing service. I have contacted them and hope that they will do something about this.

Larry Paulson
-pre, tt {font-family: Courier, monospace; font-size: 90%;}
+pre, tt {font-family: Courier, monospace; font-size: 90%; white-space: pre-wrap;}
==
Askar Safin
http://vk.com/safinaskar
Lawrence Paulson
2018-09-12 14:23:40 UTC
Permalink
Incredibly, the central university administrators agreed to this change, so it should work now.

You will probably have to clear the caches on your browser however. It looks the same to me using my main browser and I had to use a different browser to see the effect of the new style sheet.

Larry
-pre, tt {font-family: Courier, monospace; font-size: 90%;}
+pre, tt {font-family: Courier, monospace; font-size: 90%; white-space: pre-wrap;}
==
Askar Safin
http://vk.com/safinaskar
Ken Kubota
2018-09-05 12:54:27 UTC
Permalink
Post by José Manuel Rodriguez Caballero
The problem is that Abstract Algebra concerns the properties of structures
which are independent from their concrete presentations. For any R-module
In order to express this properly, type abstraction is required, which abstracts
from the concrete type ("their concrete presentations"). It creates a link between
the type and the term level, e.g.
[\t.\*:ttt . a * id = a ]
or
[\t.\x_{ttt} . a x id = a ]
for some identity element id.
Note that the variable t appears both at the term and at the type (subscript) level.

Standard HOL doesn't provide this feature, which was already suggested by
HOL founder Mike Gordon (he called it "'second order' λ-terms" [Gordon, 2001, p. 22]).
Extended HOL (Melham) provides quantification over types, but not the binding
of type variables with lambda (type abstraction) - like Andrews' system Q presented
in his Ph.D. thesis [Andrews, 1965] to which Tom refers explicitly in [Melham, 1993b].

With type abstraction, it is possible to prove abstract properties ("properties of
structures") and then transfer them to concrete objects.

Group theory is best suited to demonstrate this, and I also chose group theory:
http://owlofminerva.net/kubota/software-implementation-of-the-mathematical-logic-r0-available-for-download/#type_abstraction
See the definitions "Grp" and "GrpIdy" there.

In my example I proved that the identity element of a group is unique (p. 367),
and then instantiated (p. 423) this general theorem valid for any group to a concrete
group (XOR) after proving that XOR is a group (p. 420) at
http://doi.org/10.4444/100.10.2

In order to verify the abstract proof and to see the group definition details, run
make group_identity_element_unique.r0.out.html && open $_
make group.r0.out.html && open $_
on any Mac after downloading the software (license restrictions apply) at
http://doi.org/10.4444/100.10.3

It is possible to use auxiliary constructs such as the Isabelle axiomatic type classes,
but then additional checks have to be implemented since the syntax of the formal language
doesn't have the expressiveness which would be necessary for naturally representing
the mathematical structure in question.

For references, please see: http://doi.org/10.4444/100.111

Kind regards,

Ken Kubota

____________________________________________________


Ken Kubota
http://doi.org/10.4444/100
Post by José Manuel Rodriguez Caballero
Post by Lawrence Paulson
HOL Light defines a type “frag” of free Abelian groups over some other
type: finite maps from type elements to integers. Each such map represents
a monomial with integer exponents.
I don't think we have anything like that. It is a very nice structure,
but I have never really run into a situation where I needed anything
like it.
There is a deep theoretical reason in order to explain why the above
mentioned frag from HOL Light is avoided, whenever it is possible, in
https://www.springer.com/gp/book/9780387953854
First, a little bit of terminology. Let M be a module over the ring R
(R-module for short). The R-module of finite maps from elements in M to R,
which are homomorphisms, is denoted M* and it is called the dual R-module
of M. An Abelian group is the same as an R-module, where R is the ring of
integers, denoted Z. If M a free Z-module, i.e. a free Abelian group, then
M* can be identified with the above-mentioned frag of HOL Light, endowed
https://en.wikipedia.org/wiki/Dual_module
The problem is that Abstract Algebra concerns the properties of structures
which are independent from their concrete presentations. For any R-module
M, its dual R-module M* depends upon both M and a set S of generators of M.
In general, for a given M, there are many choices of the set S. So, in
order to prove a property of M from a property of M*, the set S should be
arbitrary from the beginning of the proof. Otherwise, the property of M*
will be translated into a property of the pair (M, S), not just of M.
Abstract Algebra is not interested in the pair (M, S), although
Computational Algebra may be interested in such a pair.
This problem was the main motivation for the introduction of the concept of
natural transformation, and then for the development of Category Theory.
For example, there is a natural transformation between M and M** (its
double dual, i.e., the dual of its dual).
Text (advanced): https://ncatlab.org/nlab/show/natural+transformation
Video (elementary introduction): http://youtu.be/2LJC-XD5Ffo
Kind Regards,
Jose M.
José Manuel Rodriguez Caballero
2018-09-06 04:30:36 UTC
Permalink
Post by Ken Kubota
Standard HOL doesn't provide this feature, which was already suggested by
HOL founder Mike Gordon (he called it "'second order' λ-terms" [Gordon, 2001, p. 22]).
Extended HOL (Melham) provides quantification over types, but not the binding
of type variables with lambda (type abstraction) - like Andrews' system Q presented
in his Ph.D. thesis [Andrews, 1965] to which Tom refers explicitly in [Melham, 1993b].
With type abstraction, it is possible to prove abstract properties ("properties of
structures") and then transfer them to concrete objects.
I am interested in this subject because I am working with the free abelian
group of primitive Pythagorean triangles (motivated for number-theoretic
reasons):

Eckert, Ernest J. "Primitive pythagorean triples." The College Mathematics
Journal 23.5 (1992): 413-417.
https://www.jstor.org/stable/pdf/2686417.pdf?casa_token=eoApY3SZBlIAAAAA:rx2mm61ERF6Y_xQ4vt2P3cIDyRPVibbLSqXZqBveMv_I6L0EPqsS12vpgZBxU4vBRyiHbqG-yX2FJR_nI14nfSOUSLhe44WOJGAUIxVFuO4ewTG9TA

Could the universal property of free abelian groups be stated in
Isabelle/HOL?

I recall the universal property of a free abelian group F with basis B: for
every function f from B to an abelian group A, there exists a unique group
homomorphism from F to A which extends f.

Kind Regards,
Jose M.
Continue reading on narkive:
Loading...