[GOAL]
l : Type u_1
R : Type u_2
inst✝¹ : DecidableEq l
inst✝ : CommRing R
⊢ (J l R)ᵀ = -J l R
[PROOFSTEP]
rw [J, fromBlocks_transpose, ← neg_one_smul R (fromBlocks _ _ _ _ : Matrix (l ⊕ l) (l ⊕ l) R), fromBlocks_smul,
  Matrix.transpose_zero, Matrix.transpose_one, transpose_neg]
[GOAL]
l : Type u_1
R : Type u_2
inst✝¹ : DecidableEq l
inst✝ : CommRing R
⊢ fromBlocks 0 1 (-1ᵀ) 0 = fromBlocks (-1 • 0) (-1 • -1) (-1 • 1) (-1 • 0)
[PROOFSTEP]
simp [fromBlocks]
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : CommRing R
inst✝ : Fintype l
⊢ J l R * J l R = -1
[PROOFSTEP]
rw [J, fromBlocks_multiply]
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : CommRing R
inst✝ : Fintype l
⊢ fromBlocks (0 * 0 + -1 * 1) (0 * -1 + -1 * 0) (1 * 0 + 0 * 1) (1 * -1 + 0 * 0) = -1
[PROOFSTEP]
simp only [Matrix.zero_mul, Matrix.neg_mul, zero_add, neg_zero, Matrix.one_mul, add_zero]
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : CommRing R
inst✝ : Fintype l
⊢ fromBlocks (-1) 0 0 (-1) = -1
[PROOFSTEP]
rw [← neg_zero, ← Matrix.fromBlocks_neg, ← fromBlocks_one]
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : CommRing R
inst✝ : Fintype l
⊢ (J l R)⁻¹ = -J l R
[PROOFSTEP]
refine' Matrix.inv_eq_right_inv _
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : CommRing R
inst✝ : Fintype l
⊢ J l R * -J l R = 1
[PROOFSTEP]
rw [Matrix.mul_neg, J_squared]
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : CommRing R
inst✝ : Fintype l
⊢ - -1 = 1
[PROOFSTEP]
exact neg_neg 1
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : CommRing R
inst✝ : Fintype l
⊢ det (J l R) * det (J l R) = 1
[PROOFSTEP]
rw [← det_mul, J_squared, ← one_smul R (-1 : Matrix _ _ R), smul_neg, ← neg_smul, det_smul, Fintype.card_sum, det_one,
  mul_one]
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : CommRing R
inst✝ : Fintype l
⊢ (-1) ^ (Fintype.card l + Fintype.card l) = 1
[PROOFSTEP]
apply Even.neg_one_pow
[GOAL]
case h
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : CommRing R
inst✝ : Fintype l
⊢ Even (Fintype.card l + Fintype.card l)
[PROOFSTEP]
exact even_add_self _
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : CommRing R
inst✝ : Fintype l
a b : Matrix (l ⊕ l) (l ⊕ l) R
ha : a ∈ {A | A * J l R * Aᵀ = J l R}
hb : b ∈ {A | A * J l R * Aᵀ = J l R}
⊢ a * b ∈ {A | A * J l R * Aᵀ = J l R}
[PROOFSTEP]
simp only [Set.mem_setOf_eq, transpose_mul] at *
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : CommRing R
inst✝ : Fintype l
a b : Matrix (l ⊕ l) (l ⊕ l) R
ha : a * J l R * aᵀ = J l R
hb : b * J l R * bᵀ = J l R
⊢ a * b * J l R * (bᵀ * aᵀ) = J l R
[PROOFSTEP]
rw [← Matrix.mul_assoc, a.mul_assoc, a.mul_assoc, hb]
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : CommRing R
inst✝ : Fintype l
a b : Matrix (l ⊕ l) (l ⊕ l) R
ha : a * J l R * aᵀ = J l R
hb : b * J l R * bᵀ = J l R
⊢ a * J l R * aᵀ = J l R
[PROOFSTEP]
exact ha
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : CommRing R
inst✝ : Fintype l
⊢ 1 ∈
    { carrier := {A | A * J l R * Aᵀ = J l R},
        mul_mem' :=
          (_ :
            ∀ {a b : Matrix (l ⊕ l) (l ⊕ l) R},
              a ∈ {A | A * J l R * Aᵀ = J l R} →
                b ∈ {A | A * J l R * Aᵀ = J l R} → a * b ∈ {A | A * J l R * Aᵀ = J l R}) }.carrier
[PROOFSTEP]
simp
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A : Matrix (l ⊕ l) (l ⊕ l) R
⊢ A ∈ symplecticGroup l R ↔ A * J l R * Aᵀ = J l R
[PROOFSTEP]
simp [symplecticGroup]
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
⊢ J l R ∈ symplecticGroup l R
[PROOFSTEP]
rw [mem_iff, J, fromBlocks_multiply, fromBlocks_transpose, fromBlocks_multiply]
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
⊢ fromBlocks ((0 * 0 + -1 * 1) * 0ᵀ + (0 * -1 + -1 * 0) * (-1)ᵀ) ((0 * 0 + -1 * 1) * 1ᵀ + (0 * -1 + -1 * 0) * 0ᵀ)
      ((1 * 0 + 0 * 1) * 0ᵀ + (1 * -1 + 0 * 0) * (-1)ᵀ) ((1 * 0 + 0 * 1) * 1ᵀ + (1 * -1 + 0 * 0) * 0ᵀ) =
    fromBlocks 0 (-1) 1 0
[PROOFSTEP]
simp
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A : Matrix (l ⊕ l) (l ⊕ l) R
h : A ∈ symplecticGroup l R
⊢ -A ∈ symplecticGroup l R
[PROOFSTEP]
rw [mem_iff] at h ⊢
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A : Matrix (l ⊕ l) (l ⊕ l) R
h : A * J l R * Aᵀ = J l R
⊢ -A * J l R * (-A)ᵀ = J l R
[PROOFSTEP]
simp [h]
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A : Matrix (l ⊕ l) (l ⊕ l) R
hA : A ∈ symplecticGroup l R
⊢ IsUnit (det A)
[PROOFSTEP]
rw [isUnit_iff_exists_inv]
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A : Matrix (l ⊕ l) (l ⊕ l) R
hA : A ∈ symplecticGroup l R
⊢ ∃ b, det A * b = 1
[PROOFSTEP]
use A.det
[GOAL]
case h
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A : Matrix (l ⊕ l) (l ⊕ l) R
hA : A ∈ symplecticGroup l R
⊢ det A * det A = 1
[PROOFSTEP]
refine' (isUnit_det_J l R).mul_left_cancel _
[GOAL]
case h
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A : Matrix (l ⊕ l) (l ⊕ l) R
hA : A ∈ symplecticGroup l R
⊢ det (J l R) * (det A * det A) = det (J l R) * 1
[PROOFSTEP]
rw [mul_one]
[GOAL]
case h
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A : Matrix (l ⊕ l) (l ⊕ l) R
hA : A ∈ symplecticGroup l R
⊢ det (J l R) * (det A * det A) = det (J l R)
[PROOFSTEP]
rw [mem_iff] at hA
[GOAL]
case h
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A : Matrix (l ⊕ l) (l ⊕ l) R
hA : A * J l R * Aᵀ = J l R
⊢ det (J l R) * (det A * det A) = det (J l R)
[PROOFSTEP]
apply_fun det at hA
[GOAL]
case h
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A : Matrix (l ⊕ l) (l ⊕ l) R
hA : det (A * J l R * Aᵀ) = det (J l R)
⊢ det (J l R) * (det A * det A) = det (J l R)
[PROOFSTEP]
simp only [det_mul, det_transpose] at hA
[GOAL]
case h
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A : Matrix (l ⊕ l) (l ⊕ l) R
hA : det A * det (J l R) * det A = det (J l R)
⊢ det (J l R) * (det A * det A) = det (J l R)
[PROOFSTEP]
rw [mul_comm A.det, mul_assoc] at hA
[GOAL]
case h
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A : Matrix (l ⊕ l) (l ⊕ l) R
hA : det (J l R) * (det A * det A) = det (J l R)
⊢ det (J l R) * (det A * det A) = det (J l R)
[PROOFSTEP]
exact hA
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A : Matrix (l ⊕ l) (l ⊕ l) R
hA : A ∈ symplecticGroup l R
⊢ Aᵀ ∈ symplecticGroup l R
[PROOFSTEP]
rw [mem_iff] at hA ⊢
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A : Matrix (l ⊕ l) (l ⊕ l) R
hA : A * J l R * Aᵀ = J l R
⊢ Aᵀ * J l R * Aᵀᵀ = J l R
[PROOFSTEP]
rw [transpose_transpose]
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A : Matrix (l ⊕ l) (l ⊕ l) R
hA : A * J l R * Aᵀ = J l R
⊢ Aᵀ * J l R * A = J l R
[PROOFSTEP]
have huA := symplectic_det hA
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A : Matrix (l ⊕ l) (l ⊕ l) R
hA : A * J l R * Aᵀ = J l R
huA : IsUnit (det A)
⊢ Aᵀ * J l R * A = J l R
[PROOFSTEP]
have huAT : IsUnit Aᵀ.det := by
  rw [Matrix.det_transpose]
  exact huA
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A : Matrix (l ⊕ l) (l ⊕ l) R
hA : A * J l R * Aᵀ = J l R
huA : IsUnit (det A)
⊢ IsUnit (det Aᵀ)
[PROOFSTEP]
rw [Matrix.det_transpose]
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A : Matrix (l ⊕ l) (l ⊕ l) R
hA : A * J l R * Aᵀ = J l R
huA : IsUnit (det A)
⊢ IsUnit (det A)
[PROOFSTEP]
exact huA
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A : Matrix (l ⊕ l) (l ⊕ l) R
hA : A * J l R * Aᵀ = J l R
huA : IsUnit (det A)
huAT : IsUnit (det Aᵀ)
⊢ Aᵀ * J l R * A = J l R
[PROOFSTEP]
calc
  Aᵀ * J l R * A = (-Aᵀ) * (J l R)⁻¹ * A := by
    rw [J_inv]
    simp
  _ = (-Aᵀ) * (A * J l R * Aᵀ)⁻¹ * A := by rw [hA]
  _ = -(Aᵀ * (Aᵀ⁻¹ * (J l R)⁻¹)) * A⁻¹ * A := by simp only [Matrix.mul_inv_rev, Matrix.mul_assoc, Matrix.neg_mul]
  _ = -(J l R)⁻¹ := by rw [mul_nonsing_inv_cancel_left _ _ huAT, nonsing_inv_mul_cancel_right _ _ huA]
  _ = J l R := by simp [J_inv]
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A : Matrix (l ⊕ l) (l ⊕ l) R
hA : A * J l R * Aᵀ = J l R
huA : IsUnit (det A)
huAT : IsUnit (det Aᵀ)
⊢ Aᵀ * J l R * A = -Aᵀ * (J l R)⁻¹ * A
[PROOFSTEP]
rw [J_inv]
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A : Matrix (l ⊕ l) (l ⊕ l) R
hA : A * J l R * Aᵀ = J l R
huA : IsUnit (det A)
huAT : IsUnit (det Aᵀ)
⊢ Aᵀ * J l R * A = -Aᵀ * -J l R * A
[PROOFSTEP]
simp
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A : Matrix (l ⊕ l) (l ⊕ l) R
hA : A * J l R * Aᵀ = J l R
huA : IsUnit (det A)
huAT : IsUnit (det Aᵀ)
⊢ -Aᵀ * (J l R)⁻¹ * A = -Aᵀ * (A * J l R * Aᵀ)⁻¹ * A
[PROOFSTEP]
rw [hA]
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A : Matrix (l ⊕ l) (l ⊕ l) R
hA : A * J l R * Aᵀ = J l R
huA : IsUnit (det A)
huAT : IsUnit (det Aᵀ)
⊢ -Aᵀ * (A * J l R * Aᵀ)⁻¹ * A = -(Aᵀ * (Aᵀ⁻¹ * (J l R)⁻¹)) * A⁻¹ * A
[PROOFSTEP]
simp only [Matrix.mul_inv_rev, Matrix.mul_assoc, Matrix.neg_mul]
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A : Matrix (l ⊕ l) (l ⊕ l) R
hA : A * J l R * Aᵀ = J l R
huA : IsUnit (det A)
huAT : IsUnit (det Aᵀ)
⊢ -(Aᵀ * (Aᵀ⁻¹ * (J l R)⁻¹)) * A⁻¹ * A = -(J l R)⁻¹
[PROOFSTEP]
rw [mul_nonsing_inv_cancel_left _ _ huAT, nonsing_inv_mul_cancel_right _ _ huA]
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A : Matrix (l ⊕ l) (l ⊕ l) R
hA : A * J l R * Aᵀ = J l R
huA : IsUnit (det A)
huAT : IsUnit (det Aᵀ)
⊢ -(J l R)⁻¹ = J l R
[PROOFSTEP]
simp [J_inv]
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A : Matrix (l ⊕ l) (l ⊕ l) R
hA : Aᵀ ∈ symplecticGroup l R
⊢ A ∈ symplecticGroup l R
[PROOFSTEP]
simpa using transpose_mem hA
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A : Matrix (l ⊕ l) (l ⊕ l) R
⊢ A ∈ symplecticGroup l R ↔ Aᵀ * J l R * A = J l R
[PROOFSTEP]
rw [← transpose_mem_iff, mem_iff, transpose_transpose]
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A : Matrix (l ⊕ l) (l ⊕ l) R
hA : A ∈ symplecticGroup l R
⊢ -(J l R * Aᵀ * J l R * A) = -J l R * (Aᵀ * J l R * A)
[PROOFSTEP]
simp only [Matrix.mul_assoc, Matrix.neg_mul]
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A : Matrix (l ⊕ l) (l ⊕ l) R
hA : A ∈ symplecticGroup l R
⊢ -J l R * (Aᵀ * J l R * A) = -J l R * J l R
[PROOFSTEP]
rw [mem_iff'] at hA
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A : Matrix (l ⊕ l) (l ⊕ l) R
hA : Aᵀ * J l R * A = J l R
⊢ -J l R * (Aᵀ * J l R * A) = -J l R * J l R
[PROOFSTEP]
rw [hA]
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A : Matrix (l ⊕ l) (l ⊕ l) R
hA : A ∈ symplecticGroup l R
⊢ -J l R * J l R = -1 • (J l R * J l R)
[PROOFSTEP]
simp only [Matrix.neg_mul, neg_smul, one_smul]
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A : Matrix (l ⊕ l) (l ⊕ l) R
hA : A ∈ symplecticGroup l R
⊢ -1 • (J l R * J l R) = -1 • -1
[PROOFSTEP]
rw [J_squared]
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A : Matrix (l ⊕ l) (l ⊕ l) R
hA : A ∈ symplecticGroup l R
⊢ -1 • -1 = 1
[PROOFSTEP]
simp only [neg_smul_neg, one_smul]
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A✝ : Matrix (l ⊕ l) (l ⊕ l) R
A : { x // x ∈ symplecticGroup l R }
⊢ ↑A⁻¹ = (↑A)⁻¹
[PROOFSTEP]
refine' (coe_inv A).trans (inv_eq_left_inv _).symm
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A✝ : Matrix (l ⊕ l) (l ⊕ l) R
A : { x // x ∈ symplecticGroup l R }
⊢ -J l R * (↑A)ᵀ * J l R * ↑A = 1
[PROOFSTEP]
simp [inv_left_mul_aux, coe_inv]
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A✝ A : Matrix (l ⊕ l) (l ⊕ l) R
hA : A ∈ symplecticGroup l R
⊢ -J l R * Aᵀ * J l R * A = 1
[PROOFSTEP]
simp only [Matrix.neg_mul, inv_left_mul_aux hA]
[GOAL]
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A✝ : Matrix (l ⊕ l) (l ⊕ l) R
src✝¹ : Inv { x // x ∈ symplecticGroup l R } := hasInv
src✝ : Monoid { x // x ∈ symplecticGroup l R } := Submonoid.toMonoid (symplecticGroup l R)
A : { x // x ∈ symplecticGroup l R }
⊢ A⁻¹ * A = 1
[PROOFSTEP]
apply Subtype.ext
[GOAL]
case a
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A✝ : Matrix (l ⊕ l) (l ⊕ l) R
src✝¹ : Inv { x // x ∈ symplecticGroup l R } := hasInv
src✝ : Monoid { x // x ∈ symplecticGroup l R } := Submonoid.toMonoid (symplecticGroup l R)
A : { x // x ∈ symplecticGroup l R }
⊢ ↑(A⁻¹ * A) = ↑1
[PROOFSTEP]
simp only [Submonoid.coe_one, Submonoid.coe_mul, Matrix.neg_mul, coe_inv]
[GOAL]
case a
l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A✝ : Matrix (l ⊕ l) (l ⊕ l) R
src✝¹ : Inv { x // x ∈ symplecticGroup l R } := hasInv
src✝ : Monoid { x // x ∈ symplecticGroup l R } := Submonoid.toMonoid (symplecticGroup l R)
A : { x // x ∈ symplecticGroup l R }
⊢ -(J l R * (↑A)ᵀ * J l R * ↑A) = 1
[PROOFSTEP]
exact inv_left_mul_aux A.2


[GOAL]
x : ℂ
h : cos x ≠ 0
⊢ HasStrictDerivAt tan (↑1 / cos x ^ 2) x
[PROOFSTEP]
convert (hasStrictDerivAt_sin x).div (hasStrictDerivAt_cos x) h using 1
[GOAL]
case h.e'_7
x : ℂ
h : cos x ≠ 0
⊢ ↑1 / cos x ^ 2 = (cos x * cos x - sin x * -sin x) / cos x ^ 2
[PROOFSTEP]
rw_mod_cast [← sin_sq_add_cos_sq x]
[GOAL]
case h.e'_7
x : ℂ
h : ¬cos x = 0
⊢ (sin x ^ 2 + cos x ^ 2) / cos x ^ 2 = (cos x * cos x - sin x * -sin x) / cos x ^ 2
[PROOFSTEP]
ring
[GOAL]
x : ℂ
hx : cos x = 0
⊢ Tendsto (fun x => ↑abs (tan x)) (𝓝[{x}ᶜ] x) atTop
[PROOFSTEP]
simp only [tan_eq_sin_div_cos, ← norm_eq_abs, norm_div]
[GOAL]
x : ℂ
hx : cos x = 0
⊢ Tendsto (fun x => ‖sin x‖ / ‖cos x‖) (𝓝[{x}ᶜ] x) atTop
[PROOFSTEP]
have A : sin x ≠ 0 := fun h => by simpa [*, sq] using sin_sq_add_cos_sq x
[GOAL]
x : ℂ
hx : cos x = 0
h : sin x = 0
⊢ False
[PROOFSTEP]
simpa [*, sq] using sin_sq_add_cos_sq x
[GOAL]
x : ℂ
hx : cos x = 0
A : sin x ≠ 0
⊢ Tendsto (fun x => ‖sin x‖ / ‖cos x‖) (𝓝[{x}ᶜ] x) atTop
[PROOFSTEP]
have B : Tendsto cos (𝓝[≠] x) (𝓝[≠] 0) := hx ▸ (hasDerivAt_cos x).tendsto_punctured_nhds (neg_ne_zero.2 A)
[GOAL]
x : ℂ
hx : cos x = 0
A : sin x ≠ 0
B : Tendsto cos (𝓝[{x}ᶜ] x) (𝓝[{0}ᶜ] 0)
⊢ Tendsto (fun x => ‖sin x‖ / ‖cos x‖) (𝓝[{x}ᶜ] x) atTop
[PROOFSTEP]
exact
  continuous_sin.continuousWithinAt.norm.mul_atTop (norm_pos_iff.2 A)
    (tendsto_norm_nhdsWithin_zero.comp B).inv_tendsto_zero
[GOAL]
x : ℂ
⊢ ContinuousAt tan x ↔ cos x ≠ 0
[PROOFSTEP]
refine' ⟨fun hc h₀ => _, fun h => (hasDerivAt_tan h).continuousAt⟩
[GOAL]
x : ℂ
hc : ContinuousAt tan x
h₀ : cos x = 0
⊢ False
[PROOFSTEP]
exact not_tendsto_nhds_of_tendsto_atTop (tendsto_abs_tan_of_cos_eq_zero h₀) _ (hc.norm.tendsto.mono_left inf_le_left)
[GOAL]
x : ℂ
h : cos x = 0
⊢ deriv tan x = ↑1 / cos x ^ 2
[PROOFSTEP]
have : ¬DifferentiableAt ℂ tan x := mt differentiableAt_tan.1 (Classical.not_not.2 h)
[GOAL]
x : ℂ
h : cos x = 0
this : ¬DifferentiableAt ℂ tan x
⊢ deriv tan x = ↑1 / cos x ^ 2
[PROOFSTEP]
simp [deriv_zero_of_not_differentiableAt this, h, sq]


[GOAL]
α : Type u_1
inst✝² : CanonicallyLinearOrderedSemifield α
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c : α
⊢ (a - b) / c = a / c - b / c
[PROOFSTEP]
simp_rw [div_eq_mul_inv, tsub_mul]


[GOAL]
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s✝ t s : Set H
c : ℝ
hc : 0 < c
y : H
hy : y ∈ {y | ∀ (x : H), x ∈ s → 0 ≤ inner x y}
x : H
hx : x ∈ s
⊢ 0 ≤ inner x (c • y)
[PROOFSTEP]
rw [real_inner_smul_right]
[GOAL]
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s✝ t s : Set H
c : ℝ
hc : 0 < c
y : H
hy : y ∈ {y | ∀ (x : H), x ∈ s → 0 ≤ inner x y}
x : H
hx : x ∈ s
⊢ 0 ≤ c * inner x y
[PROOFSTEP]
exact mul_nonneg hc.le (hy x hx)
[GOAL]
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s✝ t s : Set H
u : H
hu : u ∈ {y | ∀ (x : H), x ∈ s → 0 ≤ inner x y}
v : H
hv : v ∈ {y | ∀ (x : H), x ∈ s → 0 ≤ inner x y}
x : H
hx : x ∈ s
⊢ 0 ≤ inner x (u + v)
[PROOFSTEP]
rw [inner_add_right]
[GOAL]
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s✝ t s : Set H
u : H
hu : u ∈ {y | ∀ (x : H), x ∈ s → 0 ≤ inner x y}
v : H
hv : v ∈ {y | ∀ (x : H), x ∈ s → 0 ≤ inner x y}
x : H
hx : x ∈ s
⊢ 0 ≤ inner x u + inner x v
[PROOFSTEP]
exact add_nonneg (hu x hx) (hv x hx)
[GOAL]
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s t : Set H
⊢ innerDualCone univ = 0
[PROOFSTEP]
suffices ∀ x : H, x ∈ (univ : Set H).innerDualCone → x = 0
  by
  apply SetLike.coe_injective
  exact eq_singleton_iff_unique_mem.mpr ⟨fun x _ => (inner_zero_right _).ge, this⟩
[GOAL]
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s t : Set H
this : ∀ (x : H), x ∈ innerDualCone univ → x = 0
⊢ innerDualCone univ = 0
[PROOFSTEP]
apply SetLike.coe_injective
[GOAL]
case a
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s t : Set H
this : ∀ (x : H), x ∈ innerDualCone univ → x = 0
⊢ ↑(innerDualCone univ) = ↑0
[PROOFSTEP]
exact eq_singleton_iff_unique_mem.mpr ⟨fun x _ => (inner_zero_right _).ge, this⟩
[GOAL]
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s t : Set H
⊢ ∀ (x : H), x ∈ innerDualCone univ → x = 0
[PROOFSTEP]
exact fun x hx => by simpa [← real_inner_self_nonpos] using hx (-x) (mem_univ _)
[GOAL]
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s t : Set H
x : H
hx : x ∈ innerDualCone univ
⊢ x = 0
[PROOFSTEP]
simpa [← real_inner_self_nonpos] using hx (-x) (mem_univ _)
[GOAL]
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s t : Set H
x : H
x✝ : x ∈ s
⊢ 0 ≤ inner x 0
[PROOFSTEP]
rw [inner_zero_right]
[GOAL]
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s✝ t : Set H
x : H
s : Set H
⊢ innerDualCone (insert x s) = innerDualCone {x} ⊓ innerDualCone s
[PROOFSTEP]
rw [insert_eq, innerDualCone_union]
[GOAL]
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s t : Set H
ι : Sort u_6
f : ι → Set H
⊢ innerDualCone (⋃ (i : ι), f i) = ⨅ (i : ι), innerDualCone (f i)
[PROOFSTEP]
refine' le_antisymm (le_iInf fun i x hx y hy => hx _ <| mem_iUnion_of_mem _ hy) _
[GOAL]
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s t : Set H
ι : Sort u_6
f : ι → Set H
⊢ ⨅ (i : ι), innerDualCone (f i) ≤ innerDualCone (⋃ (i : ι), f i)
[PROOFSTEP]
intro x hx y hy
[GOAL]
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s t : Set H
ι : Sort u_6
f : ι → Set H
x : H
hx : x ∈ ⨅ (i : ι), innerDualCone (f i)
y : H
hy : y ∈ ⋃ (i : ι), f i
⊢ 0 ≤ inner y x
[PROOFSTEP]
rw [ConvexCone.mem_iInf] at hx
[GOAL]
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s t : Set H
ι : Sort u_6
f : ι → Set H
x : H
hx : ∀ (i : ι), x ∈ innerDualCone (f i)
y : H
hy : y ∈ ⋃ (i : ι), f i
⊢ 0 ≤ inner y x
[PROOFSTEP]
obtain ⟨j, hj⟩ := mem_iUnion.mp hy
[GOAL]
case intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s t : Set H
ι : Sort u_6
f : ι → Set H
x : H
hx : ∀ (i : ι), x ∈ innerDualCone (f i)
y : H
hy : y ∈ ⋃ (i : ι), f i
j : ι
hj : y ∈ f j
⊢ 0 ≤ inner y x
[PROOFSTEP]
exact hx _ _ hj
[GOAL]
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s t : Set H
S : Set (Set H)
⊢ innerDualCone (⋃₀ S) = sInf (innerDualCone '' S)
[PROOFSTEP]
simp_rw [sInf_image, sUnion_eq_biUnion, innerDualCone_iUnion]
[GOAL]
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s t : Set H
⊢ ↑(innerDualCone s) = ⋂ (i : ↑s), ↑(innerDualCone {↑i})
[PROOFSTEP]
rw [← ConvexCone.coe_iInf, ← innerDualCone_iUnion, iUnion_of_singleton_coe]
[GOAL]
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s t : Set H
⊢ IsClosed ↑(innerDualCone s)
[PROOFSTEP]
rw [innerDualCone_eq_iInter_innerDualCone_singleton]
[GOAL]
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s t : Set H
⊢ IsClosed (⋂ (i : ↑s), ↑(innerDualCone {↑i}))
[PROOFSTEP]
apply isClosed_iInter
[GOAL]
case h
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s t : Set H
⊢ ∀ (i : ↑s), IsClosed ↑(innerDualCone {↑i})
[PROOFSTEP]
intro x
[GOAL]
case h
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s t : Set H
x : ↑s
⊢ IsClosed ↑(innerDualCone {↑x})
[PROOFSTEP]
have h : ({↑x} : Set H).innerDualCone = (inner x : H → ℝ) ⁻¹' Set.Ici 0 := by
  rw [innerDualCone_singleton, ConvexCone.coe_comap, ConvexCone.coe_positive, innerₛₗ_apply_coe]
    -- the preimage is closed as `inner x` is continuous and `[0, ∞)` is closed
[GOAL]
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s t : Set H
x : ↑s
⊢ ↑(innerDualCone {↑x}) = inner ↑x ⁻¹' Ici 0
[PROOFSTEP]
rw [innerDualCone_singleton, ConvexCone.coe_comap, ConvexCone.coe_positive, innerₛₗ_apply_coe]
  -- the preimage is closed as `inner x` is continuous and `[0, ∞)` is closed
[GOAL]
case h
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s t : Set H
x : ↑s
h : ↑(innerDualCone {↑x}) = inner ↑x ⁻¹' Ici 0
⊢ IsClosed ↑(innerDualCone {↑x})
[PROOFSTEP]
rw [h]
[GOAL]
case h
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s t : Set H
x : ↑s
h : ↑(innerDualCone {↑x}) = inner ↑x ⁻¹' Ici 0
⊢ IsClosed (inner ↑x ⁻¹' Ici 0)
[PROOFSTEP]
exact isClosed_Ici.preimage (continuous_const.inner continuous_id')
[GOAL]
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s t : Set H
K : ConvexCone ℝ H
ne : Set.Nonempty ↑K
hc : IsClosed ↑K
⊢ Pointed K
[PROOFSTEP]
obtain ⟨x, hx⟩ := ne
[GOAL]
case intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s t : Set H
K : ConvexCone ℝ H
hc : IsClosed ↑K
x : H
hx : x ∈ ↑K
⊢ Pointed K
[PROOFSTEP]
let f : ℝ → H :=
  (· • x)
    -- f (0, ∞) is a subset of K
[GOAL]
case intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s t : Set H
K : ConvexCone ℝ H
hc : IsClosed ↑K
x : H
hx : x ∈ ↑K
f : ℝ → H := fun x_1 => x_1 • x
⊢ Pointed K
[PROOFSTEP]
have fI : f '' Set.Ioi 0 ⊆ (K : Set H) := by
  rintro _ ⟨_, h, rfl⟩
  exact K.smul_mem (Set.mem_Ioi.1 h) hx
[GOAL]
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s t : Set H
K : ConvexCone ℝ H
hc : IsClosed ↑K
x : H
hx : x ∈ ↑K
f : ℝ → H := fun x_1 => x_1 • x
⊢ f '' Ioi 0 ⊆ ↑K
[PROOFSTEP]
rintro _ ⟨_, h, rfl⟩
[GOAL]
case intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s t : Set H
K : ConvexCone ℝ H
hc : IsClosed ↑K
x : H
hx : x ∈ ↑K
f : ℝ → H := fun x_1 => x_1 • x
w✝ : ℝ
h : w✝ ∈ Ioi 0
⊢ f w✝ ∈ ↑K
[PROOFSTEP]
exact K.smul_mem (Set.mem_Ioi.1 h) hx
[GOAL]
case intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s t : Set H
K : ConvexCone ℝ H
hc : IsClosed ↑K
x : H
hx : x ∈ ↑K
f : ℝ → H := fun x_1 => x_1 • x
fI : f '' Ioi 0 ⊆ ↑K
⊢ Pointed K
[PROOFSTEP]
have clf : closure (f '' Set.Ioi 0) ⊆ (K : Set H) := hc.closure_subset_iff.2 fI
[GOAL]
case intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s t : Set H
K : ConvexCone ℝ H
hc : IsClosed ↑K
x : H
hx : x ∈ ↑K
f : ℝ → H := fun x_1 => x_1 • x
fI : f '' Ioi 0 ⊆ ↑K
clf : closure (f '' Ioi 0) ⊆ ↑K
⊢ Pointed K
[PROOFSTEP]
have fc : ContinuousWithinAt f (Set.Ioi (0 : ℝ)) 0 := (continuous_id.smul continuous_const).continuousWithinAt
[GOAL]
case intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s t : Set H
K : ConvexCone ℝ H
hc : IsClosed ↑K
x : H
hx : x ∈ ↑K
f : ℝ → H := fun x_1 => x_1 • x
fI : f '' Ioi 0 ⊆ ↑K
clf : closure (f '' Ioi 0) ⊆ ↑K
fc : ContinuousWithinAt f (Ioi 0) 0
⊢ Pointed K
[PROOFSTEP]
have mem₀ :=
  fc.mem_closure_image
    (by rw [closure_Ioi (0 : ℝ), mem_Ici])
      -- as 0 ∈ closure f (0, ∞) and closure f (0, ∞) ⊆ K, 0 ∈ K.
[GOAL]
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s t : Set H
K : ConvexCone ℝ H
hc : IsClosed ↑K
x : H
hx : x ∈ ↑K
f : ℝ → H := fun x_1 => x_1 • x
fI : f '' Ioi 0 ⊆ ↑K
clf : closure (f '' Ioi 0) ⊆ ↑K
fc : ContinuousWithinAt f (Ioi 0) 0
⊢ 0 ∈ closure (Ioi 0)
[PROOFSTEP]
rw [closure_Ioi (0 : ℝ), mem_Ici]
[GOAL]
case intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s t : Set H
K : ConvexCone ℝ H
hc : IsClosed ↑K
x : H
hx : x ∈ ↑K
f : ℝ → H := fun x_1 => x_1 • x
fI : f '' Ioi 0 ⊆ ↑K
clf : closure (f '' Ioi 0) ⊆ ↑K
fc : ContinuousWithinAt f (Ioi 0) 0
mem₀ : f 0 ∈ closure (f '' Ioi 0)
⊢ Pointed K
[PROOFSTEP]
have f₀ : f 0 = 0 := zero_smul ℝ x
[GOAL]
case intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝¹ : NormedAddCommGroup H
inst✝ : InnerProductSpace ℝ H
s t : Set H
K : ConvexCone ℝ H
hc : IsClosed ↑K
x : H
hx : x ∈ ↑K
f : ℝ → H := fun x_1 => x_1 • x
fI : f '' Ioi 0 ⊆ ↑K
clf : closure (f '' Ioi 0) ⊆ ↑K
fc : ContinuousWithinAt f (Ioi 0) 0
mem₀ : f 0 ∈ closure (f '' Ioi 0)
f₀ : f 0 = 0
⊢ Pointed K
[PROOFSTEP]
simpa only [f₀, ConvexCone.Pointed, ← SetLike.mem_coe] using mem_of_subset_of_mem clf mem₀
[GOAL]
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝² : NormedAddCommGroup H
inst✝¹ : InnerProductSpace ℝ H
s t : Set H
inst✝ : CompleteSpace H
K : ConvexCone ℝ H
ne : Set.Nonempty ↑K
hc : IsClosed ↑K
b : H
disj : ¬b ∈ K
⊢ ∃ y, (∀ (x : H), x ∈ K → 0 ≤ inner x y) ∧ inner y b < 0
[PROOFSTEP]
obtain ⟨z, hzK, infi⟩ := exists_norm_eq_iInf_of_complete_convex ne hc.isComplete K.convex b
[GOAL]
case intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝² : NormedAddCommGroup H
inst✝¹ : InnerProductSpace ℝ H
s t : Set H
inst✝ : CompleteSpace H
K : ConvexCone ℝ H
ne : Set.Nonempty ↑K
hc : IsClosed ↑K
b : H
disj : ¬b ∈ K
z : H
hzK : z ∈ ↑K
infi : ‖b - z‖ = ⨅ (w : ↑↑K), ‖b - ↑w‖
⊢ ∃ y, (∀ (x : H), x ∈ K → 0 ≤ inner x y) ∧ inner y b < 0
[PROOFSTEP]
have hinner := (norm_eq_iInf_iff_real_inner_le_zero K.convex hzK).1 infi
[GOAL]
case intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝² : NormedAddCommGroup H
inst✝¹ : InnerProductSpace ℝ H
s t : Set H
inst✝ : CompleteSpace H
K : ConvexCone ℝ H
ne : Set.Nonempty ↑K
hc : IsClosed ↑K
b : H
disj : ¬b ∈ K
z : H
hzK : z ∈ ↑K
infi : ‖b - z‖ = ⨅ (w : ↑↑K), ‖b - ↑w‖
hinner : ∀ (w : H), w ∈ ↑K → inner (b - z) (w - z) ≤ 0
⊢ ∃ y, (∀ (x : H), x ∈ K → 0 ≤ inner x y) ∧ inner y b < 0
[PROOFSTEP]
use z - b
[GOAL]
case h
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝² : NormedAddCommGroup H
inst✝¹ : InnerProductSpace ℝ H
s t : Set H
inst✝ : CompleteSpace H
K : ConvexCone ℝ H
ne : Set.Nonempty ↑K
hc : IsClosed ↑K
b : H
disj : ¬b ∈ K
z : H
hzK : z ∈ ↑K
infi : ‖b - z‖ = ⨅ (w : ↑↑K), ‖b - ↑w‖
hinner : ∀ (w : H), w ∈ ↑K → inner (b - z) (w - z) ≤ 0
⊢ (∀ (x : H), x ∈ K → 0 ≤ inner x (z - b)) ∧ inner (z - b) b < 0
[PROOFSTEP]
constructor
[GOAL]
case h.left
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝² : NormedAddCommGroup H
inst✝¹ : InnerProductSpace ℝ H
s t : Set H
inst✝ : CompleteSpace H
K : ConvexCone ℝ H
ne : Set.Nonempty ↑K
hc : IsClosed ↑K
b : H
disj : ¬b ∈ K
z : H
hzK : z ∈ ↑K
infi : ‖b - z‖ = ⨅ (w : ↑↑K), ‖b - ↑w‖
hinner : ∀ (w : H), w ∈ ↑K → inner (b - z) (w - z) ≤ 0
⊢ ∀ (x : H), x ∈ K → 0 ≤ inner x (z - b)
[PROOFSTEP]
rintro x hxK
[GOAL]
case h.left
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝² : NormedAddCommGroup H
inst✝¹ : InnerProductSpace ℝ H
s t : Set H
inst✝ : CompleteSpace H
K : ConvexCone ℝ H
ne : Set.Nonempty ↑K
hc : IsClosed ↑K
b : H
disj : ¬b ∈ K
z : H
hzK : z ∈ ↑K
infi : ‖b - z‖ = ⨅ (w : ↑↑K), ‖b - ↑w‖
hinner : ∀ (w : H), w ∈ ↑K → inner (b - z) (w - z) ≤ 0
x : H
hxK : x ∈ K
⊢ 0 ≤ inner x (z - b)
[PROOFSTEP]
specialize hinner _ (K.add_mem hxK hzK)
[GOAL]
case h.left
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝² : NormedAddCommGroup H
inst✝¹ : InnerProductSpace ℝ H
s t : Set H
inst✝ : CompleteSpace H
K : ConvexCone ℝ H
ne : Set.Nonempty ↑K
hc : IsClosed ↑K
b : H
disj : ¬b ∈ K
z : H
hzK : z ∈ ↑K
infi : ‖b - z‖ = ⨅ (w : ↑↑K), ‖b - ↑w‖
x : H
hxK : x ∈ K
hinner : inner (b - z) (x + z - z) ≤ 0
⊢ 0 ≤ inner x (z - b)
[PROOFSTEP]
rwa [add_sub_cancel, real_inner_comm, ← neg_nonneg, neg_eq_neg_one_mul, ← real_inner_smul_right, neg_smul, one_smul,
  neg_sub] at hinner
[GOAL]
case h.right
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝² : NormedAddCommGroup H
inst✝¹ : InnerProductSpace ℝ H
s t : Set H
inst✝ : CompleteSpace H
K : ConvexCone ℝ H
ne : Set.Nonempty ↑K
hc : IsClosed ↑K
b : H
disj : ¬b ∈ K
z : H
hzK : z ∈ ↑K
infi : ‖b - z‖ = ⨅ (w : ↑↑K), ‖b - ↑w‖
hinner : ∀ (w : H), w ∈ ↑K → inner (b - z) (w - z) ≤ 0
⊢ inner (z - b) b < 0
[PROOFSTEP]
have hinner₀ :=
  hinner 0
    (K.pointed_of_nonempty_of_isClosed ne hc)
      -- the rest of the proof is a straightforward calculation
[GOAL]
case h.right
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝² : NormedAddCommGroup H
inst✝¹ : InnerProductSpace ℝ H
s t : Set H
inst✝ : CompleteSpace H
K : ConvexCone ℝ H
ne : Set.Nonempty ↑K
hc : IsClosed ↑K
b : H
disj : ¬b ∈ K
z : H
hzK : z ∈ ↑K
infi : ‖b - z‖ = ⨅ (w : ↑↑K), ‖b - ↑w‖
hinner : ∀ (w : H), w ∈ ↑K → inner (b - z) (w - z) ≤ 0
hinner₀ : inner (b - z) (0 - z) ≤ 0
⊢ inner (z - b) b < 0
[PROOFSTEP]
rw [zero_sub, inner_neg_right, Right.neg_nonpos_iff] at hinner₀
[GOAL]
case h.right
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝² : NormedAddCommGroup H
inst✝¹ : InnerProductSpace ℝ H
s t : Set H
inst✝ : CompleteSpace H
K : ConvexCone ℝ H
ne : Set.Nonempty ↑K
hc : IsClosed ↑K
b : H
disj : ¬b ∈ K
z : H
hzK : z ∈ ↑K
infi : ‖b - z‖ = ⨅ (w : ↑↑K), ‖b - ↑w‖
hinner : ∀ (w : H), w ∈ ↑K → inner (b - z) (w - z) ≤ 0
hinner₀ : 0 ≤ inner (b - z) z
⊢ inner (z - b) b < 0
[PROOFSTEP]
have hbz : b - z ≠ 0 := by
  rw [sub_ne_zero]
  contrapose! hzK
  rwa [← hzK]
[GOAL]
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝² : NormedAddCommGroup H
inst✝¹ : InnerProductSpace ℝ H
s t : Set H
inst✝ : CompleteSpace H
K : ConvexCone ℝ H
ne : Set.Nonempty ↑K
hc : IsClosed ↑K
b : H
disj : ¬b ∈ K
z : H
hzK : z ∈ ↑K
infi : ‖b - z‖ = ⨅ (w : ↑↑K), ‖b - ↑w‖
hinner : ∀ (w : H), w ∈ ↑K → inner (b - z) (w - z) ≤ 0
hinner₀ : 0 ≤ inner (b - z) z
⊢ b - z ≠ 0
[PROOFSTEP]
rw [sub_ne_zero]
[GOAL]
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝² : NormedAddCommGroup H
inst✝¹ : InnerProductSpace ℝ H
s t : Set H
inst✝ : CompleteSpace H
K : ConvexCone ℝ H
ne : Set.Nonempty ↑K
hc : IsClosed ↑K
b : H
disj : ¬b ∈ K
z : H
hzK : z ∈ ↑K
infi : ‖b - z‖ = ⨅ (w : ↑↑K), ‖b - ↑w‖
hinner : ∀ (w : H), w ∈ ↑K → inner (b - z) (w - z) ≤ 0
hinner₀ : 0 ≤ inner (b - z) z
⊢ b ≠ z
[PROOFSTEP]
contrapose! hzK
[GOAL]
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝² : NormedAddCommGroup H
inst✝¹ : InnerProductSpace ℝ H
s t : Set H
inst✝ : CompleteSpace H
K : ConvexCone ℝ H
ne : Set.Nonempty ↑K
hc : IsClosed ↑K
b : H
disj : ¬b ∈ K
z : H
infi : ‖b - z‖ = ⨅ (w : ↑↑K), ‖b - ↑w‖
hinner : ∀ (w : H), w ∈ ↑K → inner (b - z) (w - z) ≤ 0
hinner₀ : 0 ≤ inner (b - z) z
hzK : b = z
⊢ ¬z ∈ ↑K
[PROOFSTEP]
rwa [← hzK]
[GOAL]
case h.right
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝² : NormedAddCommGroup H
inst✝¹ : InnerProductSpace ℝ H
s t : Set H
inst✝ : CompleteSpace H
K : ConvexCone ℝ H
ne : Set.Nonempty ↑K
hc : IsClosed ↑K
b : H
disj : ¬b ∈ K
z : H
hzK : z ∈ ↑K
infi : ‖b - z‖ = ⨅ (w : ↑↑K), ‖b - ↑w‖
hinner : ∀ (w : H), w ∈ ↑K → inner (b - z) (w - z) ≤ 0
hinner₀ : 0 ≤ inner (b - z) z
hbz : b - z ≠ 0
⊢ inner (z - b) b < 0
[PROOFSTEP]
rw [← neg_zero, lt_neg, ← neg_one_mul, ← real_inner_smul_left, smul_sub, neg_smul, one_smul, neg_smul, neg_sub_neg,
  one_smul]
[GOAL]
case h.right
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝² : NormedAddCommGroup H
inst✝¹ : InnerProductSpace ℝ H
s t : Set H
inst✝ : CompleteSpace H
K : ConvexCone ℝ H
ne : Set.Nonempty ↑K
hc : IsClosed ↑K
b : H
disj : ¬b ∈ K
z : H
hzK : z ∈ ↑K
infi : ‖b - z‖ = ⨅ (w : ↑↑K), ‖b - ↑w‖
hinner : ∀ (w : H), w ∈ ↑K → inner (b - z) (w - z) ≤ 0
hinner₀ : 0 ≤ inner (b - z) z
hbz : b - z ≠ 0
⊢ 0 < inner (b - z) b
[PROOFSTEP]
calc
  0 < ⟪b - z, b - z⟫_ℝ := lt_of_not_le ((Iff.not real_inner_self_nonpos).2 hbz)
  _ = ⟪b - z, b - z⟫_ℝ + 0 := (add_zero _).symm
  _ ≤ ⟪b - z, b - z⟫_ℝ + ⟪b - z, z⟫_ℝ := (add_le_add rfl.ge hinner₀)
  _ = ⟪b - z, b - z + z⟫_ℝ := (inner_add_right _ _ _).symm
  _ = ⟪b - z, b⟫_ℝ := by rw [sub_add_cancel]
[GOAL]
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝² : NormedAddCommGroup H
inst✝¹ : InnerProductSpace ℝ H
s t : Set H
inst✝ : CompleteSpace H
K : ConvexCone ℝ H
ne : Set.Nonempty ↑K
hc : IsClosed ↑K
b : H
disj : ¬b ∈ K
z : H
hzK : z ∈ ↑K
infi : ‖b - z‖ = ⨅ (w : ↑↑K), ‖b - ↑w‖
hinner : ∀ (w : H), w ∈ ↑K → inner (b - z) (w - z) ≤ 0
hinner₀ : 0 ≤ inner (b - z) z
hbz : b - z ≠ 0
⊢ inner (b - z) (b - z + z) = inner (b - z) b
[PROOFSTEP]
rw [sub_add_cancel]
[GOAL]
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝² : NormedAddCommGroup H
inst✝¹ : InnerProductSpace ℝ H
s t : Set H
inst✝ : CompleteSpace H
K : ConvexCone ℝ H
ne : Set.Nonempty ↑K
hc : IsClosed ↑K
⊢ innerDualCone ↑(innerDualCone ↑K) = K
[PROOFSTEP]
ext x
[GOAL]
case h
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝² : NormedAddCommGroup H
inst✝¹ : InnerProductSpace ℝ H
s t : Set H
inst✝ : CompleteSpace H
K : ConvexCone ℝ H
ne : Set.Nonempty ↑K
hc : IsClosed ↑K
x : H
⊢ x ∈ innerDualCone ↑(innerDualCone ↑K) ↔ x ∈ K
[PROOFSTEP]
constructor
[GOAL]
case h.mp
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝² : NormedAddCommGroup H
inst✝¹ : InnerProductSpace ℝ H
s t : Set H
inst✝ : CompleteSpace H
K : ConvexCone ℝ H
ne : Set.Nonempty ↑K
hc : IsClosed ↑K
x : H
⊢ x ∈ innerDualCone ↑(innerDualCone ↑K) → x ∈ K
[PROOFSTEP]
rw [mem_innerDualCone, ← SetLike.mem_coe]
[GOAL]
case h.mp
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝² : NormedAddCommGroup H
inst✝¹ : InnerProductSpace ℝ H
s t : Set H
inst✝ : CompleteSpace H
K : ConvexCone ℝ H
ne : Set.Nonempty ↑K
hc : IsClosed ↑K
x : H
⊢ (∀ (x_1 : H), x_1 ∈ ↑(innerDualCone ↑K) → 0 ≤ inner x_1 x) → x ∈ ↑K
[PROOFSTEP]
contrapose!
[GOAL]
case h.mp
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝² : NormedAddCommGroup H
inst✝¹ : InnerProductSpace ℝ H
s t : Set H
inst✝ : CompleteSpace H
K : ConvexCone ℝ H
ne : Set.Nonempty ↑K
hc : IsClosed ↑K
x : H
⊢ ¬x ∈ ↑K → ∃ x_1, x_1 ∈ ↑(innerDualCone ↑K) ∧ inner x_1 x < 0
[PROOFSTEP]
exact K.hyperplane_separation_of_nonempty_of_isClosed_of_nmem ne hc
[GOAL]
case h.mpr
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝² : NormedAddCommGroup H
inst✝¹ : InnerProductSpace ℝ H
s t : Set H
inst✝ : CompleteSpace H
K : ConvexCone ℝ H
ne : Set.Nonempty ↑K
hc : IsClosed ↑K
x : H
⊢ x ∈ K → x ∈ innerDualCone ↑(innerDualCone ↑K)
[PROOFSTEP]
rintro hxK y h
[GOAL]
case h.mpr
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝² : NormedAddCommGroup H
inst✝¹ : InnerProductSpace ℝ H
s t : Set H
inst✝ : CompleteSpace H
K : ConvexCone ℝ H
ne : Set.Nonempty ↑K
hc : IsClosed ↑K
x : H
hxK : x ∈ K
y : H
h : y ∈ ↑(innerDualCone ↑K)
⊢ 0 ≤ inner y x
[PROOFSTEP]
specialize h x hxK
[GOAL]
case h.mpr
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
H : Type u_5
inst✝² : NormedAddCommGroup H
inst✝¹ : InnerProductSpace ℝ H
s t : Set H
inst✝ : CompleteSpace H
K : ConvexCone ℝ H
ne : Set.Nonempty ↑K
hc : IsClosed ↑K
x : H
hxK : x ∈ K
y : H
h : 0 ≤ inner x y
⊢ 0 ≤ inner y x
[PROOFSTEP]
rwa [real_inner_comm]


[GOAL]
a b : ℤ
⊢ a = b ↔ ↑a = ↑b
[PROOFSTEP]
simp only [Int.cast_inj]
[GOAL]
a b : ℤ
⊢ a ≠ b ↔ ↑a ≠ ↑b
[PROOFSTEP]
simp only [ne_eq, Int.cast_inj]


[GOAL]
R : Type u_1
inst✝ : CommRing R
I : Ideal R
⊢ ∀ (i j : ℕ), ∃ k, I ^ k • ⊤ ≤ I ^ i • ⊤ ⊓ I ^ j • ⊤
[PROOFSTEP]
suffices ∀ i j : ℕ, ∃ k, I ^ k ≤ I ^ i ∧ I ^ k ≤ I ^ j by
  simpa only [smul_eq_mul, mul_top, Algebra.id.map_eq_id, map_id, le_inf_iff] using this
[GOAL]
R : Type u_1
inst✝ : CommRing R
I : Ideal R
this : ∀ (i j : ℕ), ∃ k, I ^ k ≤ I ^ i ∧ I ^ k ≤ I ^ j
⊢ ∀ (i j : ℕ), ∃ k, I ^ k • ⊤ ≤ I ^ i • ⊤ ⊓ I ^ j • ⊤
[PROOFSTEP]
simpa only [smul_eq_mul, mul_top, Algebra.id.map_eq_id, map_id, le_inf_iff] using this
[GOAL]
R : Type u_1
inst✝ : CommRing R
I : Ideal R
⊢ ∀ (i j : ℕ), ∃ k, I ^ k ≤ I ^ i ∧ I ^ k ≤ I ^ j
[PROOFSTEP]
intro i j
[GOAL]
R : Type u_1
inst✝ : CommRing R
I : Ideal R
i j : ℕ
⊢ ∃ k, I ^ k ≤ I ^ i ∧ I ^ k ≤ I ^ j
[PROOFSTEP]
exact ⟨max i j, pow_le_pow (le_max_left i j), pow_le_pow (le_max_right i j)⟩
[GOAL]
R : Type u_1
inst✝ : CommRing R
I : Ideal R
⊢ ∀ (a : R) (i : ℕ), ∃ j, a • I ^ j • ⊤ ≤ I ^ i • ⊤
[PROOFSTEP]
suffices ∀ (a : R) (i : ℕ), ∃ j : ℕ, a • I ^ j ≤ I ^ i by
  simpa only [smul_top_eq_map, Algebra.id.map_eq_id, map_id] using this
[GOAL]
R : Type u_1
inst✝ : CommRing R
I : Ideal R
this : ∀ (a : R) (i : ℕ), ∃ j, a • I ^ j ≤ I ^ i
⊢ ∀ (a : R) (i : ℕ), ∃ j, a • I ^ j • ⊤ ≤ I ^ i • ⊤
[PROOFSTEP]
simpa only [smul_top_eq_map, Algebra.id.map_eq_id, map_id] using this
[GOAL]
R : Type u_1
inst✝ : CommRing R
I : Ideal R
⊢ ∀ (a : R) (i : ℕ), ∃ j, a • I ^ j ≤ I ^ i
[PROOFSTEP]
intro r n
[GOAL]
R : Type u_1
inst✝ : CommRing R
I : Ideal R
r : R
n : ℕ
⊢ ∃ j, r • I ^ j ≤ I ^ n
[PROOFSTEP]
use n
[GOAL]
case h
R : Type u_1
inst✝ : CommRing R
I : Ideal R
r : R
n : ℕ
⊢ r • I ^ n ≤ I ^ n
[PROOFSTEP]
rintro a ⟨x, hx, rfl⟩
[GOAL]
case h.intro.intro
R : Type u_1
inst✝ : CommRing R
I : Ideal R
r : R
n : ℕ
x : R
hx : x ∈ ↑(I ^ n)
⊢ ↑(DistribMulAction.toLinearMap R R r) x ∈ I ^ n
[PROOFSTEP]
exact (I ^ n).smul_mem r hx
[GOAL]
R : Type u_1
inst✝ : CommRing R
I : Ideal R
⊢ ∀ (i : ℕ), ∃ j, ↑(I ^ j • ⊤) * ↑(I ^ j • ⊤) ⊆ ↑(I ^ i • ⊤)
[PROOFSTEP]
suffices ∀ i : ℕ, ∃ j : ℕ, (I ^ j : Set R) * (I ^ j : Set R) ⊆ (I ^ i : Set R) by
  simpa only [smul_top_eq_map, Algebra.id.map_eq_id, map_id] using this
[GOAL]
R : Type u_1
inst✝ : CommRing R
I : Ideal R
this : ∀ (i : ℕ), ∃ j, ↑(I ^ j) * ↑(I ^ j) ⊆ ↑(I ^ i)
⊢ ∀ (i : ℕ), ∃ j, ↑(I ^ j • ⊤) * ↑(I ^ j • ⊤) ⊆ ↑(I ^ i • ⊤)
[PROOFSTEP]
simpa only [smul_top_eq_map, Algebra.id.map_eq_id, map_id] using this
[GOAL]
R : Type u_1
inst✝ : CommRing R
I : Ideal R
⊢ ∀ (i : ℕ), ∃ j, ↑(I ^ j) * ↑(I ^ j) ⊆ ↑(I ^ i)
[PROOFSTEP]
intro n
[GOAL]
R : Type u_1
inst✝ : CommRing R
I : Ideal R
n : ℕ
⊢ ∃ j, ↑(I ^ j) * ↑(I ^ j) ⊆ ↑(I ^ n)
[PROOFSTEP]
use n
[GOAL]
case h
R : Type u_1
inst✝ : CommRing R
I : Ideal R
n : ℕ
⊢ ↑(I ^ n) * ↑(I ^ n) ⊆ ↑(I ^ n)
[PROOFSTEP]
rintro a ⟨x, b, _hx, hb, rfl⟩
[GOAL]
case h.intro.intro.intro.intro
R : Type u_1
inst✝ : CommRing R
I : Ideal R
n : ℕ
x b : R
_hx : x ∈ ↑(I ^ n)
hb : b ∈ ↑(I ^ n)
⊢ (fun x x_1 => x * x_1) x b ∈ ↑(I ^ n)
[PROOFSTEP]
exact (I ^ n).smul_mem x hb
[GOAL]
R : Type u_1
inst✝ : CommRing R
I : Ideal R
⊢ ∀ (t : Set R), t ∈ 𝓝 0 ↔ ∃ i, True ∧ ↑(I ^ i) ⊆ t
[PROOFSTEP]
intro U
[GOAL]
R : Type u_1
inst✝ : CommRing R
I : Ideal R
U : Set R
⊢ U ∈ 𝓝 0 ↔ ∃ i, True ∧ ↑(I ^ i) ⊆ U
[PROOFSTEP]
rw [I.ringFilterBasis.toAddGroupFilterBasis.nhds_zero_hasBasis.mem_iff]
[GOAL]
R : Type u_1
inst✝ : CommRing R
I : Ideal R
U : Set R
⊢ (∃ i, i ∈ RingFilterBasis.toAddGroupFilterBasis ∧ id i ⊆ U) ↔ ∃ i, True ∧ ↑(I ^ i) ⊆ U
[PROOFSTEP]
constructor
[GOAL]
case mp
R : Type u_1
inst✝ : CommRing R
I : Ideal R
U : Set R
⊢ (∃ i, i ∈ RingFilterBasis.toAddGroupFilterBasis ∧ id i ⊆ U) → ∃ i, True ∧ ↑(I ^ i) ⊆ U
[PROOFSTEP]
rintro ⟨-, ⟨i, rfl⟩, h⟩
[GOAL]
case mp.intro.intro.intro
R : Type u_1
inst✝ : CommRing R
I : Ideal R
U : Set R
i : ℕ
h : id ↑((fun i => toAddSubgroup (I ^ i • ⊤)) i) ⊆ U
⊢ ∃ i, True ∧ ↑(I ^ i) ⊆ U
[PROOFSTEP]
replace h : ↑(I ^ i) ⊆ U := by simpa using h
[GOAL]
R : Type u_1
inst✝ : CommRing R
I : Ideal R
U : Set R
i : ℕ
h : id ↑((fun i => toAddSubgroup (I ^ i • ⊤)) i) ⊆ U
⊢ ↑(I ^ i) ⊆ U
[PROOFSTEP]
simpa using h
[GOAL]
case mp.intro.intro.intro
R : Type u_1
inst✝ : CommRing R
I : Ideal R
U : Set R
i : ℕ
h : ↑(I ^ i) ⊆ U
⊢ ∃ i, True ∧ ↑(I ^ i) ⊆ U
[PROOFSTEP]
exact ⟨i, trivial, h⟩
[GOAL]
case mpr
R : Type u_1
inst✝ : CommRing R
I : Ideal R
U : Set R
⊢ (∃ i, True ∧ ↑(I ^ i) ⊆ U) → ∃ i, i ∈ RingFilterBasis.toAddGroupFilterBasis ∧ id i ⊆ U
[PROOFSTEP]
rintro ⟨i, -, h⟩
[GOAL]
case mpr.intro.intro
R : Type u_1
inst✝ : CommRing R
I : Ideal R
U : Set R
i : ℕ
h : ↑(I ^ i) ⊆ U
⊢ ∃ i, i ∈ RingFilterBasis.toAddGroupFilterBasis ∧ id i ⊆ U
[PROOFSTEP]
exact ⟨(I ^ i : Ideal R), ⟨i, by simp⟩, h⟩
[GOAL]
R : Type u_1
inst✝ : CommRing R
I : Ideal R
U : Set R
i : ℕ
h : ↑(I ^ i) ⊆ U
⊢ ↑(I ^ i) = ↑((fun i => toAddSubgroup (I ^ i • ⊤)) i)
[PROOFSTEP]
simp
[GOAL]
R : Type u_1
inst✝ : CommRing R
I : Ideal R
x : R
⊢ HasBasis (𝓝 x) (fun _n => True) fun n => (fun y => x + y) '' ↑(I ^ n)
[PROOFSTEP]
letI := I.adicTopology
[GOAL]
R : Type u_1
inst✝ : CommRing R
I : Ideal R
x : R
this : TopologicalSpace R := adicTopology I
⊢ HasBasis (𝓝 x) (fun _n => True) fun n => (fun y => x + y) '' ↑(I ^ n)
[PROOFSTEP]
have := I.hasBasis_nhds_zero_adic.map fun y => x + y
[GOAL]
R : Type u_1
inst✝ : CommRing R
I : Ideal R
x : R
this✝ : TopologicalSpace R := adicTopology I
this : HasBasis (Filter.map (fun y => x + y) (𝓝 0)) (fun _n => True) fun i => (fun y => x + y) '' ↑(I ^ i)
⊢ HasBasis (𝓝 x) (fun _n => True) fun n => (fun y => x + y) '' ↑(I ^ n)
[PROOFSTEP]
rwa [map_add_left_nhds_zero x] at this
[GOAL]
R : Type u_1
inst✝² : CommRing R
I : Ideal R
M : Type u_2
inst✝¹ : AddCommGroup M
inst✝ : Module R M
m : M
i : ℕ
⊢ ↑(I ^ i • ⊤) = ↑((fun i => toAddSubgroup (I ^ i • ⊤)) i)
[PROOFSTEP]
simp
[GOAL]
R : Type u_1
inst✝² : CommRing R
I : Ideal R
M : Type u_2
inst✝¹ : AddCommGroup M
inst✝ : Module R M
m : M
i : ℕ
a : R
a_in : a ∈ ↑(I ^ i • ⊤)
⊢ a ∈ (fun x => x • m) ⁻¹' ↑(I ^ i • ⊤)
[PROOFSTEP]
replace a_in : a ∈ I ^ i := by simpa [(I ^ i).mul_top] using a_in
[GOAL]
R : Type u_1
inst✝² : CommRing R
I : Ideal R
M : Type u_2
inst✝¹ : AddCommGroup M
inst✝ : Module R M
m : M
i : ℕ
a : R
a_in : a ∈ ↑(I ^ i • ⊤)
⊢ a ∈ I ^ i
[PROOFSTEP]
simpa [(I ^ i).mul_top] using a_in
[GOAL]
R : Type u_1
inst✝² : CommRing R
I : Ideal R
M : Type u_2
inst✝¹ : AddCommGroup M
inst✝ : Module R M
m : M
i : ℕ
a : R
a_in : a ∈ I ^ i
⊢ a ∈ (fun x => x • m) ⁻¹' ↑(I ^ i • ⊤)
[PROOFSTEP]
exact smul_mem_smul a_in mem_top
[GOAL]
R : Type u_1
inst✝² : CommRing R
I : Ideal R
M : Type u_2
inst✝¹ : AddCommGroup M
inst✝ : Module R M
n : ℕ
⊢ OpenAddSubgroup R
[PROOFSTEP]
letI := I.adicTopology
[GOAL]
R : Type u_1
inst✝² : CommRing R
I : Ideal R
M : Type u_2
inst✝¹ : AddCommGroup M
inst✝ : Module R M
n : ℕ
this : TopologicalSpace R := adicTopology I
⊢ OpenAddSubgroup R
[PROOFSTEP]
refine ⟨(I ^ n).toAddSubgroup, ?_⟩
[GOAL]
R : Type u_1
inst✝² : CommRing R
I : Ideal R
M : Type u_2
inst✝¹ : AddCommGroup M
inst✝ : Module R M
n : ℕ
this : TopologicalSpace R := adicTopology I
⊢ IsOpen (toAddSubgroup (I ^ n)).toAddSubmonoid.toAddSubsemigroup.carrier
[PROOFSTEP]
convert (I.adic_basis.toRing_subgroups_basis.openAddSubgroup n).isOpen
[GOAL]
case h.e'_3
R : Type u_1
inst✝² : CommRing R
I : Ideal R
M : Type u_2
inst✝¹ : AddCommGroup M
inst✝ : Module R M
n : ℕ
this : TopologicalSpace R := adicTopology I
⊢ (toAddSubgroup (I ^ n)).toAddSubmonoid.toAddSubsemigroup.carrier =
    ↑(RingSubgroupsBasis.openAddSubgroup (_ : RingSubgroupsBasis fun i => toAddSubgroup (I ^ i • ⊤)) n)
[PROOFSTEP]
change (I ^ n : Set R) = (I ^ n • (⊤ : Ideal R) : Set R)
[GOAL]
case h.e'_3
R : Type u_1
inst✝² : CommRing R
I : Ideal R
M : Type u_2
inst✝¹ : AddCommGroup M
inst✝ : Module R M
n : ℕ
this : TopologicalSpace R := adicTopology I
⊢ ↑(I ^ n) = ↑(I ^ n • ⊤)
[PROOFSTEP]
simp [smul_top_eq_map, Algebra.id.map_eq_id, map_id, restrictScalars_self]
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
top : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
⊢ IsAdic J ↔ (∀ (n : ℕ), IsOpen ↑(J ^ n)) ∧ ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s
[PROOFSTEP]
constructor
[GOAL]
case mp
R : Type u_1
inst✝¹ : CommRing R
top : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
⊢ IsAdic J → (∀ (n : ℕ), IsOpen ↑(J ^ n)) ∧ ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s
[PROOFSTEP]
intro H
[GOAL]
case mp
R : Type u_1
inst✝¹ : CommRing R
top : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
H : IsAdic J
⊢ (∀ (n : ℕ), IsOpen ↑(J ^ n)) ∧ ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s
[PROOFSTEP]
change _ = _ at H
[GOAL]
case mp
R : Type u_1
inst✝¹ : CommRing R
top : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
H : top = Ideal.adicTopology J
⊢ (∀ (n : ℕ), IsOpen ↑(J ^ n)) ∧ ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s
[PROOFSTEP]
rw [H]
[GOAL]
case mp
R : Type u_1
inst✝¹ : CommRing R
top : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
H : top = Ideal.adicTopology J
⊢ (∀ (n : ℕ), IsOpen ↑(J ^ n)) ∧ ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s
[PROOFSTEP]
letI := J.adicTopology
[GOAL]
case mp
R : Type u_1
inst✝¹ : CommRing R
top : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
H : top = Ideal.adicTopology J
this : TopologicalSpace R := Ideal.adicTopology J
⊢ (∀ (n : ℕ), IsOpen ↑(J ^ n)) ∧ ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s
[PROOFSTEP]
constructor
[GOAL]
case mp.left
R : Type u_1
inst✝¹ : CommRing R
top : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
H : top = Ideal.adicTopology J
this : TopologicalSpace R := Ideal.adicTopology J
⊢ ∀ (n : ℕ), IsOpen ↑(J ^ n)
[PROOFSTEP]
intro n
[GOAL]
case mp.left
R : Type u_1
inst✝¹ : CommRing R
top : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
H : top = Ideal.adicTopology J
this : TopologicalSpace R := Ideal.adicTopology J
n : ℕ
⊢ IsOpen ↑(J ^ n)
[PROOFSTEP]
exact (J.openAddSubgroup n).isOpen'
[GOAL]
case mp.right
R : Type u_1
inst✝¹ : CommRing R
top : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
H : top = Ideal.adicTopology J
this : TopologicalSpace R := Ideal.adicTopology J
⊢ ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s
[PROOFSTEP]
intro s hs
[GOAL]
case mp.right
R : Type u_1
inst✝¹ : CommRing R
top : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
H : top = Ideal.adicTopology J
this : TopologicalSpace R := Ideal.adicTopology J
s : Set R
hs : s ∈ 𝓝 0
⊢ ∃ n, ↑(J ^ n) ⊆ s
[PROOFSTEP]
simpa using J.hasBasis_nhds_zero_adic.mem_iff.mp hs
[GOAL]
case mpr
R : Type u_1
inst✝¹ : CommRing R
top : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
⊢ ((∀ (n : ℕ), IsOpen ↑(J ^ n)) ∧ ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s) → IsAdic J
[PROOFSTEP]
rintro ⟨H₁, H₂⟩
[GOAL]
case mpr.intro
R : Type u_1
inst✝¹ : CommRing R
top : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
H₁ : ∀ (n : ℕ), IsOpen ↑(J ^ n)
H₂ : ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s
⊢ IsAdic J
[PROOFSTEP]
apply TopologicalAddGroup.ext
[GOAL]
case mpr.intro.tg
R : Type u_1
inst✝¹ : CommRing R
top : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
H₁ : ∀ (n : ℕ), IsOpen ↑(J ^ n)
H₂ : ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s
⊢ TopologicalAddGroup R
[PROOFSTEP]
apply @TopologicalRing.to_topologicalAddGroup
[GOAL]
case mpr.intro.tg'
R : Type u_1
inst✝¹ : CommRing R
top : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
H₁ : ∀ (n : ℕ), IsOpen ↑(J ^ n)
H₂ : ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s
⊢ TopologicalAddGroup R
[PROOFSTEP]
apply (RingSubgroupsBasis.toRingFilterBasis _).toAddGroupFilterBasis.isTopologicalAddGroup
[GOAL]
case mpr.intro.h
R : Type u_1
inst✝¹ : CommRing R
top : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
H₁ : ∀ (n : ℕ), IsOpen ↑(J ^ n)
H₂ : ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s
⊢ 𝓝 0 = 𝓝 0
[PROOFSTEP]
ext s
[GOAL]
case mpr.intro.h.a
R : Type u_1
inst✝¹ : CommRing R
top : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
H₁ : ∀ (n : ℕ), IsOpen ↑(J ^ n)
H₂ : ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s
s : Set R
⊢ s ∈ 𝓝 0 ↔ s ∈ 𝓝 0
[PROOFSTEP]
letI := Ideal.adic_basis J
[GOAL]
case mpr.intro.h.a
R : Type u_1
inst✝¹ : CommRing R
top : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
H₁ : ∀ (n : ℕ), IsOpen ↑(J ^ n)
H₂ : ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s
s : Set R
this : SubmodulesRingBasis fun n => J ^ n • ⊤ := Ideal.adic_basis J
⊢ s ∈ 𝓝 0 ↔ s ∈ 𝓝 0
[PROOFSTEP]
rw [J.hasBasis_nhds_zero_adic.mem_iff]
[GOAL]
case mpr.intro.h.a
R : Type u_1
inst✝¹ : CommRing R
top : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
H₁ : ∀ (n : ℕ), IsOpen ↑(J ^ n)
H₂ : ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s
s : Set R
this : SubmodulesRingBasis fun n => J ^ n • ⊤ := Ideal.adic_basis J
⊢ s ∈ 𝓝 0 ↔ ∃ i, True ∧ ↑(J ^ i) ⊆ s
[PROOFSTEP]
constructor
[GOAL]
case mpr.intro.h.a.mp
R : Type u_1
inst✝¹ : CommRing R
top : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
H₁ : ∀ (n : ℕ), IsOpen ↑(J ^ n)
H₂ : ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s
s : Set R
this : SubmodulesRingBasis fun n => J ^ n • ⊤ := Ideal.adic_basis J
⊢ s ∈ 𝓝 0 → ∃ i, True ∧ ↑(J ^ i) ⊆ s
[PROOFSTEP]
intro H
[GOAL]
case mpr.intro.h.a.mpr
R : Type u_1
inst✝¹ : CommRing R
top : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
H₁ : ∀ (n : ℕ), IsOpen ↑(J ^ n)
H₂ : ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s
s : Set R
this : SubmodulesRingBasis fun n => J ^ n • ⊤ := Ideal.adic_basis J
⊢ (∃ i, True ∧ ↑(J ^ i) ⊆ s) → s ∈ 𝓝 0
[PROOFSTEP]
intro H
[GOAL]
case mpr.intro.h.a.mp
R : Type u_1
inst✝¹ : CommRing R
top : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
H₁ : ∀ (n : ℕ), IsOpen ↑(J ^ n)
H₂ : ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s
s : Set R
this : SubmodulesRingBasis fun n => J ^ n • ⊤ := Ideal.adic_basis J
H : s ∈ 𝓝 0
⊢ ∃ i, True ∧ ↑(J ^ i) ⊆ s
[PROOFSTEP]
rcases H₂ s H with ⟨n, h⟩
[GOAL]
case mpr.intro.h.a.mp.intro
R : Type u_1
inst✝¹ : CommRing R
top : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
H₁ : ∀ (n : ℕ), IsOpen ↑(J ^ n)
H₂ : ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s
s : Set R
this : SubmodulesRingBasis fun n => J ^ n • ⊤ := Ideal.adic_basis J
H : s ∈ 𝓝 0
n : ℕ
h : ↑(J ^ n) ⊆ s
⊢ ∃ i, True ∧ ↑(J ^ i) ⊆ s
[PROOFSTEP]
exact ⟨n, trivial, h⟩
[GOAL]
case mpr.intro.h.a.mpr
R : Type u_1
inst✝¹ : CommRing R
top : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
H₁ : ∀ (n : ℕ), IsOpen ↑(J ^ n)
H₂ : ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s
s : Set R
this : SubmodulesRingBasis fun n => J ^ n • ⊤ := Ideal.adic_basis J
H : ∃ i, True ∧ ↑(J ^ i) ⊆ s
⊢ s ∈ 𝓝 0
[PROOFSTEP]
rcases H with ⟨n, -, hn⟩
[GOAL]
case mpr.intro.h.a.mpr.intro.intro
R : Type u_1
inst✝¹ : CommRing R
top : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
H₁ : ∀ (n : ℕ), IsOpen ↑(J ^ n)
H₂ : ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s
s : Set R
this : SubmodulesRingBasis fun n => J ^ n • ⊤ := Ideal.adic_basis J
n : ℕ
hn : ↑(J ^ n) ⊆ s
⊢ s ∈ 𝓝 0
[PROOFSTEP]
rw [mem_nhds_iff]
[GOAL]
case mpr.intro.h.a.mpr.intro.intro
R : Type u_1
inst✝¹ : CommRing R
top : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
H₁ : ∀ (n : ℕ), IsOpen ↑(J ^ n)
H₂ : ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s
s : Set R
this : SubmodulesRingBasis fun n => J ^ n • ⊤ := Ideal.adic_basis J
n : ℕ
hn : ↑(J ^ n) ⊆ s
⊢ ∃ t, t ⊆ s ∧ IsOpen t ∧ 0 ∈ t
[PROOFSTEP]
refine' ⟨_, hn, H₁ n, (J ^ n).zero_mem⟩
[GOAL]
R : Type u_1
inst✝² : CommRing R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
h : IsAdic J
n : ℕ
hn : 0 < n
⊢ IsAdic (J ^ n)
[PROOFSTEP]
rw [isAdic_iff] at h ⊢
[GOAL]
R : Type u_1
inst✝² : CommRing R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
h : (∀ (n : ℕ), IsOpen ↑(J ^ n)) ∧ ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s
n : ℕ
hn : 0 < n
⊢ (∀ (n_1 : ℕ), IsOpen ↑((J ^ n) ^ n_1)) ∧ ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n_1, ↑((J ^ n) ^ n_1) ⊆ s
[PROOFSTEP]
constructor
[GOAL]
case left
R : Type u_1
inst✝² : CommRing R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
h : (∀ (n : ℕ), IsOpen ↑(J ^ n)) ∧ ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s
n : ℕ
hn : 0 < n
⊢ ∀ (n_1 : ℕ), IsOpen ↑((J ^ n) ^ n_1)
[PROOFSTEP]
intro m
[GOAL]
case left
R : Type u_1
inst✝² : CommRing R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
h : (∀ (n : ℕ), IsOpen ↑(J ^ n)) ∧ ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s
n : ℕ
hn : 0 < n
m : ℕ
⊢ IsOpen ↑((J ^ n) ^ m)
[PROOFSTEP]
rw [← pow_mul]
[GOAL]
case left
R : Type u_1
inst✝² : CommRing R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
h : (∀ (n : ℕ), IsOpen ↑(J ^ n)) ∧ ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s
n : ℕ
hn : 0 < n
m : ℕ
⊢ IsOpen ↑(J ^ (n * m))
[PROOFSTEP]
apply h.left
[GOAL]
case right
R : Type u_1
inst✝² : CommRing R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
h : (∀ (n : ℕ), IsOpen ↑(J ^ n)) ∧ ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s
n : ℕ
hn : 0 < n
⊢ ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n_1, ↑((J ^ n) ^ n_1) ⊆ s
[PROOFSTEP]
intro V hV
[GOAL]
case right
R : Type u_1
inst✝² : CommRing R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
h : (∀ (n : ℕ), IsOpen ↑(J ^ n)) ∧ ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s
n : ℕ
hn : 0 < n
V : Set R
hV : V ∈ 𝓝 0
⊢ ∃ n_1, ↑((J ^ n) ^ n_1) ⊆ V
[PROOFSTEP]
cases' h.right V hV with m hm
[GOAL]
case right.intro
R : Type u_1
inst✝² : CommRing R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
h : (∀ (n : ℕ), IsOpen ↑(J ^ n)) ∧ ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s
n : ℕ
hn : 0 < n
V : Set R
hV : V ∈ 𝓝 0
m : ℕ
hm : ↑(J ^ m) ⊆ V
⊢ ∃ n_1, ↑((J ^ n) ^ n_1) ⊆ V
[PROOFSTEP]
use m
[GOAL]
case h
R : Type u_1
inst✝² : CommRing R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
h : (∀ (n : ℕ), IsOpen ↑(J ^ n)) ∧ ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s
n : ℕ
hn : 0 < n
V : Set R
hV : V ∈ 𝓝 0
m : ℕ
hm : ↑(J ^ m) ⊆ V
⊢ ↑((J ^ n) ^ m) ⊆ V
[PROOFSTEP]
refine' Set.Subset.trans _ hm
[GOAL]
case h
R : Type u_1
inst✝² : CommRing R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
h : (∀ (n : ℕ), IsOpen ↑(J ^ n)) ∧ ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s
n : ℕ
hn : 0 < n
V : Set R
hV : V ∈ 𝓝 0
m : ℕ
hm : ↑(J ^ m) ⊆ V
⊢ ↑((J ^ n) ^ m) ⊆ ↑(J ^ m)
[PROOFSTEP]
cases n
[GOAL]
case h.zero
R : Type u_1
inst✝² : CommRing R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
h : (∀ (n : ℕ), IsOpen ↑(J ^ n)) ∧ ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s
V : Set R
hV : V ∈ 𝓝 0
m : ℕ
hm : ↑(J ^ m) ⊆ V
hn : 0 < Nat.zero
⊢ ↑((J ^ Nat.zero) ^ m) ⊆ ↑(J ^ m)
[PROOFSTEP]
exfalso
[GOAL]
case h.zero.h
R : Type u_1
inst✝² : CommRing R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
h : (∀ (n : ℕ), IsOpen ↑(J ^ n)) ∧ ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s
V : Set R
hV : V ∈ 𝓝 0
m : ℕ
hm : ↑(J ^ m) ⊆ V
hn : 0 < Nat.zero
⊢ False
[PROOFSTEP]
exact Nat.not_succ_le_zero 0 hn
[GOAL]
case h.succ
R : Type u_1
inst✝² : CommRing R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
h : (∀ (n : ℕ), IsOpen ↑(J ^ n)) ∧ ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s
V : Set R
hV : V ∈ 𝓝 0
m : ℕ
hm : ↑(J ^ m) ⊆ V
n✝ : ℕ
hn : 0 < Nat.succ n✝
⊢ ↑((J ^ Nat.succ n✝) ^ m) ⊆ ↑(J ^ m)
[PROOFSTEP]
rw [← pow_mul, Nat.succ_mul]
[GOAL]
case h.succ
R : Type u_1
inst✝² : CommRing R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
h : (∀ (n : ℕ), IsOpen ↑(J ^ n)) ∧ ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s
V : Set R
hV : V ∈ 𝓝 0
m : ℕ
hm : ↑(J ^ m) ⊆ V
n✝ : ℕ
hn : 0 < Nat.succ n✝
⊢ ↑(J ^ (n✝ * m + m)) ⊆ ↑(J ^ m)
[PROOFSTEP]
apply Ideal.pow_le_pow
[GOAL]
case h.succ.h
R : Type u_1
inst✝² : CommRing R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalRing R
J : Ideal R
h : (∀ (n : ℕ), IsOpen ↑(J ^ n)) ∧ ∀ (s : Set R), s ∈ 𝓝 0 → ∃ n, ↑(J ^ n) ⊆ s
V : Set R
hV : V ∈ 𝓝 0
m : ℕ
hm : ↑(J ^ m) ⊆ V
n✝ : ℕ
hn : 0 < Nat.succ n✝
⊢ m ≤ n✝ * m + m
[PROOFSTEP]
apply Nat.le_add_left
[GOAL]
R : Type u_1
inst✝⁵ : CommRing R
inst✝⁴ : TopologicalSpace R
inst✝³ : TopologicalRing R
A : Type u_2
inst✝² : CommRing A
inst✝¹ : TopologicalSpace A
inst✝ : TopologicalRing A
⊢ IsAdic ⊥ ↔ DiscreteTopology A
[PROOFSTEP]
rw [isAdic_iff]
[GOAL]
R : Type u_1
inst✝⁵ : CommRing R
inst✝⁴ : TopologicalSpace R
inst✝³ : TopologicalRing R
A : Type u_2
inst✝² : CommRing A
inst✝¹ : TopologicalSpace A
inst✝ : TopologicalRing A
⊢ ((∀ (n : ℕ), IsOpen ↑(⊥ ^ n)) ∧ ∀ (s : Set A), s ∈ 𝓝 0 → ∃ n, ↑(⊥ ^ n) ⊆ s) ↔ DiscreteTopology A
[PROOFSTEP]
constructor
[GOAL]
case mp
R : Type u_1
inst✝⁵ : CommRing R
inst✝⁴ : TopologicalSpace R
inst✝³ : TopologicalRing R
A : Type u_2
inst✝² : CommRing A
inst✝¹ : TopologicalSpace A
inst✝ : TopologicalRing A
⊢ ((∀ (n : ℕ), IsOpen ↑(⊥ ^ n)) ∧ ∀ (s : Set A), s ∈ 𝓝 0 → ∃ n, ↑(⊥ ^ n) ⊆ s) → DiscreteTopology A
[PROOFSTEP]
rintro ⟨h, _h'⟩
[GOAL]
case mp.intro
R : Type u_1
inst✝⁵ : CommRing R
inst✝⁴ : TopologicalSpace R
inst✝³ : TopologicalRing R
A : Type u_2
inst✝² : CommRing A
inst✝¹ : TopologicalSpace A
inst✝ : TopologicalRing A
h : ∀ (n : ℕ), IsOpen ↑(⊥ ^ n)
_h' : ∀ (s : Set A), s ∈ 𝓝 0 → ∃ n, ↑(⊥ ^ n) ⊆ s
⊢ DiscreteTopology A
[PROOFSTEP]
rw [discreteTopology_iff_open_singleton_zero]
[GOAL]
case mp.intro
R : Type u_1
inst✝⁵ : CommRing R
inst✝⁴ : TopologicalSpace R
inst✝³ : TopologicalRing R
A : Type u_2
inst✝² : CommRing A
inst✝¹ : TopologicalSpace A
inst✝ : TopologicalRing A
h : ∀ (n : ℕ), IsOpen ↑(⊥ ^ n)
_h' : ∀ (s : Set A), s ∈ 𝓝 0 → ∃ n, ↑(⊥ ^ n) ⊆ s
⊢ IsOpen {0}
[PROOFSTEP]
simpa using h 1
[GOAL]
case mpr
R : Type u_1
inst✝⁵ : CommRing R
inst✝⁴ : TopologicalSpace R
inst✝³ : TopologicalRing R
A : Type u_2
inst✝² : CommRing A
inst✝¹ : TopologicalSpace A
inst✝ : TopologicalRing A
⊢ DiscreteTopology A → (∀ (n : ℕ), IsOpen ↑(⊥ ^ n)) ∧ ∀ (s : Set A), s ∈ 𝓝 0 → ∃ n, ↑(⊥ ^ n) ⊆ s
[PROOFSTEP]
intros
[GOAL]
case mpr
R : Type u_1
inst✝⁵ : CommRing R
inst✝⁴ : TopologicalSpace R
inst✝³ : TopologicalRing R
A : Type u_2
inst✝² : CommRing A
inst✝¹ : TopologicalSpace A
inst✝ : TopologicalRing A
a✝ : DiscreteTopology A
⊢ (∀ (n : ℕ), IsOpen ↑(⊥ ^ n)) ∧ ∀ (s : Set A), s ∈ 𝓝 0 → ∃ n, ↑(⊥ ^ n) ⊆ s
[PROOFSTEP]
constructor
[GOAL]
case mpr.left
R : Type u_1
inst✝⁵ : CommRing R
inst✝⁴ : TopologicalSpace R
inst✝³ : TopologicalRing R
A : Type u_2
inst✝² : CommRing A
inst✝¹ : TopologicalSpace A
inst✝ : TopologicalRing A
a✝ : DiscreteTopology A
⊢ ∀ (n : ℕ), IsOpen ↑(⊥ ^ n)
[PROOFSTEP]
simp
[GOAL]
case mpr.right
R : Type u_1
inst✝⁵ : CommRing R
inst✝⁴ : TopologicalSpace R
inst✝³ : TopologicalRing R
A : Type u_2
inst✝² : CommRing A
inst✝¹ : TopologicalSpace A
inst✝ : TopologicalRing A
a✝ : DiscreteTopology A
⊢ ∀ (s : Set A), s ∈ 𝓝 0 → ∃ n, ↑(⊥ ^ n) ⊆ s
[PROOFSTEP]
intro U U_nhds
[GOAL]
case mpr.right
R : Type u_1
inst✝⁵ : CommRing R
inst✝⁴ : TopologicalSpace R
inst✝³ : TopologicalRing R
A : Type u_2
inst✝² : CommRing A
inst✝¹ : TopologicalSpace A
inst✝ : TopologicalRing A
a✝ : DiscreteTopology A
U : Set A
U_nhds : U ∈ 𝓝 0
⊢ ∃ n, ↑(⊥ ^ n) ⊆ U
[PROOFSTEP]
use 1
[GOAL]
case h
R : Type u_1
inst✝⁵ : CommRing R
inst✝⁴ : TopologicalSpace R
inst✝³ : TopologicalRing R
A : Type u_2
inst✝² : CommRing A
inst✝¹ : TopologicalSpace A
inst✝ : TopologicalRing A
a✝ : DiscreteTopology A
U : Set A
U_nhds : U ∈ 𝓝 0
⊢ ↑(⊥ ^ 1) ⊆ U
[PROOFSTEP]
simp [mem_of_mem_nhds U_nhds]
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
inst✝ : WithIdeal R
⊢ NonarchimedeanRing R
[PROOFSTEP]
infer_instance
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
inst✝ : WithIdeal R
⊢ TopologicalRing (UniformSpace.Completion R)
[PROOFSTEP]
infer_instance
[GOAL]
R : Type u_1
inst✝³ : CommRing R
inst✝² : WithIdeal R
M : Type u_2
inst✝¹ : AddCommGroup M
inst✝ : Module R M
⊢ TopologicalAddGroup M
[PROOFSTEP]
infer_instance
[GOAL]
R : Type u_1
inst✝³ : CommRing R
inst✝² : WithIdeal R
M : Type u_2
inst✝¹ : AddCommGroup M
inst✝ : Module R M
⊢ ContinuousSMul R M
[PROOFSTEP]
infer_instance


[GOAL]
f : Type u₀ → Type u₁
inst✝ : EquivFunctor f
α β : Type u₀
e : α ≃ β
x : f α
⊢ map e.symm (map e x) = x
[PROOFSTEP]
convert (congr_fun (EquivFunctor.map_trans' e e.symm) x).symm
[GOAL]
case h.e'_3
f : Type u₀ → Type u₁
inst✝ : EquivFunctor f
α β : Type u₀
e : α ≃ β
x : f α
⊢ x = map (e.trans e.symm) x
[PROOFSTEP]
simp
[GOAL]
f : Type u₀ → Type u₁
inst✝ : EquivFunctor f
α β : Type u₀
e : α ≃ β
y : f β
⊢ map e (map e.symm y) = y
[PROOFSTEP]
convert (congr_fun (EquivFunctor.map_trans' e.symm e) y).symm
[GOAL]
case h.e'_3
f : Type u₀ → Type u₁
inst✝ : EquivFunctor f
α β : Type u₀
e : α ≃ β
y : f β
⊢ y = map (e.symm.trans e) y
[PROOFSTEP]
simp
[GOAL]
f : Type u₀ → Type u₁
inst✝ : EquivFunctor f
α✝ β : Type u₀
e : α✝ ≃ β
α : Type u₀
⊢ mapEquiv f (Equiv.refl α) = Equiv.refl (f α)
[PROOFSTEP]
simp [EquivFunctor.mapEquiv]
[GOAL]
f : Type u₀ → Type u₁
inst✝ : EquivFunctor f
α✝ β : Type u₀
e : α✝ ≃ β
α : Type u₀
⊢ { toFun := id, invFun := id, left_inv := (_ : LeftInverse id id), right_inv := (_ : Function.RightInverse id id) } =
    Equiv.refl (f α)
[PROOFSTEP]
rfl
[GOAL]
f : Type u₀ → Type u₁
inst✝ : EquivFunctor f
α β : Type u₀
e : α ≃ β
γ : Type u₀
ab : α ≃ β
bc : β ≃ γ
x : f α
⊢ ↑((mapEquiv f ab).trans (mapEquiv f bc)) x = ↑(mapEquiv f (ab.trans bc)) x
[PROOFSTEP]
simp [mapEquiv, map_trans']
[GOAL]
f : Type u₀ → Type u₁
inst✝¹ : Functor f
inst✝ : LawfulFunctor f
α : Type u₀
⊢ (fun {α β} e => Functor.map ↑e) (Equiv.refl α) = id
[PROOFSTEP]
ext
[GOAL]
case h
f : Type u₀ → Type u₁
inst✝¹ : Functor f
inst✝ : LawfulFunctor f
α : Type u₀
x✝ : f α
⊢ (fun {α β} e => Functor.map ↑e) (Equiv.refl α) x✝ = id x✝
[PROOFSTEP]
apply LawfulFunctor.id_map
[GOAL]
f : Type u₀ → Type u₁
inst✝¹ : Functor f
inst✝ : LawfulFunctor f
α β γ : Type u₀
k : α ≃ β
h : β ≃ γ
⊢ (fun {α β} e => Functor.map ↑e) (k.trans h) = (fun {α β} e => Functor.map ↑e) h ∘ (fun {α β} e => Functor.map ↑e) k
[PROOFSTEP]
ext x
[GOAL]
case h
f : Type u₀ → Type u₁
inst✝¹ : Functor f
inst✝ : LawfulFunctor f
α β γ : Type u₀
k : α ≃ β
h : β ≃ γ
x : f α
⊢ (fun {α β} e => Functor.map ↑e) (k.trans h) x =
    ((fun {α β} e => Functor.map ↑e) h ∘ (fun {α β} e => Functor.map ↑e) k) x
[PROOFSTEP]
apply LawfulFunctor.comp_map k h x
[GOAL]
f : Type u₀ → Type u₁
inst✝¹ : Applicative f
inst✝ : LawfulApplicative f
α β : Type u₀
h : ∀ (γ : Type u₀), Injective pure
e₁ e₂ : α ≃ β
H : mapEquiv f e₁ = mapEquiv f e₂
x : α
⊢ pure (↑e₁ x) = pure (↑e₂ x)
[PROOFSTEP]
simpa [EquivFunctor.map] using Equiv.congr_fun H (pure x)


[GOAL]
ι : Type u_1
M : Type u_2
N : Type u_3
α : ι → Type u_4
inst✝³ : (i : ι) → SMul M (α i)
inst✝² : (i : ι) → SMul N (α i)
a✝ : M
i : ι
b✝ : α i
x✝ : (i : ι) × α i
inst✝¹ : SMul M N
inst✝ : ∀ (i : ι), IsScalarTower M N (α i)
a : M
b : N
x : (i : ι) × α i
⊢ (a • b) • x = a • b • x
[PROOFSTEP]
cases x
[GOAL]
case mk
ι : Type u_1
M : Type u_2
N : Type u_3
α : ι → Type u_4
inst✝³ : (i : ι) → SMul M (α i)
inst✝² : (i : ι) → SMul N (α i)
a✝ : M
i : ι
b✝ : α i
x : (i : ι) × α i
inst✝¹ : SMul M N
inst✝ : ∀ (i : ι), IsScalarTower M N (α i)
a : M
b : N
fst✝ : ι
snd✝ : α fst✝
⊢ (a • b) • { fst := fst✝, snd := snd✝ } = a • b • { fst := fst✝, snd := snd✝ }
[PROOFSTEP]
rw [smul_mk, smul_mk, smul_mk, smul_assoc]
[GOAL]
ι : Type u_1
M : Type u_2
N : Type u_3
α : ι → Type u_4
inst✝² : (i : ι) → SMul M (α i)
inst✝¹ : (i : ι) → SMul N (α i)
a✝ : M
i : ι
b✝ : α i
x✝ : (i : ι) × α i
inst✝ : ∀ (i : ι), SMulCommClass M N (α i)
a : M
b : N
x : (i : ι) × α i
⊢ a • b • x = b • a • x
[PROOFSTEP]
cases x
[GOAL]
case mk
ι : Type u_1
M : Type u_2
N : Type u_3
α : ι → Type u_4
inst✝² : (i : ι) → SMul M (α i)
inst✝¹ : (i : ι) → SMul N (α i)
a✝ : M
i : ι
b✝ : α i
x : (i : ι) × α i
inst✝ : ∀ (i : ι), SMulCommClass M N (α i)
a : M
b : N
fst✝ : ι
snd✝ : α fst✝
⊢ a • b • { fst := fst✝, snd := snd✝ } = b • a • { fst := fst✝, snd := snd✝ }
[PROOFSTEP]
rw [smul_mk, smul_mk, smul_mk, smul_mk, smul_comm]
[GOAL]
ι : Type u_1
M : Type u_2
N : Type u_3
α : ι → Type u_4
inst✝³ : (i : ι) → SMul M (α i)
inst✝² : (i : ι) → SMul N (α i)
a✝ : M
i : ι
b : α i
x✝ : (i : ι) × α i
inst✝¹ : (i : ι) → SMul Mᵐᵒᵖ (α i)
inst✝ : ∀ (i : ι), IsCentralScalar M (α i)
a : M
x : (i : ι) × α i
⊢ MulOpposite.op a • x = a • x
[PROOFSTEP]
cases x
[GOAL]
case mk
ι : Type u_1
M : Type u_2
N : Type u_3
α : ι → Type u_4
inst✝³ : (i : ι) → SMul M (α i)
inst✝² : (i : ι) → SMul N (α i)
a✝ : M
i : ι
b : α i
x : (i : ι) × α i
inst✝¹ : (i : ι) → SMul Mᵐᵒᵖ (α i)
inst✝ : ∀ (i : ι), IsCentralScalar M (α i)
a : M
fst✝ : ι
snd✝ : α fst✝
⊢ MulOpposite.op a • { fst := fst✝, snd := snd✝ } = a • { fst := fst✝, snd := snd✝ }
[PROOFSTEP]
rw [smul_mk, smul_mk, op_smul_eq_smul]
[GOAL]
ι : Type u_1
M : Type u_2
N : Type u_3
α : ι → Type u_4
m : Monoid M
inst✝ : (i : ι) → MulAction M (α i)
x : (i : ι) × α i
⊢ 1 • x = x
[PROOFSTEP]
cases x
[GOAL]
case mk
ι : Type u_1
M : Type u_2
N : Type u_3
α : ι → Type u_4
m : Monoid M
inst✝ : (i : ι) → MulAction M (α i)
fst✝ : ι
snd✝ : α fst✝
⊢ 1 • { fst := fst✝, snd := snd✝ } = { fst := fst✝, snd := snd✝ }
[PROOFSTEP]
rw [smul_mk, one_smul]
[GOAL]
ι : Type u_1
M : Type u_2
N : Type u_3
α : ι → Type u_4
m : Monoid M
inst✝ : (i : ι) → MulAction M (α i)
a b : M
x : (i : ι) × α i
⊢ (a * b) • x = a • b • x
[PROOFSTEP]
cases x
[GOAL]
case mk
ι : Type u_1
M : Type u_2
N : Type u_3
α : ι → Type u_4
m : Monoid M
inst✝ : (i : ι) → MulAction M (α i)
a b : M
fst✝ : ι
snd✝ : α fst✝
⊢ (a * b) • { fst := fst✝, snd := snd✝ } = a • b • { fst := fst✝, snd := snd✝ }
[PROOFSTEP]
rw [smul_mk, smul_mk, smul_mk, mul_smul]


[GOAL]
n : ℕ
x : ℕ × ℕ
⊢ x ∈ antidiagonal n ↔ x.fst + x.snd = n
[PROOFSTEP]
rw [antidiagonal, mem_map]
[GOAL]
n : ℕ
x : ℕ × ℕ
⊢ (∃ a, a ∈ range (n + 1) ∧ (a, n - a) = x) ↔ x.fst + x.snd = n
[PROOFSTEP]
constructor
[GOAL]
case mp
n : ℕ
x : ℕ × ℕ
⊢ (∃ a, a ∈ range (n + 1) ∧ (a, n - a) = x) → x.fst + x.snd = n
[PROOFSTEP]
rintro ⟨i, hi, rfl⟩
[GOAL]
case mp.intro.intro
n i : ℕ
hi : i ∈ range (n + 1)
⊢ (i, n - i).fst + (i, n - i).snd = n
[PROOFSTEP]
rw [mem_range, lt_succ_iff] at hi
[GOAL]
case mp.intro.intro
n i : ℕ
hi : i ≤ n
⊢ (i, n - i).fst + (i, n - i).snd = n
[PROOFSTEP]
exact add_tsub_cancel_of_le hi
[GOAL]
case mpr
n : ℕ
x : ℕ × ℕ
⊢ x.fst + x.snd = n → ∃ a, a ∈ range (n + 1) ∧ (a, n - a) = x
[PROOFSTEP]
rintro rfl
[GOAL]
case mpr
x : ℕ × ℕ
⊢ ∃ a, a ∈ range (x.fst + x.snd + 1) ∧ (a, x.fst + x.snd - a) = x
[PROOFSTEP]
refine' ⟨x.fst, _, _⟩
[GOAL]
case mpr.refine'_1
x : ℕ × ℕ
⊢ x.fst ∈ range (x.fst + x.snd + 1)
[PROOFSTEP]
rw [mem_range, add_assoc, lt_add_iff_pos_right]
[GOAL]
case mpr.refine'_1
x : ℕ × ℕ
⊢ 0 < x.snd + 1
[PROOFSTEP]
exact zero_lt_succ _
[GOAL]
case mpr.refine'_2
x : ℕ × ℕ
⊢ (x.fst, x.fst + x.snd - x.fst) = x
[PROOFSTEP]
exact Prod.ext rfl (by simp only [add_tsub_cancel_left])
[GOAL]
x : ℕ × ℕ
⊢ (x.fst, x.fst + x.snd - x.fst).snd = x.snd
[PROOFSTEP]
simp only [add_tsub_cancel_left]
[GOAL]
n : ℕ
⊢ length (antidiagonal n) = n + 1
[PROOFSTEP]
rw [antidiagonal, length_map, length_range]
[GOAL]
n : ℕ
⊢ antidiagonal (n + 1) = (0, n + 1) :: map (Prod.map succ id) (antidiagonal n)
[PROOFSTEP]
simp only [antidiagonal, range_succ_eq_map, map_cons, true_and_iff, Nat.add_succ_sub_one, add_zero, id.def,
  eq_self_iff_true, tsub_zero, map_map, Prod.map_mk]
[GOAL]
n : ℕ
⊢ (0, n + 1) :: (succ 0, n) :: map ((fun i => (i, n + 1 - i)) ∘ succ ∘ succ) (range n) =
    (0, n + 1) :: (succ 0, n) :: map (Prod.map succ id ∘ (fun i => (i, n - i)) ∘ succ) (range n)
[PROOFSTEP]
apply congr rfl (congr rfl _)
[GOAL]
n : ℕ
⊢ map ((fun i => (i, n + 1 - i)) ∘ succ ∘ succ) (range n) =
    map (Prod.map succ id ∘ (fun i => (i, n - i)) ∘ succ) (range n)
[PROOFSTEP]
ext
[GOAL]
case a.a
n n✝ : ℕ
a✝ : ℕ × ℕ
⊢ a✝ ∈ get? (map ((fun i => (i, n + 1 - i)) ∘ succ ∘ succ) (range n)) n✝ ↔
    a✝ ∈ get? (map (Prod.map succ id ∘ (fun i => (i, n - i)) ∘ succ) (range n)) n✝
[PROOFSTEP]
simp
[GOAL]
n : ℕ
⊢ antidiagonal (n + 1) = map (Prod.map id succ) (antidiagonal n) ++ [(n + 1, 0)]
[PROOFSTEP]
simp only [antidiagonal, range_succ, add_tsub_cancel_left, map_append, append_assoc, tsub_self, singleton_append,
  map_map, map]
[GOAL]
n : ℕ
⊢ map (fun i => (i, n + 1 - i)) (range n) ++ [(n, 1), (n + 1, 0)] =
    map (Prod.map id succ ∘ fun i => (i, n - i)) (range n) ++ [Prod.map id succ (n, 0), (n + 1, 0)]
[PROOFSTEP]
congr 1
[GOAL]
case e_a
n : ℕ
⊢ map (fun i => (i, n + 1 - i)) (range n) = map (Prod.map id succ ∘ fun i => (i, n - i)) (range n)
[PROOFSTEP]
apply map_congr
[GOAL]
case e_a.a
n : ℕ
⊢ ∀ (x : ℕ), x ∈ range n → (x, n + 1 - x) = (Prod.map id succ ∘ fun i => (i, n - i)) x
[PROOFSTEP]
simp (config := { contextual := true }) [le_of_lt, Nat.succ_eq_add_one, Nat.sub_add_comm]
[GOAL]
n : ℕ
⊢ antidiagonal (n + 2) = (0, n + 2) :: map (Prod.map succ succ) (antidiagonal n) ++ [(n + 2, 0)]
[PROOFSTEP]
rw [antidiagonal_succ']
[GOAL]
n : ℕ
⊢ map (Prod.map id succ) (antidiagonal (n + 1)) ++ [(n + 1 + 1, 0)] =
    (0, n + 2) :: map (Prod.map succ succ) (antidiagonal n) ++ [(n + 2, 0)]
[PROOFSTEP]
simp
[GOAL]
n : ℕ
⊢ map (Prod.map id succ ∘ Prod.map succ id) (antidiagonal n) = map (Prod.map succ succ) (antidiagonal n)
[PROOFSTEP]
ext
[GOAL]
case a.a
n n✝ : ℕ
a✝ : ℕ × ℕ
⊢ a✝ ∈ get? (map (Prod.map id succ ∘ Prod.map succ id) (antidiagonal n)) n✝ ↔
    a✝ ∈ get? (map (Prod.map succ succ) (antidiagonal n)) n✝
[PROOFSTEP]
simp
[GOAL]
n : ℕ
⊢ map Prod.swap (antidiagonal n) = reverse (antidiagonal n)
[PROOFSTEP]
rw [antidiagonal, map_map, ← List.map_reverse, range_eq_range', reverse_range', ← range_eq_range', map_map]
[GOAL]
n : ℕ
⊢ map (Prod.swap ∘ fun i => (i, n - i)) (range (n + 1)) =
    map ((fun i => (i, n - i)) ∘ fun x => 0 + (n + 1) - 1 - x) (range (n + 1))
[PROOFSTEP]
apply map_congr
[GOAL]
case a
n : ℕ
⊢ ∀ (x : ℕ),
    x ∈ range (n + 1) → (Prod.swap ∘ fun i => (i, n - i)) x = ((fun i => (i, n - i)) ∘ fun x => 0 + (n + 1) - 1 - x) x
[PROOFSTEP]
simp (config := { contextual := true }) [Nat.sub_sub_self, lt_succ_iff]


[GOAL]
G : Type u_1
S : Type u_2
inst✝ : Semigroup S
a✝ b c : S
h : Commute b c
a : S
⊢ a * b * c = a * c * b
[PROOFSTEP]
simp only [mul_assoc, h.eq]
[GOAL]
G : Type u_1
S : Type u_2
inst✝ : Semigroup S
a b c✝ : S
h : Commute a b
c : S
⊢ a * (b * c) = b * (a * c)
[PROOFSTEP]
simp only [← mul_assoc, h.eq]
[GOAL]
G : Type u_1
S : Type u_2
inst✝ : Semigroup S
a✝ b c : S
hbc : Commute b c
a d : S
⊢ a * b * (c * d) = a * c * (b * d)
[PROOFSTEP]
simp only [hbc.left_comm, mul_assoc]
[GOAL]
G : Type u_1
M : Type u_2
inst✝ : Monoid M
a✝ b✝ : M
u✝ u₁ u₂ u : Mˣ
a b : M
hu : a * b = ↑u
hc : Commute a b
⊢ a * (b * ↑u⁻¹) = 1
[PROOFSTEP]
rw [← mul_assoc, hu, u.mul_inv]
[GOAL]
G : Type u_1
M : Type u_2
inst✝ : Monoid M
a✝ b✝ : M
u✝ u₁ u₂ u : Mˣ
a b : M
hu : a * b = ↑u
hc : Commute a b
⊢ b * ↑u⁻¹ * a = 1
[PROOFSTEP]
have : Commute a u := hu ▸ (Commute.refl _).mul_right hc
[GOAL]
G : Type u_1
M : Type u_2
inst✝ : Monoid M
a✝ b✝ : M
u✝ u₁ u₂ u : Mˣ
a b : M
hu : a * b = ↑u
hc : Commute a b
this : Commute a ↑u
⊢ b * ↑u⁻¹ * a = 1
[PROOFSTEP]
rw [← this.units_inv_right.right_comm, ← hc.eq, hu, u.mul_inv]
[GOAL]
G : Type u_1
inst✝ : DivisionMonoid G
a b c d : G
hab : Commute a b
⊢ (a * b)⁻¹ = a⁻¹ * b⁻¹
[PROOFSTEP]
rw [hab.eq, mul_inv_rev]
[GOAL]
G : Type u_1
inst✝ : DivisionMonoid G
a b c d : G
hab : Commute a b
⊢ (a * b)⁻¹ = a⁻¹ * b⁻¹
[PROOFSTEP]
rw [hab.eq, mul_inv_rev]
[GOAL]
G : Type u_1
inst✝ : DivisionMonoid G
a b c d : G
hbd : Commute b d
hbc : Commute b⁻¹ c
⊢ a / b * (c / d) = a * c / (b * d)
[PROOFSTEP]
simp_rw [div_eq_mul_inv, mul_inv_rev, hbd.inv_inv.symm.eq, hbc.mul_mul_mul_comm]
[GOAL]
G : Type u_1
inst✝ : DivisionMonoid G
a b c d : G
hbc : Commute b c
hbd : Commute b⁻¹ d
hcd : Commute c⁻¹ d
⊢ a / b / (c / d) = a / c / (b / d)
[PROOFSTEP]
simp_rw [div_eq_mul_inv, mul_inv_rev, inv_inv, hbd.symm.eq, hcd.symm.eq, hbc.inv_inv.mul_mul_mul_comm]
[GOAL]
G : Type u_1
inst✝ : Group G
a b : G
h : Commute a b
⊢ a⁻¹ * b * a = b
[PROOFSTEP]
rw [h.inv_left.eq, inv_mul_cancel_right]
[GOAL]
G : Type u_1
inst✝ : Group G
a b : G
h : Commute a b
⊢ a⁻¹ * (b * a) = b
[PROOFSTEP]
rw [← mul_assoc, h.inv_mul_cancel]
[GOAL]
G : Type u_1
inst✝ : Group G
a b : G
h : Commute a b
⊢ a * b * a⁻¹ = b
[PROOFSTEP]
rw [h.eq, mul_inv_cancel_right]
[GOAL]
G : Type u_1
inst✝ : Group G
a b : G
h : Commute a b
⊢ a * (b * a⁻¹) = b
[PROOFSTEP]
rw [← mul_assoc, h.mul_inv_cancel]


[GOAL]
x y z✝ : ZFSet
hx : IsTransitive x
hy : IsTransitive y
z : ZFSet
hz : z ∈ x ∩ y
w : ZFSet
hw : w ∈ z
⊢ w ∈ x ∩ y
[PROOFSTEP]
rw [mem_inter] at hz ⊢
[GOAL]
x y z✝ : ZFSet
hx : IsTransitive x
hy : IsTransitive y
z : ZFSet
hz : z ∈ x ∧ z ∈ y
w : ZFSet
hw : w ∈ z
⊢ w ∈ x ∧ w ∈ y
[PROOFSTEP]
exact ⟨hx.mem_trans hw hz.1, hy.mem_trans hw hz.2⟩
[GOAL]
x y✝ z✝ : ZFSet
h : IsTransitive x
y : ZFSet
hy : y ∈ ⋃₀ x
z : ZFSet
hz : z ∈ y
⊢ z ∈ ⋃₀ x
[PROOFSTEP]
rcases mem_sUnion.1 hy with ⟨w, hw, hw'⟩
[GOAL]
case intro.intro
x y✝ z✝ : ZFSet
h : IsTransitive x
y : ZFSet
hy : y ∈ ⋃₀ x
z : ZFSet
hz : z ∈ y
w : ZFSet
hw : w ∈ x
hw' : y ∈ w
⊢ z ∈ ⋃₀ x
[PROOFSTEP]
exact mem_sUnion_of_mem hz (h.mem_trans hw' hw)
[GOAL]
x y✝ z✝ : ZFSet
H : ∀ (y : ZFSet), y ∈ x → IsTransitive y
y : ZFSet
hy : y ∈ ⋃₀ x
z : ZFSet
hz : z ∈ y
⊢ z ∈ ⋃₀ x
[PROOFSTEP]
rcases mem_sUnion.1 hy with ⟨w, hw, hw'⟩
[GOAL]
case intro.intro
x y✝ z✝ : ZFSet
H : ∀ (y : ZFSet), y ∈ x → IsTransitive y
y : ZFSet
hy : y ∈ ⋃₀ x
z : ZFSet
hz : z ∈ y
w : ZFSet
hw : w ∈ x
hw' : y ∈ w
⊢ z ∈ ⋃₀ x
[PROOFSTEP]
exact mem_sUnion_of_mem ((H w hw).mem_trans hz hw') hw
[GOAL]
x y z : ZFSet
hx : IsTransitive x
hy : IsTransitive y
⊢ IsTransitive (x ∪ y)
[PROOFSTEP]
rw [← sUnion_pair]
[GOAL]
x y z : ZFSet
hx : IsTransitive x
hy : IsTransitive y
⊢ IsTransitive (⋃₀ {x, y})
[PROOFSTEP]
apply IsTransitive.sUnion' fun z => _
[GOAL]
x y z : ZFSet
hx : IsTransitive x
hy : IsTransitive y
⊢ ∀ (z : ZFSet), z ∈ {x, y} → IsTransitive z
[PROOFSTEP]
intro
[GOAL]
x y z : ZFSet
hx : IsTransitive x
hy : IsTransitive y
z✝ : ZFSet
⊢ z✝ ∈ {x, y} → IsTransitive z✝
[PROOFSTEP]
rw [mem_pair]
[GOAL]
x y z : ZFSet
hx : IsTransitive x
hy : IsTransitive y
z✝ : ZFSet
⊢ z✝ = x ∨ z✝ = y → IsTransitive z✝
[PROOFSTEP]
rintro (rfl | rfl)
[GOAL]
case inl
y z : ZFSet
hy : IsTransitive y
z✝ : ZFSet
hx : IsTransitive z✝
⊢ IsTransitive z✝
case inr x z : ZFSet hx : IsTransitive x z✝ : ZFSet hy : IsTransitive z✝ ⊢ IsTransitive z✝
[PROOFSTEP]
assumption'
[GOAL]
x y✝ z✝ : ZFSet
h : IsTransitive x
y : ZFSet
hy : y ∈ powerset x
z : ZFSet
hz : z ∈ y
⊢ z ∈ powerset x
[PROOFSTEP]
rw [mem_powerset] at hy ⊢
[GOAL]
x y✝ z✝ : ZFSet
h : IsTransitive x
y : ZFSet
hy : y ⊆ x
z : ZFSet
hz : z ∈ y
⊢ z ⊆ x
[PROOFSTEP]
exact h.subset_of_mem (hy hz)
[GOAL]
x y✝ z : ZFSet
h : IsTransitive x
y : ZFSet
hy : y ∈ ⋃₀ x
⊢ y ∈ x
[PROOFSTEP]
rcases mem_sUnion.1 hy with ⟨z, hz, hz'⟩
[GOAL]
case intro.intro
x y✝ z✝ : ZFSet
h : IsTransitive x
y : ZFSet
hy : y ∈ ⋃₀ x
z : ZFSet
hz : z ∈ x
hz' : y ∈ z
⊢ y ∈ x
[PROOFSTEP]
exact h.mem_trans hz' hz


[GOAL]
α : Type u_1
inst✝² : Group α
inst✝¹ : LinearOrder α
inst✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
a : α
⊢ max a 1 / max a⁻¹ 1 = a
[PROOFSTEP]
rcases le_total a 1 with (h | h)
[GOAL]
case inl
α : Type u_1
inst✝² : Group α
inst✝¹ : LinearOrder α
inst✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
a : α
h : a ≤ 1
⊢ max a 1 / max a⁻¹ 1 = a
[PROOFSTEP]
simp [h]
[GOAL]
case inr
α : Type u_1
inst✝² : Group α
inst✝¹ : LinearOrder α
inst✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
a : α
h : 1 ≤ a
⊢ max a 1 / max a⁻¹ 1 = a
[PROOFSTEP]
simp [h]
[GOAL]
α : Type u_1
inst✝ : LinearOrderedCommGroup α
a✝ b✝ c✝ a b c : α
⊢ min (a / c) (b / c) = min a b / c
[PROOFSTEP]
simpa only [div_eq_mul_inv] using min_mul_mul_right a b c⁻¹
[GOAL]
α : Type u_1
inst✝ : LinearOrderedCommGroup α
a✝ b✝ c✝ a b c : α
⊢ max (a / c) (b / c) = max a b / c
[PROOFSTEP]
simpa only [div_eq_mul_inv] using max_mul_mul_right a b c⁻¹
[GOAL]
α : Type u_1
inst✝ : LinearOrderedCommGroup α
a✝ b✝ c✝ a b c : α
⊢ min (a / b) (a / c) = a / max b c
[PROOFSTEP]
simp only [div_eq_mul_inv, min_mul_mul_left, min_inv_inv']
[GOAL]
α : Type u_1
inst✝ : LinearOrderedCommGroup α
a✝ b✝ c✝ a b c : α
⊢ max (a / b) (a / c) = a / min b c
[PROOFSTEP]
simp only [div_eq_mul_inv, max_mul_mul_left, max_inv_inv']
[GOAL]
α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
a✝ b✝ c✝ a b c d : α
⊢ max a b - max c d ≤ max (a - c) (b - d)
[PROOFSTEP]
simp only [sub_le_iff_le_add, max_le_iff]
[GOAL]
α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
a✝ b✝ c✝ a b c d : α
⊢ a ≤ max (a - c) (b - d) + max c d ∧ b ≤ max (a - c) (b - d) + max c d
[PROOFSTEP]
constructor
[GOAL]
case left
α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
a✝ b✝ c✝ a b c d : α
⊢ a ≤ max (a - c) (b - d) + max c d
case right α : Type u_1 inst✝ : LinearOrderedAddCommGroup α a✝ b✝ c✝ a b c d : α ⊢ b ≤ max (a - c) (b - d) + max c d
[PROOFSTEP]
calc
  a = a - c + c := (sub_add_cancel a c).symm
  _ ≤ max (a - c) (b - d) + max c d := add_le_add (le_max_left _ _) (le_max_left _ _)
[GOAL]
case right
α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
a✝ b✝ c✝ a b c d : α
⊢ b ≤ max (a - c) (b - d) + max c d
[PROOFSTEP]
calc
  b = b - d + d := (sub_add_cancel b d).symm
  _ ≤ max (a - c) (b - d) + max c d := add_le_add (le_max_right _ _) (le_max_right _ _)
[GOAL]
α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
a✝ b✝ c✝ a b c d : α
⊢ |max a b - max c d| ≤ max |a - c| |b - d|
[PROOFSTEP]
refine' abs_sub_le_iff.2 ⟨_, _⟩
[GOAL]
case refine'_1
α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
a✝ b✝ c✝ a b c d : α
⊢ max a b - max c d ≤ max |a - c| |b - d|
[PROOFSTEP]
exact (max_sub_max_le_max _ _ _ _).trans (max_le_max (le_abs_self _) (le_abs_self _))
[GOAL]
case refine'_2
α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
a✝ b✝ c✝ a b c d : α
⊢ max c d - max a b ≤ max |a - c| |b - d|
[PROOFSTEP]
rw [abs_sub_comm a c, abs_sub_comm b d]
[GOAL]
case refine'_2
α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
a✝ b✝ c✝ a b c d : α
⊢ max c d - max a b ≤ max |c - a| |d - b|
[PROOFSTEP]
exact (max_sub_max_le_max _ _ _ _).trans (max_le_max (le_abs_self _) (le_abs_self _))
[GOAL]
α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
a✝ b✝ c✝ a b c d : α
⊢ |min a b - min c d| ≤ max |a - c| |b - d|
[PROOFSTEP]
simpa only [max_neg_neg, neg_sub_neg, abs_sub_comm] using abs_max_sub_max_le_max (-a) (-b) (-c) (-d)
[GOAL]
α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
a✝ b✝ c✝ a b c : α
⊢ |max a c - max b c| ≤ |a - b|
[PROOFSTEP]
simpa only [sub_self, abs_zero, max_eq_left (abs_nonneg (a - b))] using abs_max_sub_max_le_max a c b c


[GOAL]
n : ℕ
⊢ Ico 0 n = range n
[PROOFSTEP]
rw [Ico, tsub_zero, range_eq_range']
[GOAL]
n m : ℕ
⊢ List.length (Ico n m) = m - n
[PROOFSTEP]
dsimp [Ico]
[GOAL]
n m : ℕ
⊢ List.length (range' n (m - n)) = m - n
[PROOFSTEP]
simp only [length_range']
[GOAL]
n m : ℕ
⊢ Pairwise (fun x x_1 => x < x_1) (Ico n m)
[PROOFSTEP]
dsimp [Ico]
[GOAL]
n m : ℕ
⊢ Pairwise (fun x x_1 => x < x_1) (range' n (m - n))
[PROOFSTEP]
simp only [pairwise_lt_range']
[GOAL]
n m : ℕ
⊢ Nodup (Ico n m)
[PROOFSTEP]
dsimp [Ico]
[GOAL]
n m : ℕ
⊢ Nodup (range' n (m - n))
[PROOFSTEP]
simp only [nodup_range']
[GOAL]
n m l : ℕ
⊢ l ∈ Ico n m ↔ n ≤ l ∧ l < m
[PROOFSTEP]
suffices n ≤ l ∧ l < n + (m - n) ↔ n ≤ l ∧ l < m by simp [Ico, this]
[GOAL]
n m l : ℕ
this : n ≤ l ∧ l < n + (m - n) ↔ n ≤ l ∧ l < m
⊢ l ∈ Ico n m ↔ n ≤ l ∧ l < m
[PROOFSTEP]
simp [Ico, this]
[GOAL]
n m l : ℕ
⊢ n ≤ l ∧ l < n + (m - n) ↔ n ≤ l ∧ l < m
[PROOFSTEP]
cases' le_total n m with hnm hmn
[GOAL]
case inl
n m l : ℕ
hnm : n ≤ m
⊢ n ≤ l ∧ l < n + (m - n) ↔ n ≤ l ∧ l < m
[PROOFSTEP]
rw [add_tsub_cancel_of_le hnm]
[GOAL]
case inr
n m l : ℕ
hmn : m ≤ n
⊢ n ≤ l ∧ l < n + (m - n) ↔ n ≤ l ∧ l < m
[PROOFSTEP]
rw [tsub_eq_zero_iff_le.mpr hmn, add_zero]
[GOAL]
case inr
n m l : ℕ
hmn : m ≤ n
⊢ n ≤ l ∧ l < n ↔ n ≤ l ∧ l < m
[PROOFSTEP]
exact and_congr_right fun hnl => Iff.intro (fun hln => (not_le_of_gt hln hnl).elim) fun hlm => lt_of_lt_of_le hlm hmn
[GOAL]
n m : ℕ
h : m ≤ n
⊢ Ico n m = []
[PROOFSTEP]
simp [Ico, tsub_eq_zero_iff_le.mpr h]
[GOAL]
n m k : ℕ
⊢ map ((fun x x_1 => x + x_1) k) (Ico n m) = Ico (n + k) (m + k)
[PROOFSTEP]
rw [Ico, Ico, map_add_range', add_tsub_add_eq_tsub_right m k, add_comm n k]
[GOAL]
n m k : ℕ
h₁ : k ≤ n
⊢ map (fun x => x - k) (Ico n m) = Ico (n - k) (m - k)
[PROOFSTEP]
rw [Ico, Ico, tsub_tsub_tsub_cancel_right h₁, map_sub_range' _ _ _ h₁]
[GOAL]
n m : ℕ
h : Ico n m = []
⊢ m - n = 0
[PROOFSTEP]
rw [← length, h, List.length]
[GOAL]
n m l : ℕ
hnm : n ≤ m
hml : m ≤ l
⊢ Ico n m ++ Ico m l = Ico n l
[PROOFSTEP]
dsimp only [Ico]
[GOAL]
n m l : ℕ
hnm : n ≤ m
hml : m ≤ l
⊢ range' n (m - n) ++ range' m (l - m) = range' n (l - n)
[PROOFSTEP]
convert range'_append n (m - n) (l - m) 1 using 2
[GOAL]
case h.e'_2.h.e'_6
n m l : ℕ
hnm : n ≤ m
hml : m ≤ l
⊢ range' m (l - m) = range' (n + 1 * (m - n)) (l - m)
[PROOFSTEP]
rw [one_mul, add_tsub_cancel_of_le hnm]
[GOAL]
case h.e'_3.h.e'_2
n m l : ℕ
hnm : n ≤ m
hml : m ≤ l
⊢ l - n = l - m + (m - n)
[PROOFSTEP]
rw [tsub_add_tsub_cancel hml hnm]
[GOAL]
n m l : ℕ
⊢ Ico n m ∩ Ico m l = []
[PROOFSTEP]
apply eq_nil_iff_forall_not_mem.2
[GOAL]
n m l : ℕ
⊢ ∀ (a : ℕ), ¬a ∈ Ico n m ∩ Ico m l
[PROOFSTEP]
intro a
[GOAL]
n m l a : ℕ
⊢ ¬a ∈ Ico n m ∩ Ico m l
[PROOFSTEP]
simp only [and_imp, not_and, not_lt, List.mem_inter_iff, List.Ico.mem]
[GOAL]
n m l a : ℕ
⊢ n ≤ a → a < m → m ≤ a → l ≤ a
[PROOFSTEP]
intro _ h₂ h₃
[GOAL]
n m l a : ℕ
a✝ : n ≤ a
h₂ : a < m
h₃ : m ≤ a
⊢ l ≤ a
[PROOFSTEP]
exfalso
[GOAL]
case h
n m l a : ℕ
a✝ : n ≤ a
h₂ : a < m
h₃ : m ≤ a
⊢ False
[PROOFSTEP]
exact not_lt_of_ge h₃ h₂
[GOAL]
n : ℕ
⊢ Ico n (n + 1) = [n]
[PROOFSTEP]
dsimp [Ico]
[GOAL]
n : ℕ
⊢ range' n (n + 1 - n) = [n]
[PROOFSTEP]
simp [range', add_tsub_cancel_left]
[GOAL]
n m : ℕ
h : n ≤ m
⊢ Ico n (m + 1) = Ico n m ++ [m]
[PROOFSTEP]
rwa [← succ_singleton, append_consecutive]
[GOAL]
case hml
n m : ℕ
h : n ≤ m
⊢ m ≤ m + 1
[PROOFSTEP]
exact Nat.le_succ _
[GOAL]
n m : ℕ
h : n < m
⊢ Ico n m = n :: Ico (n + 1) m
[PROOFSTEP]
rw [← append_consecutive (Nat.le_succ n) h, succ_singleton]
[GOAL]
n m : ℕ
h : n < m
⊢ [n] ++ Ico (succ n) m = n :: Ico (n + 1) m
[PROOFSTEP]
rfl
[GOAL]
m : ℕ
h : 0 < m
⊢ Ico (m - 1) m = [m - 1]
[PROOFSTEP]
dsimp [Ico]
[GOAL]
m : ℕ
h : 0 < m
⊢ range' (m - 1) (m - (m - 1)) = [m - 1]
[PROOFSTEP]
rw [tsub_tsub_cancel_of_le (succ_le_of_lt h)]
[GOAL]
m : ℕ
h : 0 < m
⊢ range' (m - 1) (succ 0) = [m - 1]
[PROOFSTEP]
simp [← Nat.one_eq_succ_zero]
[GOAL]
n m : ℕ
⊢ Chain' (fun a b => b = succ a) (Ico n m)
[PROOFSTEP]
by_cases n < m
[GOAL]
n m : ℕ
⊢ Chain' (fun a b => b = succ a) (Ico n m)
[PROOFSTEP]
by_cases n < m
[GOAL]
case pos
n m : ℕ
h : n < m
⊢ Chain' (fun a b => b = succ a) (Ico n m)
[PROOFSTEP]
rw [eq_cons h]
[GOAL]
case pos
n m : ℕ
h : n < m
⊢ Chain' (fun a b => b = succ a) (n :: Ico (n + 1) m)
[PROOFSTEP]
exact chain_succ_range' _ _ 1
[GOAL]
case neg
n m : ℕ
h : ¬n < m
⊢ Chain' (fun a b => b = succ a) (Ico n m)
[PROOFSTEP]
rw [eq_nil_of_le (le_of_not_gt h)]
[GOAL]
case neg
n m : ℕ
h : ¬n < m
⊢ Chain' (fun a b => b = succ a) []
[PROOFSTEP]
trivial
[GOAL]
n m : ℕ
⊢ ¬m ∈ Ico n m
[PROOFSTEP]
simp
[GOAL]
n m l : ℕ
hml : m ≤ l
k : ℕ
hk : k ∈ Ico n m
⊢ decide (k < l) = true
[PROOFSTEP]
simp only [(lt_of_lt_of_le (mem.1 hk).2 hml), decide_True]
[GOAL]
n m l : ℕ
hln : l ≤ n
k : ℕ
hk : k ∈ Ico n m
⊢ ¬decide (k < l) = true
[PROOFSTEP]
simp only [decide_eq_true_eq, not_lt]
[GOAL]
n m l : ℕ
hln : l ≤ n
k : ℕ
hk : k ∈ Ico n m
⊢ l ≤ k
[PROOFSTEP]
apply le_trans hln
[GOAL]
n m l : ℕ
hln : l ≤ n
k : ℕ
hk : k ∈ Ico n m
⊢ n ≤ k
[PROOFSTEP]
exact (mem.1 hk).1
[GOAL]
n m l : ℕ
hlm : l ≤ m
⊢ filter (fun x => decide (x < l)) (Ico n m) = Ico n l
[PROOFSTEP]
cases' le_total n l with hnl hln
[GOAL]
case inl
n m l : ℕ
hlm : l ≤ m
hnl : n ≤ l
⊢ filter (fun x => decide (x < l)) (Ico n m) = Ico n l
[PROOFSTEP]
rw [← append_consecutive hnl hlm, filter_append, filter_lt_of_top_le (le_refl l), filter_lt_of_le_bot (le_refl l),
  append_nil]
[GOAL]
case inr
n m l : ℕ
hlm : l ≤ m
hln : l ≤ n
⊢ filter (fun x => decide (x < l)) (Ico n m) = Ico n l
[PROOFSTEP]
rw [eq_nil_of_le hln, filter_lt_of_le_bot hln]
[GOAL]
n m l : ℕ
⊢ filter (fun x => decide (x < l)) (Ico n m) = Ico n (min m l)
[PROOFSTEP]
cases' le_total m l with hml hlm
[GOAL]
case inl
n m l : ℕ
hml : m ≤ l
⊢ filter (fun x => decide (x < l)) (Ico n m) = Ico n (min m l)
[PROOFSTEP]
rw [min_eq_left hml, filter_lt_of_top_le hml]
[GOAL]
case inr
n m l : ℕ
hlm : l ≤ m
⊢ filter (fun x => decide (x < l)) (Ico n m) = Ico n (min m l)
[PROOFSTEP]
rw [min_eq_right hlm, filter_lt_of_ge hlm]
[GOAL]
n m l : ℕ
hln : l ≤ n
k : ℕ
hk : k ∈ Ico n m
⊢ decide (l ≤ k) = true
[PROOFSTEP]
rw [decide_eq_true_eq]
[GOAL]
n m l : ℕ
hln : l ≤ n
k : ℕ
hk : k ∈ Ico n m
⊢ l ≤ k
[PROOFSTEP]
exact le_trans hln (mem.1 hk).1
[GOAL]
n m l : ℕ
hml : m ≤ l
k : ℕ
hk : k ∈ Ico n m
⊢ ¬decide (l ≤ k) = true
[PROOFSTEP]
rw [decide_eq_true_eq]
[GOAL]
n m l : ℕ
hml : m ≤ l
k : ℕ
hk : k ∈ Ico n m
⊢ ¬l ≤ k
[PROOFSTEP]
exact not_le_of_gt (lt_of_lt_of_le (mem.1 hk).2 hml)
[GOAL]
n m l : ℕ
hnl : n ≤ l
⊢ filter (fun x => decide (l ≤ x)) (Ico n m) = Ico l m
[PROOFSTEP]
cases' le_total l m with hlm hml
[GOAL]
case inl
n m l : ℕ
hnl : n ≤ l
hlm : l ≤ m
⊢ filter (fun x => decide (l ≤ x)) (Ico n m) = Ico l m
[PROOFSTEP]
rw [← append_consecutive hnl hlm, filter_append, filter_le_of_top_le (le_refl l), filter_le_of_le_bot (le_refl l),
  nil_append]
[GOAL]
case inr
n m l : ℕ
hnl : n ≤ l
hml : m ≤ l
⊢ filter (fun x => decide (l ≤ x)) (Ico n m) = Ico l m
[PROOFSTEP]
rw [eq_nil_of_le hml, filter_le_of_top_le hml]
[GOAL]
n m l : ℕ
⊢ filter (fun x => decide (l ≤ x)) (Ico n m) = Ico (max n l) m
[PROOFSTEP]
cases' le_total n l with hnl hln
[GOAL]
case inl
n m l : ℕ
hnl : n ≤ l
⊢ filter (fun x => decide (l ≤ x)) (Ico n m) = Ico (max n l) m
[PROOFSTEP]
rw [max_eq_right hnl, filter_le_of_le hnl]
[GOAL]
case inr
n m l : ℕ
hln : l ≤ n
⊢ filter (fun x => decide (l ≤ x)) (Ico n m) = Ico (max n l) m
[PROOFSTEP]
rw [max_eq_left hln, filter_le_of_le_bot hln]
[GOAL]
n m : ℕ
hnm : n < m
⊢ filter (fun x => decide (x < n + 1)) (Ico n m) = [n]
[PROOFSTEP]
have r : min m (n + 1) = n + 1 := (@inf_eq_right _ _ m (n + 1)).mpr hnm
[GOAL]
n m : ℕ
hnm : n < m
r : min m (n + 1) = n + 1
⊢ filter (fun x => decide (x < n + 1)) (Ico n m) = [n]
[PROOFSTEP]
simp [filter_lt n m (n + 1), r]
[GOAL]
n m : ℕ
hnm : n < m
⊢ filter (fun x => decide (x ≤ n)) (Ico n m) = [n]
[PROOFSTEP]
rw [← filter_lt_of_succ_bot hnm]
[GOAL]
n m : ℕ
hnm : n < m
⊢ filter (fun x => decide (x ≤ n)) (Ico n m) = filter (fun x => decide (x < n + 1)) (Ico n m)
[PROOFSTEP]
exact
  filter_congr' fun _ _ => by
    rw [decide_eq_true_eq, decide_eq_true_eq]
    exact lt_succ_iff.symm
[GOAL]
n m : ℕ
hnm : n < m
x✝¹ : ℕ
x✝ : x✝¹ ∈ Ico n m
⊢ decide (x✝¹ ≤ n) = true ↔ decide (x✝¹ < n + 1) = true
[PROOFSTEP]
rw [decide_eq_true_eq, decide_eq_true_eq]
[GOAL]
n m : ℕ
hnm : n < m
x✝¹ : ℕ
x✝ : x✝¹ ∈ Ico n m
⊢ x✝¹ ≤ n ↔ x✝¹ < n + 1
[PROOFSTEP]
exact lt_succ_iff.symm
[GOAL]
n a b : ℕ
⊢ n < a ∨ b ≤ n ∨ n ∈ Ico a b
[PROOFSTEP]
by_cases h₁ : n < a
[GOAL]
case pos
n a b : ℕ
h₁ : n < a
⊢ n < a ∨ b ≤ n ∨ n ∈ Ico a b
[PROOFSTEP]
left
[GOAL]
case pos.h
n a b : ℕ
h₁ : n < a
⊢ n < a
[PROOFSTEP]
exact h₁
[GOAL]
case neg
n a b : ℕ
h₁ : ¬n < a
⊢ n < a ∨ b ≤ n ∨ n ∈ Ico a b
[PROOFSTEP]
right
[GOAL]
case neg.h
n a b : ℕ
h₁ : ¬n < a
⊢ b ≤ n ∨ n ∈ Ico a b
[PROOFSTEP]
by_cases h₂ : n ∈ Ico a b
[GOAL]
case pos
n a b : ℕ
h₁ : ¬n < a
h₂ : n ∈ Ico a b
⊢ b ≤ n ∨ n ∈ Ico a b
[PROOFSTEP]
right
[GOAL]
case pos.h
n a b : ℕ
h₁ : ¬n < a
h₂ : n ∈ Ico a b
⊢ n ∈ Ico a b
[PROOFSTEP]
exact h₂
[GOAL]
case neg
n a b : ℕ
h₁ : ¬n < a
h₂ : ¬n ∈ Ico a b
⊢ b ≤ n ∨ n ∈ Ico a b
[PROOFSTEP]
left
[GOAL]
case neg.h
n a b : ℕ
h₁ : ¬n < a
h₂ : ¬n ∈ Ico a b
⊢ b ≤ n
[PROOFSTEP]
simp only [Ico.mem, not_and, not_lt] at *
[GOAL]
case neg.h
n a b : ℕ
h₁ : a ≤ n
h₂ : a ≤ n → b ≤ n
⊢ b ≤ n
[PROOFSTEP]
exact h₂ h₁


[GOAL]
α : Type u_1
ι : Type u_2
inst✝² : LinearOrderedSemifield α
inst✝¹ : ExistsAddOfLE α
inst✝ : Finite ι
x y : ι → α
h : ∀ (i : ι), x i < y i
⊢ ∃ ε, 0 < ε ∧ ∀ (i : ι), x i + ε < y i
[PROOFSTEP]
cases nonempty_fintype ι
[GOAL]
case intro
α : Type u_1
ι : Type u_2
inst✝² : LinearOrderedSemifield α
inst✝¹ : ExistsAddOfLE α
inst✝ : Finite ι
x y : ι → α
h : ∀ (i : ι), x i < y i
val✝ : Fintype ι
⊢ ∃ ε, 0 < ε ∧ ∀ (i : ι), x i + ε < y i
[PROOFSTEP]
cases isEmpty_or_nonempty ι
[GOAL]
case intro.inl
α : Type u_1
ι : Type u_2
inst✝² : LinearOrderedSemifield α
inst✝¹ : ExistsAddOfLE α
inst✝ : Finite ι
x y : ι → α
h : ∀ (i : ι), x i < y i
val✝ : Fintype ι
h✝ : IsEmpty ι
⊢ ∃ ε, 0 < ε ∧ ∀ (i : ι), x i + ε < y i
[PROOFSTEP]
exact ⟨1, zero_lt_one, isEmptyElim⟩
[GOAL]
case intro.inr
α : Type u_1
ι : Type u_2
inst✝² : LinearOrderedSemifield α
inst✝¹ : ExistsAddOfLE α
inst✝ : Finite ι
x y : ι → α
h : ∀ (i : ι), x i < y i
val✝ : Fintype ι
h✝ : Nonempty ι
⊢ ∃ ε, 0 < ε ∧ ∀ (i : ι), x i + ε < y i
[PROOFSTEP]
choose ε hε hxε using fun i => exists_pos_add_of_lt' (h i)
[GOAL]
case intro.inr
α : Type u_1
ι : Type u_2
inst✝² : LinearOrderedSemifield α
inst✝¹ : ExistsAddOfLE α
inst✝ : Finite ι
x y : ι → α
h : ∀ (i : ι), x i < y i
val✝ : Fintype ι
h✝ : Nonempty ι
ε : ι → α
hε : ∀ (i : ι), 0 < ε i
hxε : ∀ (i : ι), x i + ε i = y i
⊢ ∃ ε, 0 < ε ∧ ∀ (i : ι), x i + ε < y i
[PROOFSTEP]
obtain rfl : x + ε = y := funext hxε
[GOAL]
case intro.inr
α : Type u_1
ι : Type u_2
inst✝² : LinearOrderedSemifield α
inst✝¹ : ExistsAddOfLE α
inst✝ : Finite ι
x : ι → α
val✝ : Fintype ι
h✝ : Nonempty ι
ε : ι → α
hε : ∀ (i : ι), 0 < ε i
h : ∀ (i : ι), x i < (x + ε) i
hxε : ∀ (i : ι), x i + ε i = (x + ε) i
⊢ ∃ ε_1, 0 < ε_1 ∧ ∀ (i : ι), x i + ε_1 < (x + ε) i
[PROOFSTEP]
have hε : 0 < Finset.univ.inf' Finset.univ_nonempty ε := (Finset.lt_inf'_iff _).2 fun i _ => hε _
[GOAL]
case intro.inr
α : Type u_1
ι : Type u_2
inst✝² : LinearOrderedSemifield α
inst✝¹ : ExistsAddOfLE α
inst✝ : Finite ι
x : ι → α
val✝ : Fintype ι
h✝ : Nonempty ι
ε : ι → α
hε✝ : ∀ (i : ι), 0 < ε i
h : ∀ (i : ι), x i < (x + ε) i
hxε : ∀ (i : ι), x i + ε i = (x + ε) i
hε : 0 < Finset.inf' Finset.univ (_ : Finset.Nonempty Finset.univ) ε
⊢ ∃ ε_1, 0 < ε_1 ∧ ∀ (i : ι), x i + ε_1 < (x + ε) i
[PROOFSTEP]
exact ⟨_, half_pos hε, fun i => add_lt_add_left ((half_lt_self hε).trans_le <| Finset.inf'_le _ <| Finset.mem_univ _) _⟩


[GOAL]
G₀ : Type u
M₀ : Type u_1
M₀' : Type u_2
G₀' : Type u_3
R : Type u_4
inst✝ : AddGroup R
a b : R
h : a - b = 0
⊢ a + -b = b + -b
[PROOFSTEP]
rw [← sub_eq_add_neg, h, add_neg_self]
  -- Porting note:
  -- This theorem was introduced during ad-hoc porting
  -- and hopefully can be removed again after `Mathlib.Algebra.Ring.Basic` is fully ported.
[GOAL]
G₀ : Type u
M₀ : Type u_1
M₀' : Type u_2
G₀' : Type u_3
inst✝¹ : MulZeroOneClass M₀
inst✝ : Nontrivial M₀
a b : M₀
⊢ 1 ≠ 0
[PROOFSTEP]
intro h
[GOAL]
G₀ : Type u
M₀ : Type u_1
M₀' : Type u_2
G₀' : Type u_3
inst✝¹ : MulZeroOneClass M₀
inst✝ : Nontrivial M₀
a b : M₀
h : 1 = 0
⊢ False
[PROOFSTEP]
rcases exists_pair_ne M₀ with ⟨x, y, hx⟩
[GOAL]
case intro.intro
G₀ : Type u
M₀ : Type u_1
M₀' : Type u_2
G₀' : Type u_3
inst✝¹ : MulZeroOneClass M₀
inst✝ : Nontrivial M₀
a b : M₀
h : 1 = 0
x y : M₀
hx : x ≠ y
⊢ False
[PROOFSTEP]
apply hx
[GOAL]
case intro.intro
G₀ : Type u
M₀ : Type u_1
M₀' : Type u_2
G₀' : Type u_3
inst✝¹ : MulZeroOneClass M₀
inst✝ : Nontrivial M₀
a b : M₀
h : 1 = 0
x y : M₀
hx : x ≠ y
⊢ x = y
[PROOFSTEP]
calc
  x = 1 * x := by rw [one_mul]
  _ = 0 := by rw [h, zero_mul]
  _ = 1 * y := by rw [h, zero_mul]
  _ = y := by rw [one_mul]
[GOAL]
G₀ : Type u
M₀ : Type u_1
M₀' : Type u_2
G₀' : Type u_3
inst✝¹ : MulZeroOneClass M₀
inst✝ : Nontrivial M₀
a b : M₀
h : 1 = 0
x y : M₀
hx : x ≠ y
⊢ x = 1 * x
[PROOFSTEP]
rw [one_mul]
[GOAL]
G₀ : Type u
M₀ : Type u_1
M₀' : Type u_2
G₀' : Type u_3
inst✝¹ : MulZeroOneClass M₀
inst✝ : Nontrivial M₀
a b : M₀
h : 1 = 0
x y : M₀
hx : x ≠ y
⊢ 1 * x = 0
[PROOFSTEP]
rw [h, zero_mul]
[GOAL]
G₀ : Type u
M₀ : Type u_1
M₀' : Type u_2
G₀' : Type u_3
inst✝¹ : MulZeroOneClass M₀
inst✝ : Nontrivial M₀
a b : M₀
h : 1 = 0
x y : M₀
hx : x ≠ y
⊢ 0 = 1 * y
[PROOFSTEP]
rw [h, zero_mul]
[GOAL]
G₀ : Type u
M₀ : Type u_1
M₀' : Type u_2
G₀' : Type u_3
inst✝¹ : MulZeroOneClass M₀
inst✝ : Nontrivial M₀
a b : M₀
h : 1 = 0
x y : M₀
hx : x ≠ y
⊢ 1 * y = y
[PROOFSTEP]
rw [one_mul]
[GOAL]
G₀ : Type u
M₀ : Type u_1
M₀' : Type u_2
G₀' : Type u_3
inst✝³ : MulZeroOneClass M₀
inst✝² : Nontrivial M₀
a b : M₀
inst✝¹ : Zero M₀'
inst✝ : One M₀'
f : M₀' → M₀
zero : f 0 = 0
one : f 1 = 1
⊢ ¬f 0 = f 1
[PROOFSTEP]
rw [zero, one]
[GOAL]
G₀ : Type u
M₀ : Type u_1
M₀' : Type u_2
G₀' : Type u_3
inst✝³ : MulZeroOneClass M₀
inst✝² : Nontrivial M₀
a b : M₀
inst✝¹ : Zero M₀'
inst✝ : One M₀'
f : M₀' → M₀
zero : f 0 = 0
one : f 1 = 1
⊢ ¬0 = 1
[PROOFSTEP]
exact zero_ne_one
[GOAL]
G₀ : Type u
M₀ : Type u_1
M₀' : Type u_2
G₀' : Type u_3
inst✝¹ : MulZeroClass M₀
inst✝ : NoZeroDivisors M₀
a b : M₀
⊢ 0 = a * b ↔ a = 0 ∨ b = 0
[PROOFSTEP]
rw [eq_comm, mul_eq_zero]
[GOAL]
G₀ : Type u
M₀ : Type u_1
M₀' : Type u_2
G₀' : Type u_3
inst✝¹ : MulZeroClass M₀
inst✝ : NoZeroDivisors M₀
a b : M₀
⊢ a * a = 0 ↔ a = 0
[PROOFSTEP]
simp
[GOAL]
G₀ : Type u
M₀ : Type u_1
M₀' : Type u_2
G₀' : Type u_3
inst✝¹ : MulZeroClass M₀
inst✝ : NoZeroDivisors M₀
a b : M₀
⊢ 0 = a * a ↔ a = 0
[PROOFSTEP]
simp