File: Mathlib/FieldTheory/RatFunc/AsPolynomial.lean

full_name: RatFunc.C
code: /-- `RatFunc.C a` is the constant rational function `a`. -/
def C : K →+* RatFunc K 
goal: K →+* RatFunc K

full_name: RatFunc.algebraMap_eq_C
code: @[simp]
theorem algebraMap_eq_C : algebraMap K (RatFunc K) = C 
goal: algebraMap K (RatFunc K) = RatFunc.C

full_name: RatFunc.algebraMap_C
code: @[simp]
theorem algebraMap_C (a : K) : algebraMap K[X] (RatFunc K) (Polynomial.C a) = C a 
goal: (algebraMap (Polynomial K) (RatFunc K)) (Polynomial.C a) = RatFunc.C a

full_name: RatFunc.algebraMap_comp_C
code: @[simp]
theorem algebraMap_comp_C : (algebraMap K[X] (RatFunc K)).comp Polynomial.C = C 
goal: (algebraMap (Polynomial K) (RatFunc K)).comp Polynomial.C = RatFunc.C

full_name: RatFunc.smul_eq_C_mul
code: theorem smul_eq_C_mul (r : K) (x : RatFunc K) : r • x = C r * x 
goal: r • x = RatFunc.C r * x

full_name: RatFunc.X
code: /-- `RatFunc.X` is the polynomial variable (aka indeterminate). -/
def X : RatFunc K 
goal: RatFunc K

full_name: RatFunc.algebraMap_X
code: @[simp]
theorem algebraMap_X : algebraMap K[X] (RatFunc K) Polynomial.X = X 
goal: (algebraMap (Polynomial K) (RatFunc K)) Polynomial.X = RatFunc.X

full_name: RatFunc.num_C
code: @[simp]
theorem num_C (c : K) : num (C c) = Polynomial.C c 
goal: (RatFunc.C c).num = Polynomial.C c

full_name: RatFunc.denom_C
code: @[simp]
theorem denom_C (c : K) : denom (C c) = 1 
goal: (RatFunc.C c).denom = 1

full_name: RatFunc.num_X
code: @[simp]
theorem num_X : num (X : RatFunc K) = Polynomial.X 
goal: RatFunc.X.num = Polynomial.X

full_name: RatFunc.denom_X
code: @[simp]
theorem denom_X : denom (X : RatFunc K) = 1 
goal: RatFunc.X.denom = 1

full_name: RatFunc.X_ne_zero
code: theorem X_ne_zero : (X : RatFunc K) ≠ 0 
goal: RatFunc.X ≠ 0

full_name: RatFunc.eval
code: /-- Evaluate a rational function `p` given a ring hom `f` from the scalar field
to the target and a value `x` for the variable in the target.

Fractions are reduced by clearing common denominators before evaluating:
`eval id 1 ((X^2 - 1) / (X - 1)) = eval id 1 (X + 1) = 2`, not `0 / 0 = 0`.
-/
def eval (f : K →+* L) (a : L) (p : RatFunc K) : L 
goal: L

full_name: RatFunc.eval_eq_zero_of_eval₂_denom_eq_zero
code: theorem eval_eq_zero_of_eval₂_denom_eq_zero {x : RatFunc K}
    (h : Polynomial.eval₂ f a (denom x) = 0) : eval f a x = 0 
goal: RatFunc.eval f a x = 0

full_name: RatFunc.eval₂_denom_ne_zero
code: theorem eval₂_denom_ne_zero {x : RatFunc K} (h : eval f a x ≠ 0) :
    Polynomial.eval₂ f a (denom x) ≠ 0 
goal: Polynomial.eval₂ f a x.denom ≠ 0

full_name: RatFunc.eval_C
code: @[simp]
theorem eval_C {c : K} : eval f a (C c) = f c 
goal: RatFunc.eval f a (RatFunc.C c) = f c

full_name: RatFunc.eval_X
code: @[simp]
theorem eval_X : eval f a X = a 
goal: RatFunc.eval f a RatFunc.X = a

full_name: RatFunc.eval_zero
code: @[simp]
theorem eval_zero : eval f a 0 = 0 
goal: RatFunc.eval f a 0 = 0

full_name: RatFunc.eval_one
code: @[simp]
theorem eval_one : eval f a 1 = 1 
goal: RatFunc.eval f a 1 = 1

full_name: RatFunc.eval_algebraMap
code: @[simp]
theorem eval_algebraMap {S : Type*} [CommSemiring S] [Algebra S K[X]] (p : S) :
    eval f a (algebraMap _ _ p) = (algebraMap _ K[X] p).eval₂ f a 
goal: RatFunc.eval f a ((algebraMap S (RatFunc K)) p) = Polynomial.eval₂ f a ((algebraMap S (Polynomial K)) p)

full_name: RatFunc.eval_add
code: /-- `eval` is an additive homomorphism except when a denominator evaluates to `0`.

Counterexample: `eval _ 1 (X / (X-1)) + eval _ 1 (-1 / (X-1)) = 0`
`... ≠ 1 = eval _ 1 ((X-1) / (X-1))`.

See also `RatFunc.eval₂_denom_ne_zero` to make the hypotheses simpler but less general.
-/
theorem eval_add {x y : RatFunc K} (hx : Polynomial.eval₂ f a (denom x) ≠ 0)
    (hy : Polynomial.eval₂ f a (denom y) ≠ 0) : eval f a (x + y) = eval f a x + eval f a y 
goal: RatFunc.eval f a (x + y) = RatFunc.eval f a x + RatFunc.eval f a y

full_name: RatFunc.eval_mul
code: /-- `eval` is a multiplicative homomorphism except when a denominator evaluates to `0`.

Counterexample: `eval _ 0 X * eval _ 0 (1/X) = 0 ≠ 1 = eval _ 0 1 = eval _ 0 (X * 1/X)`.

See also `RatFunc.eval₂_denom_ne_zero` to make the hypotheses simpler but less general.
-/
theorem eval_mul {x y : RatFunc K} (hx : Polynomial.eval₂ f a (denom x) ≠ 0)
    (hy : Polynomial.eval₂ f a (denom y) ≠ 0) : eval f a (x * y) = eval f a x * eval f a y 
goal: RatFunc.eval f a (x * y) = RatFunc.eval f a x * RatFunc.eval f a y

full_name: Polynomial.idealX
code: /-- This is the principal ideal generated by `X` in the ring of polynomials over a field K,
  regarded as an element of the height-one-spectrum. -/
def idealX : IsDedekindDomain.HeightOneSpectrum K[X] 
goal: IsDedekindDomain.HeightOneSpectrum (Polynomial K)

full_name: Polynomial.idealX_span
code: @[simp]
theorem idealX_span : (idealX K).asIdeal = Ideal.span {X} 
goal: (Polynomial.idealX K).asIdeal = Ideal.span {Polynomial.X}

full_name: Polynomial.valuation_X_eq_neg_one
code: @[simp]
theorem valuation_X_eq_neg_one :
    (idealX K).valuation (RatFunc.X : RatFunc K) = Multiplicative.ofAdd (-1 : ℤ) 
goal: (Polynomial.idealX K).valuation RatFunc.X = ↑(Multiplicative.ofAdd (-1))

full_name: Polynomial.valuation_of_mk
code: theorem valuation_of_mk (f : Polynomial K) {g : Polynomial K} (hg : g ≠ 0) :
    (Polynomial.idealX K).valuation (RatFunc.mk f g) =
      (Polynomial.idealX K).intValuation f / (Polynomial.idealX K).intValuation g 
goal: (Polynomial.idealX K).valuation (RatFunc.mk f g) =
  (Polynomial.idealX K).intValuation f / (Polynomial.idealX K).intValuation g

full_name: RatFunc.instValuedWithZeroMultiplicativeInt
code: instance : Valued (RatFunc K) ℤₘ₀ 
goal: Valued (RatFunc K) (WithZero (Multiplicative ℤ))

full_name: RatFunc.WithZero.valued_def
code: @[simp]
theorem WithZero.valued_def {x : RatFunc K} :
    @Valued.v (RatFunc K) _ _ _ _ x = (idealX K).valuation x 
goal: Valued.v x = (Polynomial.idealX K).valuation x