-
Notifications
You must be signed in to change notification settings - Fork 120
/
Types.jl
51 lines (43 loc) · 1.89 KB
/
Types.jl
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
########################################################################
# Abstract type for covered schemes #
########################################################################
@doc raw"""
AbsCoveredScheme{BaseRingType}
An abstract scheme ``X`` over some `base_ring` ``𝕜`` of type
`BaseRingType`, given by means of affine charts and their glueings.
"""
abstract type AbsCoveredScheme{BaseRingType} <: Scheme{BaseRingType} end
########################################################################
# A minimal implementation of AbsCoveredScheme #
########################################################################
@doc raw"""
CoveredScheme{BaseRingType}
A covered scheme ``X`` given by means of at least one `Covering`.
A scheme may possess several coverings which are partially ordered
by refinement. Use `default_covering(X)` to obtain one covering of ``X``.
"""
@attributes mutable struct CoveredScheme{BaseRingType} <: AbsCoveredScheme{BaseRingType}
coverings::Vector{<:Covering}
refinements::Dict{<:Tuple{<:Covering, <:Covering}, <:CoveringMorphism}
refinement_graph::Graph{Directed}
kk::BaseRingType
default_covering::Covering
function CoveredScheme(coverings::Vector{<:Covering},
refinements::Dict{Tuple{<:Covering, <:Covering}, <:CoveringMorphism}
)
# TODO: Check whether the refinements form a connected graph.
BaseRingType = base_ring_type(coverings[1])
all(x->(base_ring_type(x) == BaseRingType), coverings) || error("coverings are not compatible")
X = new{BaseRingType}(coverings, refinements)
X.default_covering = X.coverings[1]
X.kk = base_ring(patches(coverings[1])[1])
return X
end
function CoveredScheme(kk::Ring)
res = new{typeof(kk)}()
res.kk = kk
res.default_covering = empty_covering(kk)
res.coverings = [res.default_covering]
return res
end
end