[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q f : R[X]
⊢ { toFinsupp := f.toFinsupp } = f
[PROOFSTEP]
cases f
[GOAL]
case ofFinsupp
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ { toFinsupp := { toFinsupp := toFinsupp✝ }.toFinsupp } = { toFinsupp := toFinsupp✝ }
[PROOFSTEP]
rfl
[GOAL]
R : Type u
a✝ b✝ : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
a b : AddMonoidAlgebra R ℕ
⊢ { toFinsupp := a + b } = Polynomial.add { toFinsupp := a } { toFinsupp := b }
[PROOFSTEP]
rw [add_def]
[GOAL]
R✝ : Type u
a✝ b : R✝
m n : ℕ
inst✝¹ : Semiring R✝
p q : R✝[X]
R : Type u
inst✝ : Ring R
a : AddMonoidAlgebra R ℕ
⊢ { toFinsupp := -a } = Polynomial.neg { toFinsupp := a }
[PROOFSTEP]
rw [neg_def]
[GOAL]
R✝ : Type u
a✝ b✝ : R✝
m n : ℕ
inst✝¹ : Semiring R✝
p q : R✝[X]
R : Type u
inst✝ : Ring R
a b : AddMonoidAlgebra R ℕ
⊢ { toFinsupp := a - b } = { toFinsupp := a } - { toFinsupp := b }
[PROOFSTEP]
rw [sub_eq_add_neg, ofFinsupp_add, ofFinsupp_neg]
[GOAL]
R✝ : Type u
a✝ b✝ : R✝
m n : ℕ
inst✝¹ : Semiring R✝
p q : R✝[X]
R : Type u
inst✝ : Ring R
a b : AddMonoidAlgebra R ℕ
⊢ { toFinsupp := a } + -{ toFinsupp := b } = { toFinsupp := a } - { toFinsupp := b }
[PROOFSTEP]
rfl
[GOAL]
R : Type u
a✝ b✝ : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
a b : AddMonoidAlgebra R ℕ
⊢ { toFinsupp := a * b } = Polynomial.mul { toFinsupp := a } { toFinsupp := b }
[PROOFSTEP]
rw [mul_def]
[GOAL]
R : Type u
a✝ b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
a : AddMonoidAlgebra R ℕ
n : ℕ
⊢ { toFinsupp := a ^ n } = { toFinsupp := a } ^ n
[PROOFSTEP]
change _ = npowRec n _
[GOAL]
R : Type u
a✝ b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
a : AddMonoidAlgebra R ℕ
n : ℕ
⊢ { toFinsupp := a ^ n } = npowRec n { toFinsupp := a }
[PROOFSTEP]
induction n with
| zero => simp [npowRec]
| succ n n_ih => simp [npowRec, n_ih, pow_succ]
[GOAL]
R : Type u
a✝ b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
a : AddMonoidAlgebra R ℕ
n : ℕ
⊢ { toFinsupp := a ^ n } = npowRec n { toFinsupp := a }
[PROOFSTEP]
induction n with
| zero => simp [npowRec]
| succ n n_ih => simp [npowRec, n_ih, pow_succ]
[GOAL]
case zero
R : Type u
a✝ b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
a : AddMonoidAlgebra R ℕ
⊢ { toFinsupp := a ^ Nat.zero } = npowRec Nat.zero { toFinsupp := a }
[PROOFSTEP]

| zero => simp [npowRec]
[GOAL]
case zero
R : Type u
a✝ b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
a : AddMonoidAlgebra R ℕ
⊢ { toFinsupp := a ^ Nat.zero } = npowRec Nat.zero { toFinsupp := a }
[PROOFSTEP]
simp [npowRec]
[GOAL]
case succ
R : Type u
a✝ b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
a : AddMonoidAlgebra R ℕ
n : ℕ
n_ih : { toFinsupp := a ^ n } = npowRec n { toFinsupp := a }
⊢ { toFinsupp := a ^ Nat.succ n } = npowRec (Nat.succ n) { toFinsupp := a }
[PROOFSTEP]

| succ n n_ih => simp [npowRec, n_ih, pow_succ]
[GOAL]
case succ
R : Type u
a✝ b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
a : AddMonoidAlgebra R ℕ
n : ℕ
n_ih : { toFinsupp := a ^ n } = npowRec n { toFinsupp := a }
⊢ { toFinsupp := a ^ Nat.succ n } = npowRec (Nat.succ n) { toFinsupp := a }
[PROOFSTEP]
simp [npowRec, n_ih, pow_succ]
[GOAL]
R : Type u
a✝ b✝ : R
m n : ℕ
inst✝ : Semiring R
p q a b : R[X]
⊢ (a + b).toFinsupp = a.toFinsupp + b.toFinsupp
[PROOFSTEP]
cases a
[GOAL]
case ofFinsupp
R : Type u
a b✝ : R
m n : ℕ
inst✝ : Semiring R
p q b : R[X]
toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ ({ toFinsupp := toFinsupp✝ } + b).toFinsupp = { toFinsupp := toFinsupp✝ }.toFinsupp + b.toFinsupp
[PROOFSTEP]
cases b
[GOAL]
case ofFinsupp.ofFinsupp
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
toFinsupp✝¹ toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ ({ toFinsupp := toFinsupp✝¹ } + { toFinsupp := toFinsupp✝ }).toFinsupp =
    { toFinsupp := toFinsupp✝¹ }.toFinsupp + { toFinsupp := toFinsupp✝ }.toFinsupp
[PROOFSTEP]
rw [← ofFinsupp_add]
[GOAL]
R✝ : Type u
a✝ b : R✝
m n : ℕ
inst✝¹ : Semiring R✝
p q : R✝[X]
R : Type u
inst✝ : Ring R
a : R[X]
⊢ (-a).toFinsupp = -a.toFinsupp
[PROOFSTEP]
cases a
[GOAL]
case ofFinsupp
R✝ : Type u
a b : R✝
m n : ℕ
inst✝¹ : Semiring R✝
p q : R✝[X]
R : Type u
inst✝ : Ring R
toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ (-{ toFinsupp := toFinsupp✝ }).toFinsupp = -{ toFinsupp := toFinsupp✝ }.toFinsupp
[PROOFSTEP]
rw [← ofFinsupp_neg]
[GOAL]
R✝ : Type u
a✝ b✝ : R✝
m n : ℕ
inst✝¹ : Semiring R✝
p q : R✝[X]
R : Type u
inst✝ : Ring R
a b : R[X]
⊢ (a - b).toFinsupp = a.toFinsupp - b.toFinsupp
[PROOFSTEP]
rw [sub_eq_add_neg, ← toFinsupp_neg, ← toFinsupp_add]
[GOAL]
R✝ : Type u
a✝ b✝ : R✝
m n : ℕ
inst✝¹ : Semiring R✝
p q : R✝[X]
R : Type u
inst✝ : Ring R
a b : R[X]
⊢ (a - b).toFinsupp = (a + -b).toFinsupp
[PROOFSTEP]
rfl
[GOAL]
R : Type u
a✝ b✝ : R
m n : ℕ
inst✝ : Semiring R
p q a b : R[X]
⊢ (a * b).toFinsupp = a.toFinsupp * b.toFinsupp
[PROOFSTEP]
cases a
[GOAL]
case ofFinsupp
R : Type u
a b✝ : R
m n : ℕ
inst✝ : Semiring R
p q b : R[X]
toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ ({ toFinsupp := toFinsupp✝ } * b).toFinsupp = { toFinsupp := toFinsupp✝ }.toFinsupp * b.toFinsupp
[PROOFSTEP]
cases b
[GOAL]
case ofFinsupp.ofFinsupp
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
toFinsupp✝¹ toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ ({ toFinsupp := toFinsupp✝¹ } * { toFinsupp := toFinsupp✝ }).toFinsupp =
    { toFinsupp := toFinsupp✝¹ }.toFinsupp * { toFinsupp := toFinsupp✝ }.toFinsupp
[PROOFSTEP]
rw [← ofFinsupp_mul]
[GOAL]
R : Type u
a✝ b : R
m n✝ : ℕ
inst✝ : Semiring R
p q a : R[X]
n : ℕ
⊢ (a ^ n).toFinsupp = a.toFinsupp ^ n
[PROOFSTEP]
cases a
[GOAL]
case ofFinsupp
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ ({ toFinsupp := toFinsupp✝ } ^ n).toFinsupp = { toFinsupp := toFinsupp✝ }.toFinsupp ^ n
[PROOFSTEP]
rw [← ofFinsupp_pow]
[GOAL]
R : Type u
a✝ b : R
m n : ℕ
inst✝ : Semiring R
p q a : R[X]
⊢ a.toFinsupp = 0 ↔ a = 0
[PROOFSTEP]
rw [← toFinsupp_zero, toFinsupp_inj]
[GOAL]
R : Type u
a✝ b : R
m n : ℕ
inst✝ : Semiring R
p q a : R[X]
⊢ a.toFinsupp = 1 ↔ a = 1
[PROOFSTEP]
rw [← toFinsupp_one, toFinsupp_inj]
[GOAL]
R : Type u
a✝ b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
a : AddMonoidAlgebra R ℕ
⊢ { toFinsupp := a } = 0 ↔ a = 0
[PROOFSTEP]
rw [← ofFinsupp_zero, ofFinsupp_inj]
[GOAL]
R : Type u
a✝ b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
a : AddMonoidAlgebra R ℕ
⊢ { toFinsupp := a } = 1 ↔ a = 1
[PROOFSTEP]
rw [← ofFinsupp_one, ofFinsupp_inj]
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝³ : Semiring R
p q : R[X]
S₁ : Type ?u.114071
S₂ : Type ?u.114238
inst✝² : SMulZeroClass S₁ R
inst✝¹ : SMulZeroClass S₂ R
inst✝ : SMulCommClass S₁ S₂ R
⊢ ∀ (m : S₁) (n : S₂) (a : R[X]), m • n • a = n • m • a
[PROOFSTEP]
rintro m n ⟨f⟩
[GOAL]
case ofFinsupp
R : Type u
a b : R
m✝ n✝ : ℕ
inst✝³ : Semiring R
p q : R[X]
S₁ : Type ?u.114071
S₂ : Type ?u.114238
inst✝² : SMulZeroClass S₁ R
inst✝¹ : SMulZeroClass S₂ R
inst✝ : SMulCommClass S₁ S₂ R
m : S₁
n : S₂
f : AddMonoidAlgebra R ℕ
⊢ m • n • { toFinsupp := f } = n • m • { toFinsupp := f }
[PROOFSTEP]
simp_rw [← ofFinsupp_smul, smul_comm m n f]
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝⁴ : Semiring R
p q : R[X]
S₁ : Type ?u.117123
S₂ : Type ?u.117122
inst✝³ : SMul S₁ S₂
inst✝² : SMulZeroClass S₁ R
inst✝¹ : SMulZeroClass S₂ R
inst✝ : IsScalarTower S₁ S₂ R
⊢ ∀ (x : S₁) (y : S₂) (z : R[X]), (x • y) • z = x • y • z
[PROOFSTEP]
rintro _ _ ⟨⟩
[GOAL]
case ofFinsupp
R : Type u
a b : R
m n : ℕ
inst✝⁴ : Semiring R
p q : R[X]
S₁ : Type ?u.117123
S₂ : Type ?u.117122
inst✝³ : SMul S₁ S₂
inst✝² : SMulZeroClass S₁ R
inst✝¹ : SMulZeroClass S₂ R
inst✝ : IsScalarTower S₁ S₂ R
x✝ : S₁
y✝ : S₂
toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ (x✝ • y✝) • { toFinsupp := toFinsupp✝ } = x✝ • y✝ • { toFinsupp := toFinsupp✝ }
[PROOFSTEP]
simp_rw [← ofFinsupp_smul, smul_assoc]
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝³ : Semiring R
p q : R[X]
α : Type u_1
K : Type u_2
inst✝² : Semiring K
inst✝¹ : DistribSMul α K
inst✝ : IsScalarTower α K K
⊢ ∀ (x : α) (y z : K[X]), (x • y) • z = x • y • z
[PROOFSTEP]
rintro _ ⟨⟩ ⟨⟩
[GOAL]
case ofFinsupp.ofFinsupp
R : Type u
a b : R
m n : ℕ
inst✝³ : Semiring R
p q : R[X]
α : Type u_1
K : Type u_2
inst✝² : Semiring K
inst✝¹ : DistribSMul α K
inst✝ : IsScalarTower α K K
x✝ : α
toFinsupp✝¹ toFinsupp✝ : AddMonoidAlgebra K ℕ
⊢ (x✝ • { toFinsupp := toFinsupp✝¹ }) • { toFinsupp := toFinsupp✝ } =
    x✝ • { toFinsupp := toFinsupp✝¹ } • { toFinsupp := toFinsupp✝ }
[PROOFSTEP]
simp_rw [smul_eq_mul, ← ofFinsupp_smul, ← ofFinsupp_mul, ← ofFinsupp_smul, smul_mul_assoc]
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝³ : Semiring R
p q : R[X]
S : Type ?u.129006
inst✝² : SMulZeroClass S R
inst✝¹ : SMulZeroClass Sᵐᵒᵖ R
inst✝ : IsCentralScalar S R
⊢ ∀ (m : S) (a : R[X]), MulOpposite.op m • a = m • a
[PROOFSTEP]
rintro _ ⟨⟩
[GOAL]
case ofFinsupp
R : Type u
a b : R
m n : ℕ
inst✝³ : Semiring R
p q : R[X]
S : Type ?u.129006
inst✝² : SMulZeroClass S R
inst✝¹ : SMulZeroClass Sᵐᵒᵖ R
inst✝ : IsCentralScalar S R
m✝ : S
toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ MulOpposite.op m✝ • { toFinsupp := toFinsupp✝ } = m✝ • { toFinsupp := toFinsupp✝ }
[PROOFSTEP]
simp_rw [← ofFinsupp_smul, op_smul_eq_smul]
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p q : R[X]
inst✝ : Subsingleton R
src✝ : Inhabited R[X] := inhabited
⊢ ∀ (a : R[X]), a = default
[PROOFSTEP]
rintro ⟨x⟩
[GOAL]
case ofFinsupp
R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p q : R[X]
inst✝ : Subsingleton R
src✝ : Inhabited R[X] := inhabited
x : AddMonoidAlgebra R ℕ
⊢ { toFinsupp := x } = default
[PROOFSTEP]
refine' congr_arg ofFinsupp _
[GOAL]
case ofFinsupp
R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p q : R[X]
inst✝ : Subsingleton R
src✝ : Inhabited R[X] := inhabited
x : AddMonoidAlgebra R ℕ
⊢ x = 0
[PROOFSTEP]
simp
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p✝ q : R[X]
p : AddMonoidAlgebra R ℕ
⊢ support { toFinsupp := p } = p.support
[PROOFSTEP]
rw [support]
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p✝ q p : R[X]
⊢ p.toFinsupp.support = support p
[PROOFSTEP]
rw [support]
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ support p = ∅ ↔ p = 0
[PROOFSTEP]
rcases p with ⟨⟩
[GOAL]
case ofFinsupp
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
q : R[X]
toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ support { toFinsupp := toFinsupp✝ } = ∅ ↔ { toFinsupp := toFinsupp✝ } = 0
[PROOFSTEP]
simp [support]
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ Finset.card (support p) = 0 ↔ p = 0
[PROOFSTEP]
simp
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
x y : R
⊢ (fun t => { toFinsupp := Finsupp.single n t }) (x + y) =
    (fun t => { toFinsupp := Finsupp.single n t }) x + (fun t => { toFinsupp := Finsupp.single n t }) y
[PROOFSTEP]
simp
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
x y : R
⊢ { toFinsupp := Finsupp.single n x + Finsupp.single n y } =
    { toFinsupp := Finsupp.single n x } + { toFinsupp := Finsupp.single n y }
[PROOFSTEP]
rw [ofFinsupp_add]
  -- Porting note: Was `simp [← ofFinsupp_smul]`.
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
r x : R
⊢ AddHom.toFun
      { toFun := fun t => { toFinsupp := Finsupp.single n t },
        map_add' :=
          (_ :
            ∀ (x y : R),
              (fun t => { toFinsupp := Finsupp.single n t }) (x + y) =
                (fun t => { toFinsupp := Finsupp.single n t }) x + (fun t => { toFinsupp := Finsupp.single n t }) y) }
      (r • x) =
    ↑(RingHom.id R) r •
      AddHom.toFun
        { toFun := fun t => { toFinsupp := Finsupp.single n t },
          map_add' :=
            (_ :
              ∀ (x y : R),
                (fun t => { toFinsupp := Finsupp.single n t }) (x + y) =
                  (fun t => { toFinsupp := Finsupp.single n t }) x + (fun t => { toFinsupp := Finsupp.single n t }) y) }
        x
[PROOFSTEP]
simp
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
r x : R
⊢ { toFinsupp := Finsupp.single n (r * x) } = r • { toFinsupp := Finsupp.single n x }
[PROOFSTEP]
rw [← ofFinsupp_smul, smul_single']
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
r : R
⊢ (↑(monomial n) r).toFinsupp = Finsupp.single n r
[PROOFSTEP]
simp [monomial]
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
r : R
⊢ { toFinsupp := Finsupp.single n r } = ↑(monomial n) r
[PROOFSTEP]
simp [monomial]
[GOAL]
R : Type u
a b : R
m✝ n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n m : ℕ
r s : R
⊢ (↑(monomial n) r * ↑(monomial m) s).toFinsupp = (↑(monomial (n + m)) (r * s)).toFinsupp
[PROOFSTEP]
simp only [toFinsupp_monomial, toFinsupp_mul, AddMonoidAlgebra.single_mul_single]
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
r : R
k : ℕ
⊢ ↑(monomial n) r ^ k = ↑(monomial (n * k)) (r ^ k)
[PROOFSTEP]
induction' k with k ih
[GOAL]
case zero
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
r : R
⊢ ↑(monomial n) r ^ Nat.zero = ↑(monomial (n * Nat.zero)) (r ^ Nat.zero)
[PROOFSTEP]
simp [pow_zero, monomial_zero_one]
[GOAL]
case succ
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
r : R
k : ℕ
ih : ↑(monomial n) r ^ k = ↑(monomial (n * k)) (r ^ k)
⊢ ↑(monomial n) r ^ Nat.succ k = ↑(monomial (n * Nat.succ k)) (r ^ Nat.succ k)
[PROOFSTEP]
simp [pow_succ, ih, monomial_mul_monomial, Nat.succ_eq_add_one, mul_add, add_comm]
[GOAL]
R : Type u
a✝ b✝ : R
m n✝ : ℕ
inst✝¹ : Semiring R
p q : R[X]
S : Type u_1
inst✝ : SMulZeroClass S R
a : S
n : ℕ
b : R
⊢ (a • ↑(monomial n) b).toFinsupp = (↑(monomial n) (a • b)).toFinsupp
[PROOFSTEP]
simp
[GOAL]
R : Type u
a✝ b✝ : R
m n✝ : ℕ
inst✝¹ : Semiring R
p q : R[X]
S : Type u_1
inst✝ : SMulZeroClass S R
a : S
n : ℕ
b : R
⊢ a • Finsupp.single n b = Finsupp.single n (a • b)
[PROOFSTEP]
rw [smul_single]
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ support (p + q) ⊆ support p ∪ support q
[PROOFSTEP]
rcases p with ⟨⟩
[GOAL]
case ofFinsupp
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
q : R[X]
toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ support ({ toFinsupp := toFinsupp✝ } + q) ⊆ support { toFinsupp := toFinsupp✝ } ∪ support q
[PROOFSTEP]
rcases q with ⟨⟩
[GOAL]
case ofFinsupp.ofFinsupp
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
toFinsupp✝¹ toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ support ({ toFinsupp := toFinsupp✝¹ } + { toFinsupp := toFinsupp✝ }) ⊆
    support { toFinsupp := toFinsupp✝¹ } ∪ support { toFinsupp := toFinsupp✝ }
[PROOFSTEP]
simp only [← ofFinsupp_add, support]
[GOAL]
case ofFinsupp.ofFinsupp
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
toFinsupp✝¹ toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ (toFinsupp✝¹ + toFinsupp✝).support ⊆ toFinsupp✝¹.support ∪ toFinsupp✝.support
[PROOFSTEP]
exact support_add
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
src✝ : R →ₗ[R] R[X] := monomial 0
⊢ AddHom.toFun src✝.toAddHom 1 = 1
[PROOFSTEP]
simp [monomial_zero_one]
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
src✝ : R →ₗ[R] R[X] := monomial 0
⊢ ∀ (x y : R),
    OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : 1 = 1) } (x * y) =
      OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : 1 = 1) } x *
        OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : 1 = 1) } y
[PROOFSTEP]
simp [monomial_mul_monomial]
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
src✝ : R →ₗ[R] R[X] := monomial 0
⊢ OneHom.toFun
      (↑{ toOneHom := { toFun := src✝.toFun, map_one' := (_ : 1 = 1) },
          map_mul' := (_ : ∀ (a a_1 : R), ↑(monomial 0) (a * a_1) = ↑(monomial 0) a * ↑(monomial 0) a_1) })
      0 =
    0
[PROOFSTEP]
simp
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ ↑C 0 = 0
[PROOFSTEP]
simp
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ ↑C (bit1 a) = bit1 (↑C a)
[PROOFSTEP]
simp [bit1, C_bit0]
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ ↑C a * ↑(monomial n) b = ↑(monomial n) (a * b)
[PROOFSTEP]
simp only [← monomial_zero_left, monomial_mul_monomial, zero_add]
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ ↑(monomial n) a * ↑C b = ↑(monomial n) (a * b)
[PROOFSTEP]
simp only [← monomial_zero_left, monomial_mul_monomial, add_zero]
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
⊢ ↑(monomial n) 1 = X ^ n
[PROOFSTEP]
induction' n with n ih
[GOAL]
case zero
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ ↑(monomial Nat.zero) 1 = X ^ Nat.zero
[PROOFSTEP]
simp [monomial_zero_one]
[GOAL]
case succ
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
ih : ↑(monomial n) 1 = X ^ n
⊢ ↑(monomial (Nat.succ n)) 1 = X ^ Nat.succ n
[PROOFSTEP]
rw [pow_succ, ← ih, ← monomial_one_one_eq_X, monomial_mul_monomial, add_comm, one_mul]
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ X * p = p * X
[PROOFSTEP]
rcases p with
  ⟨⟩
    -- Porting note: `ofFinsupp.injEq` is required.
[GOAL]
case ofFinsupp
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
q : R[X]
toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ X * { toFinsupp := toFinsupp✝ } = { toFinsupp := toFinsupp✝ } * X
[PROOFSTEP]
simp only [X, ← ofFinsupp_single, ← ofFinsupp_mul, LinearMap.coe_mk, ofFinsupp.injEq]
  -- Porting note: Was `ext`.
[GOAL]
case ofFinsupp
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
q : R[X]
toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ Finsupp.single 1 1 * toFinsupp✝ = toFinsupp✝ * Finsupp.single 1 1
[PROOFSTEP]
refine Finsupp.ext fun _ => ?_
[GOAL]
case ofFinsupp
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
q : R[X]
toFinsupp✝ : AddMonoidAlgebra R ℕ
x✝ : ℕ
⊢ ↑(Finsupp.single 1 1 * toFinsupp✝) x✝ = ↑(toFinsupp✝ * Finsupp.single 1 1) x✝
[PROOFSTEP]
simp [AddMonoidAlgebra.mul_apply, AddMonoidAlgebra.sum_single_index, add_comm]
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
⊢ X ^ n * p = p * X ^ n
[PROOFSTEP]
induction' n with n ih
[GOAL]
case zero
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ X ^ Nat.zero * p = p * X ^ Nat.zero
[PROOFSTEP]
simp
[GOAL]
case succ
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
ih : X ^ n * p = p * X ^ n
⊢ X ^ Nat.succ n * p = p * X ^ Nat.succ n
[PROOFSTEP]
conv_lhs => rw [pow_succ']
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
ih : X ^ n * p = p * X ^ n
| X ^ Nat.succ n * p
[PROOFSTEP]
rw [pow_succ']
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
ih : X ^ n * p = p * X ^ n
| X ^ Nat.succ n * p
[PROOFSTEP]
rw [pow_succ']
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
ih : X ^ n * p = p * X ^ n
| X ^ Nat.succ n * p
[PROOFSTEP]
rw [pow_succ']
[GOAL]
case succ
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
ih : X ^ n * p = p * X ^ n
⊢ X ^ n * X * p = p * X ^ Nat.succ n
[PROOFSTEP]
rw [mul_assoc, X_mul, ← mul_assoc, ih, mul_assoc, ← pow_succ']
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
⊢ p * X ^ n * q = p * q * X ^ n
[PROOFSTEP]
rw [mul_assoc, X_pow_mul, ← mul_assoc]
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
r : R
⊢ ↑(monomial n) r * X = ↑(monomial (n + 1)) r
[PROOFSTEP]
erw [monomial_mul_monomial, mul_one]
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
r : R
k : ℕ
⊢ ↑(monomial n) r * X ^ k = ↑(monomial (n + k)) r
[PROOFSTEP]
induction' k with k ih
[GOAL]
case zero
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
r : R
⊢ ↑(monomial n) r * X ^ Nat.zero = ↑(monomial (n + Nat.zero)) r
[PROOFSTEP]
simp
[GOAL]
case succ
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
r : R
k : ℕ
ih : ↑(monomial n) r * X ^ k = ↑(monomial (n + k)) r
⊢ ↑(monomial n) r * X ^ Nat.succ k = ↑(monomial (n + Nat.succ k)) r
[PROOFSTEP]
simp [ih, pow_succ', ← mul_assoc, add_assoc]
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
r : R
⊢ X * ↑(monomial n) r = ↑(monomial (n + 1)) r
[PROOFSTEP]
rw [X_mul, monomial_mul_X]
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
k n : ℕ
r : R
⊢ X ^ k * ↑(monomial n) r = ↑(monomial (n + k)) r
[PROOFSTEP]
rw [X_pow_mul, monomial_mul_X_pow]
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p✝ q : R[X]
p : AddMonoidAlgebra R ℕ
⊢ coeff { toFinsupp := p } = ↑p
[PROOFSTEP]
rw [coeff]
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ Injective coeff
[PROOFSTEP]
rintro ⟨p⟩
  ⟨q⟩
      -- Porting note: `ofFinsupp.injEq` is required.
[GOAL]
case ofFinsupp.ofFinsupp
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p✝ q✝ : R[X]
p q : AddMonoidAlgebra R ℕ
⊢ coeff { toFinsupp := p } = coeff { toFinsupp := q } → { toFinsupp := p } = { toFinsupp := q }
[PROOFSTEP]
simp only [coeff, FunLike.coe_fn_eq, imp_self, ofFinsupp.injEq]
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q f : R[X]
i : ℕ
⊢ ↑f.toFinsupp i = coeff f i
[PROOFSTEP]
cases f
[GOAL]
case ofFinsupp
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
i : ℕ
toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ ↑{ toFinsupp := toFinsupp✝ }.toFinsupp i = coeff { toFinsupp := toFinsupp✝ } i
[PROOFSTEP]
rfl
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ coeff (↑(monomial n) a) m = if n = m then a else 0
[PROOFSTEP]
rw [← ofFinsupp_single]
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ coeff { toFinsupp := Finsupp.single n a } m = if n = m then a else 0
[PROOFSTEP]
simp only [coeff, LinearMap.coe_mk]
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ ↑(Finsupp.single n a) m = if n = m then a else 0
[PROOFSTEP]
rw [Finsupp.single_apply]
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ coeff 1 0 = 1
[PROOFSTEP]
rw [← monomial_zero_one, coeff_monomial]
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ (if 0 = 0 then 1 else 0) = 1
[PROOFSTEP]
simp
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ coeff (↑(monomial (n + 1)) a) 0 = 0
[PROOFSTEP]
simp [coeff_monomial]
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
hn : n ≠ 1
⊢ coeff X n = 0
[PROOFSTEP]
rw [coeff_X, if_neg hn.symm]
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ n ∈ support p ↔ coeff p n ≠ 0
[PROOFSTEP]
rcases p with ⟨⟩
[GOAL]
case ofFinsupp
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
q : R[X]
toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ n ∈ support { toFinsupp := toFinsupp✝ } ↔ coeff { toFinsupp := toFinsupp✝ } n ≠ 0
[PROOFSTEP]
simp
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ ¬n ∈ support p ↔ coeff p n = 0
[PROOFSTEP]
simp
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ coeff (↑C a) n = if n = 0 then a else 0
[PROOFSTEP]
convert coeff_monomial (a := a) (m := n) (n := 0) using 2
[GOAL]
case h.e'_3.h₁.a
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ n = 0 ↔ 0 = n
[PROOFSTEP]
simp [eq_comm]
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
h : n ≠ 0
⊢ coeff (↑C a) n = 0
[PROOFSTEP]
rw [coeff_C, if_neg h]
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
r : R
n : ℕ
⊢ coeff (↑C r) (n + 1) = 0
[PROOFSTEP]
simp [coeff_C]
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ coeff (↑m) n = ↑(if n = 0 then m else 0)
[PROOFSTEP]
simp only [← C_eq_nat_cast, coeff_C, Nat.cast_ite, Nat.cast_zero]
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
⊢ ↑C a * X ^ (n + 1) = ↑(monomial (n + 1)) a
[PROOFSTEP]
rw [pow_succ', ← mul_assoc, C_mul_X_pow_eq_monomial, X, monomial_mul_monomial, mul_one]
[GOAL]
R : Type u
a✝ b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
a : R
n : ℕ
⊢ (↑C a * X ^ n).toFinsupp = Finsupp.single n a
[PROOFSTEP]
rw [C_mul_X_pow_eq_monomial, toFinsupp_monomial]
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ ↑C a * X = ↑(monomial 1) a
[PROOFSTEP]
rw [← C_mul_X_pow_eq_monomial, pow_one]
[GOAL]
R : Type u
a✝ b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
a : R
⊢ (↑C a * X).toFinsupp = Finsupp.single 1 a
[PROOFSTEP]
rw [C_mul_X_eq_monomial, toFinsupp_monomial]
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ Subsingleton R → Subsingleton R[X]
[PROOFSTEP]
intro
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
a✝ : Subsingleton R
⊢ Subsingleton R[X]
[PROOFSTEP]
infer_instance
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ (∀ (f g : R[X]), f = g) ↔ ∀ (a b : R), a = b
[PROOFSTEP]
simpa only [← subsingleton_iff] using subsingleton_iff_subsingleton
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p✝ q✝ p q : R[X]
⊢ p = q ↔ ∀ (n : ℕ), coeff p n = coeff q n
[PROOFSTEP]
rcases p with ⟨⟩
[GOAL]
case ofFinsupp
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q✝ q : R[X]
toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ { toFinsupp := toFinsupp✝ } = q ↔ ∀ (n : ℕ), coeff { toFinsupp := toFinsupp✝ } n = coeff q n
[PROOFSTEP]
rcases q with
  ⟨⟩
    -- Porting note: Was `simp [coeff, FunLike.ext_iff]`
[GOAL]
case ofFinsupp.ofFinsupp
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
toFinsupp✝¹ toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ { toFinsupp := toFinsupp✝¹ } = { toFinsupp := toFinsupp✝ } ↔
    ∀ (n : ℕ), coeff { toFinsupp := toFinsupp✝¹ } n = coeff { toFinsupp := toFinsupp✝ } n
[PROOFSTEP]
simp [coeff]
[GOAL]
case ofFinsupp.ofFinsupp
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
toFinsupp✝¹ toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ toFinsupp✝¹ = toFinsupp✝ ↔ ∀ (n : ℕ), ↑toFinsupp✝¹ n = ↑toFinsupp✝ n
[PROOFSTEP]
exact FunLike.ext_iff (F := ℕ →₀ R)
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ AddSubmonoid.closure {p | ∃ n a, p = ↑(monomial n) a} = ⊤
[PROOFSTEP]
apply top_unique
[GOAL]
case h
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ ⊤ ≤ AddSubmonoid.closure {p | ∃ n a, p = ↑(monomial n) a}
[PROOFSTEP]
rw [← AddSubmonoid.map_equiv_top (toFinsuppIso R).symm.toAddEquiv, ← Finsupp.add_closure_setOf_eq_single,
  AddMonoidHom.map_mclosure]
[GOAL]
case h
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ AddSubmonoid.closure
      (↑(AddEquiv.toAddMonoidHom (RingEquiv.toAddEquiv (RingEquiv.symm (toFinsuppIso R)))) ''
        {f | ∃ a b, f = Finsupp.single a b}) ≤
    AddSubmonoid.closure {p | ∃ n a, p = ↑(monomial n) a}
[PROOFSTEP]
refine' AddSubmonoid.closure_mono (Set.image_subset_iff.2 _)
[GOAL]
case h
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ {f | ∃ a b, f = Finsupp.single a b} ⊆
    ↑(AddEquiv.toAddMonoidHom (RingEquiv.toAddEquiv (RingEquiv.symm (toFinsuppIso R)))) ⁻¹'
      {p | ∃ n a, p = ↑(monomial n) a}
[PROOFSTEP]
rintro _ ⟨n, a, rfl⟩
[GOAL]
case h.intro.intro
R : Type u
a✝ b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
a : R
⊢ Finsupp.single n a ∈
    ↑(AddEquiv.toAddMonoidHom (RingEquiv.toAddEquiv (RingEquiv.symm (toFinsuppIso R)))) ⁻¹'
      {p | ∃ n a, p = ↑(monomial n) a}
[PROOFSTEP]
exact ⟨n, a, Polynomial.ofFinsupp_single _ _⟩
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p q : R[X]
M : Type u_1
inst✝ : AddMonoid M
f g : R[X] →+ M
h : ∀ (n : ℕ) (a : R), ↑f (↑(monomial n) a) = ↑g (↑(monomial n) a)
⊢ Set.EqOn ↑f ↑g {p | ∃ n a, p = ↑(monomial n) a}
[PROOFSTEP]
rintro p ⟨n, a, rfl⟩
[GOAL]
case intro.intro
R : Type u
a✝ b : R
m n✝ : ℕ
inst✝¹ : Semiring R
p q : R[X]
M : Type u_1
inst✝ : AddMonoid M
f g : R[X] →+ M
h : ∀ (n : ℕ) (a : R), ↑f (↑(monomial n) a) = ↑g (↑(monomial n) a)
n : ℕ
a : R
⊢ ↑f (↑(monomial n) a) = ↑g (↑(monomial n) a)
[PROOFSTEP]
exact h n a
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p✝ q : R[X]
h : 0 = 1
p : R[X]
⊢ p = 0
[PROOFSTEP]
rw [← one_smul R p, ← h, zero_smul]
[GOAL]
R : Type u
a✝ b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
a : R
H : a ≠ 0
⊢ support (↑(monomial n) a) = {n}
[PROOFSTEP]
rw [← ofFinsupp_single, support]
[GOAL]
R : Type u
a✝ b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
a : R
H : a ≠ 0
⊢ (match { toFinsupp := Finsupp.single n a } with
    | { toFinsupp := p } => p.support) =
    {n}
[PROOFSTEP]
exact Finsupp.support_single_ne_zero _ H
[GOAL]
R : Type u
a✝ b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
a : R
⊢ support (↑(monomial n) a) ⊆ {n}
[PROOFSTEP]
rw [← ofFinsupp_single, support]
[GOAL]
R : Type u
a✝ b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
a : R
⊢ (match { toFinsupp := Finsupp.single n a } with
    | { toFinsupp := p } => p.support) ⊆
    {n}
[PROOFSTEP]
exact Finsupp.support_single_subset
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
c : R
h : c ≠ 0
⊢ support (↑C c * X) = {1}
[PROOFSTEP]
rw [C_mul_X_eq_monomial, support_monomial 1 h]
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
c : R
⊢ support (↑C c * X) ⊆ {1}
[PROOFSTEP]
simpa only [C_mul_X_eq_monomial] using support_monomial' 1 c
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
c : R
h : c ≠ 0
⊢ support (↑C c * X ^ n) = {n}
[PROOFSTEP]
rw [C_mul_X_pow_eq_monomial, support_monomial n h]
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
c : R
⊢ support (↑C c * X ^ n) ⊆ {n}
[PROOFSTEP]
simpa only [C_mul_X_pow_eq_monomial] using support_monomial' n c
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
⊢ X ^ n = ↑(monomial n) 1
[PROOFSTEP]
induction' n with n hn
[GOAL]
case zero
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ X ^ Nat.zero = ↑(monomial Nat.zero) 1
[PROOFSTEP]
rw [pow_zero, monomial_zero_one]
[GOAL]
case succ
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
hn : X ^ n = ↑(monomial n) 1
⊢ X ^ Nat.succ n = ↑(monomial (Nat.succ n)) 1
[PROOFSTEP]
rw [pow_succ', hn, X, monomial_mul_monomial, one_mul]
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
⊢ (X ^ n).toFinsupp = Finsupp.single n 1
[PROOFSTEP]
rw [X_pow_eq_monomial, toFinsupp_monomial]
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
⊢ a • X ^ n = ↑(monomial n) a
[PROOFSTEP]
rw [X_pow_eq_monomial, smul_monomial, smul_eq_mul, mul_one]
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
H : ¬1 = 0
n : ℕ
⊢ support (X ^ n) = {n}
[PROOFSTEP]
convert support_monomial n H
[GOAL]
case h.e'_2.h.e'_3
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
H : ¬1 = 0
n : ℕ
⊢ X ^ n = ↑(monomial n) 1
[PROOFSTEP]
exact X_pow_eq_monomial n
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
H : 1 = 0
⊢ support X = ∅
[PROOFSTEP]
rw [X, H, monomial_zero_right, support_zero]
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
H : ¬1 = 0
⊢ support X = {1}
[PROOFSTEP]
rw [← pow_one X, support_X_pow H 1]
[GOAL]
R : Type u
a✝ b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
a : R
ha : a ≠ 0
i j : ℕ
⊢ ↑(monomial i) a = ↑(monomial j) a ↔ i = j
[PROOFSTEP]
rw [← ofFinsupp_single, ← ofFinsupp_single, ofFinsupp.injEq, Finsupp.single_left_inj ha]
[GOAL]
R : Type u
a b : R
m✝ n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
k l m n : ℕ
u v : R
hu : u ≠ 0
hv : v ≠ 0
⊢ ↑C u * X ^ k + ↑C v * X ^ l = ↑C u * X ^ m + ↑C v * X ^ n ↔
    k = m ∧ l = n ∨ u = v ∧ k = n ∧ l = m ∨ u + v = 0 ∧ k = l ∧ m = n
[PROOFSTEP]
simp_rw [C_mul_X_pow_eq_monomial, ← toFinsupp_inj, toFinsupp_add, toFinsupp_monomial]
[GOAL]
R : Type u
a b : R
m✝ n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
k l m n : ℕ
u v : R
hu : u ≠ 0
hv : v ≠ 0
⊢ Finsupp.single k u + Finsupp.single l v = Finsupp.single m u + Finsupp.single n v ↔
    k = m ∧ l = n ∨ u = v ∧ k = n ∧ l = m ∨ u + v = 0 ∧ k = l ∧ m = n
[PROOFSTEP]
exact Finsupp.single_add_single_eq_single_add_single hu hv
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ p * q = ∑ i in support p, sum q fun j a => ↑(monomial (i + j)) (coeff p i * a)
[PROOFSTEP]
apply toFinsupp_injective
[GOAL]
case a
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ (p * q).toFinsupp = (∑ i in support p, sum q fun j a => ↑(monomial (i + j)) (coeff p i * a)).toFinsupp
[PROOFSTEP]
rcases p with ⟨⟩
[GOAL]
case a.ofFinsupp
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
q : R[X]
toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ ({ toFinsupp := toFinsupp✝ } * q).toFinsupp =
    (∑ i in support { toFinsupp := toFinsupp✝ },
        sum q fun j a => ↑(monomial (i + j)) (coeff { toFinsupp := toFinsupp✝ } i * a)).toFinsupp
[PROOFSTEP]
rcases q with ⟨⟩
[GOAL]
case a.ofFinsupp.ofFinsupp
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
toFinsupp✝¹ toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ ({ toFinsupp := toFinsupp✝¹ } * { toFinsupp := toFinsupp✝ }).toFinsupp =
    (∑ i in support { toFinsupp := toFinsupp✝¹ },
        sum { toFinsupp := toFinsupp✝ } fun j a =>
          ↑(monomial (i + j)) (coeff { toFinsupp := toFinsupp✝¹ } i * a)).toFinsupp
[PROOFSTEP]
simp [support, sum, coeff, toFinsupp_sum]
[GOAL]
case a.ofFinsupp.ofFinsupp
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
toFinsupp✝¹ toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ toFinsupp✝¹ * toFinsupp✝ =
    ∑ x in toFinsupp✝¹.support, ∑ x_1 in toFinsupp✝.support, Finsupp.single (x + x_1) (↑toFinsupp✝¹ x * ↑toFinsupp✝ x_1)
[PROOFSTEP]
rfl
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p q : R[X]
S : Type u_1
inst✝ : AddCommMonoid S
f : ℕ → R → S
⊢ sum 0 f = 0
[PROOFSTEP]
simp [sum]
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p✝ q✝ : R[X]
S : Type u_1
inst✝ : AddCommMonoid S
p q : R[X]
f : ℕ → R → S
hf : ∀ (i : ℕ), f i 0 = 0
h_add : ∀ (a : ℕ) (b₁ b₂ : R), f a (b₁ + b₂) = f a b₁ + f a b₂
⊢ sum (p + q) f = sum p f + sum q f
[PROOFSTEP]
rw [show p + q = ⟨p.toFinsupp + q.toFinsupp⟩ from add_def p q]
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p✝ q✝ : R[X]
S : Type u_1
inst✝ : AddCommMonoid S
p q : R[X]
f : ℕ → R → S
hf : ∀ (i : ℕ), f i 0 = 0
h_add : ∀ (a : ℕ) (b₁ b₂ : R), f a (b₁ + b₂) = f a b₁ + f a b₂
⊢ sum { toFinsupp := p.toFinsupp + q.toFinsupp } f = sum p f + sum q f
[PROOFSTEP]
exact Finsupp.sum_add_index (fun i _ ↦ hf i) (fun a _ b₁ b₂ ↦ h_add a b₁ b₂)
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
p✝ q : R[X]
S : Type u_1
inst✝ : AddCommMonoid S
p : R[X]
f g : ℕ → R → S
⊢ sum p (f + g) = sum p f + sum p g
[PROOFSTEP]
simp [sum_def, Finset.sum_add_distrib]
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p✝ q p : R[X]
⊢ (sum p fun n a => ↑C a * X ^ n) = p
[PROOFSTEP]
simp_rw [C_mul_X_pow_eq_monomial, sum_monomial_eq]
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p✝ q p : R[X]
n : ℕ
⊢ (erase n p).toFinsupp = Finsupp.erase n p.toFinsupp
[PROOFSTEP]
rcases p with ⟨⟩
[GOAL]
case ofFinsupp
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ (erase n { toFinsupp := toFinsupp✝ }).toFinsupp = Finsupp.erase n { toFinsupp := toFinsupp✝ }.toFinsupp
[PROOFSTEP]
simp only [erase_def]
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p✝ q : R[X]
p : AddMonoidAlgebra R ℕ
n : ℕ
⊢ { toFinsupp := Finsupp.erase n p } = erase n { toFinsupp := p }
[PROOFSTEP]
rcases p with ⟨⟩
[GOAL]
case mk
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
support✝ : Finset ℕ
toFun✝ : ℕ → R
mem_support_toFun✝ : ∀ (a : ℕ), a ∈ support✝ ↔ toFun✝ a ≠ 0
⊢ { toFinsupp := Finsupp.erase n { support := support✝, toFun := toFun✝, mem_support_toFun := mem_support_toFun✝ } } =
    erase n { toFinsupp := { support := support✝, toFun := toFun✝, mem_support_toFun := mem_support_toFun✝ } }
[PROOFSTEP]
simp only [erase_def]
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p✝ q p : R[X]
n : ℕ
⊢ support (erase n p) = Finset.erase (support p) n
[PROOFSTEP]
rcases p with ⟨⟩
[GOAL]
case ofFinsupp
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ support (erase n { toFinsupp := toFinsupp✝ }) = Finset.erase (support { toFinsupp := toFinsupp✝ }) n
[PROOFSTEP]
simp only [support, erase_def, Finsupp.support_erase]
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p✝ q p : R[X]
n : ℕ
⊢ (↑(monomial n) (coeff p n) + erase n p).toFinsupp = p.toFinsupp
[PROOFSTEP]
rcases p with ⟨⟩
[GOAL]
case ofFinsupp
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ (↑(monomial n) (coeff { toFinsupp := toFinsupp✝ } n) + erase n { toFinsupp := toFinsupp✝ }).toFinsupp =
    { toFinsupp := toFinsupp✝ }.toFinsupp
[PROOFSTEP]
rw [toFinsupp_add, toFinsupp_monomial, toFinsupp_erase, coeff]
[GOAL]
case ofFinsupp
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ Finsupp.single n
        ((match (motive := R[X] → ℕ → R) { toFinsupp := toFinsupp✝ } with
          | { toFinsupp := p } => ↑p)
          n) +
      Finsupp.erase n { toFinsupp := toFinsupp✝ }.toFinsupp =
    { toFinsupp := toFinsupp✝ }.toFinsupp
[PROOFSTEP]
exact Finsupp.single_add_erase _ _
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p✝ q p : R[X]
n i : ℕ
⊢ coeff (erase n p) i = if i = n then 0 else coeff p i
[PROOFSTEP]
rcases p with ⟨⟩
[GOAL]
case ofFinsupp
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n i : ℕ
toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ coeff (erase n { toFinsupp := toFinsupp✝ }) i = if i = n then 0 else coeff { toFinsupp := toFinsupp✝ } i
[PROOFSTEP]
simp only [erase_def, coeff]
  -- Porting note: Was `convert rfl`.
[GOAL]
case ofFinsupp
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n i : ℕ
toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ ↑(Finsupp.erase n toFinsupp✝) i = if i = n then 0 else ↑toFinsupp✝ i
[PROOFSTEP]
exact ite_congr rfl (fun _ => rfl) (fun _ => rfl)
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
⊢ (erase n 0).toFinsupp = 0.toFinsupp
[PROOFSTEP]
simp
[GOAL]
R : Type u
a✝ b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
a : R
⊢ (erase n (↑(monomial n) a)).toFinsupp = 0.toFinsupp
[PROOFSTEP]
simp
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p✝ q p : R[X]
n : ℕ
⊢ coeff (erase n p) n = 0
[PROOFSTEP]
simp [coeff_erase]
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p✝ q p : R[X]
n i : ℕ
h : i ≠ n
⊢ coeff (erase n p) i = coeff p i
[PROOFSTEP]
simp [coeff_erase, h]
[GOAL]
R : Type u
a✝ b : R
m n✝ : ℕ
inst✝ : Semiring R
p✝ q p : R[X]
n : ℕ
a : R
⊢ coeff (update p n a) = Function.update (coeff p) n a
[PROOFSTEP]
ext
[GOAL]
case h
R : Type u
a✝ b : R
m n✝ : ℕ
inst✝ : Semiring R
p✝ q p : R[X]
n : ℕ
a : R
x✝ : ℕ
⊢ coeff (update p n a) x✝ = Function.update (coeff p) n a x✝
[PROOFSTEP]
cases p
[GOAL]
case h.ofFinsupp
R : Type u
a✝ b : R
m n✝ : ℕ
inst✝ : Semiring R
p q : R[X]
n : ℕ
a : R
x✝ : ℕ
toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ coeff (update { toFinsupp := toFinsupp✝ } n a) x✝ = Function.update (coeff { toFinsupp := toFinsupp✝ }) n a x✝
[PROOFSTEP]
simp only [coeff, update, Function.update_apply, coe_update]
[GOAL]
R : Type u
a✝ b : R
m n✝ : ℕ
inst✝ : Semiring R
p✝ q p : R[X]
n : ℕ
a : R
i : ℕ
⊢ coeff (update p n a) i = if i = n then a else coeff p i
[PROOFSTEP]
rw [coeff_update, Function.update_apply]
[GOAL]
R : Type u
a✝ b : R
m n✝ : ℕ
inst✝ : Semiring R
p✝ q p : R[X]
n : ℕ
a : R
⊢ coeff (update p n a) n = a
[PROOFSTEP]
rw [p.coeff_update_apply, if_pos rfl]
[GOAL]
R : Type u
a✝ b : R
m n✝ : ℕ
inst✝ : Semiring R
p✝ q p : R[X]
n : ℕ
a : R
i : ℕ
h : i ≠ n
⊢ coeff (update p n a) i = coeff p i
[PROOFSTEP]
rw [p.coeff_update_apply, if_neg h]
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p✝ q p : R[X]
n : ℕ
⊢ update p n 0 = erase n p
[PROOFSTEP]
ext
[GOAL]
case a
R : Type u
a b : R
m n✝¹ : ℕ
inst✝ : Semiring R
p✝ q p : R[X]
n n✝ : ℕ
⊢ coeff (update p n 0) n✝ = coeff (erase n p) n✝
[PROOFSTEP]
rw [coeff_update_apply, coeff_erase]
[GOAL]
R : Type u
a✝ b : R
m n✝ : ℕ
inst✝¹ : Semiring R
p✝ q p : R[X]
n : ℕ
a : R
inst✝ : Decidable (a = 0)
⊢ support (update p n a) = if a = 0 then Finset.erase (support p) n else insert n (support p)
[PROOFSTEP]
classical
cases p
simp only [support, update, Finsupp.support_update]
congr
[GOAL]
R : Type u
a✝ b : R
m n✝ : ℕ
inst✝¹ : Semiring R
p✝ q p : R[X]
n : ℕ
a : R
inst✝ : Decidable (a = 0)
⊢ support (update p n a) = if a = 0 then Finset.erase (support p) n else insert n (support p)
[PROOFSTEP]
cases p
[GOAL]
case ofFinsupp
R : Type u
a✝ b : R
m n✝ : ℕ
inst✝¹ : Semiring R
p q : R[X]
n : ℕ
a : R
inst✝ : Decidable (a = 0)
toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ support (update { toFinsupp := toFinsupp✝ } n a) =
    if a = 0 then Finset.erase (support { toFinsupp := toFinsupp✝ }) n
    else insert n (support { toFinsupp := toFinsupp✝ })
[PROOFSTEP]
simp only [support, update, Finsupp.support_update]
[GOAL]
case ofFinsupp
R : Type u
a✝ b : R
m n✝ : ℕ
inst✝¹ : Semiring R
p q : R[X]
n : ℕ
a : R
inst✝ : Decidable (a = 0)
toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ (if a = 0 then Finset.erase toFinsupp✝.support n else insert n toFinsupp✝.support) =
    if a = 0 then Finset.erase toFinsupp✝.support n else insert n toFinsupp✝.support
[PROOFSTEP]
congr
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p✝ q p : R[X]
n : ℕ
⊢ support (update p n 0) = Finset.erase (support p) n
[PROOFSTEP]
rw [update_zero_eq_erase, support_erase]
[GOAL]
R : Type u
a✝ b : R
m n✝ : ℕ
inst✝ : Semiring R
p✝ q p : R[X]
n : ℕ
a : R
ha : a ≠ 0
⊢ support (update p n a) = insert n (support p)
[PROOFSTEP]
classical rw [support_update, if_neg ha]
[GOAL]
R : Type u
a✝ b : R
m n✝ : ℕ
inst✝ : Semiring R
p✝ q p : R[X]
n : ℕ
a : R
ha : a ≠ 0
⊢ support (update p n a) = insert n (support p)
[PROOFSTEP]
rw [support_update, if_neg ha]
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Ring R
p : R[X]
n : ℕ
⊢ coeff (-p) n = -coeff p n
[PROOFSTEP]
rcases p with
  ⟨⟩
    -- Porting note: The last rule should be `apply`ed.
[GOAL]
case ofFinsupp
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Ring R
n : ℕ
toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ coeff (-{ toFinsupp := toFinsupp✝ }) n = -coeff { toFinsupp := toFinsupp✝ } n
[PROOFSTEP]
rw [← ofFinsupp_neg, coeff, coeff]
[GOAL]
case ofFinsupp
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Ring R
n : ℕ
toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ (match (motive := R[X] → ℕ → R) { toFinsupp := -toFinsupp✝ } with
      | { toFinsupp := p } => ↑p)
      n =
    -(match (motive := R[X] → ℕ → R) { toFinsupp := toFinsupp✝ } with
        | { toFinsupp := p } => ↑p)
        n
[PROOFSTEP]
apply Finsupp.neg_apply
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Ring R
p q : R[X]
n : ℕ
⊢ coeff (p - q) n = coeff p n - coeff q n
[PROOFSTEP]
rcases p with ⟨⟩
[GOAL]
case ofFinsupp
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Ring R
q : R[X]
n : ℕ
toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ coeff ({ toFinsupp := toFinsupp✝ } - q) n = coeff { toFinsupp := toFinsupp✝ } n - coeff q n
[PROOFSTEP]
rcases q with
  ⟨⟩
    -- Porting note: The last rule should be `apply`ed.
[GOAL]
case ofFinsupp.ofFinsupp
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Ring R
n : ℕ
toFinsupp✝¹ toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ coeff ({ toFinsupp := toFinsupp✝¹ } - { toFinsupp := toFinsupp✝ }) n =
    coeff { toFinsupp := toFinsupp✝¹ } n - coeff { toFinsupp := toFinsupp✝ } n
[PROOFSTEP]
rw [← ofFinsupp_sub, coeff, coeff, coeff]
[GOAL]
case ofFinsupp.ofFinsupp
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Ring R
n : ℕ
toFinsupp✝¹ toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ (match (motive := R[X] → ℕ → R) { toFinsupp := toFinsupp✝¹ - toFinsupp✝ } with
      | { toFinsupp := p } => ↑p)
      n =
    (match (motive := R[X] → ℕ → R) { toFinsupp := toFinsupp✝¹ } with
        | { toFinsupp := p } => ↑p)
        n -
      (match (motive := R[X] → ℕ → R) { toFinsupp := toFinsupp✝ } with
        | { toFinsupp := p } => ↑p)
        n
[PROOFSTEP]
apply Finsupp.sub_apply
[GOAL]
R : Type u
a✝ b : R
m n✝ : ℕ
inst✝ : Ring R
n : ℕ
a : R
⊢ ↑(monomial n) (-a) = -↑(monomial n) a
[PROOFSTEP]
rw [eq_neg_iff_add_eq_zero, ← monomial_add, neg_add_self, monomial_zero_right]
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝ : Ring R
p : R[X]
⊢ support (-p) = support p
[PROOFSTEP]
rcases p with
  ⟨⟩
    -- Porting note: The last rule should be `apply`ed.
[GOAL]
case ofFinsupp
R : Type u
a b : R
m n : ℕ
inst✝ : Ring R
toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ support (-{ toFinsupp := toFinsupp✝ }) = support { toFinsupp := toFinsupp✝ }
[PROOFSTEP]
rw [← ofFinsupp_neg, support, support]
[GOAL]
case ofFinsupp
R : Type u
a b : R
m n : ℕ
inst✝ : Ring R
toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ (match { toFinsupp := -toFinsupp✝ } with
    | { toFinsupp := p } => p.support) =
    match { toFinsupp := toFinsupp✝ } with
    | { toFinsupp := p } => p.support
[PROOFSTEP]
apply Finsupp.support_neg
[GOAL]
R : Type u
a b : R
m n✝ : ℕ
inst✝ : Ring R
n : ℤ
⊢ ↑C ↑n = ↑n
[PROOFSTEP]
simp
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
inst✝ : Nontrivial R
⊢ Nontrivial R[X]
[PROOFSTEP]
have h : Nontrivial (AddMonoidAlgebra R ℕ) := by infer_instance
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
inst✝ : Nontrivial R
⊢ Nontrivial (AddMonoidAlgebra R ℕ)
[PROOFSTEP]
infer_instance
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
inst✝ : Nontrivial R
h : Nontrivial (AddMonoidAlgebra R ℕ)
⊢ Nontrivial R[X]
[PROOFSTEP]
rcases h.exists_pair_ne with ⟨x, y, hxy⟩
[GOAL]
case intro.intro
R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
inst✝ : Nontrivial R
h : Nontrivial (AddMonoidAlgebra R ℕ)
x y : AddMonoidAlgebra R ℕ
hxy : x ≠ y
⊢ Nontrivial R[X]
[PROOFSTEP]
refine' ⟨⟨⟨x⟩, ⟨y⟩, _⟩⟩
[GOAL]
case intro.intro
R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
inst✝ : Nontrivial R
h : Nontrivial (AddMonoidAlgebra R ℕ)
x y : AddMonoidAlgebra R ℕ
hxy : x ≠ y
⊢ { toFinsupp := x } ≠ { toFinsupp := y }
[PROOFSTEP]
simp [hxy]
[GOAL]
R : Type u
a b : R
m n : ℕ
inst✝¹ : Semiring R
inst✝ : Nontrivial R
⊢ ¬coeff X 1 = coeff 0 1
[PROOFSTEP]
simp
[GOAL]
R : Type u
a✝ b : R
m n : ℕ
inst✝ : DivisionRing R
a : ℚ
f : R[X]
⊢ a • f = ↑C ↑a * f
[PROOFSTEP]
rw [← Rat.smul_one_eq_coe, ← Polynomial.smul_C, C_1, smul_one_mul]


[GOAL]
M : Type u_1
inst✝ : Monoid M
⊢ SMulCommClass { x // x ∈ center M } { x // x ∈ center M } M
[PROOFSTEP]
infer_instance


[GOAL]
R : Type u_1
inst✝¹ : EuclideanDomain R
abv : AbsoluteValue R ℤ
ι : Type u_2
inst✝ : Fintype ι
ε : ℝ
hε : 0 < ε
b : R
hb : b ≠ 0
A : ι → R
h : IsAdmissible abv
⊢ ∃ t, ∀ (i₀ i₁ : ι), t i₀ = t i₁ → ↑(↑abv (A i₁ % b - A i₀ % b)) < ↑abv b • ε
[PROOFSTEP]
let e := Fintype.equivFin ι
[GOAL]
R : Type u_1
inst✝¹ : EuclideanDomain R
abv : AbsoluteValue R ℤ
ι : Type u_2
inst✝ : Fintype ι
ε : ℝ
hε : 0 < ε
b : R
hb : b ≠ 0
A : ι → R
h : IsAdmissible abv
e : ι ≃ Fin (Fintype.card ι) := Fintype.equivFin ι
⊢ ∃ t, ∀ (i₀ i₁ : ι), t i₀ = t i₁ → ↑(↑abv (A i₁ % b - A i₀ % b)) < ↑abv b • ε
[PROOFSTEP]
obtain ⟨t, ht⟩ := h.exists_partition' (Fintype.card ι) hε hb (A ∘ e.symm)
[GOAL]
case intro
R : Type u_1
inst✝¹ : EuclideanDomain R
abv : AbsoluteValue R ℤ
ι : Type u_2
inst✝ : Fintype ι
ε : ℝ
hε : 0 < ε
b : R
hb : b ≠ 0
A : ι → R
h : IsAdmissible abv
e : ι ≃ Fin (Fintype.card ι) := Fintype.equivFin ι
t : Fin (Fintype.card ι) → Fin (IsAdmissible.card h ε)
ht : ∀ (i₀ i₁ : Fin (Fintype.card ι)), t i₀ = t i₁ → ↑(↑abv ((A ∘ ↑e.symm) i₁ % b - (A ∘ ↑e.symm) i₀ % b)) < ↑abv b • ε
⊢ ∃ t, ∀ (i₀ i₁ : ι), t i₀ = t i₁ → ↑(↑abv (A i₁ % b - A i₀ % b)) < ↑abv b • ε
[PROOFSTEP]
refine' ⟨t ∘ e, fun i₀ i₁ h ↦ _⟩
[GOAL]
case intro
R : Type u_1
inst✝¹ : EuclideanDomain R
abv : AbsoluteValue R ℤ
ι : Type u_2
inst✝ : Fintype ι
ε : ℝ
hε : 0 < ε
b : R
hb : b ≠ 0
A : ι → R
h✝ : IsAdmissible abv
e : ι ≃ Fin (Fintype.card ι) := Fintype.equivFin ι
t : Fin (Fintype.card ι) → Fin (IsAdmissible.card h✝ ε)
ht : ∀ (i₀ i₁ : Fin (Fintype.card ι)), t i₀ = t i₁ → ↑(↑abv ((A ∘ ↑e.symm) i₁ % b - (A ∘ ↑e.symm) i₀ % b)) < ↑abv b • ε
i₀ i₁ : ι
h : (t ∘ ↑e) i₀ = (t ∘ ↑e) i₁
⊢ ↑(↑abv (A i₁ % b - A i₀ % b)) < ↑abv b • ε
[PROOFSTEP]
convert (config := { transparency := .default }) ht (e i₀) (e i₁) h
[GOAL]
case h.e'_3.h.e'_3.h.e'_6.h.e'_5.h.e'_5.h.e'_1
R : Type u_1
inst✝¹ : EuclideanDomain R
abv : AbsoluteValue R ℤ
ι : Type u_2
inst✝ : Fintype ι
ε : ℝ
hε : 0 < ε
b : R
hb : b ≠ 0
A : ι → R
h✝ : IsAdmissible abv
e : ι ≃ Fin (Fintype.card ι) := Fintype.equivFin ι
t : Fin (Fintype.card ι) → Fin (IsAdmissible.card h✝ ε)
ht : ∀ (i₀ i₁ : Fin (Fintype.card ι)), t i₀ = t i₁ → ↑(↑abv ((A ∘ ↑e.symm) i₁ % b - (A ∘ ↑e.symm) i₀ % b)) < ↑abv b • ε
i₀ i₁ : ι
h : (t ∘ ↑e) i₀ = (t ∘ ↑e) i₁
⊢ i₁ = ↑e.symm (↑e i₁)
[PROOFSTEP]
simp only [e.symm_apply_apply]
[GOAL]
case h.e'_3.h.e'_3.h.e'_6.h.e'_6.h.e'_5.h.e'_1
R : Type u_1
inst✝¹ : EuclideanDomain R
abv : AbsoluteValue R ℤ
ι : Type u_2
inst✝ : Fintype ι
ε : ℝ
hε : 0 < ε
b : R
hb : b ≠ 0
A : ι → R
h✝ : IsAdmissible abv
e : ι ≃ Fin (Fintype.card ι) := Fintype.equivFin ι
t : Fin (Fintype.card ι) → Fin (IsAdmissible.card h✝ ε)
ht : ∀ (i₀ i₁ : Fin (Fintype.card ι)), t i₀ = t i₁ → ↑(↑abv ((A ∘ ↑e.symm) i₁ % b - (A ∘ ↑e.symm) i₀ % b)) < ↑abv b • ε
i₀ i₁ : ι
h : (t ∘ ↑e) i₀ = (t ∘ ↑e) i₁
⊢ i₀ = ↑e.symm (↑e i₀)
[PROOFSTEP]
simp only [e.symm_apply_apply]
[GOAL]
R : Type u_1
inst✝ : EuclideanDomain R
abv : AbsoluteValue R ℤ
n : ℕ
h : IsAdmissible abv
⊢ ∀ {ε : ℝ},
    0 < ε →
      ∀ {b : R},
        b ≠ 0 →
          ∀ (A : Fin (Nat.succ (IsAdmissible.card h ε ^ n)) → Fin n → R),
            ∃ i₀ i₁, i₀ ≠ i₁ ∧ ∀ (k : Fin n), ↑(↑abv (A i₁ k % b - A i₀ k % b)) < ↑abv b • ε
[PROOFSTEP]
haveI := Classical.decEq R
[GOAL]
R : Type u_1
inst✝ : EuclideanDomain R
abv : AbsoluteValue R ℤ
n : ℕ
h : IsAdmissible abv
this : DecidableEq R
⊢ ∀ {ε : ℝ},
    0 < ε →
      ∀ {b : R},
        b ≠ 0 →
          ∀ (A : Fin (Nat.succ (IsAdmissible.card h ε ^ n)) → Fin n → R),
            ∃ i₀ i₁, i₀ ≠ i₁ ∧ ∀ (k : Fin n), ↑(↑abv (A i₁ k % b - A i₀ k % b)) < ↑abv b • ε
[PROOFSTEP]
induction' n with n ih
[GOAL]
case zero
R : Type u_1
inst✝ : EuclideanDomain R
abv : AbsoluteValue R ℤ
h : IsAdmissible abv
this : DecidableEq R
⊢ ∀ {ε : ℝ},
    0 < ε →
      ∀ {b : R},
        b ≠ 0 →
          ∀ (A : Fin (Nat.succ (IsAdmissible.card h ε ^ Nat.zero)) → Fin Nat.zero → R),
            ∃ i₀ i₁, i₀ ≠ i₁ ∧ ∀ (k : Fin Nat.zero), ↑(↑abv (A i₁ k % b - A i₀ k % b)) < ↑abv b • ε
[PROOFSTEP]
intro ε _hε b _hb A
[GOAL]
case zero
R : Type u_1
inst✝ : EuclideanDomain R
abv : AbsoluteValue R ℤ
h : IsAdmissible abv
this : DecidableEq R
ε : ℝ
_hε : 0 < ε
b : R
_hb : b ≠ 0
A : Fin (Nat.succ (IsAdmissible.card h ε ^ Nat.zero)) → Fin Nat.zero → R
⊢ ∃ i₀ i₁, i₀ ≠ i₁ ∧ ∀ (k : Fin Nat.zero), ↑(↑abv (A i₁ k % b - A i₀ k % b)) < ↑abv b • ε
[PROOFSTEP]
refine' ⟨0, 1, _, _⟩
[GOAL]
case zero.refine'_1
R : Type u_1
inst✝ : EuclideanDomain R
abv : AbsoluteValue R ℤ
h : IsAdmissible abv
this : DecidableEq R
ε : ℝ
_hε : 0 < ε
b : R
_hb : b ≠ 0
A : Fin (Nat.succ (IsAdmissible.card h ε ^ Nat.zero)) → Fin Nat.zero → R
⊢ 0 ≠ 1
[PROOFSTEP]
simp
[GOAL]
case zero.refine'_2
R : Type u_1
inst✝ : EuclideanDomain R
abv : AbsoluteValue R ℤ
h : IsAdmissible abv
this : DecidableEq R
ε : ℝ
_hε : 0 < ε
b : R
_hb : b ≠ 0
A : Fin (Nat.succ (IsAdmissible.card h ε ^ Nat.zero)) → Fin Nat.zero → R
⊢ ∀ (k : Fin Nat.zero), ↑(↑abv (A 1 k % b - A 0 k % b)) < ↑abv b • ε
[PROOFSTEP]
rintro ⟨i, ⟨⟩⟩
[GOAL]
case succ
R : Type u_1
inst✝ : EuclideanDomain R
abv : AbsoluteValue R ℤ
h : IsAdmissible abv
this : DecidableEq R
n : ℕ
ih :
  ∀ {ε : ℝ},
    0 < ε →
      ∀ {b : R},
        b ≠ 0 →
          ∀ (A : Fin (Nat.succ (IsAdmissible.card h ε ^ n)) → Fin n → R),
            ∃ i₀ i₁, i₀ ≠ i₁ ∧ ∀ (k : Fin n), ↑(↑abv (A i₁ k % b - A i₀ k % b)) < ↑abv b • ε
⊢ ∀ {ε : ℝ},
    0 < ε →
      ∀ {b : R},
        b ≠ 0 →
          ∀ (A : Fin (Nat.succ (IsAdmissible.card h ε ^ Nat.succ n)) → Fin (Nat.succ n) → R),
            ∃ i₀ i₁, i₀ ≠ i₁ ∧ ∀ (k : Fin (Nat.succ n)), ↑(↑abv (A i₁ k % b - A i₀ k % b)) < ↑abv b • ε
[PROOFSTEP]
intro ε hε b hb A
[GOAL]
case succ
R : Type u_1
inst✝ : EuclideanDomain R
abv : AbsoluteValue R ℤ
h : IsAdmissible abv
this : DecidableEq R
n : ℕ
ih :
  ∀ {ε : ℝ},
    0 < ε →
      ∀ {b : R},
        b ≠ 0 →
          ∀ (A : Fin (Nat.succ (IsAdmissible.card h ε ^ n)) → Fin n → R),
            ∃ i₀ i₁, i₀ ≠ i₁ ∧ ∀ (k : Fin n), ↑(↑abv (A i₁ k % b - A i₀ k % b)) < ↑abv b • ε
ε : ℝ
hε : 0 < ε
b : R
hb : b ≠ 0
A : Fin (Nat.succ (IsAdmissible.card h ε ^ Nat.succ n)) → Fin (Nat.succ n) → R
⊢ ∃ i₀ i₁, i₀ ≠ i₁ ∧ ∀ (k : Fin (Nat.succ n)), ↑(↑abv (A i₁ k % b - A i₀ k % b)) < ↑abv b • ε
[PROOFSTEP]
let M := h.card ε
[GOAL]
case succ
R : Type u_1
inst✝ : EuclideanDomain R
abv : AbsoluteValue R ℤ
h : IsAdmissible abv
this : DecidableEq R
n : ℕ
ih :
  ∀ {ε : ℝ},
    0 < ε →
      ∀ {b : R},
        b ≠ 0 →
          ∀ (A : Fin (Nat.succ (IsAdmissible.card h ε ^ n)) → Fin n → R),
            ∃ i₀ i₁, i₀ ≠ i₁ ∧ ∀ (k : Fin n), ↑(↑abv (A i₁ k % b - A i₀ k % b)) < ↑abv b • ε
ε : ℝ
hε : 0 < ε
b : R
hb : b ≠ 0
A : Fin (Nat.succ (IsAdmissible.card h ε ^ Nat.succ n)) → Fin (Nat.succ n) → R
M : ℕ := IsAdmissible.card h ε
⊢ ∃ i₀ i₁, i₀ ≠ i₁ ∧ ∀ (k : Fin (Nat.succ n)), ↑(↑abv (A i₁ k % b - A i₀ k % b)) < ↑abv b • ε
[PROOFSTEP]
obtain ⟨s, s_inj, hs⟩ :
  ∃ s : Fin (M ^ n).succ → Fin (M ^ n.succ).succ,
    Function.Injective s ∧ ∀ i₀ i₁, (abv (A (s i₁) 0 % b - A (s i₀) 0 % b) : ℝ) < abv b • ε :=
  by
  -- We can partition the `A`s into `M` subsets where
      -- the first components lie close together:
  obtain ⟨t, ht⟩ :
    ∃ t : Fin (M ^ n.succ).succ → Fin M, ∀ i₀ i₁, t i₀ = t i₁ → (abv (A i₁ 0 % b - A i₀ 0 % b) : ℝ) < abv b • ε :=
    h.exists_partition hε hb fun x ↦
      A x
        0
          -- Since the `M` subsets contain more than `M * M^n` elements total,
              -- there must be a subset that contains more than `M^n` elements.
  obtain ⟨s, hs⟩ :=
    @Fintype.exists_lt_card_fiber_of_mul_lt_card _ _ _ _ _ t (M ^ n)
      (by simpa only [Fintype.card_fin, pow_succ] using Nat.lt_succ_self (M ^ n.succ))
  refine' ⟨fun i ↦ (Finset.univ.filter fun x ↦ t x = s).toList.nthLe i _, _, fun i₀ i₁ ↦ ht _ _ _⟩
  · refine' i.2.trans_le _
    rwa [Finset.length_toList]
  · intro i j h
    ext
    exact Fin.mk.inj_iff.mp (List.nodup_iff_injective_get.mp (Finset.nodup_toList _) h)
  have : ∀ i h, (Finset.univ.filter fun x ↦ t x = s).toList.nthLe i h ∈ Finset.univ.filter fun x ↦ t x = s :=
    by
    intro i h
    exact Finset.mem_toList.mp (List.get_mem _ i h)
  obtain ⟨_, h₀⟩ := Finset.mem_filter.mp (this i₀ _)
  obtain ⟨_, h₁⟩ := Finset.mem_filter.mp (this i₁ _)
  exact h₀.trans h₁.symm
[GOAL]
R : Type u_1
inst✝ : EuclideanDomain R
abv : AbsoluteValue R ℤ
h : IsAdmissible abv
this : DecidableEq R
n : ℕ
ih :
  ∀ {ε : ℝ},
    0 < ε →
      ∀ {b : R},
        b ≠ 0 →
          ∀ (A : Fin (Nat.succ (IsAdmissible.card h ε ^ n)) → Fin n → R),
            ∃ i₀ i₁, i₀ ≠ i₁ ∧ ∀ (k : Fin n), ↑(↑abv (A i₁ k % b - A i₀ k % b)) < ↑abv b • ε
ε : ℝ
hε : 0 < ε
b : R
hb : b ≠ 0
A : Fin (Nat.succ (IsAdmissible.card h ε ^ Nat.succ n)) → Fin (Nat.succ n) → R
M : ℕ := IsAdmissible.card h ε
⊢ ∃ s, Function.Injective s ∧ ∀ (i₀ i₁ : Fin (Nat.succ (M ^ n))), ↑(↑abv (A (s i₁) 0 % b - A (s i₀) 0 % b)) < ↑abv b • ε
[PROOFSTEP]
obtain ⟨t, ht⟩ :
  ∃ t : Fin (M ^ n.succ).succ → Fin M, ∀ i₀ i₁, t i₀ = t i₁ → (abv (A i₁ 0 % b - A i₀ 0 % b) : ℝ) < abv b • ε :=
  h.exists_partition hε hb fun x ↦
    A x
      0
        -- Since the `M` subsets contain more than `M * M^n` elements total,
            -- there must be a subset that contains more than `M^n` elements.
[GOAL]
case intro
R : Type u_1
inst✝ : EuclideanDomain R
abv : AbsoluteValue R ℤ
h : IsAdmissible abv
this : DecidableEq R
n : ℕ
ih :
  ∀ {ε : ℝ},
    0 < ε →
      ∀ {b : R},
        b ≠ 0 →
          ∀ (A : Fin (Nat.succ (IsAdmissible.card h ε ^ n)) → Fin n → R),
            ∃ i₀ i₁, i₀ ≠ i₁ ∧ ∀ (k : Fin n), ↑(↑abv (A i₁ k % b - A i₀ k % b)) < ↑abv b • ε
ε : ℝ
hε : 0 < ε
b : R
hb : b ≠ 0
A : Fin (Nat.succ (IsAdmissible.card h ε ^ Nat.succ n)) → Fin (Nat.succ n) → R
M : ℕ := IsAdmissible.card h ε
t : Fin (Nat.succ (M ^ Nat.succ n)) → Fin M
ht : ∀ (i₀ i₁ : Fin (Nat.succ (M ^ Nat.succ n))), t i₀ = t i₁ → ↑(↑abv (A i₁ 0 % b - A i₀ 0 % b)) < ↑abv b • ε
⊢ ∃ s, Function.Injective s ∧ ∀ (i₀ i₁ : Fin (Nat.succ (M ^ n))), ↑(↑abv (A (s i₁) 0 % b - A (s i₀) 0 % b)) < ↑abv b • ε
[PROOFSTEP]
obtain ⟨s, hs⟩ :=
  @Fintype.exists_lt_card_fiber_of_mul_lt_card _ _ _ _ _ t (M ^ n)
    (by simpa only [Fintype.card_fin, pow_succ] using Nat.lt_succ_self (M ^ n.succ))
[GOAL]
R : Type u_1
inst✝ : EuclideanDomain R
abv : AbsoluteValue R ℤ
h : IsAdmissible abv
this : DecidableEq R
n : ℕ
ih :
  ∀ {ε : ℝ},
    0 < ε →
      ∀ {b : R},
        b ≠ 0 →
          ∀ (A : Fin (Nat.succ (IsAdmissible.card h ε ^ n)) → Fin n → R),
            ∃ i₀ i₁, i₀ ≠ i₁ ∧ ∀ (k : Fin n), ↑(↑abv (A i₁ k % b - A i₀ k % b)) < ↑abv b • ε
ε : ℝ
hε : 0 < ε
b : R
hb : b ≠ 0
A : Fin (Nat.succ (IsAdmissible.card h ε ^ Nat.succ n)) → Fin (Nat.succ n) → R
M : ℕ := IsAdmissible.card h ε
t : Fin (Nat.succ (M ^ Nat.succ n)) → Fin M
ht : ∀ (i₀ i₁ : Fin (Nat.succ (M ^ Nat.succ n))), t i₀ = t i₁ → ↑(↑abv (A i₁ 0 % b - A i₀ 0 % b)) < ↑abv b • ε
⊢ Fintype.card (Fin M) * M ^ n < Fintype.card (Fin (Nat.succ (M ^ Nat.succ n)))
[PROOFSTEP]
simpa only [Fintype.card_fin, pow_succ] using Nat.lt_succ_self (M ^ n.succ)
[GOAL]
case intro.intro
R : Type u_1
inst✝ : EuclideanDomain R
abv : AbsoluteValue R ℤ
h : IsAdmissible abv
this : DecidableEq R
n : ℕ
ih :
  ∀ {ε : ℝ},
    0 < ε →
      ∀ {b : R},
        b ≠ 0 →
          ∀ (A : Fin (Nat.succ (IsAdmissible.card h ε ^ n)) → Fin n → R),
            ∃ i₀ i₁, i₀ ≠ i₁ ∧ ∀ (k : Fin n), ↑(↑abv (A i₁ k % b - A i₀ k % b)) < ↑abv b • ε
ε : ℝ
hε : 0 < ε
b : R
hb : b ≠ 0
A : Fin (Nat.succ (IsAdmissible.card h ε ^ Nat.succ n)) → Fin (Nat.succ n) → R
M : ℕ := IsAdmissible.card h ε
t : Fin (Nat.succ (M ^ Nat.succ n)) → Fin M
ht : ∀ (i₀ i₁ : Fin (Nat.succ (M ^ Nat.succ n))), t i₀ = t i₁ → ↑(↑abv (A i₁ 0 % b - A i₀ 0 % b)) < ↑abv b • ε
s : Fin M
hs : M ^ n < Finset.card (Finset.filter (fun x => t x = s) Finset.univ)
⊢ ∃ s, Function.Injective s ∧ ∀ (i₀ i₁ : Fin (Nat.succ (M ^ n))), ↑(↑abv (A (s i₁) 0 % b - A (s i₀) 0 % b)) < ↑abv b • ε
[PROOFSTEP]
refine' ⟨fun i ↦ (Finset.univ.filter fun x ↦ t x = s).toList.nthLe i _, _, fun i₀ i₁ ↦ ht _ _ _⟩
[GOAL]
case intro.intro.refine'_1
R : Type u_1
inst✝ : EuclideanDomain R
abv : AbsoluteValue R ℤ
h : IsAdmissible abv
this : DecidableEq R
n : ℕ
ih :
  ∀ {ε : ℝ},
    0 < ε →
      ∀ {b : R},
        b ≠ 0 →
          ∀ (A : Fin (Nat.succ (IsAdmissible.card h ε ^ n)) → Fin n → R),
            ∃ i₀ i₁, i₀ ≠ i₁ ∧ ∀ (k : Fin n), ↑(↑abv (A i₁ k % b - A i₀ k % b)) < ↑abv b • ε
ε : ℝ
hε : 0 < ε
b : R
hb : b ≠ 0
A : Fin (Nat.succ (IsAdmissible.card h ε ^ Nat.succ n)) → Fin (Nat.succ n) → R
M : ℕ := IsAdmissible.card h ε
t : Fin (Nat.succ (M ^ Nat.succ n)) → Fin M
ht : ∀ (i₀ i₁ : Fin (Nat.succ (M ^ Nat.succ n))), t i₀ = t i₁ → ↑(↑abv (A i₁ 0 % b - A i₀ 0 % b)) < ↑abv b • ε
s : Fin M
hs : M ^ n < Finset.card (Finset.filter (fun x => t x = s) Finset.univ)
i : Fin (Nat.succ (M ^ n))
⊢ ↑i < List.length (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ))
[PROOFSTEP]
refine' i.2.trans_le _
[GOAL]
case intro.intro.refine'_1
R : Type u_1
inst✝ : EuclideanDomain R
abv : AbsoluteValue R ℤ
h : IsAdmissible abv
this : DecidableEq R
n : ℕ
ih :
  ∀ {ε : ℝ},
    0 < ε →
      ∀ {b : R},
        b ≠ 0 →
          ∀ (A : Fin (Nat.succ (IsAdmissible.card h ε ^ n)) → Fin n → R),
            ∃ i₀ i₁, i₀ ≠ i₁ ∧ ∀ (k : Fin n), ↑(↑abv (A i₁ k % b - A i₀ k % b)) < ↑abv b • ε
ε : ℝ
hε : 0 < ε
b : R
hb : b ≠ 0
A : Fin (Nat.succ (IsAdmissible.card h ε ^ Nat.succ n)) → Fin (Nat.succ n) → R
M : ℕ := IsAdmissible.card h ε
t : Fin (Nat.succ (M ^ Nat.succ n)) → Fin M
ht : ∀ (i₀ i₁ : Fin (Nat.succ (M ^ Nat.succ n))), t i₀ = t i₁ → ↑(↑abv (A i₁ 0 % b - A i₀ 0 % b)) < ↑abv b • ε
s : Fin M
hs : M ^ n < Finset.card (Finset.filter (fun x => t x = s) Finset.univ)
i : Fin (Nat.succ (M ^ n))
⊢ Nat.succ (M ^ n) ≤ List.length (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ))
[PROOFSTEP]
rwa [Finset.length_toList]
[GOAL]
case intro.intro.refine'_2
R : Type u_1
inst✝ : EuclideanDomain R
abv : AbsoluteValue R ℤ
h : IsAdmissible abv
this : DecidableEq R
n : ℕ
ih :
  ∀ {ε : ℝ},
    0 < ε →
      ∀ {b : R},
        b ≠ 0 →
          ∀ (A : Fin (Nat.succ (IsAdmissible.card h ε ^ n)) → Fin n → R),
            ∃ i₀ i₁, i₀ ≠ i₁ ∧ ∀ (k : Fin n), ↑(↑abv (A i₁ k % b - A i₀ k % b)) < ↑abv b • ε
ε : ℝ
hε : 0 < ε
b : R
hb : b ≠ 0
A : Fin (Nat.succ (IsAdmissible.card h ε ^ Nat.succ n)) → Fin (Nat.succ n) → R
M : ℕ := IsAdmissible.card h ε
t : Fin (Nat.succ (M ^ Nat.succ n)) → Fin M
ht : ∀ (i₀ i₁ : Fin (Nat.succ (M ^ Nat.succ n))), t i₀ = t i₁ → ↑(↑abv (A i₁ 0 % b - A i₀ 0 % b)) < ↑abv b • ε
s : Fin M
hs : M ^ n < Finset.card (Finset.filter (fun x => t x = s) Finset.univ)
⊢ Function.Injective fun i =>
    List.nthLe (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ)) ↑i
      (_ : ↑i < List.length (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ)))
[PROOFSTEP]
intro i j h
[GOAL]
case intro.intro.refine'_2
R : Type u_1
inst✝ : EuclideanDomain R
abv : AbsoluteValue R ℤ
h✝ : IsAdmissible abv
this : DecidableEq R
n : ℕ
ih :
  ∀ {ε : ℝ},
    0 < ε →
      ∀ {b : R},
        b ≠ 0 →
          ∀ (A : Fin (Nat.succ (IsAdmissible.card h✝ ε ^ n)) → Fin n → R),
            ∃ i₀ i₁, i₀ ≠ i₁ ∧ ∀ (k : Fin n), ↑(↑abv (A i₁ k % b - A i₀ k % b)) < ↑abv b • ε
ε : ℝ
hε : 0 < ε
b : R
hb : b ≠ 0
A : Fin (Nat.succ (IsAdmissible.card h✝ ε ^ Nat.succ n)) → Fin (Nat.succ n) → R
M : ℕ := IsAdmissible.card h✝ ε
t : Fin (Nat.succ (M ^ Nat.succ n)) → Fin M
ht : ∀ (i₀ i₁ : Fin (Nat.succ (M ^ Nat.succ n))), t i₀ = t i₁ → ↑(↑abv (A i₁ 0 % b - A i₀ 0 % b)) < ↑abv b • ε
s : Fin M
hs : M ^ n < Finset.card (Finset.filter (fun x => t x = s) Finset.univ)
i j : Fin (Nat.succ (M ^ n))
h :
  (fun i =>
        List.nthLe (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ)) ↑i
          (_ : ↑i < List.length (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ))))
      i =
    (fun i =>
        List.nthLe (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ)) ↑i
          (_ : ↑i < List.length (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ))))
      j
⊢ i = j
[PROOFSTEP]
ext
[GOAL]
case intro.intro.refine'_2.h
R : Type u_1
inst✝ : EuclideanDomain R
abv : AbsoluteValue R ℤ
h✝ : IsAdmissible abv
this : DecidableEq R
n : ℕ
ih :
  ∀ {ε : ℝ},
    0 < ε →
      ∀ {b : R},
        b ≠ 0 →
          ∀ (A : Fin (Nat.succ (IsAdmissible.card h✝ ε ^ n)) → Fin n → R),
            ∃ i₀ i₁, i₀ ≠ i₁ ∧ ∀ (k : Fin n), ↑(↑abv (A i₁ k % b - A i₀ k % b)) < ↑abv b • ε
ε : ℝ
hε : 0 < ε
b : R
hb : b ≠ 0
A : Fin (Nat.succ (IsAdmissible.card h✝ ε ^ Nat.succ n)) → Fin (Nat.succ n) → R
M : ℕ := IsAdmissible.card h✝ ε
t : Fin (Nat.succ (M ^ Nat.succ n)) → Fin M
ht : ∀ (i₀ i₁ : Fin (Nat.succ (M ^ Nat.succ n))), t i₀ = t i₁ → ↑(↑abv (A i₁ 0 % b - A i₀ 0 % b)) < ↑abv b • ε
s : Fin M
hs : M ^ n < Finset.card (Finset.filter (fun x => t x = s) Finset.univ)
i j : Fin (Nat.succ (M ^ n))
h :
  (fun i =>
        List.nthLe (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ)) ↑i
          (_ : ↑i < List.length (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ))))
      i =
    (fun i =>
        List.nthLe (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ)) ↑i
          (_ : ↑i < List.length (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ))))
      j
⊢ ↑i = ↑j
[PROOFSTEP]
exact Fin.mk.inj_iff.mp (List.nodup_iff_injective_get.mp (Finset.nodup_toList _) h)
[GOAL]
case intro.intro.refine'_3
R : Type u_1
inst✝ : EuclideanDomain R
abv : AbsoluteValue R ℤ
h : IsAdmissible abv
this : DecidableEq R
n : ℕ
ih :
  ∀ {ε : ℝ},
    0 < ε →
      ∀ {b : R},
        b ≠ 0 →
          ∀ (A : Fin (Nat.succ (IsAdmissible.card h ε ^ n)) → Fin n → R),
            ∃ i₀ i₁, i₀ ≠ i₁ ∧ ∀ (k : Fin n), ↑(↑abv (A i₁ k % b - A i₀ k % b)) < ↑abv b • ε
ε : ℝ
hε : 0 < ε
b : R
hb : b ≠ 0
A : Fin (Nat.succ (IsAdmissible.card h ε ^ Nat.succ n)) → Fin (Nat.succ n) → R
M : ℕ := IsAdmissible.card h ε
t : Fin (Nat.succ (M ^ Nat.succ n)) → Fin M
ht : ∀ (i₀ i₁ : Fin (Nat.succ (M ^ Nat.succ n))), t i₀ = t i₁ → ↑(↑abv (A i₁ 0 % b - A i₀ 0 % b)) < ↑abv b • ε
s : Fin M
hs : M ^ n < Finset.card (Finset.filter (fun x => t x = s) Finset.univ)
i₀ i₁ : Fin (Nat.succ (M ^ n))
⊢ t
      ((fun i =>
          List.nthLe (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ)) ↑i
            (_ : ↑i < List.length (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ))))
        i₀) =
    t
      ((fun i =>
          List.nthLe (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ)) ↑i
            (_ : ↑i < List.length (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ))))
        i₁)
[PROOFSTEP]
have : ∀ i h, (Finset.univ.filter fun x ↦ t x = s).toList.nthLe i h ∈ Finset.univ.filter fun x ↦ t x = s :=
  by
  intro i h
  exact Finset.mem_toList.mp (List.get_mem _ i h)
[GOAL]
R : Type u_1
inst✝ : EuclideanDomain R
abv : AbsoluteValue R ℤ
h : IsAdmissible abv
this : DecidableEq R
n : ℕ
ih :
  ∀ {ε : ℝ},
    0 < ε →
      ∀ {b : R},
        b ≠ 0 →
          ∀ (A : Fin (Nat.succ (IsAdmissible.card h ε ^ n)) → Fin n → R),
            ∃ i₀ i₁, i₀ ≠ i₁ ∧ ∀ (k : Fin n), ↑(↑abv (A i₁ k % b - A i₀ k % b)) < ↑abv b • ε
ε : ℝ
hε : 0 < ε
b : R
hb : b ≠ 0
A : Fin (Nat.succ (IsAdmissible.card h ε ^ Nat.succ n)) → Fin (Nat.succ n) → R
M : ℕ := IsAdmissible.card h ε
t : Fin (Nat.succ (M ^ Nat.succ n)) → Fin M
ht : ∀ (i₀ i₁ : Fin (Nat.succ (M ^ Nat.succ n))), t i₀ = t i₁ → ↑(↑abv (A i₁ 0 % b - A i₀ 0 % b)) < ↑abv b • ε
s : Fin M
hs : M ^ n < Finset.card (Finset.filter (fun x => t x = s) Finset.univ)
i₀ i₁ : Fin (Nat.succ (M ^ n))
⊢ ∀ (i : ℕ) (h : i < List.length (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ))),
    List.nthLe (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ)) i h ∈
      Finset.filter (fun x => t x = s) Finset.univ
[PROOFSTEP]
intro i h
[GOAL]
R : Type u_1
inst✝ : EuclideanDomain R
abv : AbsoluteValue R ℤ
h✝ : IsAdmissible abv
this : DecidableEq R
n : ℕ
ih :
  ∀ {ε : ℝ},
    0 < ε →
      ∀ {b : R},
        b ≠ 0 →
          ∀ (A : Fin (Nat.succ (IsAdmissible.card h✝ ε ^ n)) → Fin n → R),
            ∃ i₀ i₁, i₀ ≠ i₁ ∧ ∀ (k : Fin n), ↑(↑abv (A i₁ k % b - A i₀ k % b)) < ↑abv b • ε
ε : ℝ
hε : 0 < ε
b : R
hb : b ≠ 0
A : Fin (Nat.succ (IsAdmissible.card h✝ ε ^ Nat.succ n)) → Fin (Nat.succ n) → R
M : ℕ := IsAdmissible.card h✝ ε
t : Fin (Nat.succ (M ^ Nat.succ n)) → Fin M
ht : ∀ (i₀ i₁ : Fin (Nat.succ (M ^ Nat.succ n))), t i₀ = t i₁ → ↑(↑abv (A i₁ 0 % b - A i₀ 0 % b)) < ↑abv b • ε
s : Fin M
hs : M ^ n < Finset.card (Finset.filter (fun x => t x = s) Finset.univ)
i₀ i₁ : Fin (Nat.succ (M ^ n))
i : ℕ
h : i < List.length (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ))
⊢ List.nthLe (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ)) i h ∈
    Finset.filter (fun x => t x = s) Finset.univ
[PROOFSTEP]
exact Finset.mem_toList.mp (List.get_mem _ i h)
[GOAL]
case intro.intro.refine'_3
R : Type u_1
inst✝ : EuclideanDomain R
abv : AbsoluteValue R ℤ
h : IsAdmissible abv
this✝ : DecidableEq R
n : ℕ
ih :
  ∀ {ε : ℝ},
    0 < ε →
      ∀ {b : R},
        b ≠ 0 →
          ∀ (A : Fin (Nat.succ (IsAdmissible.card h ε ^ n)) → Fin n → R),
            ∃ i₀ i₁, i₀ ≠ i₁ ∧ ∀ (k : Fin n), ↑(↑abv (A i₁ k % b - A i₀ k % b)) < ↑abv b • ε
ε : ℝ
hε : 0 < ε
b : R
hb : b ≠ 0
A : Fin (Nat.succ (IsAdmissible.card h ε ^ Nat.succ n)) → Fin (Nat.succ n) → R
M : ℕ := IsAdmissible.card h ε
t : Fin (Nat.succ (M ^ Nat.succ n)) → Fin M
ht : ∀ (i₀ i₁ : Fin (Nat.succ (M ^ Nat.succ n))), t i₀ = t i₁ → ↑(↑abv (A i₁ 0 % b - A i₀ 0 % b)) < ↑abv b • ε
s : Fin M
hs : M ^ n < Finset.card (Finset.filter (fun x => t x = s) Finset.univ)
i₀ i₁ : Fin (Nat.succ (M ^ n))
this :
  ∀ (i : ℕ) (h : i < List.length (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ))),
    List.nthLe (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ)) i h ∈
      Finset.filter (fun x => t x = s) Finset.univ
⊢ t
      ((fun i =>
          List.nthLe (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ)) ↑i
            (_ : ↑i < List.length (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ))))
        i₀) =
    t
      ((fun i =>
          List.nthLe (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ)) ↑i
            (_ : ↑i < List.length (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ))))
        i₁)
[PROOFSTEP]
obtain ⟨_, h₀⟩ := Finset.mem_filter.mp (this i₀ _)
[GOAL]
case intro.intro.refine'_3.intro
R : Type u_1
inst✝ : EuclideanDomain R
abv : AbsoluteValue R ℤ
h : IsAdmissible abv
this✝ : DecidableEq R
n : ℕ
ih :
  ∀ {ε : ℝ},
    0 < ε →
      ∀ {b : R},
        b ≠ 0 →
          ∀ (A : Fin (Nat.succ (IsAdmissible.card h ε ^ n)) → Fin n → R),
            ∃ i₀ i₁, i₀ ≠ i₁ ∧ ∀ (k : Fin n), ↑(↑abv (A i₁ k % b - A i₀ k % b)) < ↑abv b • ε
ε : ℝ
hε : 0 < ε
b : R
hb : b ≠ 0
A : Fin (Nat.succ (IsAdmissible.card h ε ^ Nat.succ n)) → Fin (Nat.succ n) → R
M : ℕ := IsAdmissible.card h ε
t : Fin (Nat.succ (M ^ Nat.succ n)) → Fin M
ht : ∀ (i₀ i₁ : Fin (Nat.succ (M ^ Nat.succ n))), t i₀ = t i₁ → ↑(↑abv (A i₁ 0 % b - A i₀ 0 % b)) < ↑abv b • ε
s : Fin M
hs : M ^ n < Finset.card (Finset.filter (fun x => t x = s) Finset.univ)
i₀ i₁ : Fin (Nat.succ (M ^ n))
this :
  ∀ (i : ℕ) (h : i < List.length (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ))),
    List.nthLe (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ)) i h ∈
      Finset.filter (fun x => t x = s) Finset.univ
left✝ : List.nthLe (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ)) ↑i₀ ?m.22999 ∈ Finset.univ
h₀ : t (List.nthLe (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ)) ↑i₀ ?m.22999) = s
⊢ t
      ((fun i =>
          List.nthLe (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ)) ↑i
            (_ : ↑i < List.length (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ))))
        i₀) =
    t
      ((fun i =>
          List.nthLe (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ)) ↑i
            (_ : ↑i < List.length (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ))))
        i₁)
[PROOFSTEP]
obtain ⟨_, h₁⟩ := Finset.mem_filter.mp (this i₁ _)
[GOAL]
case intro.intro.refine'_3.intro.intro
R : Type u_1
inst✝ : EuclideanDomain R
abv : AbsoluteValue R ℤ
h : IsAdmissible abv
this✝ : DecidableEq R
n : ℕ
ih :
  ∀ {ε : ℝ},
    0 < ε →
      ∀ {b : R},
        b ≠ 0 →
          ∀ (A : Fin (Nat.succ (IsAdmissible.card h ε ^ n)) → Fin n → R),
            ∃ i₀ i₁, i₀ ≠ i₁ ∧ ∀ (k : Fin n), ↑(↑abv (A i₁ k % b - A i₀ k % b)) < ↑abv b • ε
ε : ℝ
hε : 0 < ε
b : R
hb : b ≠ 0
A : Fin (Nat.succ (IsAdmissible.card h ε ^ Nat.succ n)) → Fin (Nat.succ n) → R
M : ℕ := IsAdmissible.card h ε
t : Fin (Nat.succ (M ^ Nat.succ n)) → Fin M
ht : ∀ (i₀ i₁ : Fin (Nat.succ (M ^ Nat.succ n))), t i₀ = t i₁ → ↑(↑abv (A i₁ 0 % b - A i₀ 0 % b)) < ↑abv b • ε
s : Fin M
hs : M ^ n < Finset.card (Finset.filter (fun x => t x = s) Finset.univ)
i₀ i₁ : Fin (Nat.succ (M ^ n))
this :
  ∀ (i : ℕ) (h : i < List.length (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ))),
    List.nthLe (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ)) i h ∈
      Finset.filter (fun x => t x = s) Finset.univ
left✝¹ : List.nthLe (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ)) ↑i₀ ?m.22999 ∈ Finset.univ
h₀ : t (List.nthLe (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ)) ↑i₀ ?m.22999) = s
left✝ : List.nthLe (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ)) ↑i₁ ?m.23393 ∈ Finset.univ
h₁ : t (List.nthLe (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ)) ↑i₁ ?m.23393) = s
⊢ t
      ((fun i =>
          List.nthLe (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ)) ↑i
            (_ : ↑i < List.length (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ))))
        i₀) =
    t
      ((fun i =>
          List.nthLe (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ)) ↑i
            (_ : ↑i < List.length (Finset.toList (Finset.filter (fun x => t x = s) Finset.univ))))
        i₁)
[PROOFSTEP]
exact h₀.trans h₁.symm
[GOAL]
case succ.intro.intro
R : Type u_1
inst✝ : EuclideanDomain R
abv : AbsoluteValue R ℤ
h : IsAdmissible abv
this : DecidableEq R
n : ℕ
ih :
  ∀ {ε : ℝ},
    0 < ε →
      ∀ {b : R},
        b ≠ 0 →
          ∀ (A : Fin (Nat.succ (IsAdmissible.card h ε ^ n)) → Fin n → R),
            ∃ i₀ i₁, i₀ ≠ i₁ ∧ ∀ (k : Fin n), ↑(↑abv (A i₁ k % b - A i₀ k % b)) < ↑abv b • ε
ε : ℝ
hε : 0 < ε
b : R
hb : b ≠ 0
A : Fin (Nat.succ (IsAdmissible.card h ε ^ Nat.succ n)) → Fin (Nat.succ n) → R
M : ℕ := IsAdmissible.card h ε
s : Fin (Nat.succ (M ^ n)) → Fin (Nat.succ (M ^ Nat.succ n))
s_inj : Function.Injective s
hs : ∀ (i₀ i₁ : Fin (Nat.succ (M ^ n))), ↑(↑abv (A (s i₁) 0 % b - A (s i₀) 0 % b)) < ↑abv b • ε
⊢ ∃ i₀ i₁, i₀ ≠ i₁ ∧ ∀ (k : Fin (Nat.succ n)), ↑(↑abv (A i₁ k % b - A i₀ k % b)) < ↑abv b • ε
[PROOFSTEP]
obtain ⟨k₀, k₁, hk, h⟩ := ih hε hb fun x ↦ Fin.tail (A (s x))
[GOAL]
case succ.intro.intro.intro.intro.intro
R : Type u_1
inst✝ : EuclideanDomain R
abv : AbsoluteValue R ℤ
h✝ : IsAdmissible abv
this : DecidableEq R
n : ℕ
ih :
  ∀ {ε : ℝ},
    0 < ε →
      ∀ {b : R},
        b ≠ 0 →
          ∀ (A : Fin (Nat.succ (IsAdmissible.card h✝ ε ^ n)) → Fin n → R),
            ∃ i₀ i₁, i₀ ≠ i₁ ∧ ∀ (k : Fin n), ↑(↑abv (A i₁ k % b - A i₀ k % b)) < ↑abv b • ε
ε : ℝ
hε : 0 < ε
b : R
hb : b ≠ 0
A : Fin (Nat.succ (IsAdmissible.card h✝ ε ^ Nat.succ n)) → Fin (Nat.succ n) → R
M : ℕ := IsAdmissible.card h✝ ε
s : Fin (Nat.succ (M ^ n)) → Fin (Nat.succ (M ^ Nat.succ n))
s_inj : Function.Injective s
hs : ∀ (i₀ i₁ : Fin (Nat.succ (M ^ n))), ↑(↑abv (A (s i₁) 0 % b - A (s i₀) 0 % b)) < ↑abv b • ε
k₀ k₁ : Fin (Nat.succ (IsAdmissible.card h✝ ε ^ n))
hk : k₀ ≠ k₁
h : ∀ (k : Fin n), ↑(↑abv (Fin.tail (A (s k₁)) k % b - Fin.tail (A (s k₀)) k % b)) < ↑abv b • ε
⊢ ∃ i₀ i₁, i₀ ≠ i₁ ∧ ∀ (k : Fin (Nat.succ n)), ↑(↑abv (A i₁ k % b - A i₀ k % b)) < ↑abv b • ε
[PROOFSTEP]
refine' ⟨s k₀, s k₁, fun h ↦ hk (s_inj h), fun i ↦ Fin.cases _ (fun i ↦ _) i⟩
[GOAL]
case succ.intro.intro.intro.intro.intro.refine'_1
R : Type u_1
inst✝ : EuclideanDomain R
abv : AbsoluteValue R ℤ
h✝ : IsAdmissible abv
this : DecidableEq R
n : ℕ
ih :
  ∀ {ε : ℝ},
    0 < ε →
      ∀ {b : R},
        b ≠ 0 →
          ∀ (A : Fin (Nat.succ (IsAdmissible.card h✝ ε ^ n)) → Fin n → R),
            ∃ i₀ i₁, i₀ ≠ i₁ ∧ ∀ (k : Fin n), ↑(↑abv (A i₁ k % b - A i₀ k % b)) < ↑abv b • ε
ε : ℝ
hε : 0 < ε
b : R
hb : b ≠ 0
A : Fin (Nat.succ (IsAdmissible.card h✝ ε ^ Nat.succ n)) → Fin (Nat.succ n) → R
M : ℕ := IsAdmissible.card h✝ ε
s : Fin (Nat.succ (M ^ n)) → Fin (Nat.succ (M ^ Nat.succ n))
s_inj : Function.Injective s
hs : ∀ (i₀ i₁ : Fin (Nat.succ (M ^ n))), ↑(↑abv (A (s i₁) 0 % b - A (s i₀) 0 % b)) < ↑abv b • ε
k₀ k₁ : Fin (Nat.succ (IsAdmissible.card h✝ ε ^ n))
hk : k₀ ≠ k₁
h : ∀ (k : Fin n), ↑(↑abv (Fin.tail (A (s k₁)) k % b - Fin.tail (A (s k₀)) k % b)) < ↑abv b • ε
i : Fin (Nat.succ n)
⊢ ↑(↑abv (A (s k₁) 0 % b - A (s k₀) 0 % b)) < ↑abv b • ε
[PROOFSTEP]
exact hs k₀ k₁
[GOAL]
case succ.intro.intro.intro.intro.intro.refine'_2
R : Type u_1
inst✝ : EuclideanDomain R
abv : AbsoluteValue R ℤ
h✝ : IsAdmissible abv
this : DecidableEq R
n : ℕ
ih :
  ∀ {ε : ℝ},
    0 < ε →
      ∀ {b : R},
        b ≠ 0 →
          ∀ (A : Fin (Nat.succ (IsAdmissible.card h✝ ε ^ n)) → Fin n → R),
            ∃ i₀ i₁, i₀ ≠ i₁ ∧ ∀ (k : Fin n), ↑(↑abv (A i₁ k % b - A i₀ k % b)) < ↑abv b • ε
ε : ℝ
hε : 0 < ε
b : R
hb : b ≠ 0
A : Fin (Nat.succ (IsAdmissible.card h✝ ε ^ Nat.succ n)) → Fin (Nat.succ n) → R
M : ℕ := IsAdmissible.card h✝ ε
s : Fin (Nat.succ (M ^ n)) → Fin (Nat.succ (M ^ Nat.succ n))
s_inj : Function.Injective s
hs : ∀ (i₀ i₁ : Fin (Nat.succ (M ^ n))), ↑(↑abv (A (s i₁) 0 % b - A (s i₀) 0 % b)) < ↑abv b • ε
k₀ k₁ : Fin (Nat.succ (IsAdmissible.card h✝ ε ^ n))
hk : k₀ ≠ k₁
h : ∀ (k : Fin n), ↑(↑abv (Fin.tail (A (s k₁)) k % b - Fin.tail (A (s k₀)) k % b)) < ↑abv b • ε
i✝ : Fin (Nat.succ n)
i : Fin n
⊢ ↑(↑abv (A (s k₁) (Fin.succ i) % b - A (s k₀) (Fin.succ i) % b)) < ↑abv b • ε
[PROOFSTEP]
exact h i
[GOAL]
R : Type u_1
inst✝¹ : EuclideanDomain R
abv : AbsoluteValue R ℤ
ι : Type u_2
inst✝ : Fintype ι
ε : ℝ
hε : 0 < ε
b : R
hb : b ≠ 0
h : IsAdmissible abv
A : Fin (Nat.succ (IsAdmissible.card h ε ^ Fintype.card ι)) → ι → R
⊢ ∃ i₀ i₁, i₀ ≠ i₁ ∧ ∀ (k : ι), ↑(↑abv (A i₁ k % b - A i₀ k % b)) < ↑abv b • ε
[PROOFSTEP]
let e := Fintype.equivFin ι
[GOAL]
R : Type u_1
inst✝¹ : EuclideanDomain R
abv : AbsoluteValue R ℤ
ι : Type u_2
inst✝ : Fintype ι
ε : ℝ
hε : 0 < ε
b : R
hb : b ≠ 0
h : IsAdmissible abv
A : Fin (Nat.succ (IsAdmissible.card h ε ^ Fintype.card ι)) → ι → R
e : ι ≃ Fin (Fintype.card ι) := Fintype.equivFin ι
⊢ ∃ i₀ i₁, i₀ ≠ i₁ ∧ ∀ (k : ι), ↑(↑abv (A i₁ k % b - A i₀ k % b)) < ↑abv b • ε
[PROOFSTEP]
obtain ⟨i₀, i₁, ne, h⟩ := h.exists_approx_aux (Fintype.card ι) hε hb fun x y ↦ A x (e.symm y)
[GOAL]
case intro.intro.intro
R : Type u_1
inst✝¹ : EuclideanDomain R
abv : AbsoluteValue R ℤ
ι : Type u_2
inst✝ : Fintype ι
ε : ℝ
hε : 0 < ε
b : R
hb : b ≠ 0
h✝ : IsAdmissible abv
A : Fin (Nat.succ (IsAdmissible.card h✝ ε ^ Fintype.card ι)) → ι → R
e : ι ≃ Fin (Fintype.card ι) := Fintype.equivFin ι
i₀ i₁ : Fin (Nat.succ (IsAdmissible.card h✝ ε ^ Fintype.card ι))
ne : i₀ ≠ i₁
h : ∀ (k : Fin (Fintype.card ι)), ↑(↑abv (A i₁ (↑e.symm k) % b - A i₀ (↑e.symm k) % b)) < ↑abv b • ε
⊢ ∃ i₀ i₁, i₀ ≠ i₁ ∧ ∀ (k : ι), ↑(↑abv (A i₁ k % b - A i₀ k % b)) < ↑abv b • ε
[PROOFSTEP]
refine' ⟨i₀, i₁, ne, fun k ↦ _⟩
[GOAL]
case intro.intro.intro
R : Type u_1
inst✝¹ : EuclideanDomain R
abv : AbsoluteValue R ℤ
ι : Type u_2
inst✝ : Fintype ι
ε : ℝ
hε : 0 < ε
b : R
hb : b ≠ 0
h✝ : IsAdmissible abv
A : Fin (Nat.succ (IsAdmissible.card h✝ ε ^ Fintype.card ι)) → ι → R
e : ι ≃ Fin (Fintype.card ι) := Fintype.equivFin ι
i₀ i₁ : Fin (Nat.succ (IsAdmissible.card h✝ ε ^ Fintype.card ι))
ne : i₀ ≠ i₁
h : ∀ (k : Fin (Fintype.card ι)), ↑(↑abv (A i₁ (↑e.symm k) % b - A i₀ (↑e.symm k) % b)) < ↑abv b • ε
k : ι
⊢ ↑(↑abv (A i₁ k % b - A i₀ k % b)) < ↑abv b • ε
[PROOFSTEP]
convert h (e k)
[GOAL]
case h.e'_3.h.e'_3.h.e'_6.h.e'_5.h.e'_5.h.e'_2
R : Type u_1
inst✝¹ : EuclideanDomain R
abv : AbsoluteValue R ℤ
ι : Type u_2
inst✝ : Fintype ι
ε : ℝ
hε : 0 < ε
b : R
hb : b ≠ 0
h✝ : IsAdmissible abv
A : Fin (Nat.succ (IsAdmissible.card h✝ ε ^ Fintype.card ι)) → ι → R
e : ι ≃ Fin (Fintype.card ι) := Fintype.equivFin ι
i₀ i₁ : Fin (Nat.succ (IsAdmissible.card h✝ ε ^ Fintype.card ι))
ne : i₀ ≠ i₁
h : ∀ (k : Fin (Fintype.card ι)), ↑(↑abv (A i₁ (↑e.symm k) % b - A i₀ (↑e.symm k) % b)) < ↑abv b • ε
k : ι
⊢ k = ↑e.symm (↑e k)
[PROOFSTEP]
simp only [e.symm_apply_apply]
[GOAL]
case h.e'_3.h.e'_3.h.e'_6.h.e'_6.h.e'_5.h.e'_2
R : Type u_1
inst✝¹ : EuclideanDomain R
abv : AbsoluteValue R ℤ
ι : Type u_2
inst✝ : Fintype ι
ε : ℝ
hε : 0 < ε
b : R
hb : b ≠ 0
h✝ : IsAdmissible abv
A : Fin (Nat.succ (IsAdmissible.card h✝ ε ^ Fintype.card ι)) → ι → R
e : ι ≃ Fin (Fintype.card ι) := Fintype.equivFin ι
i₀ i₁ : Fin (Nat.succ (IsAdmissible.card h✝ ε ^ Fintype.card ι))
ne : i₀ ≠ i₁
h : ∀ (k : Fin (Fintype.card ι)), ↑(↑abv (A i₁ (↑e.symm k) % b - A i₀ (↑e.symm k) % b)) < ↑abv b • ε
k : ι
⊢ k = ↑e.symm (↑e k)
[PROOFSTEP]
simp only [e.symm_apply_apply]


[GOAL]
α : Type u_1
inst✝ : LT α
a : α
⊢ ¬IsSuccLimit a ↔ ∃ b, b ⋖ a
[PROOFSTEP]
simp [IsSuccLimit]
[GOAL]
α : Type u_1
inst✝¹ : Preorder α
a : α
inst✝ : SuccOrder α
h : IsSuccLimit (succ a)
⊢ IsMax a
[PROOFSTEP]
by_contra H
[GOAL]
α : Type u_1
inst✝¹ : Preorder α
a : α
inst✝ : SuccOrder α
h : IsSuccLimit (succ a)
H : ¬IsMax a
⊢ False
[PROOFSTEP]
exact h a (covby_succ_of_not_isMax H)
[GOAL]
α : Type u_1
inst✝¹ : Preorder α
a : α
inst✝ : SuccOrder α
ha : ¬IsMax a
⊢ ¬IsSuccLimit (succ a)
[PROOFSTEP]
contrapose! ha
[GOAL]
α : Type u_1
inst✝¹ : Preorder α
a : α
inst✝ : SuccOrder α
ha : IsSuccLimit (succ a)
⊢ IsMax a
[PROOFSTEP]
exact ha.isMax
[GOAL]
α : Type u_1
inst✝² : Preorder α
a : α
inst✝¹ : SuccOrder α
inst✝ : NoMaxOrder α
h : IsSuccLimit a
b : α
⊢ succ b ≠ a
[PROOFSTEP]
rintro rfl
[GOAL]
α : Type u_1
inst✝² : Preorder α
inst✝¹ : SuccOrder α
inst✝ : NoMaxOrder α
b : α
h : IsSuccLimit (succ b)
⊢ False
[PROOFSTEP]
exact not_isMax _ h.isMax
[GOAL]
α : Type u_1
inst✝³ : Preorder α
a : α
inst✝² : SuccOrder α
inst✝¹ : IsSuccArchimedean α
inst✝ : NoMaxOrder α
h : IsSuccLimit a
b : α
hb : b ≤ a
⊢ a ≤ b
[PROOFSTEP]
rcases hb.exists_succ_iterate with ⟨_ | n, rfl⟩
[GOAL]
case intro.zero
α : Type u_1
inst✝³ : Preorder α
inst✝² : SuccOrder α
inst✝¹ : IsSuccArchimedean α
inst✝ : NoMaxOrder α
b : α
h : IsSuccLimit (succ^[Nat.zero] b)
hb : b ≤ succ^[Nat.zero] b
⊢ succ^[Nat.zero] b ≤ b
[PROOFSTEP]
exact le_rfl
[GOAL]
case intro.succ
α : Type u_1
inst✝³ : Preorder α
inst✝² : SuccOrder α
inst✝¹ : IsSuccArchimedean α
inst✝ : NoMaxOrder α
b : α
n : ℕ
h : IsSuccLimit (succ^[Nat.succ n] b)
hb : b ≤ succ^[Nat.succ n] b
⊢ succ^[Nat.succ n] b ≤ b
[PROOFSTEP]
rw [iterate_succ_apply'] at h
[GOAL]
case intro.succ
α : Type u_1
inst✝³ : Preorder α
inst✝² : SuccOrder α
inst✝¹ : IsSuccArchimedean α
inst✝ : NoMaxOrder α
b : α
n : ℕ
h : IsSuccLimit (succ (succ^[n] b))
hb : b ≤ succ^[Nat.succ n] b
⊢ succ^[Nat.succ n] b ≤ b
[PROOFSTEP]
exact (not_isSuccLimit_succ _ h).elim
[GOAL]
α : Type u_1
inst✝⁴ : Preorder α
a : α
inst✝³ : SuccOrder α
inst✝² : IsSuccArchimedean α
inst✝¹ : NoMinOrder α
inst✝ : NoMaxOrder α
⊢ ¬IsSuccLimit a
[PROOFSTEP]
simp
[GOAL]
α : Type u_1
inst✝¹ : PartialOrder α
inst✝ : SuccOrder α
a b : α
C : α → Sort u_2
⊢ ¬IsSuccLimit a ↔ ∃ b, ¬IsMax b ∧ succ b = a
[PROOFSTEP]
rw [not_isSuccLimit_iff_exists_covby]
[GOAL]
α : Type u_1
inst✝¹ : PartialOrder α
inst✝ : SuccOrder α
a b : α
C : α → Sort u_2
⊢ (∃ b, b ⋖ a) ↔ ∃ b, ¬IsMax b ∧ succ b = a
[PROOFSTEP]
refine' exists_congr fun b => ⟨fun hba => ⟨hba.lt.not_isMax, (Covby.succ_eq hba)⟩, _⟩
[GOAL]
α : Type u_1
inst✝¹ : PartialOrder α
inst✝ : SuccOrder α
a b✝ : α
C : α → Sort u_2
b : α
⊢ ¬IsMax b ∧ succ b = a → b ⋖ a
[PROOFSTEP]
rintro ⟨h, rfl⟩
[GOAL]
case intro
α : Type u_1
inst✝¹ : PartialOrder α
inst✝ : SuccOrder α
b✝ : α
C : α → Sort u_2
b : α
h : ¬IsMax b
⊢ b ⋖ succ b
[PROOFSTEP]
exact covby_succ_of_not_isMax h
[GOAL]
α : Type u_1
inst✝¹ : PartialOrder α
inst✝ : SuccOrder α
a b : α
C : α → Sort u_2
h : ¬IsSuccLimit a
⊢ a ∈ range succ
[PROOFSTEP]
cases' not_isSuccLimit_iff.1 h with b hb
[GOAL]
case intro
α : Type u_1
inst✝¹ : PartialOrder α
inst✝ : SuccOrder α
a b✝ : α
C : α → Sort u_2
h : ¬IsSuccLimit a
b : α
hb : ¬IsMax b ∧ succ b = a
⊢ a ∈ range succ
[PROOFSTEP]
exact ⟨b, hb.2⟩
[GOAL]
α : Type u_1
inst✝¹ : PartialOrder α
inst✝ : SuccOrder α
a b : α
C : α → Sort u_2
hb : IsSuccLimit b
ha : a < b
⊢ succ a < b
[PROOFSTEP]
by_cases h : IsMax a
[GOAL]
case pos
α : Type u_1
inst✝¹ : PartialOrder α
inst✝ : SuccOrder α
a b : α
C : α → Sort u_2
hb : IsSuccLimit b
ha : a < b
h : IsMax a
⊢ succ a < b
[PROOFSTEP]
rwa [h.succ_eq]
[GOAL]
case neg
α : Type u_1
inst✝¹ : PartialOrder α
inst✝ : SuccOrder α
a b : α
C : α → Sort u_2
hb : IsSuccLimit b
ha : a < b
h : ¬IsMax a
⊢ succ a < b
[PROOFSTEP]
rw [lt_iff_le_and_ne, succ_le_iff_of_not_isMax h]
[GOAL]
case neg
α : Type u_1
inst✝¹ : PartialOrder α
inst✝ : SuccOrder α
a b : α
C : α → Sort u_2
hb : IsSuccLimit b
ha : a < b
h : ¬IsMax a
⊢ a < b ∧ succ a ≠ b
[PROOFSTEP]
refine' ⟨ha, fun hab => _⟩
[GOAL]
case neg
α : Type u_1
inst✝¹ : PartialOrder α
inst✝ : SuccOrder α
a b : α
C : α → Sort u_2
hb : IsSuccLimit b
ha : a < b
h : ¬IsMax a
hab : succ a = b
⊢ False
[PROOFSTEP]
subst hab
[GOAL]
case neg
α : Type u_1
inst✝¹ : PartialOrder α
inst✝ : SuccOrder α
a : α
C : α → Sort u_2
h : ¬IsMax a
hb : IsSuccLimit (succ a)
ha : a < succ a
⊢ False
[PROOFSTEP]
exact (h hb.isMax).elim
[GOAL]
α : Type u_1
inst✝¹ : PartialOrder α
inst✝ : SuccOrder α
a b✝ : α
C : α → Sort u_2
b : α
hs : (a : α) → ¬IsMax a → C (succ a)
hl : (a : α) → IsSuccLimit a → C a
⊢ C b
[PROOFSTEP]
by_cases hb : IsSuccLimit b
[GOAL]
case pos
α : Type u_1
inst✝¹ : PartialOrder α
inst✝ : SuccOrder α
a b✝ : α
C : α → Sort u_2
b : α
hs : (a : α) → ¬IsMax a → C (succ a)
hl : (a : α) → IsSuccLimit a → C a
hb : IsSuccLimit b
⊢ C b
[PROOFSTEP]
exact hl b hb
[GOAL]
case neg
α : Type u_1
inst✝¹ : PartialOrder α
inst✝ : SuccOrder α
a b✝ : α
C : α → Sort u_2
b : α
hs : (a : α) → ¬IsMax a → C (succ a)
hl : (a : α) → IsSuccLimit a → C a
hb : ¬IsSuccLimit b
⊢ C b
[PROOFSTEP]
have H := Classical.choose_spec (not_isSuccLimit_iff.1 hb)
[GOAL]
case neg
α : Type u_1
inst✝¹ : PartialOrder α
inst✝ : SuccOrder α
a b✝ : α
C : α → Sort u_2
b : α
hs : (a : α) → ¬IsMax a → C (succ a)
hl : (a : α) → IsSuccLimit a → C a
hb : ¬IsSuccLimit b
H :
  ¬IsMax (Classical.choose (_ : ∃ b_1, ¬IsMax b_1 ∧ succ b_1 = b)) ∧
    succ (Classical.choose (_ : ∃ b_1, ¬IsMax b_1 ∧ succ b_1 = b)) = b
⊢ C b
[PROOFSTEP]
rw [← H.2]
[GOAL]
case neg
α : Type u_1
inst✝¹ : PartialOrder α
inst✝ : SuccOrder α
a b✝ : α
C : α → Sort u_2
b : α
hs : (a : α) → ¬IsMax a → C (succ a)
hl : (a : α) → IsSuccLimit a → C a
hb : ¬IsSuccLimit b
H :
  ¬IsMax (Classical.choose (_ : ∃ b_1, ¬IsMax b_1 ∧ succ b_1 = b)) ∧
    succ (Classical.choose (_ : ∃ b_1, ¬IsMax b_1 ∧ succ b_1 = b)) = b
⊢ C (succ (Classical.choose (_ : ∃ b_1, ¬IsMax b_1 ∧ succ b_1 = b)))
[PROOFSTEP]
exact hs _ H.1
[GOAL]
α : Type u_1
inst✝¹ : PartialOrder α
inst✝ : SuccOrder α
a b : α
C : α → Sort u_2
hs : (a : α) → ¬IsMax a → C (succ a)
hl : (a : α) → IsSuccLimit a → C a
hb : IsSuccLimit b
⊢ isSuccLimitRecOn b hs hl = hl b hb
[PROOFSTEP]
classical exact dif_pos hb
[GOAL]
α : Type u_1
inst✝¹ : PartialOrder α
inst✝ : SuccOrder α
a b : α
C : α → Sort u_2
hs : (a : α) → ¬IsMax a → C (succ a)
hl : (a : α) → IsSuccLimit a → C a
hb : IsSuccLimit b
⊢ isSuccLimitRecOn b hs hl = hl b hb
[PROOFSTEP]
exact dif_pos hb
[GOAL]
α : Type u_1
inst✝¹ : PartialOrder α
inst✝ : SuccOrder α
a b✝ : α
C : α → Sort u_2
hs : (a : α) → ¬IsMax a → C (succ a)
hl : (a : α) → IsSuccLimit a → C a
b : α
hb : ¬IsMax b
⊢ isSuccLimitRecOn (succ b) hs hl = hs b hb
[PROOFSTEP]
have hb' := not_isSuccLimit_succ_of_not_isMax hb
[GOAL]
α : Type u_1
inst✝¹ : PartialOrder α
inst✝ : SuccOrder α
a b✝ : α
C : α → Sort u_2
hs : (a : α) → ¬IsMax a → C (succ a)
hl : (a : α) → IsSuccLimit a → C a
b : α
hb : ¬IsMax b
hb' : ¬IsSuccLimit (succ b)
⊢ isSuccLimitRecOn (succ b) hs hl = hs b hb
[PROOFSTEP]
have H := Classical.choose_spec (not_isSuccLimit_iff.1 hb')
[GOAL]
α : Type u_1
inst✝¹ : PartialOrder α
inst✝ : SuccOrder α
a b✝ : α
C : α → Sort u_2
hs : (a : α) → ¬IsMax a → C (succ a)
hl : (a : α) → IsSuccLimit a → C a
b : α
hb : ¬IsMax b
hb' : ¬IsSuccLimit (succ b)
H :
  ¬IsMax (Classical.choose (_ : ∃ b_1, ¬IsMax b_1 ∧ succ b_1 = succ b)) ∧
    succ (Classical.choose (_ : ∃ b_1, ¬IsMax b_1 ∧ succ b_1 = succ b)) = succ b
⊢ isSuccLimitRecOn (succ b) hs hl = hs b hb
[PROOFSTEP]
rw [isSuccLimitRecOn]
[GOAL]
α : Type u_1
inst✝¹ : PartialOrder α
inst✝ : SuccOrder α
a b✝ : α
C : α → Sort u_2
hs : (a : α) → ¬IsMax a → C (succ a)
hl : (a : α) → IsSuccLimit a → C a
b : α
hb : ¬IsMax b
hb' : ¬IsSuccLimit (succ b)
H :
  ¬IsMax (Classical.choose (_ : ∃ b_1, ¬IsMax b_1 ∧ succ b_1 = succ b)) ∧
    succ (Classical.choose (_ : ∃ b_1, ¬IsMax b_1 ∧ succ b_1 = succ b)) = succ b
⊢ (if hb : IsSuccLimit (succ b) then hl (succ b) hb
    else
      let_fun H :=
        (_ :
          ¬IsMax (Classical.choose (_ : ∃ b_1, ¬IsMax b_1 ∧ succ b_1 = succ b)) ∧
            succ (Classical.choose (_ : ∃ b_1, ¬IsMax b_1 ∧ succ b_1 = succ b)) = succ b);
      Eq.mpr (_ : C (succ b) = C (succ (Classical.choose (_ : ∃ b_1, ¬IsMax b_1 ∧ succ b_1 = succ b))))
        (hs (Classical.choose (_ : ∃ b_1, ¬IsMax b_1 ∧ succ b_1 = succ b))
          (_ : ¬IsMax (Classical.choose (_ : ∃ b_1, ¬IsMax b_1 ∧ succ b_1 = succ b))))) =
    hs b hb
[PROOFSTEP]
simp only [cast_eq_iff_heq, hb', not_false_iff, eq_mpr_eq_cast, dif_neg]
[GOAL]
α : Type u_1
inst✝¹ : PartialOrder α
inst✝ : SuccOrder α
a b✝ : α
C : α → Sort u_2
hs : (a : α) → ¬IsMax a → C (succ a)
hl : (a : α) → IsSuccLimit a → C a
b : α
hb : ¬IsMax b
hb' : ¬IsSuccLimit (succ b)
H :
  ¬IsMax (Classical.choose (_ : ∃ b_1, ¬IsMax b_1 ∧ succ b_1 = succ b)) ∧
    succ (Classical.choose (_ : ∃ b_1, ¬IsMax b_1 ∧ succ b_1 = succ b)) = succ b
⊢ HEq
    (hs (Classical.choose (_ : ∃ b_1, ¬IsMax b_1 ∧ succ b_1 = succ b))
      (_ : ¬IsMax (Classical.choose (_ : ∃ b_1, ¬IsMax b_1 ∧ succ b_1 = succ b))))
    (hs b hb)
[PROOFSTEP]
congr 1
[GOAL]
case e_1
α : Type u_1
inst✝¹ : PartialOrder α
inst✝ : SuccOrder α
a b✝ : α
C : α → Sort u_2
hs : (a : α) → ¬IsMax a → C (succ a)
hl : (a : α) → IsSuccLimit a → C a
b : α
hb : ¬IsMax b
hb' : ¬IsSuccLimit (succ b)
H :
  ¬IsMax (Classical.choose (_ : ∃ b_1, ¬IsMax b_1 ∧ succ b_1 = succ b)) ∧
    succ (Classical.choose (_ : ∃ b_1, ¬IsMax b_1 ∧ succ b_1 = succ b)) = succ b
⊢ Classical.choose (_ : ∃ b_1, ¬IsMax b_1 ∧ succ b_1 = succ b) = b
[PROOFSTEP]
first
| exact (succ_eq_succ_iff_of_not_isMax H.left hb).mp H.right
| exact proof_irrel_heq H.left hb
[GOAL]
case e_1
α : Type u_1
inst✝¹ : PartialOrder α
inst✝ : SuccOrder α
a b✝ : α
C : α → Sort u_2
hs : (a : α) → ¬IsMax a → C (succ a)
hl : (a : α) → IsSuccLimit a → C a
b : α
hb : ¬IsMax b
hb' : ¬IsSuccLimit (succ b)
H :
  ¬IsMax (Classical.choose (_ : ∃ b_1, ¬IsMax b_1 ∧ succ b_1 = succ b)) ∧
    succ (Classical.choose (_ : ∃ b_1, ¬IsMax b_1 ∧ succ b_1 = succ b)) = succ b
⊢ Classical.choose (_ : ∃ b_1, ¬IsMax b_1 ∧ succ b_1 = succ b) = b
[PROOFSTEP]
exact (succ_eq_succ_iff_of_not_isMax H.left hb).mp H.right
[GOAL]
case e_2
α : Type u_1
inst✝¹ : PartialOrder α
inst✝ : SuccOrder α
a b✝ : α
C : α → Sort u_2
hs : (a : α) → ¬IsMax a → C (succ a)
hl : (a : α) → IsSuccLimit a → C a
b : α
hb : ¬IsMax b
hb' : ¬IsSuccLimit (succ b)
H :
  ¬IsMax (Classical.choose (_ : ∃ b_1, ¬IsMax b_1 ∧ succ b_1 = succ b)) ∧
    succ (Classical.choose (_ : ∃ b_1, ¬IsMax b_1 ∧ succ b_1 = succ b)) = succ b
⊢ HEq (_ : ¬IsMax (Classical.choose (_ : ∃ b_1, ¬IsMax b_1 ∧ succ b_1 = succ b))) hb
[PROOFSTEP]
first
| exact (succ_eq_succ_iff_of_not_isMax H.left hb).mp H.right
| exact proof_irrel_heq H.left hb
[GOAL]
case e_2
α : Type u_1
inst✝¹ : PartialOrder α
inst✝ : SuccOrder α
a b✝ : α
C : α → Sort u_2
hs : (a : α) → ¬IsMax a → C (succ a)
hl : (a : α) → IsSuccLimit a → C a
b : α
hb : ¬IsMax b
hb' : ¬IsSuccLimit (succ b)
H :
  ¬IsMax (Classical.choose (_ : ∃ b_1, ¬IsMax b_1 ∧ succ b_1 = succ b)) ∧
    succ (Classical.choose (_ : ∃ b_1, ¬IsMax b_1 ∧ succ b_1 = succ b)) = succ b
⊢ HEq (_ : ¬IsMax (Classical.choose (_ : ∃ b_1, ¬IsMax b_1 ∧ succ b_1 = succ b))) hb
[PROOFSTEP]
exact (succ_eq_succ_iff_of_not_isMax H.left hb).mp H.right
[GOAL]
case e_2
α : Type u_1
inst✝¹ : PartialOrder α
inst✝ : SuccOrder α
a b✝ : α
C : α → Sort u_2
hs : (a : α) → ¬IsMax a → C (succ a)
hl : (a : α) → IsSuccLimit a → C a
b : α
hb : ¬IsMax b
hb' : ¬IsSuccLimit (succ b)
H :
  ¬IsMax (Classical.choose (_ : ∃ b_1, ¬IsMax b_1 ∧ succ b_1 = succ b)) ∧
    succ (Classical.choose (_ : ∃ b_1, ¬IsMax b_1 ∧ succ b_1 = succ b)) = succ b
⊢ HEq (_ : ¬IsMax (Classical.choose (_ : ∃ b_1, ¬IsMax b_1 ∧ succ b_1 = succ b))) hb
[PROOFSTEP]
exact proof_irrel_heq H.left hb
[GOAL]
α : Type u_1
inst✝² : PartialOrder α
inst✝¹ : SuccOrder α
a b : α
C : α → Sort u_2
inst✝ : NoMaxOrder α
⊢ ¬IsSuccLimit a ↔ a ∈ range succ
[PROOFSTEP]
simp_rw [isSuccLimit_iff_succ_ne, not_forall, not_ne_iff]
[GOAL]
α : Type u_1
inst✝² : PartialOrder α
inst✝¹ : SuccOrder α
a b : α
C : α → Sort u_2
inst✝ : NoMaxOrder α
⊢ (∃ x, succ x = a) ↔ a ∈ range succ
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
inst✝² : PartialOrder α
inst✝¹ : SuccOrder α
a b✝ : α
C : α → Sort u_2
inst✝ : IsSuccArchimedean α
h : IsSuccLimit a
b : α
hb : b ≤ a
⊢ a ≤ b
[PROOFSTEP]
revert h
[GOAL]
α : Type u_1
inst✝² : PartialOrder α
inst✝¹ : SuccOrder α
a b✝ : α
C : α → Sort u_2
inst✝ : IsSuccArchimedean α
b : α
hb : b ≤ a
⊢ IsSuccLimit a → a ≤ b
[PROOFSTEP]
refine' Succ.rec (fun _ => le_rfl) (fun c _ H hc => _) hb
[GOAL]
α : Type u_1
inst✝² : PartialOrder α
inst✝¹ : SuccOrder α
a b✝ : α
C : α → Sort u_2
inst✝ : IsSuccArchimedean α
b : α
hb : b ≤ a
c : α
x✝ : b ≤ c
H : IsSuccLimit c → c ≤ b
hc : IsSuccLimit (succ c)
⊢ succ c ≤ b
[PROOFSTEP]
have := hc.isMax.succ_eq
[GOAL]
α : Type u_1
inst✝² : PartialOrder α
inst✝¹ : SuccOrder α
a b✝ : α
C : α → Sort u_2
inst✝ : IsSuccArchimedean α
b : α
hb : b ≤ a
c : α
x✝ : b ≤ c
H : IsSuccLimit c → c ≤ b
hc : IsSuccLimit (succ c)
this : succ c = c
⊢ succ c ≤ b
[PROOFSTEP]
rw [this] at hc ⊢
[GOAL]
α : Type u_1
inst✝² : PartialOrder α
inst✝¹ : SuccOrder α
a b✝ : α
C : α → Sort u_2
inst✝ : IsSuccArchimedean α
b : α
hb : b ≤ a
c : α
x✝ : b ≤ c
H : IsSuccLimit c → c ≤ b
hc : IsSuccLimit c
this : succ c = c
⊢ c ≤ b
[PROOFSTEP]
exact H hc
[GOAL]
α : Type u_1
inst✝³ : PartialOrder α
inst✝² : SuccOrder α
a b : α
C : α → Sort u_2
inst✝¹ : IsSuccArchimedean α
inst✝ : NoMinOrder α
⊢ ¬IsSuccLimit a
[PROOFSTEP]
simp
[GOAL]
α : Type u_1
inst✝ : LT α
a✝ a : α
⊢ ¬IsPredLimit a ↔ ∃ b, a ⋖ b
[PROOFSTEP]
simp [IsPredLimit]
[GOAL]
α : Type u_1
inst✝ : LT α
a : α
⊢ IsSuccLimit (↑toDual a) ↔ IsPredLimit a
[PROOFSTEP]
simp [IsSuccLimit, IsPredLimit]
[GOAL]
α : Type u_1
inst✝ : LT α
a : α
⊢ IsPredLimit (↑toDual a) ↔ IsSuccLimit a
[PROOFSTEP]
simp [IsSuccLimit, IsPredLimit]
[GOAL]
α : Type u_1
inst✝¹ : Preorder α
a : α
inst✝ : PredOrder α
h : IsPredLimit (pred a)
⊢ IsMin a
[PROOFSTEP]
by_contra H
[GOAL]
α : Type u_1
inst✝¹ : Preorder α
a : α
inst✝ : PredOrder α
h : IsPredLimit (pred a)
H : ¬IsMin a
⊢ False
[PROOFSTEP]
exact h a (pred_covby_of_not_isMin H)
[GOAL]
α : Type u_1
inst✝¹ : Preorder α
a : α
inst✝ : PredOrder α
ha : ¬IsMin a
⊢ ¬IsPredLimit (pred a)
[PROOFSTEP]
contrapose! ha
[GOAL]
α : Type u_1
inst✝¹ : Preorder α
a : α
inst✝ : PredOrder α
ha : IsPredLimit (pred a)
⊢ IsMin a
[PROOFSTEP]
exact ha.isMin
[GOAL]
α : Type u_1
inst✝² : Preorder α
a : α
inst✝¹ : PredOrder α
inst✝ : NoMinOrder α
h : IsPredLimit a
b : α
⊢ pred b ≠ a
[PROOFSTEP]
rintro rfl
[GOAL]
α : Type u_1
inst✝² : Preorder α
inst✝¹ : PredOrder α
inst✝ : NoMinOrder α
b : α
h : IsPredLimit (pred b)
⊢ False
[PROOFSTEP]
exact not_isMin _ h.isMin
[GOAL]
α : Type u_1
inst✝⁴ : Preorder α
a : α
inst✝³ : PredOrder α
inst✝² : IsPredArchimedean α
inst✝¹ : NoMinOrder α
inst✝ : NoMaxOrder α
⊢ ¬IsPredLimit a
[PROOFSTEP]
simp
[GOAL]
α : Type u_1
inst✝¹ : PartialOrder α
inst✝ : PredOrder α
a b : α
C : α → Sort u_2
⊢ ¬IsPredLimit a ↔ ∃ b, ¬IsMin b ∧ pred b = a
[PROOFSTEP]
rw [← isSuccLimit_toDual_iff]
[GOAL]
α : Type u_1
inst✝¹ : PartialOrder α
inst✝ : PredOrder α
a b : α
C : α → Sort u_2
⊢ ¬IsSuccLimit (↑toDual a) ↔ ∃ b, ¬IsMin b ∧ pred b = a
[PROOFSTEP]
exact not_isSuccLimit_iff
[GOAL]
α : Type u_1
inst✝¹ : PartialOrder α
inst✝ : PredOrder α
a b : α
C : α → Sort u_2
h : ¬IsPredLimit a
⊢ a ∈ range pred
[PROOFSTEP]
cases' not_isPredLimit_iff.1 h with b hb
[GOAL]
case intro
α : Type u_1
inst✝¹ : PartialOrder α
inst✝ : PredOrder α
a b✝ : α
C : α → Sort u_2
h : ¬IsPredLimit a
b : α
hb : ¬IsMin b ∧ pred b = a
⊢ a ∈ range pred
[PROOFSTEP]
exact ⟨b, hb.2⟩
[GOAL]
α : Type u_1
inst✝³ : PartialOrder α
inst✝² : PredOrder α
a b : α
C : α → Sort u_2
inst✝¹ : IsPredArchimedean α
inst✝ : NoMaxOrder α
⊢ ¬IsPredLimit a
[PROOFSTEP]
simp