# 104 real nondegenerate quadrics through \(3\) points, tangent to \(3\) lines, and tangent to \(3\) planes.

Generically, there are \(104\) real nondegenerate quadrics which go through \(3\) points, are tangent to \(3\) lines, and are tangent to \(3\) planes in \(\mathbb{R}^3\).

## Question: Can all \(104\) be real?

The answer is yes and the following code serves as a mathematical proof.

More generally, for \(\alpha+\beta+\gamma=9\), one may ask if all nondegenerate quadrics through \(\alpha\) points, tangent to \(\beta\) lines, and tangent to \(\gamma\) planes can be made to be real. This is the aim of [BFS]. Out of \(55\) such problems indexed by the triples \((\alpha,\beta,\gamma)\), there are at least \(46\) which can be made fully real.

[BFS] Taylor Brysiewicz, Claudia Fevola, and Bernd Sturmfels. *Tangent Quadrics in Real 3-Space.* ARXIV: https://arxiv.org/abs/2010.10879 CODE: https://software.mis.mpg.de/TangentQuadricsInThreeSpace

## We first load necessary packages.

```
[1]:
```

```
using TangentQuadrics, HomotopyContinuation
```

```
┌ Info: Precompiling TangentQuadrics [feaab018-b7f7-4bdc-81a2-a469b2eb1929]
└ @ Base loading.jl:1278
```

These three points, lines, and planes are written in Plücker coordinates and are stored in the array \(\texttt{Witness[3,3,3]}\).

\(P_1=[1, 439/922, -347/271, 67/343]\),

\(P_2=[1, -211/484, 153/346, 257/254]\),

\(P_3=[1, -575/404, 131/320, -37/42]\)

\(L_1=[92/159, 92/293, -120/307, -77/256, -76/391, -96/311]\),

\(L_2=[-107/114, -18/383, 109/116, -37/217, -45/307, -47/264]\),

\(L_3=[-365/302, -45/368, 172/209, 74/245, 25/62, 87/353]\)

\(H_1=[193/182, 75/397, -244/631, 195/272]\),

\(H_2=[91/307, -17/122, -553/837, 70/309]\),

\(H_3=[919/295, 103/36, 1199/371, 57/176]\)

```
[2]:
```

```
Points=Witness[3,3,3][1]
Lines=Witness[3,3,3][2]
Planes=Witness[3,3,3][3];
```

## The following code certifies that there are \(104\) real nondegenerate quadrics satisfying the nine tangency conditions.

Disclaimer: The code below may not succeed the first time, as the computation involves some level of randomness. Nonetheless, a single success is a mathematical proof that all 104 quadrics are real and nondegenerate.

## Construct the equations.

These are given in the \(10\) variables of a symmetric \(4 \times 4\) matrix \(X=(x_{ij})\) and the \(11\)-th unknown \(D=\text{det}(X)\). The variable order is \((D,x_{11}..x_{14},x_{22}..x_{24},x_{33},x_{34},x_{44})\).

```
[3]:
```

```
Equations = TangencySystem(Points,Lines,Planes);
```

## Then solve these equations numerically.

```
[4]:
```

```
S = SolveTangencySystem(Points,Lines,Planes)
```

```
Tracking 104 paths... 100%|█████████████████████████████| Time: 0:00:00
# paths tracked: 104
# non-singular solutions (real): 104 (104)
# singular endpoints (real): 0 (0)
# total solutions (real): 104 (104)
```

```
[4]:
```

```
Result with 104 solutions
=========================
• 104 paths tracked
• 104 non-singular solutions (104 real)
• random_seed: 0x8726805c
```

## Certify that these solutions do indeed correspond to real solutions.

```
[5]:
```

```
C=certify(Equations,S)
```

```
Certifying 104 solutions... 100%|███████████████████████| Time: 0:00:00
# solutions candidates considered: 104
# certified solution intervals (real): 104 (104)
```

```
[5]:
```

```
CertificationResult
===================
• 104 solution candidates given
• 104 certified solution intervals (104 real)
• 104 distinct certified solution intervals (104 real)
```

## Certify that all \(104\) solutions are nondegenerate.

```
[6]:
```

```
certify_nondegenerate_quadrics(C)
```

```
Nondegenerate quadrics: 104 (104 real)
```