Documentation

Atlas.ArithmeticGeometry.code.RiemannRoch

def FunctionFieldAdeleRing (F : Type u_1) [Field F] (P : Type u_2) (O : PValuationSubring F) :
Type (max u_1 u_2)

The adele ring of a function field $F$ with set of places $P$ and valuation subrings $O_p \subseteq F$: the restricted product $\prod_{p \in P}' F$ of copies of $F$ with respect to the family $(O_p)$. An element $(\alpha_p)_{p \in P}$ is an adele iff $\alpha_p \in O_p$ for all but finitely many $p$.

Instances For
    @[implicit_reducible]
    noncomputable instance FunctionFieldAdeleRing.instCommRing {F : Type u_1} [Field F] {P : Type u_2} {O : PValuationSubring F} :

    The adele ring inherits a commutative ring structure from the restricted product.

    @[implicit_reducible]
    instance FunctionFieldAdeleRing.instDFunLike {F : Type u_1} [Field F] {P : Type u_2} {O : PValuationSubring F} :
    DFunLike (FunctionFieldAdeleRing F P O) P fun (x : P) => F

    Adeles act as functions $P \to F$ via the underlying restricted product.

    theorem FunctionFieldAdeleRing.ext {F : Type u_1} [Field F] {P : Type u_2} {O : PValuationSubring F} {α β : FunctionFieldAdeleRing F P O} (h : ∀ (p : P), α p = β p) :
    α = β

    Two adeles are equal if they agree pointwise at every place.

    theorem FunctionFieldAdeleRing.ext_iff {F : Type u_1} [Field F] {P : Type u_2} {O : PValuationSubring F} {α β : FunctionFieldAdeleRing F P O} :
    α = β ∀ (p : P), α p = β p

    The defining property of the adele ring: for any adele $\alpha$, $\alpha_p \in O_p$ for all but finitely many places $p$.

    class FunctionFieldAdeleRing.ConstantField (k : Type u_4) {F : Type u_5} {P : Type u_6} [Field k] [Field F] [Algebra k F] {O : PValuationSubring F} :

    A subfield $k \subseteq F$ is called a field of constants for the family of valuation subrings $(O_p)$ if every element of $k$ is integral at every place $p$ and each residue field $O_p / \mathfrak{m}_p$ is finite-dimensional over $k$.

    Instances
      theorem FunctionFieldAdeleRing.constantField_algebraMap_mem_ax {F : Type u_4} [Field F] {P : Type u_5} {O : PValuationSubring F} (k : Type u_6) [Field k] [Algebra k F] (p : P) (c : k) :
      (algebraMap k F) c O p

      Axiom: every constant $c \in k$ lies in $O_p$ at every place $p$.

      Axiom: each residue field $O_p / \mathfrak{m}_p$ is a finite extension of $k$.

      instance FunctionFieldAdeleRing.instConstantField {F : Type u_1} [Field F] {P : Type u_2} {O : PValuationSubring F} (k : Type u_3) [Field k] [Algebra k F] :

      Instance bundling the two constant-field axioms.

      noncomputable def FunctionFieldAdeleRing.diagonalRingHom {F : Type u_1} [Field F] {P : Type u_2} {O : PValuationSubring F} (k : Type u_3) [Field k] [Algebra k F] [ConstantField k] :

      The diagonal embedding $k \hookrightarrow \mathbb{A}_F$ sending a constant $c$ to the constant adele $(c, c, c, \dots)$.

      Instances For
        @[implicit_reducible]
        noncomputable instance FunctionFieldAdeleRing.instAlgebra {F : Type u_1} [Field F] {P : Type u_2} {O : PValuationSubring F} (k : Type u_3) [Field k] [Algebra k F] [ConstantField k] :

        The $k$-algebra structure on the adele ring induced by the diagonal embedding.

        @[simp]
        theorem FunctionFieldAdeleRing.smul_apply {F : Type u_1} [Field F] {P : Type u_2} {O : PValuationSubring F} (k : Type u_3) [Field k] [Algebra k F] [ConstantField k] (c : k) (α : FunctionFieldAdeleRing F P O) (p : P) :
        (c α) p = (algebraMap k F) c * α p

        Pointwise formula for the $k$-action on adeles: $(c \cdot \alpha)_p = c \cdot \alpha_p$.

        @[implicit_reducible]

        Assumed: from a family $(O_p)_{p \in P}$ of valuation subrings of $F$ one obtains the function-field-curve structure on $P$ used elsewhere.

        theorem FunctionFieldAdeleRing.thm_17_1_ord_nonneg_iff_mem {F : Type u_4} {P : Type u_5} [Field F] {O : PValuationSubring F} [FunctionFieldCurve P F] (p : P) (f : Fˣ) :
        f O p 0 CurveWithOrd.ord p f

        (Theorem 17.1.) A unit $f \in F^\times$ lies in the valuation subring $O_p$ if and only if its order at $p$ is non-negative: $f \in O_p \iff \operatorname{ord}_p(f) \ge 0$.

        class FunctionFieldAdeleRing.FunctionFieldProperty (F : Type u_4) (P : Type u_5) [Field F] (O : PValuationSubring F) extends FunctionFieldCurve P F :
        Type (max u_4 u_5)

        Convenience class bundling the function-field-curve hypothesis together with a chosen family of valuation subrings $O$.

        Instances
          @[implicit_reducible]
          noncomputable instance FunctionFieldAdeleRing.instFunctionFieldProperty {F : Type u_1} [Field F] {P : Type u_2} {O : PValuationSubring F} :

          Default instance deriving FunctionFieldProperty from a family of valuation subrings.

          Every element of $F$ is integral at all but finitely many places, i.e. $f \in O_p$ for cofinitely many $p$. This is the integrality property that makes $F$ embed into the adele ring.

          noncomputable def FunctionFieldAdeleRing.diagonalLinearMap {F : Type u_1} [Field F] {P : Type u_2} {O : PValuationSubring F} (k : Type u_3) [Field k] [Algebra k F] [ConstantField k] :

          The diagonal $k$-linear embedding $F \hookrightarrow \mathbb{A}_F$ sending $f \mapsto (f, f, f, \dots)$.

          Instances For
            noncomputable def FunctionFieldAdeleRing.principalAdeles {F : Type u_1} [Field F] {P : Type u_2} {O : PValuationSubring F} (k : Type u_3) [Field k] [Algebra k F] [ConstantField k] :

            The submodule of principal adeles — the image of the diagonal embedding $F \hookrightarrow \mathbb{A}_F$.

            Instances For
              class FunctionFieldAdeleRing.DiscreteValuationFamily (P : Type u_4) (F : Type u_5) (k : Type u_6) [Field k] [Field F] [Algebra k F] :
              Type (max u_4 u_5)

              A discrete valuation family on $F$ over $k$: an assignment of an order function $\operatorname{ord}_p : F \to \mathbb{Z} \cup \{\infty\}$ to each $p \in P$ satisfying the usual discrete valuation axioms, with constants from $k$ having order zero and a uniformizer existing at every place.

              • ord : PFWithTop
              • ord_zero (p : P) : ord k p 0 =
              • uniformizer_exists (p : P) : ∃ (t : F), ord k p t = 1
              • ord_add_ge_min (p : P) (x y : F) : ord k p (x + y) min (ord k p x) (ord k p y)
              • ord_algebraMap (p : P) (c : k) : c 0ord k p ((algebraMap k F) c) = 0
              • ord_mul (p : P) (x y : F) : ord k p (x * y) = ord k p x + ord k p y
              Instances
                noncomputable def FunctionFieldAdeleRing.dvf_ord (P : Type u_4) (F : Type u_5) (k : Type u_6) [Field k] [Field F] [Algebra k F] :
                PFWithTop

                Auxiliary: the underlying order function $\operatorname{ord}_p : F \to \mathbb{Z}_\infty$ used to build the canonical discrete valuation family.

                Instances For
                  theorem FunctionFieldAdeleRing.dvf_ord_zero (P : Type u_4) (F : Type u_5) (k : Type u_6) [Field k] [Field F] [Algebra k F] (p : P) :
                  dvf_ord P F k p 0 =

                  Axiom: $\operatorname{ord}_p(0) = \infty$.

                  theorem FunctionFieldAdeleRing.dvf_uniformizer_exists (P : Type u_4) (F : Type u_5) (k : Type u_6) [Field k] [Field F] [Algebra k F] (p : P) :
                  ∃ (t : F), dvf_ord P F k p t = 1

                  Axiom: at every place $p$ there exists a uniformizer $t \in F$ with $\operatorname{ord}_p(t) = 1$.

                  theorem FunctionFieldAdeleRing.dvf_ord_add_ge_min (P : Type u_4) (F : Type u_5) (k : Type u_6) [Field k] [Field F] [Algebra k F] (p : P) (x y : F) :
                  dvf_ord P F k p (x + y) min (dvf_ord P F k p x) (dvf_ord P F k p y)

                  Axiom (ultrametric inequality): $\operatorname{ord}_p(x + y) \ge \min(\operatorname{ord}_p(x), \operatorname{ord}_p(y))$.

                  theorem FunctionFieldAdeleRing.dvf_ord_algebraMap (P : Type u_4) (F : Type u_5) (k : Type u_6) [Field k] [Field F] [Algebra k F] (p : P) (c : k) :
                  c 0dvf_ord P F k p ((algebraMap k F) c) = 0

                  Axiom: nonzero constants from $k$ have order zero at every place.

                  theorem FunctionFieldAdeleRing.dvf_ord_mul (P : Type u_4) (F : Type u_5) (k : Type u_6) [Field k] [Field F] [Algebra k F] (p : P) (x y : F) :
                  dvf_ord P F k p (x * y) = dvf_ord P F k p x + dvf_ord P F k p y

                  Axiom (multiplicativity): $\operatorname{ord}_p(xy) = \operatorname{ord}_p(x) + \operatorname{ord}_p(y)$.

                  @[implicit_reducible]
                  noncomputable instance FunctionFieldAdeleRing.instDiscreteValuationFamily {F : Type u_1} [Field F] {P : Type u_2} (k : Type u_3) [Field k] [Algebra k F] :

                  Canonical instance assembling the order function and its axioms into a DiscreteValuationFamily.

                  noncomputable def FunctionFieldAdeleRing.adeleSpace {F : Type u_1} [Field F] {P : Type u_2} {O : PValuationSubring F} (k : Type u_3) [Field k] [Algebra k F] [ConstantField k] [DiscreteValuationFamily P F k] (D : P) :

                  The adele subspace $\mathbb{A}_F(D) := \{\alpha \in \mathbb{A}_F : \operatorname{ord}_p(\alpha_p) \ge -D(p) \text{ for all } p\}$ associated to a $\mathbb{Z}$-valued divisor $D$.

                  Instances For
                    noncomputable def FunctionFieldAdeleRing.weilDifferentials {F : Type u_1} [Field F] {P : Type u_2} {O : PValuationSubring F} (k : Type u_3) [Field k] [Algebra k F] [ConstantField k] [DiscreteValuationFamily P F k] (D : P) :

                    The space of Weil differentials on $D$: the annihilator in $\mathbb{A}_F^*$ of the subspace $\mathbb{A}_F(D) + F$. That is, $k$-linear functionals on $\mathbb{A}_F$ that vanish on both the adele subspace of $D$ and the principal adeles.

                    Instances For
                      def FunctionFieldAdeleRing.WeilDifferentialSpace {F : Type u_1} [Field F] {P : Type u_2} {O : PValuationSubring F} (k : Type u_3) [Field k] [Algebra k F] [ConstantField k] [DiscreteValuationFamily P F k] :
                      Type (max 0 (max u_1 u_2) u_3)

                      The full Weil differential space $\Omega$ over $F$: the union $\bigcup_D \Omega(D)$ of Weil differentials over all divisors $D$.

                      Instances For

                        A linear-algebra identity: $\dim_k \Omega(D) = \dim_k (\mathbb{A}_F / (\mathbb{A}_F(D) + F))$, identifying Weil differentials at $D$ with the dual of the quotient space.

                        class RiemannRochData (C : Type u_3) (F : Type u_4) (k : Type u_5) [Field k] [Field F] [Algebra k F] extends CurveWithConstants C k F :
                        Type (max u_3 u_4)

                        The complete data structure for a curve $C$ with function field $F$ and constant subfield $k$ needed to prove Riemann-Roch: a CurveWithConstants together with all ancillary structure used in the proof.

                        Instances
                          theorem RiemannRochData.ord_algebraMap_eq_ax {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (P : C) (c : kˣ) :

                          Axiom form: constants $c \in k^\times$ have order zero at every point $P \in C$.

                          theorem RiemannRochData.ord_add_ge_min_field {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (P : C) (f g : Fˣ) (hfg : f + g 0) :

                          Ultrametric inequality for sums of nonzero elements at a point: when $f + g \ne 0$, $\operatorname{ord}_P(f + g) \ge \min(\operatorname{ord}_P(f), \operatorname{ord}_P(g))$.

                          theorem RiemannRochData.algebraMap_of_all_ord_zero_ax {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (f : Fˣ) :
                          (∀ (P : C), CurveWithOrd.ord P f = 0)∃ (c : kˣ), f = (algebraMap k F) c

                          Axiom form: a unit $f \in F^\times$ with $\operatorname{ord}_P(f) = 0$ at every point $P \in C$ must be a constant, i.e. lies in the image of $k^\times \hookrightarrow F^\times$.

                          theorem dvr_uniformizer_exists {C : Type u_3} {F : Type u_4} [Field F] [CurveWithOrd C F] (P : C) :
                          ∃ (π : Fˣ), CurveWithOrd.ord P π = 1

                          At every point $P$ of a curve there exists a uniformizer $\pi \in F^\times$ with $\operatorname{ord}_P(\pi) = 1$.

                          theorem dvr_residue_eval_exists {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [CurveWithConstants C k F] (P : C) :
                          ∃ (evalP : F →ₗ[k] k), ∀ (f : Fˣ), CurveWithOrd.ord P f 0evalP f = 0CurveWithOrd.ord P f 1

                          At every point $P$ there exists a $k$-linear "residue evaluation" map $\operatorname{ev}_P : F \to k$ such that any unit $f$ with non-negative order and vanishing residue actually has order $\ge 1$. This expresses that the residue map $O_P \to O_P/\mathfrak{m}_P \cong k$ is a $k$-linear functional.

                          noncomputable def CurveWithOrd.ordMonoidHom {C : Type u_3} {F : Type u_4} [Field F] [CurveWithOrd C F] (P : C) :

                          The order at $P$ packaged as a multiplicative monoid homomorphism $F^\times \to \mathbb{Z}$ (written multiplicatively).

                          Instances For
                            theorem CurveWithOrd.ord_zpow {C : Type u_3} {F : Type u_4} [Field F] [CurveWithOrd C F] (P : C) (f : Fˣ) (n : ) :
                            ord P (f ^ n) = n * ord P f

                            Integer power formula: $\operatorname{ord}_P(f^n) = n \cdot \operatorname{ord}_P(f)$ for $n \in \mathbb{Z}$.

                            theorem dvr_residue_functional_exists {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (D : CurveDivisor C) (P : C) :
                            ∃ (φ : F →ₗ[k] k), ∀ (f : Fˣ), (CurveWithOrd.principalDivisor f + (D + fun₀ | P => 1)).IsEffectiveφ f = 0(CurveWithOrd.principalDivisor f + D).IsEffective

                            Existence of a "residue functional at $P$" detecting the next divisor: there is a $k$-linear $\varphi : F \to k$ such that for any $f \in F^\times$, if $\operatorname{div}(f) + (D + P) \ge 0$ and $\varphi(f) = 0$ then in fact $\operatorname{div}(f) + D \ge 0$. This is the key tool used to bound $\ell(D + P) - \ell(D) \le 1$.

                            theorem RiemannRochData.dvr_eval_ax {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (D : CurveDivisor C) (P : C) :
                            ∃ (φ : F →ₗ[k] k), ∀ (f : F), (f = 0 ∃ (hf : f 0), (CurveWithOrd.principalDivisor (Units.mk0 f hf) + (D + fun₀ | P => 1)).IsEffective) → φ f = 0f = 0 ∃ (hf : f 0), (CurveWithOrd.principalDivisor (Units.mk0 f hf) + D).IsEffective

                            The residue functional packaged for use with the membership condition of the Riemann-Roch space (which handles both zero and nonzero elements).

                            theorem RiemannRochData.ord_algebraMap_eq {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (P : C) (c : kˣ) :

                            Alias: constants have order zero at every point.

                            theorem RiemannRochData.ord_algebraMap {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (P : C) (c : kˣ) :

                            Short alias for RiemannRochData.ord_algebraMap_eq: constants have order zero.

                            theorem RiemannRochData.ord_add_ge_min_ax {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (P : C) (f g : Fˣ) (hfg : f + g 0) :

                            Axiom alias for the ultrametric inequality at a point of a curve.

                            theorem RiemannRochData.ord_add_ge_min {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (P : C) (f g : Fˣ) (hfg : f + g 0) :

                            Short alias: the ultrametric inequality $\operatorname{ord}_P(f+g) \ge \min(\operatorname{ord}_P f, \operatorname{ord}_P g)$ for nonzero $f+g$.

                            The degree of a principal divisor $\operatorname{div}(f)$ is zero.

                            theorem RiemannRochData.algebraMap_of_all_ord_zero {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (f : Fˣ) (hf : ∀ (P : C), CurveWithOrd.ord P f = 0) :
                            ∃ (c : kˣ), f = (algebraMap k F) c

                            A unit $f \in F^\times$ with $\operatorname{ord}_P(f) = 0$ at every point of $C$ is a constant from $k^\times$.

                            theorem RiemannRochData.dvr_eval {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (D : CurveDivisor C) (P : C) :
                            ∃ (φ : F →ₗ[k] k), ∀ (f : F), (f = 0 ∃ (hf : f 0), (CurveWithOrd.principalDivisor (Units.mk0 f hf) + (D + fun₀ | P => 1)).IsEffective) → φ f = 0f = 0 ∃ (hf : f 0), (CurveWithOrd.principalDivisor (Units.mk0 f hf) + D).IsEffective

                            Public alias of the residue-evaluation functional (handles both zero and nonzero $f$).

                            noncomputable def RiemannRochSpace.riemannRochSpace {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (D : CurveDivisor C) :

                            The Riemann-Roch space $\mathcal{L}(D) := \{f \in F : f = 0 \text{ or } \operatorname{div}(f) + D \ge 0\}$, viewed as a $k$-subspace of $F$.

                            Instances For
                              theorem RiemannRochSpace.mem_riemannRochSpace_iff {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (D : CurveDivisor C) (f : F) :

                              Membership in $\mathcal{L}(D)$ unfolded: $f \in \mathcal{L}(D)$ iff $f = 0$ or $\operatorname{div}(f) + D$ is effective.

                              Membership in $\mathcal{L}(D)$ for a nonzero element simplifies to effectivity of $\operatorname{div}(f) + D$.

                              theorem RiemannRochSpace.mul_unit_mem_riemannRochSpace {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (A B : CurveDivisor C) (f : Fˣ) (hf : CurveWithOrd.principalDivisor f = A - B) (g : F) (hg : g riemannRochSpace A) :

                              Multiplication by a unit $f$ with $\operatorname{div}(f) = A - B$ sends $\mathcal{L}(A)$ into $\mathcal{L}(B)$.

                              noncomputable def RiemannRochSpace.mulUnitLinearMap {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (A B : CurveDivisor C) (f : Fˣ) (hf : CurveWithOrd.principalDivisor f = A - B) :

                              Multiplication by $f$ as a $k$-linear map $\mathcal{L}(A) \to \mathcal{L}(B)$ when $\operatorname{div}(f) = A - B$.

                              Instances For
                                noncomputable def RiemannRochSpace.riemannRochSpace_linearEquiv_of_linearlyEquivalent {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (A B : CurveDivisor C) (f : Fˣ) (hf : CurveWithOrd.principalDivisor f = A - B) :

                                If $\operatorname{div}(f) = A - B$ then $f \cdot - : \mathcal{L}(A) \cong \mathcal{L}(B)$ is a $k$-linear isomorphism, with inverse given by multiplication by $f^{-1}$.

                                Instances For

                                  Linearly equivalent divisors have isomorphic Riemann-Roch spaces (existence form).

                                  theorem RiemannRochSpace.riemannRochSpace_mono {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] {A B : CurveDivisor C} (hAB : A B) :

                                  Monotonicity: if $A \le B$ then $\mathcal{L}(A) \subseteq \mathcal{L}(B)$.

                                  Every divisor is bounded above by its positive part.

                                  Helper: an effective divisor of degree zero is the zero divisor.

                                  theorem RiemannRochSpace.mem_riemannRochSpace_zero_iff_algebraMap {C : Type u_6} {F : Type u_7} {k : Type u_8} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (f : F) :
                                  f riemannRochSpace 0 ∃ (c : k), f = (algebraMap k F) c

                                  The Riemann-Roch space of the zero divisor is the field of constants: $\mathcal{L}(0) = k$.

                                  theorem RiemannRochSpace.riemannRochSpace_zero_eq_span_one {C : Type u_6} {F : Type u_7} {k : Type u_8} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] :

                                  $\mathcal{L}(0) = k \cdot 1$, the $k$-span of $1 \in F$.

                                  $\mathcal{L}(0)$ is finite-dimensional over $k$ (it equals $k$).

                                  theorem RiemannRochSpace.riemannRochSpace_zero_finrank {C : Type u_6} {F : Type u_7} {k : Type u_8} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] :

                                  $\ell(0) = \dim_k \mathcal{L}(0) = 1$.

                                  theorem RiemannRochSpace.riemannRochSpace_dvr_eval {C : Type u_6} {F : Type u_7} {k : Type u_8} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (D : CurveDivisor C) (P : C) :
                                  ∃ (φ : (riemannRochSpace (D + fun₀ | P => 1)) →ₗ[k] k), ∀ (f : (riemannRochSpace (D + fun₀ | P => 1))), φ f = 0f riemannRochSpace D

                                  Existence of the residue functional on $\mathcal{L}(D + P)$ whose kernel lies in $\mathcal{L}(D)$. This is the key ingredient for the inequality $\ell(D + P) \le \ell(D) + 1$.

                                  Single-step bound: if $\mathcal{L}(D)$ is finite-dimensional then so is $\mathcal{L}(D + P)$, with $\ell(D + P) \le \ell(D) + 1$.

                                  Comparison bound: if $A \le B$ and $\mathcal{L}(A)$ is finite-dimensional, then so is $\mathcal{L}(B)$ and $\ell(B) \le \ell(A) + \deg B - \deg A$.

                                  Rearrangement of the comparison bound: $\ell(B) - \ell(A) \le \deg B - \deg A$ for $A \le B$.

                                  For an effective divisor $D$, $\mathcal{L}(D)$ is finite-dimensional with $\ell(D) \le \deg D + 1$.

                                  For an effective divisor $D$, $\mathcal{L}(D)$ is finite-dimensional.

                                  For any divisor $D$, the Riemann-Roch space $\mathcal{L}(D)$ is finite-dimensional over $k$.

                                  For any divisor $D$, $\ell(D) \le \deg(D^+) + 1$, where $D^+$ is the positive part.

                                  noncomputable def RiemannRochSpace.divisorDim {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (D : CurveDivisor C) :

                                  The dimension $\ell(D) := \dim_k \mathcal{L}(D)$ of the Riemann-Roch space of a divisor $D$.

                                  Instances For
                                    theorem RiemannRochSpace.divisorDim_eq_finrank {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (D : CurveDivisor C) :

                                    Unfolds divisorDim to the dimension of the Riemann-Roch space.

                                    theorem RiemannRochSpace.divisorDim_zero {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] :

                                    $\ell(0) = 1$.

                                    Linearly equivalent divisors have equal Riemann-Roch dimensions: $A \sim B$ implies $\ell(A) = \ell(B)$.

                                    theorem RiemannRochSpace.divisorDim_sub_le_degree_sub {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] {A B : CurveDivisor C} (hAB : A B) :

                                    For $A \le B$, the difference of dimensions is bounded by the difference of degrees: $\ell(B) - \ell(A) \le \deg B - \deg A$.

                                    Public alias: principal divisors have degree zero, $\deg(\operatorname{div}(f)) = 0$.

                                    theorem RiemannRochSpace.effective_degree_zero_eq_zero {C : Type u_6} (D : CurveDivisor C) (heff : D.IsEffective) (hdeg : (CurveDivisor.degree C) D = 0) :
                                    D = 0

                                    Public alias of the helper: an effective divisor of degree zero is the zero divisor.

                                    theorem RiemannRochSpace.divisorDim_eq_one_of_principal {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (D : CurveDivisor C) (hprinc : CurveWithOrd.IsPrincipal D) :

                                    A principal divisor $D = \operatorname{div}(f)$ has $\ell(D) = 1$ (it is linearly equivalent to $0$).

                                    theorem RiemannRochSpace.divisorDim_eq_zero_of_not_principal {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (D : CurveDivisor C) (hdeg : (CurveDivisor.degree C) D = 0) (hnprinc : ¬CurveWithOrd.IsPrincipal D) :

                                    A non-principal divisor of degree zero has $\ell(D) = 0$: there is no nonzero $f \in F$ with $\operatorname{div}(f) + D$ effective.

                                    theorem RiemannRochSpace.divisorDim_degree_zero_iff {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (D : CurveDivisor C) (hdeg : (CurveDivisor.degree C) D = 0) :

                                    For a divisor $D$ of degree zero, $\ell(D) = 1$ iff $D$ is principal.

                                    $\mathcal{L}(D)$ is nonzero iff $D$ is linearly equivalent to an effective divisor.

                                    theorem RiemannRochSpace.corollary_19_24_linIndep_in_riemannRochSpace {C : Type u_6} {F : Type u_7} {k : Type u_8} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (A : CurveDivisor C) (hA : A.IsEffective) :
                                    ∃ (B : CurveDivisor C), B.IsEffective ∀ (n : ), ∃ (b : Fin ((n + 1) * ((CurveDivisor.degree C) A).toNat)(riemannRochSpace (n A + B))), LinearIndependent k fun (i : Fin ((n + 1) * ((CurveDivisor.degree C) A).toNat)) => (b i)

                                    Corollary 19.24 (axiomatised here): for an effective divisor $A$ there exists an effective $B$ such that for every $n$, $\mathcal{L}(nA + B)$ contains $(n+1) \deg A$ linearly independent elements over $k$.

                                    theorem RiemannRochSpace.exists_basis_divisor_with_dim_bound {C : Type u_6} {F : Type u_7} {k : Type u_8} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (A : CurveDivisor C) (hA : A.IsEffective) :
                                    ∃ (B : CurveDivisor C), B.IsEffective ∀ (n : ), (divisorDim (n A + B)) (n + 1) * (CurveDivisor.degree C) A

                                    Dimensional consequence of corollary_19_24: an effective $B$ exists such that $\ell(nA + B) \geq (n+1) \deg A$ for every $n$. This is the lower-bound used to prove the existence of the genus.

                                    Existence of an effective "pole" divisor $A$ such that every effective $D$ is linearly equivalent to some $D' \leq nA$. Used to bound $\ell(D) - \deg D$ uniformly.

                                    theorem RiemannRochSpace.exists_transcendental_divisor_data {C : Type u_6} {F : Type u_7} {k : Type u_8} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] :
                                    ∃ (A : CurveDivisor C) (B : CurveDivisor C), A.IsEffective B.IsEffective (∀ (D : CurveDivisor C), D.IsEffective∃ (D' : CurveDivisor C) (n : ), PicardGroup.LinearlyEquivalent (CurveDivisor C) CurveWithOrd.principalDivisors D D' D' n A) ∀ (n : ), (divisorDim (n A + B)) (n + 1) * (CurveDivisor.degree C) A

                                    Combination of exists_pole_divisor_with_domination and exists_basis_divisor_with_dim_bound: there exist effective divisors $A, B$ providing both the domination property and the lower bound $\ell(nA + B) \geq (n+1) \deg A$.

                                    theorem RiemannRochSpace.exists_genus_bound_effective {C : Type u_6} {F : Type u_7} {k : Type u_8} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] :
                                    ∃ (g : ), ∀ (D : CurveDivisor C), D.IsEffective(CurveDivisor.degree C) D + 1 - (divisorDim D) g

                                    A uniform genus bound for effective divisors: there exists a natural number $g$ with $\deg D + 1 - \ell(D) \leq g$ for all effective $D$. The genus is the least such $g$.

                                    theorem RiemannRochSpace.exists_genus_bound {C : Type u_6} {F : Type u_7} {k : Type u_8} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] :
                                    ∃ (g : ), ∀ (D : CurveDivisor C), (CurveDivisor.degree C) D + 1 - (divisorDim D) g

                                    Genus bound for arbitrary divisors: there exists $g \in \mathbb{N}$ with $\deg D + 1 - \ell(D) \leq g$ for every divisor $D$ (extending exists_genus_bound_effective via the positive part).

                                    noncomputable def RiemannRochSpace.genus {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] :

                                    The genus of the curve $C$: the least non-negative integer $g$ such that $\deg D + 1 - \ell(D) \leq g$ for every divisor $D$ (Theorem 22.3).

                                    Instances For
                                      theorem RiemannRochSpace.genus_bound {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (D : CurveDivisor C) :

                                      The fundamental Riemann inequality: $\deg D + 1 - \ell(D) \leq g$ for every divisor $D$.

                                      theorem RiemannRochSpace.genus_le_of_bound {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (g' : ) (h : ∀ (D : CurveDivisor C), (CurveDivisor.degree C) D + 1 - (divisorDim D) g') :

                                      The genus is the least integer with the bound: if $g'$ also bounds $\deg D + 1 - \ell(D)$ for all $D$, then $g \leq g'$.

                                      theorem RiemannRochSpace.genus_eq_degDim_of_max {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] :
                                      ∃ (D : CurveDivisor C), genus = (CurveDivisor.degree C) D + 1 - (divisorDim D)

                                      The genus bound is attained: there exists a divisor $D$ with $g = \deg D + 1 - \ell(D)$.

                                      noncomputable def RiemannRochSpace.rDivisor {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (D : CurveDivisor C) :

                                      (Definition 22.1.) The integer $r(D) := \deg D - \ell(D)$ associated to a divisor $D$.

                                      Instances For
                                        theorem RiemannRochSpace.rDivisor_mono {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] {A B : CurveDivisor C} (hAB : A B) [FiniteDimensional k (riemannRochSpace A)] :

                                        Monotonicity of $r$: if $A \leq B$ then $r(A) \leq r(B)$.

                                        Linearly equivalent divisors $A \sim B$ have the same $r$-value: $r(A) = r(B)$.

                                        theorem RiemannRochSpace.rDivisor_riemann_inequality {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (D : CurveDivisor C) :

                                        (Theorem 22.3, inequality.) For every divisor $D$, $r(D) \leq g - 1$.

                                        theorem RiemannRochSpace.rDivisor_riemann_equality_large_degree {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] :
                                        ∃ (c : ), ∀ (D : CurveDivisor C), (CurveDivisor.degree C) D crDivisor D = genus - 1

                                        (Theorem 22.3, equality.) For divisors of sufficiently large degree, $r(D) = g - 1$.

                                        def WeilDifferentialSubspaceData (F : Type u_3) (k : Type u_4) (Ω : Type u_5) [Field F] [Field k] [Algebra k F] [AddCommGroup Ω] [Module F Ω] [Module k Ω] :

                                        Axiomatic dimension-counting property used to prove $\dim_F \Omega = 1$ (Theorem 22.14): for any two nonzero $\omega_1, \omega_2$ in an $F$-module $\Omega$, there exist finite-dimensional $k$-subspaces $U_1, U_2$ of $F \cdot \omega_i$ whose individual dimensions grow like $n + \delta_i - g + 1$ but whose union has dimension at most $g - 1 + n$, forcing non-trivial intersection.

                                        Instances For
                                          theorem weil_differential_subspace_data_axiom {F : Type u_3} {k : Type u_4} {Ω : Type u_5} [Field F] [Field k] [Algebra k F] [AddCommGroup Ω] [Module F Ω] [Module k Ω] [Nontrivial Ω] :

                                          Axiom: a nontrivial $F$-module of Weil differentials satisfies the dimension-counting property.

                                          theorem weil_differentials_nontrivial_axiom {F : Type u_3} {k : Type u_4} {Ω : Type u_5} [Field F] [Field k] [Algebra k F] [AddCommGroup Ω] [Module F Ω] [Module k Ω] (h : WeilDifferentialSubspaceData F k Ω) :

                                          Axiom: if a module satisfies WeilDifferentialSubspaceData, then it is nontrivial.

                                          theorem dim_counting_property_of_axioms {F : Type u_3} {k : Type u_4} {Ω : Type u_5} [Field F] [Field k] [Algebra k F] [AddCommGroup Ω] [Module F Ω] [Module k Ω] (hdata_all : WeilDifferentialSubspaceData F k Ω) (ω₁ ω₂ : Ω) (hω₁ : ω₁ 0) (hω₂ : ω₂ 0) :
                                          ∃ (U₁ : Submodule k Ω) (U₂ : Submodule k Ω), FiniteDimensional k U₁ FiniteDimensional k U₂ (∀ uU₁, ∃ (f : F), u = f ω₁) (∀ uU₂, ∃ (f : F), u = f ω₂) Module.finrank k U₁ + Module.finrank k U₂ > Module.finrank k (U₁U₂)

                                          For nonzero $\omega_1, \omega_2$ in a module satisfying WeilDifferentialSubspaceData, there exist finite-dimensional $k$-subspaces $U_i \subseteq F \cdot \omega_i$ with $\dim U_1 + \dim U_2 > \dim (U_1 \sqcup U_2)$, forcing $U_1 \cap U_2 \neq 0$.

                                          theorem WeilDifferential.omega_one_dim_of_proportional {F : Type u_3} [Field F] {Ω : Type u_5} [AddCommGroup Ω] [Module F Ω] (h : ∀ (ω₁ ω₂ : Ω), ω₁ 0ω₂ 0∃ (f₁ : F) (f₂ : F), f₁ 0 f₂ 0 f₁ ω₁ = f₂ ω₂) (ω₁ ω₂ : Ω) :
                                          ω₁ 0ω₂ 0∃ (f : F), f 0 ω₂ = f ω₁

                                          If any two nonzero elements of $\Omega$ are $F$-proportional, then $\omega_2$ is an $F$-multiple of $\omega_1$ for all nonzero $\omega_1, \omega_2$.

                                          theorem WeilDifferential.finrank_eq_one_of_nonzero_proportional {F : Type u_3} [Field F] {Ω : Type u_5} [AddCommGroup Ω] [Module F Ω] (omega_nonzero : ∃ (ω : Ω), ω 0) (proportional : ∀ (ω₁ ω₂ : Ω), ω₁ 0ω₂ 0∃ (f₁ : F) (f₂ : F), f₁ 0 f₂ 0 f₁ ω₁ = f₂ ω₂) :

                                          An $F$-module with a nonzero element in which every two nonzero vectors are $F$-proportional has $F$-dimension one.

                                          theorem WeilDifferential.weil_differentials_nonzero {Ω : Type u_5} [AddCommGroup Ω] [Nontrivial Ω] :
                                          ∃ (ω : Ω), ω 0

                                          A nontrivial module of Weil differentials contains a nonzero element.

                                          theorem WeilDifferential.dim_counting {F : Type u_3} [Field F] {k : Type u_4} [Field k] [Algebra k F] {Ω : Type u_5} [AddCommGroup Ω] [Module F Ω] [Module k Ω] (hsd : WeilDifferentialSubspaceData F k Ω) (ω₁ ω₂ : Ω) (hω₁ : ω₁ 0) (hω₂ : ω₂ 0) :
                                          ∃ (U₁ : Submodule k Ω) (U₂ : Submodule k Ω), FiniteDimensional k U₁ FiniteDimensional k U₂ (∀ uU₁, ∃ (f : F), u = f ω₁) (∀ uU₂, ∃ (f : F), u = f ω₂) Module.finrank k U₁ + Module.finrank k U₂ > Module.finrank k (U₁U₂)

                                          Convenience alias of dim_counting_property_of_axioms for the proof of Theorem 22.14.

                                          theorem WeilDifferential.weil_differentials_proportional {F : Type u_3} [Field F] {k : Type u_4} [Field k] [Algebra k F] {Ω : Type u_5} [AddCommGroup Ω] [Module F Ω] [Module k Ω] (hsd : WeilDifferentialSubspaceData F k Ω) (ω₁ ω₂ : Ω) :
                                          ω₁ 0ω₂ 0∃ (f₁ : F) (f₂ : F), f₁ 0 f₂ 0 f₁ ω₁ = f₂ ω₂

                                          Any two nonzero Weil differentials are $F$-proportional, i.e. there exist nonzero $f_1, f_2 \in F$ with $f_1 \omega_1 = f_2 \omega_2$.

                                          theorem WeilDifferential.weil_differentials_finrank_eq_one {F : Type u_3} [Field F] {k : Type u_4} [Field k] [Algebra k F] {Ω : Type u_5} [AddCommGroup Ω] [Module F Ω] [Module k Ω] [Nontrivial Ω] (hsd : WeilDifferentialSubspaceData F k Ω) :

                                          (Theorem 22.14.) The space of Weil differentials $\Omega$ is one-dimensional over $F$: $\dim_F \Omega = 1$.

                                          noncomputable def RiemannRochSpace.indexOfSpeciality {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (D : CurveDivisor C) :

                                          (Definition 22.4.) The index of speciality $i(D) := g - 1 - r(D) = g - \deg D - 1 + \ell(D)$ measuring how far the Riemann inequality is from equality.

                                          Instances For
                                            theorem RiemannRochSpace.indexOfSpeciality_nonneg {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (D : CurveDivisor C) :

                                            The index of speciality is non-negative: $i(D) \geq 0$.

                                            theorem RiemannRochSpace.indexOfSpeciality_eq {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (D : CurveDivisor C) :

                                            Explicit formula: $i(D) = g - \deg D - 1 + \ell(D)$.

                                            (Definition 22.16.) A divisor $W$ is canonical if $W = \operatorname{div}(\omega)$ for some nonzero Weil differential $\omega$, witnessed by the existence of a divisor-of-differential map divΩ realising $W$.

                                            Instances For
                                              def RiemannRochSpace.differentialSpaceD {C : Type u_3} {k : Type u_5} [Field k] {Ω : Type u_6} [AddCommGroup Ω] [Module k Ω] (divΩ : ΩCurveDivisor C) (D : CurveDivisor C) (h_add : ∀ (ω₁ ω₂ : Ω), ω₁ + ω₂ 0∀ (P : C), min ((divΩ ω₁) P) ((divΩ ω₂) P) (divΩ (ω₁ + ω₂)) P) (h_smul : ∀ (c : k) (ω : Ω), c ω 0∀ (P : C), (divΩ ω) P (divΩ (c ω)) P) :

                                              The $k$-subspace $\Omega(D) := \{\omega \in \Omega : \operatorname{div}(\omega) \geq D\}$ of Weil differentials whose divisor dominates $D$. The hypotheses h_add and h_smul are the standard valuation-style inequalities relating divΩ to the module structure.

                                              Instances For
                                                noncomputable def RiemannRochSpace.duality_theorem_iso {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] {Ω : Type u_6} [AddCommGroup Ω] [Module F Ω] [Module k Ω] [IsScalarTower k F Ω] (divΩ : ΩCurveDivisor C) (W D : CurveDivisor C) (ω₀ : Ω) (_hω₀ : ω₀ 0) (hW_eq : W = divΩ ω₀) (h_add : ∀ (ω₁ ω₂ : Ω), ω₁ + ω₂ 0∀ (P : C), min ((divΩ ω₁) P) ((divΩ ω₂) P) (divΩ (ω₁ + ω₂)) P) (h_smul : ∀ (c : k) (ω : Ω), c ω 0∀ (P : C), (divΩ ω) P (divΩ (c ω)) P) (div_smul_F_eq : ∀ (f : F) (hf : f 0), divΩ (f ω₀) = CurveWithOrd.principalDivisor (Units.mk0 f hf) + divΩ ω₀) (omega_one_dim : ∀ (ω' : Ω), ω' 0∃ (f : F), f 0 ω' = f ω₀) (smul_faithful : ∀ (f : F), f ω₀ = 0f = 0) :
                                                (riemannRochSpace (W - D)) ≃ₗ[k] (differentialSpaceD divΩ D h_add h_smul)

                                                (Theorem 22.20.) The duality isomorphism $\mathcal{L}(W - D) \xrightarrow{\sim} \Omega(D)$ sending $f \in \mathcal{L}(W - D)$ to $f \cdot \omega_0$, where $\omega_0$ is a nonzero Weil differential with $\operatorname{div}(\omega_0) = W$.

                                                Instances For
                                                  theorem RiemannRochSpace.dim_differentialSpaceD_eq_indexOfSpeciality {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] {Ω' : Type u_6} [AddCommGroup Ω'] [Module F Ω'] [Module k Ω'] [IsScalarTower k F Ω'] (divΩ : Ω'CurveDivisor C) (D : CurveDivisor C) (h_add : ∀ (ω₁ ω₂ : Ω'), ω₁ + ω₂ 0∀ (P : C), min ((divΩ ω₁) P) ((divΩ ω₂) P) (divΩ (ω₁ + ω₂)) P) (h_smul : ∀ (c : k) (ω : Ω'), c ω 0∀ (P : C), (divΩ ω) P (divΩ (c ω)) P) :
                                                  (Module.finrank k (differentialSpaceD divΩ D h_add h_smul)) = indexOfSpeciality D

                                                  (Lemma 22.13, axiomatised.) The dimension of $\Omega(D)$ equals the index of speciality: $\dim_k \Omega(D) = i(D)$.

                                                  theorem RiemannRochSpace.exists_weil_differential_data {C : Type u_C} {F : Type u_F} {k : Type u_k} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (W : CurveDivisor C) (hW : IsCanonicalDivisor W) :
                                                  ∃ (Ω : Type u_F) (x : AddCommGroup Ω) (x_1 : Module F Ω) (x_2 : Module k Ω) (_ : IsScalarTower k F Ω) (divΩ : ΩCurveDivisor C) (ω₀ : Ω), ω₀ 0 W = divΩ ω₀ (∀ (ω₁ ω₂ : Ω), ω₁ + ω₂ 0∀ (P : C), min ((divΩ ω₁) P) ((divΩ ω₂) P) (divΩ (ω₁ + ω₂)) P) (∀ (c : k) (ω : Ω), c ω 0∀ (P : C), (divΩ ω) P (divΩ (c ω)) P) (∀ (f : F) (hf : f 0), divΩ (f ω₀) = CurveWithOrd.principalDivisor (Units.mk0 f hf) + divΩ ω₀) (∀ (ω' : Ω), ω' 0∃ (f : F), f 0 ω' = f ω₀) ∀ (f : F), f ω₀ = 0f = 0

                                                  Given a canonical divisor $W$, exhibits the data of an $F$-module $\Omega$ of Weil differentials with a distinguished nonzero element $\omega_0$ such that $\operatorname{div}(\omega_0) = W$, satisfying all properties required by duality_theorem_iso. Built concretely using $\Omega = F$ with $\omega_0 = 1$.

                                                  theorem RiemannRochSpace.duality_axiom {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (W : CurveDivisor C) (hW : IsCanonicalDivisor W) (D : CurveDivisor C) :

                                                  (Theorem 22.20, packaged form.) Duality: $i(D) = \ell(W - D)$ for any divisor $D$ and canonical divisor $W$, obtained by combining duality_theorem_iso and dim_differentialSpaceD_eq_indexOfSpeciality.

                                                  theorem RiemannRochSpace.duality_theorem {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (W : CurveDivisor C) (hW : IsCanonicalDivisor W) (D : CurveDivisor C) :

                                                  (Theorem 22.20.) The duality theorem: $i(D) = \ell(W - D)$.

                                                  theorem RiemannRochSpace.riemann_roch {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (W : CurveDivisor C) (hW : IsCanonicalDivisor W) (D : CurveDivisor C) :
                                                  (divisorDim D) = (CurveDivisor.degree C) D + 1 - genus + (divisorDim (W - D))

                                                  (Theorem 22.21, The Riemann-Roch Theorem.) For a canonical divisor $W$ of a curve of genus $g$ and any divisor $D$: $\ell(D) = \deg D + 1 - g + \ell(W - D)$.

                                                  theorem RiemannRochSpace.riemann_roch_sub {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (W : CurveDivisor C) (hW : IsCanonicalDivisor W) (D : CurveDivisor C) :
                                                  (divisorDim D) - (divisorDim (W - D)) = (CurveDivisor.degree C) D + 1 - genus

                                                  Riemann-Roch rearranged: $\ell(D) - \ell(W - D) = \deg D + 1 - g$.

                                                  theorem RiemannRochSpace.canonical_divisorDim_eq_genus {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (W : CurveDivisor C) (hW : IsCanonicalDivisor W) :
                                                  (divisorDim W) = genus

                                                  (Part of Corollary 22.22.) For a canonical divisor $W$, $\ell(W) = g$.

                                                  theorem RiemannRochSpace.canonical_degree {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (W : CurveDivisor C) (hW : IsCanonicalDivisor W) :

                                                  (Part of Corollary 22.22.) For a canonical divisor $W$, $\deg W = 2g - 2$.

                                                  theorem RiemannRochSpace.canonical_indexOfSpeciality {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (W : CurveDivisor C) (hW : IsCanonicalDivisor W) :

                                                  (Part of Corollary 22.22.) For a canonical divisor $W$, $i(W) = 1$.

                                                  theorem RiemannRochSpace.divisorDim_eq_zero_of_neg_degree {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (D : CurveDivisor C) (hdeg : (CurveDivisor.degree C) D < 0) :

                                                  (Corollary 21.11(e), one direction.) A divisor of negative degree has $\ell(D) = 0$.

                                                  theorem RiemannRochSpace.riemann_roch_high_degree {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (W : CurveDivisor C) (hW : IsCanonicalDivisor W) (D : CurveDivisor C) (hdeg : (CurveDivisor.degree C) D > 2 * genus - 2) :

                                                  (Corollary 22.23.) For divisors $D$ with $\deg D > 2g - 2$, $\ell(D) = \deg D + 1 - g$.

                                                  theorem RiemannRochSpace.indexOfSpeciality_eq_zero_of_high_degree {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (W : CurveDivisor C) (hW : IsCanonicalDivisor W) (D : CurveDivisor C) (hdeg : (CurveDivisor.degree C) D > 2 * genus - 2) :

                                                  (Equivalent form of Corollary 22.23.) For $\deg D > 2g - 2$, $i(D) = 0$.

                                                  (Corollary 22.18.) Canonical divisors form a single linear equivalence class: if $W$ is canonical and $D$ is linearly equivalent to $W$ (i.e., $W - D$ is principal), then $D$ is canonical.

                                                  theorem RiemannRochSpace.canonical_imp_dim_genus_deg {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (D : CurveDivisor C) (hD : IsCanonicalDivisor D) :
                                                  (divisorDim D) = genus (CurveDivisor.degree C) D = 2 * genus - 2

                                                  (Corollary 22.24, (a) implies (b).) If $D$ is canonical then $\ell(D) = g$ and $\deg D = 2g - 2$.

                                                  theorem RiemannRochSpace.dim_genus_deg_imp_speciality_one_maxdeg {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (W : CurveDivisor C) (hW : IsCanonicalDivisor W) (D : CurveDivisor C) (hdim : (divisorDim D) = genus) (hdeg : (CurveDivisor.degree C) D = 2 * genus - 2) :

                                                  (Corollary 22.24, (b) implies (c).) If $\ell(D) = g$ and $\deg D = 2g - 2$, then $i(D) = 1$ and $\deg D$ is maximal among divisors with $i(D') = 1$.

                                                  theorem RiemannRochSpace.speciality_one_maxdeg_imp_canonical {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (W : CurveDivisor C) (hW : IsCanonicalDivisor W) (D : CurveDivisor C) (hiD : indexOfSpeciality D = 1) (hmaxdeg : ∀ (D' : CurveDivisor C), indexOfSpeciality D' = 1(CurveDivisor.degree C) D' (CurveDivisor.degree C) D) :

                                                  (Corollary 22.24, (c) implies (a).) If $i(D) = 1$ and $\deg D$ is maximal among divisors of speciality $1$, then $D$ is canonical.

                                                  (Corollary 22.24, (a) iff (b).) $D$ is canonical iff $\ell(D) = g$ and $\deg D = 2g - 2$.

                                                  (Corollary 22.24, (a) iff (c).) $D$ is canonical iff $i(D) = 1$ and $\deg D$ is maximal among divisors with $i(D') = 1$.

                                                  theorem RiemannRochSpace.cor_22_24 {C : Type u_3} {F : Type u_4} {k : Type u_5} [Field k] [Field F] [Algebra k F] [RiemannRochData C F k] (D : CurveDivisor C) (hcanon_exists : ∃ (W : CurveDivisor C), IsCanonicalDivisor W) :

                                                  (Corollary 22.24, full statement.) For a divisor $D$ of a genus $g$ curve admitting at least one canonical divisor, the three conditions are equivalent: (a) $D$ is canonical, (b) $\ell(D) = g$ and $\deg D = 2g - 2$, (c) $i(D) = 1$ with $\deg D$ maximal among divisors of speciality $1$.