Theorem: padicNormE.defn
File: Mathlib/NumberTheory/Padics/PadicNumbers.lean

tactic: dsimp [padicNormE]
state_before: p : ℕ
inst✝ : Fact (Nat.Prime p)
f : PadicSeq p
ε : ℚ
hε : 0 < ε
⊢ ∃ N, ∀ (i : ℕ), i ≥ N → ↑padicNormE (Padic.mk f - ↑(↑f i)) < ε

tactic: change ∃ N, ∀ i ≥ N, (f - const _ (f i)).norm < ε
state_before: p : ℕ
inst✝ : Fact (Nat.Prime p)
f : PadicSeq p
ε : ℚ
hε : 0 < ε
⊢ ∃ N,
    ∀ (i : ℕ),
      i ≥ N →
        Quotient.lift PadicSeq.norm (_ : ∀ {f g : PadicSeq p}, f ≈ g → PadicSeq.norm f = PadicSeq.norm g)
            (Padic.mk f - ↑(↑f i)) <
          ε

tactic: by_contra' h
state_before: p : ℕ
inst✝ : Fact (Nat.Prime p)
f : PadicSeq p
ε : ℚ
hε : 0 < ε
⊢ ∃ N, ∀ (i : ℕ), i ≥ N → PadicSeq.norm (f - const (padicNorm p) (↑f i)) < ε

tactic: cases' cauchy₂ f hε with N hN
state_before: p : ℕ
inst✝ : Fact (Nat.Prime p)
f : PadicSeq p
ε : ℚ
hε : 0 < ε
h : ∀ (N : ℕ), ∃ i, i ≥ N ∧ ε ≤ PadicSeq.norm (f - const (padicNorm p) (↑f i))
⊢ False

tactic: rcases h N with ⟨i, hi, hge⟩
state_before: case intro
p : ℕ
inst✝ : Fact (Nat.Prime p)
f : PadicSeq p
ε : ℚ
hε : 0 < ε
h : ∀ (N : ℕ), ∃ i, i ≥ N ∧ ε ≤ PadicSeq.norm (f - const (padicNorm p) (↑f i))
N : ℕ
hN : ∀ (j : ℕ), j ≥ N → ∀ (k : ℕ), k ≥ N → padicNorm p (↑f j - ↑f k) < ε
⊢ False

tactic: have hne : ¬f - const (padicNorm p) (f i) ≈ 0 := by
  intro h
  unfold PadicSeq.norm at hge; split_ifs at hge
  exact not_lt_of_ge hge hε
state_before: case intro.intro.intro
p : ℕ
inst✝ : Fact (Nat.Prime p)
f : PadicSeq p
ε : ℚ
hε : 0 < ε
h : ∀ (N : ℕ), ∃ i, i ≥ N ∧ ε ≤ PadicSeq.norm (f - const (padicNorm p) (↑f i))
N : ℕ
hN : ∀ (j : ℕ), j ≥ N → ∀ (k : ℕ), k ≥ N → padicNorm p (↑f j - ↑f k) < ε
i : ℕ
hi : i ≥ N
hge : ε ≤ PadicSeq.norm (f - const (padicNorm p) (↑f i))
⊢ False

tactic: unfold PadicSeq.norm at hge
state_before: case intro.intro.intro
p : ℕ
inst✝ : Fact (Nat.Prime p)
f : PadicSeq p
ε : ℚ
hε : 0 < ε
h : ∀ (N : ℕ), ∃ i, i ≥ N ∧ ε ≤ PadicSeq.norm (f - const (padicNorm p) (↑f i))
N : ℕ
hN : ∀ (j : ℕ), j ≥ N → ∀ (k : ℕ), k ≥ N → padicNorm p (↑f j - ↑f k) < ε
i : ℕ
hi : i ≥ N
hge : ε ≤ PadicSeq.norm (f - const (padicNorm p) (↑f i))
hne : ¬f - const (padicNorm p) (↑f i) ≈ 0
⊢ False

tactic: split_ifs at hge
state_before: case intro.intro.intro
p : ℕ
inst✝ : Fact (Nat.Prime p)
f : PadicSeq p
ε : ℚ
hε : 0 < ε
h : ∀ (N : ℕ), ∃ i, i ≥ N ∧ ε ≤ PadicSeq.norm (f - const (padicNorm p) (↑f i))
N : ℕ
hN : ∀ (j : ℕ), j ≥ N → ∀ (k : ℕ), k ≥ N → padicNorm p (↑f j - ↑f k) < ε
i : ℕ
hi : i ≥ N
hge :
  ε ≤
    if hf : f - const (padicNorm p) (↑f i) ≈ 0 then 0
    else padicNorm p (↑(f - const (padicNorm p) (↑f i)) (stationaryPoint hf))
hne : ¬f - const (padicNorm p) (↑f i) ≈ 0
⊢ False

tactic: exact not_le_of_gt hε hge
state_before: case intro.intro.intro.inl
p : ℕ
inst✝ : Fact (Nat.Prime p)
f : PadicSeq p
ε : ℚ
hε : 0 < ε
h : ∀ (N : ℕ), ∃ i, i ≥ N ∧ ε ≤ PadicSeq.norm (f - const (padicNorm p) (↑f i))
N : ℕ
hN : ∀ (j : ℕ), j ≥ N → ∀ (k : ℕ), k ≥ N → padicNorm p (↑f j - ↑f k) < ε
i : ℕ
hi : i ≥ N
hne : ¬f - const (padicNorm p) (↑f i) ≈ 0
h✝ : f - const (padicNorm p) (↑f i) ≈ 0
hge : ε ≤ 0
⊢ False

case intro.intro.intro.inr
p : ℕ
inst✝ : Fact (Nat.Prime p)
f : PadicSeq p
ε : ℚ
hε : 0 < ε
h : ∀ (N : ℕ), ∃ i, i ≥ N ∧ ε ≤ PadicSeq.norm (f - const (padicNorm p) (↑f i))
N : ℕ
hN : ∀ (j : ℕ), j ≥ N → ∀ (k : ℕ), k ≥ N → padicNorm p (↑f j - ↑f k) < ε
i : ℕ
hi : i ≥ N
hne h✝ : ¬f - const (padicNorm p) (↑f i) ≈ 0
hge : ε ≤ padicNorm p (↑(f - const (padicNorm p) (↑f i)) (stationaryPoint h✝))
⊢ False

tactic: apply not_le_of_gt _ hge
state_before: case intro.intro.intro.inr
p : ℕ
inst✝ : Fact (Nat.Prime p)
f : PadicSeq p
ε : ℚ
hε : 0 < ε
h : ∀ (N : ℕ), ∃ i, i ≥ N ∧ ε ≤ PadicSeq.norm (f - const (padicNorm p) (↑f i))
N : ℕ
hN : ∀ (j : ℕ), j ≥ N → ∀ (k : ℕ), k ≥ N → padicNorm p (↑f j - ↑f k) < ε
i : ℕ
hi : i ≥ N
hne h✝ : ¬f - const (padicNorm p) (↑f i) ≈ 0
hge : ε ≤ padicNorm p (↑(f - const (padicNorm p) (↑f i)) (stationaryPoint h✝))
⊢ False

tactic: cases' _root_.em (N ≤ stationaryPoint hne) with hgen hngen
state_before: p : ℕ
inst✝ : Fact (Nat.Prime p)
f : PadicSeq p
ε : ℚ
hε : 0 < ε
h : ∀ (N : ℕ), ∃ i, i ≥ N ∧ ε ≤ PadicSeq.norm (f - const (padicNorm p) (↑f i))
N : ℕ
hN : ∀ (j : ℕ), j ≥ N → ∀ (k : ℕ), k ≥ N → padicNorm p (↑f j - ↑f k) < ε
i : ℕ
hi : i ≥ N
hne h✝ : ¬f - const (padicNorm p) (↑f i) ≈ 0
hge : ε ≤ padicNorm p (↑(f - const (padicNorm p) (↑f i)) (stationaryPoint h✝))
⊢ ε > padicNorm p (↑(f - const (padicNorm p) (↑f i)) (stationaryPoint h✝))

tactic: intro h
state_before: p : ℕ
inst✝ : Fact (Nat.Prime p)
f : PadicSeq p
ε : ℚ
hε : 0 < ε
h : ∀ (N : ℕ), ∃ i, i ≥ N ∧ ε ≤ PadicSeq.norm (f - const (padicNorm p) (↑f i))
N : ℕ
hN : ∀ (j : ℕ), j ≥ N → ∀ (k : ℕ), k ≥ N → padicNorm p (↑f j - ↑f k) < ε
i : ℕ
hi : i ≥ N
hge : ε ≤ PadicSeq.norm (f - const (padicNorm p) (↑f i))
⊢ ¬f - const (padicNorm p) (↑f i) ≈ 0

tactic: unfold PadicSeq.norm at hge
state_before: p : ℕ
inst✝ : Fact (Nat.Prime p)
f : PadicSeq p
ε : ℚ
hε : 0 < ε
h✝ : ∀ (N : ℕ), ∃ i, i ≥ N ∧ ε ≤ PadicSeq.norm (f - const (padicNorm p) (↑f i))
N : ℕ
hN : ∀ (j : ℕ), j ≥ N → ∀ (k : ℕ), k ≥ N → padicNorm p (↑f j - ↑f k) < ε
i : ℕ
hi : i ≥ N
hge : ε ≤ PadicSeq.norm (f - const (padicNorm p) (↑f i))
h : f - const (padicNorm p) (↑f i) ≈ 0
⊢ False

tactic: split_ifs at hge
state_before: p : ℕ
inst✝ : Fact (Nat.Prime p)
f : PadicSeq p
ε : ℚ
hε : 0 < ε
h✝ : ∀ (N : ℕ), ∃ i, i ≥ N ∧ ε ≤ PadicSeq.norm (f - const (padicNorm p) (↑f i))
N : ℕ
hN : ∀ (j : ℕ), j ≥ N → ∀ (k : ℕ), k ≥ N → padicNorm p (↑f j - ↑f k) < ε
i : ℕ
hi : i ≥ N
hge :
  ε ≤
    if hf : f - const (padicNorm p) (↑f i) ≈ 0 then 0
    else padicNorm p (↑(f - const (padicNorm p) (↑f i)) (stationaryPoint hf))
h : f - const (padicNorm p) (↑f i) ≈ 0
⊢ False

tactic: exact not_lt_of_ge hge hε
state_before: p : ℕ
inst✝ : Fact (Nat.Prime p)
f : PadicSeq p
ε : ℚ
hε : 0 < ε
h✝ : ∀ (N : ℕ), ∃ i, i ≥ N ∧ ε ≤ PadicSeq.norm (f - const (padicNorm p) (↑f i))
N : ℕ
hN : ∀ (j : ℕ), j ≥ N → ∀ (k : ℕ), k ≥ N → padicNorm p (↑f j - ↑f k) < ε
i : ℕ
hi : i ≥ N
h : f - const (padicNorm p) (↑f i) ≈ 0
hge : ε ≤ 0
⊢ False

tactic: apply hN _ hgen _ hi
state_before: case inl
p : ℕ
inst✝ : Fact (Nat.Prime p)
f : PadicSeq p
ε : ℚ
hε : 0 < ε
h : ∀ (N : ℕ), ∃ i, i ≥ N ∧ ε ≤ PadicSeq.norm (f - const (padicNorm p) (↑f i))
N : ℕ
hN : ∀ (j : ℕ), j ≥ N → ∀ (k : ℕ), k ≥ N → padicNorm p (↑f j - ↑f k) < ε
i : ℕ
hi : i ≥ N
hne h✝ : ¬f - const (padicNorm p) (↑f i) ≈ 0
hge : ε ≤ padicNorm p (↑(f - const (padicNorm p) (↑f i)) (stationaryPoint h✝))
hgen : N ≤ stationaryPoint hne
⊢ ε > padicNorm p (↑(f - const (padicNorm p) (↑f i)) (stationaryPoint h✝))

tactic: have := stationaryPoint_spec hne le_rfl (le_of_not_le hngen)
state_before: case inr
p : ℕ
inst✝ : Fact (Nat.Prime p)
f : PadicSeq p
ε : ℚ
hε : 0 < ε
h : ∀ (N : ℕ), ∃ i, i ≥ N ∧ ε ≤ PadicSeq.norm (f - const (padicNorm p) (↑f i))
N : ℕ
hN : ∀ (j : ℕ), j ≥ N → ∀ (k : ℕ), k ≥ N → padicNorm p (↑f j - ↑f k) < ε
i : ℕ
hi : i ≥ N
hne h✝ : ¬f - const (padicNorm p) (↑f i) ≈ 0
hge : ε ≤ padicNorm p (↑(f - const (padicNorm p) (↑f i)) (stationaryPoint h✝))
hngen : ¬N ≤ stationaryPoint hne
⊢ ε > padicNorm p (↑(f - const (padicNorm p) (↑f i)) (stationaryPoint h✝))

tactic: rw [← this]
state_before: case inr
p : ℕ
inst✝ : Fact (Nat.Prime p)
f : PadicSeq p
ε : ℚ
hε : 0 < ε
h : ∀ (N : ℕ), ∃ i, i ≥ N ∧ ε ≤ PadicSeq.norm (f - const (padicNorm p) (↑f i))
N : ℕ
hN : ∀ (j : ℕ), j ≥ N → ∀ (k : ℕ), k ≥ N → padicNorm p (↑f j - ↑f k) < ε
i : ℕ
hi : i ≥ N
hne h✝ : ¬f - const (padicNorm p) (↑f i) ≈ 0
hge : ε ≤ padicNorm p (↑(f - const (padicNorm p) (↑f i)) (stationaryPoint h✝))
hngen : ¬N ≤ stationaryPoint hne
this :
  padicNorm p (↑(f - const (padicNorm p) (↑f i)) N) =
    padicNorm p (↑(f - const (padicNorm p) (↑f i)) (stationaryPoint hne))
⊢ ε > padicNorm p (↑(f - const (padicNorm p) (↑f i)) (stationaryPoint h✝))

tactic: exact hN _ le_rfl _ hi
state_before: case inr
p : ℕ
inst✝ : Fact (Nat.Prime p)
f : PadicSeq p
ε : ℚ
hε : 0 < ε
h : ∀ (N : ℕ), ∃ i, i ≥ N ∧ ε ≤ PadicSeq.norm (f - const (padicNorm p) (↑f i))
N : ℕ
hN : ∀ (j : ℕ), j ≥ N → ∀ (k : ℕ), k ≥ N → padicNorm p (↑f j - ↑f k) < ε
i : ℕ
hi : i ≥ N
hne h✝ : ¬f - const (padicNorm p) (↑f i) ≈ 0
hge : ε ≤ padicNorm p (↑(f - const (padicNorm p) (↑f i)) (stationaryPoint h✝))
hngen : ¬N ≤ stationaryPoint hne
this :
  padicNorm p (↑(f - const (padicNorm p) (↑f i)) N) =
    padicNorm p (↑(f - const (padicNorm p) (↑f i)) (stationaryPoint hne))
⊢ ε > padicNorm p (↑(f - const (padicNorm p) (↑f i)) N)