incr-set prlevel 1
if #0=4 START 
incr-set prlevel -1

;;; Usage:
;;; 	<hom_and_map a b c ff
;;;
;;; A presentation of the module 
;;; Hom(A,B) is put into the
;;; variable c. ff is set to the map 
;;;      ff: H0 --> A0^* \tensor B0 
;;; inducing the natural map 
;;;      H = Hom(A,B) --> Hom(A0,B),
;;; where 
;;;			a
;;; 	A1 --> A0 --> A --> 0
;;;         b
;;; 	B1 --> B0 --> B --> 0
;;;         c
;;; 	H1 --> H0 --> Hom(a,b) --> 0
;;; are the given presentations.
;;;
;;; To get actual maps: After 
;;; <hom_and_map a b c ff,
;;; if f1 is a column whose entries have degrees
;;; matching the column degrees of ff, then
;;; mult ff f1 f
;;; <map_from_col f a b g
;;; gives g: A0 --> B0 representing a map coker a --> coker b.

incr-set prlevel 1
jump END
;;;
;;; Parameters:
;;;		a,b = modules
;;; Output values:
;;;		c = Hom(a,b)
;;; 
;;; This script is used in the script
;;; double_dual1, where the map
;;; A --> Hom(Hom(A,B),B) is computed.
;;;
;;; We will compute Hom as the kernel of
;;; the map 
;;;                f = Hom(a,B) 
;;;		Hom(A0,B)  ------------>  Hom(A1,B), where
;;; where b is a presentation of B and
;;;         a
;;;		A1 --> A0
;;; is a.
;Last modified 2/20/89 DE
START:

;First we compute presentations g0 and g1 of
;	Hom(A0,b)  and  Hom(A1,b)
;from the presentation of b.

<idenrowdegs #1 @A0
<idencoldegs #1 @A1
<idenrowdegs #2 @B0

transpose @A0 A0_dual@
transpose @A1 A1_dual@

outer A0_dual@ #2 @g0
outer A1_dual@ #2 @g1

;Next we make the comparison map that comes
;from the presentation of a:

transpose #1 a'@
outer a'@ @B0 f@

<kernel_and_map f@ @g0 @g1 #3 #4

;Get a minimal form for the answers:
<prune_and_map #3 #3 @g
mult #4 @g #4

kill a'@ @A0 @A1 @B0
kill  A1_dual@ A0_dual@
kill @g0 @g1 f@ @g

END:
incr-set prlevel -1

$;;;;;;;; EXAMPLE SECTION ;;;;;;;;;;;;;;;;;;;;;;;;;
<hom_and_map
;This script is used by double_dual1 and by 
;random_map

