-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProjectiveSpace.class.st
More file actions
173 lines (148 loc) · 5.45 KB
/
Copy pathProjectiveSpace.class.st
File metadata and controls
173 lines (148 loc) · 5.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
"
Projective spaces P^nR as schemes, i.e. Proj R[x1,...,xn] for some commutative ring R.
"
Class {
#name : #ProjectiveSpace,
#superclass : #ProjectiveVariety,
#category : #'Mathematics-Schemes-Projective'
}
{ #category : #'instance creation' }
ProjectiveSpace class >> coordinateRing: aPolynomialRing [
^ (aPolynomialRing rank = 1 ifTrue: [ProjectiveLine] ifFalse: [self]) new coordinateRing: aPolynomialRing
]
{ #category : #examples }
ProjectiveSpace class >> example1 [
"The rational projective plane:"
^ ProjectiveSpace new: 2 over: QQ
]
{ #category : #examples }
ProjectiveSpace class >> example2 [
"Or assigning names to the indeterminates of the homogeneous coordinate ring:"
^ ProjectiveSpace new: #(x y z) over: QQ
]
{ #category : #examples }
ProjectiveSpace class >> example3 [
"And equivalently:"
^ (QQ polynomialsIn: #(x y z)) proj
]
{ #category : #'instance creation' }
ProjectiveSpace class >> new: rank over: aRing [
^ self coordinateRing:
(rank isInteger
ifTrue: [aRing polynomialsIn: rank+1]
ifFalse: [aRing polynomialsIn: rank])
]
{ #category : #accessing }
ProjectiveSpace >> ambient [
^ self
]
{ #category : #morphisms }
ProjectiveSpace >> automorphisms [
"Answer the group of automorphisms PGL(P), i.e. the linear automorphisms. These are the only regular automorphisms.
Note that there are more rational automorphisms, the Cremona maps, but they are not included in this group. In the projective plane, the group of birational automorphisms is generated by the linear automorphisms plus the standard quadratic transformation (that takes each coordinate to its reciprocal xi -> 1/xi)."
self notYetImplemented
]
{ #category : #operations }
ProjectiveSpace >> cartProd: aProjectiveSpace [ "◊ "
"Answer the cartesian product of the receiver and the argument."
(aProjectiveSpace isKindOf: ProjectiveSpace)
ifFalse: [^' super ◊ aProjectiveSpace'].
^ ProductProjectiveSpace components: {self. aProjectiveSpace}
]
{ #category : #accessing }
ProjectiveSpace >> dimension [
^ self coordinateRing dimension - 1
]
{ #category : #accessing }
ProjectiveSpace >> gradings [
"Answer the gradings of the coordinate ring of the receiver.
When all the gradings are 1 this is ordinary projective space, otherwise it is a weighted (or graded) projective space."
^ self coordinateRing gradings
]
{ #category : #accessing }
ProjectiveSpace >> ideal [
"Answer the defining ideal of the receiver, considered as a subscheme of itself."
^ self coordinateRing zeroIdeal
]
{ #category : #testing }
ProjectiveSpace >> isOrdinaryProjectiveSpace [
"Answer true if the receiver is the ordinary projective space, which means that it's not weighted (or that all weights or gradings are 1)."
^ self coordinateRing gradings allSatisfy: [:each| each = 1]
]
{ #category : #testing }
ProjectiveSpace >> isPlane [
^ self rank = 3
]
{ #category : #private }
ProjectiveSpace >> newPatch: i [
^ (self coordinateRing copyWithout: i) spec
]
{ #category : #points }
ProjectiveSpace >> pointsCountOver: aRing [
aRing isField ifTrue: [^ aRing isFinite ifTrue: [^ self rank choose: 1 q: aRing size] ifFalse: [aRing size]].
aRing isFinite ifFalse: [^ aRing size].
(aRing isKindOf: ModularIntegerRing)
ifTrue:
[^ ((aRing modulus) raisedTo: (self rank - 1) )* ((aRing modulus factors asSet collect: [:p| (0 to: self rank - 1) sum: [:i| 1 / (p raisedTo: i)]]) fold: [:a :b| a*b])].
^ super pointsCountOver: aRing
]
{ #category : #points }
ProjectiveSpace >> pointsOver: aRing do: aBlock [
| old |
aRing isField ifTrue: [^ self pointsOverField: aRing do: aBlock].
(aRing isKindOf: RationalIntegerRing)
ifTrue: [^ self pointsOverIntegersDo: aBlock].
old := Set new.
'aRing ^ self rank do: [:each|
| point |
each isZero ifFalse:
[point := self pointAt: each.
old add: point ifAbsent: [aBlock value: point]]]'
]
{ #category : #'points-private' }
ProjectiveSpace >> pointsOverField: aRing do: aBlock [
| one zero |
one := aRing one.
zero := aRing zero.
'aRing ^ (self rank - 1) do: [:each|
(each isZero not and: [(each at: each lastNonZero) = one])
ifTrue: [aBlock value: (self pointAt: each, zero)].
aBlock value: (self pointAt: (each, one))]'.
]
{ #category : #printing }
ProjectiveSpace >> printOn: aStream [
aStream nextPutAll: 'PP'; nextPutAll: (self rank - 1) printString; print: self scalars
]
{ #category : #morphisms }
ProjectiveSpace >> quadraticMap [
"Answer the standard quadratic map that takes each coordinate to its reciprocal.
This is a birational automorphism. In the projective plane, this automorphism together with the linear automorphisms of PGL generate the group of birational automorphisms."
^ self to: self evaluating: [:x| x apply: [:each| each reciprocal]]
]
{ #category : #accessing }
ProjectiveSpace >> rank [
^ self coordinateRing rank
]
{ #category : #testing }
ProjectiveSpace >> satisfies: aTuple [
^ true
]
{ #category : #private }
ProjectiveSpace >> saturated [
^ self
]
{ #category : #operations }
ProjectiveSpace >> subscheme: anObject [
| I |
I := (anObject isKindOf: Ideal)
ifTrue: [anObject] ifFalse: [self coordinateRing * anObject].
^ (self coordinateRing / I) proj
]
{ #category : #morphisms }
ProjectiveSpace >> veronese: degree [
"Answer the Veronese map of the given degree from the receiver."
| F monomials |
F := self functionField.
monomials := (F integers allMonomialsOfDegree: degree) collect: [:each| F embed: each].
^ RationalMap from: self to: (ProjectiveSpace new: monomials size - 1 over: self scalars) representatives: monomials
]