You must be reading the same history books that Annata reads.
That's called HIS-story .. not history.
Are you aware the US sunk a Japanese mini-sub in Pearl Harbor Bay one hour before the attack began? No?
Two others were detected and found.
On the morning of 7 December 1941, under the command of LCDR William W. Outerbridge, Ward was conducting a precautionary patrol off the entrance to Pearl Harbor when she was informed at 03:57 by visual signals from the coastal minesweeper Condor of a periscope sighting, whereupon Ward began searching for the contact.[4] At about
06:37, she sighted a periscope apparently tailing the cargo ship Antares whereupon she attacked the target.[4] The target sunk was a Japanese Ko-hyoteki-class two-man midget submarine and thus Ward fired the first American shots of World War II a few hours before Japanese carrier aircraft formally opened the conflict with their attack on the Pacific Fleet inside the harbor. The submarine was attempting to enter the harbor by following Antares through the anti-submarine nets at the harbor entrance. Ward fired several rounds from its main guns hitting the conning tower of the sub and also dropped several depth charges during the attack.
https://en.wikipedia.org/wiki/USS_Ward_(DD-139)
What time did the attack begin?
The Japanese attack at Pearl Harbor, on December 7th, 1941, was a two pronged attack, comprised of both aerial and underwater components. Five Midget submarines were launched from I-Class mother subs, at the entrance to the harbor. The five Midgets took part in the attack, but history was unclear as to what degree. Remains of two of the midget subs were located shortly after the attack.The third was located by Navy divers in 1960. The fourth, sunk by the USS Ward prior to the air assault, was located by HURL in 2002. That left the last of the midget submarines, and the full story of the underwater attack at Pearl Harbor, still something of a mystery.
https://www.johnchatterton.com/project-files/pearl-harbor-and-the-japanese-midget-submarines/
The subs had a range of about 60 miles .. so unless Japan is 60 miles of the coast of Pearl Harbor, they had to know there were some big ass ships out there that brought them here.