I ran into this same thing formalizing some of my old notes in Lean a few days ago. The tricky thing I suppose is that 0. Injectivity and A non-empty or B empty implies left invertibility, 1. Left invertibility implies injectivity. 2. Surjectivity iff right invertibility, and 3. Surjectivity rules out this corner case, so bijectivity iff invertibility. So this one vacuous case just throws a wrench in what is "supposed" to be true.