# Coverings

`Covering`

s are the backbone data structure for `CoveredScheme`

s in Oscar.

`Covering`

— Type`Covering`

A covering of a scheme $X$ by affine charts $Uᵢ$ which are glued along isomorphisms $gᵢⱼ : Uᵢ⊃ Vᵢⱼ → Vⱼᵢ ⊂ Uⱼ$.

**Note:** The distinction between the different affine charts of the scheme is made from their hashes. Thus, an affine scheme must not appear more than once in any covering!

## Constructors

`Covering`

— Method`Covering(patches::Vector{<:AbsSpec})`

Return a `Covering`

with pairwise disjoint affine charts $Uᵢ$ given by the entries of `patches`

. This `Covering`

will have no glueings except those glueings along the identity of every affine chart to itself.

**Examples**

```
julia> P1, (x,y) = QQ["x", "y"];
julia> P2, (u,v) = QQ["u", "v"];
julia> U1 = Spec(P1);
julia> U2 = Spec(P2);
julia> C = Covering([U1, U2]) # A Covering with two disjoint affine charts
Covering
described by patches
1: spec of multivariate polynomial ring
2: spec of multivariate polynomial ring
in the coordinate(s)
1: [x, y]
2: [u, v]
```

`disjoint_union`

— Method`disjoint_union(C1::Covering, C2::Covering)`

Return the `Covering`

corresponding to the disjoint union of `C1`

and `C2`

.

The charts and glueings of the disjoint union are given by the disjoint union of the charts and glueings of the covers `C1`

and `C2`

.

**Examples**

```
julia> P1, (x,y) = QQ["x", "y"];
julia> P2, (u,v) = QQ["u", "v"];
julia> U1 = Spec(P1);
julia> U2 = Spec(P2);
julia> C1 = Covering(U1) # Set up the trivial covering with only one patch
Covering
described by patches
1: spec of multivariate polynomial ring
in the coordinate(s)
1: [x, y]
julia> C2 = Covering(U2)
Covering
described by patches
1: spec of multivariate polynomial ring
in the coordinate(s)
1: [u, v]
julia> C = disjoint_union(C1, C2)
Covering
described by patches
1: spec of multivariate polynomial ring
2: spec of multivariate polynomial ring
in the coordinate(s)
1: [x, y]
2: [u, v]
```

## Attributes

`affine_charts`

— Method`affine_charts(C::Covering)`

Return the list of affine charts that make up the `Covering`

`C`

.

`glueings`

— Method`glueings(C::Covering)`

Return a dictionary of glueings of the `affine_chart`

s of `C`

.

The keys are pairs `(U, V)`

of `affine_chart`

s. One can also use `C[U, V]`

to obtain the respective glueing.

**Note:** Glueings are lazy in the sense that they are in general only computed when asked for. This method only returns the internal cache, but does not try to compute new glueings.

## Methods

`add_glueing!`

— Method`add_glueing!(C::Covering, G::AbsGlueing)`

Add a glueing `G`

to the covering `C`

.

The `patches`

of `G`

must be among the `affine_charts`

of `C`

.

**Examples**

```
julia> P1, (x,y) = QQ["x", "y"];
julia> P2, (u,v) = QQ["u", "v"];
julia> U1 = Spec(P1);
julia> U2 = Spec(P2);
julia> C = Covering([U1, U2]) # A Covering with two disjoint affine charts
Covering
described by patches
1: spec of multivariate polynomial ring
2: spec of multivariate polynomial ring
in the coordinate(s)
1: [x, y]
2: [u, v]
julia> V1 = PrincipalOpenSubset(U1, x); # Preparations for glueing
julia> V2 = PrincipalOpenSubset(U2, u);
julia> f = SpecMor(V1, V2, [1//x, y//x]); # The glueing isomorphism
julia> g = SpecMor(V2, V1, [1//u, v//u]); # and its inverse
julia> G = Glueing(U1, U2, f, g); # Construct the glueing
julia> add_glueing!(C, G) # Make the glueing part of the Covering
Covering
described by patches
1: spec of multivariate polynomial ring
2: spec of multivariate polynomial ring
in the coordinate(s)
1: [x, y]
2: [u, v]
julia> C[U1, U2] == G # Check whether the glueing of U1 and U2 in C is G.
true
```

# Glueings

Glueings are used to identify open subsets $U \subset X$ and $V \subset Y$ of affine schemes along an isomorphism $f \colon U \leftrightarrow V \colon g$.

## Types

The abstract type of any such glueing is

`AbsGlueing`

— Type`AbsGlueing`

A glueing of two affine schemes $X$ and $Y$ (the `patches`

) along open subsets $U$ in $X$ and $V$ in $Y$ (the `glueing_domains`

) along mutual isomorphisms $f : U ↔ V : g$ (the `glueing_morphisms`

).

The available concrete types are

`Glueing`

— Type`Glueing`

Concrete instance of an `AbsGlueing`

for glueings of affine schemes $X ↩ U ≅ V ↪ Y$ along open subsets $U$ and $V$ of type `SpecOpen`

.

`SimpleGlueing`

— Type`SimpleGlueing`

Concrete instance of an `AbsGlueing`

for glueings of affine schemes $X ↩ U ≅ V ↪ Y$ along open subsets $U$ and $V$ of type `PrincipalOpenSubset`

.

## Constructors

`Glueing`

— Method`Glueing(X::AbsSpec, Y::AbsSpec, f::SchemeMor, g::SchemeMor)`

Glue two affine schemes $X$ and $Y$ along mutual isomorphisms $f$ and $g$ of open subsets $U$ of $X$ and $V$ of $Y$.

**Examples**

```
julia> P1, (x,y) = QQ["x", "y"]; P2, (u,v) = QQ["u", "v"];
julia> U1 = Spec(P1); U2 = Spec(P2);
julia> V1 = PrincipalOpenSubset(U1, x); # Preparations for glueing
julia> V2 = PrincipalOpenSubset(U2, u);
julia> f = SpecMor(V1, V2, [1//x, y//x]); # The glueing isomorphism
julia> g = SpecMor(V2, V1, [1//u, v//u]); # and its inverse
julia> G = Glueing(U1, U2, f, g) # Construct the glueing
Glueing
of spec of multivariate polynomial ring
and spec of multivariate polynomial ring
along the open subsets
[x, y] spec of localized ring
[u, v] spec of localized ring
given by the pullback function
u -> 1/x
v -> y/x
julia> typeof(G)<:SimpleGlueing # Since the glueing domains were `PrincipalOpenSubsets`, this defaults to a `SimpleGlueing`
true
julia> # Alternative using SpecOpens as glueing domains:
julia> W1 = SpecOpen(U1, [x]); W2 = SpecOpen(U2, [u]);
julia> h1 = SpecOpenMor(W1, W2, [1//x, y//x]);
julia> h2 = SpecOpenMor(W2, W1, [1//u, v//u]);
julia> H = Glueing(U1, U2, h1, h2)
Glueing
of spec of multivariate polynomial ring
and spec of multivariate polynomial ring
along the open subsets
[x, y] complement to V(x) in affine scheme with coordinates [x, y]
[u, v] complement to V(u) in affine scheme with coordinates [u, v]
defined by the map
morphism
from [x, y] spec of localized ring
to [u, v] spec of multivariate polynomial ring
given by the pullback function
u -> 1/x
v -> y/x
julia> typeof(H)<:Glueing
true
```

## Attributes

`patches`

— Method`patches(G::AbsGlueing)`

Return a pair of affine schemes `(X, Y)`

which are glued by `G`

.

`glueing_domains`

— Method`glueing_domains(G::AbsGlueing)`

Return a pair of open subsets $U$ and $V$ of the respective `patches`

of `G`

which are glued by `G`

along the `glueing_morphisms`

of `G`

.

`glueing_morphisms`

— Method`glueing_morphisms(G::AbsGlueing)`

Return a pair of mutually inverse isomorphisms `(f, g)`

of open subsets $U$ and $V$ of the respective `patches`

of `G`

which are used for the glueing identification.

`inverse`

— Method`inverse(G::AbsGlueing)`

Return the glueing `H`

with `patches`

, `glueing_domains`

, and `glueing_morphisms`

in opposite order compared to `G`

.

## Methods

`compose`

— Method`compose(G::AbsGlueing, H::AbsGlueing)`

Given glueings `X ↩ U ≅ V ↪ Y`

and `Y ↩ V' ≅ W ↪ Z`

, return the glueing `X ↩ V ∩ V' ↪ Z`

.

**WARNING:** In general such a glueing will not provide a separated scheme. Use `maximal_extension`

to extend the glueing.

`maximal_extension`

— Method`maximal_extension(G::Glueing)`

Given a glueing `X ↩ U ≅ V ↪ Y`

, try to find the maximal extension to an open subset `U' ⊃ U`

in `X`

and `V' ⊃ V`

in `Y`

so that the resulting scheme is separated.

`restrict`

— Method`restrict(G::AbsGlueing, f::AbsSpecMor, g::AbsSpecMor; check::Bool=true)`

Given a glueing $X ↩ U ≅ V ↪ Y$ and isomorphisms $f : X → X'$ and $g: Y → Y'$, return the induced glueing of $X'$ and $Y'$.