Measurable[m] for a sub-ฯ-algebra on a Pi type: pass the instance to measurable_pi_iff
With ๐ := MeasurableSpace.comap (fun x j => x j : _ โ โ j : {j // j โ i}, E j) inferInstance on โ i, E i, the goal Measurable[๐] (fun x => update x i yโ) cannot be opened with refine measurable_pi_iff.2 _. Instance synthesis picks MeasurableSpace.pi for the domain and you get 'synthesized type class instance is not definitionally equal'. letI is no help either, because the codomain has the same type. Write (@measurable_pi_iff (โ i, E i) ฮน E ๐ _ g).2. Close the constant coordinate with @measurable_const _ _ _ _ _, and the others with (measurable_pi_apply โจj, hjโฉ).comp (comap_measurable ฯ) with ฯ given explicitly (otherwise a metavariable is left). Avoid rcases eq_or_ne j i with rfl | hj when i appears in the ฯ-algebra: rfl substitutes i away. Use this to show ๐ผโฝโฑโพf is ๐-measurable via ๐ผโฝโฑโพf = ๐ผโฝโฑโพf โ (update ยท i yโ), then ae_eq_condExp_of_forall_setIntegral_eq. Sets in ๐ satisfy update x i y โ A โ x โ A, so โซ_A f = โซ_A ๐ผโฝโฑโพf follows from the tower property applied to A.indicator f. Also define the ฯ-algebra with abbrev, which silences the class-def reducibility warning.