Theorem: PerfectClosure.eq_iff'
File: Mathlib/FieldTheory/PerfectClosure.lean

tactic: constructor
state_before: K : Type u
inst✝² : CommRing K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : CharP K p
x y : ℕ × K
⊢ mk K p x = mk K p y ↔ ∃ z, (↑(frobenius K p)^[y.fst + z]) x.snd = (↑(frobenius K p)^[x.fst + z]) y.snd

tactic: intro H
state_before: case mpr
K : Type u
inst✝² : CommRing K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : CharP K p
x y : ℕ × K
⊢ (∃ z, (↑(frobenius K p)^[y.fst + z]) x.snd = (↑(frobenius K p)^[x.fst + z]) y.snd) → mk K p x = mk K p y

tactic: cases' x with m x
state_before: case mpr
K : Type u
inst✝² : CommRing K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : CharP K p
x y : ℕ × K
H : ∃ z, (↑(frobenius K p)^[y.fst + z]) x.snd = (↑(frobenius K p)^[x.fst + z]) y.snd
⊢ mk K p x = mk K p y

tactic: cases' y with n y
state_before: case mpr.mk
K : Type u
inst✝² : CommRing K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : CharP K p
y : ℕ × K
m : ℕ
x : K
H : ∃ z, (↑(frobenius K p)^[y.fst + z]) (m, x).snd = (↑(frobenius K p)^[(m, x).fst + z]) y.snd
⊢ mk K p (m, x) = mk K p y

tactic: cases' H with z H
state_before: case mpr.mk.mk
K : Type u
inst✝² : CommRing K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : CharP K p
m : ℕ
x : K
n : ℕ
y : K
H : ∃ z, (↑(frobenius K p)^[(n, y).fst + z]) (m, x).snd = (↑(frobenius K p)^[(m, x).fst + z]) (n, y).snd
⊢ mk K p (m, x) = mk K p (n, y)

tactic: dsimp only at H
state_before: case mpr.mk.mk.intro
K : Type u
inst✝² : CommRing K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : CharP K p
m : ℕ
x : K
n : ℕ
y : K
z : ℕ
H : (↑(frobenius K p)^[(n, y).fst + z]) (m, x).snd = (↑(frobenius K p)^[(m, x).fst + z]) (n, y).snd
⊢ mk K p (m, x) = mk K p (n, y)

tactic: rw [R.sound K p (n + z) m x _ rfl, R.sound K p (m + z) n y _ rfl, H]
state_before: case mpr.mk.mk.intro
K : Type u
inst✝² : CommRing K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : CharP K p
m : ℕ
x : K
n : ℕ
y : K
z : ℕ
H : (↑(frobenius K p)^[n + z]) x = (↑(frobenius K p)^[m + z]) y
⊢ mk K p (m, x) = mk K p (n, y)

tactic: rw [add_assoc, add_comm, add_comm z]
state_before: case mpr.mk.mk.intro
K : Type u
inst✝² : CommRing K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : CharP K p
m : ℕ
x : K
n : ℕ
y : K
z : ℕ
H : (↑(frobenius K p)^[n + z]) x = (↑(frobenius K p)^[m + z]) y
⊢ mk K p (n + z + m, (↑(frobenius K p)^[m + z]) y) = mk K p (m + z + n, (↑(frobenius K p)^[m + z]) y)

tactic: intro H
state_before: case mp
K : Type u
inst✝² : CommRing K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : CharP K p
x y : ℕ × K
⊢ mk K p x = mk K p y → ∃ z, (↑(frobenius K p)^[y.fst + z]) x.snd = (↑(frobenius K p)^[x.fst + z]) y.snd

tactic: replace H := Quot.exact _ H
state_before: case mp
K : Type u
inst✝² : CommRing K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : CharP K p
x y : ℕ × K
H : mk K p x = mk K p y
⊢ ∃ z, (↑(frobenius K p)^[y.fst + z]) x.snd = (↑(frobenius K p)^[x.fst + z]) y.snd

tactic: induction H
state_before: case mp
K : Type u
inst✝² : CommRing K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : CharP K p
x y : ℕ × K
H : EqvGen (R K p) x y
⊢ ∃ z, (↑(frobenius K p)^[y.fst + z]) x.snd = (↑(frobenius K p)^[x.fst + z]) y.snd

tactic: case rel x y H => cases' H with n x; exact ⟨0, rfl⟩
state_before: case mp.rel
K : Type u
inst✝² : CommRing K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : CharP K p
x y x✝ y✝ : ℕ × K
a✝ : R K p x✝ y✝
⊢ ∃ z, (↑(frobenius K p)^[y✝.fst + z]) x✝.snd = (↑(frobenius K p)^[x✝.fst + z]) y✝.snd

case mp.refl
K : Type u
inst✝² : CommRing K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : CharP K p
x y x✝ : ℕ × K
⊢ ∃ z, (↑(frobenius K p)^[x✝.fst + z]) x✝.snd = (↑(frobenius K p)^[x✝.fst + z]) x✝.snd

case mp.symm
K : Type u
inst✝² : CommRing K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : CharP K p
x y x✝ y✝ : ℕ × K
a✝ : EqvGen (R K p) x✝ y✝
a_ih✝ : ∃ z, (↑(frobenius K p)^[y✝.fst + z]) x✝.snd = (↑(frobenius K p)^[x✝.fst + z]) y✝.snd
⊢ ∃ z, (↑(frobenius K p)^[x✝.fst + z]) y✝.snd = (↑(frobenius K p)^[y✝.fst + z]) x✝.snd

case mp.trans
K : Type u
inst✝² : CommRing K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : CharP K p
x y x✝ y✝ z✝ : ℕ × K
a✝¹ : EqvGen (R K p) x✝ y✝
a✝ : EqvGen (R K p) y✝ z✝
a_ih✝¹ : ∃ z, (↑(frobenius K p)^[y✝.fst + z]) x✝.snd = (↑(frobenius K p)^[x✝.fst + z]) y✝.snd
a_ih✝ : ∃ z, (↑(frobenius K p)^[z✝.fst + z]) y✝.snd = (↑(frobenius K p)^[y✝.fst + z]) z✝.snd
⊢ ∃ z, (↑(frobenius K p)^[z✝.fst + z]) x✝.snd = (↑(frobenius K p)^[x✝.fst + z]) z✝.snd

tactic: case refl H => exact ⟨0, rfl⟩
state_before: case mp.refl
K : Type u
inst✝² : CommRing K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : CharP K p
x y x✝ : ℕ × K
⊢ ∃ z, (↑(frobenius K p)^[x✝.fst + z]) x✝.snd = (↑(frobenius K p)^[x✝.fst + z]) x✝.snd

case mp.symm
K : Type u
inst✝² : CommRing K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : CharP K p
x y x✝ y✝ : ℕ × K
a✝ : EqvGen (R K p) x✝ y✝
a_ih✝ : ∃ z, (↑(frobenius K p)^[y✝.fst + z]) x✝.snd = (↑(frobenius K p)^[x✝.fst + z]) y✝.snd
⊢ ∃ z, (↑(frobenius K p)^[x✝.fst + z]) y✝.snd = (↑(frobenius K p)^[y✝.fst + z]) x✝.snd

case mp.trans
K : Type u
inst✝² : CommRing K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : CharP K p
x y x✝ y✝ z✝ : ℕ × K
a✝¹ : EqvGen (R K p) x✝ y✝
a✝ : EqvGen (R K p) y✝ z✝
a_ih✝¹ : ∃ z, (↑(frobenius K p)^[y✝.fst + z]) x✝.snd = (↑(frobenius K p)^[x✝.fst + z]) y✝.snd
a_ih✝ : ∃ z, (↑(frobenius K p)^[z✝.fst + z]) y✝.snd = (↑(frobenius K p)^[y✝.fst + z]) z✝.snd
⊢ ∃ z, (↑(frobenius K p)^[z✝.fst + z]) x✝.snd = (↑(frobenius K p)^[x✝.fst + z]) z✝.snd

tactic: case symm x y H ih => cases' ih with w ih; exact ⟨w, ih.symm⟩
state_before: case mp.symm
K : Type u
inst✝² : CommRing K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : CharP K p
x y x✝ y✝ : ℕ × K
a✝ : EqvGen (R K p) x✝ y✝
a_ih✝ : ∃ z, (↑(frobenius K p)^[y✝.fst + z]) x✝.snd = (↑(frobenius K p)^[x✝.fst + z]) y✝.snd
⊢ ∃ z, (↑(frobenius K p)^[x✝.fst + z]) y✝.snd = (↑(frobenius K p)^[y✝.fst + z]) x✝.snd

case mp.trans
K : Type u
inst✝² : CommRing K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : CharP K p
x y x✝ y✝ z✝ : ℕ × K
a✝¹ : EqvGen (R K p) x✝ y✝
a✝ : EqvGen (R K p) y✝ z✝
a_ih✝¹ : ∃ z, (↑(frobenius K p)^[y✝.fst + z]) x✝.snd = (↑(frobenius K p)^[x✝.fst + z]) y✝.snd
a_ih✝ : ∃ z, (↑(frobenius K p)^[z✝.fst + z]) y✝.snd = (↑(frobenius K p)^[y✝.fst + z]) z✝.snd
⊢ ∃ z, (↑(frobenius K p)^[z✝.fst + z]) x✝.snd = (↑(frobenius K p)^[x✝.fst + z]) z✝.snd

tactic: case trans x y z H1 H2 ih1 ih2 =>
  cases' ih1 with z1 ih1
  cases' ih2 with z2 ih2
  exists z2 + (y.1 + z1)
  rw [← add_assoc, iterate_add_apply, ih1]
  rw [← iterate_add_apply, add_comm, iterate_add_apply, ih2]
  rw [← iterate_add_apply]
  simp only [add_comm, add_left_comm]
state_before: case mp.trans
K : Type u
inst✝² : CommRing K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : CharP K p
x y x✝ y✝ z✝ : ℕ × K
a✝¹ : EqvGen (R K p) x✝ y✝
a✝ : EqvGen (R K p) y✝ z✝
a_ih✝¹ : ∃ z, (↑(frobenius K p)^[y✝.fst + z]) x✝.snd = (↑(frobenius K p)^[x✝.fst + z]) y✝.snd
a_ih✝ : ∃ z, (↑(frobenius K p)^[z✝.fst + z]) y✝.snd = (↑(frobenius K p)^[y✝.fst + z]) z✝.snd
⊢ ∃ z, (↑(frobenius K p)^[z✝.fst + z]) x✝.snd = (↑(frobenius K p)^[x✝.fst + z]) z✝.snd

tactic: cases' H with n x
state_before: K : Type u
inst✝² : CommRing K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : CharP K p
x✝ y✝ x y : ℕ × K
H : R K p x y
⊢ ∃ z, (↑(frobenius K p)^[y.fst + z]) x.snd = (↑(frobenius K p)^[x.fst + z]) y.snd

tactic: exact ⟨0, rfl⟩
state_before: case intro
K : Type u
inst✝² : CommRing K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : CharP K p
x✝ y : ℕ × K
n : ℕ
x : K
⊢ ∃ z,
    (↑(frobenius K p)^[(n + 1, ↑(frobenius K p) x).fst + z]) (n, x).snd =
      (↑(frobenius K p)^[(n, x).fst + z]) (n + 1, ↑(frobenius K p) x).snd

tactic: exact ⟨0, rfl⟩
state_before: K : Type u
inst✝² : CommRing K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : CharP K p
x y H : ℕ × K
⊢ ∃ z, (↑(frobenius K p)^[H.fst + z]) H.snd = (↑(frobenius K p)^[H.fst + z]) H.snd

tactic: cases' ih with w ih
state_before: K : Type u
inst✝² : CommRing K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : CharP K p
x✝ y✝ x y : ℕ × K
H : EqvGen (R K p) x y
ih : ∃ z, (↑(frobenius K p)^[y.fst + z]) x.snd = (↑(frobenius K p)^[x.fst + z]) y.snd
⊢ ∃ z, (↑(frobenius K p)^[x.fst + z]) y.snd = (↑(frobenius K p)^[y.fst + z]) x.snd

tactic: exact ⟨w, ih.symm⟩
state_before: case intro
K : Type u
inst✝² : CommRing K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : CharP K p
x✝ y✝ x y : ℕ × K
H : EqvGen (R K p) x y
w : ℕ
ih : (↑(frobenius K p)^[y.fst + w]) x.snd = (↑(frobenius K p)^[x.fst + w]) y.snd
⊢ ∃ z, (↑(frobenius K p)^[x.fst + z]) y.snd = (↑(frobenius K p)^[y.fst + z]) x.snd

tactic: cases' ih1 with z1 ih1
state_before: K : Type u
inst✝² : CommRing K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : CharP K p
x✝ y✝ x y z : ℕ × K
H1 : EqvGen (R K p) x y
H2 : EqvGen (R K p) y z
ih1 : ∃ z, (↑(frobenius K p)^[y.fst + z]) x.snd = (↑(frobenius K p)^[x.fst + z]) y.snd
ih2 : ∃ z_1, (↑(frobenius K p)^[z.fst + z_1]) y.snd = (↑(frobenius K p)^[y.fst + z_1]) z.snd
⊢ ∃ z_1, (↑(frobenius K p)^[z.fst + z_1]) x.snd = (↑(frobenius K p)^[x.fst + z_1]) z.snd

tactic: cases' ih2 with z2 ih2
state_before: case intro
K : Type u
inst✝² : CommRing K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : CharP K p
x✝ y✝ x y z : ℕ × K
H1 : EqvGen (R K p) x y
H2 : EqvGen (R K p) y z
ih2 : ∃ z_1, (↑(frobenius K p)^[z.fst + z_1]) y.snd = (↑(frobenius K p)^[y.fst + z_1]) z.snd
z1 : ℕ
ih1 : (↑(frobenius K p)^[y.fst + z1]) x.snd = (↑(frobenius K p)^[x.fst + z1]) y.snd
⊢ ∃ z_1, (↑(frobenius K p)^[z.fst + z_1]) x.snd = (↑(frobenius K p)^[x.fst + z_1]) z.snd

tactic: exists z2 + (y.1 + z1)
state_before: case intro.intro
K : Type u
inst✝² : CommRing K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : CharP K p
x✝ y✝ x y z : ℕ × K
H1 : EqvGen (R K p) x y
H2 : EqvGen (R K p) y z
z1 : ℕ
ih1 : (↑(frobenius K p)^[y.fst + z1]) x.snd = (↑(frobenius K p)^[x.fst + z1]) y.snd
z2 : ℕ
ih2 : (↑(frobenius K p)^[z.fst + z2]) y.snd = (↑(frobenius K p)^[y.fst + z2]) z.snd
⊢ ∃ z_1, (↑(frobenius K p)^[z.fst + z_1]) x.snd = (↑(frobenius K p)^[x.fst + z_1]) z.snd

tactic: rw [← add_assoc, iterate_add_apply, ih1]
state_before: case intro.intro
K : Type u
inst✝² : CommRing K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : CharP K p
x✝ y✝ x y z : ℕ × K
H1 : EqvGen (R K p) x y
H2 : EqvGen (R K p) y z
z1 : ℕ
ih1 : (↑(frobenius K p)^[y.fst + z1]) x.snd = (↑(frobenius K p)^[x.fst + z1]) y.snd
z2 : ℕ
ih2 : (↑(frobenius K p)^[z.fst + z2]) y.snd = (↑(frobenius K p)^[y.fst + z2]) z.snd
⊢ (↑(frobenius K p)^[z.fst + (z2 + (y.fst + z1))]) x.snd = (↑(frobenius K p)^[x.fst + (z2 + (y.fst + z1))]) z.snd

tactic: rw [← iterate_add_apply, add_comm, iterate_add_apply, ih2]
state_before: case intro.intro
K : Type u
inst✝² : CommRing K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : CharP K p
x✝ y✝ x y z : ℕ × K
H1 : EqvGen (R K p) x y
H2 : EqvGen (R K p) y z
z1 : ℕ
ih1 : (↑(frobenius K p)^[y.fst + z1]) x.snd = (↑(frobenius K p)^[x.fst + z1]) y.snd
z2 : ℕ
ih2 : (↑(frobenius K p)^[z.fst + z2]) y.snd = (↑(frobenius K p)^[y.fst + z2]) z.snd
⊢ (↑(frobenius K p)^[z.fst + z2]) ((↑(frobenius K p)^[x.fst + z1]) y.snd) =
    (↑(frobenius K p)^[x.fst + (z2 + (y.fst + z1))]) z.snd

tactic: rw [← iterate_add_apply]
state_before: case intro.intro
K : Type u
inst✝² : CommRing K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : CharP K p
x✝ y✝ x y z : ℕ × K
H1 : EqvGen (R K p) x y
H2 : EqvGen (R K p) y z
z1 : ℕ
ih1 : (↑(frobenius K p)^[y.fst + z1]) x.snd = (↑(frobenius K p)^[x.fst + z1]) y.snd
z2 : ℕ
ih2 : (↑(frobenius K p)^[z.fst + z2]) y.snd = (↑(frobenius K p)^[y.fst + z2]) z.snd
⊢ (↑(frobenius K p)^[x.fst + z1]) ((↑(frobenius K p)^[y.fst + z2]) z.snd) =
    (↑(frobenius K p)^[x.fst + (z2 + (y.fst + z1))]) z.snd

tactic: simp only [add_comm, add_left_comm]
state_before: case intro.intro
K : Type u
inst✝² : CommRing K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : CharP K p
x✝ y✝ x y z : ℕ × K
H1 : EqvGen (R K p) x y
H2 : EqvGen (R K p) y z
z1 : ℕ
ih1 : (↑(frobenius K p)^[y.fst + z1]) x.snd = (↑(frobenius K p)^[x.fst + z1]) y.snd
z2 : ℕ
ih2 : (↑(frobenius K p)^[z.fst + z2]) y.snd = (↑(frobenius K p)^[y.fst + z2]) z.snd
⊢ (↑(frobenius K p)^[x.fst + z1 + (y.fst + z2)]) z.snd = (↑(frobenius K p)^[x.fst + (z2 + (y.fst + z1))]) z.snd