The Woodward–Hoffmann rules were first formulated in 1965 to explain the striking stereospecificity of electrocyclic reactions under thermal and photochemical control. The stereochemistry of electrocyclization was synthetically important in the context of Woodward's longstanding endeavor to synthesize vitamin B12, and observations made in the course of the synthesis served to inspire the formulation of the Woodward–Hoffmann rules. The interconversion of model cyclobutene and butadiene derivatives under thermal (heating) and photochemical (Ultraviolet irradiation) conditions is illustrative. Thermolysis of "trans"-1,2,3,4-tetramethyl-1-cyclobutene (1) afforded only one geometric isomer, ("E","E")-3,4-dimethyl-2,4-hexadiene (2); the ("Z","Z") and the ("E","Z") geometric isomers were not detected in the product mixture. Similarly, thermolysis of "cis"-1,2,3,4-tetramethyl-1-cyclobutene (3) afforded only ("E","Z") isomer 4. In both ring opening reactions, the carbons on the ends of the breaking σ-bond rotate in the "same" direction. On the other hand, the opposite stereochemical course was followed under photochemical activation: When the related compound ("E","E")-2,4-hexadiene (5) was exposed to light, "cis"-3,4-dimethyl-1-cyclobutene (6) was formed exclusively as a result of electrocyclic ring closure. This requires the ends of the π-system to rotate in "opposite" directions to form the new σ-bond. Thermolysis of 6 follows the same stereochemical course as 3: electrocyclic ring opening leads to the formation of ("E","Z")-2,4-hexadiene (7) and "not" 5.