l3lab/ntp-mathlib huggingface dataset:
lemma degree_norm_smul_basis [IsDomain R] (p q : R[X]) :
    (Algebra.norm R[X] <| p • (1 : W.CoordinateRing) + q • mk W Y).degree =
      max (2 • p.degree) (2 • q.degree + 3) := by
  have hdp : (p ^ 2).degree = 2 • p.degree := degree_pow p 2
  have hdpq : (p * q * (C W.a₁ * X + C W.a₃)).degree ≤ p.degree + q.degree + 1 := by
    simpa only [degree_mul] using add_le_add_left degree_linear_le (p.degree + q.degree)
  have hdq :
      (q ^ 2 * (X ^ 3 + C W.a₂ * X ^ 2 + C W.a₄ * X + C W.a₆)).degree = 2 • q.degree + 3 := by
    rw [degree_mul, degree_pow, ← one_mul <| X ^ 3, ← C_1, degree_cubic <| one_ne_zero' R]
  rw [norm_smul_basis]
  by_cases hp : p = 0
  · simpa only [hp, hdq, neg_zero, zero_sub, zero_mul, zero_pow zero_lt_two, degree_neg] using
      (max_bot_left _).symm
  · by_cases hq : q = 0
    · simpa only [hq, hdp, sub_zero, zero_mul, mul_zero, zero_pow zero_lt_two] using
        (max_bot_right _).symm
    · rw [← not_congr degree_eq_bot] at hp hq
      -- porting note: BUG `cases` tactic does not modify assumptions in `hp'` and `hq'`
      rcases hp' : p.degree with _ | dp -- `hp' : ` should be redundant
      · exact (hp hp').elim -- `hp'` should be `rfl`
      · rw [hp'] at hdp hdpq -- line should be redundant
        rcases hq' : q.degree with _ | dq -- `hq' : ` should be redundant
        · exact (hq hq').elim -- `hq'` should be `rfl`
        · rw [hq'] at hdpq hdq -- line should be redundant
          rcases le_or_lt dp (dq + 1) with hpq | hpq
          · convert (degree_sub_eq_right_of_degree_lt <| (degree_sub_le _ _).trans_lt <|
                      max_lt_iff.mpr ⟨hdp.trans_lt _, hdpq.trans_lt _⟩).trans
              (max_eq_right_of_lt _).symm <;> rw [hdq] <;>
                exact WithBot.coe_lt_coe.mpr <| by linarith only [hpq]
          · rw [sub_sub]
            convert (degree_sub_eq_left_of_degree_lt <| (degree_add_le _ _).trans_lt <|
                      max_lt_iff.mpr ⟨hdpq.trans_lt _, hdq.trans_lt _⟩).trans
              (max_eq_left_of_lt _).symm <;> rw [hdp] <;>
                exact WithBot.coe_lt_coe.mpr <| by 

Proof state:
R : Type u
inst✝¹ : CommRing R
W : Affine R
inst✝ : IsDomain R
p q : R[X]
hp : ¬degree p = ⊥
hq : ¬degree q = ⊥
dp : ℕ
hdp : degree (p ^ 2) = 2 • some dp
hp' : degree p = some dp
dq : ℕ
hdq : degree (q ^ 2 * (Y ^ 3 + C W.a₂ * Y ^ 2 + C W.a₄ * Y + C W.a₆)) = 2 • some dq + 3
hdpq : degree (p * q * (C W.a₁ * Y + C W.a₃)) ≤ some dp + some dq + 1
hq' : degree q = some dq
hpq : dq + 1 < dp
⊢ (fun x x_1 => x + x_1) ((fun x x_1 => x + x_1) dp dq) 1 < (fun x x_1 => x + x_1) dp ((fun x x_1 => x + x_1) dp 0)

Next tactic:
linarith only [hpq]
lemma degree_norm_smul_basis [IsDomain R] (p q : R[X]) :
    (Algebra.norm R[X] <| p • (1 : W.CoordinateRing) + q • mk W Y).degree =
      max (2 • p.degree) (2 • q.degree + 3) := by
  have hdp : (p ^ 2).degree = 2 • p.degree := degree_pow p 2
  have hdpq : (p * q * (C W.a₁ * X + C W.a₃)).degree ≤ p.degree + q.degree + 1 := by
    simpa only [degree_mul] using add_le_add_left degree_linear_le (p.degree + q.degree)
  have hdq :
      (q ^ 2 * (X ^ 3 + C W.a₂ * X ^ 2 + C W.a₄ * X + C W.a₆)).degree = 2 • q.degree + 3 := by
    rw [degree_mul, degree_pow, ← one_mul <| X ^ 3, ← C_1, degree_cubic <| one_ne_zero' R]
  rw [norm_smul_basis]
  by_cases hp : p = 0
  · simpa only [hp, hdq, neg_zero, zero_sub, zero_mul, zero_pow zero_lt_two, degree_neg] using
      (max_bot_left _).symm
  · by_cases hq : q = 0
    · simpa only [hq, hdp, sub_zero, zero_mul, mul_zero, zero_pow zero_lt_two] using
        (max_bot_right _).symm
    · rw [← not_congr degree_eq_bot] at hp hq
      -- porting note: BUG `cases` tactic does not modify assumptions in `hp'` and `hq'`
      rcases hp' : p.degree with _ | dp -- `hp' : ` should be redundant
      · exact (hp hp').elim -- `hp'` should be `rfl`
      · rw [hp'] at hdp hdpq -- line should be redundant
        rcases hq' : q.degree with _ | dq -- `hq' : ` should be redundant
        · exact (hq hq').elim -- `hq'` should be `rfl`
        · rw [hq'] at hdpq hdq -- line should be redundant
          rcases le_or_lt dp (dq + 1) with hpq | hpq
          · convert (degree_sub_eq_right_of_degree_lt <| (degree_sub_le _ _).trans_lt <|
                      max_lt_iff.mpr ⟨hdp.trans_lt _, hdpq.trans_lt _⟩).trans
              (max_eq_right_of_lt _).symm <;> rw [hdq] <;>
                exact WithBot.coe_lt_coe.mpr <| by linarith only [hpq]
          · rw [sub_sub]
            convert (degree_sub_eq_left_of_degree_lt <| (degree_add_le _ _).trans_lt <|
                      max_lt_iff.mpr ⟨hdpq.trans_lt _, hdq.trans_lt _⟩).trans
              (max_eq_left_of_lt _).symm <;> rw [hdp] <;>
                

Proof state:
case neg.some.some.inr.convert_3
R : Type u
inst✝¹ : CommRing R
W : Affine R
inst✝ : IsDomain R
p q : R[X]
hp : ¬degree p = ⊥
hq : ¬degree q = ⊥
dp : ℕ
hdp : degree (p ^ 2) = 2 • some dp
hp' : degree p = some dp
dq : ℕ
hdq : degree (q ^ 2 * (Y ^ 3 + C W.a₂ * Y ^ 2 + C W.a₄ * Y + C W.a₆)) = 2 • some dq + 3
hdpq : degree (p * q * (C W.a₁ * Y + C W.a₃)) ≤ some dp + some dq + 1
hq' : degree q = some dq
hpq : dq + 1 < dp
⊢ 2 • some dq + 3 < 2 • some dp

Next tactic:
exact WithBot.coe_lt_coe.mpr <| by linarith only [hpq]
lemma degree_norm_smul_basis [IsDomain R] (p q : R[X]) :
    (Algebra.norm R[X] <| p • (1 : W.CoordinateRing) + q • mk W Y).degree =
      max (2 • p.degree) (2 • q.degree + 3) := by
  have hdp : (p ^ 2).degree = 2 • p.degree := degree_pow p 2
  have hdpq : (p * q * (C W.a₁ * X + C W.a₃)).degree ≤ p.degree + q.degree + 1 := by
    simpa only [degree_mul] using add_le_add_left degree_linear_le (p.degree + q.degree)
  have hdq :
      (q ^ 2 * (X ^ 3 + C W.a₂ * X ^ 2 + C W.a₄ * X + C W.a₆)).degree = 2 • q.degree + 3 := by
    rw [degree_mul, degree_pow, ← one_mul <| X ^ 3, ← C_1, degree_cubic <| one_ne_zero' R]
  rw [norm_smul_basis]
  by_cases hp : p = 0
  · simpa only [hp, hdq, neg_zero, zero_sub, zero_mul, zero_pow zero_lt_two, degree_neg] using
      (max_bot_left _).symm
  · by_cases hq : q = 0
    · simpa only [hq, hdp, sub_zero, zero_mul, mul_zero, zero_pow zero_lt_two] using
        (max_bot_right _).symm
    · rw [← not_congr degree_eq_bot] at hp hq
      -- porting note: BUG `cases` tactic does not modify assumptions in `hp'` and `hq'`
      rcases hp' : p.degree with _ | dp -- `hp' : ` should be redundant
      · exact (hp hp').elim -- `hp'` should be `rfl`
      · rw [hp'] at hdp hdpq -- line should be redundant
        rcases hq' : q.degree with _ | dq -- `hq' : ` should be redundant
        · exact (hq hq').elim -- `hq'` should be `rfl`
        · rw [hq'] at hdpq hdq -- line should be redundant
          rcases le_or_lt dp (dq + 1) with hpq | hpq
          · convert (degree_sub_eq_right_of_degree_lt <| (degree_sub_le _ _).trans_lt <|
                      max_lt_iff.mpr ⟨hdp.trans_lt _, hdpq.trans_lt _⟩).trans
              (max_eq_right_of_lt _).symm <;> rw [hdq] <;>
                exact WithBot.coe_lt_coe.mpr <| by linarith only [hpq]
          · rw [sub_sub]
            convert (degree_sub_eq_left_of_degree_lt <| (degree_add_le _ _).trans_lt <|
                      max_lt_iff.mpr ⟨hdpq.trans_lt _, hdq.trans_lt _⟩).trans
              (max_eq_left_of_lt _).symm <;> rw [hdp] <;>
                exact WithBot.coe_lt_coe.mpr <| by 

Proof state:
R : Type u
inst✝¹ : CommRing R
W : Affine R
inst✝ : IsDomain R
p q : R[X]
hp : ¬degree p = ⊥
hq : ¬degree q = ⊥
dp : ℕ
hdp : degree (p ^ 2) = 2 • some dp
hp' : degree p = some dp
dq : ℕ
hdq : degree (q ^ 2 * (Y ^ 3 + C W.a₂ * Y ^ 2 + C W.a₄ * Y + C W.a₆)) = 2 • some dq + 3
hdpq : degree (p * q * (C W.a₁ * Y + C W.a₃)) ≤ some dp + some dq + 1
hq' : degree q = some dq
hpq : dq + 1 < dp
⊢ (fun x x_1 => x + x_1) ((fun x x_1 => x + x_1) dq ((fun x x_1 => x + x_1) dq 0)) ↑3 <
    (fun x x_1 => x + x_1) dp ((fun x x_1 => x + x_1) dp 0)

Next tactic:
linarith only [hpq]
lemma degree_norm_smul_basis [IsDomain R] (p q : R[X]) :
    (Algebra.norm R[X] <| p • (1 : W.CoordinateRing) + q • mk W Y).degree =
      max (2 • p.degree) (2 • q.degree + 3) := by
  have hdp : (p ^ 2).degree = 2 • p.degree := degree_pow p 2
  have hdpq : (p * q * (C W.a₁ * X + C W.a₃)).degree ≤ p.degree + q.degree + 1 := by
    simpa only [degree_mul] using add_le_add_left degree_linear_le (p.degree + q.degree)
  have hdq :
      (q ^ 2 * (X ^ 3 + C W.a₂ * X ^ 2 + C W.a₄ * X + C W.a₆)).degree = 2 • q.degree + 3 := by
    rw [degree_mul, degree_pow, ← one_mul <| X ^ 3, ← C_1, degree_cubic <| one_ne_zero' R]
  rw [norm_smul_basis]
  by_cases hp : p = 0
  · simpa only [hp, hdq, neg_zero, zero_sub, zero_mul, zero_pow zero_lt_two, degree_neg] using
      (max_bot_left _).symm
  · by_cases hq : q = 0
    · simpa only [hq, hdp, sub_zero, zero_mul, mul_zero, zero_pow zero_lt_two] using
        (max_bot_right _).symm
    · rw [← not_congr degree_eq_bot] at hp hq
      -- porting note: BUG `cases` tactic does not modify assumptions in `hp'` and `hq'`
      rcases hp' : p.degree with _ | dp -- `hp' : ` should be redundant
      · exact (hp hp').elim -- `hp'` should be `rfl`
      · rw [hp'] at hdp hdpq -- line should be redundant
        rcases hq' : q.degree with _ | dq -- `hq' : ` should be redundant
        · exact (hq hq').elim -- `hq'` should be `rfl`
        · rw [hq'] at hdpq hdq -- line should be redundant
          rcases le_or_lt dp (dq + 1) with hpq | hpq
          · convert (degree_sub_eq_right_of_degree_lt <| (degree_sub_le _ _).trans_lt <|
                      max_lt_iff.mpr ⟨hdp.trans_lt _, hdpq.trans_lt _⟩).trans
              (max_eq_right_of_lt _).symm <;> rw [hdq] <;>
                exact WithBot.coe_lt_coe.mpr <| by linarith only [hpq]
          · rw [sub_sub]
            convert (degree_sub_eq_left_of_degree_lt <| (degree_add_le _ _).trans_lt <|
                      max_lt_iff.mpr ⟨hdpq.trans_lt _, hdq.trans_lt _⟩).trans
              (max_eq_left_of_lt _).symm <;> rw [hdp] <;>
                

Proof state:
case neg.some.some.inr.convert_5
R : Type u
inst✝¹ : CommRing R
W : Affine R
inst✝ : IsDomain R
p q : R[X]
hp : ¬degree p = ⊥
hq : ¬degree q = ⊥
dp : ℕ
hdp : degree (p ^ 2) = 2 • some dp
hp' : degree p = some dp
dq : ℕ
hdq : degree (q ^ 2 * (Y ^ 3 + C W.a₂ * Y ^ 2 + C W.a₄ * Y + C W.a₆)) = 2 • some dq + 3
hdpq : degree (p * q * (C W.a₁ * Y + C W.a₃)) ≤ some dp + some dq + 1
hq' : degree q = some dq
hpq : dq + 1 < dp
⊢ 2 • some dq + 3 < 2 • some dp

Next tactic:
exact WithBot.coe_lt_coe.mpr <| by linarith only [hpq]
lemma degree_norm_ne_one [IsDomain R] (x : W.CoordinateRing) :
    (Algebra.norm R[X] x).degree ≠ 1 := by
  

Proof state:
R : Type u
inst✝¹ : CommRing R
W : Affine R
inst✝ : IsDomain R
x : W.CoordinateRing
⊢ degree ((Algebra.norm R[X]) x) ≠ 1

Next tactic:
rcases exists_smul_basis_eq x with ⟨p, q, rfl⟩
lemma degree_norm_ne_one [IsDomain R] (x : W.CoordinateRing) :
    (Algebra.norm R[X] x).degree ≠ 1 := by
  rcases exists_smul_basis_eq x with ⟨p, q, rfl⟩
  

Proof state:
case intro.intro
R : Type u
inst✝¹ : CommRing R
W : Affine R
inst✝ : IsDomain R
p q : R[X]
⊢ degree ((Algebra.norm R[X]) (p • 1 + q • (mk W) Y)) ≠ 1

Next tactic:
rw [degree_norm_smul_basis]
lemma degree_norm_ne_one [IsDomain R] (x : W.CoordinateRing) :
    (Algebra.norm R[X] x).degree ≠ 1 := by
  rcases exists_smul_basis_eq x with ⟨p, q, rfl⟩
  rw [degree_norm_smul_basis]
  

Proof state:
case intro.intro
R : Type u
inst✝¹ : CommRing R
W : Affine R
inst✝ : IsDomain R
p q : R[X]
⊢ max (2 • degree p) (2 • degree q + 3) ≠ 1

Next tactic:
rcases p.degree with (_ | _ | _ | _)
lemma degree_norm_ne_one [IsDomain R] (x : W.CoordinateRing) :
    (Algebra.norm R[X] x).degree ≠ 1 := by
  rcases exists_smul_basis_eq x with ⟨p, q, rfl⟩
  rw [degree_norm_smul_basis]
  rcases p.degree with (_ | _ | _ | _) <;> 

Proof state:
case intro.intro.none
R : Type u
inst✝¹ : CommRing R
W : Affine R
inst✝ : IsDomain R
p q : R[X]
⊢ max (2 • none) (2 • degree q + 3) ≠ 1

Next tactic:
cases q.degree
lemma degree_norm_ne_one [IsDomain R] (x : W.CoordinateRing) :
    (Algebra.norm R[X] x).degree ≠ 1 := by
  rcases exists_smul_basis_eq x with ⟨p, q, rfl⟩
  rw [degree_norm_smul_basis]
  rcases p.degree with (_ | _ | _ | _) <;> 

Proof state:
case intro.intro.some.zero
R : Type u
inst✝¹ : CommRing R
W : Affine R
inst✝ : IsDomain R
p q : R[X]
⊢ max (2 • some Nat.zero) (2 • degree q + 3) ≠ 1

Next tactic:
cases q.degree
lemma degree_norm_ne_one [IsDomain R] (x : W.CoordinateRing) :
    (Algebra.norm R[X] x).degree ≠ 1 := by
  rcases exists_smul_basis_eq x with ⟨p, q, rfl⟩
  rw [degree_norm_smul_basis]
  rcases p.degree with (_ | _ | _ | _) <;> 

Proof state:
case intro.intro.some.succ.zero
R : Type u
inst✝¹ : CommRing R
W : Affine R
inst✝ : IsDomain R
p q : R[X]
⊢ max (2 • some (Nat.succ Nat.zero)) (2 • degree q + 3) ≠ 1

Next tactic:
cases q.degree
lemma degree_norm_ne_one [IsDomain R] (x : W.CoordinateRing) :
    (Algebra.norm R[X] x).degree ≠ 1 := by
  rcases exists_smul_basis_eq x with ⟨p, q, rfl⟩
  rw [degree_norm_smul_basis]
  rcases p.degree with (_ | _ | _ | _) <;> 

Proof state:
case intro.intro.some.succ.succ
R : Type u
inst✝¹ : CommRing R
W : Affine R
inst✝ : IsDomain R
p q : R[X]
n✝ : ℕ
⊢ max (2 • some (Nat.succ (Nat.succ n✝))) (2 • degree q + 3) ≠ 1

Next tactic:
cases q.degree
lemma degree_norm_ne_one [IsDomain R] (x : W.CoordinateRing) :
    (Algebra.norm R[X] x).degree ≠ 1 := by
  rcases exists_smul_basis_eq x with ⟨p, q, rfl⟩
  rw [degree_norm_smul_basis]
  rcases p.degree with (_ | _ | _ | _) <;> cases q.degree
  

Proof state:
case intro.intro.none.none
R : Type u
inst✝¹ : CommRing R
W : Affine R
inst✝ : IsDomain R
p q : R[X]
⊢ max (2 • none) (2 • none + 3) ≠ 1
case intro.intro.none.some
R : Type u
inst✝¹ : CommRing R
W : Affine R
inst✝ : IsDomain R
p q : R[X]
val✝ : ℕ
⊢ max (2 • none) (2 • some val✝ + 3) ≠ 1
case intro.intro.some.zero.none
R : Type u
inst✝¹ : CommRing R
W : Affine R
inst✝ : IsDomain R
p q : R[X]
⊢ max (2 • some Nat.zero) (2 • none + 3) ≠ 1
case intro.intro.some.zero.some
R : Type u
inst✝¹ : CommRing R
W : Affine R
inst✝ : IsDomain R
p q : R[X]
val✝ : ℕ
⊢ max (2 • some Nat.zero) (2 • some val✝ + 3) ≠ 1
case intro.intro.some.succ.zero.none
R : Type u
inst✝¹ : CommRing R
W : Affine R
inst✝ : IsDomain R
p q : R[X]
⊢ max (2 • some (Nat.succ Nat.zero)) (2 • none + 3) ≠ 1
case intro.intro.some.succ.zero.some
R : Type u
inst✝¹ : CommRing R
W : Affine R
inst✝ : IsDomain R
p q : R[X]
val✝ : ℕ
⊢ max (2 • some (Nat.succ Nat.zero)) (2 • some val✝ + 3) ≠ 1
case intro.intro.some.succ.succ.none
R : Type u
inst✝¹ : CommRing R
W : Affine R
inst✝ : IsDomain R
p q : R[X]
n✝ : ℕ
⊢ max (2 • some (Nat.succ (Nat.succ n✝))) (2 • none + 3) ≠ 1
case intro.intro.some.succ.succ.some
R : Type u
inst✝¹ : CommRing R
W : Affine R
inst✝ : IsDomain R
p q : R[X]
n✝ val✝ : ℕ
⊢ max (2 • some (Nat.succ (Nat.succ n✝))) (2 • some val✝ + 3) ≠ 1

Next tactic:
any_goals rintro (_ | _)
lemma degree_norm_ne_one [IsDomain R] (x : W.CoordinateRing) :
    (Algebra.norm R[X] x).degree ≠ 1 := by
  rcases exists_smul_basis_eq x with ⟨p, q, rfl⟩
  rw [degree_norm_smul_basis]
  rcases p.degree with (_ | _ | _ | _) <;> cases q.degree
  any_goals 

Proof state:
case intro.intro.none.none
R : Type u
inst✝¹ : CommRing R
W : Affine R
inst✝ : IsDomain R
p q : R[X]
⊢ max (2 • none) (2 • none + 3) ≠ 1

Next tactic:
rintro (_ | _)
lemma degree_norm_ne_one [IsDomain R] (x : W.CoordinateRing) :
    (Algebra.norm R[X] x).degree ≠ 1 := by
  rcases exists_smul_basis_eq x with ⟨p, q, rfl⟩
  rw [degree_norm_smul_basis]
  rcases p.degree with (_ | _ | _ | _) <;> cases q.degree
  any_goals 

Proof state:
case intro.intro.none.some
R : Type u
inst✝¹ : CommRing R
W : Affine R
inst✝ : IsDomain R
p q : R[X]
val✝ : ℕ
⊢ max (2 • none) (2 • some val✝ + 3) ≠ 1

Next tactic:
rintro (_ | _)
lemma degree_norm_ne_one [IsDomain R] (x : W.CoordinateRing) :
    (Algebra.norm R[X] x).degree ≠ 1 := by
  rcases exists_smul_basis_eq x with ⟨p, q, rfl⟩
  rw [degree_norm_smul_basis]
  rcases p.degree with (_ | _ | _ | _) <;> cases q.degree
  any_goals 

Proof state:
case intro.intro.some.zero.none
R : Type u
inst✝¹ : CommRing R
W : Affine R
inst✝ : IsDomain R
p q : R[X]
⊢ max (2 • some Nat.zero) (2 • none + 3) ≠ 1

Next tactic:
rintro (_ | _)
lemma degree_norm_ne_one [IsDomain R] (x : W.CoordinateRing) :
    (Algebra.norm R[X] x).degree ≠ 1 := by
  rcases exists_smul_basis_eq x with ⟨p, q, rfl⟩
  rw [degree_norm_smul_basis]
  rcases p.degree with (_ | _ | _ | _) <;> cases q.degree
  any_goals 

Proof state:
case intro.intro.some.zero.some
R : Type u
inst✝¹ : CommRing R
W : Affine R
inst✝ : IsDomain R
p q : R[X]
val✝ : ℕ
⊢ max (2 • some Nat.zero) (2 • some val✝ + 3) ≠ 1

Next tactic:
rintro (_ | _)
lemma degree_norm_ne_one [IsDomain R] (x : W.CoordinateRing) :
    (Algebra.norm R[X] x).degree ≠ 1 := by
  rcases exists_smul_basis_eq x with ⟨p, q, rfl⟩
  rw [degree_norm_smul_basis]
  rcases p.degree with (_ | _ | _ | _) <;> cases q.degree
  any_goals 

Proof state:
case intro.intro.some.succ.zero.none
R : Type u
inst✝¹ : CommRing R
W : Affine R
inst✝ : IsDomain R
p q : R[X]
⊢ max (2 • some (Nat.succ Nat.zero)) (2 • none + 3) ≠ 1

Next tactic:
rintro (_ | _)
lemma degree_norm_ne_one [IsDomain R] (x : W.CoordinateRing) :
    (Algebra.norm R[X] x).degree ≠ 1 := by
  rcases exists_smul_basis_eq x with ⟨p, q, rfl⟩
  rw [degree_norm_smul_basis]
  rcases p.degree with (_ | _ | _ | _) <;> cases q.degree
  any_goals 

Proof state:
case intro.intro.some.succ.zero.some
R : Type u
inst✝¹ : CommRing R
W : Affine R
inst✝ : IsDomain R
p q : R[X]
val✝ : ℕ
⊢ max (2 • some (Nat.succ Nat.zero)) (2 • some val✝ + 3) ≠ 1

Next tactic:
rintro (_ | _)
lemma degree_norm_ne_one [IsDomain R] (x : W.CoordinateRing) :
    (Algebra.norm R[X] x).degree ≠ 1 := by
  rcases exists_smul_basis_eq x with ⟨p, q, rfl⟩
  rw [degree_norm_smul_basis]
  rcases p.degree with (_ | _ | _ | _) <;> cases q.degree
  any_goals 

Proof state:
case intro.intro.some.succ.succ.none
R : Type u
inst✝¹ : CommRing R
W : Affine R
inst✝ : IsDomain R
p q : R[X]
n✝ : ℕ
⊢ max (2 • some (Nat.succ (Nat.succ n✝))) (2 • none + 3) ≠ 1

Next tactic:
rintro (_ | _)
lemma degree_norm_ne_one [IsDomain R] (x : W.CoordinateRing) :
    (Algebra.norm R[X] x).degree ≠ 1 := by
  rcases exists_smul_basis_eq x with ⟨p, q, rfl⟩
  rw [degree_norm_smul_basis]
  rcases p.degree with (_ | _ | _ | _) <;> cases q.degree
  any_goals 

Proof state:
case intro.intro.some.succ.succ.some
R : Type u
inst✝¹ : CommRing R
W : Affine R
inst✝ : IsDomain R
p q : R[X]
n✝ val✝ : ℕ
⊢ max (2 • some (Nat.succ (Nat.succ n✝))) (2 • some val✝ + 3) ≠ 1

Next tactic:
rintro (_ | _)
lemma degree_norm_ne_one [IsDomain R] (x : W.CoordinateRing) :
    (Algebra.norm R[X] x).degree ≠ 1 := by
  rcases exists_smul_basis_eq x with ⟨p, q, rfl⟩
  rw [degree_norm_smul_basis]
  rcases p.degree with (_ | _ | _ | _) <;> cases q.degree
  any_goals rintro (_ | _)
  -- porting note: replaced `dec_trivial` with `by exact (cmp_eq_lt_iff ..).mp rfl`
  

Proof state:
case intro.intro.some.succ.succ.some
R : Type u
inst✝¹ : CommRing R
W : Affine R
inst✝ : IsDomain R
p q : R[X]
n✝ val✝ : ℕ
⊢ max (2 • some (Nat.succ (Nat.succ n✝))) (2 • some val✝ + 3) ≠ 1

Next tactic:
exact (lt_max_of_lt_right <| by exact (cmp_eq_lt_iff ..).mp rfl).ne'
lemma degree_norm_ne_one [IsDomain R] (x : W.CoordinateRing) :
    (Algebra.norm R[X] x).degree ≠ 1 := by
  rcases exists_smul_basis_eq x with ⟨p, q, rfl⟩
  rw [degree_norm_smul_basis]
  rcases p.degree with (_ | _ | _ | _) <;> cases q.degree
  any_goals rintro (_ | _)
  -- porting note: replaced `dec_trivial` with `by exact (cmp_eq_lt_iff ..).mp rfl`
  exact (lt_max_of_lt_right <| by 

Proof state:
R : Type u
inst✝¹ : CommRing R
W : Affine R
inst✝ : IsDomain R
p q : R[X]
n✝ val✝ : ℕ
⊢ 1 < 2 • some val✝ + 3

Next tactic:
exact (cmp_eq_lt_iff ..).mp rfl
/-- The group homomorphism mapping an affine point $(x, y)$ of `W` to the class of the non-zero
fractional ideal $\langle X - x, Y - y \rangle$ of $F(W)$ in the class group of $F[W]$. -/
@[simps]
noncomputable def toClass : W.Point →+ Additive (ClassGroup W.CoordinateRing) where
  toFun := toClassFun
  map_zero' := rfl
  map_add' := by
    

Proof state:
R : Type u
inst✝¹ : CommRing R
W✝ : Affine R
F : Type u
inst✝ : Field F
W : Affine F
⊢ ∀ (x y : Point W),
    ZeroHom.toFun { toFun := toClassFun, map_zero' := (_ : toClassFun 0 = toClassFun 0) } (x + y) =
      ZeroHom.toFun { toFun := toClassFun, map_zero' := (_ : toClassFun 0 = toClassFun 0) } x +
        ZeroHom.toFun { toFun := toClassFun, map_zero' := (_ : toClassFun 0 = toClassFun 0) } y

Next tactic:
rintro (_ | @⟨x₁, y₁, h₁⟩) (_ | @⟨x₂, y₂, h₂⟩)
/-- The group homomorphism mapping an affine point $(x, y)$ of `W` to the class of the non-zero
fractional ideal $\langle X - x, Y - y \rangle$ of $F(W)$ in the class group of $F[W]$. -/
@[simps]
noncomputable def toClass : W.Point →+ Additive (ClassGroup W.CoordinateRing) where
  toFun := toClassFun
  map_zero' := rfl
  map_add' := by
    rintro (_ | @⟨x₁, y₁, h₁⟩) (_ | @⟨x₂, y₂, h₂⟩)
    

Proof state:
case zero.zero
R : Type u
inst✝¹ : CommRing R
W✝ : Affine R
F : Type u
inst✝ : Field F
W : Affine F
⊢ ZeroHom.toFun { toFun := toClassFun, map_zero' := (_ : toClassFun 0 = toClassFun 0) } (zero + zero) =
    ZeroHom.toFun { toFun := toClassFun, map_zero' := (_ : toClassFun 0 = toClassFun 0) } zero +
      ZeroHom.toFun { toFun := toClassFun, map_zero' := (_ : toClassFun 0 = toClassFun 0) } zero
case zero.some
R : Type u
inst✝¹ : CommRing R
W✝ : Affine R
F : Type u
inst✝ : Field F
W : Affine F
x₂ y₂ : F
h₂ : W.nonsingular x₂ y₂
⊢ ZeroHom.toFun { toFun := toClassFun, map_zero' := (_ : toClassFun 0 = toClassFun 0) } (zero + some h₂) =
    ZeroHom.toFun { toFun := toClassFun, map_zero' := (_ : toClassFun 0 = toClassFun 0) } zero +
      ZeroHom.toFun { toFun := toClassFun, map_zero' := (_ : toClassFun 0 = toClassFun 0) } (some h₂)
case some.zero
R : Type u
inst✝¹ : CommRing R
W✝ : Affine R
F : Type u
inst✝ : Field F
W : Affine F
x₁ y₁ : F
h₁ : W.nonsingular x₁ y₁
⊢ ZeroHom.toFun { toFun := toClassFun, map_zero' := (_ : toClassFun 0 = toClassFun 0) } (some h₁ + zero) =
    ZeroHom.toFun { toFun := toClassFun, map_zero' := (_ : toClassFun 0 = toClassFun 0) } (some h₁) +
      ZeroHom.toFun { toFun := toClassFun, map_zero' := (_ : toClassFun 0 = toClassFun 0) } zero
case some.some
R : Type u
inst✝¹ : CommRing R
W✝ : Affine R
F : Type u
inst✝ : Field F
W : Affine F
x₁ y₁ : F
h₁ : W.nonsingular x₁ y₁
x₂ y₂ : F
h₂ : W.nonsingular x₂ y₂
⊢ ZeroHom.toFun { toFun := toClassFun, map_zero' := (_ : toClassFun 0 = toClassFun 0) } (some h₁ + some h₂) =
    ZeroHom.toFun { toFun := toClassFun, map_zero' := (_ : toClassFun 0 = toClassFun 0) } (some h₁) +
      ZeroHom.toFun { toFun := toClassFun, map_zero' := (_ : toClassFun 0 = toClassFun 0) } (some h₂)

Next tactic:
any_goals simp only [zero_def, toClassFun, _root_.zero_add, _root_.add_zero]
/-- The group homomorphism mapping an affine point $(x, y)$ of `W` to the class of the non-zero
fractional ideal $\langle X - x, Y - y \rangle$ of $F(W)$ in the class group of $F[W]$. -/
@[simps]
noncomputable def toClass : W.Point →+ Additive (ClassGroup W.CoordinateRing) where
  toFun := toClassFun
  map_zero' := rfl
  map_add' := by
    rintro (_ | @⟨x₁, y₁, h₁⟩) (_ | @⟨x₂, y₂, h₂⟩)
    any_goals 

Proof state:
case zero.zero
R : Type u
inst✝¹ : CommRing R
W✝ : Affine R
F : Type u
inst✝ : Field F
W : Affine F
⊢ ZeroHom.toFun { toFun := toClassFun, map_zero' := (_ : toClassFun 0 = toClassFun 0) } (zero + zero) =
    ZeroHom.toFun { toFun := toClassFun, map_zero' := (_ : toClassFun 0 = toClassFun 0) } zero +
      ZeroHom.toFun { toFun := toClassFun, map_zero' := (_ : toClassFun 0 = toClassFun 0) } zero

Next tactic:
simp only [zero_def, toClassFun, _root_.zero_add, _root_.add_zero]