Metamath Proof Explorer


Theorem flsqrt

Description: A condition equivalent to the floor of a square root. (Contributed by AV, 17-Aug-2021)

Ref Expression
Assertion flsqrt A 0 A B 0 A = B B 2 A A < B + 1 2

Proof

Step Hyp Ref Expression
1 resqrtcl A 0 A A
2 nn0z B 0 B
3 flbi A B A = B B A A < B + 1
4 1 2 3 syl2an A 0 A B 0 A = B B A A < B + 1
5 nn0re B 0 B
6 nn0ge0 B 0 0 B
7 5 6 jca B 0 B 0 B
8 sqrtsq B 0 B B 2 = B
9 8 eqcomd B 0 B B = B 2
10 7 9 syl B 0 B = B 2
11 10 breq1d B 0 B A B 2 A
12 11 adantl A 0 A B 0 B A B 2 A
13 nn0sqcl B 0 B 2 0
14 13 nn0red B 0 B 2
15 5 sqge0d B 0 0 B 2
16 14 15 jca B 0 B 2 0 B 2
17 16 anim2i A 0 A B 0 A 0 A B 2 0 B 2
18 17 ancomd A 0 A B 0 B 2 0 B 2 A 0 A
19 sqrtle B 2 0 B 2 A 0 A B 2 A B 2 A
20 18 19 syl A 0 A B 0 B 2 A B 2 A
21 12 20 bitr4d A 0 A B 0 B A B 2 A
22 peano2nn0 B 0 B + 1 0
23 22 nn0red B 0 B + 1
24 1red B 0 1
25 0le1 0 1
26 25 a1i B 0 0 1
27 5 24 6 26 addge0d B 0 0 B + 1
28 23 27 sqrtsqd B 0 B + 1 2 = B + 1
29 28 eqcomd B 0 B + 1 = B + 1 2
30 29 breq2d B 0 A < B + 1 A < B + 1 2
31 30 adantl A 0 A B 0 A < B + 1 A < B + 1 2
32 2nn0 2 0
33 32 a1i B 0 2 0
34 22 33 nn0expcld B 0 B + 1 2 0
35 34 nn0red B 0 B + 1 2
36 23 sqge0d B 0 0 B + 1 2
37 35 36 jca B 0 B + 1 2 0 B + 1 2
38 sqrtlt A 0 A B + 1 2 0 B + 1 2 A < B + 1 2 A < B + 1 2
39 37 38 sylan2 A 0 A B 0 A < B + 1 2 A < B + 1 2
40 31 39 bitr4d A 0 A B 0 A < B + 1 A < B + 1 2
41 21 40 anbi12d A 0 A B 0 B A A < B + 1 B 2 A A < B + 1 2
42 4 41 bitrd A 0 A B 0 A = B B 2 A A < B + 1 2