[GOAL]
𝕜 : Type u_1
E : Type u_2
α : Type u_3
x : ℝ
⊢ ‖x⋆ * x‖ = ‖x‖ * ‖x‖
[PROOFSTEP]
simp only [star, id.def, norm_mul]
[GOAL]
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝² : NonUnitalNormedRing E
inst✝¹ : StarRing E
inst✝ : CstarRing E
⊢ ∀ (x : E), ‖x⋆‖ = ‖x‖
[PROOFSTEP]
intro x
[GOAL]
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝² : NonUnitalNormedRing E
inst✝¹ : StarRing E
inst✝ : CstarRing E
x : E
⊢ ‖x⋆‖ = ‖x‖
[PROOFSTEP]
by_cases htriv : x = 0
[GOAL]
case pos
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝² : NonUnitalNormedRing E
inst✝¹ : StarRing E
inst✝ : CstarRing E
x : E
htriv : x = 0
⊢ ‖x⋆‖ = ‖x‖
[PROOFSTEP]
simp only [htriv, star_zero]
[GOAL]
case neg
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝² : NonUnitalNormedRing E
inst✝¹ : StarRing E
inst✝ : CstarRing E
x : E
htriv : ¬x = 0
⊢ ‖x⋆‖ = ‖x‖
[PROOFSTEP]
have hnt : 0 < ‖x‖ := norm_pos_iff.mpr htriv
[GOAL]
case neg
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝² : NonUnitalNormedRing E
inst✝¹ : StarRing E
inst✝ : CstarRing E
x : E
htriv : ¬x = 0
hnt : 0 < ‖x‖
⊢ ‖x⋆‖ = ‖x‖
[PROOFSTEP]
have hnt_star : 0 < ‖x⋆‖ := norm_pos_iff.mpr ((AddEquiv.map_ne_zero_iff starAddEquiv (M := E)).mpr htriv)
[GOAL]
case neg
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝² : NonUnitalNormedRing E
inst✝¹ : StarRing E
inst✝ : CstarRing E
x : E
htriv : ¬x = 0
hnt : 0 < ‖x‖
hnt_star : 0 < ‖x⋆‖
⊢ ‖x⋆‖ = ‖x‖
[PROOFSTEP]
have h₁ :=
  calc
    ‖x‖ * ‖x‖ = ‖x⋆ * x‖ := norm_star_mul_self.symm
    _ ≤ ‖x⋆‖ * ‖x‖ := norm_mul_le _ _
[GOAL]
case neg
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝² : NonUnitalNormedRing E
inst✝¹ : StarRing E
inst✝ : CstarRing E
x : E
htriv : ¬x = 0
hnt : 0 < ‖x‖
hnt_star : 0 < ‖x⋆‖
h₁ : ‖x‖ * ‖x‖ ≤ ‖x⋆‖ * ‖x‖
⊢ ‖x⋆‖ = ‖x‖
[PROOFSTEP]
have h₂ :=
  calc
    ‖x⋆‖ * ‖x⋆‖ = ‖x * x⋆‖ := by rw [← norm_star_mul_self, star_star]
    _ ≤ ‖x‖ * ‖x⋆‖ := norm_mul_le _ _
[GOAL]
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝² : NonUnitalNormedRing E
inst✝¹ : StarRing E
inst✝ : CstarRing E
x : E
htriv : ¬x = 0
hnt : 0 < ‖x‖
hnt_star : 0 < ‖x⋆‖
h₁ : ‖x‖ * ‖x‖ ≤ ‖x⋆‖ * ‖x‖
⊢ ‖x⋆‖ * ‖x⋆‖ = ‖x * x⋆‖
[PROOFSTEP]
rw [← norm_star_mul_self, star_star]
[GOAL]
case neg
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝² : NonUnitalNormedRing E
inst✝¹ : StarRing E
inst✝ : CstarRing E
x : E
htriv : ¬x = 0
hnt : 0 < ‖x‖
hnt_star : 0 < ‖x⋆‖
h₁ : ‖x‖ * ‖x‖ ≤ ‖x⋆‖ * ‖x‖
h₂ : ‖x⋆‖ * ‖x⋆‖ ≤ ‖x‖ * ‖x⋆‖
⊢ ‖x⋆‖ = ‖x‖
[PROOFSTEP]
exact le_antisymm (le_of_mul_le_mul_right h₂ hnt_star) (le_of_mul_le_mul_right h₁ hnt)
[GOAL]
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝² : NonUnitalNormedRing E
inst✝¹ : StarRing E
inst✝ : CstarRing E
x : E
⊢ ‖x * x⋆‖ = ‖x‖ * ‖x‖
[PROOFSTEP]
nth_rw 1 [← star_star x]
[GOAL]
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝² : NonUnitalNormedRing E
inst✝¹ : StarRing E
inst✝ : CstarRing E
x : E
⊢ ‖x⋆⋆ * x⋆‖ = ‖x‖ * ‖x‖
[PROOFSTEP]
simp only [norm_star_mul_self, norm_star]
[GOAL]
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝² : NonUnitalNormedRing E
inst✝¹ : StarRing E
inst✝ : CstarRing E
x : E
⊢ ‖x⋆ * x‖ = ‖x⋆‖ * ‖x‖
[PROOFSTEP]
rw [norm_star_mul_self, norm_star]
[GOAL]
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝² : NonUnitalNormedRing E
inst✝¹ : StarRing E
inst✝ : CstarRing E
x : E
⊢ x⋆ * x = 0 ↔ x = 0
[PROOFSTEP]
rw [← norm_eq_zero, norm_star_mul_self]
[GOAL]
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝² : NonUnitalNormedRing E
inst✝¹ : StarRing E
inst✝ : CstarRing E
x : E
⊢ ‖x‖ * ‖x‖ = 0 ↔ x = 0
[PROOFSTEP]
exact mul_self_eq_zero.trans norm_eq_zero
[GOAL]
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝² : NonUnitalNormedRing E
inst✝¹ : StarRing E
inst✝ : CstarRing E
x : E
⊢ x⋆ * x ≠ 0 ↔ x ≠ 0
[PROOFSTEP]
simp only [Ne.def, star_mul_self_eq_zero_iff]
[GOAL]
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝² : NonUnitalNormedRing E
inst✝¹ : StarRing E
inst✝ : CstarRing E
x : E
⊢ x * x⋆ = 0 ↔ x = 0
[PROOFSTEP]
simpa only [star_eq_zero, star_star] using @star_mul_self_eq_zero_iff _ _ _ _ (star x)
[GOAL]
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝² : NonUnitalNormedRing E
inst✝¹ : StarRing E
inst✝ : CstarRing E
x : E
⊢ x * x⋆ ≠ 0 ↔ x ≠ 0
[PROOFSTEP]
simp only [Ne.def, mul_star_self_eq_zero_iff]
[GOAL]
𝕜 : Type u_1
E : Type u_2
α : Type u_3
ι : Type u_4
R₁ : Type u_5
R₂ : Type u_6
R : ι → Type u_7
inst✝⁹ : NonUnitalNormedRing R₁
inst✝⁸ : StarRing R₁
inst✝⁷ : CstarRing R₁
inst✝⁶ : NonUnitalNormedRing R₂
inst✝⁵ : StarRing R₂
inst✝⁴ : CstarRing R₂
inst✝³ : (i : ι) → NonUnitalNormedRing (R i)
inst✝² : (i : ι) → StarRing (R i)
inst✝¹ : Fintype ι
inst✝ : ∀ (i : ι), CstarRing (R i)
x : R₁ × R₂
⊢ ‖x⋆ * x‖ = ‖x‖ * ‖x‖
[PROOFSTEP]
dsimp only [norm]
[GOAL]
𝕜 : Type u_1
E : Type u_2
α : Type u_3
ι : Type u_4
R₁ : Type u_5
R₂ : Type u_6
R : ι → Type u_7
inst✝⁹ : NonUnitalNormedRing R₁
inst✝⁸ : StarRing R₁
inst✝⁷ : CstarRing R₁
inst✝⁶ : NonUnitalNormedRing R₂
inst✝⁵ : StarRing R₂
inst✝⁴ : CstarRing R₂
inst✝³ : (i : ι) → NonUnitalNormedRing (R i)
inst✝² : (i : ι) → StarRing (R i)
inst✝¹ : Fintype ι
inst✝ : ∀ (i : ι), CstarRing (R i)
x : R₁ × R₂
⊢ ‖(x⋆ * x).fst‖ ⊔ ‖(x⋆ * x).snd‖ = (‖x.fst‖ ⊔ ‖x.snd‖) * (‖x.fst‖ ⊔ ‖x.snd‖)
[PROOFSTEP]
simp only [Prod.fst_mul, Prod.fst_star, Prod.snd_mul, Prod.snd_star, norm_star_mul_self, ← sq]
[GOAL]
𝕜 : Type u_1
E : Type u_2
α : Type u_3
ι : Type u_4
R₁ : Type u_5
R₂ : Type u_6
R : ι → Type u_7
inst✝⁹ : NonUnitalNormedRing R₁
inst✝⁸ : StarRing R₁
inst✝⁷ : CstarRing R₁
inst✝⁶ : NonUnitalNormedRing R₂
inst✝⁵ : StarRing R₂
inst✝⁴ : CstarRing R₂
inst✝³ : (i : ι) → NonUnitalNormedRing (R i)
inst✝² : (i : ι) → StarRing (R i)
inst✝¹ : Fintype ι
inst✝ : ∀ (i : ι), CstarRing (R i)
x : R₁ × R₂
⊢ ‖x.fst‖ ^ 2 ⊔ ‖x.snd‖ ^ 2 = (‖x.fst‖ ⊔ ‖x.snd‖) ^ 2
[PROOFSTEP]
refine' le_antisymm _ _
[GOAL]
case refine'_1
𝕜 : Type u_1
E : Type u_2
α : Type u_3
ι : Type u_4
R₁ : Type u_5
R₂ : Type u_6
R : ι → Type u_7
inst✝⁹ : NonUnitalNormedRing R₁
inst✝⁸ : StarRing R₁
inst✝⁷ : CstarRing R₁
inst✝⁶ : NonUnitalNormedRing R₂
inst✝⁵ : StarRing R₂
inst✝⁴ : CstarRing R₂
inst✝³ : (i : ι) → NonUnitalNormedRing (R i)
inst✝² : (i : ι) → StarRing (R i)
inst✝¹ : Fintype ι
inst✝ : ∀ (i : ι), CstarRing (R i)
x : R₁ × R₂
⊢ ‖x.fst‖ ^ 2 ⊔ ‖x.snd‖ ^ 2 ≤ (‖x.fst‖ ⊔ ‖x.snd‖) ^ 2
[PROOFSTEP]
refine' max_le _ _
[GOAL]
case refine'_1.refine'_1
𝕜 : Type u_1
E : Type u_2
α : Type u_3
ι : Type u_4
R₁ : Type u_5
R₂ : Type u_6
R : ι → Type u_7
inst✝⁹ : NonUnitalNormedRing R₁
inst✝⁸ : StarRing R₁
inst✝⁷ : CstarRing R₁
inst✝⁶ : NonUnitalNormedRing R₂
inst✝⁵ : StarRing R₂
inst✝⁴ : CstarRing R₂
inst✝³ : (i : ι) → NonUnitalNormedRing (R i)
inst✝² : (i : ι) → StarRing (R i)
inst✝¹ : Fintype ι
inst✝ : ∀ (i : ι), CstarRing (R i)
x : R₁ × R₂
⊢ ‖x.fst‖ ^ 2 ≤ (‖x.fst‖ ⊔ ‖x.snd‖) ^ 2
[PROOFSTEP]
rw [sq_le_sq, abs_of_nonneg (norm_nonneg _)]
[GOAL]
case refine'_1.refine'_2
𝕜 : Type u_1
E : Type u_2
α : Type u_3
ι : Type u_4
R₁ : Type u_5
R₂ : Type u_6
R : ι → Type u_7
inst✝⁹ : NonUnitalNormedRing R₁
inst✝⁸ : StarRing R₁
inst✝⁷ : CstarRing R₁
inst✝⁶ : NonUnitalNormedRing R₂
inst✝⁵ : StarRing R₂
inst✝⁴ : CstarRing R₂
inst✝³ : (i : ι) → NonUnitalNormedRing (R i)
inst✝² : (i : ι) → StarRing (R i)
inst✝¹ : Fintype ι
inst✝ : ∀ (i : ι), CstarRing (R i)
x : R₁ × R₂
⊢ ‖x.snd‖ ^ 2 ≤ (‖x.fst‖ ⊔ ‖x.snd‖) ^ 2
[PROOFSTEP]
rw [sq_le_sq, abs_of_nonneg (norm_nonneg _)]
[GOAL]
case refine'_1.refine'_1
𝕜 : Type u_1
E : Type u_2
α : Type u_3
ι : Type u_4
R₁ : Type u_5
R₂ : Type u_6
R : ι → Type u_7
inst✝⁹ : NonUnitalNormedRing R₁
inst✝⁸ : StarRing R₁
inst✝⁷ : CstarRing R₁
inst✝⁶ : NonUnitalNormedRing R₂
inst✝⁵ : StarRing R₂
inst✝⁴ : CstarRing R₂
inst✝³ : (i : ι) → NonUnitalNormedRing (R i)
inst✝² : (i : ι) → StarRing (R i)
inst✝¹ : Fintype ι
inst✝ : ∀ (i : ι), CstarRing (R i)
x : R₁ × R₂
⊢ ‖x.fst‖ ≤ |‖x.fst‖ ⊔ ‖x.snd‖|
case refine'_1.refine'_2
𝕜 : Type u_1
E : Type u_2
α : Type u_3
ι : Type u_4
R₁ : Type u_5
R₂ : Type u_6
R : ι → Type u_7
inst✝⁹ : NonUnitalNormedRing R₁
inst✝⁸ : StarRing R₁
inst✝⁷ : CstarRing R₁
inst✝⁶ : NonUnitalNormedRing R₂
inst✝⁵ : StarRing R₂
inst✝⁴ : CstarRing R₂
inst✝³ : (i : ι) → NonUnitalNormedRing (R i)
inst✝² : (i : ι) → StarRing (R i)
inst✝¹ : Fintype ι
inst✝ : ∀ (i : ι), CstarRing (R i)
x : R₁ × R₂
⊢ ‖x.snd‖ ≤ |‖x.fst‖ ⊔ ‖x.snd‖|
[PROOFSTEP]
exact (le_max_left _ _).trans (le_abs_self _)
[GOAL]
case refine'_1.refine'_2
𝕜 : Type u_1
E : Type u_2
α : Type u_3
ι : Type u_4
R₁ : Type u_5
R₂ : Type u_6
R : ι → Type u_7
inst✝⁹ : NonUnitalNormedRing R₁
inst✝⁸ : StarRing R₁
inst✝⁷ : CstarRing R₁
inst✝⁶ : NonUnitalNormedRing R₂
inst✝⁵ : StarRing R₂
inst✝⁴ : CstarRing R₂
inst✝³ : (i : ι) → NonUnitalNormedRing (R i)
inst✝² : (i : ι) → StarRing (R i)
inst✝¹ : Fintype ι
inst✝ : ∀ (i : ι), CstarRing (R i)
x : R₁ × R₂
⊢ ‖x.snd‖ ≤ |‖x.fst‖ ⊔ ‖x.snd‖|
[PROOFSTEP]
exact (le_max_right _ _).trans (le_abs_self _)
[GOAL]
case refine'_2
𝕜 : Type u_1
E : Type u_2
α : Type u_3
ι : Type u_4
R₁ : Type u_5
R₂ : Type u_6
R : ι → Type u_7
inst✝⁹ : NonUnitalNormedRing R₁
inst✝⁸ : StarRing R₁
inst✝⁷ : CstarRing R₁
inst✝⁶ : NonUnitalNormedRing R₂
inst✝⁵ : StarRing R₂
inst✝⁴ : CstarRing R₂
inst✝³ : (i : ι) → NonUnitalNormedRing (R i)
inst✝² : (i : ι) → StarRing (R i)
inst✝¹ : Fintype ι
inst✝ : ∀ (i : ι), CstarRing (R i)
x : R₁ × R₂
⊢ (‖x.fst‖ ⊔ ‖x.snd‖) ^ 2 ≤ ‖x.fst‖ ^ 2 ⊔ ‖x.snd‖ ^ 2
[PROOFSTEP]
rw [le_sup_iff]
[GOAL]
case refine'_2
𝕜 : Type u_1
E : Type u_2
α : Type u_3
ι : Type u_4
R₁ : Type u_5
R₂ : Type u_6
R : ι → Type u_7
inst✝⁹ : NonUnitalNormedRing R₁
inst✝⁸ : StarRing R₁
inst✝⁷ : CstarRing R₁
inst✝⁶ : NonUnitalNormedRing R₂
inst✝⁵ : StarRing R₂
inst✝⁴ : CstarRing R₂
inst✝³ : (i : ι) → NonUnitalNormedRing (R i)
inst✝² : (i : ι) → StarRing (R i)
inst✝¹ : Fintype ι
inst✝ : ∀ (i : ι), CstarRing (R i)
x : R₁ × R₂
⊢ (‖x.fst‖ ⊔ ‖x.snd‖) ^ 2 ≤ ‖x.fst‖ ^ 2 ∨ (‖x.fst‖ ⊔ ‖x.snd‖) ^ 2 ≤ ‖x.snd‖ ^ 2
[PROOFSTEP]
rcases le_total ‖x.fst‖ ‖x.snd‖ with (h | h)
[GOAL]
case refine'_2.inl
𝕜 : Type u_1
E : Type u_2
α : Type u_3
ι : Type u_4
R₁ : Type u_5
R₂ : Type u_6
R : ι → Type u_7
inst✝⁹ : NonUnitalNormedRing R₁
inst✝⁸ : StarRing R₁
inst✝⁷ : CstarRing R₁
inst✝⁶ : NonUnitalNormedRing R₂
inst✝⁵ : StarRing R₂
inst✝⁴ : CstarRing R₂
inst✝³ : (i : ι) → NonUnitalNormedRing (R i)
inst✝² : (i : ι) → StarRing (R i)
inst✝¹ : Fintype ι
inst✝ : ∀ (i : ι), CstarRing (R i)
x : R₁ × R₂
h : ‖x.fst‖ ≤ ‖x.snd‖
⊢ (‖x.fst‖ ⊔ ‖x.snd‖) ^ 2 ≤ ‖x.fst‖ ^ 2 ∨ (‖x.fst‖ ⊔ ‖x.snd‖) ^ 2 ≤ ‖x.snd‖ ^ 2
[PROOFSTEP]
simp [h]
[GOAL]
case refine'_2.inr
𝕜 : Type u_1
E : Type u_2
α : Type u_3
ι : Type u_4
R₁ : Type u_5
R₂ : Type u_6
R : ι → Type u_7
inst✝⁹ : NonUnitalNormedRing R₁
inst✝⁸ : StarRing R₁
inst✝⁷ : CstarRing R₁
inst✝⁶ : NonUnitalNormedRing R₂
inst✝⁵ : StarRing R₂
inst✝⁴ : CstarRing R₂
inst✝³ : (i : ι) → NonUnitalNormedRing (R i)
inst✝² : (i : ι) → StarRing (R i)
inst✝¹ : Fintype ι
inst✝ : ∀ (i : ι), CstarRing (R i)
x : R₁ × R₂
h : ‖x.snd‖ ≤ ‖x.fst‖
⊢ (‖x.fst‖ ⊔ ‖x.snd‖) ^ 2 ≤ ‖x.fst‖ ^ 2 ∨ (‖x.fst‖ ⊔ ‖x.snd‖) ^ 2 ≤ ‖x.snd‖ ^ 2
[PROOFSTEP]
simp [h]
[GOAL]
𝕜 : Type u_1
E : Type u_2
α : Type u_3
ι : Type u_4
R₁ : Type u_5
R₂ : Type u_6
R : ι → Type u_7
inst✝⁹ : NonUnitalNormedRing R₁
inst✝⁸ : StarRing R₁
inst✝⁷ : CstarRing R₁
inst✝⁶ : NonUnitalNormedRing R₂
inst✝⁵ : StarRing R₂
inst✝⁴ : CstarRing R₂
inst✝³ : (i : ι) → NonUnitalNormedRing (R i)
inst✝² : (i : ι) → StarRing (R i)
inst✝¹ : Fintype ι
inst✝ : ∀ (i : ι), CstarRing (R i)
x : (i : ι) → R i
⊢ ‖x⋆ * x‖ = ‖x‖ * ‖x‖
[PROOFSTEP]
simp only [norm, Pi.mul_apply, Pi.star_apply, nnnorm_star_mul_self, ← sq]
[GOAL]
𝕜 : Type u_1
E : Type u_2
α : Type u_3
ι : Type u_4
R₁ : Type u_5
R₂ : Type u_6
R : ι → Type u_7
inst✝⁹ : NonUnitalNormedRing R₁
inst✝⁸ : StarRing R₁
inst✝⁷ : CstarRing R₁
inst✝⁶ : NonUnitalNormedRing R₂
inst✝⁵ : StarRing R₂
inst✝⁴ : CstarRing R₂
inst✝³ : (i : ι) → NonUnitalNormedRing (R i)
inst✝² : (i : ι) → StarRing (R i)
inst✝¹ : Fintype ι
inst✝ : ∀ (i : ι), CstarRing (R i)
x : (i : ι) → R i
⊢ ↑(Finset.sup Finset.univ fun b => ‖x b‖₊ ^ 2) = ↑(Finset.sup Finset.univ fun b => ‖x b‖₊) ^ 2
[PROOFSTEP]
norm_cast
[GOAL]
𝕜 : Type u_1
E : Type u_2
α : Type u_3
ι : Type u_4
R₁ : Type u_5
R₂ : Type u_6
R : ι → Type u_7
inst✝⁹ : NonUnitalNormedRing R₁
inst✝⁸ : StarRing R₁
inst✝⁷ : CstarRing R₁
inst✝⁶ : NonUnitalNormedRing R₂
inst✝⁵ : StarRing R₂
inst✝⁴ : CstarRing R₂
inst✝³ : (i : ι) → NonUnitalNormedRing (R i)
inst✝² : (i : ι) → StarRing (R i)
inst✝¹ : Fintype ι
inst✝ : ∀ (i : ι), CstarRing (R i)
x : (i : ι) → R i
⊢ (Finset.sup Finset.univ fun b => ‖x b‖₊ ^ 2) = (Finset.sup Finset.univ fun b => ‖x b‖₊) ^ 2
[PROOFSTEP]
exact
  (Finset.comp_sup_eq_sup_comp_of_is_total (fun x : NNReal => x ^ 2)
      (fun x y h => by simpa only [sq] using mul_le_mul' h h) (by simp)).symm
[GOAL]
𝕜 : Type u_1
E : Type u_2
α : Type u_3
ι : Type u_4
R₁ : Type u_5
R₂ : Type u_6
R : ι → Type u_7
inst✝⁹ : NonUnitalNormedRing R₁
inst✝⁸ : StarRing R₁
inst✝⁷ : CstarRing R₁
inst✝⁶ : NonUnitalNormedRing R₂
inst✝⁵ : StarRing R₂
inst✝⁴ : CstarRing R₂
inst✝³ : (i : ι) → NonUnitalNormedRing (R i)
inst✝² : (i : ι) → StarRing (R i)
inst✝¹ : Fintype ι
inst✝ : ∀ (i : ι), CstarRing (R i)
x✝ : (i : ι) → R i
x y : NNReal
h : x ≤ y
⊢ (fun x => x ^ 2) x ≤ (fun x => x ^ 2) y
[PROOFSTEP]
simpa only [sq] using mul_le_mul' h h
[GOAL]
𝕜 : Type u_1
E : Type u_2
α : Type u_3
ι : Type u_4
R₁ : Type u_5
R₂ : Type u_6
R : ι → Type u_7
inst✝⁹ : NonUnitalNormedRing R₁
inst✝⁸ : StarRing R₁
inst✝⁷ : CstarRing R₁
inst✝⁶ : NonUnitalNormedRing R₂
inst✝⁵ : StarRing R₂
inst✝⁴ : CstarRing R₂
inst✝³ : (i : ι) → NonUnitalNormedRing (R i)
inst✝² : (i : ι) → StarRing (R i)
inst✝¹ : Fintype ι
inst✝ : ∀ (i : ι), CstarRing (R i)
x : (i : ι) → R i
⊢ (fun x => x ^ 2) ⊥ = ⊥
[PROOFSTEP]
simp
[GOAL]
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝³ : NormedRing E
inst✝² : StarRing E
inst✝¹ : CstarRing E
inst✝ : Nontrivial E
⊢ ‖1‖ = 1
[PROOFSTEP]
have : 0 < ‖(1 : E)‖ := norm_pos_iff.mpr one_ne_zero
[GOAL]
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝³ : NormedRing E
inst✝² : StarRing E
inst✝¹ : CstarRing E
inst✝ : Nontrivial E
this : 0 < ‖1‖
⊢ ‖1‖ = 1
[PROOFSTEP]
rw [← mul_left_inj' this.ne', ← norm_star_mul_self, mul_one, star_one, one_mul]
[GOAL]
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝³ : NormedRing E
inst✝² : StarRing E
inst✝¹ : CstarRing E
inst✝ : Nontrivial E
U : { x // x ∈ unitary E }
⊢ ‖↑U‖ = 1
[PROOFSTEP]
rw [← sq_eq_sq (norm_nonneg _) zero_le_one, one_pow 2, sq, ← CstarRing.norm_star_mul_self, unitary.coe_star_mul_self,
  CstarRing.norm_one]
[GOAL]
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝² : NormedRing E
inst✝¹ : StarRing E
inst✝ : CstarRing E
U : { x // x ∈ unitary E }
A : E
⊢ ‖↑U * A‖ = ‖A‖
[PROOFSTEP]
nontriviality E
[GOAL]
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝² : NormedRing E
inst✝¹ : StarRing E
inst✝ : CstarRing E
U : { x // x ∈ unitary E }
A : E
✝ : Nontrivial E
⊢ ‖↑U * A‖ = ‖A‖
[PROOFSTEP]
refine' le_antisymm _ _
[GOAL]
case refine'_1
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝² : NormedRing E
inst✝¹ : StarRing E
inst✝ : CstarRing E
U : { x // x ∈ unitary E }
A : E
✝ : Nontrivial E
⊢ ‖↑U * A‖ ≤ ‖A‖
[PROOFSTEP]
calc
  _ ≤ ‖(U : E)‖ * ‖A‖ := norm_mul_le _ _
  _ = ‖A‖ := by rw [norm_coe_unitary, one_mul]
[GOAL]
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝² : NormedRing E
inst✝¹ : StarRing E
inst✝ : CstarRing E
U : { x // x ∈ unitary E }
A : E
✝ : Nontrivial E
⊢ ‖↑U‖ * ‖A‖ = ‖A‖
[PROOFSTEP]
rw [norm_coe_unitary, one_mul]
[GOAL]
case refine'_2
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝² : NormedRing E
inst✝¹ : StarRing E
inst✝ : CstarRing E
U : { x // x ∈ unitary E }
A : E
✝ : Nontrivial E
⊢ ‖A‖ ≤ ‖↑U * A‖
[PROOFSTEP]
calc
  _ = ‖(U : E)⋆ * U * A‖ := by rw [unitary.coe_star_mul_self U, one_mul]
  _ ≤ ‖(U : E)⋆‖ * ‖(U : E) * A‖ := by
    rw [mul_assoc]
    exact norm_mul_le _ _
  _ = ‖(U : E) * A‖ := by rw [norm_star, norm_coe_unitary, one_mul]
[GOAL]
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝² : NormedRing E
inst✝¹ : StarRing E
inst✝ : CstarRing E
U : { x // x ∈ unitary E }
A : E
✝ : Nontrivial E
⊢ ‖A‖ = ‖(↑U)⋆ * ↑U * A‖
[PROOFSTEP]
rw [unitary.coe_star_mul_self U, one_mul]
[GOAL]
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝² : NormedRing E
inst✝¹ : StarRing E
inst✝ : CstarRing E
U : { x // x ∈ unitary E }
A : E
✝ : Nontrivial E
⊢ ‖(↑U)⋆ * ↑U * A‖ ≤ ‖(↑U)⋆‖ * ‖↑U * A‖
[PROOFSTEP]
rw [mul_assoc]
[GOAL]
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝² : NormedRing E
inst✝¹ : StarRing E
inst✝ : CstarRing E
U : { x // x ∈ unitary E }
A : E
✝ : Nontrivial E
⊢ ‖(↑U)⋆ * (↑U * A)‖ ≤ ‖(↑U)⋆‖ * ‖↑U * A‖
[PROOFSTEP]
exact norm_mul_le _ _
[GOAL]
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝² : NormedRing E
inst✝¹ : StarRing E
inst✝ : CstarRing E
U : { x // x ∈ unitary E }
A : E
✝ : Nontrivial E
⊢ ‖(↑U)⋆‖ * ‖↑U * A‖ = ‖↑U * A‖
[PROOFSTEP]
rw [norm_star, norm_coe_unitary, one_mul]
[GOAL]
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝² : NormedRing E
inst✝¹ : StarRing E
inst✝ : CstarRing E
A : E
U : { x // x ∈ unitary E }
⊢ ‖A * ↑U‖ = ‖((↑U)⋆ * A⋆)⋆‖
[PROOFSTEP]
simp only [star_star, star_mul]
[GOAL]
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝² : NormedRing E
inst✝¹ : StarRing E
inst✝ : CstarRing E
A : E
U : { x // x ∈ unitary E }
⊢ ‖((↑U)⋆ * A⋆)⋆‖ = ‖(↑U)⋆ * A⋆‖
[PROOFSTEP]
rw [norm_star]
[GOAL]
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝² : NormedRing E
inst✝¹ : StarRing E
inst✝ : CstarRing E
x : E
hx : IsSelfAdjoint x
n : ℕ
⊢ ‖x ^ 2 ^ n‖₊ = ‖x‖₊ ^ 2 ^ n
[PROOFSTEP]
induction' n with k hk
[GOAL]
case zero
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝² : NormedRing E
inst✝¹ : StarRing E
inst✝ : CstarRing E
x : E
hx : IsSelfAdjoint x
⊢ ‖x ^ 2 ^ Nat.zero‖₊ = ‖x‖₊ ^ 2 ^ Nat.zero
[PROOFSTEP]
simp only [pow_zero, pow_one, Nat.zero_eq]
[GOAL]
case succ
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝² : NormedRing E
inst✝¹ : StarRing E
inst✝ : CstarRing E
x : E
hx : IsSelfAdjoint x
k : ℕ
hk : ‖x ^ 2 ^ k‖₊ = ‖x‖₊ ^ 2 ^ k
⊢ ‖x ^ 2 ^ Nat.succ k‖₊ = ‖x‖₊ ^ 2 ^ Nat.succ k
[PROOFSTEP]
rw [pow_succ, pow_mul', sq]
[GOAL]
case succ
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝² : NormedRing E
inst✝¹ : StarRing E
inst✝ : CstarRing E
x : E
hx : IsSelfAdjoint x
k : ℕ
hk : ‖x ^ 2 ^ k‖₊ = ‖x‖₊ ^ 2 ^ k
⊢ ‖x ^ 2 ^ k * x ^ 2 ^ k‖₊ = ‖x‖₊ ^ (2 * 2 ^ k)
[PROOFSTEP]
nth_rw 1 [← selfAdjoint.mem_iff.mp hx]
[GOAL]
case succ
𝕜 : Type u_1
E : Type u_2
α : Type u_3
inst✝² : NormedRing E
inst✝¹ : StarRing E
inst✝ : CstarRing E
x : E
hx : IsSelfAdjoint x
k : ℕ
hk : ‖x ^ 2 ^ k‖₊ = ‖x‖₊ ^ 2 ^ k
⊢ ‖x⋆ ^ 2 ^ k * x ^ 2 ^ k‖₊ = ‖x‖₊ ^ (2 * 2 ^ k)
[PROOFSTEP]
rw [← star_pow, CstarRing.nnnorm_star_mul_self, ← sq, hk, pow_mul']


[GOAL]
α : Sort u_1
β : Sort u_2
γ : Sort u_3
h : Nonempty α
inst✝ : IsEmpty β
⊢ IsEmpty (α → β)
[PROOFSTEP]
infer_instance
[GOAL]
α : Sort u_1
β : Sort u_2
γ : Sort u_3
p : Prop
⊢ IsEmpty p ↔ ¬p
[PROOFSTEP]
simp only [← not_nonempty_iff, nonempty_Prop]
[GOAL]
α : Sort u_1
β : Sort u_2
γ : Sort u_3
π : α → Sort u_4
⊢ IsEmpty ((a : α) → π a) ↔ ∃ a, IsEmpty (π a)
[PROOFSTEP]
simp only [← not_nonempty_iff, Classical.nonempty_pi, not_forall]
[GOAL]
α✝ : Sort u_1
β : Sort u_2
γ : Sort u_3
α : Type u_5
E : α → Type u_4
⊢ IsEmpty (Sigma E) ↔ ∀ (a : α), IsEmpty (E a)
[PROOFSTEP]
simp only [← not_nonempty_iff, nonempty_sigma, not_exists]
[GOAL]
α✝ : Sort u_1
β : Sort u_2
γ : Sort u_3
α : Sort u_5
E : α → Sort u_4
⊢ IsEmpty (PSigma E) ↔ ∀ (a : α), IsEmpty (E a)
[PROOFSTEP]
simp only [← not_nonempty_iff, nonempty_psigma, not_exists]
[GOAL]
α : Sort u_1
β : Sort u_2
γ : Sort u_3
p : α → Prop
⊢ IsEmpty (Subtype p) ↔ ∀ (x : α), ¬p x
[PROOFSTEP]
simp only [← not_nonempty_iff, nonempty_subtype, not_exists]
[GOAL]
α✝ : Sort u_1
β✝ : Sort u_2
γ : Sort u_3
α : Type u_4
β : Type u_5
⊢ IsEmpty (α × β) ↔ IsEmpty α ∨ IsEmpty β
[PROOFSTEP]
simp only [← not_nonempty_iff, nonempty_prod, not_and_or]
[GOAL]
α : Sort u_1
β : Sort u_2
γ : Sort u_3
⊢ IsEmpty (PProd α β) ↔ IsEmpty α ∨ IsEmpty β
[PROOFSTEP]
simp only [← not_nonempty_iff, nonempty_pprod, not_and_or]
[GOAL]
α✝ : Sort u_1
β✝ : Sort u_2
γ : Sort u_3
α : Type u_4
β : Type u_5
⊢ IsEmpty (α ⊕ β) ↔ IsEmpty α ∧ IsEmpty β
[PROOFSTEP]
simp only [← not_nonempty_iff, nonempty_sum, not_or]
[GOAL]
α✝ : Sort u_1
β✝ : Sort u_2
γ : Sort u_3
α : Sort u_4
β : Sort u_5
⊢ IsEmpty (α ⊕' β) ↔ IsEmpty α ∧ IsEmpty β
[PROOFSTEP]
simp only [← not_nonempty_iff, nonempty_psum, not_or]
[GOAL]
α✝ : Sort u_1
β : Sort u_2
γ : Sort u_3
α : Type u_4
⊢ IsEmpty (ULift α) ↔ IsEmpty α
[PROOFSTEP]
simp only [← not_nonempty_iff, nonempty_ulift]
[GOAL]
α✝ : Sort u_1
β : Sort u_2
γ : Sort u_3
α : Sort u_4
⊢ IsEmpty (PLift α) ↔ IsEmpty α
[PROOFSTEP]
simp only [← not_nonempty_iff, nonempty_plift]


[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
h : a ≤ b
⊢ a + (b - a) = b
[PROOFSTEP]
refine' le_antisymm _ le_add_tsub
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
h : a ≤ b
⊢ a + (b - a) ≤ b
[PROOFSTEP]
obtain ⟨c, rfl⟩ := exists_add_of_le h
[GOAL]
case intro
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a c✝ d c : α
h : a ≤ a + c
⊢ a + (a + c - a) ≤ a + c
[PROOFSTEP]
exact add_le_add_left add_tsub_le_left a
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
h : a ≤ b
⊢ b - a + a = b
[PROOFSTEP]
rw [add_comm]
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
h : a ≤ b
⊢ a + (b - a) = b
[PROOFSTEP]
exact add_tsub_cancel_of_le h
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
h : c ≤ b
⊢ a - c ≤ b - c ↔ a ≤ b
[PROOFSTEP]
rw [tsub_le_iff_right, tsub_add_cancel_of_le h]
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
h1 : c ≤ a
h2 : c ≤ b
⊢ a - c = b - c ↔ a = b
[PROOFSTEP]
simp_rw [le_antisymm_iff, tsub_le_tsub_iff_right h1, tsub_le_tsub_iff_right h2]
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
h : c ≤ b
h2 : a - c < b - c
⊢ a < b
[PROOFSTEP]
refine' ((tsub_le_tsub_iff_right h).mp h2.le).lt_of_ne _
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
h : c ≤ b
h2 : a - c < b - c
⊢ a ≠ b
[PROOFSTEP]
rintro rfl
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a c d : α
h : c ≤ a
h2 : a - c < a - c
⊢ False
[PROOFSTEP]
exact h2.false
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
hab : b ≤ a
hcb : c ≤ b
⊢ a - b + (b - c) = a - c
[PROOFSTEP]
convert tsub_add_cancel_of_le (tsub_le_tsub_right hab c) using 2
[GOAL]
case h.e'_2.h.e'_5
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
hab : b ≤ a
hcb : c ≤ b
⊢ a - b = a - c - (b - c)
[PROOFSTEP]
rw [tsub_tsub, add_tsub_cancel_of_le hcb]
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
h : c ≤ b
⊢ a - c - (b - c) = a - b
[PROOFSTEP]
rw [tsub_tsub, add_tsub_cancel_of_le h]
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
hc : AddLECancellable c
h : c ≤ b
⊢ a = b - c → a + c = b
[PROOFSTEP]
rintro rfl
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
b c d : α
hc : AddLECancellable c
h : c ≤ b
⊢ b - c + c = b
[PROOFSTEP]
exact tsub_add_cancel_of_le h
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
hb : AddLECancellable b
h : b ≤ a
⊢ a - b = c ↔ a = c + b
[PROOFSTEP]
rw [eq_comm, hb.eq_tsub_iff_add_eq_of_le h, eq_comm]
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a✝ b c d : α
hc : AddLECancellable c
h : c ≤ b
a : α
⊢ a + b - c = a + (b - c)
[PROOFSTEP]
conv_lhs => rw [← add_tsub_cancel_of_le h, add_comm c, ← add_assoc, hc.add_tsub_cancel_right]
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a✝ b c d : α
hc : AddLECancellable c
h : c ≤ b
a : α
| a + b - c
[PROOFSTEP]
rw [← add_tsub_cancel_of_le h, add_comm c, ← add_assoc, hc.add_tsub_cancel_right]
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a✝ b c d : α
hc : AddLECancellable c
h : c ≤ b
a : α
| a + b - c
[PROOFSTEP]
rw [← add_tsub_cancel_of_le h, add_comm c, ← add_assoc, hc.add_tsub_cancel_right]
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a✝ b c d : α
hc : AddLECancellable c
h : c ≤ b
a : α
| a + b - c
[PROOFSTEP]
rw [← add_tsub_cancel_of_le h, add_comm c, ← add_assoc, hc.add_tsub_cancel_right]
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
hb : AddLECancellable b
h : b ≤ a
⊢ a - b + c = a + c - b
[PROOFSTEP]
rw [add_comm a, hb.add_tsub_assoc_of_le h, add_comm]
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
hbc : AddLECancellable (b - c)
h₁ : b ≤ a
h₂ : c ≤ b
⊢ a = a - b + c + (b - c)
[PROOFSTEP]
rw [add_assoc, add_tsub_cancel_of_le h₂, tsub_add_cancel_of_le h₁]
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
hb : AddLECancellable b
hd : AddLECancellable d
hba : b ≤ a
hdc : d ≤ c
⊢ a - b + (c - d) = a + c - (b + d)
[PROOFSTEP]
rw [hb.tsub_add_eq_add_tsub hba, ← hd.add_tsub_assoc_of_le hdc, tsub_tsub, add_comm d]
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
ha : AddLECancellable a
h : a ≤ c
⊢ b ≤ c - a ↔ b + a ≤ c
[PROOFSTEP]
rw [add_comm]
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
ha : AddLECancellable a
h : a ≤ c
⊢ b ≤ c - a ↔ a + b ≤ c
[PROOFSTEP]
exact ha.le_tsub_iff_left h
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
hb : AddLECancellable b
hba : b ≤ a
⊢ a - b < c ↔ a < b + c
[PROOFSTEP]
refine' ⟨hb.lt_add_of_tsub_lt_left, _⟩
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
hb : AddLECancellable b
hba : b ≤ a
⊢ a < b + c → a - b < c
[PROOFSTEP]
intro h
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
hb : AddLECancellable b
hba : b ≤ a
h : a < b + c
⊢ a - b < c
[PROOFSTEP]
refine' (tsub_le_iff_left.mpr h.le).lt_of_ne _
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
hb : AddLECancellable b
hba : b ≤ a
h : a < b + c
⊢ a - b ≠ c
[PROOFSTEP]
rintro rfl
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b d : α
hb : AddLECancellable b
hba : b ≤ a
h : a < b + (a - b)
⊢ False
[PROOFSTEP]
exact h.ne' (add_tsub_cancel_of_le hba)
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
hb : AddLECancellable b
hba : b ≤ a
⊢ a - b < c ↔ a < c + b
[PROOFSTEP]
rw [add_comm]
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
hb : AddLECancellable b
hba : b ≤ a
⊢ a - b < c ↔ a < b + c
[PROOFSTEP]
exact hb.tsub_lt_iff_left hba
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
hb : AddLECancellable b
hc : AddLECancellable c
h₁ : b ≤ a
h₂ : c ≤ a
⊢ a - b < c ↔ a - c < b
[PROOFSTEP]
rw [hb.tsub_lt_iff_left h₁, hc.tsub_lt_iff_right h₂]
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
ha : AddLECancellable a
hc : AddLECancellable c
h₁ : a ≤ b
h₂ : c ≤ b
⊢ a ≤ b - c ↔ c ≤ b - a
[PROOFSTEP]
rw [ha.le_tsub_iff_left h₁, hc.le_tsub_iff_right h₂]
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
hc : AddLECancellable c
h : c ≤ b
⊢ a < b - c ↔ a + c < b
[PROOFSTEP]
refine' ⟨fun h' => (add_le_of_le_tsub_right_of_le h h'.le).lt_of_ne _, hc.lt_tsub_of_add_lt_right⟩
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
hc : AddLECancellable c
h : c ≤ b
h' : a < b - c
⊢ a + c ≠ b
[PROOFSTEP]
rintro rfl
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a c d : α
hc : AddLECancellable c
h : c ≤ a + c
h' : a < a + c - c
⊢ False
[PROOFSTEP]
exact h'.ne' hc.add_tsub_cancel_right
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
hc : AddLECancellable c
h : c ≤ b
⊢ a < b - c ↔ c + a < b
[PROOFSTEP]
rw [add_comm]
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
hc : AddLECancellable c
h : c ≤ b
⊢ a < b - c ↔ a + c < b
[PROOFSTEP]
exact hc.lt_tsub_iff_right_of_le h
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
hab : AddLECancellable (a - b)
h₁ : b ≤ a
h₂ : c ≤ a
h₃ : a - b = a - c
⊢ b = c
[PROOFSTEP]
rw [← hab.inj]
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
hab : AddLECancellable (a - b)
h₁ : b ≤ a
h₂ : c ≤ a
h₃ : a - b = a - c
⊢ a - b + b = a - b + c
[PROOFSTEP]
rw [tsub_add_cancel_of_le h₁, h₃, tsub_add_cancel_of_le h₂]
[GOAL]
α : Type u_1
inst✝⁶ : AddCommSemigroup α
inst✝⁵ : PartialOrder α
inst✝⁴ : ExistsAddOfLE α
inst✝³ : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝² : Sub α
inst✝¹ : OrderedSub α
a b c d : α
inst✝ : ContravariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x < x_1
hb : AddLECancellable b
hca : c ≤ a
h : a - b < a - c
⊢ c < b
[PROOFSTEP]
conv_lhs at h => rw [← tsub_add_cancel_of_le hca]
[GOAL]
α : Type u_1
inst✝⁶ : AddCommSemigroup α
inst✝⁵ : PartialOrder α
inst✝⁴ : ExistsAddOfLE α
inst✝³ : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝² : Sub α
inst✝¹ : OrderedSub α
a b c d : α
inst✝ : ContravariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x < x_1
hb : AddLECancellable b
hca : c ≤ a
h : a - b < a - c
| a - b
[PROOFSTEP]
rw [← tsub_add_cancel_of_le hca]
[GOAL]
α : Type u_1
inst✝⁶ : AddCommSemigroup α
inst✝⁵ : PartialOrder α
inst✝⁴ : ExistsAddOfLE α
inst✝³ : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝² : Sub α
inst✝¹ : OrderedSub α
a b c d : α
inst✝ : ContravariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x < x_1
hb : AddLECancellable b
hca : c ≤ a
h : a - b < a - c
| a - b
[PROOFSTEP]
rw [← tsub_add_cancel_of_le hca]
[GOAL]
α : Type u_1
inst✝⁶ : AddCommSemigroup α
inst✝⁵ : PartialOrder α
inst✝⁴ : ExistsAddOfLE α
inst✝³ : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝² : Sub α
inst✝¹ : OrderedSub α
a b c d : α
inst✝ : ContravariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x < x_1
hb : AddLECancellable b
hca : c ≤ a
h : a - b < a - c
| a - b
[PROOFSTEP]
rw [← tsub_add_cancel_of_le hca]
[GOAL]
α : Type u_1
inst✝⁶ : AddCommSemigroup α
inst✝⁵ : PartialOrder α
inst✝⁴ : ExistsAddOfLE α
inst✝³ : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝² : Sub α
inst✝¹ : OrderedSub α
a b c d : α
inst✝ : ContravariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x < x_1
hb : AddLECancellable b
hca : c ≤ a
h : a - c + c - b < a - c
⊢ c < b
[PROOFSTEP]
exact lt_of_add_lt_add_left (hb.lt_add_of_tsub_lt_right h)
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
hc : AddLECancellable c
h : c ≤ a
h2 : a < b
⊢ a - c < b - c
[PROOFSTEP]
apply hc.lt_tsub_of_add_lt_left
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
hc : AddLECancellable c
h : c ≤ a
h2 : a < b
⊢ c + (a - c) < b
[PROOFSTEP]
rwa [add_tsub_cancel_of_le h]
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
hac : AddLECancellable (a - c)
h : c ≤ a
⊢ a + b = b + c + (a - c)
[PROOFSTEP]
rw [add_assoc, add_tsub_cancel_of_le h, add_comm]
[GOAL]
α : Type u_1
inst✝⁵ : AddCommSemigroup α
inst✝⁴ : PartialOrder α
inst✝³ : ExistsAddOfLE α
inst✝² : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
hab : AddLECancellable (a - b)
h : b ≤ a
⊢ a - c - (a - b) = b - c
[PROOFSTEP]
rw [tsub_right_comm, hab.tsub_tsub_cancel_of_le h]
[GOAL]
α : Type u_1
inst✝² : CanonicallyOrderedAddMonoid α
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
⊢ b - a + a = b ↔ a ≤ b
[PROOFSTEP]
rw [add_comm]
[GOAL]
α : Type u_1
inst✝² : CanonicallyOrderedAddMonoid α
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
⊢ a + (b - a) = b ↔ a ≤ b
[PROOFSTEP]
exact add_tsub_cancel_iff_le
[GOAL]
α : Type u_1
inst✝² : CanonicallyOrderedAddMonoid α
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
⊢ a - b = 0 ↔ a ≤ b
[PROOFSTEP]
rw [← nonpos_iff_eq_zero, tsub_le_iff_left, add_zero]
[GOAL]
α : Type u_1
inst✝² : CanonicallyOrderedAddMonoid α
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
⊢ 0 < a - b ↔ ¬a ≤ b
[PROOFSTEP]
rw [pos_iff_ne_zero, Ne.def, tsub_eq_zero_iff_le]
[GOAL]
α : Type u_1
inst✝² : CanonicallyOrderedAddMonoid α
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
ha : AddLECancellable a
hc : AddLECancellable c
h : c ≤ a
⊢ a - b ≤ a - c ↔ c ≤ b
[PROOFSTEP]
refine' ⟨_, fun h => tsub_le_tsub_left h a⟩
[GOAL]
α : Type u_1
inst✝² : CanonicallyOrderedAddMonoid α
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
ha : AddLECancellable a
hc : AddLECancellable c
h : c ≤ a
⊢ a - b ≤ a - c → c ≤ b
[PROOFSTEP]
rw [tsub_le_iff_left, ← hc.add_tsub_assoc_of_le h, hc.le_tsub_iff_right (h.trans le_add_self), add_comm b]
[GOAL]
α : Type u_1
inst✝² : CanonicallyOrderedAddMonoid α
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
ha : AddLECancellable a
hc : AddLECancellable c
h : c ≤ a
⊢ a + c ≤ a + b → c ≤ b
[PROOFSTEP]
apply ha
[GOAL]
α : Type u_1
inst✝² : CanonicallyOrderedAddMonoid α
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
ha : AddLECancellable a
hb : AddLECancellable b
hc : AddLECancellable c
hba : b ≤ a
hca : c ≤ a
⊢ a - b = a - c ↔ b = c
[PROOFSTEP]
simp_rw [le_antisymm_iff, ha.tsub_le_tsub_iff_left hb hba, ha.tsub_le_tsub_iff_left hc hca, and_comm]
[GOAL]
α : Type u_1
inst✝³ : CanonicallyOrderedAddMonoid α
inst✝² : Sub α
inst✝¹ : OrderedSub α
a b c d : α
inst✝ : ContravariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
⊢ AddCommMonoid α
[PROOFSTEP]
infer_instance
[GOAL]
α : Type u_1
inst✝³ : CanonicallyOrderedAddMonoid α
inst✝² : Sub α
inst✝¹ : OrderedSub α
a✝ b✝ c✝ d : α
inst✝ : ContravariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
src✝ : AddCommMonoid α := inferInstance
a b c : α
h : a + b = a + c
⊢ b = c
[PROOFSTEP]
simpa only [add_tsub_cancel_left] using congr_arg (fun x => x - a) h
[GOAL]
α : Type u_1
inst✝² : CanonicallyLinearOrderedAddMonoid α
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
⊢ 0 < a - b ↔ b < a
[PROOFSTEP]
rw [tsub_pos_iff_not_le, not_le]
[GOAL]
α : Type u_1
inst✝² : CanonicallyLinearOrderedAddMonoid α
inst✝¹ : Sub α
inst✝ : OrderedSub α
a✝ b✝ c d a b : α
⊢ a - b = a - min a b
[PROOFSTEP]
cases' le_total a b with h h
[GOAL]
case inl
α : Type u_1
inst✝² : CanonicallyLinearOrderedAddMonoid α
inst✝¹ : Sub α
inst✝ : OrderedSub α
a✝ b✝ c d a b : α
h : a ≤ b
⊢ a - b = a - min a b
[PROOFSTEP]
rw [min_eq_left h, tsub_self, tsub_eq_zero_of_le h]
[GOAL]
case inr
α : Type u_1
inst✝² : CanonicallyLinearOrderedAddMonoid α
inst✝¹ : Sub α
inst✝ : OrderedSub α
a✝ b✝ c d a b : α
h : b ≤ a
⊢ a - b = a - min a b
[PROOFSTEP]
rw [min_eq_right h]
[GOAL]
α : Type u_1
inst✝² : CanonicallyLinearOrderedAddMonoid α
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
hc : AddLECancellable c
h : c ≤ a
⊢ a - c < b - c ↔ a < b
[PROOFSTEP]
rw [hc.lt_tsub_iff_left, add_tsub_cancel_of_le h]
[GOAL]
α : Type u_1
inst✝² : CanonicallyLinearOrderedAddMonoid α
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
ha : AddLECancellable a
h₁ : 0 < a
h₂ : 0 < b
⊢ a - b < a
[PROOFSTEP]
refine' tsub_le_self.lt_of_ne fun h => _
[GOAL]
α : Type u_1
inst✝² : CanonicallyLinearOrderedAddMonoid α
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
ha : AddLECancellable a
h₁ : 0 < a
h₂ : 0 < b
h : a - b = a
⊢ False
[PROOFSTEP]
rw [← h, tsub_pos_iff_lt] at h₁
[GOAL]
α : Type u_1
inst✝² : CanonicallyLinearOrderedAddMonoid α
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
ha : AddLECancellable a
h₁ : b < a
h₂ : 0 < b
h : a - b = a
⊢ False
[PROOFSTEP]
exact h₂.not_le (ha.add_le_iff_nonpos_left.1 <| add_le_of_le_tsub_left_of_le h₁.le h.ge)
[GOAL]
α : Type u_1
inst✝² : CanonicallyLinearOrderedAddMonoid α
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
ha : AddLECancellable a
⊢ a - b < a ↔ 0 < a ∧ 0 < b
[PROOFSTEP]
refine' ⟨fun h => ⟨(zero_le _).trans_lt h, (zero_le b).lt_of_ne _⟩, fun h => ha.tsub_lt_self h.1 h.2⟩
[GOAL]
α : Type u_1
inst✝² : CanonicallyLinearOrderedAddMonoid α
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
ha : AddLECancellable a
h : a - b < a
⊢ 0 ≠ b
[PROOFSTEP]
rintro rfl
[GOAL]
α : Type u_1
inst✝² : CanonicallyLinearOrderedAddMonoid α
inst✝¹ : Sub α
inst✝ : OrderedSub α
a c d : α
ha : AddLECancellable a
h : a - 0 < a
⊢ False
[PROOFSTEP]
rw [tsub_zero] at h
[GOAL]
α : Type u_1
inst✝² : CanonicallyLinearOrderedAddMonoid α
inst✝¹ : Sub α
inst✝ : OrderedSub α
a c d : α
ha : AddLECancellable a
h : a < a
⊢ False
[PROOFSTEP]
exact h.false
[GOAL]
α : Type u_1
inst✝² : CanonicallyLinearOrderedAddMonoid α
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
⊢ a - b + b = max a b
[PROOFSTEP]
cases' le_total a b with h h
[GOAL]
case inl
α : Type u_1
inst✝² : CanonicallyLinearOrderedAddMonoid α
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
h : a ≤ b
⊢ a - b + b = max a b
[PROOFSTEP]
rw [max_eq_right h, tsub_eq_zero_of_le h, zero_add]
[GOAL]
case inr
α : Type u_1
inst✝² : CanonicallyLinearOrderedAddMonoid α
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
h : b ≤ a
⊢ a - b + b = max a b
[PROOFSTEP]
rw [max_eq_left h, tsub_add_cancel_of_le h]
[GOAL]
α : Type u_1
inst✝² : CanonicallyLinearOrderedAddMonoid α
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
⊢ a + (b - a) = max a b
[PROOFSTEP]
rw [add_comm, max_comm, tsub_add_eq_max]
[GOAL]
α : Type u_1
inst✝² : CanonicallyLinearOrderedAddMonoid α
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
⊢ a - min a b = a - b
[PROOFSTEP]
cases' le_total a b with h h
[GOAL]
case inl
α : Type u_1
inst✝² : CanonicallyLinearOrderedAddMonoid α
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
h : a ≤ b
⊢ a - min a b = a - b
[PROOFSTEP]
rw [min_eq_left h, tsub_self, tsub_eq_zero_of_le h]
[GOAL]
case inr
α : Type u_1
inst✝² : CanonicallyLinearOrderedAddMonoid α
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
h : b ≤ a
⊢ a - min a b = a - b
[PROOFSTEP]
rw [min_eq_right h]
[GOAL]
α : Type u_1
inst✝² : CanonicallyLinearOrderedAddMonoid α
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
⊢ a - b + min a b = a
[PROOFSTEP]
rw [← tsub_min, @tsub_add_cancel_of_le]
[GOAL]
case h
α : Type u_1
inst✝² : CanonicallyLinearOrderedAddMonoid α
inst✝¹ : Sub α
inst✝ : OrderedSub α
a b c d : α
⊢ min a b ≤ a
[PROOFSTEP]
apply min_le_left


[GOAL]
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
n : ℕ
x : 𝕎 R
k : ℕ
⊢ coeff (x * ↑n) k = ↑(aeval x.coeff) (wittMulN p n k)
[PROOFSTEP]
induction' n with n ih generalizing k
[GOAL]
case zero
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
x : 𝕎 R
k✝ k : ℕ
⊢ coeff (x * ↑Nat.zero) k = ↑(aeval x.coeff) (wittMulN p Nat.zero k)
[PROOFSTEP]
simp only [Nat.zero_eq, Nat.cast_zero, mul_zero, zero_coeff, wittMulN, AlgHom.map_zero, Pi.zero_apply]
[GOAL]
case succ
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
x : 𝕎 R
k✝ n : ℕ
ih : ∀ (k : ℕ), coeff (x * ↑n) k = ↑(aeval x.coeff) (wittMulN p n k)
k : ℕ
⊢ coeff (x * ↑(Nat.succ n)) k = ↑(aeval x.coeff) (wittMulN p (Nat.succ n) k)
[PROOFSTEP]
rw [wittMulN, Nat.succ_eq_add_one, Nat.cast_add, Nat.cast_one, mul_add, mul_one, aeval_bind₁, add_coeff]
[GOAL]
case succ
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
x : 𝕎 R
k✝ n : ℕ
ih : ∀ (k : ℕ), coeff (x * ↑n) k = ↑(aeval x.coeff) (wittMulN p n k)
k : ℕ
⊢ peval (wittAdd p k) ![(x * ↑n).coeff, x.coeff] =
    ↑(aeval fun i => ↑(aeval x.coeff) (Function.uncurry ![wittMulN p n, X] i)) (wittAdd p k)
[PROOFSTEP]
apply eval₂Hom_congr (RingHom.ext_int _ _) _ rfl
[GOAL]
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
x : 𝕎 R
k✝ n : ℕ
ih : ∀ (k : ℕ), coeff (x * ↑n) k = ↑(aeval x.coeff) (wittMulN p n k)
k : ℕ
⊢ Function.uncurry ![(x * ↑n).coeff, x.coeff] = fun i => ↑(aeval x.coeff) (Function.uncurry ![wittMulN p n, X] i)
[PROOFSTEP]
ext1 ⟨b, i⟩
[GOAL]
case h.mk
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
x : 𝕎 R
k✝ n : ℕ
ih : ∀ (k : ℕ), coeff (x * ↑n) k = ↑(aeval x.coeff) (wittMulN p n k)
k : ℕ
b : Fin 2
i : ℕ
⊢ Function.uncurry ![(x * ↑n).coeff, x.coeff] (b, i) = ↑(aeval x.coeff) (Function.uncurry ![wittMulN p n, X] (b, i))
[PROOFSTEP]
fin_cases b
[GOAL]
case h.mk.head
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
x : 𝕎 R
k✝ n : ℕ
ih : ∀ (k : ℕ), coeff (x * ↑n) k = ↑(aeval x.coeff) (wittMulN p n k)
k i : ℕ
⊢ Function.uncurry ![(x * ↑n).coeff, x.coeff] ({ val := 0, isLt := (_ : 0 < 2) }, i) =
    ↑(aeval x.coeff) (Function.uncurry ![wittMulN p n, X] ({ val := 0, isLt := (_ : 0 < 2) }, i))
[PROOFSTEP]
simp [Function.uncurry, Matrix.cons_val_zero, ih]
[GOAL]
case h.mk.tail.head
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
x : 𝕎 R
k✝ n : ℕ
ih : ∀ (k : ℕ), coeff (x * ↑n) k = ↑(aeval x.coeff) (wittMulN p n k)
k i : ℕ
⊢ Function.uncurry ![(x * ↑n).coeff, x.coeff] ({ val := 1, isLt := (_ : (fun a => a < 2) 1) }, i) =
    ↑(aeval x.coeff) (Function.uncurry ![wittMulN p n, X] ({ val := 1, isLt := (_ : (fun a => a < 2) 1) }, i))
[PROOFSTEP]
simp [Function.uncurry, Matrix.cons_val_one, Matrix.head_cons, aeval_X]
[GOAL]
p : ℕ
R✝ : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R✝
n : ℕ
R : Type u_2
_Rcr : CommRing R
x : 𝕎 R
⊢ (x * ↑n).coeff = fun n_1 => ↑(aeval x.coeff) (wittMulN p n n_1)
[PROOFSTEP]
funext k
[GOAL]
case h
p : ℕ
R✝ : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R✝
n : ℕ
R : Type u_2
_Rcr : CommRing R
x : 𝕎 R
k : ℕ
⊢ coeff (x * ↑n) k = ↑(aeval x.coeff) (wittMulN p n k)
[PROOFSTEP]
exact mulN_coeff n x k
[GOAL]
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
n k : ℕ
⊢ ↑(bind₁ (wittMulN p n)) (wittPolynomial p ℤ k) = ↑n * wittPolynomial p ℤ k
[PROOFSTEP]
induction' n with n ih
[GOAL]
case zero
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
k : ℕ
⊢ ↑(bind₁ (wittMulN p Nat.zero)) (wittPolynomial p ℤ k) = ↑Nat.zero * wittPolynomial p ℤ k
[PROOFSTEP]
simp [wittMulN, Nat.cast_zero, zero_mul, bind₁_zero_wittPolynomial]
[GOAL]
case succ
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
k n : ℕ
ih : ↑(bind₁ (wittMulN p n)) (wittPolynomial p ℤ k) = ↑n * wittPolynomial p ℤ k
⊢ ↑(bind₁ (wittMulN p (Nat.succ n))) (wittPolynomial p ℤ k) = ↑(Nat.succ n) * wittPolynomial p ℤ k
[PROOFSTEP]
rw [wittMulN, ← bind₁_bind₁, wittAdd, wittStructureInt_prop]
[GOAL]
case succ
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
k n : ℕ
ih : ↑(bind₁ (wittMulN p n)) (wittPolynomial p ℤ k) = ↑n * wittPolynomial p ℤ k
⊢ ↑(bind₁ (Function.uncurry ![wittMulN p n, X]))
      (↑(bind₁ fun i => ↑(rename (Prod.mk i)) (wittPolynomial p ℤ k)) (X 0 + X 1)) =
    ↑(Nat.succ n) * wittPolynomial p ℤ k
[PROOFSTEP]
simp only [AlgHom.map_add, Nat.cast_succ, bind₁_X_right]
[GOAL]
case succ
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
k n : ℕ
ih : ↑(bind₁ (wittMulN p n)) (wittPolynomial p ℤ k) = ↑n * wittPolynomial p ℤ k
⊢ ↑(bind₁ (Function.uncurry ![wittMulN p n, X])) (↑(rename (Prod.mk 0)) (wittPolynomial p ℤ k)) +
      ↑(bind₁ (Function.uncurry ![wittMulN p n, X])) (↑(rename (Prod.mk 1)) (wittPolynomial p ℤ k)) =
    (↑n + 1) * wittPolynomial p ℤ k
[PROOFSTEP]
rw [add_mul, one_mul, bind₁_rename, bind₁_rename]
[GOAL]
case succ
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
k n : ℕ
ih : ↑(bind₁ (wittMulN p n)) (wittPolynomial p ℤ k) = ↑n * wittPolynomial p ℤ k
⊢ ↑(bind₁ (Function.uncurry ![wittMulN p n, X] ∘ Prod.mk 0)) (wittPolynomial p ℤ k) +
      ↑(bind₁ (Function.uncurry ![wittMulN p n, X] ∘ Prod.mk 1)) (wittPolynomial p ℤ k) =
    ↑n * wittPolynomial p ℤ k + wittPolynomial p ℤ k
[PROOFSTEP]
simp only [ih, Function.uncurry, Function.comp, bind₁_X_left, AlgHom.id_apply, Matrix.cons_val_zero, Matrix.head_cons,
  Matrix.cons_val_one]


[GOAL]
p : ℕ
inst✝ : Fact (Nat.Prime p)
⊢ 1 ∈
    { carrier := {x | ‖x‖ ≤ 1},
        mul_mem' := (_ : ∀ {a b : ℚ_[p]}, a ∈ {x | ‖x‖ ≤ 1} → b ∈ {x | ‖x‖ ≤ 1} → ‖a * b‖ ≤ 1) }.carrier
[PROOFSTEP]
norm_num
[GOAL]
p : ℕ
inst✝ : Fact (Nat.Prime p)
⊢ 0 ∈
    {
          toSubsemigroup :=
            { carrier := {x | ‖x‖ ≤ 1},
              mul_mem' := (_ : ∀ {a b : ℚ_[p]}, a ∈ {x | ‖x‖ ≤ 1} → b ∈ {x | ‖x‖ ≤ 1} → ‖a * b‖ ≤ 1) },
          one_mem' := (_ : ‖1‖ ≤ 1) }.toSubsemigroup.carrier
[PROOFSTEP]
norm_num
[GOAL]
p : ℕ
inst✝ : Fact (Nat.Prime p)
⊢ Add { x // x ∈ subring p }
[PROOFSTEP]
infer_instance
[GOAL]
p : ℕ
inst✝ : Fact (Nat.Prime p)
⊢ Mul { x // x ∈ subring p }
[PROOFSTEP]
infer_instance
[GOAL]
p : ℕ
inst✝ : Fact (Nat.Prime p)
⊢ Neg { x // x ∈ subring p }
[PROOFSTEP]
infer_instance
[GOAL]
p : ℕ
inst✝ : Fact (Nat.Prime p)
⊢ Sub { x // x ∈ subring p }
[PROOFSTEP]
infer_instance
[GOAL]
p : ℕ
inst✝ : Fact (Nat.Prime p)
⊢ Zero { x // x ∈ subring p }
[PROOFSTEP]
infer_instance
[GOAL]
p : ℕ
inst✝ : Fact (Nat.Prime p)
⊢ ‖1‖ ≤ 1
[PROOFSTEP]
norm_num
[GOAL]
p : ℕ
inst✝ : Fact (Nat.Prime p)
z : ℤ_[p]
⊢ ↑z = 0 ↔ z = 0
[PROOFSTEP]
rw [← coe_zero, Subtype.coe_inj]
[GOAL]
p : ℕ
inst✝ : Fact (Nat.Prime p)
⊢ AddCommGroup { x // x ∈ subring p }
[PROOFSTEP]
infer_instance
[GOAL]
p : ℕ
inst✝ : Fact (Nat.Prime p)
⊢ CommRing { x // x ∈ subring p }
[PROOFSTEP]
infer_instance
[GOAL]
p : ℕ
inst✝ : Fact (Nat.Prime p)
k : ℚ_[p]
property✝ : ‖k‖ ≤ 1
h : ‖k‖ = 1
⊢ ‖k⁻¹‖ ≤ 1
[PROOFSTEP]
simp [h]
[GOAL]
p : ℕ
inst✝ : Fact (Nat.Prime p)
m n : ℕ
h : ↑m = ↑n
⊢ ↑m = ↑n
[PROOFSTEP]
rw [Subtype.ext_iff] at h
[GOAL]
p : ℕ
inst✝ : Fact (Nat.Prime p)
m n : ℕ
h✝ : ↑m = ↑n
h : ↑↑m = ↑↑n
⊢ ↑m = ↑n
[PROOFSTEP]
norm_cast at h
[GOAL]
p : ℕ
inst✝ : Fact (Nat.Prime p)
z1 z2 : ℤ
⊢ ↑z1 = ↑z2 ↔ z1 = z2
[PROOFSTEP]
suffices (z1 : ℚ_[p]) = z2 ↔ z1 = z2 from Iff.trans (by norm_cast) this
[GOAL]
p : ℕ
inst✝ : Fact (Nat.Prime p)
z1 z2 : ℤ
this : ↑z1 = ↑z2 ↔ z1 = z2
⊢ ↑z1 = ↑z2 ↔ ↑z1 = ↑z2
[PROOFSTEP]
norm_cast
[GOAL]
p : ℕ
inst✝ : Fact (Nat.Prime p)
z1 z2 : ℤ
⊢ ↑z1 = ↑z2 ↔ z1 = z2
[PROOFSTEP]
norm_cast
[GOAL]
p : ℕ
inst✝ : Fact (Nat.Prime p)
seq : ℕ → ℤ
h : IsCauSeq (padicNorm p) fun n => ↑(seq n)
⊢ ↑(PadicSeq.norm { val := fun n => ↑(seq n), property := h }) ≤ 1
[PROOFSTEP]
rw [PadicSeq.norm]
[GOAL]
p : ℕ
inst✝ : Fact (Nat.Prime p)
seq : ℕ → ℤ
h : IsCauSeq (padicNorm p) fun n => ↑(seq n)
⊢ ↑(if hf : { val := fun n => ↑(seq n), property := h } ≈ 0 then 0
      else padicNorm p (↑{ val := fun n => ↑(seq n), property := h } (PadicSeq.stationaryPoint hf))) ≤
    1
[PROOFSTEP]
split_ifs with hne
[GOAL]
case pos
p : ℕ
inst✝ : Fact (Nat.Prime p)
seq : ℕ → ℤ
h : IsCauSeq (padicNorm p) fun n => ↑(seq n)
hne : { val := fun n => ↑(seq n), property := h } ≈ 0
⊢ ↑0 ≤ 1
[PROOFSTEP]
norm_cast
[GOAL]
case neg
p : ℕ
inst✝ : Fact (Nat.Prime p)
seq : ℕ → ℤ
h : IsCauSeq (padicNorm p) fun n => ↑(seq n)
hne : ¬{ val := fun n => ↑(seq n), property := h } ≈ 0
⊢ ↑(padicNorm p (↑{ val := fun n => ↑(seq n), property := h } (PadicSeq.stationaryPoint hne))) ≤ 1
[PROOFSTEP]
norm_cast
[GOAL]
case neg
p : ℕ
inst✝ : Fact (Nat.Prime p)
seq : ℕ → ℤ
h : IsCauSeq (padicNorm p) fun n => ↑(seq n)
hne : ¬{ val := fun n => ↑(seq n), property := h } ≈ 0
⊢ padicNorm p (↑{ val := fun n => ↑(seq n), property := h } (PadicSeq.stationaryPoint hne)) ≤ 1
[PROOFSTEP]
apply padicNorm.of_int
[GOAL]
p : ℕ
inst✝ : Fact (Nat.Prime p)
src✝ : CommRing ℤ_[p] := instCommRing
⊢ ∀ (a b : ℤ_[p]), ‖a * b‖ ≤ ‖a‖ * ‖b‖
[PROOFSTEP]
simp [norm_def]
[GOAL]
p : ℕ
inst✝ : Fact (Nat.Prime p)
⊢ ∀ {x : ℤ_[p]}, ‖x‖ = 0 ↔ x = 0
[PROOFSTEP]
simp [norm_eq_zero]
[GOAL]
p : ℕ
inst✝ : Fact (Nat.Prime p)
x✝¹ x✝ : ℤ_[p]
⊢ ‖x✝¹ * x✝‖ = ‖x✝¹‖ * ‖x✝‖
[PROOFSTEP]
simp only [norm_def, padicNormE.mul, PadicInt.coe_mul]
[GOAL]
p : ℕ
inst✝ : Fact (Nat.Prime p)
z1 z2 : ℤ_[p]
⊢ ‖z1 * z2‖ = ‖z1‖ * ‖z2‖
[PROOFSTEP]
simp [norm_def]
[GOAL]
p : ℕ
inst✝ : Fact (Nat.Prime p)
z : ℤ_[p]
⊢ ‖z ^ 0‖ = ‖z‖ ^ 0
[PROOFSTEP]
simp
[GOAL]
p : ℕ
inst✝ : Fact (Nat.Prime p)
z : ℤ_[p]
k : ℕ
⊢ ‖z ^ (k + 1)‖ = ‖z‖ ^ (k + 1)
[PROOFSTEP]
rw [pow_succ, pow_succ, norm_mul]
[GOAL]
p : ℕ
inst✝ : Fact (Nat.Prime p)
z : ℤ_[p]
k : ℕ
⊢ ‖z‖ * ‖z ^ k‖ = ‖z‖ * ‖z‖ ^ k
[PROOFSTEP]
congr
[GOAL]
case e_a
p : ℕ
inst✝ : Fact (Nat.Prime p)
z : ℤ_[p]
k : ℕ
⊢ ‖z ^ k‖ = ‖z‖ ^ k
[PROOFSTEP]
apply norm_pow
[GOAL]
p : ℕ
inst✝ : Fact (Nat.Prime p)
z1 z2 : ℤ_[p]
h : ‖z1 + z2‖ < ‖z2‖
hne : ¬‖z1‖ = ‖z2‖
⊢ ‖z1 + z2‖ ≥ ‖z2‖
[PROOFSTEP]
rw [norm_add_eq_max_of_ne hne]
[GOAL]
p : ℕ
inst✝ : Fact (Nat.Prime p)
z1 z2 : ℤ_[p]
h : ‖z1 + z2‖ < ‖z2‖
hne : ¬‖z1‖ = ‖z2‖
⊢ max ‖z1‖ ‖z2‖ ≥ ‖z2‖
[PROOFSTEP]
apply le_max_right
[GOAL]
p : ℕ
inst✝ : Fact (Nat.Prime p)
z1 z2 : ℤ_[p]
h : ‖z1 + z2‖ < ‖z1‖
hne : ¬‖z1‖ = ‖z2‖
⊢ ‖z1 + z2‖ ≥ ‖z1‖
[PROOFSTEP]
rw [norm_add_eq_max_of_ne hne]
[GOAL]
p : ℕ
inst✝ : Fact (Nat.Prime p)
z1 z2 : ℤ_[p]
h : ‖z1 + z2‖ < ‖z1‖
hne : ¬‖z1‖ = ‖z2‖
⊢ max ‖z1‖ ‖z2‖ ≥ ‖z1‖
[PROOFSTEP]
apply le_max_left
[GOAL]
p : ℕ
inst✝ : Fact (Nat.Prime p)
z : ℤ_[p]
⊢ ‖↑z‖ = ‖z‖
[PROOFSTEP]
simp [norm_def]
[GOAL]
p : ℕ
inst✝ : Fact (Nat.Prime p)
z : ℤ
⊢ ‖↑z‖ = ‖↑z‖
[PROOFSTEP]
simp [norm_def]
[GOAL]
p : ℕ
inst✝ : Fact (Nat.Prime p)
f : CauSeq ℤ_[p] norm
x✝ : ℝ
hε : x✝ > 0
⊢ ∃ i, ∀ (j : ℕ), j ≥ i → (fun a => ‖a‖) ((fun n => ↑(↑f n)) j - (fun n => ↑(↑f n)) i) < x✝
[PROOFSTEP]
simpa [norm, norm_def] using f.cauchy hε
[GOAL]
p : ℕ
inst✝ : Fact (Nat.Prime p)
f : CauSeq ℤ_[p] norm
hqn : ‖CauSeq.lim (PadicInt.cauSeq_to_rat_cauSeq f)‖ ≤ 1
ε : ℝ
⊢ ε > 0 →
    ∃ i,
      ∀ (j : ℕ),
        j ≥ i →
          ‖↑(f - CauSeq.const norm { val := CauSeq.lim (PadicInt.cauSeq_to_rat_cauSeq f), property := hqn }) j‖ < ε
[PROOFSTEP]
simpa [norm, norm_def] using CauSeq.equiv_lim (cauSeq_to_rat_cauSeq f) ε
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
ε : ℝ
hε : 0 < ε
⊢ ∃ k, ↑p ^ (-↑k) < ε
[PROOFSTEP]
obtain ⟨k, hk⟩ := exists_nat_gt ε⁻¹
[GOAL]
case intro
p : ℕ
hp : Fact (Nat.Prime p)
ε : ℝ
hε : 0 < ε
k : ℕ
hk : ε⁻¹ < ↑k
⊢ ∃ k, ↑p ^ (-↑k) < ε
[PROOFSTEP]
use k
[GOAL]
case h
p : ℕ
hp : Fact (Nat.Prime p)
ε : ℝ
hε : 0 < ε
k : ℕ
hk : ε⁻¹ < ↑k
⊢ ↑p ^ (-↑k) < ε
[PROOFSTEP]
rw [← inv_lt_inv hε (_root_.zpow_pos_of_pos _ _)]
[GOAL]
case h
p : ℕ
hp : Fact (Nat.Prime p)
ε : ℝ
hε : 0 < ε
k : ℕ
hk : ε⁻¹ < ↑k
⊢ ε⁻¹ < (↑p ^ (-↑k))⁻¹
[PROOFSTEP]
rw [zpow_neg, inv_inv, zpow_ofNat]
[GOAL]
case h
p : ℕ
hp : Fact (Nat.Prime p)
ε : ℝ
hε : 0 < ε
k : ℕ
hk : ε⁻¹ < ↑k
⊢ ε⁻¹ < ↑p ^ k
[PROOFSTEP]
apply lt_of_lt_of_le hk
[GOAL]
case h
p : ℕ
hp : Fact (Nat.Prime p)
ε : ℝ
hε : 0 < ε
k : ℕ
hk : ε⁻¹ < ↑k
⊢ ↑k ≤ ↑p ^ k
[PROOFSTEP]
norm_cast
[GOAL]
case h
p : ℕ
hp : Fact (Nat.Prime p)
ε : ℝ
hε : 0 < ε
k : ℕ
hk : ε⁻¹ < ↑k
⊢ k ≤ p ^ k
[PROOFSTEP]
apply le_of_lt
[GOAL]
case h.a
p : ℕ
hp : Fact (Nat.Prime p)
ε : ℝ
hε : 0 < ε
k : ℕ
hk : ε⁻¹ < ↑k
⊢ k < p ^ k
[PROOFSTEP]
convert Nat.lt_pow_self _ _ using 1
[GOAL]
case h.a.convert_2
p : ℕ
hp : Fact (Nat.Prime p)
ε : ℝ
hε : 0 < ε
k : ℕ
hk : ε⁻¹ < ↑k
⊢ 1 < p
[PROOFSTEP]
exact hp.1.one_lt
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
ε : ℝ
hε : 0 < ε
k : ℕ
hk : ε⁻¹ < ↑k
⊢ 0 < ↑p
[PROOFSTEP]
exact_mod_cast hp.1.pos
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
ε : ℚ
hε : 0 < ε
⊢ ∃ k, ↑p ^ (-↑k) < ε
[PROOFSTEP]
obtain ⟨k, hk⟩ := @exists_pow_neg_lt p _ ε (by exact_mod_cast hε)
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
ε : ℚ
hε : 0 < ε
⊢ 0 < ↑ε
[PROOFSTEP]
exact_mod_cast hε
[GOAL]
case intro
p : ℕ
hp : Fact (Nat.Prime p)
ε : ℚ
hε : 0 < ε
k : ℕ
hk : ↑p ^ (-↑k) < ↑ε
⊢ ∃ k, ↑p ^ (-↑k) < ε
[PROOFSTEP]
use k
[GOAL]
case h
p : ℕ
hp : Fact (Nat.Prime p)
ε : ℚ
hε : 0 < ε
k : ℕ
hk : ↑p ^ (-↑k) < ↑ε
⊢ ↑p ^ (-↑k) < ε
[PROOFSTEP]
rw [show (p : ℝ) = (p : ℚ) by simp] at hk
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
ε : ℚ
hε : 0 < ε
k : ℕ
hk : ↑p ^ (-↑k) < ↑ε
⊢ ↑p = ↑↑p
[PROOFSTEP]
simp
[GOAL]
case h
p : ℕ
hp : Fact (Nat.Prime p)
ε : ℚ
hε : 0 < ε
k : ℕ
hk : ↑↑p ^ (-↑k) < ↑ε
⊢ ↑p ^ (-↑k) < ε
[PROOFSTEP]
exact_mod_cast hk
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
k : ℤ
this : ‖↑k‖ < 1 ↔ ↑p ∣ k
⊢ ‖↑k‖ < 1 ↔ ↑p ∣ k
[PROOFSTEP]
rwa [norm_int_cast_eq_padic_norm]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
k : ℤ
n : ℕ
this : ‖↑k‖ ≤ ↑p ^ (-↑n) ↔ ↑(p ^ n) ∣ k
⊢ ‖↑k‖ ≤ ↑p ^ (-↑n) ↔ ↑(p ^ n) ∣ k
[PROOFSTEP]
simpa [norm_int_cast_eq_padic_norm]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : x ≠ 0
⊢ ‖x‖ = ↑p ^ (-valuation x)
[PROOFSTEP]
refine @Padic.norm_eq_pow_val p hp x ?_
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : x ≠ 0
⊢ ↑x ≠ 0
[PROOFSTEP]
contrapose! hx
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : ↑x = 0
⊢ x = 0
[PROOFSTEP]
exact Subtype.val_injective hx
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
⊢ valuation ↑p = 1
[PROOFSTEP]
simp [valuation]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
⊢ 0 ≤ valuation x
[PROOFSTEP]
by_cases hx : x = 0
[GOAL]
case pos
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : x = 0
⊢ 0 ≤ valuation x
[PROOFSTEP]
simp [hx]
[GOAL]
case neg
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : ¬x = 0
⊢ 0 ≤ valuation x
[PROOFSTEP]
have h : (1 : ℝ) < p := by exact_mod_cast hp.1.one_lt
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : ¬x = 0
⊢ 1 < ↑p
[PROOFSTEP]
exact_mod_cast hp.1.one_lt
[GOAL]
case neg
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : ¬x = 0
h : 1 < ↑p
⊢ 0 ≤ valuation x
[PROOFSTEP]
rw [← neg_nonpos, ← (zpow_strictMono h).le_iff_le]
[GOAL]
case neg
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : ¬x = 0
h : 1 < ↑p
⊢ (fun x x_1 => x ^ x_1) (↑p) (-valuation x) ≤ (fun x x_1 => x ^ x_1) (↑p) 0
[PROOFSTEP]
show (p : ℝ) ^ (-valuation x) ≤ (p : ℝ) ^ (0 : ℤ)
[GOAL]
case neg
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : ¬x = 0
h : 1 < ↑p
⊢ ↑p ^ (-valuation x) ≤ ↑p ^ 0
[PROOFSTEP]
rw [← norm_eq_pow_val hx]
[GOAL]
case neg
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : ¬x = 0
h : 1 < ↑p
⊢ ‖x‖ ≤ ↑p ^ 0
[PROOFSTEP]
simpa using x.property
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
hc : c ≠ 0
⊢ valuation (↑p ^ n * c) = ↑n + valuation c
[PROOFSTEP]
have : ‖(p : ℤ_[p]) ^ n * c‖ = ‖(p : ℤ_[p]) ^ n‖ * ‖c‖ := norm_mul _ _
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
hc : c ≠ 0
this : ‖↑p ^ n * c‖ = ‖↑p ^ n‖ * ‖c‖
⊢ valuation (↑p ^ n * c) = ↑n + valuation c
[PROOFSTEP]
have aux : (p : ℤ_[p]) ^ n * c ≠ 0 := by
  contrapose! hc
  rw [mul_eq_zero] at hc
  cases' hc with hc hc
  · refine (hp.1.ne_zero ?_).elim
    exact_mod_cast pow_eq_zero hc
  · exact hc
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
hc : c ≠ 0
this : ‖↑p ^ n * c‖ = ‖↑p ^ n‖ * ‖c‖
⊢ ↑p ^ n * c ≠ 0
[PROOFSTEP]
contrapose! hc
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
this : ‖↑p ^ n * c‖ = ‖↑p ^ n‖ * ‖c‖
hc : ↑p ^ n * c = 0
⊢ c = 0
[PROOFSTEP]
rw [mul_eq_zero] at hc
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
this : ‖↑p ^ n * c‖ = ‖↑p ^ n‖ * ‖c‖
hc : ↑p ^ n = 0 ∨ c = 0
⊢ c = 0
[PROOFSTEP]
cases' hc with hc hc
[GOAL]
case inl
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
this : ‖↑p ^ n * c‖ = ‖↑p ^ n‖ * ‖c‖
hc : ↑p ^ n = 0
⊢ c = 0
[PROOFSTEP]
refine (hp.1.ne_zero ?_).elim
[GOAL]
case inl
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
this : ‖↑p ^ n * c‖ = ‖↑p ^ n‖ * ‖c‖
hc : ↑p ^ n = 0
⊢ p = 0
[PROOFSTEP]
exact_mod_cast pow_eq_zero hc
[GOAL]
case inr
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
this : ‖↑p ^ n * c‖ = ‖↑p ^ n‖ * ‖c‖
hc : c = 0
⊢ c = 0
[PROOFSTEP]
exact hc
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
hc : c ≠ 0
this : ‖↑p ^ n * c‖ = ‖↑p ^ n‖ * ‖c‖
aux : ↑p ^ n * c ≠ 0
⊢ valuation (↑p ^ n * c) = ↑n + valuation c
[PROOFSTEP]
rwa [norm_eq_pow_val aux, norm_p_pow, norm_eq_pow_val hc, ← zpow_add₀, ← neg_add, zpow_inj, neg_inj] at this
[GOAL]
case h₀
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
hc : c ≠ 0
this : ↑p ^ (-valuation (↑p ^ n * c)) = ↑p ^ (-(↑n + valuation c))
aux : ↑p ^ n * c ≠ 0
⊢ 0 < ↑p
[PROOFSTEP]
exact_mod_cast hp.1.pos
[GOAL]
case h₁
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
hc : c ≠ 0
this : ↑p ^ (-valuation (↑p ^ n * c)) = ↑p ^ (-(↑n + valuation c))
aux : ↑p ^ n * c ≠ 0
⊢ ↑p ≠ 1
[PROOFSTEP]
exact_mod_cast hp.1.ne_one
[GOAL]
case ha
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
hc : c ≠ 0
this : ↑p ^ (-valuation (↑p ^ n * c)) = ↑p ^ (-↑n) * ↑p ^ (-valuation c)
aux : ↑p ^ n * c ≠ 0
⊢ ↑p ≠ 0
[PROOFSTEP]
exact_mod_cast hp.1.ne_zero
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
k : ℚ_[p]
property✝ : ‖k‖ ≤ 1
h : ‖{ val := k, property := property✝ }‖ = 1
⊢ { val := k, property := property✝ } * inv { val := k, property := property✝ } = 1
[PROOFSTEP]
have hk : k ≠ 0 := fun h' => zero_ne_one' ℚ_[p] (by simp [h'] at h )
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
k : ℚ_[p]
property✝ : ‖k‖ ≤ 1
h : ‖{ val := k, property := property✝ }‖ = 1
h' : k = 0
⊢ 0 = 1
[PROOFSTEP]
simp [h'] at h
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
k : ℚ_[p]
property✝ : ‖k‖ ≤ 1
h : ‖{ val := k, property := property✝ }‖ = 1
hk : k ≠ 0
⊢ { val := k, property := property✝ } * inv { val := k, property := property✝ } = 1
[PROOFSTEP]
unfold PadicInt.inv
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
k : ℚ_[p]
property✝ : ‖k‖ ≤ 1
h : ‖{ val := k, property := property✝ }‖ = 1
hk : k ≠ 0
⊢ ({ val := k, property := property✝ } *
      match { val := k, property := property✝ } with
      | { val := k, property := property } => if h : ‖k‖ = 1 then { val := k⁻¹, property := (_ : ‖k⁻¹‖ ≤ 1) } else 0) =
    1
[PROOFSTEP]
rw [norm_eq_padic_norm] at h
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
k : ℚ_[p]
property✝ : ‖k‖ ≤ 1
h : ‖k‖ = 1
hk : k ≠ 0
⊢ ({ val := k, property := property✝ } *
      match { val := k, property := property✝ } with
      | { val := k, property := property } => if h : ‖k‖ = 1 then { val := k⁻¹, property := (_ : ‖k⁻¹‖ ≤ 1) } else 0) =
    1
[PROOFSTEP]
dsimp only
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
k : ℚ_[p]
property✝ : ‖k‖ ≤ 1
h : ‖k‖ = 1
hk : k ≠ 0
⊢ ({ val := k, property := property✝ } * if h : ‖k‖ = 1 then { val := k⁻¹, property := (_ : ‖k⁻¹‖ ≤ 1) } else 0) = 1
[PROOFSTEP]
rw [dif_pos h]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
k : ℚ_[p]
property✝ : ‖k‖ ≤ 1
h : ‖k‖ = 1
hk : k ≠ 0
⊢ { val := k, property := property✝ } * { val := k⁻¹, property := (_ : ‖k⁻¹‖ ≤ 1) } = 1
[PROOFSTEP]
apply Subtype.ext_iff_val.2
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
k : ℚ_[p]
property✝ : ‖k‖ ≤ 1
h : ‖k‖ = 1
hk : k ≠ 0
⊢ ↑({ val := k, property := property✝ } * { val := k⁻¹, property := (_ : ‖k⁻¹‖ ≤ 1) }) = ↑1
[PROOFSTEP]
simp [mul_inv_cancel hk]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
z : ℤ_[p]
hz : ‖z‖ = 1
⊢ inv z * z = 1
[PROOFSTEP]
rw [mul_comm, mul_inv hz]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
z : ℤ_[p]
h : IsUnit z
⊢ ‖z‖ = 1
[PROOFSTEP]
rcases isUnit_iff_dvd_one.1 h with ⟨w, eq⟩
[GOAL]
case intro
p : ℕ
hp : Fact (Nat.Prime p)
z : ℤ_[p]
h : IsUnit z
w : ℤ_[p]
eq : 1 = z * w
⊢ ‖z‖ = 1
[PROOFSTEP]
refine' le_antisymm (norm_le_one _) _
[GOAL]
case intro
p : ℕ
hp : Fact (Nat.Prime p)
z : ℤ_[p]
h : IsUnit z
w : ℤ_[p]
eq : 1 = z * w
⊢ 1 ≤ ‖z‖
[PROOFSTEP]
have := mul_le_mul_of_nonneg_left (norm_le_one w) (norm_nonneg z)
[GOAL]
case intro
p : ℕ
hp : Fact (Nat.Prime p)
z : ℤ_[p]
h : IsUnit z
w : ℤ_[p]
eq : 1 = z * w
this : ‖z‖ * ‖w‖ ≤ ‖z‖ * 1
⊢ 1 ≤ ‖z‖
[PROOFSTEP]
rwa [mul_one, ← norm_mul, ← eq, norm_one] at this
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
z1 z2 : ℤ_[p]
hz2 : ‖z2‖ < 1
⊢ ‖z1 * z2‖ = ‖z1‖ * ‖z2‖
[PROOFSTEP]
simp
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
z : ℤ_[p]
⊢ z ∈ nonunits ℤ_[p] ↔ ‖z‖ < 1
[PROOFSTEP]
rw [lt_iff_le_and_ne]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
z : ℤ_[p]
⊢ z ∈ nonunits ℤ_[p] ↔ ‖z‖ ≤ 1 ∧ ‖z‖ ≠ 1
[PROOFSTEP]
simp [norm_le_one z, nonunits, isUnit_iff]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
u : ℤ_[p]ˣ
⊢ IsUnit ↑u
[PROOFSTEP]
simp
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : x ≠ 0
u : ℚ_[p] := ↑x * ↑p ^ (-valuation x)
⊢ ‖u‖ = 1
[PROOFSTEP]
simp [hx, Nat.zpow_ne_zero_of_pos (by exact_mod_cast hp.1.pos) x.valuation, norm_eq_pow_val, zpow_neg, inv_mul_cancel]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : x ≠ 0
u : ℚ_[p] := ↑x * ↑p ^ (-valuation x)
⊢ 0 < ?m.493673
[PROOFSTEP]
exact_mod_cast hp.1.pos
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : x ≠ 0
⊢ x = ↑(unitCoeff hx) * ↑p ^ Int.natAbs (valuation x)
[PROOFSTEP]
apply Subtype.coe_injective
[GOAL]
case a
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : x ≠ 0
⊢ (fun a => ↑a) x = (fun a => ↑a) (↑(unitCoeff hx) * ↑p ^ Int.natAbs (valuation x))
[PROOFSTEP]
push_cast
[GOAL]
case a
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : x ≠ 0
⊢ ↑x = ↑↑(unitCoeff hx) * ↑p ^ Int.natAbs (valuation x)
[PROOFSTEP]
have repr : (x : ℚ_[p]) = unitCoeff hx * (p : ℚ_[p]) ^ x.valuation :=
  by
  rw [unitCoeff_coe, mul_assoc, ← zpow_add₀]
  · simp
  · exact_mod_cast hp.1.ne_zero
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : x ≠ 0
⊢ ↑x = ↑↑(unitCoeff hx) * ↑p ^ valuation x
[PROOFSTEP]
rw [unitCoeff_coe, mul_assoc, ← zpow_add₀]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : x ≠ 0
⊢ ↑x = ↑x * ↑p ^ (-valuation x + valuation x)
[PROOFSTEP]
simp
[GOAL]
case ha
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : x ≠ 0
⊢ ↑p ≠ 0
[PROOFSTEP]
exact_mod_cast hp.1.ne_zero
[GOAL]
case a
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : x ≠ 0
repr : ↑x = ↑↑(unitCoeff hx) * ↑p ^ valuation x
⊢ ↑x = ↑↑(unitCoeff hx) * ↑p ^ Int.natAbs (valuation x)
[PROOFSTEP]
convert repr using 2
[GOAL]
case h.e'_3.h.e'_6
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : x ≠ 0
repr : ↑x = ↑↑(unitCoeff hx) * ↑p ^ valuation x
⊢ ↑p ^ Int.natAbs (valuation x) = ↑p ^ valuation x
[PROOFSTEP]
rw [← zpow_ofNat, Int.natAbs_of_nonneg (valuation_nonneg x)]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : x ≠ 0
n : ℕ
⊢ ‖x‖ ≤ ↑p ^ (-↑n) ↔ ↑n ≤ valuation x
[PROOFSTEP]
rw [norm_eq_pow_val hx]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : x ≠ 0
n : ℕ
⊢ ↑p ^ (-valuation x) ≤ ↑p ^ (-↑n) ↔ ↑n ≤ valuation x
[PROOFSTEP]
lift x.valuation to ℕ using x.valuation_nonneg with k
[GOAL]
case intro
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : x ≠ 0
n k : ℕ
⊢ ↑p ^ (-↑k) ≤ ↑p ^ (-↑n) ↔ ↑n ≤ ↑k
[PROOFSTEP]
simp only [Int.ofNat_le, zpow_neg, zpow_ofNat]
[GOAL]
case intro
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : x ≠ 0
n k : ℕ
⊢ (↑p ^ k)⁻¹ ≤ (↑p ^ n)⁻¹ ↔ n ≤ k
[PROOFSTEP]
have aux : ∀ m : ℕ, 0 < (p : ℝ) ^ m := by
  intro m
  refine pow_pos ?_ m
  exact_mod_cast hp.1.pos
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : x ≠ 0
n k : ℕ
⊢ ∀ (m : ℕ), 0 < ↑p ^ m
[PROOFSTEP]
intro m
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : x ≠ 0
n k m : ℕ
⊢ 0 < ↑p ^ m
[PROOFSTEP]
refine pow_pos ?_ m
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : x ≠ 0
n k m : ℕ
⊢ 0 < ↑p
[PROOFSTEP]
exact_mod_cast hp.1.pos
[GOAL]
case intro
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : x ≠ 0
n k : ℕ
aux : ∀ (m : ℕ), 0 < ↑p ^ m
⊢ (↑p ^ k)⁻¹ ≤ (↑p ^ n)⁻¹ ↔ n ≤ k
[PROOFSTEP]
rw [inv_le_inv (aux _) (aux _)]
[GOAL]
case intro
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : x ≠ 0
n k : ℕ
aux : ∀ (m : ℕ), 0 < ↑p ^ m
⊢ ↑p ^ n ≤ ↑p ^ k ↔ n ≤ k
[PROOFSTEP]
have : p ^ n ≤ p ^ k ↔ n ≤ k := (pow_strictMono_right hp.1.one_lt).le_iff_le
[GOAL]
case intro
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : x ≠ 0
n k : ℕ
aux : ∀ (m : ℕ), 0 < ↑p ^ m
this : p ^ n ≤ p ^ k ↔ n ≤ k
⊢ ↑p ^ n ≤ ↑p ^ k ↔ n ≤ k
[PROOFSTEP]
rw [← this]
[GOAL]
case intro
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : x ≠ 0
n k : ℕ
aux : ∀ (m : ℕ), 0 < ↑p ^ m
this : p ^ n ≤ p ^ k ↔ n ≤ k
⊢ ↑p ^ n ≤ ↑p ^ k ↔ p ^ n ≤ p ^ k
[PROOFSTEP]
norm_cast
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : x ≠ 0
n : ℕ
⊢ x ∈ Ideal.span {↑p ^ n} ↔ ↑n ≤ valuation x
[PROOFSTEP]
rw [Ideal.mem_span_singleton]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : x ≠ 0
n : ℕ
⊢ ↑p ^ n ∣ x ↔ ↑n ≤ valuation x
[PROOFSTEP]
constructor
[GOAL]
case mp
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : x ≠ 0
n : ℕ
⊢ ↑p ^ n ∣ x → ↑n ≤ valuation x
[PROOFSTEP]
rintro ⟨c, rfl⟩
[GOAL]
case mp.intro
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
hx : ↑p ^ n * c ≠ 0
⊢ ↑n ≤ valuation (↑p ^ n * c)
[PROOFSTEP]
suffices c ≠ 0 by
  rw [valuation_p_pow_mul _ _ this, le_add_iff_nonneg_right]
  apply valuation_nonneg
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
hx : ↑p ^ n * c ≠ 0
this : c ≠ 0
⊢ ↑n ≤ valuation (↑p ^ n * c)
[PROOFSTEP]
rw [valuation_p_pow_mul _ _ this, le_add_iff_nonneg_right]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
hx : ↑p ^ n * c ≠ 0
this : c ≠ 0
⊢ 0 ≤ valuation c
[PROOFSTEP]
apply valuation_nonneg
[GOAL]
case mp.intro
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
hx : ↑p ^ n * c ≠ 0
⊢ c ≠ 0
[PROOFSTEP]
contrapose! hx
[GOAL]
case mp.intro
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
c : ℤ_[p]
hx : c = 0
⊢ ↑p ^ n * c = 0
[PROOFSTEP]
rw [hx, mul_zero]
[GOAL]
case mpr
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : x ≠ 0
n : ℕ
⊢ ↑n ≤ valuation x → ↑p ^ n ∣ x
[PROOFSTEP]
nth_rewrite 2 [unitCoeff_spec hx]
[GOAL]
case mpr
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : x ≠ 0
n : ℕ
⊢ ↑n ≤ valuation x → ↑p ^ n ∣ ↑(unitCoeff hx) * ↑p ^ Int.natAbs (valuation x)
[PROOFSTEP]
lift x.valuation to ℕ using x.valuation_nonneg with k
[GOAL]
case mpr.intro
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : x ≠ 0
n k : ℕ
⊢ ↑n ≤ ↑k → ↑p ^ n ∣ ↑(unitCoeff hx) * ↑p ^ Int.natAbs ↑k
[PROOFSTEP]
simp only [Int.natAbs_ofNat, Units.isUnit, IsUnit.dvd_mul_left, Int.ofNat_le]
[GOAL]
case mpr.intro
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : x ≠ 0
n k : ℕ
⊢ n ≤ k → ↑p ^ n ∣ ↑p ^ k
[PROOFSTEP]
intro H
[GOAL]
case mpr.intro
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : x ≠ 0
n k : ℕ
H : n ≤ k
⊢ ↑p ^ n ∣ ↑p ^ k
[PROOFSTEP]
obtain ⟨k, rfl⟩ := Nat.exists_eq_add_of_le H
[GOAL]
case mpr.intro.intro
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : x ≠ 0
n k : ℕ
H : n ≤ n + k
⊢ ↑p ^ n ∣ ↑p ^ (n + k)
[PROOFSTEP]
simp only [pow_add, dvd_mul_right]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
n : ℕ
⊢ ‖x‖ ≤ ↑p ^ (-↑n) ↔ x ∈ Ideal.span {↑p ^ n}
[PROOFSTEP]
by_cases hx : x = 0
[GOAL]
case pos
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
n : ℕ
hx : x = 0
⊢ ‖x‖ ≤ ↑p ^ (-↑n) ↔ x ∈ Ideal.span {↑p ^ n}
[PROOFSTEP]
subst hx
[GOAL]
case pos
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
⊢ ‖0‖ ≤ ↑p ^ (-↑n) ↔ 0 ∈ Ideal.span {↑p ^ n}
[PROOFSTEP]
simp only [norm_zero, zpow_neg, zpow_ofNat, inv_nonneg, iff_true_iff, Submodule.zero_mem]
[GOAL]
case pos
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
⊢ 0 ≤ ↑p ^ n
[PROOFSTEP]
exact_mod_cast Nat.zero_le _
[GOAL]
case neg
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
n : ℕ
hx : ¬x = 0
⊢ ‖x‖ ≤ ↑p ^ (-↑n) ↔ x ∈ Ideal.span {↑p ^ n}
[PROOFSTEP]
rw [norm_le_pow_iff_le_valuation x hx, mem_span_pow_iff_le_valuation x hx]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
n : ℤ
⊢ ‖x‖ ≤ ↑p ^ n ↔ ‖x‖ < ↑p ^ (n + 1)
[PROOFSTEP]
rw [norm_def]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
n : ℤ
⊢ ‖↑x‖ ≤ ↑p ^ n ↔ ‖↑x‖ < ↑p ^ (n + 1)
[PROOFSTEP]
exact Padic.norm_le_pow_iff_norm_lt_pow_add_one _ _
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
n : ℤ
⊢ ‖x‖ < ↑p ^ n ↔ ‖x‖ ≤ ↑p ^ (n - 1)
[PROOFSTEP]
rw [norm_le_pow_iff_norm_lt_pow_add_one, sub_add_cancel]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
⊢ ‖x‖ < 1 ↔ ↑p ∣ x
[PROOFSTEP]
have := norm_le_pow_iff_mem_span_pow x 1
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
this : ‖x‖ ≤ ↑p ^ (-↑1) ↔ x ∈ Ideal.span {↑p ^ 1}
⊢ ‖x‖ < 1 ↔ ↑p ∣ x
[PROOFSTEP]
rw [Ideal.mem_span_singleton, pow_one] at this
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
this : ‖x‖ ≤ ↑p ^ (-↑1) ↔ ↑p ∣ x
⊢ ‖x‖ < 1 ↔ ↑p ∣ x
[PROOFSTEP]
rw [← this, norm_le_pow_iff_norm_lt_pow_add_one]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
this : ‖x‖ ≤ ↑p ^ (-↑1) ↔ ↑p ∣ x
⊢ ‖x‖ < 1 ↔ ‖x‖ < ↑p ^ (-↑1 + 1)
[PROOFSTEP]
simp only [zpow_zero, Int.ofNat_zero, Int.ofNat_succ, add_left_neg, zero_add]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
a : ℤ
⊢ ↑p ^ n ∣ ↑a ↔ ↑(p ^ n) ∣ a
[PROOFSTEP]
rw [← Nat.cast_pow, ← norm_int_le_pow_iff_dvd, norm_le_pow_iff_mem_span_pow, Ideal.mem_span_singleton, Nat.cast_pow]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
⊢ ∀ (a b : ℤ_[p]), a ∈ nonunits ℤ_[p] → b ∈ nonunits ℤ_[p] → a + b ∈ nonunits ℤ_[p]
[PROOFSTEP]
simp only [mem_nonunits]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
⊢ ∀ (a b : ℤ_[p]), ‖a‖ < 1 → ‖b‖ < 1 → ‖a + b‖ < 1
[PROOFSTEP]
exact fun x y => norm_lt_one_add
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
⊢ ↑p ∈ nonunits ℤ_[p]
[PROOFSTEP]
have : (p : ℝ)⁻¹ < 1 := inv_lt_one <| by exact_mod_cast hp.1.one_lt
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
⊢ 1 < ↑p
[PROOFSTEP]
exact_mod_cast hp.1.one_lt
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
this : (↑p)⁻¹ < 1
⊢ ↑p ∈ nonunits ℤ_[p]
[PROOFSTEP]
rwa [← norm_p, ← mem_nonunits] at this
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
⊢ maximalIdeal ℤ_[p] = Ideal.span {↑p}
[PROOFSTEP]
apply le_antisymm
[GOAL]
case a
p : ℕ
hp : Fact (Nat.Prime p)
⊢ maximalIdeal ℤ_[p] ≤ Ideal.span {↑p}
[PROOFSTEP]
intro x hx
[GOAL]
case a
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : x ∈ maximalIdeal ℤ_[p]
⊢ x ∈ Ideal.span {↑p}
[PROOFSTEP]
simp only [LocalRing.mem_maximalIdeal, mem_nonunits] at hx
[GOAL]
case a
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : ‖x‖ < 1
⊢ x ∈ Ideal.span {↑p}
[PROOFSTEP]
rwa [Ideal.mem_span_singleton, ← norm_lt_one_iff_dvd]
[GOAL]
case a
p : ℕ
hp : Fact (Nat.Prime p)
⊢ Ideal.span {↑p} ≤ maximalIdeal ℤ_[p]
[PROOFSTEP]
rw [Ideal.span_le, Set.singleton_subset_iff]
[GOAL]
case a
p : ℕ
hp : Fact (Nat.Prime p)
⊢ ↑p ∈ ↑(maximalIdeal ℤ_[p])
[PROOFSTEP]
exact p_nonnunit
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
⊢ Prime ↑p
[PROOFSTEP]
rw [← Ideal.span_singleton_prime, ← maximalIdeal_eq_span_p]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
⊢ Ideal.IsPrime (maximalIdeal ℤ_[p])
[PROOFSTEP]
infer_instance
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
⊢ ↑p ≠ 0
[PROOFSTEP]
exact_mod_cast hp.1.ne_zero
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℤ_[p]
hx : x ≠ 0
⊢ ↑p ^ Int.natAbs (valuation x) * ↑(unitCoeff hx) = x
[PROOFSTEP]
rw [mul_comm, ← unitCoeff_spec hx]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℕ → ℤ_[p]
hx : ∀ {m n : ℕ}, m ≤ n → x m ≡ x n [SMOD maximalIdeal ℤ_[p] ^ m • ⊤]
⊢ ∃ L, ∀ (n : ℕ), x n ≡ L [SMOD maximalIdeal ℤ_[p] ^ n • ⊤]
[PROOFSTEP]
simp only [← Ideal.one_eq_top, smul_eq_mul, mul_one, SModEq.sub_mem, maximalIdeal_eq_span_p, Ideal.span_singleton_pow, ←
  norm_le_pow_iff_mem_span_pow] at hx ⊢
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℕ → ℤ_[p]
hx : ∀ {m n : ℕ}, m ≤ n → ‖x m - x n‖ ≤ ↑p ^ (-↑m)
⊢ ∃ L, ∀ (n : ℕ), ‖x n - L‖ ≤ ↑p ^ (-↑n)
[PROOFSTEP]
let x' : CauSeq ℤ_[p] norm := ⟨x, ?_⟩
[GOAL]
case refine_2
p : ℕ
hp : Fact (Nat.Prime p)
x : ℕ → ℤ_[p]
hx : ∀ {m n : ℕ}, m ≤ n → ‖x m - x n‖ ≤ ↑p ^ (-↑m)
x' : CauSeq ℤ_[p] norm := { val := x, property := ?refine_1 }
⊢ ∃ L, ∀ (n : ℕ), ‖x n - L‖ ≤ ↑p ^ (-↑n)
case refine_1
p : ℕ
hp : Fact (Nat.Prime p)
x : ℕ → ℤ_[p]
hx : ∀ {m n : ℕ}, m ≤ n → ‖x m - x n‖ ≤ ↑p ^ (-↑m)
⊢ IsCauSeq norm x
[PROOFSTEP]
swap
[GOAL]
case refine_1
p : ℕ
hp : Fact (Nat.Prime p)
x : ℕ → ℤ_[p]
hx : ∀ {m n : ℕ}, m ≤ n → ‖x m - x n‖ ≤ ↑p ^ (-↑m)
⊢ IsCauSeq norm x
[PROOFSTEP]
intro ε hε
[GOAL]
case refine_1
p : ℕ
hp : Fact (Nat.Prime p)
x : ℕ → ℤ_[p]
hx : ∀ {m n : ℕ}, m ≤ n → ‖x m - x n‖ ≤ ↑p ^ (-↑m)
ε : ℝ
hε : ε > 0
⊢ ∃ i, ∀ (j : ℕ), j ≥ i → ‖x j - x i‖ < ε
[PROOFSTEP]
obtain ⟨m, hm⟩ := exists_pow_neg_lt p hε
[GOAL]
case refine_1.intro
p : ℕ
hp : Fact (Nat.Prime p)
x : ℕ → ℤ_[p]
hx : ∀ {m n : ℕ}, m ≤ n → ‖x m - x n‖ ≤ ↑p ^ (-↑m)
ε : ℝ
hε : ε > 0
m : ℕ
hm : ↑p ^ (-↑m) < ε
⊢ ∃ i, ∀ (j : ℕ), j ≥ i → ‖x j - x i‖ < ε
[PROOFSTEP]
refine ⟨m, fun n hn => lt_of_le_of_lt ?_ hm⟩
[GOAL]
case refine_1.intro
p : ℕ
hp : Fact (Nat.Prime p)
x : ℕ → ℤ_[p]
hx : ∀ {m n : ℕ}, m ≤ n → ‖x m - x n‖ ≤ ↑p ^ (-↑m)
ε : ℝ
hε : ε > 0
m : ℕ
hm : ↑p ^ (-↑m) < ε
n : ℕ
hn : n ≥ m
⊢ ‖x n - x m‖ ≤ ↑p ^ (-↑m)
[PROOFSTEP]
rw [← neg_sub, norm_neg]
[GOAL]
case refine_1.intro
p : ℕ
hp : Fact (Nat.Prime p)
x : ℕ → ℤ_[p]
hx : ∀ {m n : ℕ}, m ≤ n → ‖x m - x n‖ ≤ ↑p ^ (-↑m)
ε : ℝ
hε : ε > 0
m : ℕ
hm : ↑p ^ (-↑m) < ε
n : ℕ
hn : n ≥ m
⊢ ‖x m - x n‖ ≤ ↑p ^ (-↑m)
[PROOFSTEP]
exact hx hn
[GOAL]
case refine_2
p : ℕ
hp : Fact (Nat.Prime p)
x : ℕ → ℤ_[p]
hx : ∀ {m n : ℕ}, m ≤ n → ‖x m - x n‖ ≤ ↑p ^ (-↑m)
x' : CauSeq ℤ_[p] norm := { val := x, property := (_ : ∀ (ε : ℝ), ε > 0 → ∃ i, ∀ (j : ℕ), j ≥ i → ‖x j - x i‖ < ε) }
⊢ ∃ L, ∀ (n : ℕ), ‖x n - L‖ ≤ ↑p ^ (-↑n)
[PROOFSTEP]
refine ⟨x'.lim, fun n => ?_⟩
[GOAL]
case refine_2
p : ℕ
hp : Fact (Nat.Prime p)
x : ℕ → ℤ_[p]
hx : ∀ {m n : ℕ}, m ≤ n → ‖x m - x n‖ ≤ ↑p ^ (-↑m)
x' : CauSeq ℤ_[p] norm := { val := x, property := (_ : ∀ (ε : ℝ), ε > 0 → ∃ i, ∀ (j : ℕ), j ≥ i → ‖x j - x i‖ < ε) }
n : ℕ
⊢ ‖x n - CauSeq.lim x'‖ ≤ ↑p ^ (-↑n)
[PROOFSTEP]
have : (0 : ℝ) < (p : ℝ) ^ (-n : ℤ) := by
  apply zpow_pos_of_pos
  exact_mod_cast hp.1.pos
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℕ → ℤ_[p]
hx : ∀ {m n : ℕ}, m ≤ n → ‖x m - x n‖ ≤ ↑p ^ (-↑m)
x' : CauSeq ℤ_[p] norm := { val := x, property := (_ : ∀ (ε : ℝ), ε > 0 → ∃ i, ∀ (j : ℕ), j ≥ i → ‖x j - x i‖ < ε) }
n : ℕ
⊢ 0 < ↑p ^ (-↑n)
[PROOFSTEP]
apply zpow_pos_of_pos
[GOAL]
case ha
p : ℕ
hp : Fact (Nat.Prime p)
x : ℕ → ℤ_[p]
hx : ∀ {m n : ℕ}, m ≤ n → ‖x m - x n‖ ≤ ↑p ^ (-↑m)
x' : CauSeq ℤ_[p] norm := { val := x, property := (_ : ∀ (ε : ℝ), ε > 0 → ∃ i, ∀ (j : ℕ), j ≥ i → ‖x j - x i‖ < ε) }
n : ℕ
⊢ 0 < ↑p
[PROOFSTEP]
exact_mod_cast hp.1.pos
[GOAL]
case refine_2
p : ℕ
hp : Fact (Nat.Prime p)
x : ℕ → ℤ_[p]
hx : ∀ {m n : ℕ}, m ≤ n → ‖x m - x n‖ ≤ ↑p ^ (-↑m)
x' : CauSeq ℤ_[p] norm := { val := x, property := (_ : ∀ (ε : ℝ), ε > 0 → ∃ i, ∀ (j : ℕ), j ≥ i → ‖x j - x i‖ < ε) }
n : ℕ
this : 0 < ↑p ^ (-↑n)
⊢ ‖x n - CauSeq.lim x'‖ ≤ ↑p ^ (-↑n)
[PROOFSTEP]
obtain ⟨i, hi⟩ := equiv_def₃ (equiv_lim x') this
[GOAL]
case refine_2.intro
p : ℕ
hp : Fact (Nat.Prime p)
x : ℕ → ℤ_[p]
hx : ∀ {m n : ℕ}, m ≤ n → ‖x m - x n‖ ≤ ↑p ^ (-↑m)
x' : CauSeq ℤ_[p] norm := { val := x, property := (_ : ∀ (ε : ℝ), ε > 0 → ∃ i, ∀ (j : ℕ), j ≥ i → ‖x j - x i‖ < ε) }
n : ℕ
this : 0 < ↑p ^ (-↑n)
i : ℕ
hi : ∀ (j : ℕ), j ≥ i → ∀ (k : ℕ), k ≥ j → ‖↑x' k - ↑(const norm (CauSeq.lim x')) j‖ < ↑p ^ (-↑n)
⊢ ‖x n - CauSeq.lim x'‖ ≤ ↑p ^ (-↑n)
[PROOFSTEP]
by_cases hin : i ≤ n
[GOAL]
case pos
p : ℕ
hp : Fact (Nat.Prime p)
x : ℕ → ℤ_[p]
hx : ∀ {m n : ℕ}, m ≤ n → ‖x m - x n‖ ≤ ↑p ^ (-↑m)
x' : CauSeq ℤ_[p] norm := { val := x, property := (_ : ∀ (ε : ℝ), ε > 0 → ∃ i, ∀ (j : ℕ), j ≥ i → ‖x j - x i‖ < ε) }
n : ℕ
this : 0 < ↑p ^ (-↑n)
i : ℕ
hi : ∀ (j : ℕ), j ≥ i → ∀ (k : ℕ), k ≥ j → ‖↑x' k - ↑(const norm (CauSeq.lim x')) j‖ < ↑p ^ (-↑n)
hin : i ≤ n
⊢ ‖x n - CauSeq.lim x'‖ ≤ ↑p ^ (-↑n)
[PROOFSTEP]
exact (hi i le_rfl n hin).le
[GOAL]
case neg
p : ℕ
hp : Fact (Nat.Prime p)
x : ℕ → ℤ_[p]
hx : ∀ {m n : ℕ}, m ≤ n → ‖x m - x n‖ ≤ ↑p ^ (-↑m)
x' : CauSeq ℤ_[p] norm := { val := x, property := (_ : ∀ (ε : ℝ), ε > 0 → ∃ i, ∀ (j : ℕ), j ≥ i → ‖x j - x i‖ < ε) }
n : ℕ
this : 0 < ↑p ^ (-↑n)
i : ℕ
hi : ∀ (j : ℕ), j ≥ i → ∀ (k : ℕ), k ≥ j → ‖↑x' k - ↑(const norm (CauSeq.lim x')) j‖ < ↑p ^ (-↑n)
hin : ¬i ≤ n
⊢ ‖x n - CauSeq.lim x'‖ ≤ ↑p ^ (-↑n)
[PROOFSTEP]
push_neg at hin
[GOAL]
case neg
p : ℕ
hp : Fact (Nat.Prime p)
x : ℕ → ℤ_[p]
hx : ∀ {m n : ℕ}, m ≤ n → ‖x m - x n‖ ≤ ↑p ^ (-↑m)
x' : CauSeq ℤ_[p] norm := { val := x, property := (_ : ∀ (ε : ℝ), ε > 0 → ∃ i, ∀ (j : ℕ), j ≥ i → ‖x j - x i‖ < ε) }
n : ℕ
this : 0 < ↑p ^ (-↑n)
i : ℕ
hi : ∀ (j : ℕ), j ≥ i → ∀ (k : ℕ), k ≥ j → ‖↑x' k - ↑(const norm (CauSeq.lim x')) j‖ < ↑p ^ (-↑n)
hin : n < i
⊢ ‖x n - CauSeq.lim x'‖ ≤ ↑p ^ (-↑n)
[PROOFSTEP]
specialize hi i le_rfl i le_rfl
[GOAL]
case neg
p : ℕ
hp : Fact (Nat.Prime p)
x : ℕ → ℤ_[p]
hx : ∀ {m n : ℕ}, m ≤ n → ‖x m - x n‖ ≤ ↑p ^ (-↑m)
x' : CauSeq ℤ_[p] norm := { val := x, property := (_ : ∀ (ε : ℝ), ε > 0 → ∃ i, ∀ (j : ℕ), j ≥ i → ‖x j - x i‖ < ε) }
n : ℕ
this : 0 < ↑p ^ (-↑n)
i : ℕ
hin : n < i
hi : ‖↑x' i - ↑(const norm (CauSeq.lim x')) i‖ < ↑p ^ (-↑n)
⊢ ‖x n - CauSeq.lim x'‖ ≤ ↑p ^ (-↑n)
[PROOFSTEP]
specialize hx hin.le
[GOAL]
case neg
p : ℕ
hp : Fact (Nat.Prime p)
x : ℕ → ℤ_[p]
hx✝ : ∀ {m n : ℕ}, m ≤ n → ‖x m - x n‖ ≤ ↑p ^ (-↑m)
x' : CauSeq ℤ_[p] norm := { val := x, property := (_ : ∀ (ε : ℝ), ε > 0 → ∃ i, ∀ (j : ℕ), j ≥ i → ‖x j - x i‖ < ε) }
n : ℕ
this : 0 < ↑p ^ (-↑n)
i : ℕ
hin : n < i
hi : ‖↑x' i - ↑(const norm (CauSeq.lim x')) i‖ < ↑p ^ (-↑n)
hx : ‖x n - x i‖ ≤ ↑p ^ (-↑n)
⊢ ‖x n - CauSeq.lim x'‖ ≤ ↑p ^ (-↑n)
[PROOFSTEP]
have := nonarchimedean (x n - x i : ℤ_[p]) (x i - x'.lim)
[GOAL]
case neg
p : ℕ
hp : Fact (Nat.Prime p)
x : ℕ → ℤ_[p]
hx✝ : ∀ {m n : ℕ}, m ≤ n → ‖x m - x n‖ ≤ ↑p ^ (-↑m)
x' : CauSeq ℤ_[p] norm := { val := x, property := (_ : ∀ (ε : ℝ), ε > 0 → ∃ i, ∀ (j : ℕ), j ≥ i → ‖x j - x i‖ < ε) }
n : ℕ
this✝ : 0 < ↑p ^ (-↑n)
i : ℕ
hin : n < i
hi : ‖↑x' i - ↑(const norm (CauSeq.lim x')) i‖ < ↑p ^ (-↑n)
hx : ‖x n - x i‖ ≤ ↑p ^ (-↑n)
this : ‖x n - x i + (x i - CauSeq.lim x')‖ ≤ max ‖x n - x i‖ ‖x i - CauSeq.lim x'‖
⊢ ‖x n - CauSeq.lim x'‖ ≤ ↑p ^ (-↑n)
[PROOFSTEP]
rw [sub_add_sub_cancel] at this
[GOAL]
case neg
p : ℕ
hp : Fact (Nat.Prime p)
x : ℕ → ℤ_[p]
hx✝ : ∀ {m n : ℕ}, m ≤ n → ‖x m - x n‖ ≤ ↑p ^ (-↑m)
x' : CauSeq ℤ_[p] norm := { val := x, property := (_ : ∀ (ε : ℝ), ε > 0 → ∃ i, ∀ (j : ℕ), j ≥ i → ‖x j - x i‖ < ε) }
n : ℕ
this✝ : 0 < ↑p ^ (-↑n)
i : ℕ
hin : n < i
hi : ‖↑x' i - ↑(const norm (CauSeq.lim x')) i‖ < ↑p ^ (-↑n)
hx : ‖x n - x i‖ ≤ ↑p ^ (-↑n)
this : ‖x n - CauSeq.lim x'‖ ≤ max ‖x n - x i‖ ‖x i - CauSeq.lim x'‖
⊢ ‖x n - CauSeq.lim x'‖ ≤ ↑p ^ (-↑n)
[PROOFSTEP]
refine' this.trans (max_le_iff.mpr ⟨hx, hi.le⟩)
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x✝ : { x // x ∈ nonZeroDivisors ℤ_[p] }
x : ℤ_[p]
hx : x ∈ nonZeroDivisors ℤ_[p]
⊢ IsUnit (↑(algebraMap ℤ_[p] ℚ_[p]) ↑{ val := x, property := hx })
[PROOFSTEP]
rwa [algebraMap_apply, isUnit_iff_ne_zero, PadicInt.coe_ne_zero, ← mem_nonZeroDivisors_iff_ne_zero]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℚ_[p]
⊢ ∃ x_1, x * ↑(algebraMap ℤ_[p] ℚ_[p]) ↑x_1.snd = ↑(algebraMap ℤ_[p] ℚ_[p]) x_1.fst
[PROOFSTEP]
by_cases hx : ‖x‖ ≤ 1
[GOAL]
case pos
p : ℕ
hp : Fact (Nat.Prime p)
x : ℚ_[p]
hx : ‖x‖ ≤ 1
⊢ ∃ x_1, x * ↑(algebraMap ℤ_[p] ℚ_[p]) ↑x_1.snd = ↑(algebraMap ℤ_[p] ℚ_[p]) x_1.fst
[PROOFSTEP]
use(⟨x, hx⟩, 1)
[GOAL]
case h
p : ℕ
hp : Fact (Nat.Prime p)
x : ℚ_[p]
hx : ‖x‖ ≤ 1
⊢ x * ↑(algebraMap ℤ_[p] ℚ_[p]) ↑({ val := x, property := hx }, 1).snd =
    ↑(algebraMap ℤ_[p] ℚ_[p]) ({ val := x, property := hx }, 1).fst
[PROOFSTEP]
rw [Submonoid.coe_one, map_one, mul_one, PadicInt.algebraMap_apply, Subtype.coe_mk]
[GOAL]
case neg
p : ℕ
hp : Fact (Nat.Prime p)
x : ℚ_[p]
hx : ¬‖x‖ ≤ 1
⊢ ∃ x_1, x * ↑(algebraMap ℤ_[p] ℚ_[p]) ↑x_1.snd = ↑(algebraMap ℤ_[p] ℚ_[p]) x_1.fst
[PROOFSTEP]
set n := Int.toNat (-x.valuation) with hn
[GOAL]
case neg
p : ℕ
hp : Fact (Nat.Prime p)
x : ℚ_[p]
hx : ¬‖x‖ ≤ 1
n : ℕ := Int.toNat (-Padic.valuation x)
hn : n = Int.toNat (-Padic.valuation x)
⊢ ∃ x_1, x * ↑(algebraMap ℤ_[p] ℚ_[p]) ↑x_1.snd = ↑(algebraMap ℤ_[p] ℚ_[p]) x_1.fst
[PROOFSTEP]
have hn_coe : (n : ℤ) = -x.valuation := by
  rw [hn, Int.toNat_of_nonneg]
  rw [Right.nonneg_neg_iff]
  rw [Padic.norm_le_one_iff_val_nonneg, not_le] at hx
  exact hx.le
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℚ_[p]
hx : ¬‖x‖ ≤ 1
n : ℕ := Int.toNat (-Padic.valuation x)
hn : n = Int.toNat (-Padic.valuation x)
⊢ ↑n = -Padic.valuation x
[PROOFSTEP]
rw [hn, Int.toNat_of_nonneg]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℚ_[p]
hx : ¬‖x‖ ≤ 1
n : ℕ := Int.toNat (-Padic.valuation x)
hn : n = Int.toNat (-Padic.valuation x)
⊢ 0 ≤ -Padic.valuation x
[PROOFSTEP]
rw [Right.nonneg_neg_iff]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℚ_[p]
hx : ¬‖x‖ ≤ 1
n : ℕ := Int.toNat (-Padic.valuation x)
hn : n = Int.toNat (-Padic.valuation x)
⊢ Padic.valuation x ≤ 0
[PROOFSTEP]
rw [Padic.norm_le_one_iff_val_nonneg, not_le] at hx
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℚ_[p]
hx : Padic.valuation x < 0
n : ℕ := Int.toNat (-Padic.valuation x)
hn : n = Int.toNat (-Padic.valuation x)
⊢ Padic.valuation x ≤ 0
[PROOFSTEP]
exact hx.le
[GOAL]
case neg
p : ℕ
hp : Fact (Nat.Prime p)
x : ℚ_[p]
hx : ¬‖x‖ ≤ 1
n : ℕ := Int.toNat (-Padic.valuation x)
hn : n = Int.toNat (-Padic.valuation x)
hn_coe : ↑n = -Padic.valuation x
⊢ ∃ x_1, x * ↑(algebraMap ℤ_[p] ℚ_[p]) ↑x_1.snd = ↑(algebraMap ℤ_[p] ℚ_[p]) x_1.fst
[PROOFSTEP]
set a := x * (p : ℚ_[p]) ^ n with ha
[GOAL]
case neg
p : ℕ
hp : Fact (Nat.Prime p)
x : ℚ_[p]
hx : ¬‖x‖ ≤ 1
n : ℕ := Int.toNat (-Padic.valuation x)
hn : n = Int.toNat (-Padic.valuation x)
hn_coe : ↑n = -Padic.valuation x
a : ℚ_[p] := x * ↑p ^ n
ha : a = x * ↑p ^ n
⊢ ∃ x_1, x * ↑(algebraMap ℤ_[p] ℚ_[p]) ↑x_1.snd = ↑(algebraMap ℤ_[p] ℚ_[p]) x_1.fst
[PROOFSTEP]
have ha_norm : ‖a‖ = 1 :=
  by
  have hx : x ≠ 0 := by
    intro h0
    rw [h0, norm_zero] at hx
    exact hx zero_le_one
  rw [ha, padicNormE.mul, padicNormE.norm_p_pow, Padic.norm_eq_pow_val hx, ← zpow_add', hn_coe, neg_neg, add_left_neg,
    zpow_zero]
  exact Or.inl (Nat.cast_ne_zero.mpr (NeZero.ne p))
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℚ_[p]
hx : ¬‖x‖ ≤ 1
n : ℕ := Int.toNat (-Padic.valuation x)
hn : n = Int.toNat (-Padic.valuation x)
hn_coe : ↑n = -Padic.valuation x
a : ℚ_[p] := x * ↑p ^ n
ha : a = x * ↑p ^ n
⊢ ‖a‖ = 1
[PROOFSTEP]
have hx : x ≠ 0 := by
  intro h0
  rw [h0, norm_zero] at hx
  exact hx zero_le_one
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℚ_[p]
hx : ¬‖x‖ ≤ 1
n : ℕ := Int.toNat (-Padic.valuation x)
hn : n = Int.toNat (-Padic.valuation x)
hn_coe : ↑n = -Padic.valuation x
a : ℚ_[p] := x * ↑p ^ n
ha : a = x * ↑p ^ n
⊢ x ≠ 0
[PROOFSTEP]
intro h0
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℚ_[p]
hx : ¬‖x‖ ≤ 1
n : ℕ := Int.toNat (-Padic.valuation x)
hn : n = Int.toNat (-Padic.valuation x)
hn_coe : ↑n = -Padic.valuation x
a : ℚ_[p] := x * ↑p ^ n
ha : a = x * ↑p ^ n
h0 : x = 0
⊢ False
[PROOFSTEP]
rw [h0, norm_zero] at hx
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℚ_[p]
hx : ¬0 ≤ 1
n : ℕ := Int.toNat (-Padic.valuation x)
hn : n = Int.toNat (-Padic.valuation x)
hn_coe : ↑n = -Padic.valuation x
a : ℚ_[p] := x * ↑p ^ n
ha : a = x * ↑p ^ n
h0 : x = 0
⊢ False
[PROOFSTEP]
exact hx zero_le_one
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℚ_[p]
hx✝ : ¬‖x‖ ≤ 1
n : ℕ := Int.toNat (-Padic.valuation x)
hn : n = Int.toNat (-Padic.valuation x)
hn_coe : ↑n = -Padic.valuation x
a : ℚ_[p] := x * ↑p ^ n
ha : a = x * ↑p ^ n
hx : x ≠ 0
⊢ ‖a‖ = 1
[PROOFSTEP]
rw [ha, padicNormE.mul, padicNormE.norm_p_pow, Padic.norm_eq_pow_val hx, ← zpow_add', hn_coe, neg_neg, add_left_neg,
  zpow_zero]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x : ℚ_[p]
hx✝ : ¬‖x‖ ≤ 1
n : ℕ := Int.toNat (-Padic.valuation x)
hn : n = Int.toNat (-Padic.valuation x)
hn_coe : ↑n = -Padic.valuation x
a : ℚ_[p] := x * ↑p ^ n
ha : a = x * ↑p ^ n
hx : x ≠ 0
⊢ ↑p ≠ 0 ∨ -Padic.valuation x + -↑n ≠ 0 ∨ -Padic.valuation x = 0 ∧ -↑n = 0
[PROOFSTEP]
exact Or.inl (Nat.cast_ne_zero.mpr (NeZero.ne p))
[GOAL]
case neg
p : ℕ
hp : Fact (Nat.Prime p)
x : ℚ_[p]
hx : ¬‖x‖ ≤ 1
n : ℕ := Int.toNat (-Padic.valuation x)
hn : n = Int.toNat (-Padic.valuation x)
hn_coe : ↑n = -Padic.valuation x
a : ℚ_[p] := x * ↑p ^ n
ha : a = x * ↑p ^ n
ha_norm : ‖a‖ = 1
⊢ ∃ x_1, x * ↑(algebraMap ℤ_[p] ℚ_[p]) ↑x_1.snd = ↑(algebraMap ℤ_[p] ℚ_[p]) x_1.fst
[PROOFSTEP]
use(⟨a, le_of_eq ha_norm⟩, ⟨(p ^ n : ℤ_[p]), mem_nonZeroDivisors_iff_ne_zero.mpr (NeZero.ne _)⟩)
[GOAL]
case h
p : ℕ
hp : Fact (Nat.Prime p)
x : ℚ_[p]
hx : ¬‖x‖ ≤ 1
n : ℕ := Int.toNat (-Padic.valuation x)
hn : n = Int.toNat (-Padic.valuation x)
hn_coe : ↑n = -Padic.valuation x
a : ℚ_[p] := x * ↑p ^ n
ha : a = x * ↑p ^ n
ha_norm : ‖a‖ = 1
⊢ x *
      ↑(algebraMap ℤ_[p] ℚ_[p])
        ↑({ val := a, property := (_ : ‖a‖ ≤ 1) },
              { val := ↑(p ^ n), property := (_ : ↑(p ^ n) ∈ nonZeroDivisors ℤ_[p]) }).snd =
    ↑(algebraMap ℤ_[p] ℚ_[p])
      ({ val := a, property := (_ : ‖a‖ ≤ 1) },
          { val := ↑(p ^ n), property := (_ : ↑(p ^ n) ∈ nonZeroDivisors ℤ_[p]) }).fst
[PROOFSTEP]
simp only [map_pow, map_natCast, algebraMap_apply, PadicInt.coe_pow, PadicInt.coe_nat_cast, Subtype.coe_mk,
  Nat.cast_pow]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
⊢ ∀ {x y : ℤ_[p]}, ↑(algebraMap ℤ_[p] ℚ_[p]) x = ↑(algebraMap ℤ_[p] ℚ_[p]) y ↔ ∃ c, ↑c * x = ↑c * y
[PROOFSTEP]
simp_rw [algebraMap_apply, Subtype.coe_inj]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
⊢ ∀ {x y : ℤ_[p]}, x = y ↔ ∃ c, ↑c * x = ↑c * y
[PROOFSTEP]
refine ⟨fun h => ⟨1, by rw [h]⟩, ?_⟩
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x✝ y✝ : ℤ_[p]
h : x✝ = y✝
⊢ ↑1 * x✝ = ↑1 * y✝
[PROOFSTEP]
rw [h]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
x✝ y✝ : ℤ_[p]
⊢ (∃ c, ↑c * x✝ = ↑c * y✝) → x✝ = y✝
[PROOFSTEP]
rintro ⟨⟨c, hc⟩, h⟩
[GOAL]
case intro.mk
p : ℕ
hp : Fact (Nat.Prime p)
x✝ y✝ c : ℤ_[p]
hc : c ∈ nonZeroDivisors ℤ_[p]
h : ↑{ val := c, property := hc } * x✝ = ↑{ val := c, property := hc } * y✝
⊢ x✝ = y✝
[PROOFSTEP]
exact (mul_eq_mul_left_iff.mp h).resolve_right (mem_nonZeroDivisors_iff_ne_zero.mp hc)