# 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{<:AbsAffineScheme})`

Return a `Covering`

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

. This `Covering`

will have no gluings except those gluings 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: affine 2-space
2: affine 2-space
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 gluings of the disjoint union are given by the disjoint union of the charts and gluings 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: affine 2-space
in the coordinate(s)
1: [x, y]
julia> C2 = Covering(U2)
Covering
described by patches
1: affine 2-space
in the coordinate(s)
1: [u, v]
julia> C = disjoint_union(C1, C2)
Covering
described by patches
1: affine 2-space
2: affine 2-space
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`

.

`gluings`

— Method`gluings(C::Covering)`

Return a dictionary of gluings 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 gluing.

**Note:** Gluings 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 gluings.

## Methods

`add_gluing!`

— Method`add_gluing!(C::Covering, G::AbsGluing)`

Add a gluing `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: affine 2-space
2: affine 2-space
in the coordinate(s)
1: [x, y]
2: [u, v]
julia> V1 = PrincipalOpenSubset(U1, x); # Preparations for gluing
julia> V2 = PrincipalOpenSubset(U2, u);
julia> f = morphism(V1, V2, [1//x, y//x]); # The gluing isomorphism
julia> g = morphism(V2, V1, [1//u, v//u]); # and its inverse
julia> G = Gluing(U1, U2, f, g); # Construct the gluing
julia> add_gluing!(C, G) # Make the gluing part of the Covering
Covering
described by patches
1: affine 2-space
2: affine 2-space
in the coordinate(s)
1: [x, y]
2: [u, v]
julia> C[U1, U2] == G # Check whether the gluing of U1 and U2 in C is G.
true
```

# Gluings

Gluings 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 gluing is

`AbsGluing`

— Type`AbsGluing`

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

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

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

).

The available concrete types are

`Gluing`

— Type`Gluing`

Concrete instance of an `AbsGluing`

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

.

`SimpleGluing`

— Type`SimpleGluing`

Concrete instance of an `AbsGluing`

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

.

## Constructors

`Gluing`

— Method`Gluing(X::AbsAffineScheme, Y::AbsAffineScheme, 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 gluing
julia> V2 = PrincipalOpenSubset(U2, u);
julia> f = morphism(V1, V2, [1//x, y//x]); # The gluing isomorphism
julia> g = morphism(V2, V1, [1//u, v//u]); # and its inverse
julia> G = Gluing(U1, U2, f, g) # Construct the gluing
Gluing
of affine 2-space
and affine 2-space
along the open subsets
[x, y] AA^2 \ scheme(x)
[u, v] AA^2 \ scheme(u)
given by the pullback function
u -> 1/x
v -> y/x
julia> G isa SimpleGluing # Since the gluing domains were `PrincipalOpenSubsets`, this defaults to a `SimpleGluing`
true
julia> # Alternative using AffineSchemeOpenSubschemes as gluing domains:
julia> W1 = AffineSchemeOpenSubscheme(U1, [x]); W2 = AffineSchemeOpenSubscheme(U2, [u]);
julia> h1 = AffineSchemeOpenSubschemeMor(W1, W2, [1//x, y//x]);
julia> h2 = AffineSchemeOpenSubschemeMor(W2, W1, [1//u, v//u]);
julia> H = Gluing(U1, U2, h1, h2)
Gluing
of affine 2-space
and affine 2-space
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
affine scheme morphism
from [x, y] AA^2 \ scheme(x)
to [u, v] affine 2-space
given by the pullback function
u -> 1/x
v -> y/x
julia> H isa Gluing
true
```

## Attributes

`patches`

— Method`patches(G::AbsGluing)`

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

which are glued by `G`

.

`gluing_domains`

— Method`gluing_domains(G::AbsGluing)`

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

of `G`

which are glued by `G`

along the `gluing_morphisms`

of `G`

.

`gluing_morphisms`

— Method`gluing_morphisms(G::AbsGluing)`

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 gluing identification.

`inverse`

— Method`inverse(G::AbsGluing)`

Return the gluing `H`

with `patches`

, `gluing_domains`

, and `gluing_morphisms`

in opposite order compared to `G`

.

## Methods

`compose`

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

Given gluings `X ↩ U ≅ V ↪ Y`

and `Y ↩ V' ≅ W ↪ Z`

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

.

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

to extend the gluing.

`maximal_extension`

— Method`maximal_extension(G::Gluing)`

Given a gluing `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::AbsGluing, f::AbsAffineSchemeMor, g::AbsAffineSchemeMor; check::Bool=true)`

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