Acts I, II, and III take place in relatively closed spaces: the Reverend Parris's house, the Proctors' house, and the meeting house / courtroom, respectively. Each closed space seems to feel too small for all the big emotions and tensions and anxieties; it's as though the small areas are as confining as the laws and pressures and superstitions of the Puritans themselves. In Parris's house, the minister's own anxiety about how he will be perceived by the wider community influences him to act in a way that is ultimately self-serving rather than Salem-serving; ditto for the Putnams, Abigail, and the other girls. In John Proctor's home, the strained relationship between him and his wife widen the chasm between them, and when Mr. Hale arrives, we see them all chafe against the religious codes of the colony. Then, in the courtroom, we see the stifling atmosphere created by Judge Danforth and Hathorne's corruption, despite the evidence brought by Proctor, Corey, and Nurse or the more reasonable arguments presented by Hale. As the act progresses, we seem to feel the walls closing in on Proctor and the other accused innocents. It's a damning view of the Puritans to be sure.
Act IV, however, begins in a small, enclosed space -- the jail -- and ends in the wide open space outside it. Within the jail, Proctor and the others are what society has made them: convicts. But outside the jail, Proctor has the opportunity to see that he is more than the sum of his parts as determined by his religion and his community. Though he'd made a mistake and been unfaithful to his wife, he finally realizes that this doesn't make him an irredeemable sinner; he comes to understand -- when outside the walls (both literal and figurative) erected by religion and community -- that he can still choose to be good and honest. It is as though he gains the freedom to see himself in a new way when he is no longer trapped within Puritans structures, be they physical or symbolic.