-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGeneExpression.lean
More file actions
91 lines (75 loc) · 3.35 KB
/
Copy pathGeneExpression.lean
File metadata and controls
91 lines (75 loc) · 3.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import Mathlib.Tactic.DeriveFintype
import CRNT.Basic.Complex
import CRNT.Basic.Reaction
import CRNT.Basic.Network
import CRNT.Stoich.Vector
import CRNT.Kinetics.Concentration
import CRNT.Kinetics.MassAction
/-!
# Simple gene expression
A mechanistic transcription/translation/degradation network:
```text
DNA → DNA + mRNA (transcription; DNA acts catalytically)
mRNA → mRNA + Protein (translation; mRNA acts catalytically)
mRNA → 0 (mRNA degradation)
Protein → 0 (protein degradation)
```
It demonstrates source/target complexes, the zero complex, and the mass-action vector
field. As a structural (parameter-independent) fact we prove that the DNA concentration
is conserved by the mass-action dynamics: `d[DNA]/dt = 0` for every rate choice and
every concentration, because DNA appears catalytically.
-/
namespace CRNT.Examples.GeneExpression
open CRNT
/-- Three species: DNA, mRNA, and Protein. -/
inductive Species
| DNA
| mRNA
| Protein
deriving DecidableEq, Fintype, Repr
open Species
/-- The complex `DNA`. -/
def cDNA : Complex Species := fun s => match s with | DNA => 1 | _ => 0
/-- The complex `DNA + mRNA`. -/
def cDNAmRNA : Complex Species := fun s => match s with | DNA => 1 | mRNA => 1 | _ => 0
/-- The complex `mRNA`. -/
def cmRNA : Complex Species := fun s => match s with | mRNA => 1 | _ => 0
/-- The complex `mRNA + Protein`. -/
def cmRNAProt : Complex Species := fun s => match s with | mRNA => 1 | Protein => 1 | _ => 0
/-- The complex `Protein`. -/
def cProt : Complex Species := fun s => match s with | Protein => 1 | _ => 0
/-- Four reactions: transcription, translation, and two degradations. -/
inductive Rxn
| transcribe
| translate
| degradeMRNA
| degradeProt
deriving DecidableEq, Fintype, Repr
/-- The reaction map. The zero complex `Complex.zero` is the target of degradation. -/
def rxn : Rxn → Reaction Species
| .transcribe => { source := cDNA, target := cDNAmRNA }
| .translate => { source := cmRNA, target := cmRNAProt }
| .degradeMRNA => { source := cmRNA, target := Complex.zero }
| .degradeProt => { source := cProt, target := Complex.zero }
/-- The gene-expression network. -/
def N : Network Species :=
{ R := Rxn, decEqR := inferInstance, fintypeR := inferInstance, reaction := rxn }
/-- `n = 5`: the five complexes are `DNA`, `DNA+mRNA`, `mRNA`, `mRNA+Protein`,
`Protein`, and `0` — but `DNA+mRNA` and `mRNA+Protein` together with the others give
five distinct complexes appearing in reactions, plus the zero complex. -/
theorem numComplexes_eq : N.numComplexes = 6 := by decide
/-- Every reaction leaves the DNA coordinate unchanged: DNA is catalytic. -/
theorem reactionVector_DNA_zero (r : N.R) : N.reactionVector r DNA = 0 := by
cases r <;>
simp [Network.reactionVector, N, rxn, Reaction.vector,
cDNA, cDNAmRNA, cmRNA, cmRNAProt, cProt, Complex.zero]
/-- **DNA is conserved.** For every choice of positive rate constants and every
concentration, the mass-action rate of change of DNA is zero. This is a structural,
parameter-independent property obtained directly from the reaction vectors. -/
theorem dDNA_dt_eq_zero (κ : Network.RateConstants N) (x : Concentration Species) :
N.massActionVectorField κ x DNA = 0 := by
rw [Network.massActionVectorField_apply]
apply Finset.sum_eq_zero
intro r _
rw [reactionVector_DNA_zero r, mul_zero]
end CRNT.Examples.GeneExpression