When generating a DSA key with Elgamal subkey (option 2) the subkey is limited
to DSA keysize. See the following transcript:
$ gpg2 --gen-key --expert
Please select what kind of key you want:
(1) RSA and RSA (default) (2) DSA and Elgamal (3) DSA (sign only) (4) RSA (sign only) (7) DSA (set your own capabilities) (8) RSA (set your own capabilities)
Your selection? 2
DSA keys may be between 512 and 3072 bits long.
What keysize do you want? (2048)
Requested keysize is 2048 bits
DSA keys may be between 512 and 3072 bits long.
What keysize do you want for the subkey? (2048) 4096
DSA keysizes must be in the range 512-3072