l3lab/ntp-mathlib huggingface dataset:
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> 

Proof state:
case inl.inl.inl.inr
b c d : ℤ
h✝² : b = 1
h✝¹ : c = 1
h✝ : d = -1
⊢ 1 + b = c + d ↔ 1 = c ∧ b = d ∨ 1 = d ∧ b = c

Next tactic:
subst b
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> 

Proof state:
case inl.inl.inr.inl
b c d : ℤ
h✝² : b = 1
h✝¹ : c = -1
h✝ : d = 1
⊢ 1 + b = c + d ↔ 1 = c ∧ b = d ∨ 1 = d ∧ b = c

Next tactic:
subst b
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> 

Proof state:
case inl.inl.inr.inr
b c d : ℤ
h✝² : b = 1
h✝¹ : c = -1
h✝ : d = -1
⊢ 1 + b = c + d ↔ 1 = c ∧ b = d ∨ 1 = d ∧ b = c

Next tactic:
subst b
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> 

Proof state:
case inl.inr.inl.inl
b c d : ℤ
h✝² : b = -1
h✝¹ : c = 1
h✝ : d = 1
⊢ 1 + b = c + d ↔ 1 = c ∧ b = d ∨ 1 = d ∧ b = c

Next tactic:
subst b
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> 

Proof state:
case inl.inr.inl.inr
b c d : ℤ
h✝² : b = -1
h✝¹ : c = 1
h✝ : d = -1
⊢ 1 + b = c + d ↔ 1 = c ∧ b = d ∨ 1 = d ∧ b = c

Next tactic:
subst b
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> 

Proof state:
case inl.inr.inr.inl
b c d : ℤ
h✝² : b = -1
h✝¹ : c = -1
h✝ : d = 1
⊢ 1 + b = c + d ↔ 1 = c ∧ b = d ∨ 1 = d ∧ b = c

Next tactic:
subst b
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> 

Proof state:
case inl.inr.inr.inr
b c d : ℤ
h✝² : b = -1
h✝¹ : c = -1
h✝ : d = -1
⊢ 1 + b = c + d ↔ 1 = c ∧ b = d ∨ 1 = d ∧ b = c

Next tactic:
subst b
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> 

Proof state:
case inr.inl.inl.inl
b c d : ℤ
h✝² : b = 1
h✝¹ : c = 1
h✝ : d = 1
⊢ -1 + b = c + d ↔ -1 = c ∧ b = d ∨ -1 = d ∧ b = c

Next tactic:
subst b
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> 

Proof state:
case inr.inl.inl.inr
b c d : ℤ
h✝² : b = 1
h✝¹ : c = 1
h✝ : d = -1
⊢ -1 + b = c + d ↔ -1 = c ∧ b = d ∨ -1 = d ∧ b = c

Next tactic:
subst b
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> 

Proof state:
case inr.inl.inr.inl
b c d : ℤ
h✝² : b = 1
h✝¹ : c = -1
h✝ : d = 1
⊢ -1 + b = c + d ↔ -1 = c ∧ b = d ∨ -1 = d ∧ b = c

Next tactic:
subst b
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> 

Proof state:
case inr.inl.inr.inr
b c d : ℤ
h✝² : b = 1
h✝¹ : c = -1
h✝ : d = -1
⊢ -1 + b = c + d ↔ -1 = c ∧ b = d ∨ -1 = d ∧ b = c

Next tactic:
subst b
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> 

Proof state:
case inr.inr.inl.inl
b c d : ℤ
h✝² : b = -1
h✝¹ : c = 1
h✝ : d = 1
⊢ -1 + b = c + d ↔ -1 = c ∧ b = d ∨ -1 = d ∧ b = c

Next tactic:
subst b
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> 

Proof state:
case inr.inr.inl.inr
b c d : ℤ
h✝² : b = -1
h✝¹ : c = 1
h✝ : d = -1
⊢ -1 + b = c + d ↔ -1 = c ∧ b = d ∨ -1 = d ∧ b = c

Next tactic:
subst b
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> 

Proof state:
case inr.inr.inr.inl
b c d : ℤ
h✝² : b = -1
h✝¹ : c = -1
h✝ : d = 1
⊢ -1 + b = c + d ↔ -1 = c ∧ b = d ∨ -1 = d ∧ b = c

Next tactic:
subst b
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> 

Proof state:
case inr.inr.inr.inr
b c d : ℤ
h✝² : b = -1
h✝¹ : c = -1
h✝ : d = -1
⊢ -1 + b = c + d ↔ -1 = c ∧ b = d ∨ -1 = d ∧ b = c

Next tactic:
subst b
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> 

Proof state:
case inl.inl.inl.inl
c d : ℤ
h✝¹ : c = 1
h✝ : d = 1
⊢ 1 + 1 = c + d ↔ 1 = c ∧ 1 = d ∨ 1 = d ∧ 1 = c

Next tactic:
subst c
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> 

Proof state:
case inl.inl.inl.inr
c d : ℤ
h✝¹ : c = 1
h✝ : d = -1
⊢ 1 + 1 = c + d ↔ 1 = c ∧ 1 = d ∨ 1 = d ∧ 1 = c

Next tactic:
subst c
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> 

Proof state:
case inl.inl.inr.inl
c d : ℤ
h✝¹ : c = -1
h✝ : d = 1
⊢ 1 + 1 = c + d ↔ 1 = c ∧ 1 = d ∨ 1 = d ∧ 1 = c

Next tactic:
subst c
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> 

Proof state:
case inl.inl.inr.inr
c d : ℤ
h✝¹ : c = -1
h✝ : d = -1
⊢ 1 + 1 = c + d ↔ 1 = c ∧ 1 = d ∨ 1 = d ∧ 1 = c

Next tactic:
subst c
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> 

Proof state:
case inl.inr.inl.inl
c d : ℤ
h✝¹ : c = 1
h✝ : d = 1
⊢ 1 + -1 = c + d ↔ 1 = c ∧ -1 = d ∨ 1 = d ∧ -1 = c

Next tactic:
subst c
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> 

Proof state:
case inl.inr.inl.inr
c d : ℤ
h✝¹ : c = 1
h✝ : d = -1
⊢ 1 + -1 = c + d ↔ 1 = c ∧ -1 = d ∨ 1 = d ∧ -1 = c

Next tactic:
subst c
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> 

Proof state:
case inl.inr.inr.inl
c d : ℤ
h✝¹ : c = -1
h✝ : d = 1
⊢ 1 + -1 = c + d ↔ 1 = c ∧ -1 = d ∨ 1 = d ∧ -1 = c

Next tactic:
subst c
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> 

Proof state:
case inl.inr.inr.inr
c d : ℤ
h✝¹ : c = -1
h✝ : d = -1
⊢ 1 + -1 = c + d ↔ 1 = c ∧ -1 = d ∨ 1 = d ∧ -1 = c

Next tactic:
subst c
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> 

Proof state:
case inr.inl.inl.inl
c d : ℤ
h✝¹ : c = 1
h✝ : d = 1
⊢ -1 + 1 = c + d ↔ -1 = c ∧ 1 = d ∨ -1 = d ∧ 1 = c

Next tactic:
subst c
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> 

Proof state:
case inr.inl.inl.inr
c d : ℤ
h✝¹ : c = 1
h✝ : d = -1
⊢ -1 + 1 = c + d ↔ -1 = c ∧ 1 = d ∨ -1 = d ∧ 1 = c

Next tactic:
subst c
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> 

Proof state:
case inr.inl.inr.inl
c d : ℤ
h✝¹ : c = -1
h✝ : d = 1
⊢ -1 + 1 = c + d ↔ -1 = c ∧ 1 = d ∨ -1 = d ∧ 1 = c

Next tactic:
subst c
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> 

Proof state:
case inr.inl.inr.inr
c d : ℤ
h✝¹ : c = -1
h✝ : d = -1
⊢ -1 + 1 = c + d ↔ -1 = c ∧ 1 = d ∨ -1 = d ∧ 1 = c

Next tactic:
subst c
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> 

Proof state:
case inr.inr.inl.inl
c d : ℤ
h✝¹ : c = 1
h✝ : d = 1
⊢ -1 + -1 = c + d ↔ -1 = c ∧ -1 = d ∨ -1 = d ∧ -1 = c

Next tactic:
subst c
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> 

Proof state:
case inr.inr.inl.inr
c d : ℤ
h✝¹ : c = 1
h✝ : d = -1
⊢ -1 + -1 = c + d ↔ -1 = c ∧ -1 = d ∨ -1 = d ∧ -1 = c

Next tactic:
subst c
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> 

Proof state:
case inr.inr.inr.inl
c d : ℤ
h✝¹ : c = -1
h✝ : d = 1
⊢ -1 + -1 = c + d ↔ -1 = c ∧ -1 = d ∨ -1 = d ∧ -1 = c

Next tactic:
subst c
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> 

Proof state:
case inr.inr.inr.inr
c d : ℤ
h✝¹ : c = -1
h✝ : d = -1
⊢ -1 + -1 = c + d ↔ -1 = c ∧ -1 = d ∨ -1 = d ∧ -1 = c

Next tactic:
subst c
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> subst c <;> 

Proof state:
case inl.inl.inl.inl
d : ℤ
h✝ : d = 1
⊢ 1 + 1 = 1 + d ↔ 1 = 1 ∧ 1 = d ∨ 1 = d ∧ 1 = 1

Next tactic:
subst d
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> subst c <;> 

Proof state:
case inl.inl.inl.inr
d : ℤ
h✝ : d = -1
⊢ 1 + 1 = 1 + d ↔ 1 = 1 ∧ 1 = d ∨ 1 = d ∧ 1 = 1

Next tactic:
subst d
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> subst c <;> 

Proof state:
case inl.inl.inr.inl
d : ℤ
h✝ : d = 1
⊢ 1 + 1 = -1 + d ↔ 1 = -1 ∧ 1 = d ∨ 1 = d ∧ 1 = -1

Next tactic:
subst d
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> subst c <;> 

Proof state:
case inl.inl.inr.inr
d : ℤ
h✝ : d = -1
⊢ 1 + 1 = -1 + d ↔ 1 = -1 ∧ 1 = d ∨ 1 = d ∧ 1 = -1

Next tactic:
subst d
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> subst c <;> 

Proof state:
case inl.inr.inl.inl
d : ℤ
h✝ : d = 1
⊢ 1 + -1 = 1 + d ↔ 1 = 1 ∧ -1 = d ∨ 1 = d ∧ -1 = 1

Next tactic:
subst d
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> subst c <;> 

Proof state:
case inl.inr.inl.inr
d : ℤ
h✝ : d = -1
⊢ 1 + -1 = 1 + d ↔ 1 = 1 ∧ -1 = d ∨ 1 = d ∧ -1 = 1

Next tactic:
subst d
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> subst c <;> 

Proof state:
case inl.inr.inr.inl
d : ℤ
h✝ : d = 1
⊢ 1 + -1 = -1 + d ↔ 1 = -1 ∧ -1 = d ∨ 1 = d ∧ -1 = -1

Next tactic:
subst d
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> subst c <;> 

Proof state:
case inl.inr.inr.inr
d : ℤ
h✝ : d = -1
⊢ 1 + -1 = -1 + d ↔ 1 = -1 ∧ -1 = d ∨ 1 = d ∧ -1 = -1

Next tactic:
subst d
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> subst c <;> 

Proof state:
case inr.inl.inl.inl
d : ℤ
h✝ : d = 1
⊢ -1 + 1 = 1 + d ↔ -1 = 1 ∧ 1 = d ∨ -1 = d ∧ 1 = 1

Next tactic:
subst d
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> subst c <;> 

Proof state:
case inr.inl.inl.inr
d : ℤ
h✝ : d = -1
⊢ -1 + 1 = 1 + d ↔ -1 = 1 ∧ 1 = d ∨ -1 = d ∧ 1 = 1

Next tactic:
subst d
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> subst c <;> 

Proof state:
case inr.inl.inr.inl
d : ℤ
h✝ : d = 1
⊢ -1 + 1 = -1 + d ↔ -1 = -1 ∧ 1 = d ∨ -1 = d ∧ 1 = -1

Next tactic:
subst d
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> subst c <;> 

Proof state:
case inr.inl.inr.inr
d : ℤ
h✝ : d = -1
⊢ -1 + 1 = -1 + d ↔ -1 = -1 ∧ 1 = d ∨ -1 = d ∧ 1 = -1

Next tactic:
subst d
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> subst c <;> 

Proof state:
case inr.inr.inl.inl
d : ℤ
h✝ : d = 1
⊢ -1 + -1 = 1 + d ↔ -1 = 1 ∧ -1 = d ∨ -1 = d ∧ -1 = 1

Next tactic:
subst d
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> subst c <;> 

Proof state:
case inr.inr.inl.inr
d : ℤ
h✝ : d = -1
⊢ -1 + -1 = 1 + d ↔ -1 = 1 ∧ -1 = d ∨ -1 = d ∧ -1 = 1

Next tactic:
subst d
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> subst c <;> 

Proof state:
case inr.inr.inr.inl
d : ℤ
h✝ : d = 1
⊢ -1 + -1 = -1 + d ↔ -1 = -1 ∧ -1 = d ∨ -1 = d ∧ -1 = -1

Next tactic:
subst d
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> subst c <;> 

Proof state:
case inr.inr.inr.inr
d : ℤ
h✝ : d = -1
⊢ -1 + -1 = -1 + d ↔ -1 = -1 ∧ -1 = d ∨ -1 = d ∧ -1 = -1

Next tactic:
subst d
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> subst c <;> subst d <;>
    

Proof state:
case inl.inl.inl.inl
⊢ 1 + 1 = 1 + 1 ↔ 1 = 1 ∧ 1 = 1 ∨ 1 = 1 ∧ 1 = 1

Next tactic:
simp (config := {decide := true})
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> subst c <;> subst d <;>
    

Proof state:
case inl.inl.inl.inr
⊢ 1 + 1 = 1 + -1 ↔ 1 = 1 ∧ 1 = -1 ∨ 1 = -1 ∧ 1 = 1

Next tactic:
simp (config := {decide := true})
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> subst c <;> subst d <;>
    

Proof state:
case inl.inl.inr.inl
⊢ 1 + 1 = -1 + 1 ↔ 1 = -1 ∧ 1 = 1 ∨ 1 = 1 ∧ 1 = -1

Next tactic:
simp (config := {decide := true})
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> subst c <;> subst d <;>
    

Proof state:
case inl.inl.inr.inr
⊢ 1 + 1 = -1 + -1 ↔ 1 = -1 ∧ 1 = -1 ∨ 1 = -1 ∧ 1 = -1

Next tactic:
simp (config := {decide := true})
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> subst c <;> subst d <;>
    

Proof state:
case inl.inr.inl.inl
⊢ 1 + -1 = 1 + 1 ↔ 1 = 1 ∧ -1 = 1 ∨ 1 = 1 ∧ -1 = 1

Next tactic:
simp (config := {decide := true})
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> subst c <;> subst d <;>
    

Proof state:
case inl.inr.inl.inr
⊢ 1 + -1 = 1 + -1 ↔ 1 = 1 ∧ -1 = -1 ∨ 1 = -1 ∧ -1 = 1

Next tactic:
simp (config := {decide := true})
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> subst c <;> subst d <;>
    

Proof state:
case inl.inr.inr.inl
⊢ 1 + -1 = -1 + 1 ↔ 1 = -1 ∧ -1 = 1 ∨ 1 = 1 ∧ -1 = -1

Next tactic:
simp (config := {decide := true})
theorem isUnit_add_isUnit_eq_isUnit_add_isUnit {a b c d : ℤ} (ha : IsUnit a) (hb : IsUnit b)
    (hc : IsUnit c) (hd : IsUnit d) : a + b = c + d ↔ a = c ∧ b = d ∨ a = d ∧ b = c := by
  rw [isUnit_iff] at ha hb hc hd
  cases ha <;> cases hb <;> cases hc <;> cases hd <;>
      subst a <;> subst b <;> subst c <;> subst d <;>
    

Proof state:
case inl.inr.inr.inr
⊢ 1 + -1 = -1 + -1 ↔ 1 = -1 ∧ -1 = -1 ∨ 1 = -1 ∧ -1 = -1

Next tactic:
simp (config := {decide := true})