-- Mathlib/NumberTheory/RamificationInertia/Basic.lean
theorem ramificationIdx_spec {n : ℕ} (hle : map f p ≤ P ^ n) (hgt : ¬map f p ≤ P ^ (n + 1)) :
    ramificationIdx f p P = n

Proof state:
R : Type u
inst✝¹ : CommRing R
S : Type v
inst✝ : CommRing S
f : R →+* S
p : Ideal R
P : Ideal S
n : ℕ
hle : map f p ≤ P ^ n
hgt : ¬map f p ≤ P ^ (n + 1)
Q : ℕ → Prop := fun m => ∀ (k : ℕ), map f p ≤ P ^ k → k ≤ m
this : Q n
h : Nat.find ⋯ < n
this' : Q (Nat.find ⋯)
⊢ False

Tactic:
exact h.not_le (this' _ hle)

Result:
no goals

Proof state:
R : Type u
inst✝¹ : CommRing R
S : Type v
inst✝ : CommRing S
f : R →+* S
p : Ideal R
P : Ideal S
n : ℕ
hle : map f p ≤ P ^ n
hgt : ¬map f p ≤ P ^ (n + 1)
Q : ℕ → Prop := fun m => ∀ (k : ℕ), map f p ≤ P ^ k → k ≤ m
k : ℕ
hk : map f p ≤ P ^ k
⊢ k ≤ n

Tactic:
refine le_of_not_lt fun hnk => ?_

Result:
R : Type u
inst✝¹ : CommRing R
S : Type v
inst✝ : CommRing S
f : R →+* S
p : Ideal R
P : Ideal S
n : ℕ
hle : map f p ≤ P ^ n
hgt : ¬map f p ≤ P ^ (n + 1)
Q : ℕ → Prop := fun m => ∀ (k : ℕ), map f p ≤ P ^ k → k ≤ m
k : ℕ
hk : map f p ≤ P ^ k
hnk : n < k
⊢ False

Proof state:
R : Type u
inst✝¹ : CommRing R
S : Type v
inst✝ : CommRing S
f : R →+* S
p : Ideal R
P : Ideal S
n : ℕ
hle : map f p ≤ P ^ n
hgt : ¬map f p ≤ P ^ (n + 1)
Q : ℕ → Prop := fun m => ∀ (k : ℕ), map f p ≤ P ^ k → k ≤ m
this : Q n
⊢ ramificationIdx f p P = n

Tactic:
rw [ramificationIdx_eq_find ⟨n, this⟩]

Result:
R : Type u
inst✝¹ : CommRing R
S : Type v
inst✝ : CommRing S
f : R →+* S
p : Ideal R
P : Ideal S
n : ℕ
hle : map f p ≤ P ^ n
hgt : ¬map f p ≤ P ^ (n + 1)
Q : ℕ → Prop := fun m => ∀ (k : ℕ), map f p ≤ P ^ k → k ≤ m
this : Q n
⊢ Nat.find ⋯ = n

Proof state:
R : Type u
inst✝¹ : CommRing R
S : Type v
inst✝ : CommRing S
f : R →+* S
p : Ideal R
P : Ideal S
n : ℕ
hle : map f p ≤ P ^ n
hgt : ¬map f p ≤ P ^ (n + 1)
Q : ℕ → Prop := fun m => ∀ (k : ℕ), map f p ≤ P ^ k → k ≤ m
⊢ ramificationIdx f p P = n

Tactic:
have : Q n := by
  intro k hk
  refine le_of_not_lt fun hnk => ?_
  exact hgt (hk.trans (Ideal.pow_le_pow_right hnk))

Result:
R : Type u
inst✝¹ : CommRing R
S : Type v
inst✝ : CommRing S
f : R →+* S
p : Ideal R
P : Ideal S
n : ℕ
hle : map f p ≤ P ^ n
hgt : ¬map f p ≤ P ^ (n + 1)
Q : ℕ → Prop := fun m => ∀ (k : ℕ), map f p ≤ P ^ k → k ≤ m
this : Q n
⊢ ramificationIdx f p P = n

Proof state:
R : Type u
inst✝¹ : CommRing R
S : Type v
inst✝ : CommRing S
f : R →+* S
p : Ideal R
P : Ideal S
n : ℕ
hle : map f p ≤ P ^ n
hgt : ¬map f p ≤ P ^ (n + 1)
Q : ℕ → Prop := fun m => ∀ (k : ℕ), map f p ≤ P ^ k → k ≤ m
this : Q n
⊢ Nat.find ⋯ = n

Tactic:
refine le_antisymm (Nat.find_min' _ this) (le_of_not_gt fun h : Nat.find _ < n => ?_)

Result:
R : Type u
inst✝¹ : CommRing R
S : Type v
inst✝ : CommRing S
f : R →+* S
p : Ideal R
P : Ideal S
n : ℕ
hle : map f p ≤ P ^ n
hgt : ¬map f p ≤ P ^ (n + 1)
Q : ℕ → Prop := fun m => ∀ (k : ℕ), map f p ≤ P ^ k → k ≤ m
this : Q n
h : Nat.find ⋯ < n
⊢ False

Proof state:
R : Type u
inst✝¹ : CommRing R
S : Type v
inst✝ : CommRing S
f : R →+* S
p : Ideal R
P : Ideal S
n : ℕ
hle : map f p ≤ P ^ n
hgt : ¬map f p ≤ P ^ (n + 1)
Q : ℕ → Prop := fun m => ∀ (k : ℕ), map f p ≤ P ^ k → k ≤ m
⊢ Q n

Tactic:
intro k hk

Result:
R : Type u
inst✝¹ : CommRing R
S : Type v
inst✝ : CommRing S
f : R →+* S
p : Ideal R
P : Ideal S
n : ℕ
hle : map f p ≤ P ^ n
hgt : ¬map f p ≤ P ^ (n + 1)
Q : ℕ → Prop := fun m => ∀ (k : ℕ), map f p ≤ P ^ k → k ≤ m
k : ℕ
hk : map f p ≤ P ^ k
⊢ k ≤ n

Proof state:
R : Type u
inst✝¹ : CommRing R
S : Type v
inst✝ : CommRing S
f : R →+* S
p : Ideal R
P : Ideal S
n : ℕ
hle : map f p ≤ P ^ n
hgt : ¬map f p ≤ P ^ (n + 1)
⊢ ramificationIdx f p P = n

Tactic:
classical
let Q : ℕ → Prop := fun m => ∀ k : ℕ, map f p ≤ P ^ k → k ≤ m
have : Q n := by
  intro k hk
  refine le_of_not_lt fun hnk => ?_
  exact hgt (hk.trans (Ideal.pow_le_pow_right hnk))
rw [ramificationIdx_eq_find ⟨n, this⟩]
refine le_antisymm (Nat.find_min' _ this) (le_of_not_gt fun h : Nat.find _ < n => ?_)
obtain this' := Nat.find_spec ⟨n, this⟩
exact h.not_le (this' _ hle)

Result:
no goals

Proof state:
R : Type u
inst✝¹ : CommRing R
S : Type v
inst✝ : CommRing S
f : R →+* S
p : Ideal R
P : Ideal S
n : ℕ
hle : map f p ≤ P ^ n
hgt : ¬map f p ≤ P ^ (n + 1)
⊢ ramificationIdx f p P = n

Tactic:
let Q : ℕ → Prop := fun m => ∀ k : ℕ, map f p ≤ P ^ k → k ≤ m

Result:
R : Type u
inst✝¹ : CommRing R
S : Type v
inst✝ : CommRing S
f : R →+* S
p : Ideal R
P : Ideal S
n : ℕ
hle : map f p ≤ P ^ n
hgt : ¬map f p ≤ P ^ (n + 1)
Q : ℕ → Prop := fun m => ∀ (k : ℕ), map f p ≤ P ^ k → k ≤ m
⊢ ramificationIdx f p P = n

Proof state:
R : Type u
inst✝¹ : CommRing R
S : Type v
inst✝ : CommRing S
f : R →+* S
p : Ideal R
P : Ideal S
n : ℕ
hle : map f p ≤ P ^ n
hgt : ¬map f p ≤ P ^ (n + 1)
Q : ℕ → Prop := fun m => ∀ (k : ℕ), map f p ≤ P ^ k → k ≤ m
this : Q n
h : Nat.find ⋯ < n
⊢ False

Tactic:
obtain this' := Nat.find_spec ⟨n, this⟩

Result:
R : Type u
inst✝¹ : CommRing R
S : Type v
inst✝ : CommRing S
f : R →+* S
p : Ideal R
P : Ideal S
n : ℕ
hle : map f p ≤ P ^ n
hgt : ¬map f p ≤ P ^ (n + 1)
Q : ℕ → Prop := fun m => ∀ (k : ℕ), map f p ≤ P ^ k → k ≤ m
this : Q n
h : Nat.find ⋯ < n
this' : Q (Nat.find ⋯)
⊢ False

Proof state:
R : Type u
inst✝¹ : CommRing R
S : Type v
inst✝ : CommRing S
f : R →+* S
p : Ideal R
P : Ideal S
n : ℕ
hle : map f p ≤ P ^ n
hgt : ¬map f p ≤ P ^ (n + 1)
Q : ℕ → Prop := fun m => ∀ (k : ℕ), map f p ≤ P ^ k → k ≤ m
k : ℕ
hk : map f p ≤ P ^ k
hnk : n < k
⊢ False

Tactic:
exact hgt (hk.trans (Ideal.pow_le_pow_right hnk))

Result:
no goals