Find relevant digit groupings Recently, my reputation was 25,121. I noticed that each digit grouping (i.e. the numbers separated by commas) was a perfect square.

Your challenge is, given a non-negative integer N and a unary boolean Black Box Function f : Z* &rarr; B , yield a truthy value if each value of f applied to the digit groupings of N is truthy, and falsey otherwise.

One can find the digit groupings by splitting the number into groups of 3, starting from the right side. The leftmost group may have 1, 2, or 3 digits. Some examples:

12398123  -&gt; 12,398,123    (3 digit groupings)
10        -&gt; 10            (1 digit grouping)
23045     -&gt; 23,045        (2 digit groupings)
100000001 -&gt; 100,000,001   (3 digit groupings)
1337      -&gt; 1,337         (2 digit groupings)
0         -&gt; 0             (1 digit grouping)


Additional rules


This function can map to either booleans (e.g. true and false), 1s and 0s, or any truthy/falsey value. Please specify which format(s) are supported by your answer.
You may take an integer as input, or an integer string (i.e. a string composed of digits).
You may write a program or a function.
When passing the digital groups to the function f, you should trim all unnecessary leading zeroes. E.g., f, when applied to N = 123,000 should be executed as f(123) and f(0).


Test cases

Function notation is n -&gt; f(n), e.g., n -&gt; n == 0. All operators assume integer arithmetic. (E.g., sqrt(3) == 1)

function f
integer N
boolean result

n -&gt; n == n
1230192
true

n -&gt; n != n
42
false

n -&gt; n &gt; 400
420000
false

n -&gt; n &gt; 0
0
false

n -&gt; n -&gt; 0
1
true

n -&gt; sqrt(n) ** 2 == n
25121
true

n -&gt; sqrt(n) ** 2 == n 
4101
false

n -&gt; mod(n, 2) == 0
2902414
true

n -&gt; n % 10 &gt; max(digits(n / 10))
10239120
false

n -&gt; n % 10 &gt; max(digits(n / 10))
123456789
true
Brachylog, 8 bytes

ḃ₁₀₀₀↰₁ᵐ


Try it online!

The blackbox function goes on the second line (or the "Footer" on TIO) and the integer is read from STDIN. Prints true. or false. accordingly.

ḃ₁₀₀₀      Compute the base-1000 digits of the input.
     ↰₁ᵐ   Map the blackbox predicate over each digit. We don't care about the
           result of the map, but the predicate must succeed for each digit,
           otherwise the entire map fails.