case intro.intro.intro.intro.intro
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht1 : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n ∨ x = 2 * m * n ∧ y = m ^ 2 - n ^ 2
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
⊢ ∃ m n,
    x = m ^ 2 - n ^ 2 ∧
      y = 2 * m * n ∧ z = m ^ 2 + n ^ 2 ∧ Int.gcd m n = 1 ∧ (m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0) ∧ 0 ≤ m
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
⊢ ∃ m n,
    x = m ^ 2 - n ^ 2 ∧
      y = 2 * m * n ∧ z = m ^ 2 + n ^ 2 ∧ Int.gcd m n = 1 ∧ (m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0) ∧ 0 ≤ m
obtain ⟨m, n, ht1, ht2, ht3, ht4⟩ :=
  PythagoreanTriple.coprime_classification.mp (And.intro h h_coprime)
case intro.intro.intro.intro.intro.inl
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht1 : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n ∨ x = 2 * m * n ∧ y = m ^ 2 - n ^ 2
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : 0 ≤ m
⊢ ∃ m n,
    x = m ^ 2 - n ^ 2 ∧
      y = 2 * m * n ∧ z = m ^ 2 + n ^ 2 ∧ Int.gcd m n = 1 ∧ (m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0) ∧ 0 ≤ m

case intro.intro.intro.intro.intro.inr
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht1 : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n ∨ x = 2 * m * n ∧ y = m ^ 2 - n ^ 2
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
⊢ ∃ m n,
    x = m ^ 2 - n ^ 2 ∧
      y = 2 * m * n ∧ z = m ^ 2 + n ^ 2 ∧ Int.gcd m n = 1 ∧ (m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0) ∧ 0 ≤ m
case intro.intro.intro.intro.intro
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht1 : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n ∨ x = 2 * m * n ∧ y = m ^ 2 - n ^ 2
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
⊢ ∃ m n,
    x = m ^ 2 - n ^ 2 ∧
      y = 2 * m * n ∧ z = m ^ 2 + n ^ 2 ∧ Int.gcd m n = 1 ∧ (m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0) ∧ 0 ≤ m
cases' le_or_lt 0 m with hm hm
case intro.intro.intro.intro.intro.inl
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht1 : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n ∨ x = 2 * m * n ∧ y = m ^ 2 - n ^ 2
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : 0 ≤ m
⊢ x = m ^ 2 - n ^ 2 ∧
    y = 2 * m * n ∧ z = m ^ 2 + n ^ 2 ∧ Int.gcd m n = 1 ∧ (m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0) ∧ 0 ≤ m
case intro.intro.intro.intro.intro.inl
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht1 : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n ∨ x = 2 * m * n ∧ y = m ^ 2 - n ^ 2
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : 0 ≤ m
⊢ ∃ m n,
    x = m ^ 2 - n ^ 2 ∧
      y = 2 * m * n ∧ z = m ^ 2 + n ^ 2 ∧ Int.gcd m n = 1 ∧ (m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0) ∧ 0 ≤ m
use m, n
case intro.intro.intro.intro.intro.inl.inl
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : 0 ≤ m
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
⊢ x = m ^ 2 - n ^ 2 ∧
    y = 2 * m * n ∧ z = m ^ 2 + n ^ 2 ∧ Int.gcd m n = 1 ∧ (m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0) ∧ 0 ≤ m

case intro.intro.intro.intro.intro.inl.inr
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : 0 ≤ m
h_even : x = 2 * m * n ∧ y = m ^ 2 - n ^ 2
⊢ x = m ^ 2 - n ^ 2 ∧
    y = 2 * m * n ∧ z = m ^ 2 + n ^ 2 ∧ Int.gcd m n = 1 ∧ (m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0) ∧ 0 ≤ m
case intro.intro.intro.intro.intro.inl
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht1 : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n ∨ x = 2 * m * n ∧ y = m ^ 2 - n ^ 2
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : 0 ≤ m
⊢ x = m ^ 2 - n ^ 2 ∧
    y = 2 * m * n ∧ z = m ^ 2 + n ^ 2 ∧ Int.gcd m n = 1 ∧ (m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0) ∧ 0 ≤ m
cases' ht1 with h_odd h_even
case intro.intro.intro.intro.intro.inl.inr.h
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : 0 ≤ m
h_even : x = 2 * m * n ∧ y = m ^ 2 - n ^ 2
⊢ False
case intro.intro.intro.intro.intro.inl.inr
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : 0 ≤ m
h_even : x = 2 * m * n ∧ y = m ^ 2 - n ^ 2
⊢ x = m ^ 2 - n ^ 2 ∧
    y = 2 * m * n ∧ z = m ^ 2 + n ^ 2 ∧ Int.gcd m n = 1 ∧ (m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0) ∧ 0 ≤ m
exfalso
case intro.intro.intro.intro.intro.inl.inr.h.intro
x y✝ z✝ : ℤ
h✝ : PythagoreanTriple x y✝ z✝
y z : ℤ
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : 0 ≤ m
h : PythagoreanTriple (2 * m * n) y z
h_coprime : Int.gcd (2 * m * n) y = 1
h_parity : 2 * m * n % 2 = 1
⊢ False
case intro.intro.intro.intro.intro.inl.inr.h
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : 0 ≤ m
h_even : x = 2 * m * n ∧ y = m ^ 2 - n ^ 2
⊢ False
rcases h_even with ⟨rfl, -⟩
case intro.intro.intro.intro.intro.inl.inr.h.intro
x y✝ z✝ : ℤ
h✝ : PythagoreanTriple x y✝ z✝
y z : ℤ
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : 0 ≤ m
h : PythagoreanTriple (2 * m * n) y z
h_coprime : Int.gcd (2 * m * n) y = 1
h_parity : 0 = 1
⊢ False
case intro.intro.intro.intro.intro.inl.inr.h.intro
x y✝ z✝ : ℤ
h✝ : PythagoreanTriple x y✝ z✝
y z : ℤ
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : 0 ≤ m
h : PythagoreanTriple (2 * m * n) y z
h_coprime : Int.gcd (2 * m * n) y = 1
h_parity : 2 * m * n % 2 = 1
⊢ False
rw [mul_assoc, Int.mul_emod_right] at h_parity
no goals
case intro.intro.intro.intro.intro.inl.inr.h.intro
x y✝ z✝ : ℤ
h✝ : PythagoreanTriple x y✝ z✝
y z : ℤ
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : 0 ≤ m
h : PythagoreanTriple (2 * m * n) y z
h_coprime : Int.gcd (2 * m * n) y = 1
h_parity : 0 = 1
⊢ False
exact zero_ne_one h_parity
case intro.intro.intro.intro.intro.inl.inl
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : 0 ≤ m
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
⊢ y = 2 * m * n ∧ z = m ^ 2 + n ^ 2 ∧ Int.gcd m n = 1 ∧ (m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0) ∧ 0 ≤ m
case intro.intro.intro.intro.intro.inl.inl
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : 0 ≤ m
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
⊢ x = m ^ 2 - n ^ 2 ∧
    y = 2 * m * n ∧ z = m ^ 2 + n ^ 2 ∧ Int.gcd m n = 1 ∧ (m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0) ∧ 0 ≤ m
apply And.intro h_odd.1
case intro.intro.intro.intro.intro.inl.inl
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : 0 ≤ m
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
⊢ z = m ^ 2 + n ^ 2 ∧ Int.gcd m n = 1 ∧ (m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0) ∧ 0 ≤ m
case intro.intro.intro.intro.intro.inl.inl
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : 0 ≤ m
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
⊢ y = 2 * m * n ∧ z = m ^ 2 + n ^ 2 ∧ Int.gcd m n = 1 ∧ (m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0) ∧ 0 ≤ m
apply And.intro h_odd.2
case intro.intro.intro.intro.intro.inl.inl.inl
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos✝ : 0 < z
m n : ℤ
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : 0 ≤ m
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
h_pos : z = m ^ 2 + n ^ 2
⊢ z = m ^ 2 + n ^ 2 ∧ Int.gcd m n = 1 ∧ (m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0) ∧ 0 ≤ m

case intro.intro.intro.intro.intro.inl.inl.inr
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : 0 ≤ m
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
h_neg : z = -(m ^ 2 + n ^ 2)
⊢ z = m ^ 2 + n ^ 2 ∧ Int.gcd m n = 1 ∧ (m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0) ∧ 0 ≤ m
case intro.intro.intro.intro.intro.inl.inl
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : 0 ≤ m
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
⊢ z = m ^ 2 + n ^ 2 ∧ Int.gcd m n = 1 ∧ (m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0) ∧ 0 ≤ m
cases' ht2 with h_pos h_neg
no goals
case intro.intro.intro.intro.intro.inl.inl.inl
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos✝ : 0 < z
m n : ℤ
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : 0 ≤ m
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
h_pos : z = m ^ 2 + n ^ 2
⊢ z = m ^ 2 + n ^ 2 ∧ Int.gcd m n = 1 ∧ (m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0) ∧ 0 ≤ m
apply And.intro h_pos (And.intro ht3 (And.intro ht4 hm))
case intro.intro.intro.intro.intro.inl.inl.inr.h
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : 0 ≤ m
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
h_neg : z = -(m ^ 2 + n ^ 2)
⊢ False
case intro.intro.intro.intro.intro.inl.inl.inr
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : 0 ≤ m
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
h_neg : z = -(m ^ 2 + n ^ 2)
⊢ z = m ^ 2 + n ^ 2 ∧ Int.gcd m n = 1 ∧ (m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0) ∧ 0 ≤ m
exfalso
case intro.intro.intro.intro.intro.inl.inl.inr.h
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
m n : ℤ
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : 0 ≤ m
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
h_neg : z = -(m ^ 2 + n ^ 2)
⊢ 0 < z → False
case intro.intro.intro.intro.intro.inl.inl.inr.h
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : 0 ≤ m
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
h_neg : z = -(m ^ 2 + n ^ 2)
⊢ False
revert h_pos
case intro.intro.intro.intro.intro.inl.inl.inr.h
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
m n : ℤ
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : 0 ≤ m
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
h_neg : z = -(m ^ 2 + n ^ 2)
⊢ 0 < -(m ^ 2 + n ^ 2) → False
case intro.intro.intro.intro.intro.inl.inl.inr.h
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
m n : ℤ
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : 0 ≤ m
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
h_neg : z = -(m ^ 2 + n ^ 2)
⊢ 0 < z → False
rw [h_neg]
no goals
case intro.intro.intro.intro.intro.inl.inl.inr.h
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
m n : ℤ
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : 0 ≤ m
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
h_neg : z = -(m ^ 2 + n ^ 2)
⊢ 0 < -(m ^ 2 + n ^ 2) → False
exact imp_false.mpr (not_lt.mpr (neg_nonpos.mpr (add_nonneg (sq_nonneg m) (sq_nonneg n))))
case intro.intro.intro.intro.intro.inr
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht1 : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n ∨ x = 2 * m * n ∧ y = m ^ 2 - n ^ 2
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
⊢ x = (-m) ^ 2 - (-n) ^ 2 ∧
    y = 2 * -m * -n ∧
      z = (-m) ^ 2 + (-n) ^ 2 ∧ Int.gcd (-m) (-n) = 1 ∧ (-m % 2 = 0 ∧ -n % 2 = 1 ∨ -m % 2 = 1 ∧ -n % 2 = 0) ∧ 0 ≤ -m
case intro.intro.intro.intro.intro.inr
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht1 : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n ∨ x = 2 * m * n ∧ y = m ^ 2 - n ^ 2
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
⊢ ∃ m n,
    x = m ^ 2 - n ^ 2 ∧
      y = 2 * m * n ∧ z = m ^ 2 + n ^ 2 ∧ Int.gcd m n = 1 ∧ (m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0) ∧ 0 ≤ m
use -m, -n
case intro.intro.intro.intro.intro.inr.inl
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
⊢ x = (-m) ^ 2 - (-n) ^ 2 ∧
    y = 2 * -m * -n ∧
      z = (-m) ^ 2 + (-n) ^ 2 ∧ Int.gcd (-m) (-n) = 1 ∧ (-m % 2 = 0 ∧ -n % 2 = 1 ∨ -m % 2 = 1 ∧ -n % 2 = 0) ∧ 0 ≤ -m

case intro.intro.intro.intro.intro.inr.inr
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_even : x = 2 * m * n ∧ y = m ^ 2 - n ^ 2
⊢ x = (-m) ^ 2 - (-n) ^ 2 ∧
    y = 2 * -m * -n ∧
      z = (-m) ^ 2 + (-n) ^ 2 ∧ Int.gcd (-m) (-n) = 1 ∧ (-m % 2 = 0 ∧ -n % 2 = 1 ∨ -m % 2 = 1 ∧ -n % 2 = 0) ∧ 0 ≤ -m
case intro.intro.intro.intro.intro.inr
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht1 : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n ∨ x = 2 * m * n ∧ y = m ^ 2 - n ^ 2
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
⊢ x = (-m) ^ 2 - (-n) ^ 2 ∧
    y = 2 * -m * -n ∧
      z = (-m) ^ 2 + (-n) ^ 2 ∧ Int.gcd (-m) (-n) = 1 ∧ (-m % 2 = 0 ∧ -n % 2 = 1 ∨ -m % 2 = 1 ∧ -n % 2 = 0) ∧ 0 ≤ -m
cases' ht1 with h_odd h_even
case intro.intro.intro.intro.intro.inr.inr.h
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_even : x = 2 * m * n ∧ y = m ^ 2 - n ^ 2
⊢ False
case intro.intro.intro.intro.intro.inr.inr
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_even : x = 2 * m * n ∧ y = m ^ 2 - n ^ 2
⊢ x = (-m) ^ 2 - (-n) ^ 2 ∧
    y = 2 * -m * -n ∧
      z = (-m) ^ 2 + (-n) ^ 2 ∧ Int.gcd (-m) (-n) = 1 ∧ (-m % 2 = 0 ∧ -n % 2 = 1 ∨ -m % 2 = 1 ∧ -n % 2 = 0) ∧ 0 ≤ -m
exfalso
case intro.intro.intro.intro.intro.inr.inr.h.intro
x y✝ z✝ : ℤ
h✝ : PythagoreanTriple x y✝ z✝
y z : ℤ
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h : PythagoreanTriple (2 * m * n) y z
h_coprime : Int.gcd (2 * m * n) y = 1
h_parity : 2 * m * n % 2 = 1
⊢ False
case intro.intro.intro.intro.intro.inr.inr.h
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_even : x = 2 * m * n ∧ y = m ^ 2 - n ^ 2
⊢ False
rcases h_even with ⟨rfl, -⟩
case intro.intro.intro.intro.intro.inr.inr.h.intro
x y✝ z✝ : ℤ
h✝ : PythagoreanTriple x y✝ z✝
y z : ℤ
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h : PythagoreanTriple (2 * m * n) y z
h_coprime : Int.gcd (2 * m * n) y = 1
h_parity : 0 = 1
⊢ False
case intro.intro.intro.intro.intro.inr.inr.h.intro
x y✝ z✝ : ℤ
h✝ : PythagoreanTriple x y✝ z✝
y z : ℤ
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h : PythagoreanTriple (2 * m * n) y z
h_coprime : Int.gcd (2 * m * n) y = 1
h_parity : 2 * m * n % 2 = 1
⊢ False
rw [mul_assoc, Int.mul_emod_right] at h_parity
no goals
case intro.intro.intro.intro.intro.inr.inr.h.intro
x y✝ z✝ : ℤ
h✝ : PythagoreanTriple x y✝ z✝
y z : ℤ
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h : PythagoreanTriple (2 * m * n) y z
h_coprime : Int.gcd (2 * m * n) y = 1
h_parity : 0 = 1
⊢ False
exact zero_ne_one h_parity
case intro.intro.intro.intro.intro.inr.inl
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
⊢ x = m ^ 2 - (-n) ^ 2 ∧
    y = 2 * -m * -n ∧
      z = m ^ 2 + (-n) ^ 2 ∧ Int.gcd (-m) (-n) = 1 ∧ (-m % 2 = 0 ∧ -n % 2 = 1 ∨ -m % 2 = 1 ∧ -n % 2 = 0) ∧ 0 ≤ -m
case intro.intro.intro.intro.intro.inr.inl
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
⊢ x = (-m) ^ 2 - (-n) ^ 2 ∧
    y = 2 * -m * -n ∧
      z = (-m) ^ 2 + (-n) ^ 2 ∧ Int.gcd (-m) (-n) = 1 ∧ (-m % 2 = 0 ∧ -n % 2 = 1 ∨ -m % 2 = 1 ∧ -n % 2 = 0) ∧ 0 ≤ -m
rw [neg_sq m]
case intro.intro.intro.intro.intro.inr.inl
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
⊢ x = m ^ 2 - n ^ 2 ∧
    y = 2 * -m * -n ∧
      z = m ^ 2 + n ^ 2 ∧ Int.gcd (-m) (-n) = 1 ∧ (-m % 2 = 0 ∧ -n % 2 = 1 ∨ -m % 2 = 1 ∧ -n % 2 = 0) ∧ 0 ≤ -m
case intro.intro.intro.intro.intro.inr.inl
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
⊢ x = m ^ 2 - (-n) ^ 2 ∧
    y = 2 * -m * -n ∧
      z = m ^ 2 + (-n) ^ 2 ∧ Int.gcd (-m) (-n) = 1 ∧ (-m % 2 = 0 ∧ -n % 2 = 1 ∨ -m % 2 = 1 ∧ -n % 2 = 0) ∧ 0 ≤ -m
rw [neg_sq n]
case intro.intro.intro.intro.intro.inr.inl
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
⊢ y = 2 * -m * -n ∧
    z = m ^ 2 + n ^ 2 ∧ Int.gcd (-m) (-n) = 1 ∧ (-m % 2 = 0 ∧ -n % 2 = 1 ∨ -m % 2 = 1 ∧ -n % 2 = 0) ∧ 0 ≤ -m
case intro.intro.intro.intro.intro.inr.inl
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
⊢ x = m ^ 2 - n ^ 2 ∧
    y = 2 * -m * -n ∧
      z = m ^ 2 + n ^ 2 ∧ Int.gcd (-m) (-n) = 1 ∧ (-m % 2 = 0 ∧ -n % 2 = 1 ∨ -m % 2 = 1 ∧ -n % 2 = 0) ∧ 0 ≤ -m
apply And.intro h_odd.1
case intro.intro.intro.intro.intro.inr.inl.left
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
⊢ y = 2 * -m * -n

case intro.intro.intro.intro.intro.inr.inl.right
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
⊢ z = m ^ 2 + n ^ 2 ∧ Int.gcd (-m) (-n) = 1 ∧ (-m % 2 = 0 ∧ -n % 2 = 1 ∨ -m % 2 = 1 ∧ -n % 2 = 0) ∧ 0 ≤ -m
case intro.intro.intro.intro.intro.inr.inl
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
⊢ y = 2 * -m * -n ∧
    z = m ^ 2 + n ^ 2 ∧ Int.gcd (-m) (-n) = 1 ∧ (-m % 2 = 0 ∧ -n % 2 = 1 ∨ -m % 2 = 1 ∧ -n % 2 = 0) ∧ 0 ≤ -m
constructor
case intro.intro.intro.intro.intro.inr.inl.right.inl
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos✝ : 0 < z
m n : ℤ
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
h_pos : z = m ^ 2 + n ^ 2
⊢ z = m ^ 2 + n ^ 2 ∧ Int.gcd (-m) (-n) = 1 ∧ (-m % 2 = 0 ∧ -n % 2 = 1 ∨ -m % 2 = 1 ∧ -n % 2 = 0) ∧ 0 ≤ -m

case intro.intro.intro.intro.intro.inr.inl.right.inr
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
h_neg : z = -(m ^ 2 + n ^ 2)
⊢ z = m ^ 2 + n ^ 2 ∧ Int.gcd (-m) (-n) = 1 ∧ (-m % 2 = 0 ∧ -n % 2 = 1 ∨ -m % 2 = 1 ∧ -n % 2 = 0) ∧ 0 ≤ -m
case intro.intro.intro.intro.intro.inr.inl.right
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
⊢ z = m ^ 2 + n ^ 2 ∧ Int.gcd (-m) (-n) = 1 ∧ (-m % 2 = 0 ∧ -n % 2 = 1 ∨ -m % 2 = 1 ∧ -n % 2 = 0) ∧ 0 ≤ -m
cases' ht2 with h_pos h_neg
case intro.intro.intro.intro.intro.inr.inl.left
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
⊢ 2 * m * n = 2 * -m * -n
case intro.intro.intro.intro.intro.inr.inl.left
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
⊢ y = 2 * -m * -n
rw [h_odd.2]
no goals
case intro.intro.intro.intro.intro.inr.inl.left
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht2 : z = m ^ 2 + n ^ 2 ∨ z = -(m ^ 2 + n ^ 2)
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
⊢ 2 * m * n = 2 * -m * -n
ring
case intro.intro.intro.intro.intro.inr.inl.right.inl
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos✝ : 0 < z
m n : ℤ
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
h_pos : z = m ^ 2 + n ^ 2
⊢ Int.gcd (-m) (-n) = 1 ∧ (-m % 2 = 0 ∧ -n % 2 = 1 ∨ -m % 2 = 1 ∧ -n % 2 = 0) ∧ 0 ≤ -m
case intro.intro.intro.intro.intro.inr.inl.right.inl
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos✝ : 0 < z
m n : ℤ
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
h_pos : z = m ^ 2 + n ^ 2
⊢ z = m ^ 2 + n ^ 2 ∧ Int.gcd (-m) (-n) = 1 ∧ (-m % 2 = 0 ∧ -n % 2 = 1 ∨ -m % 2 = 1 ∧ -n % 2 = 0) ∧ 0 ≤ -m
apply And.intro h_pos
case intro.intro.intro.intro.intro.inr.inl.right.inl.left
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos✝ : 0 < z
m n : ℤ
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
h_pos : z = m ^ 2 + n ^ 2
⊢ Int.gcd (-m) (-n) = 1

case intro.intro.intro.intro.intro.inr.inl.right.inl.right
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos✝ : 0 < z
m n : ℤ
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
h_pos : z = m ^ 2 + n ^ 2
⊢ (-m % 2 = 0 ∧ -n % 2 = 1 ∨ -m % 2 = 1 ∧ -n % 2 = 0) ∧ 0 ≤ -m
case intro.intro.intro.intro.intro.inr.inl.right.inl
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos✝ : 0 < z
m n : ℤ
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
h_pos : z = m ^ 2 + n ^ 2
⊢ Int.gcd (-m) (-n) = 1 ∧ (-m % 2 = 0 ∧ -n % 2 = 1 ∨ -m % 2 = 1 ∧ -n % 2 = 0) ∧ 0 ≤ -m
constructor
case intro.intro.intro.intro.intro.inr.inl.right.inl.left
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos✝ : 0 < z
m n : ℤ
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
h_pos : z = m ^ 2 + n ^ 2
⊢ Nat.gcd (Int.natAbs (-m)) (Int.natAbs (-n)) = 1
case intro.intro.intro.intro.intro.inr.inl.right.inl.left
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos✝ : 0 < z
m n : ℤ
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
h_pos : z = m ^ 2 + n ^ 2
⊢ Int.gcd (-m) (-n) = 1
delta Int.gcd
case intro.intro.intro.intro.intro.inr.inl.right.inl.left
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos✝ : 0 < z
m n : ℤ
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
h_pos : z = m ^ 2 + n ^ 2
⊢ Nat.gcd (Int.natAbs m) (Int.natAbs n) = 1
case intro.intro.intro.intro.intro.inr.inl.right.inl.left
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos✝ : 0 < z
m n : ℤ
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
h_pos : z = m ^ 2 + n ^ 2
⊢ Nat.gcd (Int.natAbs (-m)) (Int.natAbs (-n)) = 1
rw [Int.natAbs_neg, Int.natAbs_neg]
no goals
case intro.intro.intro.intro.intro.inr.inl.right.inl.left
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos✝ : 0 < z
m n : ℤ
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
h_pos : z = m ^ 2 + n ^ 2
⊢ Nat.gcd (Int.natAbs m) (Int.natAbs n) = 1
exact ht3
case intro.intro.intro.intro.intro.inr.inl.right.inl.right
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos✝ : 0 < z
m n : ℤ
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
h_pos : z = m ^ 2 + n ^ 2
⊢ (m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0) ∧ 0 ≤ -m
case intro.intro.intro.intro.intro.inr.inl.right.inl.right
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos✝ : 0 < z
m n : ℤ
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
h_pos : z = m ^ 2 + n ^ 2
⊢ (-m % 2 = 0 ∧ -n % 2 = 1 ∨ -m % 2 = 1 ∧ -n % 2 = 0) ∧ 0 ≤ -m
rw [Int.neg_emod_two, Int.neg_emod_two]
case intro.intro.intro.intro.intro.inr.inl.right.inl.right
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos✝ : 0 < z
m n : ℤ
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
h_pos : z = m ^ 2 + n ^ 2
⊢ 0 ≤ -m
case intro.intro.intro.intro.intro.inr.inl.right.inl.right
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos✝ : 0 < z
m n : ℤ
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
h_pos : z = m ^ 2 + n ^ 2
⊢ (m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0) ∧ 0 ≤ -m
apply And.intro ht4
no goals
case intro.intro.intro.intro.intro.inr.inl.right.inl.right
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos✝ : 0 < z
m n : ℤ
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
h_pos : z = m ^ 2 + n ^ 2
⊢ 0 ≤ -m
linarith
case intro.intro.intro.intro.intro.inr.inl.right.inr.h
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
h_neg : z = -(m ^ 2 + n ^ 2)
⊢ False
case intro.intro.intro.intro.intro.inr.inl.right.inr
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
h_neg : z = -(m ^ 2 + n ^ 2)
⊢ z = m ^ 2 + n ^ 2 ∧ Int.gcd (-m) (-n) = 1 ∧ (-m % 2 = 0 ∧ -n % 2 = 1 ∨ -m % 2 = 1 ∧ -n % 2 = 0) ∧ 0 ≤ -m
exfalso
case intro.intro.intro.intro.intro.inr.inl.right.inr.h
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
m n : ℤ
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
h_neg : z = -(m ^ 2 + n ^ 2)
⊢ 0 < z → False
case intro.intro.intro.intro.intro.inr.inl.right.inr.h
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
h_pos : 0 < z
m n : ℤ
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
h_neg : z = -(m ^ 2 + n ^ 2)
⊢ False
revert h_pos
case intro.intro.intro.intro.intro.inr.inl.right.inr.h
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
m n : ℤ
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
h_neg : z = -(m ^ 2 + n ^ 2)
⊢ 0 < -(m ^ 2 + n ^ 2) → False
case intro.intro.intro.intro.intro.inr.inl.right.inr.h
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
m n : ℤ
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
h_neg : z = -(m ^ 2 + n ^ 2)
⊢ 0 < z → False
rw [h_neg]
no goals
case intro.intro.intro.intro.intro.inr.inl.right.inr.h
x✝ y✝ z✝ : ℤ
h✝ : PythagoreanTriple x✝ y✝ z✝
x y z : ℤ
h : PythagoreanTriple x y z
h_coprime : Int.gcd x y = 1
h_parity : x % 2 = 1
m n : ℤ
ht3 : Int.gcd m n = 1
ht4 : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0
hm : m < 0
h_odd : x = m ^ 2 - n ^ 2 ∧ y = 2 * m * n
h_neg : z = -(m ^ 2 + n ^ 2)
⊢ 0 < -(m ^ 2 + n ^ 2) → False
exact imp_false.mpr (not_lt.mpr (neg_nonpos.mpr (add_nonneg (sq_nonneg m) (sq_nonneg n))))