"It is hard to play the piano."
https://8020japanese.com/wa-vs-ga/ is a fairly in-depth blog post covering は vs が that might help shed some light on this matter.
A quick answer though is that は makes this a fairly neutral statement: "As for playing the piano, it is difficult."
が, on the other hand, would emphasize the "playing the piano" part of the sentence: "Playing the piano is the thing which is difficult."
が, due to this emphasis, is often used for contrast. Take the following hypothetical conversation: A) "Which is more difficult, playing the piano or the recorder?" B) "Playing the piano is the thing which is difficult." (Which would imply that playing the recorder isn't as difficult.)
は and が would both be grammatically correct in this sentence, but there is a slightly different nuance between using one versus the other.
Thanks. However I didn't mean it quite like that. I meant using こと instead of の.
I'm pretty certain the sentence you wrote— [verb phrase] + の + こと —wouldn't be correct. I can't see what the sense of having both の and こと would be. Maybe you had "[noun] + の + こと" in mind when you wrote that?
Here is how I instinctively answered the question:
It marked my answer as being wrong, saying it wanted の instead of こと. However, it might well be that the only reason for this is because they may not have started adding any alternative Japanese answers for this sentence (since the course isn't officially released on web, and the apps don't have any Japanese typing...).
I was just trying to double-check that こと can be used, or to find out whether it might not be as natural as の in this sentence.
Sorry, I should have given a little more thought to my comment before I posted. I think I conflated noun omission (i.e.,「赤いの」 "the red one" in lieu of, for instance, 「赤いのシャツ」 "the red shirt") with the replacement of a generic noun (もの or こと) by の.
You're absolutely right that のこと, as I wrote in my original comment, would be redundant. I'm not sure that it is entirely ungrammatical but it's certainly awkward.
I completely agree with you that「ピアノを弾くことは難しいです。」is grammatically sound Japanese. As to whether こと is as natural as の, I'm not completely sure myself. My gut feeling is that の is more common in spoken (especially casual) language while こと may be more common in written language. Take the above with a grain of salt, however, as I'm still learning; I'd love for a native speaker to chime in.
EDIT: http://www.imabi.net/nominalization.htm is a good overview of this subject.
Why not ピアノを弾きにくい? There are examples of this being used to mean "difficult to play" in the context of music: https://context.reverso.net/translation/japanese-english/%E5%BC%BE%E3%81%8D%E3%81%AB%E3%81%8F%E3%81%84