(A) Schematic overview of the behavioral tasks and task training sequences used in this study. Top row: One group of mice is trained in the simple task only. Middle row: Another group of mice is trained on the delay task and then transitioned to the simple task. Bottom row: Another group of mice is trained on the switching task and then transitioned to the simple task. The middle and bottom rows indicate complex training histories. (B) Top: Schematic of virtual reality behavioral setup. Bottom right: Schematic of optogenetic inhibition with bilateral target locations. Bottom left: Top view of Y-maze. Inhibition lasted from trial onset throughout maze traversal. (C) Left: Simple task schematic indicating two trial types (horizontal or vertical cues) and corresponding rewarded navigation decisions (running left or right). Corresponding VR screenshots at the trial start are below. Right: Top view of the two maze schematics. Water drops indicate hidden reward locations. (D) Left: Example session in the simple task showing mean performance for each inhibited location. Right: Performance in the simple task for each inhibited location across 45 sessions from 4 mice. Bars indicate mean ± standard error of the mean (SEM) of a bootstrap distribution of the mean. S1 p = 0.84; RSC p < 0.001; PPC p = 0.006; from bootstrapped distributions of ΔFraction Correct (difference from control performance) compared to 0, two-tailed test, α = 0.05 plus Bonferroni correction. *: p < 0.05; **: p < 0.01; ***: p < 0.001. Sessions per mouse: 11 ± 2. Trials per session: 53 ± 23 (control), 19 ± 8 (S1), 18 ± 9 (RSC), 20 ± 9 (PPC), mean ± standard deviation (SD). (E) Similar to (C), but for the delay task. (F) Similar to (D), but for the delay task. Sixty-two sessions from 7 mice. S1 p = 0.006; RSC p < 0.001; PPC p < 0.001. Sessions per mouse: 9 ± 4. Trials per session: 60 ± 15 (control), 16 ± 6 (S1), 15 ± 4 (RSC), 17 ± 5 (PPC), mean ± SD. (G) Left: Schematic of the switching task, utilizing the identical mazes as the simple task. The cue–choice associations from the simple task (Rule A) were switched within a session (to Rule B). Right: Behavioral performance from an example session. Dotted orange lines indicate rule switches. (H) Similar to (D), but for the switching task, Rule A trials only. 89 sessions from 6 mice. S1 p = 0.036; RSC p < 0.001; PPC p < 0.001. Sessions per mouse: 15 ± 5. Trials per session: 26 ± 9 (control), 8 ± 3 (S1), 7 ± 4 (RSC), 8 ± 3 (PPC), mean ± SD. (I) Comparison of inhibition effects (ΔFraction Correct) in the simple and the delay tasks for each cortical inhibition location. Bars indicate mean ± SEM of a bootstrap distribution of the mean; two-tailed comparisons of bootstrapped ΔFraction Correct distributions, α = 0.05. *: p < 0.05; **: p < 0.01; ***: p < 0.001. Same datasets as in (F, G). (J) Similar to (I), but for the simple versus switching task (Rule A trials only). Same datasets as in (F, H). The simple task data are the same as in (I). (K) Left: Comparison of performance on control trials across tasks, using only the first two laser-on blocks in each session. Bars indicate mean ± SEM of a bootstrap distribution of the mean. Delay versus simple p < 0.001; switching versus simple p < 0.001; two-tailed comparisons of bootstrapped Fraction Correct distributions, α = 0.05. *** p < 0.001. Right: The number of training sessions needed to reach performance criteria across tasks (Methods). Bars indicate mean ± SEM across mice, n = 4 for simple task, n = 5 for delay task, n = 6 for switching task. Both delay and switching task data were compared to the simple task data using an unpaired two-sided t-test. Delay versus simple p = 0.015; switching versus simple p = 0.006. *: p < 0.05, **: p < 0.01.