Is my triangle on the lattice? Write a program or function which takes three positive integers \$a, b, c\$ and returns/outputs one value if there is, and a different value if there isn't, a triangle on the square lattice, whose sides' lengths are \$\sqrt{a}, \sqrt{b}, \sqrt{c}\$. By &quot;on the square lattice&quot; I mean that its vertices are in the \$xy\$ plane, and their \$x\$ and \$y\$-coordinates are all integers
This is code-golf so the shortest code in bytes wins.
Test cases:

16 9 25: true (3-4-5 triangle)
8 1 5: true (e.g. (0,0), (1,0), (2,2))
5 10 13: true (e.g. (0,1), (1,3), (3,0); sides needn't be on grid lines)
10 2 1: false (not a triangle: long side is too long for short sides to meet)
4 1 9: false (not a triangle: three points in a straight line)
3 2 1: false (triangle is on the cubic lattice but not the square lattice)
3 7 1: false (triangle is on the hex lattice but not the square lattice)
25 25 25: false (no such triangle on this lattice)
5 5 4: true (isosceles is OK)
15 15 12: false (OK shape, wrong size)
25 25 20: true (OK shape and size; common prime factor 5 is OK)
4 4 5: false (Bubbler's suggestion)
17 17 18: true (acute isosceles with equal short sides OK)
26 37 41: true (acute scalene is OK)

These same test cases, but just the numbers. First, those that should return true:
16 9 25
8 1 5
5 10 13
5 5 4
25 25 20
17 17 18
26 37 41

Then those that should return false:
10 2 1
4 1 9
3 2 1
3 7 1
25 25 25
15 15 12
Python3, 171 151 142 137 133 bytes

151 =&gt; 142 Thanks to @user
142 =&gt; 137 and fixed correctness thanks to @Bubbler
137 =&gt; 133 thanks to @xnor and @Bubbler

lambda l:l in[[d*d+D*D,e*e+E*E,(d-e)**2+(D-E)**2]for d,e,D,E in product(*[range(-max(l),max(l))]*4)if d*E-e*D]
from itertools import*

Tests here:
TESTS = [
    (16,9,25,True),
    (8,1,5,True),
    (5,10,13,True),
    (10,2,1,False),
    (4,1,9,False),
    (3,2,1,False),
    (3,7,1,False),
    (25,25,25,False),
    (5,5,4,True),
    (15,15,12,False),
    (25,25,20,True),
    (4,4,5,False)
]

for x,y,z,true in TESTS:
    print('testing',x,y,z)
    computed = f([x,y,z])
    assert computed == true

Try it online!