How to read this library

Contracts are grouped into ten domains. For each contract we list its file name, the key theorems it proves (exactly as they appear in the Lean source), and what those theorems establish. To inspect any theorem yourself, import the contract and run #check: no trust required.

import KLean.Contracts.MichaelisMenten

#check KLean.MichaelisMenten.velocity_monotone
#check KLean.MichaelisMenten.velocity_lt_vmax
-- Lean 4 elaborates each theorem. No sorry. No axioms.
Domain 1 of 10
Enzyme Kinetics & Drug Response
8 contracts
ContractKey theoremsWhat it proves
MichaelisMentenvelocity_posvelocity_lt_vmaxvelocity_monotoneReaction velocity is positive, never exceeds Vmax, and rises with substrate.
HillEquationeffect_nonnegeffect_lt_emaxDose-response effect stays non-negative and below Emax.
CompetitiveInhibitionvelocity_posvelocity_lt_vmaxvelocity_decreases_with_inhibitorVelocity is positive, bounded, and falls as inhibitor rises.
IC50Relationshipic50_posic50_ge_KIic50_increases_with_substrateCheng-Prusoff: IC50 is positive, at least KI, and grows with substrate.
HillCooperativityhillOccupancy_poshillOccupancy_lt_onehillOccupancy_half_at_KFractional occupancy lies in (0,1) and equals ½ at K.
LangmuirIsothermcoverage_poscoverage_lt_onecoverage_monotoneSurface coverage is a bounded, monotone fraction.
ReceptorBindingoccupancy_posoccupancy_lt_onehalf_occupancy_at_KDReceptor occupancy is bounded and half-saturated at KD.
CatalyticEfficiencycatalyticEfficiency_poscatalyticEfficiency_increases_with_kcatkcat/Km is positive and rises with kcat.
Domain 2 of 10
Longevity & Biological Age
12 contracts
ContractKey theoremsWhat it proves
PhenoAgemortalityScore_posmortalityScore_lt_onephenoage_M_rangeLevine 2018: mortality score is a probability in (0,1); phenotypic age stays in range.
Telomeretelomere_postelomere_decreasingtelomere_wellDefinedHerrmann 2023: telomere length is positive, well-defined, and declines with age.
BiologicalAgeensemble_nonnegensemble_upper_boundinsufficient_knowledge_propagatesComposite age is bounded; insufficient-knowledge flags propagate through the ensemble.
GompertzMortalitymortality_posmortality_increasingMortality hazard is positive and increases with age.
WeibullSurvivalsurvival_possurvival_le_onesurvival_decreasingSurvival function is a decreasing probability.
TelomereAttritiontelomereLength_postelomereLength_decreasinghayflick_boundL-DNA: telomere length stays positive, decreases, and respects the Hayflick bound.
GCContentgcContent_nonneggcContent_le_oneGC fraction lies in the unit interval.
DnaTmmeltingTemp_nonnegmeltingTemp_increases_with_GCmeltingTemp_pos_of_gcDNA melting temperature is non-negative and rises with GC content.
EpigeneticClockAccelerationclock_age_nonnegacceleration_realreversal_possibleEpigenetic age is non-negative; acceleration is real-valued; reversal is representable.
SenolyticSelectivityselectivity_nonnegselectivity_boundclearance_monotoneSenolytic selectivity is bounded; clearance is monotone in selectivity.
InflammAgingScorescore_nonnegscore_monotone_il6score_boundedInflammaging score is bounded and monotone in IL-6.
StemCellSelfRenewalsymmetric_renewal_oneasymmetric_renewal_halfsymmetric_gt_asymmetricSelf-renewal probabilities for symmetric vs. asymmetric division are ordered correctly.
Domain 3 of 10
Clinical & Renal Function
11 contracts
ContractKey theoremsWhat it proves
CkdMdrdegfr_posMDRD eGFR is strictly positive.
CkdEpickdEpi_posCKD-EPI 2021 eGFR is strictly positive.
CockcroftGaultcrcl_posCreatinine clearance is strictly positive.
MeldScoremeld_increases_with_bilimeld_increases_with_inrmeld_increases_with_creatMELD rises monotonically with bilirubin, INR, and creatinine.
HendersonHasselbalchpH_eq_pKa_when_equalpH_increases_with_ratiopH equals pKa at equal ratio and rises with the base/acid ratio.
Osmolarityosmolarity_pososmolarity_increases_with_naSerum osmolarity is positive and rises with sodium.
OsmoticPressureosmoticPressure_pososmoticPressure_increases_with_concentrationvan't Hoff: osmotic pressure is positive and rises with concentration.
BloodOxygenSaturationsaturation_nonnegsaturation_le_onefull_saturationSpO2 is a fraction in [0,1] reaching 1 at full saturation.
BMIbmi_posbmi_increases_with_weightbmi_decreases_with_heightBMI is positive, rises with weight, falls with height.
CardiacOutputcardiacOutput_poscardiacOutput_increases_with_hrFick principle: cardiac output is positive and rises with heart rate.
ErythropoiesisODEequilibrium_nonnegequilibrium_posequilibrium_monotone_epoRBC-production equilibrium is non-negative and monotone in EPO.
Domain 4 of 10
Genetics & Population Biology
15 contracts
ContractKey theoremsWhat it proves
HardyWeinberghardy_weinberg_equilibriumfreq_AA_nonnegGenotype frequencies satisfy HWE and remain non-negative.
SirEpidemicreproductionNumber_posepidemic_thresholdR0 is positive; the epidemic threshold condition holds.
LogisticGrowthpopulation_pospopulation_le_KPopulation stays positive and bounded by carrying capacity K.
CellDoublingTimedoublingTime_posdoublingTime_decreasingDoubling time is positive and decreases with growth rate.
AllometricScalingallometric_posallometric_increases_with_massAllometric quantity is positive and rises with body mass.
ClonalExpansioncloneSize_poscloneSize_increases_over_timecloneSize_at_zeroClone size is positive, grows over time, and matches the initial seed at t=0.
MonodGrowthgrowthRate_posgrowthRate_half_at_KsMicrobial growth rate is positive, bounded by μmax, half at Ks.
NucleotideBalanceenergyCharge_nonnegenergyCharge_le_oneAdenylate energy charge (ATP/ADP/AMP) lies in [0,1].
AbsorbingStateProbabilityabsorption_prob_nonnegabsorption_prob_le_oneterminal_has_full_absorptionMarkov absorption probability is a valid probability; terminal states absorb fully.
BranchProbabilitySimplexbranch_prob_nonnegbranch_prob_le_onebranch_simplexPhylogenetic branch probabilities form a valid simplex.
CigarInvariantrefLen_nonnegqueryLen_nonnegcigarItem_len_posAlignment CIGAR reference/query lengths are non-negative; item lengths positive.
CodingSequenceLengthvalid_cds_divisible_by_threenum_codons_posconcat_preserves_frameA valid CDS length is divisible by three; concatenation preserves reading frame.
GOEnrichmentClosureclosure_monotoneclosure_union_supersetclosure_singletonGene-ontology ancestor closure is monotone and respects unions.
MarkovTransitionStochasticityentry_le_onestochastic_rowentry_mem_unit_intervalTransition-matrix rows are stochastic; entries lie in [0,1].
NucleotideCompositionSumcomposition_sums_to_oneall_fractions_nonnegNucleotide composition fractions are non-negative and sum to one.
Domain 5 of 10
AlphaFold & Protein Structure
9 contracts
ContractKey theoremsWhat it proves
ProteinRMSDsquaredDeviation_nonnegrmsd_nonnegrmsd_zero_iffRMSD is non-negative and zero iff the structures coincide.
BoltzmannDistributionboltzmannFactor_posprobability_posprobability_le_oneBoltzmann factors are positive; state probabilities lie in (0,1].
ContactProbabilitysigmoid_possigmoid_lt_onesigmoid_monotoneContact probability is a monotone sigmoid in (0,1).
TmScoretmTerm_postmTerm_le_onetmTerm_eq_one_iffEach TM-score term lies in (0,1] and equals one iff aligned exactly.
TMScoretmScore_nonnegAggregate TM-score variant is non-negative.
PairwisePotentialtotalEnergy_appendtotalEnergy_neg_of_all_negtotalEnergy_singletonResidue-pair energy is additive over concatenation.
SequenceIdentityseqIdentity_nonnegseqIdentity_le_oneseqIdentity_one_iff_identicalSequence identity is a fraction in [0,1], one iff identical.
AlphaFoldConfidenceplddt_boundshigh_confidence_thresholdpLDDT stays within bounds; the high-confidence threshold is well-defined.
ProteinAggregationRaterate_nonnegrate_monotoneproteostasis_balanceAggregation rate is non-negative, monotone, and balances at proteostasis.
Domain 6 of 10
Biophysics & Physical Chemistry
9 contracts
ContractKey theoremsWhat it proves
BeerLambertabsorbance_posabsorbance_monotone_concentrationAbsorbance is positive and rises with concentration.
NernstEquationnernstPotential_increases_with_coutMembrane potential rises with external ion concentration.
FickDiffusionflux_magnitude_posflux_increases_with_gradientDiffusive flux magnitude is positive and grows with the gradient.
FretEfficiencyfret_posfret_lt_onefret_decreases_with_distanceFRET efficiency lies in (0,1) and falls with donor-acceptor distance.
EinsteinStokesdiffusionCoeff_posdiffusionCoeff_decreases_with_radiusDiffusion coefficient is positive and falls with particle radius.
PoiseuilleFlowflowRate_posflowRate_increases_with_radiusBlood-flow rate is positive and rises sharply with vessel radius.
ArrheniusEquationrateConstant_posrateConstant_increases_with_tempRate constant is positive and rises with temperature.
GibbsFreeEnergygibbs_neg_when_exothermic_and_entropy_posgibbs_decreases_with_tempΔG is negative for exothermic, entropy-positive reactions and falls with T.
DiffusionMapEntropyentropy_nonneguniform_entropyDiffusion-map entropy is non-negative and maximal for uniform weights.
Domain 7 of 10
Mitochondria & Cell Biology
10 contracts
ContractKey theoremsWhat it proves
ProtonMotiveForcepmf_pos_of_dominant_potentialpmf_linear_in_potentialMitchell equation: PMF is positive when potential dominates, linear in it.
AtpSynthaseEfficiencyefficiency_posefficiency_le_oneefficiency_lt_one_strictATP-synthase efficiency lies in (0,1).
TranslationRatetranslationRate_postranslationRate_increases_with_mRNATranslation rate is positive and rises with mRNA abundance.
RibosomeDensitycoverage_nonnegcoverage_le_onecoverage_increases_with_ribosomesTASEP coverage is a fraction in [0,1] rising with ribosome count.
CellCycleFractionconservationg1_le_ones_le_onem_le_oneCell-cycle phase fractions are each ≤ 1 and conserve to the whole.
MrnaHalfLifehalfLife_posmrnaAbundance_posmrnaAbundance_at_halflifeHalf-life is positive; abundance is positive and halves at the half-life.
ProteinSteadyStatesteadyState_possteadyState_increases_with_synthesisSteady-state protein level is positive and rises with synthesis rate.
AutophagyFluxBalanceflux_nonnegnet_autophagy_nonnegstarvation_upregulatesAutophagy flux is non-negative; starvation upregulates net flux.
MitochondrialMembranePotentialhealthy_potential_negpotential_lower_boundhealthy_rangeHealthy membrane potential is negative and within a bounded range.
NADPlusRationad_plus_posratio_posratio_decreasingNAD+/NADH is positive and decreasing under the modeled stress.
Domain 8 of 10
Pharmacokinetics & Lab Methods
6 contracts
ContractKey theoremsWhat it proves
FirstOrderPKconcentration_posconcentration_decreasinghalflife_positiveFirst-order concentration is positive, decreasing, with positive half-life.
BodySurfaceAreabsa_posbsa_nonnegMosteller BSA is positive.
PcrAmplificationcopies_poscopies_increasing_in_cyclescopies_doubles_per_cyclePCR copy number is positive and doubles each cycle.
DilutionSeriesconcentration_posconcentration_decreasingSerial dilution concentration is positive and strictly decreasing.
ShannonEntropyentropy_at_halfentropy_symmetricBinary Shannon entropy is symmetric and maximal at p = ½.
FluorescenceQuantumYieldquantumYield_posquantumYield_lt_onequantumYield_eq_one_iff_no_nonradiativeQuantum yield lies in (0,1), reaching one only without non-radiative decay.
Domain 9 of 10
Synthetic Biology
11 contracts
ContractKey theoremsWhat it proves
SynNotchand_gate_logicand_gate_true_iff_bothand_gate_false_if_either_absentSynNotch AND-gate activates iff both ligands are present.
Riboswitchconfidence_in_unit_intervalinsufficient_knowledge_when_low_confidenceRiboswitch design confidence stays in [0,1]; low confidence flags insufficient knowledge.
LongevityProtocolpipeline_confidence_boundedvalid_age_rangeik_propagates_pipelineThe end-to-end pipeline keeps confidence bounded and propagates insufficient-knowledge.
CircularRNABacksplicebacksplice_score_nonnegcanonical_backsplice_positivehigher_score_preferredcircRNA backsplice scores are non-negative; canonical sites score positive.
IRESActivityactivity_mem_unit_intervalhigher_activity_more_translationinactive_ires_no_initiationIRES activity lies in [0,1]; higher activity yields more translation.
RNAFoldingFreeEnergystable_implies_nonpos_energymore_negative_dg_more_stableStable folds carry non-positive ΔG; more negative ΔG is more stable.
StemLoopStabilityhairpin_energy_nonposmore_pairs_more_stableloop_size_validHairpin energy is non-positive; more base pairs increase stability.
ModifiedNucleotideRatioratio_nonnegratio_le_onefull_substitution_iffModified-nucleotide ratio lies in [0,1], one iff fully substituted.
PolyASiteStrengthstrength_mem_unit_intervalcanonical_site_strength_onestronger_site_dominatesPoly-A site strength lies in [0,1]; canonical sites are maximal.
TranslationInitiationContextkozak_score_mem_unit_intervalperfect_kozak_score_onebetter_kozak_not_worseKozak score lies in [0,1]; a perfect context scores one.
CodonAdaptationIndexcai_poscai_le_onecai_eq_one_iff_optimalCAI lies in (0,1], one iff fully codon-optimized.
Domain 10 of 10
ML & Single-Cell Analysis
3 contracts
ContractKey theoremsWhat it proves
GPPosteriorVarianceposterior_variance_nonnegdirac_has_zero_variancevariance_zero_iff_diracGaussian-process posterior variance is non-negative, zero iff Dirac.
PseudotimeOrderingpseudotime_nonnegroot_pseudotime_zeroroot_is_minimalPseudotime is non-negative; the root cell is the unique minimum.
SparseApproximationBoundapprox_error_nonnegmore_inducing_tightermax_budget_minimal_errorSparse approximation error is non-negative and tightens with more inducing points.
Run it yourself: live API

Every contract above is also served over HTTP by klean-server (Rust / Axum) on the Kenosian Protocol Platform. No Lean toolchain required. The endpoints below are live.

GC content
curl "https://kpp.kenosian.com/klean/v1/gc_content?sequence=ATCGATCG"
Michaelis-Menten velocity
curl -X POST "https://kpp.kenosian.com/v1/michaelis_menten" \
  -H "Content-Type: application/json" \
  -d '{"substrate": 0.5, "km": 0.1, "vmax": 2.0}'
Contributions & feedback

K-Lean is open infrastructure under Apache 2.0. New biology contracts, proof improvements, domain extensions, and corrections are all welcome, and we welcome scrutiny and pushback in equal measure.

Contributions & feedback welcome: info@kenosian.com

Contact