Orbiter 2022
Combinatorial Objects
arc_lifting_with_two_lines.cpp
Go to the documentation of this file.
1// arc_lifting_with_two_lines.cpp
2//
3// Anton Betten, Fatma Karaoglu
4//
5// December 27, 2018
6//
7//
8//
9//
10
11#include "foundations.h"
12
13using namespace std;
14
15
16namespace orbiter {
17namespace layer1_foundations {
18namespace algebraic_geometry {
19
20
22{
23 null();
24}
25
27{
28 freeself();
29}
30
32{
33 q = 0;
34 F = NULL;
35 Surf = NULL;
36 Arc6 = NULL;
37 Arc_coords = NULL;
38
39}
40
42{
43 if (Arc_coords) {
45 }
46 null();
47}
48
50 surface_domain *Surf,
51 long int *Arc6, long int line1, long int line2,
52 int verbose_level)
53// line1 = b1
54// line2 = b2
55// and Arc6 is the six-arc arising as image of
56// the half double-six a1, a2, a3, a4, a5, a6
57// The arc must be given as points in PG(3,q), not in PG(2,q).
58// The partition is missing.
59{
60 int f_v = (verbose_level >= 1);
61 int f_vv = (verbose_level >= 2);
62 int q;
63 int base_cols[4];
64 int Basis[16];
65 int Transversals[4 * 8];
66 int rk;
68
69 if (f_v) {
70 cout << "arc_lifting_with_two_lines::create_surface" << endl;
71 cout << "line1=" << line1 << " line2=" << line2 << endl;
72 cout << "Arc6: ";
73 Lint_vec_print(cout, Arc6, 6);
74 cout << endl;
75 }
76
77 arc_size = 6;
82
83 F = Surf->F;
84 q = F->q;
85
86
87 Arc_coords = NEW_int(6 * 4);
89
91 Arc_coords, 6, 4 /*dimension*/,
92 base_cols, 0 /* verbose_level */);
93 if (rk != 3) {
94 cout << "arc_lifting_with_two_lines::create_surface "
95 "the arc does not lie in a plane" << endl;
96 cout << "rk=" << rk << endl;
97 exit(1);
98 }
100
101
103
104 if (f_vv) {
105 cout << "arc_lifting_with_two_lines::create_surface "
106 "plane_rk=" << plane_rk << endl;
107 }
108
109 if (line1 == 0 && line2 == 0) {
110 if (f_v) {
111 cout << "arc_lifting_with_two_lines::create_surface both lines are zero, "
112 "meaning we will pick our own lines" << endl;
113 }
114 if (f_v) {
115 cout << "arc_lifting_with_two_lines::create_surface before Surf->P->find_two_lines_for_arc_lifting" << endl;
116 }
118 Arc6[0] /* P1 */, Arc6[1] /* P2 */, line1, line2,
119 verbose_level - 2);
120 if (f_v) {
121 cout << "arc_lifting_with_two_lines::create_surface after Surf->P->find_two_lines_for_arc_lifting" << endl;
122 }
123 }
124
125 if (f_v) {
126 cout << "arc_lifting_with_two_lines::create_surface line1=" << line1 << endl;
127 cout << "arc_lifting_with_two_lines::create_surface line2=" << line2 << endl;
128 }
129
130
131 Surf->unrank_line(Basis, line1);
132 Surf->unrank_line(Basis + 8, line2);
133 if (f_vv) {
134 cout << "arc_lifting_with_two_lines::create_surface" << endl;
135 cout << "line1=" << line1 << ":" << endl;
137 cout << "line2=" << line2 << ":" << endl;
139 }
141 Basis, 4, 4 /*dimension*/,
142 base_cols,
143 0 /* verbose_level */);
144 if (rk != 4) {
145 cout << "arc_lifting_with_two_lines::create_surface "
146 "the two lines are not skew" << endl;
147 exit(1);
148 }
149
151 line1,
152 plane_rk,
153 0 /* verbose_level */);
154
156 line2,
157 plane_rk,
158 0 /* verbose_level */);
159
160 if (f_vv) {
161 cout << "P[0]=" << P[0] << endl;
162 cout << "P[1]=" << P[1] << endl;
163 }
164
165 // P[0] and P[1] are points on the arc.
166 // Find them and remove them
167 // so we can find the remaining four point of the arc:
168 int i, a, h;
169
170 h = 2;
171 for (i = 0; i < 6; i++) {
172 a = Arc6[i];
173 if (a == P[0] || a == P[1]) {
174 continue;
175 }
176 P[h++] = a;
177 }
178 if (h != 6) {
179 cout << "arc_lifting_with_two_lines::create_surface "
180 "h != 6" << endl;
181 exit(1);
182 }
183 // now P[2], P[3], P[4], P[5] are the remaining four points
184 // of the arc.
185
186 if (f_vv) {
187 cout << "P[]: ";
188 Lint_vec_print(cout, P, 6);
189 cout << endl;
190 }
191
193 // the line c_12
194
195 if (f_vv) {
196 cout << "arc_lifting_with_two_lines::create_surface "
197 "transversal_01=" << transversal_01 << endl;
198 }
199
201 // the line c_23
202
203 if (f_vv) {
204 cout << "arc_lifting_with_two_lines::create_surface "
205 "transversal_23=" << transversal_23 << endl;
206 }
208 // the line c_45
209
210 if (f_vv) {
211 cout << "arc_lifting_with_two_lines::create_surface "
212 "transversal_23=" << transversal_45 << endl;
213 }
214
215
217
218 if (f_vv) {
219 cout << "arc_lifting_with_two_lines::create_surface "
220 "rearranged arc:" << endl;
221 Lint_vec_print(cout, P, 6);
222 cout << endl;
224 }
225
226 for (i = 0; i < 4; i++) {
227 transversal[i] =
229 line1, line2, P[2 + i],
230 0 /* verbose_level */);
231 Surf->unrank_line(Transversals + i * 8, transversal[i]);
232 }
233 if (f_vv) {
234 cout << "arc_lifting_with_two_lines::create_surface "
235 "transversal:" << endl;
236 Lint_vec_print(cout, transversal, 4);
237 cout << endl;
238 cout << "Transversals:" << endl;
240 }
241
242 input_Lines[0] = line1;
243 input_Lines[1] = line2;
247 input_Lines[5] = transversal[0];
248 input_Lines[6] = transversal[1];
249 input_Lines[7] = transversal[2];
250 input_Lines[8] = transversal[3];
251
252
254 9, input_Lines,
255 coeff, 0/* verbose_level*/);
256
257 if (f_v) {
258 cout << "arc_lifting_with_two_lines::create_surface "
259 "coeff:" << endl;
260 Int_vec_print(cout, coeff, 20);
261 cout << endl;
262
264 cout << endl;
265 }
266
267 // now we have a 4 + 2:
268 // b1 b2 . . . .
269 // . . a3 a4 a5 a6
270 //
271 // where b1 = line1, b2 = line2
272 // and a3 = transversal[0]
273 // and a4 = transversal[1]
274 // and a5 = transversal[2]
275 // and a6 = transversal[3]
276 //
277 // it remains to fill in the missing lines
278 // to create a double six.
279
280 // The points of a2 can be found in the following way:
281 // Consider any line L through P2 and a point on b1 (but not on c12).
282 // Each such line intersects a2
283 // in the tritangent plane through c12, b1, a2.
284 // The point on a2 can be found as the third point of intersection of
285 // F (F is the surface equation)
286 // with the line L (besides the point on b1 and the point P2).
287
288 // By doing this for two different lines through P2 and b1,
289 // two distinct points on a1 are found.
290 // This determines a1.
291
292 int B1[8];
293 int P2[4];
294 int pt1 = 0, pt2 = 0;
295 int i1, i2, j1, j2;
296
297 Surf->unrank_line(B1, line1);
298 Surf->P->unrank_point(P2, P[1]);
299
300 for (i1 = 0; i1 <= q; i1++) {
302 line1, i1 /*pt_rk*/, 0 /* verbose_level*/);
303 if (!Surf->P->is_incident(pt1, transversal_01)) {
304 if (f_vv) {
305 cout << "found point pt1 which is not on "
306 "transversal_01, i1=" << i1 << endl;
307 }
308 break;
309 }
310 }
311 if (i1 == q + 1) {
312 cout << "arc_lifting_with_two_lines::create_surface could "
313 "not find first point on line b1" << endl;
314 exit(1);
315 }
316 for (i2 = i1 + 1; i2 <= q; i2++) {
318 line1, i2 /*pt_rk*/, 0 /* verbose_level*/);
319 if (!Surf->P->is_incident(pt2, transversal_01)) {
320 break;
321 }
322 }
323 if (i2 == q + 1) {
324 cout << "arc_lifting_with_two_lines::create_surface could "
325 "not find second point on line b1" << endl;
326 exit(1);
327 }
328
329 if (f_vv) {
330 cout << "arc_lifting_with_two_lines::create_surface "
331 "pt1=" << pt1 << " pt2=" << pt2 << endl;
332 }
333
334 int line3, line4;
335 int pt3 = 0, pt4 = 0;
336 int val;
337
338 line3 = Surf->P->line_through_two_points(P[1], pt1);
339 line4 = Surf->P->line_through_two_points(P[1], pt2);
340
341 for (j1 = 0; j1 <= q; j1++) {
343 line3, j1 /*pt_rk*/, 0 /* verbose_level */);
345 //cout << "j1=" << j1 << " pt3=" << pt3 << " val=" << val << endl;
346 if (pt3 == P[1]) {
347 if (f_vv) {
348 cout << "pt3 == P[1], skipping" << endl;
349 }
350 continue;
351 }
352#if 1
353 if (pt3 == pt1) {
354 if (f_vv) {
355 cout << "pt3 == pt1, skipping" << endl;
356 }
357 continue;
358 }
359#endif
360 if (val == 0) {
361 break;
362 }
363 }
364 if (j1 == q + 1) {
365 if (f_vv) {
366 cout << "arc_lifting_with_two_lines::create_surface "
367 "j1 == q + 1, picking pt1" << endl;
368 }
369 pt3 = pt1;
370 }
371
372 for (j2 = 0; j2 <= q; j2++) {
374 line4, j2 /*pt_rk*/, 0 /* verbose_level*/);
375 if (pt4 == P[1]) {
376 continue;
377 }
378#if 1
379 if (pt4 == pt2) {
380 continue;
381 }
382#endif
384 //cout << "j2=" << j2 << " pt4=" << pt4 << " val=" << val << endl;
385 if (val == 0) {
386 break;
387 }
388 }
389 if (j2 == q + 1) {
390 if (f_vv) {
391 cout << "arc_lifting_with_two_lines::create_surface "
392 "j2 == q + 1, picking pt2" << endl;
393 }
394 pt4 = pt2;
395 }
396
397 if (f_vv) {
398 cout << "arc_lifting_with_two_lines::create_surface "
399 "pt3=" << pt3 << " pt4=" << pt4 << endl;
400 }
401
402 int a2;
403 int basis_a2[8];
404
405 a2 = Surf->P->line_through_two_points(pt3, pt4);
406 Surf->unrank_line(basis_a2, a2);
407
408
409 if (f_v) {
410 cout << "arc_lifting_with_two_lines::create_surface "
411 "a2=" << a2 << endl;
412 cout << "basis_a2:" << endl;
414 }
415
416
417 // now we have:
418 // b1 b2 . . . .
419 // . a2 a3 a4 a5 a6
420 //
421 // where b1 = line1, b2 = line2
422 // and a3 = transversal[0]
423 // and a4 = transversal[1]
424 // and a5 = transversal[2]
425 // and a6 = transversal[3]
426 //
427
428 // We consider the 5 + 1 formed by b1 and a2,a3,a4,a5,a6:
429 //
430 // We pick the five point in order a3,a4,a5,a6,a2,
431 // so the double six will be
432 // a3 a4 a5 a6 a2 a1
433 // b3 b4 b5 b6 b2 b1
434
435 long int five_pts[5];
436 long int double_six_special[12];
437 long int double_six[12];
438
439 five_pts[0] = transversal[0];
440 five_pts[1] = transversal[1];
441 five_pts[2] = transversal[2];
442 five_pts[3] = transversal[3];
443 five_pts[4] = a2;
444
445 if (f_vv) {
446 cout << "arc_lifting_with_two_lines::create_surface "
447 "five_pts=";
448 Lint_vec_print(cout, five_pts, 5);
449 cout << endl;
450 }
451 if (f_vv) {
452 cout << "arc_lifting_with_two_lines::create_surface "
453 "before Surf->create_double_six_from_five_"
454 "lines_with_a_common_transversal" << endl;
455 }
457 five_pts, double_six_special,
458 verbose_level - 10);
459 if (f_vv) {
460 cout << "arc_lifting_with_two_lines::create_surface "
461 "after Surf->create_double_six_from_five_"
462 "lines_with_a_common_transversal" << endl;
463 }
464
465 // the double six is
466 // a3 a4 a5 a6 a2 a1
467 // b3 b4 b5 b6 b2 b1
468
469
470 if (f_vv) {
471 cout << "arc_lifting_with_two_lines::create_surface "
472 "double_six_special=";
473 Lint_vec_print(cout, double_six_special, 12);
474 cout << endl;
475 }
476 double_six[0] = double_six_special[5];
477 double_six[1] = double_six_special[4];
478 double_six[2] = double_six_special[0];
479 double_six[3] = double_six_special[1];
480 double_six[4] = double_six_special[2];
481 double_six[5] = double_six_special[3];
482 double_six[6 + 0] = double_six_special[6 + 5];
483 double_six[6 + 1] = double_six_special[6 + 4];
484 double_six[6 + 2] = double_six_special[6 + 0];
485 double_six[6 + 3] = double_six_special[6 + 1];
486 double_six[6 + 4] = double_six_special[6 + 2];
487 double_six[6 + 5] = double_six_special[6 + 3];
488
489 if (f_v) {
490 cout << "arc_lifting_with_two_lines::create_surface "
491 "double_six=";
492 Lint_vec_print(cout, double_six, 12);
493 cout << endl;
494 }
495 Lint_vec_copy(double_six, lines27, 12);
497 lines27 + 12, verbose_level - 10);
498
499 if (f_v) {
500 cout << "arc_lifting_with_two_lines::create_surface "
501 "done" << endl;
502 }
503}
504
505}}}
506
507
void create_surface(surface_domain *Surf, long int *Arc6, long int line1, long int line2, int verbose_level)
int create_double_six_from_five_lines_with_a_common_transversal(long int *five_pts, long int *double_six, int verbose_level)
Given a five-plus-one five_pts[5], complete the double-six.
void create_the_fifteen_other_lines(long int *double_six, long int *fifteen_other_lines, int verbose_level)
Given a double six in double_six[12], compute the 15 remaining lines cij.
ring_theory::homogeneous_polynomial_domain * Poly3_4
void build_cubic_surface_from_lines(int len, long int *S, int *coeff, int verbose_level)
various functions related to geometries
Definition: geometry.h:721
void find_two_lines_for_arc_lifting(projective_space *P, long int P1, long int P2, long int &line1, long int &line2, int verbose_level)
int point_of_intersection_of_a_line_and_a_plane_in_three_space(long int line, int plane, int verbose_level)
long int transversal_to_two_skew_lines_through_a_point(long int line1, long int line2, int pt, int verbose_level)
long int line_through_two_points(long int p1, long int p2)
int create_point_on_line(long int line_rk, int pt_rk, int verbose_level)
int Gauss_simple(int *A, int m, int n, int *base_cols, int verbose_level)
#define Lint_vec_copy(A, B, C)
Definition: foundations.h:694
#define FREE_int(p)
Definition: foundations.h:640
#define Lint_vec_print(A, B, C)
Definition: foundations.h:686
#define NEW_int(n)
Definition: foundations.h:625
#define Int_vec_print(A, B, C)
Definition: foundations.h:685
orbiter_kernel_system::orbiter_session * Orbiter
global Orbiter session
the orbiter library for the classification of combinatorial objects