Theorem: succ_plus_n_eq_succ_n_plus (meetings/ex5.lean)

State before:
x y : ↑N0
⊢ plus (S y, x) = S (plus (x, y))
Tactic:
let A := {x : N0 | plus ((S y), x) = S (plus (x, y))}
State after:
x y : ↑N0
A : Set ↑N0 := {x | plus (S y, x) = S (plus (x, y))}
⊢ plus (S y, x) = S (plus (x, y))

State before:
x y : ↑N0
A : Set ↑N0 := {x | plus (S y, x) = S (plus (x, y))}
⊢ plus (S y, x) = S (plus (x, y))
Tactic:
have hzmem : z ∈ A := by
  simp only [Set.mem_setOf_eq]
  rw [zplus, zero_plus_x_eq_eq]
State after:
x y : ↑N0
A : Set ↑N0 := {x | plus (S y, x) = S (plus (x, y))}
hzmem : z ∈ A
⊢ plus (S y, x) = S (plus (x, y))

State before:
x y : ↑N0
A : Set ↑N0 := {x | plus (S y, x) = S (plus (x, y))}
hzmem : z ∈ A
⊢ plus (S y, x) = S (plus (x, y))
Tactic:
have hind : (∀ n : N0, n ∈ A → (S n) ∈ A) := by
  intros n hel
  simp only [Set.mem_setOf_eq]
  simp only [Set.mem_setOf_eq] at hel
  rw [splus, hel, succ_plus_eq_succ_plus]
State after:
x y : ↑N0
A : Set ↑N0 := {x | plus (S y, x) = S (plus (x, y))}
hzmem : z ∈ A
hind : ∀ n ∈ A, S n ∈ A
⊢ plus (S y, x) = S (plus (x, y))

State before:
x y : ↑N0
A : Set ↑N0 := {x | plus (S y, x) = S (plus (x, y))}
hzmem : z ∈ A
hind : ∀ n ∈ A, S n ∈ A
⊢ plus (S y, x) = S (plus (x, y))
Tactic:
have heq := p3 A ⟨hzmem, hind⟩
State after:
x y : ↑N0
A : Set ↑N0 := {x | plus (S y, x) = S (plus (x, y))}
hzmem : z ∈ A
hind : ∀ n ∈ A, S n ∈ A
heq : Subtype.val '' A = N0
⊢ plus (S y, x) = S (plus (x, y))

State before:
x y : ↑N0
A : Set ↑N0 := {x | plus (S y, x) = S (plus (x, y))}
hzmem : z ∈ A
hind : ∀ n ∈ A, S n ∈ A
heq : Subtype.val '' A = N0
⊢ plus (S y, x) = S (plus (x, y))
Tactic:
simp [A, Set.ext_iff] at heq
State after:
x y : ↑N0
A : Set ↑N0 := {x | plus (S y, x) = S (plus (x, y))}
hzmem : z ∈ A
hind : ∀ n ∈ A, S n ∈ A
heq :
  ∀ (x : α),
    (∃ (x_1 : x ∈ N0),
        plus (S y, { val := x, property := (_ : x ∈ N0) }) = S (plus ({ val := x, property := (_ : x ∈ N0) }, y))) ↔
      x ∈ N0
⊢ plus (S y, x) = S (plus (x, y))

State before:
x y : ↑N0
A : Set ↑N0 := {x | plus (S y, x) = S (plus (x, y))}
hzmem : z ∈ A
hind : ∀ n ∈ A, S n ∈ A
heq :
  ∀ (x : α),
    (∃ (x_1 : x ∈ N0),
        plus (S y, { val := x, property := (_ : x ∈ N0) }) = S (plus ({ val := x, property := (_ : x ∈ N0) }, y))) ↔
      x ∈ N0
⊢ plus (S y, x) = S (plus (x, y))
Tactic:
specialize heq x
State after:
x y : ↑N0
A : Set ↑N0 := {x | plus (S y, x) = S (plus (x, y))}
hzmem : z ∈ A
hind : ∀ n ∈ A, S n ∈ A
heq :
  (∃ (x_1 : ↑x ∈ N0),
      plus (S y, { val := ↑x, property := (_ : ↑x ∈ N0) }) = S (plus ({ val := ↑x, property := (_ : ↑x ∈ N0) }, y))) ↔
    ↑x ∈ N0
⊢ plus (S y, x) = S (plus (x, y))

State before:
x y : ↑N0
A : Set ↑N0 := {x | plus (S y, x) = S (plus (x, y))}
hzmem : z ∈ A
hind : ∀ n ∈ A, S n ∈ A
heq :
  (∃ (x_1 : ↑x ∈ N0),
      plus (S y, { val := ↑x, property := (_ : ↑x ∈ N0) }) = S (plus ({ val := ↑x, property := (_ : ↑x ∈ N0) }, y))) ↔
    ↑x ∈ N0
⊢ plus (S y, x) = S (plus (x, y))
Tactic:
simp only [Subtype.coe_eta, Subtype.coe_prop, exists_const, iff_true] at heq
State after:
x y : ↑N0
A : Set ↑N0 := {x | plus (S y, x) = S (plus (x, y))}
hzmem : z ∈ A
hind : ∀ n ∈ A, S n ∈ A
heq : plus (S y, x) = S (plus (x, y))
⊢ plus (S y, x) = S (plus (x, y))

State before:
x y : ↑N0
A : Set ↑N0 := {x | plus (S y, x) = S (plus (x, y))}
hzmem : z ∈ A
hind : ∀ n ∈ A, S n ∈ A
heq : plus (S y, x) = S (plus (x, y))
⊢ plus (S y, x) = S (plus (x, y))
Tactic:
exact heq
State after:
no goals

State before:
x y : ↑N0
A : Set ↑N0 := {x | plus (S y, x) = S (plus (x, y))}
⊢ z ∈ A
Tactic:
simp only [Set.mem_setOf_eq]
State after:
x y : ↑N0
A : Set ↑N0 := {x | plus (S y, x) = S (plus (x, y))}
⊢ plus (S y, z) = S (plus (z, y))

State before:
x y : ↑N0
A : Set ↑N0 := {x | plus (S y, x) = S (plus (x, y))}
⊢ plus (S y, z) = S (plus (z, y))
Tactic:
rw [zplus, zero_plus_x_eq_eq]
State after:
no goals

State before:
x y : ↑N0
A : Set ↑N0 := {x | plus (S y, x) = S (plus (x, y))}
hzmem : z ∈ A
⊢ ∀ n ∈ A, S n ∈ A
Tactic:
intros n hel
State after:
x y : ↑N0
A : Set ↑N0 := {x | plus (S y, x) = S (plus (x, y))}
hzmem : z ∈ A
n : ↑N0
hel : n ∈ A
⊢ S n ∈ A

State before:
x y : ↑N0
A : Set ↑N0 := {x | plus (S y, x) = S (plus (x, y))}
hzmem : z ∈ A
n : ↑N0
hel : n ∈ A
⊢ S n ∈ A
Tactic:
simp only [Set.mem_setOf_eq]
State after:
x y : ↑N0
A : Set ↑N0 := {x | plus (S y, x) = S (plus (x, y))}
hzmem : z ∈ A
n : ↑N0
hel : n ∈ A
⊢ plus (S y, S n) = S (plus (S n, y))

State before:
x y : ↑N0
A : Set ↑N0 := {x | plus (S y, x) = S (plus (x, y))}
hzmem : z ∈ A
n : ↑N0
hel : n ∈ A
⊢ plus (S y, S n) = S (plus (S n, y))
Tactic:
simp only [Set.mem_setOf_eq] at hel
State after:
x y : ↑N0
A : Set ↑N0 := {x | plus (S y, x) = S (plus (x, y))}
hzmem : z ∈ A
n : ↑N0
hel : plus (S y, n) = S (plus (n, y))
⊢ plus (S y, S n) = S (plus (S n, y))

State before:
x y : ↑N0
A : Set ↑N0 := {x | plus (S y, x) = S (plus (x, y))}
hzmem : z ∈ A
n : ↑N0
hel : plus (S y, n) = S (plus (n, y))
⊢ plus (S y, S n) = S (plus (S n, y))
Tactic:
rw [splus, hel, succ_plus_eq_succ_plus]
State after:
no goals