Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Seven upstream library lemmas for Lean 4.33.1

Definition
Monodromy_PlatformCompatibility

by Xiaoyang Liu · Nov 5, 2026 · Mathlib 0df444a (Lean v4.33.1)

computabilitycovering-spacesmonodromy-computation

The covering-lift endpoint, conditional equality, and function-extension lemmas listed below, with their original proofs and upstream source references.

Definition code
/-
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
Source
IsCoveringMap.coe_monodromy_mk: https://github.com/leanprover-community/mathlib4/blob/56a005855ea17e0b0958f73ec801ae140b0a1679/Mathlib/Topology/Homotopy/Lifting.lean#L392-L394; declaration/proof SHA-256 2b856be2d8be6870646e59a9272202f8019167fc66fa5cf18787b2d17fecdf1d IsCoveringMap.monodromy_eq_apply_one: https://github.com/leanprover-community/mathlib4/blob/56a005855ea17e0b0958f73ec801ae140b0a1679/Mathlib/Topology/Homotopy/Lifting.lean#L396-L399; declaration/proof SHA-256 58d2f7424d83aaecba0c2368d395fa614b1edad780cd4c30f194ff8a8431e8b8 ite_eq_left: https://github.com/leanprover/lean4/blob/v4.35.0/src/Init/Core.lean#L1179-L1182; declaration/proof SHA-256 a8efc7fb197a3268499ef90e2b6e21661e10299a156ccd1b76c0a75fb5377e55 ite_eq_right: https://github.com/leanprover/lean4/blob/v4.35.0/src/Init/Core.lean#L1188-L1191; declaration/proof SHA-256 0e5219de5a8a43f02f982ff6a92ccde3407012b0dc06d82f7075a998c7b5acb8 dite_eq_left: https://github.com/leanprover/lean4/blob/v4.35.0/src/Init/Core.lean#L1204-L1207; declaration/proof SHA-256 266cc1bdd89103978eee188c43ac84154a336fdf4c5cb18173c8fdb2881fa9b8 dite_eq_right: https://github.com/leanprover/lean4/blob/v4.35.0/src/Init/Core.lean#L1213-L1216; declaration/proof SHA-256 10a9832c704bdbc2ab90dff4454ac488e9f49df29dd305b34ce32b8727eb24ec Function.Injective.extend_update: https://github.com/leanprover-community/mathlib4/blob/56a005855ea17e0b0958f73ec801ae140b0a1679/Mathlib/Logic/Function/Basic.lean#L923-L931; declaration/proof SHA-256 f51b89db093a5ef92f516774bb3965d18510a789a184f29ebc9c9d9ad913acee
Read-back

What the Lean code literally says, in plain math · OpenAI Codex (independent agent)

For every proposition ccc, every specified decision procedure for ccc, every sort AAA at any universe level (including proposition sorts), and every t,e∈At,e\in At,e∈A, ite_eq_left states that a proof hc:ch_c:chc​:c implies (if c then t else e)=t(\text{if }c\text{ then }t\text{ else }e)=t(if c then t else e)=t, and ite_eq_right states that a proof h¬c:¬ch_{\neg c}:\neg ch¬c​:¬c implies (if c then t else e)=e(\text{if }c\text{ then }t\text{ else }e)=e(if c then t else e)=e. For every such ccc, decision procedure, and sort AAA, and every pair of functions t:c→At:c\to At:c→A and e:(¬c)→Ae:(\neg c)\to Ae:(¬c)→A, dite_eq_left states that, given hc:ch_c:chc​:c, the dependent conditional that evaluates ttt on a proof of ccc when ccc holds and evaluates eee on a proof of ¬c\neg c¬c otherwise equals t(hc)t(h_c)t(hc​); dite_eq_right states that, given h¬c:¬ch_{\neg c}:\neg ch¬c​:¬c, the same dependent conditional equals e(h¬c)e(h_{\neg c})e(h¬c​). Function.Injective.extend_update states that for arbitrary sorts A,B,CA,B,CA,B,C, specified decidable equalities on AAA and BBB, an injective function f:A→Bf:A\to Bf:A→B, functions g:A→Cg:A\to Cg:A→C and d:B→Cd:B\to Cd:B→C, a point i∈Ai\in Ai∈A, and a value a∈Ca\in Ca∈C, one has Ext⁡f(g[i↦a],d)=Ext⁡f(g,d)[f(i)↦a]\operatorname{Ext}_f(g[i\mapsto a],d)=\operatorname{Ext}_f(g,d)[f(i)\mapsto a]Extf​(g[i↦a],d)=Extf​(g,d)[f(i)↦a] as functions B→CB\to CB→C, where g[i↦a]g[i\mapsto a]g[i↦a] equals aaa at iii and equals ggg at every other argument, and Ext⁡f(g,d)(b)\operatorname{Ext}_f(g,d)(b)Extf​(g,d)(b) equals g(k)g(k)g(k) for a classically chosen kkk satisfying f(k)=bf(k)=bf(k)=b when such a kkk exists, and equals d(b)d(b)d(b) otherwise; the update on the right has the same meaning at the point f(i)f(i)f(i). These assertions include empty sorts whenever their displayed arguments exist. The remaining two assertions concern arbitrary topological spaces E,XE,XE,X, a map p:E→Xp:E\to Xp:E→X supplied with a proof that it is a covering map, arbitrary points x,y∈Xx,y\in Xx,y∈X, a continuous path γ:I→X\gamma:I\to Xγ:I→X with I=[0,1]I=[0,1]I=[0,1], γ(0)=x\gamma(0)=xγ(0)=x and γ(1)=y\gamma(1)=yγ(1)=y, and a point eee of the fibre p−1({x})p^{-1}(\{x\})p−1({x}), meaning an element of EEE with p(e)=xp(e)=xp(e)=x: writing Lγ,e:I→EL_{\gamma,e}:I\to ELγ,e​:I→E for the continuous lift selected from those satisfying p∘Lγ,e=γp\circ L_{\gamma,e}=\gammap∘Lγ,e​=γ and Lγ,e(0)=eL_{\gamma,e}(0)=eLγ,e​(0)=e, and M([γ])(e)M([\gamma])(e)M([γ])(e) for the monodromy value in p−1({y})p^{-1}(\{y\})p−1({y}) defined by taking the endpoint of such a lift on the homotopy class [γ][\gamma][γ] relative to the two endpoints, IsCoveringMap.coe_monodromy_mk states that the underlying element of EEE of M([γ])(e)M([\gamma])(e)M([γ])(e) equals Lγ,e(1)L_{\gamma,e}(1)Lγ,e​(1); IsCoveringMap.monodromy_eq_apply_one states that for every continuous map Γ:I→E\Gamma:I\to EΓ:I→E, if p∘Γ=γp\circ\Gamma=\gammap∘Γ=γ as functions and Γ(0)=e\Gamma(0)=eΓ(0)=e as elements of EEE, then the underlying element of EEE of M([γ])(e)M([\gamma])(e)M([γ])(e) equals Γ(1)\Gamma(1)Γ(1). The quantification requires no global nonemptiness of these spaces or fibres, and an empty starting fibre provides no possible argument eee.

Human review
  • Endorsed by marwahaha · Nov 6, 2026

  • Endorsed by Xiaoyang Liu · Nov 6, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me