To defend someone, the lawyer doesn't necessarily have to say or establish that the client is innocent, just that the state hasn't made its case beyond a reasonable doubt. A lawyer can't, however, encourage someone to commit perjury or put on a witness the lawyer knows will commit perjury. So if the lawyer knows the person committed the crime, even if there's someone who's testifying to a false alibi, the lawyer can't put that witness on. If the defendant wants to testify, he or she can because of the constitutional right to defend yourself. When the lawyer knows the person is going to commit perjury though, the lawyer has to advise against it. If the defendant insists, the lawyer has to allow him or her to go ahead, but can't participate. In these cases, instead of the testimony coming in the form of the attorney questioning the witness, the defense attorney sits down and the defendant tells his or her story in narrative form. This is a big give away that the attorney knows the defendant is lying.