Are these sentences grammatically correct?

I thought clauses after a semicolon must be able to stand as independent sentences, but my grammar book is telling me otherwise. Are the below sentences correct and why? Additionally, if I were to replace the semicolon with a comma in the second sentence would it be wrong/awkward?

The difference between Tom and Bob is that the former is optimistic; the latter, pessimistic.

Some visitors were impressed by the museum’s sheer size; others by its solemn gravity.

Thank you so much!

I think the key for me is that the information that would make the second part a complete sentence is implied. “Some visitors were impressed by the museum’s sheer size; other visitors were impressed by its solemn gravity” is a perfectly fine sentence, but it’s kinda wordy. If you can grammatically omit unnecessary information…why not? Like instead of “The letter that was sent to me was in an envelope” you can write “The letter sent to me was in an envelope.” Cleaner. Conciser. More elegant.

I’m sure that’s not the official explanation, but that’s how I think about it.

The difference between Tom and Bob is that the former is optimistic; the latter [is] pessimistic.

Some visitors were impressed by the museum’s sheer size; others [were impressed] by its solemn gravity.

Both post-semicolon clauses are complete sentences, they just have something that is ommitted and to be understood by the reader.

For the record, this sort of ellipsis–legal omission to produce independent clauses that, in a vacuum, lack crucial clause components–is not tested on the SAT.

Thank you all for your replies! It helped a lot. :slight_smile: