Seven upstream library lemmas for Lean 4.33.1
DefinitionMonodromy_PlatformCompatibilityThe covering-lift endpoint, conditional equality, and function-extension lemmas listed below, with their original proofs and upstream source references.
/-
Copyright (c) 2025 Junyan Xu. All rights reserved.
Copyright (c) 2016 Johannes Hölzl. All rights reserved.
Copyright (c) 2016 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the Mathlib and Lean LICENSE files.
Authors: Junyan Xu, Johannes Hölzl, Mario Carneiro; Lean core contributors
Compatibility backport from Mathlib commit
56a005855ea17e0b0958f73ec801ae140b0a1679,
Mathlib/Topology/Homotopy/Lifting.lean, lines 392-399.
The IsCoveringMap declarations and their proofs below are verbatim from that source.
The ite_eq_left/right and dite_eq_left/right declarations and proofs are
verbatim from Lean v4.35.0, src/Init/Core.lean, lines 1179-1182, 1188-1191,
1204-1207, and 1213-1216. The Function.Injective.extend_update declaration
and proof are verbatim from the same Mathlib commit,
Mathlib/Logic/Function/Basic.lean, lines 923-931.
-/
module
public import Mathlib.Topology.Homotopy.Lifting
public import Mathlib.Logic.Function.Basic
noncomputable section
@[expose] public section
open Function Topology unitInterval
variable {E X : Type*} [TopologicalSpace E] [TopologicalSpace X] {p : E → X}
universe u
theorem ite_eq_left {c : Prop} {h : Decidable c} (hc : c) {α : Sort u} {t e : α} : (ite c t e) = t :=
match h with
| isTrue _ => rfl
| isFalse hnc => absurd hc hnc
theorem ite_eq_right {c : Prop} {h : Decidable c} (hnc : ¬c) {α : Sort u} {t e : α} : (ite c t e) = e :=
match h with
| isTrue hc => absurd hc hnc
| isFalse _ => rfl
theorem dite_eq_left {c : Prop} {h : Decidable c} (hc : c) {α : Sort u} {t : c → α} {e : ¬ c → α} : (dite c t e) = t hc :=
match h with
| isTrue _ => rfl
| isFalse hnc => absurd hc hnc
theorem dite_eq_right {c : Prop} {h : Decidable c} (hnc : ¬c) {α : Sort u} {t : c → α} {e : ¬ c → α} : (dite c t e) = e hnc :=
match h with
| isTrue hc => absurd hc hnc
| isFalse _ => rfl
namespace Function
variable {α β γ : Sort*} {f : α → β}
theorem Injective.extend_update [DecidableEq α] [DecidableEq β] (hf : Injective f) (g : α → γ)
(e : β → γ) (i : α) (a : γ) :
extend f (update g i a) e = update (extend f g e) (f i) a := by
ext j
by_cases h : ∃ k, f k = j
· obtain ⟨k, rfl⟩ := h
simp [hf, update_apply, hf.eq_iff]
· grind [extend_apply']
end Function
namespace IsCoveringMap
variable (cov : IsCoveringMap p)
theorem coe_monodromy_mk {x y : X} (γ : Path x y) (e : p ⁻¹' {x}) :
(cov.monodromy (.mk γ) e : E) = cov.liftPath γ e (γ.source.trans e.2.symm) 1 :=
rfl
lemma monodromy_eq_apply_one {x y : X} {γ : Path x y} {e : p ⁻¹' {x}} {Γ : C(I, E)}
(hpΓ : p ∘ Γ = γ) (Γ_0 : Γ 0 = e) : cov.monodromy (.mk γ) e = Γ 1 := by
rw [show Γ = cov.liftPath γ e (γ.source.trans e.2.symm) from (eq_liftPath_iff' ..).mpr ⟨hpΓ, Γ_0⟩,
coe_monodromy_mk]
end IsCoveringMap
Read-back
What the Lean code literally says, in plain math · OpenAI Codex (independent agent)
For every proposition , every specified decision procedure for , every sort at any universe level (including proposition sorts), and every , ite_eq_left states that a proof implies , and ite_eq_right states that a proof implies . For every such , decision procedure, and sort , and every pair of functions and , dite_eq_left states that, given , the dependent conditional that evaluates on a proof of when holds and evaluates on a proof of otherwise equals ; dite_eq_right states that, given , the same dependent conditional equals . Function.Injective.extend_update states that for arbitrary sorts , specified decidable equalities on and , an injective function , functions and , a point , and a value , one has as functions , where equals at and equals at every other argument, and equals for a classically chosen satisfying when such a exists, and equals otherwise; the update on the right has the same meaning at the point . These assertions include empty sorts whenever their displayed arguments exist. The remaining two assertions concern arbitrary topological spaces , a map supplied with a proof that it is a covering map, arbitrary points , a continuous path with , and , and a point of the fibre , meaning an element of with : writing for the continuous lift selected from those satisfying and , and for the monodromy value in defined by taking the endpoint of such a lift on the homotopy class relative to the two endpoints, IsCoveringMap.coe_monodromy_mk states that the underlying element of of equals ; IsCoveringMap.monodromy_eq_apply_one states that for every continuous map , if as functions and as elements of , then the underlying element of of equals . The quantification requires no global nonemptiness of these spaces or fibres, and an empty starting fibre provides no possible argument .
Confirmed by the mission captain (proposal self-audit).